数通互联化工云平台
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
3.6 KiB

4 months ago
import{d as J,r,ax as S,y as K,w as Q,a as n,c as y,b as s,q as C,e as u,H as d,h as i,I as j,Y as W,f as x,F as L,g as M,t as O,bg as X,cz as Z,aj as ee,b3 as te,ab as ae,b4 as le,ac as oe,at as se,_ as ne}from"./index-e450010e.js";import{c as ie,h as re,f as ue,i as de}from"./index-a04a5857.js";import ce from"./pickorg-a8189a5b.js";import"./icon_people-16b4e23b.js";const pe=["onDblclick"],fe={key:1},_e={class:"dialog-footer left_right"},ge=J({__name:"setupmatrixuser",props:{userShow:{type:Boolean,default:!1},matrixcont:{type:Object,default(){return{}}}},emits:["update:userShow"],setup(F,{emit:I}){const c=F,E=I,N=r(!1),p=S([]),l=S([]),H=r(!1),g=r(!1),B=r(!1),f=S([]),V=r(),D=r();r([]);const w=K({get:()=>c.userShow,set:e=>{E("update:userShow",e)}});function k(){E("update:userShow",!1),$()}function $(){var e;(e=V.value)==null||e.splice(0,V.value.length),l.splice(0,l.length)}Q(()=>c.userShow,()=>{c.userShow&&ie({id:c.matrixcont.id}).then(({data:e})=>{console.log("监听数据---->",e),p.splice(0,p.length),e.factor.forEach(t=>{p.push({id:t.id,label:t.name,prop:t.pinyin,types:t.types})}),e.outcome.forEach(t=>{p.push({id:t.id,label:t.name,prop:t.pinyin,types:t.types})})}).finally(()=>{l.splice(0,l.length),re({id:c.matrixcont.id}).then(e=>{console.log("监听数据--11111-->",e),e.data&&e.data.length>0&&e.data.forEach(t=>{l.push(t)})}).finally(()=>{l.length<1&&v()})})});function v(){ue({id:8}).then(e=>{var t={};p.forEach(a=>{t[a.prop]={id:a.id,types:a.types,number:e.data.uuidstring,userlist:[],orgid:0,namelist:[],isedit:!1,pinyin:a.prop}}),l.push(t)})}function z(){f&&f.length>0&&f.splice(0,f.length),l&&l.length>0&&l.forEach(e=>{Object.entries(e).map(a=>{let h=1;a[a.length-1].types==1&&(h=2),f.push({id:0,number:a[a.length-1].number,userlist:a[a.length-1].userlist,types:h,mcid:c.matrixcont.id,mhid:a[a.length-1].id})})}),de(f).then(e=>{k()})}function P(e){e.types<1?B.value=!0:B.value=!1,e.isedit=!0,g.value=!0,D.value=e}function q(e){l.splice(e,1),l.length<1&&v()}return(e,t)=>{const a=Z,h=ee,U=te,m=ae,A=le,R=oe,Y=se;return n(),y(R,{modelValue:i(w),"onUpdate:modelValue":t[1]||(t[1]=o=>j(w)?w.value=o:null),"custom-class":"dialog_box",title:"矩阵数据维护","before-close":k,width:"80%",draggable:""},{footer:s(()=>[C("div",_e,[C("div",null,[u(m,{type:"warning",onClick:v},{default:s(()=>[d("添加数据")]),_:1})]),C("div",null,[u(m,{type:"primary",loading:i(N),onClick:z},{default:s(()=>[d("确 定")]),_:1},8,["loading"]),u(m,{onClick:k},{default:s(()=>[d("取 消")]),_:1})])])]),default:s(()=>[u(ce,{orgBoxShow:i(g),"onUpdate:orgBoxShow":t[0]||(t[0]=o=>j(g)?g.value=o:null),ismultiselect:!1,tabledata:i(D)},null,8,["orgBoxShow","tabledata"]),W((n(),y(A,{"highlight-current-row":"",data:i(l),border:""},{default:s(()=>[(n(!0),x(L,null,M(i(p),(o,T)=>(n(),y(U,{key:T,align:"center"},{header:s(()=>[d(O(o.label),1)]),default:s(_=>[_.row[o.prop].isedit?(n(),x("div",fe,[u(h,{modelValue:_.row[o.prop].namelist,"onUpdate:modelValue":b=>_.row[o.prop].namelist=b,placeholder:"请选择","suffix-icon":i(X)},null,8,["modelValue","onUpdate:modelValue","suffix-icon"])])):(n(),x("div",{key:0,class:"edit_table_row",onDblclick:b=>P(_.row[o.prop])},[(n(!0),x(L,null,M(_.row[o.prop].userlist,(b,G)=>(n(),y(a,{key:G,class:"ml-2",size:"small"},{default:s(()=>[d(O(b.name),1)]),_:2},1024))),128)),d("  ")],40,pe))]),_:2},1024))),128)),u(U,{label:"操作",width:"80",align:"center"},{default:s(o=>[u(m,{type:"danger",link:"",onClick:T=>q(o.$index)},{default:s(()=>[d("删除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[Y,i(H)]])]),_:1},8,["modelValue"])}}});const xe=ne(ge,[["__scopeId","data-v-723bb0ca"]]);export{xe as default};