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 B}from"./index-BQgPd3bX.js";import{B as E,u as _}from"./useTable-B6PunZL5.js";import{T as x}from"./index-BIj58_Cj.js";import{b as S,aq as L,ao as N,v as R,_ as U}from"./entry/index-DJx93RYF-1731481145019.js";import{u as A}from"./index-CzIUqxsa.js";import{E as $,g as M,d as g}from"./EmployeeDrawer-B-UgI_3h.js";import{M as V}from"./antd-CBeLo_oO.js";import{d as F,f as k,k as y,a9 as p,_ as I,$ as O,a7 as d,a6 as v,G as T,a2 as q,a0 as D}from"./vue-B5pbXMv7.js";import"./ExclamationCircleOutlined-Ca0mYuiu.js";import"./useForm-pwHPrILC.js";import"./index-D_SNX-7K.js";import"./tree-BtJaOqz0.js";import"./copyTextToClipboard-Dngb1Nn3.js";import"./index-BDsRYE32.js";import"./index-wDJjh9Os.js";import"./index-BzfGKMh3.js";import"./index-DkGmfgEA.js";import"./index-Cuu0w1HY.js";import"./useWindowSizeFn-BxA6-zLj.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-lvT7rWOs.js";import"./file-UkiX_CBa.js";import"./label-D2isa3-f.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:E,EmployeeDrawer:$,TableAction:x,Button:N},setup(){const{t}=R.useI18n(),m=k(),n=k(!1),[u,{openDrawer:c}]=A(),[h,{reload:a}]=_({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 f(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:y(B.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:f,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"),f=p("EmployeeDrawer");return I(),O("div",null,[y(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(q(t.t("common.delete")),1)]),_:1},8,["onClick"])):D("",!0)]),toolbar:d(()=>[y(i,{type:"primary",onClick:t.handleCreate},{default:d(()=>[T(q(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"])):D("",!0)]),_:1},8,["onRegister"]),y(f,{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};
|