1 |
- import{r as a,W as o}from"./index.BsmLRken.js";import{a as i}from"./authFunction.Btaz6jXy.js";import"./vue.YrNK8sx4.js";function n(t){return a({url:"/api/job/list",method:"get",params:{...t,tenant_id:"1"}})}function s(t){return a({url:"/api/job/create",method:"post",data:{...t,tenant_id:"1"}})}function c(t){return a({url:"/api/job/update",method:"put",data:{...t,tenant_id:"1"}})}function u(t){return a({url:"/api/job/delete",method:"delete",data:{id:t,tenant_id:"1"}})}const y=function({crudExpose:t,context:r}){return{crudOptions:{request:{pageRequest:async e=>await n(e),addRequest:async({form:e})=>await s(e),editRequest:async({form:e,row:l})=>(e.id=l.id,await c(e)),delRequest:async({row:e})=>await u(e.id)},pagination:{show:!0},actionbar:{buttons:{add:{show:i("role:Create")}}},rowHandle:{fixed:"right",width:320,buttons:{view:{show:!0},edit:{show:i("role:Update")},remove:{show:i("role:Delete")},qrcode:{text:"小程序码",icon:"",click:e=>{r.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_display:{title:"职位类型",search:{show:!0},type:"dict-select",column:{width:100},dict:o({data:[{value:"全职",label:"全职"},{value:"兼职",label:"兼职"},{value:"实习",label:"实习"},{value:"其他",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 l=e.location.split(" ");l.length>0&&(e.location=l)}}}},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:o({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};
|