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 f,a5 as Z,o as I,D as ee,c as p,e as i,G as _,i as o,g as E,h as a,f as b,F as v,H as V,t as le,j as M,u as w,q as te}from"./index.35a9731b.js";import{f as m}from"./expertStore.19e31da5.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:x}=X(Y.dictStore),S=f([]),P=f({multiple:!0}),{proxy:$}=te(),c=Z(j,"modelValue");I(async()=>{const e=await ee({regionCode:330500,regionLevel:2}),l=[];l.push(e.data),S.value=G(l),await T("technical_expertise"),await T("industry_sector"),await T("expert_source"),await T("good_at"),await T("other")});const G=e=>e.map(r=>{const d={};if(d.value=r.unionCode,d.label=r.name,r.children&&r.children.length){d.children=r.children.map(n=>({value:n.unionCode,label:n.name}));const u=G(r.children);d.children=[...u]}return d}),q=()=>{if(c.value.length>=5){$.$message.warning("\u6700\u591A\u6DFB\u52A05\u4E2A\u89C4\u5219");return}c.value.push({})},H=e=>{c.value.splice(e,1)},D=f([]),A=f([]),k=f([]),N=f([]),B=f([]),T=async e=>{if(e==="technical_expertise"&&D.value.length===0){const l=await m({rootTagCodeList:[e]});D.value=y(l)[0].children}else if(e==="industry_sector"&&A.value.length===0){const l=await m({rootTagCodeList:[e]});A.value=y(l)[0].children}else if(e==="expert_source"&&k.value.length===0){const l=await m({rootTagCodeList:[e]});k.value=y(l)[0].children}else if(e==="good_at"&&N.value.length===0){const l=await m({rootTagCodeList:[e]});N.value=y(l)[0].children}else if(e==="other"&&B.value.length===0){const l=await m({rootTagCodeList:[e]});B.value=y(l)[0].children}},y=e=>e==null?void 0:e.map(r=>{const d={};if(d.value=r.parentCode+"##"+r.unionCode,d.label=r.tagName,r.children&&r.children.length){d.children=r.children.map(n=>({value:n.parentCode+"##"+n.unionCode,label:n.tagName}));const u=y(r.children);d.children=[...u]}return d});J({handleParmas:O});function O(){const e=c.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 r=p("el-button"),d=p("el-input-number"),u=p("el-form-item"),n=p("el-col"),C=p("el-row"),R=p("el-option"),L=p("el-select"),U=p("el-cascader"),F=p("el-card");return i(),_(F,{class:"mb-16",shadow:"never"},{header:o(()=>l[0]||(l[0]=[E("div",{class:"card-header"},[E("span",null,"\u62BD\u53D6\u4FE1\u606F")],-1)])),default:o(()=>[a(C,{gutter:20},{default:o(()=>[a(n,{span:24},{default:o(()=>[a(u,{label:"\u62BD\u53D6\u89C4\u5219"},{default:o(()=>[(i(!0),b(v,null,V(c.value,(s,g)=>(i(),_(F,{key:g,class:"box-card w-full mb-8"},{header:o(()=>[E("div",ae,[E("span",null,"\u89C4\u5219"+le(g+1),1),a(r,{type:"danger",plain:"",icon:"Delete",disabled:c.value.length===1,onClick:t=>H(g)},{default:o(()=>l[1]||(l[1]=[M(" \u5220\u9664\u89C4\u5219 ")])),_:2},1032,["disabled","onClick"])])]),default:o(()=>[a(C,{class:"mt-8",gutter:10},{default:o(()=>[a(n,{span:8},{default:o(()=>[a(u,{label:"\u9080\u8BF7\u6570\u91CF","label-width":100},{default:o(()=>[a(d,{modelValue:c.value[g].count,"onUpdate:modelValue":t=>c.value[g].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(C,{gutter:10,class:"mt-8"},{default:o(()=>[a(n,{span:8},{default:o(()=>[a(u,{label:"\u5176\u4ED6\u6807\u7B7E","label-width":100},{default:o(()=>[a(L,{modelValue:c.value[g].otherTag,"onUpdate:modelValue":t=>c.value[g].otherTag=t,class:"w-full",clearable:"",placeholder:"\u8BF7\u9009\u62E9"},{default:o(()=>[(i(!0),b(v,null,V(B.value,t=>(i(),_(R,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),a(n,{span:8},{default:o(()=>[a(u,{label:"\u4E13\u5BB6\u7EA7\u522B","label-width":100},{default:o(()=>[a(U,{modelValue:s.expertRegionList,"onUpdate:modelValue":t=>s.expertRegionList=t,clearable:"",options:S.value,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",props:P.value},null,8,["modelValue","onUpdate:modelValue","options","props"])]),_:2},1024)]),_:2},1024),a(n,{span:8},{default:o(()=>[a(u,{label:"\u5185\u5916\u56F4","label-width":100},{default:o(()=>[a(L,{modelValue:s.expertType,"onUpdate:modelValue":t=>s.expertType=t,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",clearable:""},{default:o(()=>[(i(!0),b(v,null,V(w(x)&&w(x).length&&w(x).find(t=>t.dictionaryName==="expert_type").dictionaryList,(t,h)=>(i(),_(R,{key:h,label:t.describe,value:t.dictionaryCode},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024)]),_:2},1024),a(C,{gutter:10,class:"mt-8"},{default:o(()=>[a(n,{span:8},{default:o(()=>[a(u,{label:"\u5C65\u804C\u610F\u5411","label-width":100},{default:o(()=>[a(U,{modelValue:s.intentionRegion,"onUpdate:modelValue":t=>s.intentionRegion=t,options:S.value,class:"w-full",clearable:""},null,8,["modelValue","onUpdate:modelValue","options"])]),_:2},1024)]),_:2},1024),a(n,{span:8},{default:o(()=>[a(u,{label:"\u4E13\u5BB6\u6765\u6E90","label-width":100},{default:o(()=>[a(L,{modelValue:s.expertSource,"onUpdate:modelValue":t=>s.expertSource=t,class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:""},{default:o(()=>[(i(!0),b(v,null,V(k.value,(t,h)=>(i(),_(R,{key:h,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),a(n,{span:8},{default:o(()=>[a(u,{label:"\u804C\u79F0\u7EA7\u522B","label-width":100},{default:o(()=>[a(L,{modelValue:s.professionalLevel,"onUpdate:modelValue":t=>s.professionalLevel=t,class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:""},{default:o(()=>[(i(!0),b(v,null,V(w(x)&&w(x).length&&w(x).find(t=>t.dictionaryName==="title_level").dictionaryList,(t,h)=>(i(),_(R,{key:h,label:t.describe,value:t.dictionaryCode},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024)]),_:2},1024),a(C,{gutter:10,class:"mt-8"},{default:o(()=>[a(n,{span:8},{default:o(()=>[a(u,{label:"\u64C5\u957F\u65B9\u5411","label-width":100},{default:o(()=>[a(L,{modelValue:s.goodAt,"onUpdate:modelValue":t=>s.goodAt=t,class:"w-full",placeholder:"\u8BF7\u9009\u62E9",clearable:""},{default:o(()=>[(i(!0),b(v,null,V(N.value,(t,h)=>(i(),_(R,{key:h,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1024),a(n,{span:8},{default:o(()=>[a(u,{label:"\u6280\u672F\u4E13\u957F","label-width":100},{default:o(()=>[a(U,{modelValue:s.technicalExpertise,"onUpdate:modelValue":t=>s.technicalExpertise=t,options:D.value,placeholder:"\u8BF7\u9009\u62E9",class:"w-full",clearable:""},null,8,["modelValue","onUpdate:modelValue","options"])]),_:2},1024)]),_:2},1024),a(n,{span:8},{default:o(()=>[a(u,{label:"\u884C\u4E1A\u9886\u57DF","label-width":100},{default:o(()=>[a(U,{modelValue:s.industrySector,"onUpdate:modelValue":t=>s.industrySector=t,options:A.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(r,{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};