2 lines
6.5 KiB
JavaScript
Raw Permalink Normal View History

2025-06-02 21:34:56 +08:00
var e=Object.defineProperty,a=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable,o=(a,l,t)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[l]=t;import{C as n,d as r,r as u,O as d,S as i,j as s,H as m,c as p,o as c,F as f,e as g,R as v,k as b,w as y,l as h,m as _,h as V,P as k,f as w,Q as C}from"./index-C-c3zR6K.js";import{l as S,g as I,d as N,u as O,a as x}from"./data-Ds2MkwTF.js";const D={class:"app-container"},P={class:"dialog-footer"},j=n({name:"Data"}),q=Object.assign(j,{setup(e){const{proxy:n}=r(),j=u([]),q=u(!1),U=u(!0),F=u(!0),R=u([]),$=u(!0),J=u(!0),K=u(0),T=u(""),z=d({form:{},queryParams:{pageNum:1,pageSize:10,formId:null,formVersion:null,dataContent:null,status:null,formName:null,userName:null},rules:{formId:[{required:!0,message:"关联的表单ID不能为空",trigger:"blur"}],formVersion:[{required:!0,message:"表单版本不能为空",trigger:"blur"}],dataContent:[{required:!0,message:"表单数据内容不能为空",trigger:"blur"}],status:[{required:!0,message:"数据状态不能为空",trigger:"change"}]}}),{queryParams:B,form:E,rules:Q}=i(z);function H(){U.value=!0,S(B.value).then((e=>{j.value=e.rows,K.value=e.total,U.value=!1}))}function A(){q.value=!1,G()}function G(){E.value={dataId:null,formId:null,formVersion:null,dataContent:null,status:null,createBy:null,createTime:null,updateBy:null,updateTime:null,remark:null,delFlag:null}}function L(){B.value.pageNum=1,H()}function M(){n.resetForm("queryRef"),L()}function W(e){R.value=e.map((e=>e.dataId)),$.value=1!=e.length,J.value=!e.length}function X(){G(),q.value=!0,T.value="添加单数据"}const Y=u();function Z(e){G();const a=e.dataId||R.value;I(a).then((e=>{E.value=e.data,q.value=!0,T.value="修改单数据",C((()=>{Y.value.setFormJson(JSON.parse(E.value.formSchema)),Y.value.setFormData(JSON.parse(E.value.dataContent))}))}))}function ee(){Y.value.getFormData().then((e=>{E.value.dataContent=JSON.stringify(e),null!=E.value.dataId?O(E.value).then((e=>{n.$modal.msgSuccess("修改成功"),q.value=!1,H()})):x(E.value).then((e=>{n.$modal.msgSuccess("新增成功"),q.value=!1,H()}))}))}function ae(e){const a=e.dataId||R.value;n.$modal.confirm('是否确认删除单数据编号为"'+a+'"的数据项?').then((function(){return N(a)})).then((()=>{H(),n.$modal.msgSuccess("删除成功")})).catch((()=>{}))}function le(){n.download("form/data/export",((e,n)=>{for(var r in n||(n={}))l.call(n,r)&&o(e,r,n[r]);if(a)for(var r of a(n))t.call(n,r)&&o(e,r,n[r]);return e})({},B.value),`data_${(new Date).getTime()}.xlsx`)}return H(),(e,a)=>{const l=s("el-input"),t=s("el-form-item"),o=s("el-button"),n=s("el-form"),r=s("el-col"),u=s("right-toolbar"),d=s("el-row"),i=s("el-table-column"),C=s("el-table"),S=s("pagination"),I=s("v-form-render"),N=s("el-dialog"),O=m("hasPermi"),x=m("loading");return c(),p("div",D,[f(g(n,{model:b(B),ref:"queryRef",inline:!0,"label-width":"68px"},{default:y((()=>[g(t,{label:"关联的表单ID",prop:"formId"},{default:y((()=>[g(l,{modelValue:b(B).formId,"onUpdate:modelValue":a[0]||(a[0]=e=>b(B).formId=e),placeholder:"请输入关联的表单ID",clearable:"",onKeyup:h(L,["enter"])},null,8,["modelValue"])])),_:1}),g(t,{label:"表单版本",prop:"formVersion"},{default:y((()=>[g(l,{modelValue:b(B).formVersion,"onUpdate:modelValue":a[1]||(a[1]=e=>b(B).formVersion=e),placeholder:"请输入表单版本",clearable:"",onKeyup:h(L,["enter"])},null,8,["modelValue"])])),_:1}),g(t,{label:"表单名称",prop:"formName"},{default:y((()=>[g(l,{modelValue:b(B).formName,"onUpdate:modelValue":a[2]||(a[2]=e=>b(B).formName=e),placeholder:"请输入表单名称",clearable:"",onKeyup:h(L,["enter"])},null,8,["modelValue"])])),_:1}),g(t,{label:"用户账号",prop:"userName"},{default:y((()=>[g(l,{modelValue:b(B).userName,"onUpdate:modelValue":a[3]||(a[3]=e=>b(B).userName=e),placeholder:"请输入用户账号",clearable:"",onKeyup:h(L,["enter"])},null,8,["modelValue"])])),_:1}),g(t,null,{default:y((()=>[g(o,{type:"primary",icon:"Search",onClick:L},{default:y((()=>a[8]||(a[8]=[_("搜索")]))),_:1}),g(o,{i