|
1 |
- import{c as O}from"./expertStore.778691cb.js";import{d as j,b as J,r as f,J as P,D as $,B as q,c as i,e as G,G as A,i as l,h as t,j as y,g as C,t as F,q as H}from"./index.149277cd.js";const K={class:"search mb-16"},M=j({name:"driverDialog"}),X=Object.assign(M,{props:{visible:{type:Boolean,default:!1,required:!0},data:{type:Array,default:void 0},selectExpertType:{type:Number,default:1}},emits:["close","getUserData"],setup(I,{emit:h}){const{proxy:V}=H(),c=I,b=h,o=J({expertRegionLevel:void 0,expertName:void 0,company:void 0}),u=f(),N=f(0),S=[{type:"selection",reserveSelection:!0,width:"55"},{label:"\u59D3\u540D",key:"expertName",prop:"expertName"},{label:"\u5DE5\u4F5C\u5355\u4F4D",key:"company",prop:"company",showOverflowTooltip:!0,width:250},{label:"\u4E13\u5BB6\u7EA7\u522B",key:"expertRegionInfo",slot:"expertRegionInfo",width:"150"},{label:"\u624B\u673A\u53F7\u7801",key:"phoneNo",prop:"phoneNo",width:"150"},{label:"\u4E13\u5BB6\u7C7B\u578B",key:"expertType[0].dictionaryName",prop:"expertType[0].dictionaryName",width:"150"}],m=f([]),g=async(s=(e=>(e=u.value)==null?void 0:e.pageParams)())=>{const n=await O({...s,...o,expertRegionInfo:o.expertRegionInfo?{regionCode:o.expertRegionInfo.slice(-1)[0].split("##")[0],regionLevel:o.expertRegionInfo.slice(-1)[0].split("##")[2],regionName:o.expertRegionInfo.slice(-1)[0].split("##")[1]}:void 0});N.value=n.data.total,m.value=n.data.records||[];const a=JSON.parse(JSON.stringify(p.value));a!=null&&a.length&&m.value&&m.value.forEach(d=>{a.map(v=>v.userId*1).includes(d.userId)&&u.value.toggleRowSelect(d,!0)})},T=()=>{g()},D=()=>{o.expertRegionInfo=void 0,o.expertName=void 0,o.company=void 0,u.value.pageParams.pageNumber=1,u.value.pageParams.pageSize=10,g()},p=f([]),L=s=>{const e=s.map(n=>n.userId);m.value.forEach(n=>{e.includes(n.userId)?p.value.push(n):p.value=p.value.filter(a=>a.userId!==n.userId)})},B=()=>{const s={},e=p.value.reduce((n,a)=>(s[a.userId]||(s[a.userId]=n.push(a)),n),[]);c.selectExpertType===1&&(e==null?void 0:e.length)>10?V.$message.warning("\u6700\u591A\u9009\u62E910\u4F4D\u4EBA\u5458"):b("getUserData",e)},w=f([]);return P(()=>c.visible,async s=>{var e;if(s){(e=c.data)!=null&&e.length&&(p.value=c.data.map(a=>a));const n=await $({regionCode:330500,regionLevel:2});w.value=[n.data],g(),q.userStore.setRoleStore()}}),(s,e)=>{const n=i("el-cascader"),a=i("el-form-item"),d=i("el-col"),x=i("el-input"),v=i("el-row"),_=i("el-button"),E=i("el-form"),U=i("table-list"),z=i("el-dialog");return G(),A(z,{"model-value":I.visible,title:"\u9009\u62E9\u4EBA\u5458",width:"840px","destroy-on-close":"",onClose:e[4]||(e[4]=r=>b("close"))},{footer:l(()=>[t(_,{type:"primary",size:"small",onClick:B},{default:l(()=>e[7]||(e[7]=[y(" \u786E\u5B9A ")])),_:1}),t(_,{size:"small",onClick:e[3]||(e[3]=r=>b("close"))},{default:l(()=>e[8]||(e[8]=[y(" \u5173\u95ED ")])),_:1})]),default:l(()=>[C("div",K,[t(E,{"label-suffix":":",model:o,size:"small"},{default:l(()=>[t(v,{gutter:16,class:"mb-16"},{default:l(()=>[t(d,{span:8},{default:l(()=>[t(a,{label:"\u4E13\u5BB6\u7EA7\u522B"},{default:l(()=>[t(n,{modelValue:o.expertRegionInfo,"onUpdate:modelValue":e[0]||(e[0]=r=>o.expertRegionInfo=r),options:w.value,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",props:{value:"unionCode",label:"name"}},null,8,["modelValue","options"])]),_:1})]),_:1}),t(d,{span:8},{default:l(()=>[t(a,{label:"\u4E13\u5BB6\u59D3\u540D"},{default:l(()=>[t(x,{modelValue:o.expertName,"onUpdate:modelValue":e[1]||(e[1]=r=>o.expertName=r),placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1}),t(d,{span:8},{default:l(()=>[t(a,{label:"\u5DE5\u4F5C\u5355\u4F4D"},{default:l(()=>[t(x,{modelValue:o.company,"onUpdate:modelValue":e[2]||(e[2]=r=>o.company=r),maxlength:"11",placeholder:"\u8BF7\u8F93\u5165"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),t(v,null,{default:l(()=>[t(d,{span:24},{default:l(()=>[t(a,{class:"btn"},{default:l(()=>[t(_,{type:"primary",onClick:T},{default:l(()=>e[5]||(e[5]=[y("\u67E5\u8BE2")])),_:1}),t(_,{onClick:D},{default:l(()=>e[6]||(e[6]=[y("\u91CD\u7F6E")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])]),t(U,{ref_key:"tableListRef",ref:u,column:S,data:m.value,total:N.value,"row-key":"userId",onSelectionChange:L,onGetTableData:g},{expertRegionInfo:l(({scope:r})=>{var R,k;return[C("span",null,F(((k=(R=r.row)==null?void 0:R.expertRegionInfo)==null?void 0:k.regionName)||"-"),1)]}),_:1},8,["data","total"])]),_:1},8,["model-value"])}}});export{X as default};
|