import{r as o,W as n}from"./index.D93ign_E.js";import{aH as i,S as s,P as r,aj as l}from"./vue.D1BjjNmv.js";function u(t){return o({url:"/api/system/competency/list",method:"get",params:{...t,tenant_id:1}})}function c(t){return o({url:"/api/system/competency/create",method:"post",data:{...t,tenant_id:1}})}function d(t){return o({url:"/api/system/competency/update",method:"post",data:{...t,tenant_id:1}})}function m(t){return o({url:"/api/system/competency/delete",method:"post",data:{...t,tenant_id:1}})}function v(t){return o({url:"/api/system/competency/list",method:"get",params:{...t,tenant_id:1}})}function p(t){return o({url:"/api/system/job/list",method:"get",params:{...t,tenant_id:1}})}const h=function({crudExpose:t}){return i(),{crudOptions:{toolbar:{buttons:{search:{show:!1},refresh:{show:!1},compact:{show:!1},export:{text:"导出",type:"primary",size:"small",icon:"upload",circle:!1,display:!0},columns:{show:!1}}},request:{pageRequest:async e=>{try{return await u(e)}catch(a){return console.error("Failed to fetch list:",a),{data:{items:[],total:0}}}},addRequest:async({form:e})=>await c(e),editRequest:async({form:e,row:a})=>(e.id=a.id,await d(e)),delRequest:async({row:e})=>await m({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,buttons:{search:{size:"small"},reset:{size:"small"}}},columns:{id:{title:"ID",form:{show:!1},column:{show:!0}},name:{title:"标签名称",search:{show:!0,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?s("span",null,[r("-")]):s("div",{style:"display: flex; flex-wrap: wrap; gap: 4px;"},[e.positions.map(a=>s(l("el-tag"),{key:a.id,type:"warning",effect:"plain",size:"mini"},{default:()=>[a.title]}))])}},dict:n({getData:async()=>(await p({page:1,limit:1e3,tenant_id:1})).data||[],label:"title",value:"id"}),form:{component:{multiple:!0,filterable:!0,placeholder:"请选择关联职位"}}},sort:{title:"排序",type:"number",column:{minWidth:80},form:{value:1}},create_datetime:{title:"创建时间",type:"datetime",column:{minWidth:160},form:{show:!1}},update_datetime:{title:"更新时间",type:"datetime",column:{minWidth:160},form:{show:!1}},is_general:{title:"通用胜任力",type:"dict-select",column:{minWidth:90,component:{render:({row:e})=>s("span",null,[e.is_general?"通用":"非通用"])}},dict:n({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:"请输入标签描述"}}}}}}},x=Object.freeze(Object.defineProperty({__proto__:null,createCrudOptions:h},Symbol.toStringTag,{value:"Module"}));export{v as G,x as a,h as c};
