您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

2 行
12KB

  1. import{G as H,E as M,r as c,a as le,o as te,V as ae,B as oe,b as R,c as p,L as h,h as s,e as U,f as n,d as b,F as _,H as y,t as ne,i as B,u as I,s as re}from"./index-dd5fae99.js";import{f as x}from"./expertStore-7d1ebc1f.js";import{c as se}from"./reviewMeeting-39e99ddc.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==="市本级"?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("最多添加5个规则");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([]),E=c([]),N=c([]),j=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"&&E.value.length===0){const e=await x({rootTagCodeList:[a]});E.value=f(e)[0].children}else if(a==="other"&&N.value.length===0){const e=await x({rootTagCodeList:[a]});N.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 P=c(["technical_expertise##计算机科学技术##3020000","3020000##人工智能##3020200","3020200##机器翻译##3020203"]),z=c([["330500##湖州市##2","330503##南浔区##3"],["330500##湖州市##2","330521##德清县##3"]]),O=c(["330500##湖州市##2","330521##德清县##3"]),J=c(["industry_sector##制造业##4030000","4030000##酒、饮料及精制茶制造业##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"),q=R("el-card");return p(),h(q,{class:"mb-16",shadow:"never"},{header:s(()=>e[7]||(e[7]=[U("div",{class:"card-header"},[U("span",null,"抽取信息")],-1)])),default:s(()=>[n(g,{gutter:20},{default:s(()=>[n(d,{span:24},{default:s(()=>[n(u,{label:"抽取规则"},{default:s(()=>[(p(!0),b(_,null,y(o.expertInviteRule.randomRules,(de,i)=>(p(),h(q,{key:i,class:"box-card w-full mb-8"},{header:s(()=>[U("div",ue,[U("span",null,"规则"+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(" 删除规则 ")])),_:2},1032,["disabled","onClick"])])]),default:s(()=>[n(g,{class:"mt-8",gutter:10},{default:s(()=>[n(d,{span:8},{default:s(()=>[n(u,{label:"邀请数量","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:"请输入",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:"其他标签","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:"请选择",onChange:l=>T(l,i),onVisibleChange:e[0]||(e[0]=l=>j("other"))},{default:s(()=>[(p(!0),b(_,null,y(N.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:"专家级别","label-width":100},{default:s(()=>[n(k,{modelValue:z.value,"onUpdate:modelValue":e[1]||(e[1]=l=>z.value=l),clearable:"",options:S.value,placeholder:"请选择",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:"内外围","label-width":100},{default:s(()=>[n(V,{modelValue:o.expertInviteRule.randomRules[i].expertType,"onUpdate:modelValue":l=>o.expertInviteRule.randomRules[i].expertType=l,placeholder:"请选择",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:"履职意向","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:"专家来源","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:"请选择",clearable:"",onChange:l=>T(l,i),onVisibleChange:e[3]||(e[3]=l=>j("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:"职称级别","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:"请选择",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:"擅长方向","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:"请选择",clearable:"",onChange:l=>T(l,i),onVisibleChange:e[4]||(e[4]=l=>j("good_at"))},{default:s(()=>[(p(!0),b(_,null,y(E.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:"技术专长","label-width":100},{default:s(()=>[n(k,{modelValue:P.value,"onUpdate:modelValue":e[5]||(e[5]=l=>P.value=l),options:w.value,placeholder:"请选择",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:"行业领域","label-width":100},{default:s(()=>[n(k,{modelValue:J.value,"onUpdate:modelValue":e[6]||(e[6]=l=>J.value=l),options:L.value,placeholder:"请选择",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("添加规则")])),_:1})]),_:1})]),_:1})]),_:1}),n(t,{onClick:ee},{default:s(()=>e[10]||(e[10]=[B("测试")])),_:1})]),_:1})}}};export{ge as default};