niucloud-admin/niucloud/public/admin/assets/agreement_edit-39a55be8.js
全栈小学生 0e47055ccb v1.0.0-beta.1
2023-04-15 17:12:49 +08:00

2 lines
4.3 KiB
JavaScript

/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as F}from"./index.vue_vue_type_script_setup_true_lang-0079e90b.js";/* empty css */import{u as q,t as i}from"./index-5f4ce139.js";import{w as A,x as I}from"./sys-aa893c6b.js";import{u as N,a as T}from"./vue-router-b5675730.js";import{x as U}from"./index-aae906bf.js";import{E as $}from"./index-95693143.js";import{a as j,E as L}from"./index-624573cc.js";import{E as O}from"./index-acd12562.js";import{E as P}from"./index-4862d1b3.js";import{v as X}from"./directive-a07a10ed.js";import{d as M,r as c,w as z,M as G,c as H,b as y,e as J,L as K,m as Q,p as l,q as r,u as n,f as k,v as w,x as h}from"./runtime-core.esm-bundler-7c3fd514.js";import"./index.vue_vue_type_style_index_0_lang-a42d8a18.js";/* empty css */import"./el-overlay-f7f710bd.js";import"./plugin-vue_export-helper-edbdb6f8.js";import"./index-f02197a7.js";import"./index-868cd458.js";import"./index-a3cf5375.js";import"./event-9519ab40.js";import"./focus-trap-bb1e8c7a.js";import"./index-7b0897f9.js";import"./error-492b6a5b.js";import"./attachment-51c3470b.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index-be5dc120.js";import"./index-2083be2e.js";import"./index-be5868d6.js";import"./index-cf47f151.js";import"./common-465e36b3.js";import"./index-548a7823.js";import"./validator-62f68fe3.js";import"./index-c656f08b.js";import"./index-2f0b1bf3.js";import"./index-9bac81c5.js";import"./index-f97852b4.js";import"./el-switch-3d36d31d.js";import"./index-47617222.js";import"./index-381e0c1f.js";import"./index-470ade69.js";import"./isEqual-f40f939e.js";import"./_Uint8Array-de4f83bb.js";import"./flatten-b3585bb8.js";import"./index-800b62de.js";import"./index-9fbce820.js";import"./index-2804b007.js";import"./index-4683bff4.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./common-cc37bda4.js";import"./common-2cf17469.js";import"./el-radio-c9a1047c.js";import"./el-avatar-7d17482e.js";import"./_baseClone-cf40e5b2.js";import"./_initCloneObject-bc5ed9bb.js";const W={class:"main-container"},Y={class:"fixed-footer-wrap"},Z={class:"fixed-footer"},_e=M({__name:"agreement_edit",setup(tt){const d=q(),u=N(),x=T(),f=u.query.key||"",a=c(!1);c([]);const V=U();d.pageReturn=!0,z(u,(p,t)=>{d.pageReturn=!1});const _={agreement_key:"",content:"",title:"",agreement_key_name:""},e=G({..._});a.value=!0,f&&(async(p="")=>{Object.assign(e,_);const t=await(await A(p)).data;Object.keys(e).forEach(o=>{t[o]!=null&&(e[o]=t[o])}),a.value=!1})(f);const v=c(),E=H(()=>({title:[{required:!0,message:i("titlePlaceholder"),trigger:"blur"}]})),R=async p=>{a.value||!p||await p.validate(async t=>{if(t){a.value=!0;const o=e;o.key=e.agreement_key,I(o).then(s=>{a.value=!1,g()}).catch(()=>{a.value=!1})}})},g=()=>{V.removeTab(u.path),x.push({path:"/setting/agreement"})};return(p,t)=>{const o=$,s=j,D=F,S=L,B=O,b=P,C=X;return y(),J("div",W,[K((y(),Q(B,{class:"box-card !border-none",shadow:"never"},{default:l(()=>[r(S,{model:e,"label-width":"90px",ref_key:"formRef",ref:v,rules:n(E),class:"page-form"},{default:l(()=>[r(s,{label:n(i)("type")},{default:l(()=>[r(o,{modelValue:e.agreement_key_name,"onUpdate:modelValue":t[0]||(t[0]=m=>e.agreement_key_name=m),readonly:"",class:"input-width"},null,8,["modelValue"])]),_:1},8,["label"]),r(s,{label:n(i)("title"),prop:"title"},{default:l(()=>[r(o,{modelValue:e.title,"onUpdate:modelValue":t[1]||(t[1]=m=>e.title=m),clearable:"",placeholder:n(i)("titlePlaceholder"),class:"input-width",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),r(s,{label:n(i)("content")},{default:l(()=>[r(D,{modelValue:e.content,"onUpdate:modelValue":t[2]||(t[2]=m=>e.content=m)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1})),[[C,a.value]]),k("div",Y,[k("div",Z,[r(b,{type:"primary",onClick:t[3]||(t[3]=m=>R(v.value))},{default:l(()=>[w(h(n(i)("save")),1)]),_:1}),r(b,{onClick:t[4]||(t[4]=m=>g())},{default:l(()=>[w(h(n(i)("cancel")),1)]),_:1})])])])}}});export{_e as default};