2 lines
3.4 KiB
JavaScript
2 lines
3.4 KiB
JavaScript
import{d as R,O as $,f as I,r as y,cN as P,n as S,q as T,N as l,h as k,c as j,a as r,u as a,t as p,y as q,I as O,w as m,e as s,i as x,W as U,X as A,Y as z,$ as L,E as M,a0 as W}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as X}from"./index.vue_vue_type_script_setup_true_lang-d9adee77.js";import"./el-form-item-4ed993c7.js";/* empty css */import{M as Y,N as G}from"./sys-8ead7f22.js";import"./index.vue_vue_type_style_index_0_lang-5c6c00d9.js";/* empty css */import"./attachment-c69dd9fd.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./index.vue_vue_type_script_setup_true_lang-9285296e.js";/* empty css */const H={class:"main-container"},J={class:"detail-head"},K=r("span",{class:"iconfont iconxiangzuojiantou !text-xs"},null,-1),Q={class:"ml-[1px]"},Z=r("span",{class:"adorn"},"|",-1),ee={class:"right"},te={class:"fixed-footer-wrap"},ae={class:"fixed-footer"},Pe=R({__name:"agreement_edit",setup(oe){const u=$(),_=I(),f=u.query.key||"",i=y(!1),V=P(),w=u.meta.title,g={agreement_key:"",content:"",title:"",agreement_key_name:""},t=S({...g});i.value=!0,f&&(async(c="")=>{Object.assign(t,g);const e=await(await Y(c)).data;Object.keys(t).forEach(o=>{e[o]!=null&&(t[o]=e[o])}),i.value=!1})(f);const v=y(),E=T(()=>({title:[{required:!0,message:l("titlePlaceholder"),trigger:"blur"}]})),N=async c=>{i.value||!c||await c.validate(async e=>{if(e){i.value=!0;const o=t;o.key=t.agreement_key,G(o).then(d=>{i.value=!1,b()}).catch(()=>{i.value=!1})}})},b=()=>{V.removeTab(u.path),_.push({path:"/setting/agreement"})};return(c,e)=>{const o=U,d=A,C=X,D=z,B=L,h=M,F=W;return k(),j("div",H,[r("div",J,[r("div",{class:"left",onClick:e[0]||(e[0]=n=>a(_).push({path:"/setting/agreement"}))},[K,r("span",Q,p(a(l)("returnToPreviousPage")),1)]),Z,r("span",ee,p(a(w)),1)]),q((k(),O(B,{class:"box-card !border-none",shadow:"never"},{default:m(()=>[s(D,{model:t,"label-width":"90px",ref_key:"formRef",ref:v,rules:a(E),class:"page-form"},{default:m(()=>[s(d,{label:a(l)("type")},{default:m(()=>[s(o,{modelValue:t.agreement_key_name,"onUpdate:modelValue":e[1]||(e[1]=n=>t.agreement_key_name=n),readonly:"",class:"input-width"},null,8,["modelValue"])]),_:1},8,["label"]),s(d,{label:a(l)("title"),prop:"title"},{default:m(()=>[s(o,{modelValue:t.title,"onUpdate:modelValue":e[2]||(e[2]=n=>t.title=n),clearable:"",placeholder:a(l)("titlePlaceholder"),class:"input-width",maxlength:"20"},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(d,{label:a(l)("content")},{default:m(()=>[s(C,{modelValue:t.content,"onUpdate:modelValue":e[3]||(e[3]=n=>t.content=n)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model","rules"])]),_:1})),[[F,i.value]]),r("div",te,[r("div",ae,[s(h,{type:"primary",onClick:e[4]||(e[4]=n=>N(v.value))},{default:m(()=>[x(p(a(l)("save")),1)]),_:1}),s(h,{onClick:e[5]||(e[5]=n=>b())},{default:m(()=>[x(p(a(l)("cancel")),1)]),_:1})])])])}}});export{Pe as default};
|