2 lines
3.6 KiB
JavaScript
2 lines
3.6 KiB
JavaScript
import{G as $,H as j,C as q,I as K,K as P,B as G,a2 as H,a3 as Q,D as Z,L as z}from"./element-plus.2acb577d.js";import{_ as A}from"./index.vue_vue_type_style_index_0_lang.9e5f7fb0.js";import{a as J,b as M}from"./oa_flow.d67349c4.js";import{a as W,f as x}from"./index.81df6f20.js";import{Z as X,r as m,o as s,K as c,L as l,R as Y,U as o,u as ee,c as y,T as E,a9 as V,Q as ae,n as le}from"./@vue.821a47ec.js";const te={key:0},ie={__name:"index",props:{formData:{type:Object,required:!0},flow_cate:{type:Number},type:{type:Number}},setup(n){const r=n,C=X({flow_id:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:["blur"]}],check_admin_names:[{required:!0,message:"\u4E0D\u53EF\u4E3A\u7A7A",trigger:["blur"]}]}),u=m(!1),v=m(null),d=m(2),k=W().userInfo,g=async a=>{d.value=a,u.value=!0,await le(),v.value.open()},L=a=>{if(d.value==1){if(a.id==k.id)return u.value=!1,x.msgError("\u5BA1\u6838\u4EBA\u4E0D\u80FD\u4E3A\u81EA\u5DF1");r.formData.check_admin_names=a.name,r.formData.check_admin_ids=a.id}else{if(a.map(e=>e.id).includes(k.id))return u.value=!1,x.msgError("\u6284\u9001\u4EBA\u4E0D\u80FD\u5305\u542B\u81EA\u5DF1");r.formData.copy_names=a.map(e=>e.name).join(","),r.formData.copy_uids=a.map(e=>e.id).join(",")}u.value=!1},_=m([]);(async()=>{const a=await J({flow_cate:r.flow_cate,type:r.type});_.value=a.lists})();const D=m(2),b=m([]),T=async a=>{const e=_.value.find(i=>i.id===a);if(D.value=e.check_type,e.check_type!=2){r.formData.check_admin_names="",r.formData.check_admin_ids="";let i=await M({id:e.id});b.value=i.flow_list}},F=(a,e)=>{if(a==1)return"\u5F53\u524D\u90E8\u95E8\u8D1F\u8D23\u4EBA";if(a==2)return"\u6216\u7B7E";if(a==3)return"\u4F1A\u7B7E";if(a==4)return e.flow_name};return(a,e)=>{const i=$,N=j,p=q,f=K,w=P,h=G,S=H,U=Q,B=A,I=Z,O=z;return s(),c(O,null,{header:l(()=>e[5]||(e[5]=[Y(" \u5BA1\u6279\u6D41\u7A0B ")])),default:l(()=>[o(I,{ref:"formRef",model:n.formData,"label-width":"100px",rules:ee(C)},{default:l(()=>[o(w,null,{default:l(()=>[o(f,{span:12},{default:l(()=>[o(p,{label:"\u5BA1\u6279\u6D41\u7A0B",prop:"flow_id"},{default:l(()=>[o(N,{modelValue:n.formData.flow_id,"onUpdate:modelValue":e[0]||(e[0]=t=>n.formData.flow_id=t),placeholder:"\u9009\u62E9\u5BA1\u6279\u6D41\u7A0B",class:"flex-1",onChange:T},{default:l(()=>[(s(!0),y(E,null,V(_.value,t=>(s(),c(i,{label:t.name,value:t.id},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),o(w,null,{default:l(()=>[D.value==2?(s(),c(f,{key:0,span:12},{default:l(()=>[o(p,{label:"\u5BA1\u6838\u4EBA",prop:"check_admin_names"},{default:l(()=>[o(h,{modelValue:n.formData.check_admin_names,"onUpdate:modelValue":e[1]||(e[1]=t=>n.formData.check_admin_names=t),clearable:"",placeholder:"\u70B9\u51FB\u9009\u62E9\u5BA1\u6838\u4EBA",readonly:"",onClick:e[2]||(e[2]=t=>g(1))},null,8,["modelValue"])]),_:1})]),_:1})):(s(),c(f,{key:1,style:{"max-height":"400px","min-height":"200px","margin-left":"30px"}},{default:l(()=>[o(U,{direction:"vertical",active:0},{default:l(()=>[(s(!0),y(E,null,V(b.value,(t,R)=>(s(),c(S,{title:R+1+`\u7EA7\u5BA1\u6838(${F(t.flow_type,t)})`,description:t.flow_user_names},null,8,["title","description"]))),256))]),_:1})]),_:1}))]),_:1}),o(w,null,{default:l(()=>[o(f,{span:12},{default:l(()=>[o(p,{label:"\u6284\u9001\u4EBA"},{default:l(()=>[o(h,{modelValue:n.formData.copy_names,"onUpdate:modelValue":e[3]||(e[3]=t=>n.formData.copy_names=t),clearable:"",placeholder:"\u70B9\u51FB\u9009\u62E9\u6284\u9001\u4EBA",readonly:"",onClick:e[4]||(e[4]=t=>g(2))},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),u.value?(s(),y("div",te,[o(B,{ref_key:"personnel",ref:v,onConfirm:L,type:d.value},null,8,["type"])])):ae("",!0)]),_:1},8,["model","rules"])]),_:1})}}};export{ie as _};
|