Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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