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.
1 lines
3.9 KiB
1 lines
3.9 KiB
import{d as q,r as u,ar as C,C as J,n as K,o as s,c as y,w as n,g as S,a as d,j as c,f as i,D as M,a7 as Q,b as x,F as j,e as L,t as O,a$ as W,aZ as X,ai as Y,aT as ee,G as te,aU as oe,H as le,aM as ae,_ as ne}from"./index-b0696d90.js";/* empty css */import{c as se,h as ie,f as re,i as ue}from"./index-33d74b1c.js";import de from"./pickorg-9cbc936b.js";import"./index-43a073f3.js";import"./icon_people-2120116c.js";/* empty css */import"./indexapi-2b4ca4b9.js";import"./index-de32b8dd.js";const ce=["onDblclick"],pe={key:1},fe={class:"dialog-footer left_right"},ge=q({__name:"setupmatrixuser",props:{userShow:{type:Boolean,default:!1},matrixcont:{type:Object,default(){return{}}}},emits:["update:userShow"],setup(F,{emit:E}){const p=F,N=u(!1),f=C([]),l=C([]),$=u(!1),_=u(!1),B=u(!1),r=C([]),V=u(),D=u();u([]);const w=J({get:()=>p.userShow,set:e=>{E("update:userShow",e)}});function k(){E("update:userShow",!1),H()}function H(){var e;(e=V.value)==null||e.splice(0,V.value.length),l.splice(0,l.length)}K(()=>p.userShow,()=>{p.userShow&&se({id:p.matrixcont.id}).then(({data:e})=>{console.log("监听数据---->",e),f.splice(0,f.length),e.factor.forEach(t=>{f.push({id:t.id,label:t.name,prop:t.pinyin,types:t.types})}),e.outcome.forEach(t=>{f.push({id:t.id,label:t.name,prop:t.pinyin,types:t.types})})}).finally(()=>{l.splice(0,l.length),ie({id:p.matrixcont.id}).then(e=>{e.data&&e.data.length>0&&e.data.forEach(t=>{l.push(t)})}).finally(()=>{l.length<1&&v()})})});function v(){re({id:8}).then(e=>{var t={};f.forEach(o=>{t[o.prop]={id:o.id,types:o.types,number:e.data.uuidstring,userlist:[],orgid:0,namelist:[],isedit:!1,pinyin:o.prop}}),l.push(t)})}function I(){r&&r.length>0&&r.splice(0,r.length),console.log("提交数据-->",l),l&&l.length>0&&l.forEach(e=>{console.log("提交数据-4->",e,e.bm),Object.entries(e).map(o=>{console.log("提交数据-2->",o,o[o.length-1].number);let h=1;o[o.length-1].types==1&&(h=2),r.push({id:0,number:o[o.length-1].number,userlist:o[o.length-1].userlist,types:h,mcid:p.matrixcont.id,mhid:o[o.length-1].id})})}),ue(r).then(e=>{console.log("提交数据-66666->",e),k()}),console.log("提交数据-1->",r)}function P(e){console.log("单击单元格-2222222->",e),e.types<1?B.value=!0:B.value=!1,e.isedit=!0,_.value=!0,D.value=e}function z(e){console.log("删除行",e),l.splice(e,1),l.length<1&&v()}return(e,t)=>{const o=X,h=Y,U=ee,m=te,A=oe,G=le,R=ae;return s(),y(G,{modelValue:i(w),"onUpdate:modelValue":t[1]||(t[1]=a=>M(w)?w.value=a:null),"custom-class":"dialog_box",title:"矩阵数据维护","before-close":k,width:"80%",draggable:""},{footer:n(()=>[S("div",fe,[S("div",null,[d(m,{type:"warning",onClick:v},{default:n(()=>[c("添加数据")]),_:1})]),S("div",null,[d(m,{type:"primary",loading:i(N),onClick:I},{default:n(()=>[c("确 定")]),_:1},8,["loading"]),d(m,{onClick:k},{default:n(()=>[c("取 消")]),_:1})])])]),default:n(()=>[d(de,{orgBoxShow:i(_),"onUpdate:orgBoxShow":t[0]||(t[0]=a=>M(_)?_.value=a:null),ismultiselect:!1,tabledata:i(D)},null,8,["orgBoxShow","tabledata"]),Q((s(),y(A,{"highlight-current-row":"",data:i(l),border:""},{default:n(()=>[(s(!0),x(j,null,L(i(f),(a,T)=>(s(),y(U,{key:T,align:"center"},{header:n(()=>[c(O(a.label),1)]),default:n(g=>[g.row[a.prop].isedit?(s(),x("div",pe,[d(h,{modelValue:g.row[a.prop].namelist,"onUpdate:modelValue":b=>g.row[a.prop].namelist=b,placeholder:"请选择","suffix-icon":i(W)},null,8,["modelValue","onUpdate:modelValue","suffix-icon"])])):(s(),x("div",{key:0,class:"edit_table_row",onDblclick:b=>P(g.row[a.prop])},[(s(!0),x(j,null,L(g.row[a.prop].userlist,(b,Z)=>(s(),y(o,{key:Z,class:"ml-2",size:"small"},{default:n(()=>[c(O(b.name),1)]),_:2},1024))),128)),c(" ")],40,ce))]),_:2},1024))),128)),d(U,{label:"操作",width:"80",align:"center"},{default:n(a=>[d(m,{type:"danger",link:"",onClick:T=>z(a.$index)},{default:n(()=>[c("删除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[R,i($)]])]),_:1},8,["modelValue"])}}});const Ce=ne(ge,[["__scopeId","data-v-c631e7a8"]]);export{Ce as default};
|
|
|