|
- import{C as O,B as q,r as R,b as X,o as Y,D as Z,c as g,e as p,G as f,i as n,g as U,h as a,f as _,F as b,H as x,t as $,j as P,u as I,q as ee}from"./index.13afb401.js";import{f as D}from"./expertStore.6088ad4d.js";const le={class:"card-header flex justify-between"},re={__name:"RefillDialog",setup(te){const{dictList:m}=O(q.dictStore),k=R([]),H=R({multiple:!0}),{proxy:M}=ee(),C=R([0]),W=O(q.userStore).userInfo||{},o=X({expertInviteRule:{inviteType:1,randomRules:[{expertDicts:[],expertTags:[]}],appointRule:{},avoidRule:{avoidUnitIdList:[],avoidOrgIdList:[],expertIds:[],avoidType:W.value.regionName==="\u5E02\u672C\u7EA7"?2:1}},meetingBasicInfo:{isInnerProject:!0}});Y(async()=>{const t=await Z({regionCode:330500,regionLevel:2}),l=[];l.push(t.data),k.value=A(l)});const A=t=>t.map(r=>{const u={};if(u.value=r.unionCode,u.label=r.name,r.children&&r.children.length){u.children=r.children.map(d=>({value:d.unionCode,label:d.name}));const s=A(r.children);u.children=[...s]}return u}),z=()=>{if(o.expertInviteRule.randomRules.length>=5){M.$message.warning("\u6700\u591A\u6DFB\u52A05\u4E2A\u89C4\u5219");return}C.value.push(C.value.length),o.expertInviteRule.randomRules.push({expertDicts:[],expertTags:[]})},J=t=>{o.expertInviteRule.randomRules.splice(t,1),C.value.splice(t,1)},y=(t,l)=>{let r,u,s;if(t)Array.isArray(t)?(r=t[0].split("##")[0],u=t[t.length-1].split("##")[0],s={tagGeneralType:r,tagCodes:[t[t.length-1].split("##")[2]],expertTag:r}):(u=t.split("##")[0],s={tagType:u,tagCodes:[t.split("##")[2]],expertTag:u});else{s=void 0,o.expertInviteRule.randomRules[l].expertTags=[];return}if(o.expertInviteRule.randomRules[l].expertTags.length===0)o.expertInviteRule.randomRules[l].expertTags.push(s);else if(Array.isArray(t)){const d=o.expertInviteRule.randomRules[l].expertTags.findIndex(c=>c.tagGeneralType===r);d!==-1?o.expertInviteRule.randomRules[l].expertTags.splice(d,1,s):o.expertInviteRule.randomRules[l].expertTags.push(s)}else{const d=o.expertInviteRule.randomRules[l].expertTags.findIndex(c=>c.tagType===u);d!==-1?o.expertInviteRule.randomRules[l].expertTags.splice(d,1,s):o.expertInviteRule.randomRules[l].expertTags.push(s)}},F=(t,l)=>{if(!t){o.expertInviteRule.randomRules[l].expertDicts=[];return}const r=t.split("##")[1],u={dictCodes:[t.split("##")[0]],expertDict:r};if(o.expertInviteRule.randomRules[l].expertDicts.length===0)o.expertInviteRule.randomRules[l].expertDicts.push(u);else{const s=o.expertInviteRule.randomRules[l].expertDicts.findIndex(d=>d.expertDict===r);s!==-1?o.expertInviteRule.randomRules[l].expertDicts.splice(s,1,u):o.expertInviteRule.randomRules[l].expertDicts.push(u)}},K=(t,l)=>{let r=[];t?r=t.pop().split("##"):r=[];const u=r==null?void 0:r[0],s=r==null?void 0:r[2];o.expertInviteRule.randomRules[l].intentionRegionCode=u,o.expertInviteRule.randomRules[l].intentionRegionLevel=s},S=R([]),E=R([]),N=R([]),B=R([]),j=R([]),T=async t=>{if(t==="technical_expertise"&&S.value.length===0){const l=await D({rootTagCodeList:[t]});S.value=v(l)[0].children}else if(t==="industry_sector"&&E.value.length===0){const l=await D({rootTagCodeList:[t]});E.value=v(l)[0].children}else if(t==="expert_source"&&N.value.length===0){const l=await D({rootTagCodeList:[t]});N.value=v(l)[0].children}else if(t==="good_at"&&B.value.length===0){const l=await D({rootTagCodeList:[t]});B.value=v(l)[0].children}else if(t==="other"&&j.value.length===0){const l=await D({rootTagCodeList:[t]});j.value=v(l)[0].children}},v=t=>t==null?void 0:t.map(r=>{const u={};if(u.value=r.parentCode+"##"+r.unionCode,u.label=r.tagName,r.children&&r.children.length){u.children=r.children.map(d=>({value:d.parentCode+"##"+d.unionCode,label:d.tagName}));const s=v(r.children);u.children=[...s]}return u}),Q=(t,l)=>{var r;console.log(o.expertInviteRule.randomRules[l].expertRegionLists),o.expertInviteRule.randomRules[l].expertRegionList=((r=o.expertInviteRule.randomRules[l].expertRegionLists)==null?void 0:r.map(u=>{var s,d;return{regionCode:(s=u[u.length-1])==null?void 0:s.split("##")[0],regionLevel:((d=u[u.length-1])==null?void 0:d.split("##")[2])*1}}))||[]};return(t,l)=>{const r=g("el-button"),u=g("el-input-number"),s=g("el-form-item"),d=g("el-col"),c=g("el-row"),V=g("el-option"),w=g("el-select"),L=g("el-cascader"),G=g("el-card");return p(),f(G,{class:"mb-16",shadow:"never"},{header:n(()=>l[5]||(l[5]=[U("div",{class:"card-header"},[U("span",null,"\u62BD\u53D6\u4FE1\u606F")],-1)])),default:n(()=>[a(c,{gutter:20},{default:n(()=>[a(d,{span:24},{default:n(()=>[a(s,{label:"\u62BD\u53D6\u89C4\u5219"},{default:n(()=>[(p(!0),_(b,null,x(C.value,(ae,i)=>(p(),f(G,{key:i,class:"box-card w-full mb-8"},{header:n(()=>[U("div",le,[U("span",null,"\u89C4\u5219"+$(i+1),1),a(r,{type:"danger",plain:"",icon:"Delete",disabled:C.value.length===1,onClick:e=>J(i)},{default:n(()=>l[6]||(l[6]=[P(" \u5220\u9664\u89C4\u5219 ")])),_:2},1032,["disabled","onClick"])])]),default:n(()=>[a(c,{class:"mt-8",gutter:10},{default:n(()=>[a(d,{span:8},{default:n(()=>[a(s,{label:"\u9080\u8BF7\u6570\u91CF","label-width":100,prop:`expertInviteRule.randomRules[${i}].count`,rules:[{required:!0,message:" ",trigger:"blur"}]},{default:n(()=>[a(u,{modelValue:o.expertInviteRule.randomRules[i].count,"onUpdate:modelValue":e=>o.expertInviteRule.randomRules[i].count=e,placeholder:"\u8BF7\u8F93\u5165",min:1,controls:!1,step:1,"step-strictly":""},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])]),_:2},1024)]),_:2},1024),a(c,{gutter:10,class:"mt-8"},{default:n(()=>[a(d,{span:8},{default:n(()=>[a(s,{label:"\u5176\u4ED6\u6807\u7B7E","label-width":100},{default:n(()=>[a(w,{modelValue:o.expertInviteRule.randomRules[i].otherTag,"onUpdate:modelValue":e=>o.expertInviteRule.randomRules[i].otherTag=e,class:"w-full",clearable:"",placeholder:"\u8BF7\u9009\u62E9",onChange:e=>y(e,i),onVisibleChange:l[0]||(l[0]=e=>T("other"))},{default:n(()=>[(p(!0),_(b,null,x(j.value,e=>(p(),f(V,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024)]),_:2},1024),a(d,{span:8},{default:n(()=>[a(s,{label:"\u4E13\u5BB6\u7EA7\u522B","label-width":100},{default:n(()=>[a(L,{modelValue:o.expertInviteRule.randomRules[i].expertRegionLists,"onUpdate:modelValue":e=>o.expertInviteRule.randomRules[i].expertRegionLists=e,clearable:"",options:k.value,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",props:H.value,onChange:e=>Q(e,i)},null,8,["modelValue","onUpdate:modelValue","options","props","onChange"])]),_:2},1024)]),_:2},1024),a(d,{span:8},{default:n(()=>[a(s,{label:"\u5185\u5916\u56F4","label-width":100},{default:n(()=>[a(w,{modelValue:o.expertInviteRule.randomRules[i].expertType,"onUpdate:modelValue":e=>o.expertInviteRule.randomRules[i].expertType=e,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",clearable:"",onChange:e=>F(e,i)},{default:n(()=>[(p(!0),_(b,null,x(I(m)&&I(m).length&&I(m).find(e=>e.dictionaryName==="expert_type").dictionaryList,(e,h)=>(p(),f(V,{key:h,label:e.describe,value:e.dictionaryCode+"##"+e.dictionaryType},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024)]),_:2},1024)]),_:2},1024),a(c,{gutter:10,class:"mt-8"},{default:n(()=>[a(d,{span:8},{default:n(()=>[a(s,{label:"\u5C65\u804C\u610F\u5411","label-width":100},{default:n(()=>[a(L,{options:k.value,class:"w-full",clearable:"",onChange:e=>K(e,i)},null,8,["options","onChange"])]),_:2},1024)]),_:2},1024),a(d,{span:8},{default:n(()=>[a(s,{label:"\u4E13\u5BB6\u6765\u6E90","label-width":100},{default:n(()=>[a(w,{modelValue:o.expertInviteRule.randomRules[i].expertSource,"onUpdate:modelValue":e=>o.expertInviteRule.randomRules[i].expertSource=e,class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:"",onChange:e=>y(e,i),onVisibleChange:l[1]||(l[1]=e=>T("expert_source"))},{default:n(()=>[(p(!0),_(b,null,x(N.value,(e,h)=>(p(),f(V,{key:h,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024)]),_:2},1024),a(d,{span:8},{default:n(()=>[a(s,{label:"\u804C\u79F0\u7EA7\u522B","label-width":100},{default:n(()=>[a(w,{modelValue:o.expertInviteRule.randomRules[i].professionalLevel,"onUpdate:modelValue":e=>o.expertInviteRule.randomRules[i].professionalLevel=e,class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:"",onChange:e=>F(e,i)},{default:n(()=>[(p(!0),_(b,null,x(I(m)&&I(m).length&&I(m).find(e=>e.dictionaryName==="title_level").dictionaryList,(e,h)=>(p(),f(V,{key:h,label:e.describe,value:e.dictionaryCode+"##"+e.dictionaryType},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024)]),_:2},1024)]),_:2},1024),a(c,{gutter:10,class:"mt-8"},{default:n(()=>[a(d,{span:8},{default:n(()=>[a(s,{label:"\u64C5\u957F\u65B9\u5411","label-width":100},{default:n(()=>[a(w,{modelValue:o.expertInviteRule.randomRules[i].goodAt,"onUpdate:modelValue":e=>o.expertInviteRule.randomRules[i].goodAt=e,class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:"",onChange:e=>y(e,i),onVisibleChange:l[2]||(l[2]=e=>T("good_at"))},{default:n(()=>[(p(!0),_(b,null,x(B.value,(e,h)=>(p(),f(V,{key:h,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024)]),_:2},1024),a(d,{span:8},{default:n(()=>[a(s,{label:"\u6280\u672F\u4E13\u957F","label-width":100},{default:n(()=>[a(L,{options:S.value,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",clearable:"",onChange:e=>y(e,i),onVisibleChange:l[3]||(l[3]=e=>T("technical_expertise"))},null,8,["options","onChange"])]),_:2},1024)]),_:2},1024),a(d,{span:8},{default:n(()=>[a(s,{label:"\u884C\u4E1A\u9886\u57DF","label-width":100},{default:n(()=>[a(L,{options:E.value,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",clearable:"",onChange:e=>y(e,i),onVisibleChange:l[4]||(l[4]=e=>T("industry_sector"))},null,8,["options","onChange"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),a(r,{class:"w-full",type:"primary",icon:"plus",plain:"",onClick:z},{default:n(()=>l[7]||(l[7]=[P("\u6DFB\u52A0\u89C4\u5219")])),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}}};export{re as default};
|