share-modal.15faf25d.js 5.4 KB

1
  1. import{_ as te,d as oe,E as c,af as y,a7 as de,br as v,x as _,aA as ne,o,N as r,K as a,O as ie,u as p,aK as re,y as t,c as g,M as E,L as V,b as se,W as D}from"./index.743f0c80.js";import{b as pe,c as _e,d as me,e as ve,r as fe,f as ce,g as ge}from"./configs.beacb924.js";const Ee=D("\u53EA\u8BFB"),Ve=D("\u8BFB\u5199"),be={"w-full":"",flex:"","justify-end":""},Be=D("\u63D0\u4EA4 "),ye=D("\u53D6\u6D88"),De=oe({__name:"share-modal",emits:["reload"],setup(ke,{expose:S,emit:h}){const b=c(""),k=c(!1),f=c(!1),A=c(null),F=y(()=>!b.value),C={menu_ids:[],source_uid:"",source_data_group_id:"",uid:"",data_group_id:"",type:"2"},s=de({source:"1",target:"1"}),N=y(()=>k.value?"\u6570\u636E\u5171\u4EAB\u8BE6\u60C5":F.value?"\u521B\u5EFA\u6570\u636E\u5171\u4EAB":"\u7F16\u8F91\u6570\u636E\u5171\u4EAB"),L=()=>{f.value=!1,h("reload")},M=y(()=>z.value||W.value||j.value||Y.value),K=y(()=>I.value||P.value),l=c({...C}),{run:T,data:U,loading:j}=v({initalData:[]}),{run:G,data:O,loading:W}=v({initalData:[]}),{run:q,data:w,loading:z}=v({initalData:[],isList:!0}),{run:H,loading:I}=v({success:()=>L()}),{run:J,loading:P}=v({success:()=>L()}),{run:Q,data:X,loading:Y}=v({initalData:{},success:()=>{let{menu_list:m,source_data_group_id:u,data_group_id:d,uid:n,source_uid:i,type:x}=X.value;s.source=i==="0"?"2":"1",s.target=n==="0"?"2":"1",d=d==="0"?"":d,u=u==="0"?"":u,n=n==="0"?"":n,i=i==="0"?"":i,l.value={menu_ids:m.map(({id:B})=>B),source_data_group_id:u,data_group_id:d,source_uid:i,uid:n,type:x}}});function Z(){H(ce(l.value))}function $(){J(ge({id:b.value,...l.value}))}function ee(){A.value.validate(m=>{if(!!m){if(F.value)return Z();$()}})}return S({onDisplay(m="",u=!1){if(f.value=!0,T(pe()),G(_e()),q(me()),k.value=u,b.value=m,!m)return l.value={...C};Q(ve({id:b.value}))}}),(m,u)=>{const d=_("el-option"),n=_("el-select"),i=_("el-form-item"),x=_("el-divider"),B=_("el-radio"),ue=_("el-radio-group"),R=_("el-button"),le=_("el-dialog"),ae=ne("loading");return o(),r(le,{modelValue:f.value,"onUpdate:modelValue":u[12]||(u[12]=e=>f.value=e),title:p(N),center:"",onClose:u[13]||(u[13]=()=>l.value={...C})},{default:a(()=>[ie((o(),r(p(re),{"label-width":"120px",ref_key:"formRef",ref:A,model:l.value,disabled:k.value,rules:p(fe)},{default:a(()=>[t(i,{prop:"menu_ids",label:"\u5171\u4EAB\u7684\u83DC\u5355\u6570\u636E"},{default:a(()=>[t(n,{"w-full":"",modelValue:l.value.menu_ids,"onUpdate:modelValue":u[0]||(u[0]=e=>l.value.menu_ids=e),multiple:""},{default:a(()=>[(o(!0),g(V,null,E(p(O),e=>(o(),r(d,{key:e.id,value:e.id,label:e.menu_name},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(i,{label:"\u6570\u636E\u6E90\u5171\u4EAB\u5BF9\u8C61",prop:s.source==="1"?"source_uid":"source_data_group_id"},{default:a(()=>[t(n,{"w-100px":"",modelValue:s.source,"onUpdate:modelValue":u[1]||(u[1]=e=>s.source=e),onChange:u[2]||(u[2]=e=>e==="1"?l.value.source_data_group_id="":l.value.source_uid="")},{default:a(()=>[t(d,{value:"1",label:"\u7528\u6237"}),t(d,{value:"2",label:"\u7528\u6237\u7EC4"})]),_:1},8,["modelValue"]),s.source==="1"?(o(),r(n,{key:0,"flex-1":"",placeholder:"\u8BF7\u9009\u62E9\u7528\u6237",modelValue:l.value.source_uid,"onUpdate:modelValue":u[3]||(u[3]=e=>l.value.source_uid=e)},{default:a(()=>[(o(!0),g(V,null,E(p(U),e=>(o(),r(d,{key:e.id,value:e.id,label:e.nickname},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])):(o(),r(n,{key:1,"flex-1":"",placeholder:"\u8BF7\u9009\u62E9\u7528\u6237\u7EC4",modelValue:l.value.source_data_group_id,"onUpdate:modelValue":u[4]||(u[4]=e=>l.value.source_data_group_id=e)},{default:a(()=>[(o(!0),g(V,null,E(p(w),e=>(o(),r(d,{key:e.id,value:e.id,label:e.title},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]))]),_:1},8,["prop"]),t(x),t(i,{label:"\u6570\u636E\u5171\u4EAB\u5BF9\u8C61",prop:s.target==="1"?"uid":"data_group_id"},{default:a(()=>[t(n,{"w-100px":"",modelValue:s.target,"onUpdate:modelValue":u[5]||(u[5]=e=>s.target=e),onChange:u[6]||(u[6]=e=>e==="1"?l.value.source_uid="":l.value.uid="")},{default:a(()=>[t(d,{value:"1",label:"\u7528\u6237"}),t(d,{value:"2",label:"\u7528\u6237\u7EC4"})]),_:1},8,["modelValue"]),s.target==="1"?(o(),r(n,{key:0,"flex-1":"",placeholder:"\u8BF7\u9009\u62E9\u7528\u6237",modelValue:l.value.uid,"onUpdate:modelValue":u[7]||(u[7]=e=>l.value.uid=e)},{default:a(()=>[(o(!0),g(V,null,E(p(U),e=>(o(),r(d,{key:e.id,value:e.id,label:e.nickname},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])):(o(),r(n,{key:1,"flex-1":"",placeholder:"\u8BF7\u9009\u62E9\u7528\u6237\u7EC4",modelValue:l.value.data_group_id,"onUpdate:modelValue":u[8]||(u[8]=e=>l.value.data_group_id=e)},{default:a(()=>[(o(!0),g(V,null,E(p(w),e=>(o(),r(d,{key:e.id,value:e.id,label:e.title},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]))]),_:1},8,["prop"]),t(i,{label:"\u5171\u4EAB\u7684\u6570\u636E\u6743\u9650",prop:"type"},{default:a(()=>[t(ue,{modelValue:l.value.type,"onUpdate:modelValue":u[9]||(u[9]=e=>l.value.type=e)},{default:a(()=>[t(B,{label:"2"},{default:a(()=>[Ee]),_:1}),t(B,{label:"1"},{default:a(()=>[Ve]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(i,null,{default:a(()=>[se("div",be,[t(R,{type:"primary",onClick:u[10]||(u[10]=()=>ee()),loading:p(K)},{default:a(()=>[Be]),_:1},8,["loading"]),t(R,{onClick:u[11]||(u[11]=()=>f.value=!1)},{default:a(()=>[ye]),_:1})])]),_:1})]),_:1},8,["model","disabled","rules"])),[[ae,p(M)]])]),_:1},8,["modelValue","title"])}}});var Ae=te(De,[["__file","D:/work/accout-vue3-ui/src/views/interest/dataShare/components/share-modal.vue"]]);export{Ae as default};