|
- var Z=Object.defineProperty,ee=Object.defineProperties;var te=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var ae=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var j=(p,s,e)=>s in p?Z(p,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):p[s]=e,$=(p,s)=>{for(var e in s||(s={}))ae.call(s,e)&&j(p,e,s[e]);if(S)for(var e of S(s))le.call(s,e)&&j(p,e,s[e]);return p},C=(p,s)=>ee(p,te(s));var E=(p,s,e)=>new Promise((V,T)=>{var f=m=>{try{t(e.next(m))}catch(v){T(v)}},k=m=>{try{t(e.throw(m))}catch(v){T(v)}},t=m=>m.done?V(m.value):Promise.resolve(m.value).then(f,k);t((e=e.apply(p,s)).next())});import{_ as oe,d as ne,b as se,r as h,o as ie,f as i,g as d,L as N,m as n,k as I,l as a,j as x,h as R,G as q,M as pe,p as D,i as re,q as me}from"./index.0ce34295.js";import{E as ue}from"./index.d11a141d.js";import{t as de,s as ce}from"./reviewTemplateConfig.92904b7d.js";import{g as P,a as _e}from"./getIsShowRegionTree.eec62b25.js";const fe=["onClick"],ve={class:"footer"},ge=ne({name:"reviewTemplateConfig"}),ye=Object.assign(ge,{setup(p){const{proxy:s}=me(),e=se({regionCode:void 0,templateType:"1"}),V=l=>{e.regionCode=l.regionLevel===3?l.regionCode:void 0,f()},T=({props:l})=>{e.templateType=l.name,f()},f=()=>E(this,null,function*(){try{const l=yield de(C($({},e),{templateType:e.templateType*1}));t.value=l.data||{templates:[]}}catch(l){t.value={templates:[]}}}),k=[{label:"\u5E8F\u53F7",type:"index",width:"60"},{label:"\u610F\u89C1\u6807\u9898",slot:"title"},{label:"\u9009\u9879\u7C7B\u578B",slot:"optionType",width:120},{label:"\u5305\u542B\u7684\u9009\u9879",slot:"options"},{label:"\u64CD\u4F5C",slot:"action",width:60}],t=h({templates:[]}),m=h(),v=()=>{t.value.templates.push({title:"",optionType:void 0,options:[{}]})},B=l=>{t.value.templates.splice(l,1)},L=l=>{t.value.templates[l].options.push({option:""})},X=(l,r)=>{t.value.templates[l].options.splice(r,1)},b=h(!1),F=l=>E(this,null,function*(){!l||(yield l.validate(r=>E(this,null,function*(){if(r){const c=z();b.value=!0;try{yield ce(c),s.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),b.value=!1}catch(u){b.value=!1}}})))}),z=()=>{var l;return{regionCode:e.regionCode,templateType:e.templateType*1,templates:((l=t.value)==null?void 0:l.templates.map((r,c)=>C($({},r),{serialNo:c,options:r.options.map((u,w)=>C($({},u),{serialNo:w}))})))||[]}};return ie(()=>{P(["SUPER_ADMIN","REGION_MANAGER","EXPERT_ADMIN"])||f()}),(l,r)=>{const c=i("el-col"),u=i("el-tab-pane"),w=i("el-tabs"),U=i("el-input"),A=i("el-form-item"),G=i("el-option"),J=i("el-select"),K=i("svg-icon"),M=i("el-button"),H=i("table-list"),Q=i("el-form"),W=i("el-card"),Y=i("el-row");return d(),N(Y,{gutter:16},{default:n(()=>[I(P)(["SUPER_ADMIN","REGION_MANAGER","EXPERT_ADMIN"])?(d(),N(c,{key:0,style:{"padding-right":"16px"},span:4},{default:n(()=>[a(ue,{params:I(_e)({SUPER_ADMIN:!1,REGION_MANAGER:!1,EXPERT_ADMIN:!1}),onGetTree:V},null,8,["params"])]),_:1})):x("v-if",!0),a(c,{span:I(P)(["SUPER_ADMIN","REGION_MANAGER","EXPERT_ADMIN"])?20:24},{default:n(()=>[a(W,{class:"w-full tab-card footerCard",shadow:"never"},{header:n(()=>[a(w,{modelValue:e.templateType,"onUpdate:modelValue":r[0]||(r[0]=g=>e.templateType=g),class:"demo-tabs",onTabClick:T},{default:n(()=>[a(u,{label:"\u521D\u6B65\u65B9\u6848\u8BC4\u5BA1\u6A21\u7248",name:"1"}),a(u,{label:"\u5EFA\u8BBE\u65B9\u6848\u8BC4\u5BA1\u6A21\u7248",name:"2"}),a(u,{label:"\u9A8C\u6536\u8BC4\u5BA1\u6A21\u7248",name:"3"}),a(u,{label:"\u90E8\u95E8\u8054\u5BA1\u6A21\u7248",name:"4"}),a(u,{label:"\u516C\u5E73\u6027\u5BA1\u67E5",name:"5"})]),_:1},8,["modelValue"])]),default:n(()=>[a(Q,{ref_key:"formRef",ref:m,model:t.value},{default:n(()=>{var g;return[a(H,{ref:"tableListRef",column:k,data:((g=t.value)==null?void 0:g.templates)||[],pagination:!1},{title:n(({scope:o})=>[t.value.templates[o.$index]?(d(),N(A,{key:0,prop:`templates[${o.$index}].title`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:n(()=>[a(U,{modelValue:t.value.templates[o.$index].title,"onUpdate:modelValue":_=>t.value.templates[o.$index].title=_},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):x("v-if",!0)]),optionType:n(({scope:o})=>[t.value.templates[o.$index]?(d(),N(A,{key:0,prop:`templates[${o.$index}].optionType`,rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},{default:n(()=>[a(J,{modelValue:t.value.templates[o.$index].optionType,"onUpdate:modelValue":_=>t.value.templates[o.$index].optionType=_},{default:n(()=>[a(G,{label:"\u5355\u9009",value:1}),a(G,{label:"\u591A\u9009",value:2})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"])):x("v-if",!0)]),options:n(({scope:o})=>[t.value.templates[o.$index]?(d(),R(q,{key:0},[(d(!0),R(q,null,pe(t.value.templates[o.$index].options,(_,y)=>(d(),R("div",{key:y,class:"flex items-center mb-8"},[a(A,{class:"flex-1",style:{"margin-bottom":"0"},prop:`templates[${o.$index}].options[${y}].option`,rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}]},{default:n(()=>[a(U,{modelValue:t.value.templates[o.$index].options[y].option,"onUpdate:modelValue":O=>t.value.templates[o.$index].options[y].option=O},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["prop"]),a(K,{name:"deleteIcon",class:"ml-4 cursor-pointer text-24",onClick:O=>X(o.$index,y)},null,8,["onClick"])]))),128)),a(M,{type:"primary",size:"small",class:"w-full",plain:"",icon:"Plus",onClick:_=>L(o.$index)},{default:n(()=>[D("\u6DFB\u52A0\u9009\u9879")]),_:2},1032,["onClick"])],64)):x("v-if",!0)]),action:n(({scope:o})=>[t.value.templates[o.$index]?(d(),R("a",{key:0,class:"text-danger",onClick:_=>B(o.$index)},"\u79FB\u9664",8,fe)):x("v-if",!0)]),_:1},8,["data"])]}),_:1},8,["model"]),a(M,{type:"primary",class:"w-full",plain:"",icon:"Plus",onClick:v},{default:n(()=>[D("\u6DFB\u52A0\u610F\u89C1\u7C7B\u578B")]),_:1}),re("div",ve,[a(M,{type:"primary",loading:b.value,onClick:r[1]||(r[1]=g=>F(m.value))},{default:n(()=>[D(" \u63D0\u4EA4 ")]),_:1},8,["loading"])])]),_:1})]),_:1},8,["span"])]),_:1})}}}),Ee=oe(ye,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/pages/systemManage/templateConfig/components/expertReviewTemplateConfig.vue"]]);export{Ee as default};
|