12 |
- import{E as e,t as s,v as a,k as t}from"../element-plus/element-plus.DqqeXZzT.js";import{I as i}from"../_input/_input.DPT4C86A.js";import{_ as l}from"../_popconfirm/_popconfirm.C2WlUwAw.js";import{p as r,T as o}from"../tableInfo/tableInfo.DCb2GEsc.js";import{A as n}from"../api/api.BtQEnbVN.js";import{d as c,Y as d,r as u,i as p,n as m,o as h,J as v,K as _,L as f,c as b,T as g,a as j,O as L,M,S as y,U as k,a9 as w,h as x,ba as C,b8 as N,u as I,R}from"../@vue/@vue.lccsL1Mu.js";import{R as V}from"../radioGroup/radioGroup.DXKMGiGl.js";import{S as A}from"../_select/_select.DVQW4rAo.js";import{D as E}from"../_dialog/_dialog.ium6sOk7.js";import{_ as T}from"../../assets/index-DYMYfyXS.js";import"../lodash-es/lodash-es.LxYfApIs.js";import"../async-validator/async-validator.DSgsWN2H.js";import"../@vueuse/@vueuse.D2YafqsA.js";import"../dayjs/dayjs.D4rZQhfm.js";import"../axios/axios.CUN3se9v.js";import"../@ctrl/@ctrl.D2oWfImC.js";import"../@popperjs/@popperjs.D3lHDW-0.js";import"../escape-html/escape-html.J6B7JOz4.js";import"../normalize-wheel-es/normalize-wheel-es.Erkn7R64.js";import"../caret-top/caret-top.BxG-YGIs.js";import"../question-filled/question-filled.CpBGPdbF.js";import"../warning-filled/warning-filled.Br0zWNXs.js";import"../_tooltip/_tooltip.5el2jQVf.js";import"../vue-router/vue-router.D86bYXwF.js";import"../pinia/pinia.DodrAXQg.js";import"../vue-demi/vue-demi.Dq6ymT-8.js";import"../pinia-plugin-persist/pinia-plugin-persist.Cjrd7Wf_.js";import"../@element-plus/@element-plus.BWbqilIf.js";import"../echarts/echarts.C_nC9ACL.js";import"../tslib/tslib.DduEQve-.js";import"../zrender/zrender.XYf_pgl8.js";const $={class:"dialogBox"},W={class:"flex tMar20",style:{"align-items":"flex-start"}},z=(e=>(C("data-v-458c5650"),e=e(),N(),e))((()=>j("span",{class:"spanTitle f14",style:{width:"80px","margin-top":"6px"}},"项目成员",-1))),D={class:"cascader-container left"},S={class:"cascader-title"},F={class:"cascader-list"},q={class:"cascader-list member-parent"},B={class:"cascader-container right"},G={class:"cascader-title"},O={class:"cascader-list"},P={class:"choose"},H={class:"ellipsis"},J={class:"choose"},K={class:"ellipsis"},U=T(c({__name:"addProject",emits:["init"],setup(t,{expose:l,emit:r}){const{proxy:o}=x();o.$NumberHandle;const c={children:"childs",label:"name"},C={children:"childs",label:"username"},N=d({value:1,name:"项目成员",EgName:"cover",radioVal:"1",haveNotes:!1,list:[{name:"所有人可见",value:"1"},{name:"指定成员可见",value:"2"}]}),I=d({treeList:[],editId:"",title:"新增项目",chargeList:[],visibleVal:"",titleAc:"1",chooseMemberList:[],chooseMemberList_user:[],userList:[]}),R=()=>{m((()=>{I.chooseMemberList=[],I.chooseMemberList_user=[],T.value.setCheckedNodes([]),U.value.setCheckedNodes([])}))},T=u(),U=u(),Y=e=>{m((()=>{I.chooseMemberList=T.value.getCheckedNodes()}))},Q=()=>{m((()=>{I.chooseMemberList_user=U.value.getCheckedNodes()}))},X=u(""),Z=u(),ee=u(),se=u(),ae=u(!1),te=async()=>{if(""==Z.value.value)return void e.error("名称为必填项");ae.value=!0;let s=n.project_add;const a=d({name:Z.value.value,note:ee.value.value,head_user_id:se.value.value,show_type:N.radioVal,department_ids:I.chooseMemberList.map((e=>e.id)),user_ids:I.chooseMemberList_user.map((e=>e.id))});I.editId&&(a.id=I.editId,s=n.project_edit);let t=await o.$http.post(s,a);ae.value=!1,t&&"0"==t.errNo?(t.rst,ie.value=!1,r("init")):e.error(t.errMsg)},ie=u(!1);return l({switchShow:(s,a)=>{ie.value=s,s&&m((async()=>{Z.value.value="",ee.value.value="",se.value.value="",N.radioVal="1",I.chooseMemberList=[],I.chooseMemberList_user=[],X.value="",I.editId="",I.title="新增项目",ae.value=!0,await(async()=>{let s=await o.$http.get(n.depart_list);if(s&&"0"==s.errNo){let e=s.rst;I.treeList=e}else e.error(s.errMsg)})(),await(async()=>{let s=await o.$http.get(n.user_list);if(s&&"0"==s.errNo){let e=s.rst;I.userList=e}else e.error(s.errMsg)})(),ae.value=!1,a?.id&&(async s=>{ae.value=!0;let a=await o.$http.get(n.project_detail,{id:s});if(ae.value=!1,a&&"0"==a.errNo){let e=a?.rst;I.editId=e?.id,Z.value.value=e.name,ee.value.value=e.note,se.value.value=e.head_user_id,N.radioVal=e.show_type+"",I.chooseMemberList=[],I.treeList.forEach((s=>{e?.department_ids?.includes(s.id)&&I.chooseMemberList.push({id:s.id,name:s.name}),s.childs.forEach((s=>{e?.department_ids?.includes(s.id)&&I.chooseMemberList.push(s)}))})),I.chooseMemberList_user=[],I.userList.forEach((s=>{e?.sys_user_ids?.includes(s.id)&&I.chooseMemberList_user.push(s)})),T.value.setCheckedNodes(I.chooseMemberList),U.value.setCheckedNodes(I.chooseMemberList_user),I.title="编辑项目"}else e.error(a.errMsg)})(a?.id)}))}}),p((()=>{m((()=>{}))})),(e,t)=>{const l=s,r=a;return h(),v(E,{ref:"DialogRef_editType",dialogVisible:ie.value,onConfirm:te,onClose:t[3]||(t[3]=e=>ie.value=!1),width:"800px",height:"calc(100vh - 220px)",top:"20px","dialog-title":I.title},{content:_((()=>[f((h(),b("div",$,[g(i,{ref_key:"nameRef",ref:Z,spanTitleWidth:"80px",inputWidth:"80%",title:"项目名称",haveTag:!0,haverMar15:!1},null,512),g(i,{ref_key:"noteRef",ref:ee,class:"tMar20",spanTitleWidth:"80px",inputWidth:"80%",title:"备注",haverMar15:!1},null,512),g(A,{ref_key:"ideaManRef",ref:se,class:"tMar20",clearFlag:!0,title:"项目负责人",selectWidth:"190px",optObj:{k:"id",la:"username",val:"id"},options:I.userList},null,8,["options"]),j("div",W,[z,j("div",null,[j("div",null,[g(V,{showTitle:!1,id:N.EgName,radioList:N.list,echoVal:N.radioVal,title:N.name,onReturnEvent:t[0]||(t[0]=e=>{N.radioVal=e})},null,8,["id","radioList","echoVal","title"])]),f(j("div",null,[j("div",D,[j("div",S,[j("span",{class:L(["tab-label","1"==I.titleAc?"active":""]),onClick:t[1]||(t[1]=e=>I.titleAc="1")}," 部门 ",2),j("span",{class:L(["tab-label","2"==I.titleAc?"active":""]),onClick:t[2]||(t[2]=e=>I.titleAc="2")}," 人员 ",2)]),f(j("div",F,[g(l,{ref_key:"treeCascaderRef",ref:T,onChange:Y,"node-key":"id",data:I.treeList,props:c,"show-checkbox":""},null,8,["data"])],512),[[M,"1"==I.titleAc]]),f(j("div",q,[g(l,{ref_key:"treeCascaderRef_user",ref:U,onChange:Q,"node-key":"id",data:I.userList,props:C,"show-checkbox":""},null,8,["data"])],512),[[M,"2"==I.titleAc]])]),j("div",B,[j("div",G,[j("span",null,"已选可见人员("+y(I.chooseMemberList.length+I.chooseMemberList_user.length)+")",1),j("span",{class:"clear",onClick:R},"清空")]),j("div",O,[(h(!0),b(k,null,w(I.chooseMemberList,(e=>(h(),b("div",{class:"choose-member",key:e.id},[j("p",P,[j("span",H,y(e.name||"-"),1)])])))),128)),(h(!0),b(k,null,w(I.chooseMemberList_user,(e=>(h(),b("div",{class:"choose-member",key:e.id},[j("p",J,[j("span",K,y(e.username||"-"),1)])])))),128))])])],512),[[M,"2"==N.radioVal]])])])])),[[r,ae.value]])])),_:1},8,["dialogVisible","dialog-title"])}}}),[["__scopeId","data-v-458c5650"]]),Y={class:"screenBox flex"},Q=R("新增项目"),X={class:"text-center"},Z=["onClick"],ee=T(c({__name:"index",setup(s){const{proxy:a}=x(),c=d([{name:"项目名称",column:"name"},{name:"备注",column:"note",cancleForMat:!0},{name:"项目负责人",column:"head_user"},{name:"创建人",column:"create_user"},{name:"创建时间",column:"created_at"},{name:"关联账户数",column:"account_num"},{name:"操作",column:"operate",slotFlag:!0}]),{tableInfo:v,tableListRef:f,total:L}=r(c),M=e=>{m((()=>{y.value.switchShow(!0,e||"")}))},y=u(),w=u(),C=async(s,t)=>{f.value.loading=!0;const i=d({name:w.value.value});let l=await a.$http.get(n.project_list,i);f.value.loading=!1,l&&"0"==l.errNo?v.tableList=l.rst:e.error(l.errMsg)};return p((async()=>{await C()})),(s,r)=>{const c=t;return h(),b(k,null,[j("div",Y,[g(i,{ref_key:"InputRef_text",ref:w,title:"项目名称",placeholderTxt:"项目名称",onChangeEvent:r[0]||(r[0]=e=>C()),onClearEvent:r[1]||(r[1]=e=>C())},null,512),g(c,{type:"primary",class:"lMarauto",onClick:r[2]||(r[2]=e=>M())},{default:_((()=>[Q])),_:1})]),g(o,{ref_key:"tableListRef",ref:f,tableData:I(v).tableList,descol:I(v).descolList,total:I(L),onInit:C},{operate:_((s=>[j("div",X,[j("span",{class:"operate_text lMar8 pointer",onClick:e=>M(s.row)},"编辑",8,Z),g(l,{onConfirm:t=>(async s=>{f.value.loading=!0;const t=d({id:s.id});let i=await a.$http.post(n.project_dele,t);f.value.loading=!1,e.info(i.errMsg),i&&"0"==i.errNo&&await C()})(s.row)},null,8,["onConfirm"])])])),_:1},8,["tableData","descol","total"]),g(U,{ref_key:"AddProjectRef",ref:y,onInit:C},null,512)],64)}}}),[["__scopeId","data-v-33249801"]]);export{ee as default};
|