|
- import{g as R,a as X}from"./getIsShowRegionTree.49e84d71.js";import{E as Y}from"./index.b0d7b20c.js";import{d as Z,s as ee}from"./earlyWarningManage.d437714e.js";import{p as le}from"./flowConfiguration.b9428b57.js";import{d as ae,r as f,o as te,c as i,e as c,f as y,h as e,i as a,u as E,I as b,k as h,F as oe,J as ue,g as _,t as j,j as C,x as ne}from"./index.20c8d60f.js";const re={class:"footerPage earlyWarningRule"},se={key:0,class:"flex items-center text-14"},me=_("span",{class:"mr-4"},"\u5F53\u6D41\u7A0B\u8FBE\u5230\u5BA1\u6838\u4EBA\uFF0C\u5230\u8FBE",-1),de=_("span",{class:"ml-4"},"\u5C0F\u65F6\u672A\u5904\u7406\u65F6\u81EA\u52A8\u53D1\u9001\u4E34\u671F\u63D0\u9192\uFF0C",-1),ie=_("span",null,"\u8D85\u8FC7",-1),pe={class:"ml-4"},ce={key:1,class:"flex items-center text-14"},_e=_("span",{class:"mr-4"},"\u5F53",-1),ve=_("span",{class:"ml-4"},"\u5C0F\u65F6\u672A\u5904\u7406\u65F6\u81EA\u52A8\u53D1\u9001\u4E34\u671F\u63D0\u9192\uFF0C",-1),fe=_("span",null,"\u8D85\u8FC7",-1),be=_("span",{class:"ml-4"},"\u5C0F\u65F6\u672A\u5904\u7406\u65F6\u81EA\u52A8\u53D1\u9001\u8D85\u671F\u63D0\u9192",-1),ge={class:"footer"},Ve=ae({name:"earlyWarningRule"}),ke=Object.assign(Ve,{setup(ye){const{proxy:x}=ne(),D=o=>{w.value=o.regionLevel===3?o.regionCode:void 0,N()},w=f(),O=f(),N=async()=>{const o=await Z(w.value);O.value=o.data,k.value.resetFields(),l.value={rule:[{}],noticeContent:u.value==="1"?"{projectName}\u7684{flowType}\u5728\u60A8\u7684\u5BA1\u6838\u8282\u70B9\u5DF2\u8D85\u8FC7{time}\u5C0F\u65F6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406\u3002":"\u8BF7\u5C3D\u5FEB\u5904\u7406{projectName}\u7684{stepName}\uFF0C\u5DF2\u505C\u7559{time}\u3002",adventContent:u.value==="1"?"{projectName}\u7684{flowType}\u5728\u60A8\u7684\u5BA1\u6838\u8282\u70B9\u5DF2\u8D85\u8FC7{time}\u5C0F\u65F6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406\u3002":"\u8BF7\u5C3D\u5FEB\u5904\u7406{projectName}\u7684{stepName}\uFF0C\u5DF2\u505C\u7559{time}\uFF0C\u5C06\u5728{time2}\u5C0F\u65F6\u540E\u8D85\u671F\u3002"},G(O.value.find(n=>n.ruleType===u.value*1)||{})},G=o=>{var n;l.value={...o,rule:o.rule?JSON.parse(o.rule).map(m=>({...m,notice:m.notice?m.notice.split(",").map(v=>v*1):[]})):[{}],noticeMethod:((n=o==null?void 0:o.noticeMethod)==null?void 0:n.split(",").map(m=>m*1))||void 0,noticeContent:o.noticeContent||l.value.noticeContent,adventContent:o.adventContent||l.value.adventContent,isOpen:o.isOpen||!1}},u=f("1"),z=o=>{u.value=o,N()},k=f(),l=f({rule:[{}],noticeContent:"{projectName}\u7684{flowType}\u5728\u60A8\u7684\u5BA1\u6838\u8282\u70B9\u5DF2\u8D85\u8FC7{time}\u5C0F\u65F6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406\u3002",adventContent:"{projectName}\u7684{flowType}\u5728\u60A8\u7684\u5BA1\u6838\u8282\u70B9\u5DF2\u8D85\u8FC7{time}\u5C0F\u65F6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406\u3002"}),P={noticeMethod:[{required:!0,message:"\u8BF7\u9009\u62E9"}],noticeContent:[{required:!0,message:"\u8BF7\u8F93\u5165"}],adventContent:[{required:!0,message:"\u8BF7\u8F93\u5165"}],isOpen:[{required:!0,type:Boolean}]},T=f(!1),S=async o=>{!o||await o.validate(async n=>{if(n){T.value=!0;const m=l.value.rule.map(g=>{var d;return{...g,notice:(d=g.notice)!=null&&d.length?g.notice.join(","):void 0}}),v={...l.value,ruleType:u.value*1,areaCode:w.value,rule:JSON.stringify(m),noticeMethod:l.value.noticeMethod.join(",")};await ee(v),N(),x.$message.success("\u4FDD\u5B58\u6210\u529F\uFF01"),T.value=!1}})},B=()=>{l.value.rule.push({time:void 0,notice:[]})},L=o=>{l.value.rule.splice(o,1)},F=f(),J=async()=>{const o=await le({regionCode:w.value||331100});F.value=o.data.records};return te(()=>{R(["SUPER_ADMIN","REGION_MANAGER"])||N(),J()}),(o,n)=>{const m=i("el-col"),v=i("el-tab-pane"),g=i("el-tabs"),d=i("el-form-item"),U=i("el-input-number"),r=i("el-option"),V=i("el-select"),M=i("el-button"),A=i("el-checkbox"),W=i("el-checkbox-group"),q=i("el-input"),H=i("el-switch"),I=i("el-row"),K=i("el-form"),Q=i("el-card");return c(),y("div",re,[e(I,null,{default:a(()=>[E(R)(["SUPER_ADMIN","REGION_MANAGER"])?(c(),b(m,{key:0,style:{"padding-right":"16px"},span:4},{default:a(()=>[e(Y,{params:E(X)({SUPER_ADMIN:!1,REGION_MANAGER:!1}),onGetTree:D},null,8,["params"])]),_:1})):h("",!0),e(m,{span:E(R)(["SUPER_ADMIN","REGION_MANAGER"])?20:24},{default:a(()=>[e(Q,{class:"tab-card"},{header:a(()=>[e(g,{modelValue:u.value,"onUpdate:modelValue":n[0]||(n[0]=p=>u.value=p),onTabChange:z},{default:a(()=>[e(v,{label:"\u6D41\u7A0B\u9884\u8B66\u89C4\u5219",name:"1"}),e(v,{label:"\u586B\u62A5\u9884\u8B66\u89C4\u5219",name:"2"}),e(v,{label:"\u5B9E\u65BD\u76D1\u7BA1",name:"3"}),e(v,{label:"\u7EED\u5EFA\u9879\u76EE\u8D44\u91D1\u5BA1\u6279",name:"4"}),e(v,{label:"\u7EE9\u6548\u8BC4\u4EF7\u901A\u77E5",name:"5"})]),_:1},8,["modelValue"])]),default:a(()=>[e(K,{ref_key:"formRef",ref:k,model:l.value,rules:P,"label-position":"right","label-suffix":":","scroll-to-error":""},{default:a(()=>[e(I,null,{default:a(()=>[e(m,null,{default:a(()=>[e(d,{label:"\u89C4\u5219",style:{"margin-bottom":"0"}}),(c(!0),y(oe,null,ue(l.value.rule,(p,t)=>{var $;return c(),y("div",{key:t,class:"mb-8 flex items-center justify-between ruleBox"},[u.value==="1"||u.value==="4"?(c(),y("div",se,[me,e(d,{prop:`rule[${t}].adventTime`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],"label-width":"0",style:{"margin-bottom":"0",width:"80px"}},{default:a(()=>[e(U,{modelValue:l.value.rule[t].adventTime,"onUpdate:modelValue":s=>l.value.rule[t].adventTime=s,min:1,max:99999,precision:0,placeholder:"\u8BF7\u8F93\u5165",controls:!1},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),de,ie,e(d,{prop:`rule[${t}].time`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],"label-width":"0",style:{"margin-bottom":"0",width:"150px"}},{default:a(()=>[e(U,{modelValue:p.time,"onUpdate:modelValue":s=>p.time=s,min:1,max:99999,precision:0,placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),_("span",pe,"\u5C0F\u65F6\u5185\u6CA1\u6709"+j(u.value==="1"?"\u63D0\u4EA4":"\u5904\u7406")+"\u65F6\u53D1\u9001\u8D85\u671F\u63D0\u9192",1),u.value==="1"?(c(),b(d,{key:0,label:"\u63D0\u9192\u5BF9\u8C61",prop:`rule[${t}].notice`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}],style:{"margin-bottom":"0"},class:"ml-40"},{default:a(()=>[e(V,{modelValue:l.value.rule[t].notice,"onUpdate:modelValue":s=>l.value.rule[t].notice=s,multiple:""},{default:a(()=>[e(r,{label:"\u9879\u76EE\u8054\u7CFB\u4EBA",value:1}),e(r,{label:"\u9879\u76EE\u8D1F\u8D23\u4EBA",value:2})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):h("",!0)])):(c(),y("div",ce,[_e,e(d,{prop:`rule[${t}].biz`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}],"label-width":"0",style:{"margin-bottom":"0",width:"150px"},class:"mr-8"},{default:a(()=>[u.value==="2"?(c(),b(V,{key:0,modelValue:l.value.rule[t].biz,"onUpdate:modelValue":s=>l.value.rule[t].biz=s},{default:a(()=>[e(r,{label:"\u9884\u5BA1\u7533\u62A5",value:1}),e(r,{label:"\u5EFA\u8BBE\u65B9\u6848\u7533\u62A5",value:2}),e(r,{label:"\u91C7\u8D2D\u7ED3\u679C\u5907\u6848",value:3}),e(r,{label:"\u521D\u9A8C\u5907\u6848",value:4}),e(r,{label:"\u9A8C\u6536\u7533\u62A5",value:5})]),_:2},1032,["modelValue","onUpdate:modelValue"])):u.value==="3"?(c(),b(V,{key:1,modelValue:l.value.rule[t].biz,"onUpdate:modelValue":s=>l.value.rule[t].biz=s},{default:a(()=>[e(r,{label:"\u9879\u76EE\u521D\u9A8C",value:1}),e(r,{label:"\u9879\u76EE\u7EC8\u9A8C",value:2})]),_:2},1032,["modelValue","onUpdate:modelValue"])):u.value==="5"?(c(),b(V,{key:2,modelValue:l.value.rule[t].biz,"onUpdate:modelValue":s=>l.value.rule[t].biz=s},{default:a(()=>[e(r,{label:"\u5355\u4F4D\u81EA\u8BC4",value:1}),e(r,{label:"\u81EA\u8BC4\u786E\u8BA4",value:2}),e(r,{label:"\u9879\u76EE\u590D\u8BC4",value:3}),e(r,{label:"\u4E0A\u4F20\u56DE\u590D\u5355",value:4}),e(r,{label:"\u56DE\u590D\u5355\u5BA1\u6838",value:5}),e(r,{label:"\u4E13\u5BB6\u6838\u67E5",value:6}),e(r,{label:"\u9879\u76EE\u6574\u6539",value:7}),e(r,{label:"\u6574\u6539\u6838\u67E5",value:8})]),_:2},1032,["modelValue","onUpdate:modelValue"])):h("",!0)]),_:2},1032,["prop"]),e(d,{prop:`rule[${t}].adventTime`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],"label-width":"0",style:{"margin-bottom":"0",width:"80px"}},{default:a(()=>[e(U,{modelValue:l.value.rule[t].adventTime,"onUpdate:modelValue":s=>l.value.rule[t].adventTime=s,min:1,max:99999,precision:0,placeholder:"\u8BF7\u8F93\u5165",controls:!1},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),ve,fe,e(d,{prop:`rule[${t}].time`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],"label-width":"0",style:{"margin-bottom":"0",width:"80px"}},{default:a(()=>[e(U,{modelValue:l.value.rule[t].time,"onUpdate:modelValue":s=>l.value.rule[t].time=s,min:1,max:99999,precision:0,placeholder:"\u8BF7\u8F93\u5165",controls:!1},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),be,u.value==="2"||u.value==="3"?(c(),b(d,{key:0,label:"\u63D0\u9192\u5BF9\u8C61",prop:`rule[${t}].notice`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}],style:{"margin-bottom":"0"},class:"ml-40"},{default:a(()=>[e(V,{modelValue:l.value.rule[t].notice,"onUpdate:modelValue":s=>l.value.rule[t].notice=s,multiple:""},{default:a(()=>[e(r,{label:"\u9879\u76EE\u8054\u7CFB\u4EBA",value:1}),e(r,{label:"\u9879\u76EE\u8D1F\u8D23\u4EBA",value:2})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):h("",!0)])),(($=l.value.rule)==null?void 0:$.length)>1?(c(),b(M,{key:2,type:"danger",link:"",onClick:s=>L(t)},{default:a(()=>[C("\u5220\u9664")]),_:2},1032,["onClick"])):h("",!0)])}),128)),e(M,{icon:"Plus",type:"primary",plain:"",size:"small",class:"mb-16",onClick:B},{default:a(()=>[C("\u6DFB\u52A0\u89C4\u5219")]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(d,{label:"\u63D0\u9192\u65B9\u5F0F",prop:"noticeMethod"},{default:a(()=>[e(W,{modelValue:l.value.noticeMethod,"onUpdate:modelValue":n[1]||(n[1]=p=>l.value.noticeMethod=p)},{default:a(()=>[e(A,{label:0},{default:a(()=>[C("\u6D59\u653F\u9489\u5DE5\u4F5C\u901A\u77E5")]),_:1}),e(A,{label:1},{default:a(()=>[C("\u624B\u673A\u77ED\u4FE1")]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(d,{label:"\u4E34\u671F\u63D0\u9192\u6587\u6848",prop:"adventContent"},{default:a(()=>[e(q,{modelValue:l.value.adventContent,"onUpdate:modelValue":n[2]||(n[2]=p=>l.value.adventContent=p),type:"textarea",placeholder:"\u8BF7\u8F93\u5165",maxlength:100,"show-word-limit":""},null,8,["modelValue"]),_("p",null,"\u9879\u76EE\u540D\u79F0\uFF1A{projectName}\uFF0C"+j(u.value==="1"?"\u6D41\u7A0B\u7C7B\u578B\uFF1A{flowType}\uFF0C":u.value==="4"?"":"\u73AF\u8282\u540D\u79F0\uFF1A{stepName}\uFF0C")+"\u505C\u7559\u65F6\u95F4\uFF1A{time}\uFF0C\u5269\u4F59\u65F6\u95F4\uFF1A{time2}\u3002",1)]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(d,{label:"\u8D85\u671F\u63D0\u9192\u6587\u6848",prop:"noticeContent"},{default:a(()=>[e(q,{modelValue:l.value.noticeContent,"onUpdate:modelValue":n[3]||(n[3]=p=>l.value.noticeContent=p),type:"textarea",placeholder:"\u8BF7\u8F93\u5165",maxlength:100,"show-word-limit":""},null,8,["modelValue"]),_("p",null,"\u9879\u76EE\u540D\u79F0\uFF1A{projectName}\uFF0C"+j(u.value==="1"?"\u6D41\u7A0B\u7C7B\u578B\uFF1A{flowType}\uFF0C":u.value==="4"?"":"\u73AF\u8282\u540D\u79F0\uFF1A{stepName}\uFF0C")+"\u505C\u7559\u65F6\u95F4\uFF1A{time}\u3002",1)]),_:1})]),_:1}),e(m,null,{default:a(()=>[e(d,{label:"\u662F\u5426\u542F\u7528",prop:"isOpen"},{default:a(()=>[e(H,{modelValue:l.value.isOpen,"onUpdate:modelValue":n[4]||(n[4]=p=>l.value.isOpen=p)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),_:1})]),_:1},8,["span"])]),_:1}),_("div",ge,[e(M,{type:"primary",loading:T.value,onClick:n[5]||(n[5]=p=>S(k.value))},{default:a(()=>[C("\u4FDD\u5B58")]),_:1},8,["loading"])])])}}});export{ke as default};
|