import{W as i}from"./index.Cep9aVOj.js";import{D as o,U as r,A as s,a as c}from"./api.o0bWG1Ko.js";import{a}from"./authFunction.DYW8BxI3.js";import"./vue.YrNK8sx4.js";const y=function({crudExpose:n,context:l}){return{crudOptions:{request:{pageRequest:async e=>await c(e),addRequest:async({form:e})=>await s(e),editRequest:async({form:e,row:t})=>(e.id=t.id,await r(e)),delRequest:async({row:e})=>await o(e.id)},pagination:{show:!0},actionbar:{buttons:{add:{show:a("role:Create"),click:()=>{l.router.push("/position/create")}}}},rowHandle:{fixed:"right",width:320,buttons:{view:{show:!0,icon:"View",type:"text"},edit:{show:a("role:Update"),icon:"Edit",type:"text",click:e=>{l.router.push(`/position/detail?id=${e.row.id}`)}},remove:{show:a("role:Delete"),icon:"Delete",type:"text"},qrcode:{text:"小程序码",type:"text",icon:"",click:e=>{l.generateQRCode(e.row)},order:4}}},form:{col:{span:24},labelWidth:"100px",wrapper:{is:"el-dialog",width:"600px"}},columns:{id:{title:"ID",column:{show:!1},search:{show:!1},form:{show:!1}},title:{title:"职位名称",search:{show:!0},column:{minWidth:120,sortable:"custom"},form:{rules:[{required:!0,message:"角色名称必填"}],component:{placeholder:"请输入角色名称"}}},job_type:{title:"职位类型",search:{show:!0},type:"dict-select",column:{width:100},dict:i({data:[{value:0,label:"全职"},{value:1,label:"兼职"},{value:2,label:"实习"},{value:3,label:"其他"}]}),form:{rules:[{required:!0,message:"职位类型必填"}],component:{placeholder:"职位类型"}}},salary_range:{title:"薪资范围",search:{show:!0},column:{minWidth:100},form:{rules:[{required:!0,message:"薪资范围必填"}],component:{placeholder:"请输入薪资范围"}}},location:{title:"工作地点",search:{show:!0},column:{minWidth:120,formatter:({row:e})=>Array.isArray(e.location)?e.location.join(" "):e.province&&e.city?e.province+" "+e.city+(e.district?" "+e.district:""):e.location||""},form:{component:{name:"el-cascader",props:{options:[{value:"上海市",label:"上海市",children:[{value:"浦东新区",label:"浦东新区",children:[{value:"张江",label:"张江"},{value:"金桥",label:"金桥"},{value:"陆家嘴",label:"陆家嘴"}]},{value:"徐汇区",label:"徐汇区",children:[{value:"漕河泾",label:"漕河泾"},{value:"徐家汇",label:"徐家汇"}]}]},{value:"北京市",label:"北京市",children:[{value:"海淀区",label:"海淀区",children:[{value:"中关村",label:"中关村"},{value:"上地",label:"上地"}]},{value:"朝阳区",label:"朝阳区",children:[{value:"CBD",label:"CBD"},{value:"望京",label:"望京"}]}]}],props:{expandTrigger:"hover",checkStrictly:!1},placeholder:"请选择工作地点",clearable:!0,showAllLevels:!0},on:{change:e=>{console.log("地址选择变化:",e)}}},valueResolve:e=>{e.location&&Array.isArray(e.location)&&e.location.length>0&&(e.province=e.location[0],e.city=e.location[1]||"",e.district=e.location[2]||"",e.location=e.location.join(" "))},valueBuilder:e=>{if(e.province&&e.city)e.location=[e.province,e.city],e.district&&e.location.push(e.district);else if(typeof e.location=="string"&&e.location){const t=e.location.split(" ");t.length>0&&(e.location=t)}}}},department:{title:"所属部门",search:{show:!0},column:{minWidth:100},form:{rules:[{required:!0,message:"所属部门必填"}],component:{placeholder:"请输入所属部门"}}},job_type:{title:"状态",search:{show:!0},type:"dict-select",column:{minWidth:100},dict:i({data:[{value:0,label:"未发布"},{value:1,label:"已发布"},{value:2,label:"已结束"}]}),form:{rules:[{required:!0,message:"职位类型必填"}]}},end_date:{title:"截止日期",type:"datetime",search:{show:!0},column:{minWidth:150,sortable:"custom"},form:{rules:[{required:!0,message:"截止日期必填"}],component:{type:"datetime",valueFormat:"YYYY-MM-DD HH:mm:ss",placeholder:"请选择截止日期"}}},requirements:{title:"职位要求",search:{show:!1},column:{minWidth:120},form:{component:{type:"textarea",rows:4}}},description:{title:"职位描述",search:{show:!1},column:{minWidth:120},form:{component:{type:"textarea",rows:4}}},province:{title:"省份",column:{show:!1},form:{show:!1}},city:{title:"城市",column:{show:!1},form:{show:!1}},district:{title:"区域",column:{show:!1},form:{show:!1}}}}}};export{y as createCrudOptions};