|
- import{G as q,E as J,y as W,r,a as z,$ as b,o as G,b as n,c as m,d as f,f as l,h as s,e as _,i as y,j as v,t as T,M as K,k as Q,s as X}from"./index-dd5fae99.js";import{a as Y,e as Z,f as ee,g as te}from"./flowConfiguration-e3261cd3.js";import{d as oe,p as ae}from"./flowPathConfiguration-3512bcb6.js";const le={class:"flex justify-between items-center"},se=["onClick"],ne=["onClick"],re=["onClick"],de=["onClick"],ie=Q({name:"flowPathConfiguration"}),we=Object.assign(ie,{setup(pe){const{proxy:d}=X(),g=q(J.userStore).userInfo||{},V=W(),w=r(),S=z([{label:"序号",type:"index",width:"80"},{label:"流程名称",key:"processDefName",prop:"processDefName",minWidth:"200"},{label:"流程类型",key:"type",width:"140",render:t=>b("span",t.type==="DEFAULT"?"默认流程":t.type==="SEAL"?"盖章流程":t.type==="JOINT_REVIEW"?"重大项目联审流程":"其他流程")},{label:"状态",key:"isStop",width:"80",render:t=>[b("span",{class:["dot mr-4",`${t.isStop?"bg-danger":"bg-success"}`]}),b("span",{class:t.isStop?"text-danger":"text-success"},t.isStop?"禁用":"启用")]},{label:"创建时间",key:"created",prop:"created",width:"240"},{label:"操作",slot:"action",fixed:"right",width:"270"}]),k=r([]),C=r(0),i=async(t=w.value.pageParams)=>{const e=await Y({...t,orgCode:g.value.empPosUnitCode});C.value=e.data.total,k.value=e.data.records},N=t=>{V.push({name:"unitConfigEdit",query:{processDefId:t.processDefId}})},R=t=>{d.$messageBox.confirm("是否删除该流程?","提示!",{type:"warning"}).then(async()=>{await oe({processDefId:t.processDefId}),d.$message.success("删除成功!"),i()})},$=t=>{const e=t.isStop?"启用":"禁用";d.$messageBox.confirm(`是否${e}该流程?`,"提示!",{type:"warning"}).then(async()=>{e==="启用"?await Z({processDefId:t.processDefId}):await ee({processDefId:t.processDefId}),d.$message.success(`${e}成功!`),i()})},u=r(!1),E=r(),D=async t=>{if(u.value=!0,E.value=t?"编辑信息":"新增流程",t&&t.processDefId){const e=await ae({processDefId:t.processDefId});a.value={...e.data,isEnable:!e.data.isStop}}else a.value={isEnable:!0,type:"OTHER"}},x=r(),ue=r({DEFAULT:"默认流程",SEAL:"盖章流程",OTHER:"其他流程",JOINT_REVIEW:"重大项目联审流程"}),B={processDefName:[{required:!0,message:"请填写流程名称",trigger:"blur"}],type:[{required:!0,message:"请选择流程类型",trigger:"change"}]},a=r({type:"OTHER"}),F=async t=>{t&&await t.validate(async e=>{if(e){const p={...a.value,process:a.value.process?JSON.parse(a.value.process):void 0,orgCode:g.value.empPosUnitCode,isStop:!a.value.isEnable};await te(p),d.$message.success("提交成功!"),i(),u.value=!1,a.value={type:"OTHER"}}})},h=()=>{u.value=!1};return G(()=>{i()}),(t,e)=>{const p=n("el-button"),O=n("table-list"),L=n("el-card"),H=n("el-input"),I=n("el-form-item"),U=n("el-col"),ce=n("el-radio"),me=n("el-radio-group"),j=n("el-row"),P=n("el-switch"),A=n("el-form"),M=n("el-dialog");return m(),f("div",null,[l(L,{shadow:"never"},{header:s(()=>[_("div",le,[e[6]||(e[6]=_("span",null,"流程列表",-1)),l(p,{type:"primary",icon:"Plus",size:"small",onClick:e[0]||(e[0]=()=>D())},{default:s(()=>e[5]||(e[5]=[y("增加流程")])),_:1})])]),default:s(()=>[l(O,{ref_key:"tableListRef",ref:w,column:S,data:k.value,total:C.value,onGetTableData:i},{action:s(({scope:o})=>[o.row.type==="OTHER"?(m(),f("a",{key:0,onClick:c=>D(o.row)},"编辑信息",8,se)):v("",!0),_("a",{onClick:c=>N(o.row)},"编辑流程",8,ne),o.row.type==="OTHER"?(m(),f("a",{key:1,onClick:c=>$(o.row)},T(o.row.isStop?"启用":"禁用"),9,re)):v("",!0),o.row.type==="OTHER"?(m(),f("a",{key:2,class:"text-danger",onClick:c=>R(o.row)},"删除",8,de)):v("",!0)]),_:1},8,["column","data","total"])]),_:1}),l(M,{"model-value":u.value,title:E.value,width:"600px",onClose:h},{footer:s(()=>[l(p,{type:"primary",onClick:e[4]||(e[4]=o=>F(x.value))},{default:s(()=>e[8]||(e[8]=[y(" 提交 ")])),_:1}),l(p,{onClick:h},{default:s(()=>e[9]||(e[9]=[y(" 关闭 ")])),_:1})]),default:s(()=>[l(A,{ref_key:"addFormRef",ref:x,model:a.value,rules:B,"label-width":"90px","label-suffix":":"},{default:s(()=>[l(j,null,{default:s(()=>[l(U,{span:24},{default:s(()=>[l(I,{label:"流程名称",prop:"processDefName"},{default:s(()=>[l(H,{modelValue:a.value.processDefName,"onUpdate:modelValue":e[1]||(e[1]=o=>a.value.processDefName=o),placeholder:"请填写 "},null,8,["modelValue"])]),_:1})]),_:1}),v("",!0)]),_:1}),l(I,{label:"状态",prop:"isEnable"},{default:s(()=>[l(P,{modelValue:a.value.isEnable,"onUpdate:modelValue":e[3]||(e[3]=o=>a.value.isEnable=o),style:{"--el-switch-on-color":"#4ecb74","--el-switch-off-color":"#ff3b30"}},null,8,["modelValue"]),e[7]||(e[7]=y(" ")),_("span",{style:K({color:a.value.isEnable?"#4ECB74":"#FF3B30"})},T(a.value.isEnable?"已启用":"已禁用"),5)]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value","title"])])}}});export{we as default};
|