工业互联网平台脚手架前端代码
houzhongjian
2024-09-18 23db5e5c6bfcbd7030a4003cd4ea18fbb920024f
1
import{d as $,u as M,r as d,A as N,b as Q,P as W,a as e,o,g as v,B as r,k as t,c as _,i as b,a3 as Y,N as j,F as y,O as q,h as z,Q as I,R as Z,S as D,T as G,a7 as H,W as J,am as K,V as X,Z as ee,$ as ae}from"./index-CHTXMeh8.js";import{E as le}from"./el-card-Bdk9qx7q.js";import{c as re}from"./index-BV2p1r3n.js";import{u as te}from"./tagsView-C8yDzF3Q.js";import{a as se}from"./index-BnVkKGRw.js";import{g as ue}from"./index-DYclHsjD.js";const de=$({name:"BpmOALeaveCreate",__name:"create",setup(oe){const V=I(),{delView:x}=te(),{push:O,currentRoute:B}=M(),c=d(!1),s=d({type:void 0,reason:void 0,startTime:void 0,endTime:void 0}),E=N({type:[{required:!0,message:"\u8BF7\u5047\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],reason:[{required:!0,message:"\u8BF7\u5047\u539F\u56E0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],startTime:[{required:!0,message:"\u8BF7\u5047\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}],endTime:[{required:!0,message:"\u8BF7\u5047\u7ED3\u675F\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}),g=d(),i=d([]),p=d({}),h=d(),T=d({}),k=d([]),L=async()=>{var m,l;if(g&&await g.value.validate()){((m=i.value)==null?void 0:m.length)>0&&await h.value.validate(),c.value=!0;try{const u={...s.value};((l=i.value)==null?void 0:l.length)>0&&(u.startUserSelectAssignees=p.value),await re(u),V.success("\u53D1\u8D77\u6210\u529F"),x(e(B)),await O({name:"BpmOALeave"})}finally{c.value=!1}}};return Q(async()=>{var l;const m=await se(void 0,"oa_leave");if(m){if(i.value=m.startUserSelectTasks,((l=i.value)==null?void 0:l.length)>0){for(const u of i.value)p.value[u.id]=[],T.value[u.id]=[{required:!0,message:"\u8BF7\u9009\u62E9\u5BA1\u6279\u4EBA",trigger:"blur"}];k.value=await ue()}}else V.error("OA \u8BF7\u5047\u7684\u6D41\u7A0B\u6A21\u578B\u672A\u914D\u7F6E\uFF0C\u8BF7\u68C0\u67E5\uFF01")}),(m,l)=>{const u=ae,U=Z,n=D,w=G,R=H,A=J,S=le,P=K,C=X,F=ee;return W((o(),v(A,{ref_key:"formRef",ref:g,model:e(s),rules:e(E),"label-width":"80px"},{default:r(()=>[t(n,{label:"\u8BF7\u5047\u7C7B\u578B",prop:"type"},{default:r(()=>[t(U,{modelValue:e(s).type,"onUpdate:modelValue":l[0]||(l[0]=a=>e(s).type=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u8BF7\u5047\u7C7B\u578B"},{default:r(()=>[(o(!0),_(y,null,b(e(Y)(e(j).BPM_OA_LEAVE_TYPE),a=>(o(),v(u,{key:a.value,label:a.label,value:a.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(n,{label:"\u5F00\u59CB\u65F6\u95F4",prop:"startTime"},{default:r(()=>[t(w,{modelValue:e(s).startTime,"onUpdate:modelValue":l[1]||(l[1]=a=>e(s).startTime=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65F6\u95F4",type:"datetime","value-format":"x"},null,8,["modelValue"])]),_:1}),t(n,{label:"\u7ED3\u675F\u65F6\u95F4",prop:"endTime"},{default:r(()=>[t(w,{modelValue:e(s).endTime,"onUpdate:modelValue":l[2]||(l[2]=a=>e(s).endTime=a),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65F6\u95F4",type:"datetime","value-format":"x"},null,8,["modelValue"])]),_:1}),t(n,{label:"\u539F\u56E0",prop:"reason"},{default:r(()=>[t(R,{modelValue:e(s).reason,"onUpdate:modelValue":l[3]||(l[3]=a=>e(s).reason=a),placeholder:"\u8BF7\u8F93\u8BF7\u5047\u539F\u56E0",type:"textarea"},null,8,["modelValue"])]),_:1}),e(i).length>0?(o(),v(P,{key:0},{default:r(()=>[t(S,{class:"mb-10px"},{header:r(()=>[q("\u6307\u5B9A\u5BA1\u6279\u4EBA")]),default:r(()=>[t(A,{model:e(p),rules:e(T),ref_key:"startUserSelectAssigneesFormRef",ref:h},{default:r(()=>[(o(!0),_(y,null,b(e(i),a=>(o(),v(n,{key:a.id,label:`\u4EFB\u52A1\u3010${a.name}\u3011`,prop:a.id},{default:r(()=>[t(U,{modelValue:e(p)[a.id],"onUpdate:modelValue":f=>e(p)[a.id]=f,multiple:"",placeholder:"\u8BF7\u9009\u62E9\u5BA1\u6279\u4EBA"},{default:r(()=>[(o(!0),_(y,null,b(e(k),f=>(o(),v(u,{key:f.id,label:f.nickname,value:f.id},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["label","prop"]))),128))]),_:1},8,["model","rules"])]),_:1})]),_:1})):z("",!0),t(n,null,{default:r(()=>[t(C,{disabled:e(c),type:"primary",onClick:L},{default:r(()=>[q("\u786E \u5B9A")]),_:1},8,["disabled"])]),_:1})]),_:1},8,["model","rules"])),[[F,e(c)]])}}});export{de as default};