数通互联化工云平台
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.4 KiB

import{d as O,u as R,r as c,I as y,a as h,ah as S,G as M,b as N,h as n,D as W,z,o as u,c as G,f as p,j as _,w as A,m as H,S as b,q as C,E as f,W as I,B as m}from"./index-3679850f.js";const P=O({__name:"content",setup(J){const g=R(),i=c(),D=c(!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=f(o.data),a.tableData=f(o.listData),a.dict=I(o.dict),a.source=o.source,m(()=>{i.value.getListData(),D.value=!1}),w())})};S(()=>{B()});const B=M(()=>g.query.id,()=>{k()},{}),l=c(),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=f(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)&&m(()=>{l.value.getData({formId:a.source})}),e.key==="edit"&&m(()=>{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 N(()=>{k()}),(e,s)=>{const o=n("ak-list"),j=n("ak-form"),x=n("el-dialog"),F=W("loading");return z((u(),G("div",null,[a.visible?(u(),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),r.value?(u(),p(x,{key:1,"destroy-on-close":"",modelValue:t.visible,"onUpdate:modelValue":s[0]||(s[0]=V=>t.visible=V),title:t.title,width:t.width||"600px","before-close":U},{default:A(()=>[H(j,{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)])),[[F,D.value]])}}});export{P as default};