You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
4.8KB

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