index-fwoz509X.js 4.9 KB

1
  1. var s=(t,m,n)=>new Promise((u,c)=>{var h=o=>{try{i(n.next(o))}catch(l){c(l)}},a=o=>{try{i(n.throw(o))}catch(l){c(l)}},i=o=>o.done?u(o.value):Promise.resolve(o.value).then(h,a);i((n=n.apply(t,m)).next())});import{i as D}from"./index-CmHCevOz.js";import{B,u as E}from"./useTable-BfBUHulV.js";import{T as x}from"./index-aybT_Y4v.js";import{b as S,aq as L,ao as N,v as R,_ as U}from"./entry/index-J3oNdpPM-1725854857151.js";import{u as $}from"./index-psQvanR4.js";import{_ as A,g as M,d as g}from"./EmployeeDrawer.vue_vue_type_script_setup_true_lang-BBkcVaLY.js";import{M as V}from"./antd-DubAfnNp.js";import{d as F,f as k,k as f,a5 as p,_ as I,$ as O,a7 as d,a6 as v,G as T,a1 as _,a9 as q}from"./vue-Ba_NIFIa.js";import"./ExclamationCircleOutlined-CfCFlzTg.js";import"./useForm-Djppl_MV.js";import"./index-n-UgBTsO.js";import"./tree-Dhx73awc.js";import"./copyTextToClipboard-BG9-7yqE.js";import"./index-DjbzqzJs.js";import"./index-a2RDnbRa.js";import"./index-K1arWPmu.js";import"./index-ADuKtuEb.js";import"./index-C598-cfU.js";import"./useWindowSizeFn-BzWD8RX1.js";import"./plugin-4Lbo649h.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-BsbclbaU.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-B_4FgPKl.js";import"./file-B7qeyh17.js";import"./label-DqS-FuCI.js";const{t:e}=S(),P=[{title:e("wechat.employee.title"),dataIndex:"title",width:100},{title:e("wechat.employee.hireCount"),dataIndex:"hireCount",width:100},{title:e("wechat.employee.serviceCount"),dataIndex:"serviceCount",width:100},{title:e("wechat.employee.achievementCount"),dataIndex:"achievementCount",width:100},{title:e("wechat.employee.intro"),dataIndex:"intro",width:100},{title:e("wechat.employee.estimate"),dataIndex:"estimate",width:100},{title:e("wechat.employee.skill"),dataIndex:"skill",width:100},{title:e("wechat.employee.abilityType"),dataIndex:"abilityType",width:100},{title:e("wechat.employee.scene"),dataIndex:"scene",width:100},{title:e("wechat.employee.switchIn"),dataIndex:"switchIn",width:100},{title:e("common.createTime"),dataIndex:"createdAt",width:70,customRender:({record:t})=>L(t.createdAt)}],j=[{field:"title",label:e("wechat.employee.title"),component:"Input",colProps:{span:8}},{field:"tags",label:e("wechat.employee.tags"),component:"Input",colProps:{span:8}}];e("wechat.employee.title"),e("wechat.employee.avatar"),e("wechat.employee.tags"),e("wechat.employee.hireCount"),e("wechat.employee.serviceCount"),e("wechat.employee.achievementCount"),e("wechat.employee.intro"),e("wechat.employee.estimate"),e("wechat.employee.skill"),e("wechat.employee.abilityType"),e("wechat.employee.scene"),e("wechat.employee.switchIn"),e("wechat.employee.tutorial"),e("wechat.employee.videoUrl"),e("wechat.employee.workExperience");const G=F({name:"EmployeeManagement",components:{BasicTable:B,EmployeeDrawer:A,TableAction:x,Button:N},setup(){const{t}=R.useI18n(),m=k(),n=k(!1),[u,{openDrawer:c}]=$(),[h,{reload:a}]=E({title:t("wechat.employee.employeeList"),api:M,columns:P,formConfig:{schemas:j},useSearchForm:!0,showTableSetting:!0,bordered:!1,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:80,title:t("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",columnWidth:30,onChange:(r,C)=>{m.value=r,n.value=r.length>0}}});function i(r){return s(this,null,function*(){yield a()})}function o(){c(!0,{isUpdate:!1})}function l(r){c(!0,{record:r,isUpdate:!0})}function y(r){return s(this,null,function*(){(yield g({ids:[r.id]})).code===0&&(yield a())})}function b(){return s(this,null,function*(){V.confirm({title:t("common.deleteConfirm"),icon:f(D.ExclamationCircleOutlined),onOk(){return s(this,null,function*(){(yield g({ids:m.value})).code===0&&(n.value=!1,yield a())})},onCancel(){}})})}function w(){return s(this,null,function*(){yield a()})}return{t,registerTable:h,registerDrawer:u,handleCreate:o,handleEdit:l,handleDelete:y,handleSuccess:w,handleBatchDelete:b,showDeleteButton:n,getList:i}}});function W(t,m,n,u,c,h){const a=p("Button"),i=p("a-button"),o=p("TableAction"),l=p("BasicTable"),y=p("EmployeeDrawer");return I(),O("div",null,[f(l,{onRegister:t.registerTable},{tableTitle:d(()=>[t.showDeleteButton?(I(),v(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:t.handleBatchDelete},{default:d(()=>[T(_(t.t("common.delete")),1)]),_:1},8,["onClick"])):q("",!0)]),toolbar:d(()=>[f(i,{type:"primary",onClick:t.handleCreate},{default:d(()=>[T(_(t.t("wechat.employee.addEmployee")),1)]),_:1},8,["onClick"])]),bodyCell:d(({column:b,record:w})=>[b.key==="action"?(I(),v(o,{key:0,actions:[{icon:"clarity:note-edit-line",onClick:t.handleEdit.bind(null,w)},{icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:t.t("common.deleteConfirm"),placement:"left",confirm:t.handleDelete.bind(null,w)}}]},null,8,["actions"])):q("",!0)]),_:1},8,["onRegister"]),f(y,{onRegister:t.registerDrawer,onSuccess:t.handleSuccess,"onUpdate:getList":t.getList},null,8,["onRegister","onSuccess","onUpdate:getList"])])}const Ie=U(G,[["render",W]]);export{Ie as default};