You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
9.0KB

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