import{r as o,S as s,W as r,I as l}from"./index.CL7yl-Wb.js";import{aH as d,S as a,P as p,aj as u}from"./vue.D1BjjNmv.js";function m(t){return o({url:"/api/system/competency/list",method:"get",params:{...t,tenant_id:s.get("tenant_id")}})}function h(t){return o({url:"/api/system/competency/create",method:"post",data:{...t,tenant_id:s.get("tenant_id")}})}function f(t){return o({url:"/api/system/competency/update",method:"post",data:{...t,tenant_id:s.get("tenant_id")}})}function y(t){return o({url:"/api/system/competency/delete",method:"post",data:{...t,tenant_id:s.get("tenant_id")}})}function q(t){return o({url:"/api/system/competency/list",method:"get",params:{...t,tenant_id:s.get("tenant_id")}})}function w(t){return o({url:"/api/system/job/list",method:"get",params:{...t,tenant_id:s.get("tenant_id")}})}function O(t){return o({url:"/api/system/job/list",method:"get",params:{...t,tenant_id:s.get("tenant_id")}})}const g=function({crudExpose:t}){return d(),{crudOptions:{toolbar:{buttons:{search:{show:!1},refresh:{show:!1},compact:{show:!1},export:{text:"导出",type:"primary",size:"small",icon:"upload",circle:!1,display:!0,show:!1},columns:{show:!1}}},request:{pageRequest:async e=>{try{return e.form&&e.form.job_id&&(e.job_id=e.form.job_id),await m(e)}catch(n){return console.error("Failed to fetch list:",n),{data:{items:[],total:0}}}},addRequest:async({form:e})=>await h(e),editRequest:async({form:e,row:n})=>(e.id=n.id,await f(e)),delRequest:async({row:e})=>await y({id:e.id})},actionbar:{buttons:{add:{show:!0}}},rowHandle:{fixed:"right",width:200,buttons:{view:{show:!1},edit:{iconRight:"Edit",type:"text",show:!0},remove:{iconRight:"Delete",type:"text",show:!0}}},pagination:{show:!0},table:{rowKey:"id"},search:{show:!0,autoSearch:!1,buttons:{search:{size:"small"},reset:{size:"small"}}},columns:{id:{title:"ID",form:{show:!1},column:{show:!0}},keyword:{title:"标签名称",search:{show:!0,component:{placeholder:"请输入标签名称"},size:"small",col:{span:3}},type:"input",column:{show:!1,minWidth:120},form:{show:!1,rules:[{required:!0,message:"标签名称为必填项"}]}},name:{title:"标签名称",search:{show:!1,component:{placeholder:"请输入标签名称"},size:"small",col:{span:3}},type:"input",column:{minWidth:120},form:{rules:[{required:!0,message:"标签名称为必填项"}]}},positions:{title:"关联职位",type:"dict-select",column:{minWidth:150,component:{vModel:"modelValue",multiple:!0,name:"fs-component",render:({row:e})=>!e.positions||e.positions.length===0?a("span",null,[p("-")]):a("div",{style:"display: flex; flex-wrap: wrap; gap: 4px;"},[e.positions.map(n=>a(u("el-tag"),{key:n.id,type:"warning",effect:"plain",size:"mini"},{default:()=>[n.title]}))])}},dict:r({getData:async()=>(await w({page:1,limit:100,tenant_id:s.get("tenant_id")})).data||[],label:"title",value:"id"}),form:{component:{props:{multiple:!0,filterable:!0,placeholder:"请选择关联职位",disabled:l(({mode:e})=>e==="edit")},value:l(({form:e})=>e.positions?(console.log("form.positions",e.positions),Array.isArray(e.positions)?e.positions.map(i=>typeof i=="object"&&i!==null?(e.competency_tags_config||(e.competency_tags_config=[],e.positions=[]),e.competency_tags_config.find(c=>c.id===i.id)||(e.competency_tags_config.push({id:i.id,competency_name:i.name,weight:i.weight||100,importance:i.importance||1,remark:""}),e.positions.push(i.id)),i.id):i):e.positions):[])}}},sort:{title:"排序",type:"number",column:{minWidth:80},form:{value:1}},create_datetime:{title:"创建时间",type:"datetime",column:{show:!1,minWidth:160},form:{show:!1}},update_datetime:{title:"更新时间",type:"datetime",column:{show:!1,minWidth:160},form:{show:!1}},is_general:{title:"通用胜任力",type:"dict-select",column:{minWidth:90,component:{render:({row:e})=>a("span",null,[e.is_general?"通用":"非通用"])}},dict:r({data:[{value:!0,label:"通用"},{value:!1,label:"非通用"}]}),form:{value:!0,component:{name:"el-switch"}}},description:{title:"描述",search:{show:!1,component:{placeholder:"请输入描述"}},type:"textarea",column:{minWidth:150,showOverflowTooltip:!0},form:{component:{span:24,placeholder:"请输入标签描述"}}}}}}},z=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:g},Symbol.toStringTag,{value:"Module"}));export{q as G,O as a,z as b,g as c};
