index.De1AFSZR.js 4.3 KB

12345
  1. const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RoleDrawer.LKdDXc9E.js","assets/index.CbAj2snU.js","assets/vue.D1BjjNmv.js","assets/index.DMqZoTO6.css","assets/splitpanes.DuIxzowM.js","assets/splitpanes.C2zCCjIY.css","assets/RoleDrawerStores.Bmochpay.js","assets/RoleUsersStores.BixvBaCy.js","assets/api.7bUu83yQ.js","assets/_plugin-vue_export-helper.DlAUqK2U.js","assets/RoleDrawer.ClKFTd_V.css"])))=>i.map(i=>d[i]);
  2. import{k as M,_ as V,s as h,z as U,E as m,X as p}from"./index.CbAj2snU.js";import{a as B,r as i,aH as j,q as S,aj as f,J as A,o as _,K as x,S as c,H as L,u as g,aA as O,b as F,c as y}from"./vue.D1BjjNmv.js";import{createCrudOptions as H}from"./crud.DpEMfwKG.js";import{R as I}from"./RoleDrawerStores.Bmochpay.js";import{R as N}from"./RoleMenuBtnStores.Ds74f0Jk.js";import{R as z}from"./RoleMenuFieldStores.1tuZt4kb.js";import{R as J}from"./RoleUsersStores.BixvBaCy.js";import K from"./BatchTagsDialog.CxDBxDTw.js";import{P as Q}from"./api.DUij4-Bf.js";import{_ as X}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./authFunction.C-7CQATY.js";import"./api.7bUu83yQ.js";const G={class:"qrcode-container"},W=["src"],Y={key:1,class:"loading"},Z=B({name:"role"}),ee=B({...Z,setup(te){const b=O(()=>V(()=>import("./RoleDrawer.LKdDXc9E.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),n=i(!1),a=i(""),v=I(),C=N(),$=z(),T=J(),l=j(),R=i(),k=i([]);async function D(e){try{n.value=!0,a.value="";const t=await U.post("https://backend.qicai321.com/api/system/wechat/qrcode",{scene:`${e.id}`,page:"pages/index/index",width:430,auto_color:!1,is_hyaline:!1},{responseType:"blob"}),s=new Blob([t.data],{type:"image/png"});a.value=URL.createObjectURL(s)}catch(t){console.error("生成小程序码失败:",t),m.error("生成小程序二维码失败,请稍后重试"),n.value=!1}}function q(e){const s=[{field:"title",name:"职位名称"},{field:"job_type",name:"职位类型"},{field:"salary_range",name:"薪资范围"},{field:"location",name:"工作地点"},{field:"department",name:"所属部门"},{field:"requirements",name:"职位要求"},{field:"description",name:"职位描述"},{field:"end_date",name:"截止日期"}].filter(({field:o})=>!e[o]||typeof e[o]=="string"&&e[o].trim()==="").map(({name:o})=>o);return{isComplete:s.length===0,missing:s}}async function E(e){try{const t=e.status===2?"重新发布":"发布",{isComplete:s,missing:o}=q(e);if(!s){await p.alert(`职位信息不完整,缺少以下必填信息:
  3. ${o.join("、")}
  4. 请先完善职位信息后再发布。`,"职位信息不完整",{confirmButtonText:"去完善",type:"warning"}),l.push(`/position/detail?id=${e.id}`);return}if(e.end_date&&new Date(e.end_date)<new Date&&await p.confirm(`职位截止日期已过期(${e.end_date}),是否要更新截止日期后再发布?`,"截止日期已过期",{confirmButtonText:"更新并发布",cancelButtonText:"仍要发布",distinguishCancelAndClose:!0,type:"warning"})==="confirm"){l.push(`/position/detail?id=${e.id}`);return}const u=e.status===2?`确定要重新发布职位 "${e.title}" 吗?`:`确定要发布职位 "${e.title}" 吗?发布后求职者即可看到此职位。`;await p.confirm(u,`确认${t}`,{confirmButtonText:`确定${t}`,cancelButtonText:"取消",type:"warning"});const r=await Q({job_id:e.id,tenant_id:1});r.code===2e3?(h(`职位${t}成功`),d.doRefresh()):m.error(r.msg||`${t}失败`)}catch(t){t!=="cancel"&&t!=="close"&&(console.error("发布职位失败:",t),m.error("操作失败,请稍后重试"))}}const{crudBinding:P,crudRef:w,crudExpose:d}=M({createCrudOptions:H,context:{RoleDrawer:v,RoleMenuBtn:C,RoleMenuField:$,generateQRCode:D,publishPosition:E,router:l,$message:{warning:e=>h(e)},selectedRows:k,openBatchTagsDialog:e=>{R.value.open(e)}}});return S(async()=>{d.doRefresh(),T.get_all_users()}),(e,t)=>{const s=f("fs-crud"),o=f("el-dialog"),u=f("fs-page");return _(),A(u,null,{default:x(()=>[c(s,L({ref_key:"crudRef",ref:w},g(P)),null,16),c(g(b)),c(o,{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=r=>n.value=r),title:"小程序二维码",width:"400px","align-center":""},{default:x(()=>[F("div",G,[a.value?(_(),y("img",{key:0,src:a.value,alt:"小程序二维码"},null,8,W)):(_(),y("div",Y,"生成中..."))])]),_:1},8,["modelValue"]),c(K,{ref_key:"batchTagsDialogRef",ref:R,crudExpose:g(d)},null,8,["crudExpose"])]),_:1})}}}),_e=X(ee,[["__scopeId","data-v-a28f1a3e"]]);export{_e as default};