Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

RefillDialog.c88cba4f.js 12KB

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