mirror of
https://gitee.com/myxzgzs/boyue-kfcode-hasfj.git
synced 2025-06-21 17:19:36 +08:00
2 lines
7.2 KiB
JavaScript
2 lines
7.2 KiB
JavaScript
![]() |
import{C as se,a as de,d as fe,r as f,O,S as pe,j as i,H as Q,c as ce,o as p,F as c,e as l,R as z,k as a,w as t,l as ge,m as r,h as _,P as J,B as _e,f as ve,aw as be,Q as ye}from"./index-CrAWI0wi.js";import{a as ke}from"./data-BNqb1Obk.js";import{l as Ce,g as K,d as Ve,u as we,a as Se}from"./template--CvDN_PQ.js";const Ne={class:"app-container"},De={class:"dialog-footer"},Ie=se({name:"Template"}),$e=Object.assign(Ie,{setup(he){const L=de(),{proxy:g}=fe(),R=f([]),v=f(!1),N=f(!0),w=f(!0),D=f([]),T=f(!0),$=f(!0),I=f(0),F=f(""),s=O({formContentDialogVisible:!1,formSchema:"",formId:null}),A=O({form:{},queryParams:{pageNum:1,pageSize:10,formName:null},rules:{formName:[{required:!0,message:"表单名称不能为空",trigger:"blur"}],formVersion:[{required:!0,message:"表单版本不能为空",trigger:"blur"}],formStatus:[{required:!0,message:"发布状态不能为空",trigger:"change"}]}}),{queryParams:d,form:u,rules:H}=pe(A);function b(){N.value=!0,Ce(d.value).then(n=>{R.value=n.rows,I.value=n.total,N.value=!1})}function G(){v.value=!1,U()}function U(){u.value={formId:null,formName:null,formSchema:null,formVersion:null,formStatus:null,remark:null,createBy:null,createTime:null,updateBy:null,updateTime:null,delFlag:null},g.resetForm("templateRef")}function h(){d.value.pageNum=1,b()}function M(){g.resetForm("queryRef"),h()}function W(n){D.value=n.map(e=>e.formId),T.value=n.length!=1,$.value=!n.length}function X(){L.push("/tool/build")}function Y(n){be.openPage({path:"/tool/build",query:{id:n.formId}})}function q(n){U();const e=n.formId||D.value;K(e).then(C=>{u.value=C.data,v.value=!0,F.value="修改单模板"})}function Z(){g.$refs.templateRef.validate(n=>{n&&(u.value.formId!=null?we(u.value).then(e=>{g.$modal.msgSuccess("修改成功"),v.value=!1,b()}):Se(u.value).then(e=>{g.$modal.msgSuccess("新增成功"),v.value=!1,b()}))})}function P(n){const e=n.formId||D.value;g.$modal.confirm('是否确认删除单模板编号为"'+e+'"的数据项?').then(function(){return Ve(e)}).then(()=>{b(),g.$modal.msgSuccess("删除成功")}).catch(()=>{})}function ee(){g.download("form/template/export",{...d.value},`template_${new Date().getTime()}.xlsx`)}const B=f();function le(n){K(n.formId).then(e=>{s.formSchema=JSON.parse(e.data.formSchema||"{}"),s.formId=n.formId,s.formContentDialogVisible=!0})}function te(){ye(()=>{B.value.getFormData().then(n=>{const e=JSON.stringify(n);ke({formId:s.formId,dataContent:e}).then(()=>{s.formContentDialogVisible=!1,g.$modal.msgSuccess("提交成功")})})})}return b(),(n,e)=>{const C=i("el-input"),V=i("el-form-item"),m=i("el-button"),E=i("el-form"),S=i("el-col"),oe=i("right-toolbar"),ae=i("el-row"),y=i("el-table-column"),ne=i("el-link"),re=i("el-table"),me=i("pagination"),j=i("el-dialog"),ie=i("v-form-render"),k=Q("hasPermi"),ue=Q("loading");return p(),ce("div",Ne,[c(l(E,{model:a(d),ref:"queryRef",inline:!0,"label-width":"68px"},{default:t(()=>[l(V,{label:"表单名称",prop:"formName"},{default:t(()=>[l(C,{modelValue:a(d).formName,"onUpdate:modelValue":e[0]||(e[0]=o=>a(d).formName=o),placeholder:"请输入表单名称",clearable:"",onKeyup:ge(h,["enter"])},null,8,["modelValue"])]),_:1}),l(V,null,{default:t(()=>[l(m,{type:"primary",icon:"Search",onClick:h},{default:t(()=>e[10]||(e[10]=[r("搜索")])),_:1}),l(m,{icon:"Refresh",onClick:M},{default:t(()=>e[11]||(e[11]=[r("重置")])),_:1})]),_:1})]),_:1},8,["model"]),[[z,a(w)]]),l(ae,{gutter:10,class:"mb8"},{default:t(()=>[l(S,{span:1.5},{default:t(()=>[c((p(),_(m,{type:"primary",plain:"",icon:"Plus",onClick:X},{default:t(()=>e[12]||(e[12]=[r("新增")])),_:1})),[[k,["form:template:add"]]])]),_:1}),l(S,{span:1.5},{default:t(()=>[c((p(),_(m,{type:"success",plain:"",icon:"Edit",disabled:a(T),onClick:q},{default:t(()=>e[13]||(e[13]=[r("修改")])),_:1},8,["disabled"])),[[k,["form:template:edit"]]])]),_:1}),l(S,{span:1.5},{default:t(()=>[c((p(),_(m,{type:"danger",plain:"",icon:"Delete",disabled:a($),onClick:P},{default:t(()=>e[14]||(e[14]=[r("删除")])),_:1},8,["disabled"])),[[k,["form:template:remove"]]])]),_:1}),l(S,{span:1.5},{default:t(()=>[c((p(),_(m,{type:"w
|