Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

2 рядки
2.9KB

  1. import{d as B,b as L,r as _,J as T,c as n,e as x,G as J,i as l,g as k,h as o,j as v,Y as R}from"./index.e8b71da7.js";const z={class:"search mb-16"},E={class:"dialog-footer"},G=B({name:"userListDialog"}),q=Object.assign(G,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},params:{type:Object,default:()=>({})}},emits:["close","getProjectData"],setup(N,{emit:w}){const c=N,g=w,d=L({name:void 0}),u=_(),h=_(0),I=[{type:"selection",reserveSelection:!0,width:"55"},{label:"\u59D3\u540D",key:"name",prop:"name"},{label:"\u624B\u673A\u53F7\u7801",key:"phoneNo",prop:"phoneNo",width:"150"},{label:"\u6240\u5C5E\u5355\u4F4D\uFF08\u4E3B\u804C\uFF09",key:"orgName",prop:"orgName",showOverflowTooltip:!0,width:250},{label:"\u6240\u5C5E\u533A\u57DF",key:"regionName",prop:"regionName",width:"150"}],i=_([]),f=async(s=(e=>(e=u.value)==null?void 0:e.pageParams)())=>{const a=await R({...s,...d,...c.params});h.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()},j=()=>{d.name=void 0,u.value.pageParams.pageNumber=1,u.value.pageParams.pageSize=10,f()},r=_([]),D=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)})},P=()=>{const s={},e=r.value.reduce((a,t)=>(s[t.userId]||(s[t.userId]=a.push(t)),a),[]);g("getProjectData",e)};return T(()=>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"),S=n("el-form"),V=n("table-list"),O=n("el-dialog");return x(),J(O,{"model-value":N.visible,title:"\u6DFB\u52A0\u4EBA\u5458",width:"70%","destroy-on-close":"",onClose:e[2]||(e[2]=y=>g("close"))},{footer:l(()=>[k("span",E,[o(p,{onClick:e[1]||(e[1]=y=>g("close"))},{default:l(()=>e[5]||(e[5]=[v("\u5173\u95ED")])),_:1}),o(p,{type:"primary",onClick:P},{default:l(()=>e[6]||(e[6]=[v(" \u786E\u5B9A ")])),_:1})])]),default:l(()=>[k("div",z,[o(S,{"label-suffix":":",model:d,size:"small"},{default:l(()=>[o(b,{gutter:16},{default:l(()=>[o(m,{span:8},{default:l(()=>[o(t,{label:"\u7528\u6237\u59D3\u540D"},{default:l(()=>[o(a,{modelValue:d.name,"onUpdate:modelValue":e[0]||(e[0]=y=>d.name=y),placeholder:"\u8BF7\u8F93\u5165"},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("\u67E5\u8BE2")])),_:1}),o(p,{onClick:j},{default:l(()=>e[4]||(e[4]=[v("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),o(V,{ref_key:"tableListRef",ref:u,column:I,data:i.value,total:h.value,"row-key":"userId",onSelectionChange:D,onGetTableData:f},null,8,["data","total"])]),_:1},8,["model-value"])}}});export{q as default};