数通互联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
2.5 KiB

import{d as O,r as n,I as y,e as h,ah as R,G as S,o as M,z as N,a as c,c as z,g as p,j as _,u as G,w as W,l as A,S as b,q as C,D as u,V as I,B as f,m,E as H,h as J}from"./index-ea7eee8a.js";const Q=O({__name:"content",setup(K){const g=J(),i=n(),D=n(!0),a=y({searchData:[],tableData:[],dict:{},visible:!0,source:""}),v=h(()=>g.query.id),k=()=>{if(!v.value)return b.error("非法操作..."),!1;const e={id:v.value};C("designById",e).then(s=>{const o=s.data;o&&Object.keys(o).length&&(a.searchData=u(o.data),a.tableData=u(o.listData),a.dict=I(o.dict),a.source=o.source,f(()=>{i.value.getListData(),D.value=!1}),w())})};R(()=>{B()});const B=S(()=>g.query.id,()=>{k()},{}),l=n(),t=y({visible:!1,title:"",formType:1,formData:{},width:"",dict:{},editId:""}),r=h(()=>{var e;return a.source&&((e=a.tableData.config)==null?void 0:e.openType)==="dialog"}),w=()=>{var e;r.value&&(t.width=(e=a.tableData.config)==null?void 0:e.dialogWidth,C("designById",{id:a.source}).then(s=>{const o=s.data;o&&Object.keys(o).length&&(t.formData=u(o.data),t.dict=I(o.dict))}).catch(s=>{b.error(s.message||"非法操作.")}))},E=(e,s)=>{var o;(e.key==="add"||e.key==="edit")&&r.value&&(t.visible=!0,t.title=e.key==="add"?"新增":"编辑",t.formType=e.key==="add"?1:2,t.editId=s&&s.id,e.key==="add"&&((o=t.formData.config)!=null&&o.addLoad)&&f(()=>{l.value.getData({formId:a.source})}),e.key==="edit"&&f(()=>{l.value.getData({formId:a.source,id:s.id})}))},L=e=>(e.formId=a.source,e.id=t.editId,e),q=e=>{e==="success"&&(d(),i.value.getListData())},T=e=>{(e==="reset"||e==="cancel")&&d()},U=e=>{d(),e&&e()},d=()=>{t.visible=!1,t.editId=""};return M(()=>{k()}),(e,s)=>{const o=m("ak-list"),V=m("ak-form"),j=m("el-dialog"),x=H("loading");return N((c(),z("div",null,[a.visible?(c(),p(o,{key:0,ref_key:"listEl",ref:i,searchData:a.searchData,tableData:a.tableData,dict:a.dict,formId:a.source,requestUrl:"getContentList",deleteUrl:"delFormContent",autoLoad:!1,onBtnClick:E},null,8,["searchData","tableData","dict","formId"])):_("",!0),G(r)?(c(),p(j,{key:1,"destroy-on-close":"",modelValue:t.visible,"onUpdate:modelValue":s[0]||(s[0]=F=>t.visible=F),title:t.title,width:t.width||"600px","before-close":U},{default:W(()=>[A(V,{ref_key:"formEl",ref:l,formData:t.formData,dict:t.dict,type:t.formType,requestUrl:"getFormContent",addUrl:"saveFormContent",editUrl:"editFormContent",beforeSubmit:L,afterSubmit:q,onBtnClick:T},null,8,["formData","dict","type"])]),_:1},8,["modelValue","title","width"])):_("",!0)])),[[x,D.value]])}}});export{Q as default};