const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RoleDrawer.Cz9K5fyA.js","assets/index.DbBdG0ey.js","assets/vue.D1BjjNmv.js","assets/index.4Qdovvko.css","assets/splitpanes.DuIxzowM.js","assets/splitpanes.C2zCCjIY.css","assets/api.DpcR85Vg.js","assets/RoleUsersStores.GdzsNeyQ.js","assets/_plugin-vue_export-helper.DlAUqK2U.js","assets/RoleDrawer.B5S87lfr.css","assets/BatchTagsDialog.BZgSEtw8.js","assets/api.FId1L2eu.js","assets/crud.D1_1GLEO.js","assets/authFunction.BxREwNvp.js","assets/BatchTagsDialog.DLwKO8ny.css","assets/BatchCategoryDialog.CU2AR1MK.js","assets/BatchCompetencyTagsDialog.C9nNZNJY.js","assets/BatchCompetencyTagsDialog.BpP3HAqq.css"])))=>i.map(i=>d[i]);
import{k as z,ag as H,_ as g,s as J}from"./index.DbBdG0ey.js";import{createCrudOptions as K}from"./crud.D1_1GLEO.js";import{R as Q}from"./api.DpcR85Vg.js";import{R as X}from"./RoleMenuBtnStores.DfUoOZZZ.js";import{R as Y}from"./RoleMenuFieldStores.D-gdfxnU.js";import{R as Z}from"./RoleUsersStores.GdzsNeyQ.js";import ee from"./treeList.DxnziPbY.js";import{D as te,G as oe,a as ae,b as se}from"./api.DSMUiFta.js";import ne from"./index.BzCWQBGI.js";import{a as L,r,q as re,aj as p,J as x,o as D,K as m,S as l,b as C,H as ce,u as _,c as le,Q as ie,aA as h,M as ue}from"./vue.D1BjjNmv.js";import{_ as _e}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./api.FId1L2eu.js";import"./authFunction.BxREwNvp.js";const me={class:"document-box document-left-box"},pe={class:"document-box document-right-box"},de={key:1},fe=L({name:"role"}),ge=L({...fe,setup(De){const N=h(()=>g(()=>import("./RoleDrawer.Cz9K5fyA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),V=h(()=>g(()=>import("./BatchTagsDialog.BZgSEtw8.js"),__vite__mapDeps([10,11,1,2,3,12,13,8,14]))),I=h(()=>g(()=>import("./BatchCategoryDialog.CU2AR1MK.js"),__vite__mapDeps([15,11,1,2,3,12,13]))),q=h(()=>g(()=>import("./BatchCompetencyTagsDialog.C9nNZNJY.js"),__vite__mapDeps([16,1,2,3,11,8,17]))),T=r(),w=r(),E=r(),d=r(!1),y=r({}),M=r(null),b=r([]),P=Q(),S=X(),A=Y(),F=Z(),O=r();r([]);const v=r([]),{crudBinding:U,crudRef:G,crudExpose:f}=z({createCrudOptions:K,context:{RoleDrawer:P,RoleMenuBtn:S,RoleMenuField:A,$message:{warning:e=>J(e)},openBatchTagsDialog:e=>{T.value.open(e)},openBatchCategoryDialog:e=>{w.value.open(e)},openBatchCompetencyTagsDialog:e=>{E.value.open(e)},selectedRows:[]}}),k=r(1),B=e=>{e==="submit"&&R(),d.value=!1,y.value={}},W=(e,o)=>{ElMessageBox.confirm("您确认删除该文档分类吗?","温馨提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(async()=>{const t=await te(e);o(),(t==null?void 0:t.code)===2e3&&(H(t.msg),R())})},$=e=>{var c,u;console.log("record",e);const o=((c=e==null?void 0:e.currentNode)==null?void 0:c.id)||"",t=o.replace(/^(open_|prof_|category_|tag_)/,"");k.value=!isNaN(Number(t))&&t!==null?t:1;let a;const s=(u=e==null?void 0:e.firstLevel)==null?void 0:u.id,n=o.startsWith("open_")?"open":o.startsWith("prof_")?"professional":o.startsWith("category_")?"category":o.startsWith("tag_")?"tag":s;n==="open"||s==="root"?a="0":s==="psychology_questions"?a="4":s==="common_questions"?a="1":(n==="professional"||s==="professional_questions")&&(a="1,2,3,4,6");const i={form:{limit:20,...s==="root"||s==="professional_questions"?{position_types:k.value}:{},question_form:a,...n==="category"?{question_category:t}:{},...n==="tag"?{question_tags:t}:{}}};f.doSearch(i)},j=(e,o)=>{var t,a,s,n;if(e==="update"&&o){const i=((n=(s=(a=(t=M.value)==null?void 0:t.treeRef)==null?void 0:a.currentNode)==null?void 0:s.parent)==null?void 0:n.data)||{};b.value=[i],y.value=o}d.value=!0},R=()=>{oe({}).then(e=>{console.log("ret",e),e.data,ae({page:1,limit:50}).then(o=>{console.log("res",o);const t=o.data.items.filter(a=>!["技术能力","服务意识","职业素质","基本常识","色盲检测","内容铺垫","心理测试","心理测试1"].includes(a.name));se({}).then(a=>{console.log("res",a);const s=a.data.items,n=[...t.map(i=>({id:`category_${i.id}`,title:i.name,children:s.filter(c=>c.category_id===i.id).map(c=>({id:`tag_${c.id}`,title:c.name,chinese_explanation:c.chinese_explanation||""}))}))];v.value=n})})})};return re(async()=>{R(),f.doRefresh(),F.get_all_users()}),(e,o)=>{const t=p("el-col"),a=p("el-tooltip"),s=p("fs-crud"),n=p("el-row"),i=p("el-drawer"),c=p("fs-page");return D(),x(c,null,{default:m(()=>[l(n,{class:"document-el-row"},{default:m(()=>[l(t,{span:3},{default:m(()=>[C("div",me,[l(ee,{ref_key:"treeListRef",ref:O,treeData:v.value,onTreeClick:$,onUpdateDocument:j,onDeleteDocument:W},null,8,["treeData"])])]),_:1}),l(t,{span:21},{default:m(()=>[C("div",pe,[l(s,ce({ref_key:"crudRef",ref:G,"dialog-width":800},_(U)),{"cell-chinese_explanation":m(u=>[u.row.chinese_explanation?(D(),x(a,{key:0,content:u.row.chinese_explanation,placement:"top","hide-after":2e3},{default:m(()=>[C("span",null,ie(u.row.chinese_explanation),1)]),_:2},1032,["content"])):(D(),le("span",de,"-"))]),_:1},16)])]),_:1})]),_:1}),l(_(N)),l(_(V),{ref_key:"batchTagsDialogRef",ref:T,crudExpose:_(f)},null,8,["crudExpose"]),l(_(I),{ref_key:"batchCategoryDialogRef",ref:w,crudExpose:_(f)},null,8,["crudExpose"]),l(_(q),{ref_key:"batchCompetencyTagsDialogRef",ref:E,crudExpose:_(f)},null,8,["crudExpose"]),l(i,{modelValue:d.value,"onUpdate:modelValue":o[0]||(o[0]=u=>d.value=u),title:"添加分类",direction:"rtl",size:"500px","close-on-click-modal":!1,"before-close":B},{default:m(()=>[d.value?(D(),x(ne,{key:0,initFormData:y.value,cacheData:b.value,treeData:v.value,onDrawerClose:B},null,8,["initFormData","cacheData","treeData"])):ue("",!0)]),_:1},8,["modelValue"])]),_:1})}}}),Ne=_e(ge,[["__scopeId","data-v-93d34cd5"]]);export{Ne as default};
