2 lines
2.6 KiB
JavaScript
2 lines
2.6 KiB
JavaScript
var g=Object.defineProperty;var m=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var f=(u,t,e)=>t in u?g(u,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):u[t]=e,w=(u,t)=>{for(var e in t||(t={}))I.call(t,e)&&f(u,e,t[e]);if(m)for(var e of m(t))b.call(t,e)&&f(u,e,t[e]);return u};var p=(u,t,e)=>new Promise((l,n)=>{var c=r=>{try{o(e.next(r))}catch(s){n(s)}},d=r=>{try{o(e.throw(r))}catch(s){n(s)}},o=r=>r.done?l(r.value):Promise.resolve(r.value).then(c,d);o((e=e.apply(u,t)).next())});import{B}from"./BasicForm.2c365a17.js";import{u as _}from"./useForm.266d6458.js";import{a as h,B as x}from"./index.bc0989a7.js";import{a as v,v as C,f as y,k as i,o as E,j as k,z as q,n as A,aH as S,cT as P,cU as R}from"./index.15bf95a0.js";const H=[{title:"\u8857\u9547\u540D\u79F0",dataIndex:"name"},{title:"\u8857\u9547\u5730\u5740",dataIndex:"address"},{title:"\u8857\u9547\u9762\u79EF",dataIndex:"areas"},{title:"\u8857\u9547\u5C31\u4E1A\u4EBA\u6570",dataIndex:"workforce"},{title:"\u8857\u9547\u63CF\u8FF0",dataIndex:"description"},{width:180,title:"\u64CD\u4F5C",dataIndex:"action",align:"center",fixed:void 0}],T=[{field:"id",label:"\u8857\u9547ID",required:!1,dynamicDisabled:!0,component:"Input",ifShow:({values:u})=>!!u.id},{field:"name",label:"\u8857\u9547\u540D\u79F0",required:!0,component:"Input"},{field:"address",label:"\u8857\u9547\u5730\u5740",required:!0,component:"Input"},{field:"areas",label:"\u8857\u9547\u9762\u79EF",required:!0,component:"Input"},{field:"workforce",label:"\u8857\u9547\u4EBA\u6570",required:!0,component:"Input"},{field:"description",label:"\u8857\u9547\u4ECB\u7ECD",required:!1,component:"InputTextArea"}],j=v({__name:"DeviceDrawer",emits:["success","register"],setup(u,{emit:t}){const e=C(!1),l=y(()=>e.value?"\u7F16\u8F91\u8857\u9547":"\u65B0\u589E\u8857\u9547"),[n,{resetFields:c,setFieldsValue:d,validate:o}]=_({labelWidth:120,baseColProps:{span:24},schemas:T,showActionButtonGroup:!1}),[r,{setDrawerProps:s,closeDrawer:F}]=h(a=>p(this,null,function*(){c(),s({confirmLoading:!1}),e.value=a==null?void 0:a.isUpdate,i(e)&&d(w({},a))})),D=()=>p(this,null,function*(){try{const a=yield o();a.type=2,a.id?yield P(a.id,a):yield R(a),F(),t("success")}finally{s({confirmLoading:!1})}});return(a,G)=>(E(),k(i(x),S(a.$attrs,{onRegister:i(r),showFooter:"",title:i(l),width:"500px",onOk:D}),{default:q(()=>[A(i(B),{onRegister:i(n)},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}});var M=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"}));export{M as D,j as _,H as c};
|