12 |
- import{E as e,v as a,k as t,r as s}from"../element-plus/element-plus.DqqeXZzT.js";import{d as i,Y as l,r as o,o as r,J as n,K as p,L as u,c as d,T as m,n as c,i as v,a as f,ah as h,u as j,U as _,R as y}from"../@vue/@vue.lccsL1Mu.js";import{_ as g}from"../_popconfirm/_popconfirm.C2WlUwAw.js";import{p as x,T as b}from"../tableInfo/tableInfo.DCb2GEsc.js";import{D as w}from"../_dialog/_dialog.ium6sOk7.js";import{I}from"../_input/_input.DPT4C86A.js";import{h as L,_ as M,A as k}from"../../assets/index-DYMYfyXS.js";import{s as C}from"../@element-plus/@element-plus.BWbqilIf.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"../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"../echarts/echarts.C_nC9ACL.js";import"../tslib/tslib.DduEQve-.js";import"../zrender/zrender.XYf_pgl8.js";const R={class:"dialogBox"},T=M(i({__name:"addTeam",emits:["init"],setup(t,{expose:s,emit:i}){const v=l({treeList:[],editId:"",title:"新增项目",chargeList:[],visibleVal:"",titleAc:"1",chooseMemberList:[],chooseMemberList_user:[],userList:[]}),f=o(),h=o(),j=o(!1),_=async()=>{var a;""!=f.value.value?(j.value=!0,""!=v.editId?(a={id:v.editId,name:f.value.value,note:h.value.value},new Promise((async(t,s)=>{const i=await L.post("/api/sys/teamEdit",a);0==i.errNo?t(i.rst):(e.error(i.errMsg),s())}))).then((e=>{j.value=!1,y.value=!1,i("init")})).catch((()=>{j.value=!1})):function(a){return new Promise((async(t,s)=>{const i=await L.post("/api/sys/teamAdd",a);0==i.errNo?t(i.rst):(e.error(i.errMsg),s())}))}({name:f.value.value,note:h.value.value}).then((e=>{j.value=!1,y.value=!1,i("init")})).catch((()=>{j.value=!1}))):e.error("名称为必填项")},y=o(!1);return s({switchShow:(e,a)=>{y.value=e,e&&c((async()=>{f.value.value="",h.value.value="",v.editId="",j.value=!1,v.title="新增团队",a?.id&&(v.editId=a.id,v.title="编辑团队",f.value.value=a?.name,h.value.value=a?.note)}))}}),(e,t)=>{const s=a;return r(),n(w,{ref:"DialogRef_editType",dialogVisible:y.value,onConfirm:_,onClose:t[0]||(t[0]=e=>y.value=!1),width:"600px",height:"calc(100vh - 220px)",top:"20px","dialog-title":v.title},{content:p((()=>[u((r(),d("div",R,[m(I,{ref_key:"nameRef",ref:f,spanTitleWidth:"80px",inputWidth:"80%",title:"团队名称",haveTag:!0,haverMar15:!1},null,512),m(I,{ref_key:"noteRef",ref:h,class:"tMar20",spanTitleWidth:"80px",inputWidth:"80%",title:"备注",haverMar15:!1},null,512)])),[[s,j.value]])])),_:1},8,["dialogVisible","dialog-title"])}}}),[["__scopeId","data-v-720f9bdc"]]),V={class:"screenBox flex",style:{padding:"10px 15px"}},z=y("新增团队"),D={class:"text-center"},A=["onClick"],P=M(i({__name:"index",setup(a){const i=l([{name:"团队名称",column:"name"},{name:"备注",column:"note",cancleForMat:!0},{name:"创建时间",column:"created_at"},{name:"操作",column:"operate",slotFlag:!0}]),{tableInfo:n,tableListRef:u,total:y}=x(i),w=e=>{c((()=>{I.value.switchShow(!0,e||"")}))},I=o(),M=o(""),R=async()=>{u.value.loading=!0,k({name:M.value}).then((e=>{u.value.loading=!1,n.tableList=e})).catch((()=>{u.value.loading=!1}))},P=async a=>{var t;u.value.loading=!0,(t={id:a.id},new Promise((async(a,s)=>{const i=await L.post("/api/sys/teamDel",t);0==i.errNo?a(i.rst):(e.error(i.errMsg),s())}))).then((()=>{u.value.loading=!1,R()})).catch((()=>{u.value.loading=!1}))};return v((async()=>{await R()})),(e,a)=>{const i=t,l=s;return r(),d(_,null,[f("div",V,[m(l,{onKeyup:h(R,["enter","native"]),onClear:a[1]||(a[1]=e=>R()),style:{width:"260px"},modelValue:M.value,"onUpdate:modelValue":a[2]||(a[2]=e=>M.value=e),placeholder:"请输入团队名称搜索"},{append:p((()=>[m(i,{icon:j(C),onClick:a[0]||(a[0]=e=>R())},null,8,["icon"])])),_:1},8,["onKeyup","modelValue"]),m(i,{type:"primary",size:"default",class:"lMarauto",onClick:a[3]||(a[3]=e=>w())},{default:p((()=>[z])),_:1})]),m(b,{ref_key:"tableListRef",ref:u,tableData:j(n).tableList,descol:j(n).descolList,total:j(y),onInit:R},{operate:p((e=>[f("div",D,[f("span",{class:"operate_text lMar8 pointer",onClick:a=>w(e.row)},"编辑",8,A),m(g,{onConfirm:a=>P(e.row)},null,8,["onConfirm"])])])),_:1},8,["tableData","descol","total"]),m(T,{ref_key:"AddProjectRef",ref:I,onInit:R},null,512)],64)}}}),[["__scopeId","data-v-45261e45"]]);export{P as default};
|