選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

2 行
2.8KB

  1. import{a as L,r as _,B as O,b as n,c as T,L as x,h as l,e as h,f as o,i as v,k as R,Z as z}from"./index-dd5fae99.js";const E={class:"search mb-16"},J={class:"dialog-footer"},$=R({name:"userListDialog"}),A=Object.assign($,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},params:{type:Object,default:()=>({})}},emits:["close","getProjectData"],setup(k,{emit:w}){const c=k,g=w,d=L({name:void 0}),u=_(),N=_(0),I=[{type:"selection",reserveSelection:!0,width:"55"},{label:"姓名",key:"name",prop:"name"},{label:"手机号码",key:"phoneNo",prop:"phoneNo",width:"150"},{label:"所属单位(主职)",key:"orgName",prop:"orgName",showOverflowTooltip:!0,width:250},{label:"所属区域",key:"regionName",prop:"regionName",width:"150"}],i=_([]),f=async(s=(e=>(e=u.value)==null?void 0:e.pageParams)())=>{const a=await z({...s,...d,...c.params});N.value=a.data.total,i.value=a.data.records||[];const t=JSON.parse(JSON.stringify(r.value))||[];t!=null&&t.length&&i.value&&i.value.forEach(m=>{t.map(b=>b.userId).includes(m.userId)&&u.value.toggleRowSelect(m,!0)})},C=()=>{u.value.pageParams.pageNumber=1,f()},D=()=>{d.name=void 0,u.value.pageParams.pageNumber=1,u.value.pageParams.pageSize=10,f()},r=_([]),P=s=>{const e=s.map(a=>a.userId);i.value.forEach(a=>{e.includes(a.userId)?r.value.push(a):r.value=r.value.filter(t=>t.userId!==a.userId)})},S=()=>{const s={},e=r.value.reduce((a,t)=>(s[t.userId]||(s[t.userId]=a.push(t)),a),[]);g("getProjectData",e)};return O(()=>c.visible,async s=>{var e;s&&((e=c.data)!=null&&e.length?r.value=c.data.map(a=>a):r.value=[],f())}),(s,e)=>{const a=n("el-input"),t=n("el-form-item"),m=n("el-col"),p=n("el-button"),b=n("el-row"),V=n("el-form"),j=n("table-list"),B=n("el-dialog");return T(),x(B,{"model-value":k.visible,title:"添加人员",width:"70%","destroy-on-close":"",onClose:e[2]||(e[2]=y=>g("close"))},{footer:l(()=>[h("span",J,[o(p,{onClick:e[1]||(e[1]=y=>g("close"))},{default:l(()=>e[5]||(e[5]=[v("关闭")])),_:1}),o(p,{type:"primary",onClick:S},{default:l(()=>e[6]||(e[6]=[v(" 确定 ")])),_:1})])]),default:l(()=>[h("div",E,[o(V,{"label-suffix":":",model:d,size:"small"},{default:l(()=>[o(b,{gutter:16},{default:l(()=>[o(m,{span:8},{default:l(()=>[o(t,{label:"用户姓名"},{default:l(()=>[o(a,{modelValue:d.name,"onUpdate:modelValue":e[0]||(e[0]=y=>d.name=y),placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1}),o(m,{span:16},{default:l(()=>[o(t,{class:"btn"},{default:l(()=>[o(p,{type:"primary",onClick:C},{default:l(()=>e[3]||(e[3]=[v("查询")])),_:1}),o(p,{onClick:D},{default:l(()=>e[4]||(e[4]=[v("重置")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),o(j,{ref_key:"tableListRef",ref:u,column:I,data:i.value,total:N.value,"row-key":"userId",onSelectionChange:P,onGetTableData:f},null,8,["data","total"])]),_:1},8,["model-value"])}}});export{A as default};