Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

2 Zeilen
7.2KB

  1. var k=Object.defineProperty,x=Object.defineProperties;var ee=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var oe=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var I=(d,i,t)=>i in d?k(d,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):d[i]=t,L=(d,i)=>{for(var t in i||(i={}))oe.call(i,t)&&I(d,t,i[t]);if(E)for(var t of E(i))le.call(i,t)&&I(d,t,i[t]);return d},S=(d,i)=>x(d,ee(i));var M=(d,i,t)=>new Promise(($,C)=>{var j=b=>{try{N(t.next(b))}catch(O){C(O)}},o=b=>{try{N(t.throw(b))}catch(O){C(O)}},N=b=>b.done?$(b.value):Promise.resolve(b.value).then(j,o);N((t=t.apply(d,i)).next())});import{_ as te,d as ae,H as ue,r as G,P as ne,f as m,g as s,L as U,m as n,l as u,p as A,h as v,G as g,M as D,i as H,k as V,j as y,t as se}from"./index.81c9c707.js";const ie={class:"orBox"},re={class:"flexbetween"},de=["onClick"],ce={key:0,class:"mx-48 my-17 bg-warning text-white rounded-full w-24 h-24 flex items-center justify-center"},pe=ae({name:"conditionDialog"}),ve=Object.assign(pe,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close","update:data"],setup(d,{emit:i}){const{filedConditionsOptions:t}=ue.dictStore.globalDicts||{},$=d,C=i,j=G(),o=G({groups:[]}),N={name:[{required:!0,message:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u540D\u79F0",trigger:"blur"}]},b=c=>M(this,null,function*(){if(!c){C("close",!0);return}yield c.validate(r=>M(this,null,function*(){if(r){const p=[];o.value.groups.length&&o.value.groups.forEach((B,T)=>{const P=B.conditions.map(f=>({id:f.id,title:t.find(w=>w.value===f.id).label,compare:f.compare,value:Array.of(f.value),valueType:t.find(w=>w.value===f.id).valueType}));p.push({groupType:"AND",conditions:P,cids:P.map(f=>f.id)})});const _={id:$.data.id,name:$.data.name,type:"CONDITION",props:{groups:p,groupsType:"OR"}};C("update:data",_),C("close",!0)}}))}),O=c=>{o.value.groups[c].conditions.push({})},J=(c,r)=>{o.value.groups[c].conditions.splice(r,1)},K=()=>{o.value.groups.push({conditions:[]})},Q=c=>{o.value.groups.splice(c,1)},W=(c,r)=>{o.value.groups[c].conditions[r].compare=void 0,o.value.groups[c].conditions[r].value=void 0};return ne(()=>$.visible,c=>M(this,null,function*(){c?o.value={groups:$.data.props.groups.map(r=>({conditions:r.conditions.map(p=>S(L({},p),{value:t.find(_=>_.value===p.id).type==="bool_condition"?p.value.join()*1:p.value.join()}))}))}:j.value.resetFields()})),(c,r)=>{const p=m("el-option"),_=m("el-select"),B=m("el-form-item"),T=m("el-col"),P=m("el-input"),f=m("Delete"),w=m("el-icon"),X=m("el-row"),R=m("Plus"),F=m("el-button"),Y=m("el-form"),Z=m("el-dialog");return s(),U(Z,{"model-value":d.visible,title:"\u7B5B\u9009\u6570\u636E",width:"840px","destroy-on-close":"",onClose:r[2]||(r[2]=q=>C("close"))},{footer:n(()=>[u(F,{type:"primary",onClick:r[0]||(r[0]=q=>b(j.value))},{default:n(()=>[A(" \u63D0\u4EA4 ")]),_:1}),u(F,{onClick:r[1]||(r[1]=q=>C("close"))},{default:n(()=>[A(" \u5173\u95ED ")]),_:1})]),default:n(()=>[u(Y,{ref_key:"formRef",ref:j,model:o.value,rules:N,"label-suffix":":",class:"form"},{default:n(()=>[(s(!0),v(g,null,D(o.value.groups,(q,l)=>(s(),v("div",{key:l},[H("div",ie,[(s(!0),v(g,null,D(q.conditions,(z,a)=>(s(),U(X,{key:a,gutter:8,class:"mb-8"},{default:n(()=>[u(T,{span:8},{default:n(()=>[u(B,{prop:`groups[${l}][conditions][${a}].id`,rules:{required:!0,message:"\u8BF7\u9009\u62E9\u9879\u76EE\u5B57\u6BB5"}},{default:n(()=>[u(_,{modelValue:o.value.groups[l].conditions[a].id,"onUpdate:modelValue":e=>o.value.groups[l].conditions[a].id=e,class:"w-full",onChange:e=>W(l,a)},{default:n(()=>[(s(!0),v(g,null,D(V(t),e=>(s(),U(p,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1032,["prop"])]),_:2},1024),u(T,{span:6},{default:n(()=>[u(B,{prop:`groups[${l}][conditions][${a}].compare`,rules:{required:!0,message:"\u8BF7\u9009\u62E9\u5224\u65AD\u7B26"}},{default:n(()=>[u(_,{modelValue:o.value.groups[l].conditions[a].compare,"onUpdate:modelValue":e=>o.value.groups[l].conditions[a].compare=e},{default:n(()=>[o.value.groups[l].conditions[a].id?(s(!0),v(g,{key:0},D(V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).judges,(e,h)=>(s(),U(p,{key:h,label:e,value:h},null,8,["label","value"]))),128)):y("v-if",!0)]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024),u(T,{span:9},{default:n(()=>[u(B,{prop:`groups[${l}][conditions][${a}].value`,rules:{required:!0,message:"\u8BF7\u9009\u62E9\u6216\u8F93\u5165"}},{default:n(()=>[o.value.groups[l].conditions[a].id?V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).type==="bool_condition"?(s(),v(g,{key:1},[y(" \u662F\u5426\u9009\u9879"),u(_,{modelValue:o.value.groups[l].conditions[a].value,"onUpdate:modelValue":e=>o.value.groups[l].conditions[a].value=e,class:"w-full"},{default:n(()=>[u(p,{label:"\u662F",value:1}),u(p,{label:"\u5426",value:0})]),_:2},1032,["modelValue","onUpdate:modelValue"])],2112)):V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).type==="value_condition"?(s(),v(g,{key:2},[y(" \u591A\u9009"),u(_,{modelValue:o.value.groups[l].conditions[a].value,"onUpdate:modelValue":e=>o.value.groups[l].conditions[a].value=e,class:"w-full"},{default:n(()=>[(s(!0),v(g,null,D(V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).options,(e,h)=>(s(),U(p,{key:h,label:e,value:h},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])],2112)):V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).type==="single_condition"?(s(),v(g,{key:3},[y(" \u5355\u9009"),u(_,{modelValue:o.value.groups[l].conditions[a].value,"onUpdate:modelValue":e=>o.value.groups[l].conditions[a].value=e,class:"w-full"},{default:n(()=>[(s(!0),v(g,null,D(V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).options,(e,h)=>(s(),U(p,{key:h,label:e,value:h},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])],2112)):V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).type==="range_condition"?(s(),v(g,{key:4},[y(" \u91D1\u989D"),u(P,{modelValue:o.value.groups[l].conditions[a].value,"onUpdate:modelValue":e=>o.value.groups[l].conditions[a].value=e},{append:n(()=>[A(se(V(t).find(e=>e.value===o.value.groups[l].conditions[a].id).unit),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])],2112)):y("v-if",!0):(s(),U(_,{key:0,class:"w-full"}))]),_:2},1032,["prop"])]),_:2},1024),u(T,{span:1,class:"flex items-center text-danger delCol justify-end"},{default:n(()=>[u(w,{class:"cursor-pointer",onClick:e=>J(l,a)},{default:n(()=>[u(f)]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024))),128)),H("div",re,[u(F,{size:"small",onClick:z=>O(l)},{default:n(()=>[u(w,{class:"mr-4"},{default:n(()=>[u(R)]),_:1}),A("\u4E14\u6761\u4EF6 ")]),_:2},1032,["onClick"]),q.length?y("v-if",!0):(s(),v("span",{key:0,class:"text-danger cursor-pointer",onClick:z=>Q(l)},[u(w,null,{default:n(()=>[u(f)]),_:1})],8,de))])]),l<o.value.groups.length-1?(s(),v("p",ce,"\u6216")):y("v-if",!0)]))),128)),u(F,{size:"small",type:"primary",plain:"",class:"mt-16",onClick:K},{default:n(()=>[u(w,{class:"mr-4"},{default:n(()=>[u(R)]),_:1}),A("\u6216\u6761\u4EF6 ")]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}}),fe=te(ve,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/systemManage/flowConfiguration/configEdit/components/conditionDialog.vue"]]);export{fe as default};