1 |
- var l=(e,c,o)=>new Promise((u,s)=>{var p=t=>{try{r(o.next(t))}catch(i){s(i)}},n=t=>{try{r(o.throw(t))}catch(i){s(i)}},r=t=>t.done?u(t.value):Promise.resolve(t.value).then(p,n);r((o=o.apply(e,c)).next())});import{i as D}from"./index-BQgPd3bX.js";import{B as T,u as S}from"./useTable-B6PunZL5.js";import{T as v}from"./index-BIj58_Cj.js";import{ao as I,v as $,_ as E}from"./entry/index-DJx93RYF-1731481145019.js";import{u as A}from"./index-CzIUqxsa.js";import{C as M,g as N,c as V,s as F,d as g}from"./ChatRecordsDrawer-1bkkF1pt.js";import{M as L}from"./antd-CBeLo_oO.js";import{d as O,f as k,k as h,a9 as d,_ as w,$ as U,a7 as m,a6 as y,G as R,a2 as _,a0 as B}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";const W=O({name:"ChatRecordsManagement",components:{BasicTable:T,ChatRecordsDrawer:M,TableAction:v,Button:I},setup(){const{t:e}=$.useI18n(),c=k(),o=k(!1),[u,{openDrawer:s}]=A(),[p,{reload:n}]=S({title:e("wechat.chatRecords.chatRecordsList"),api:N,columns:V,formConfig:{labelWidth:120,schemas:F},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:30,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",columnWidth:20,onChange:(a,b)=>{c.value=a,o.value=a.length>0}}});function r(){s(!0,{isUpdate:!1})}function t(a){s(!0,{record:a,isUpdate:!0})}function i(a){return l(this,null,function*(){(yield g({ids:[a.id]})).code===0&&(yield n())})}function f(){return l(this,null,function*(){L.confirm({title:e("common.deleteConfirm"),icon:h(D.ExclamationCircleOutlined),onOk(){return l(this,null,function*(){(yield g({ids:c.value})).code===0&&(o.value=!1,yield n())})},onCancel(){}})})}function C(){return l(this,null,function*(){yield n()})}return{t:e,registerTable:p,registerDrawer:u,handleCreate:r,handleEdit:t,handleDelete:i,handleSuccess:C,handleBatchDelete:f,showDeleteButton:o}}});function j(e,c,o,u,s,p){const n=d("Button"),r=d("a-button"),t=d("TableAction"),i=d("BasicTable"),f=d("ChatRecordsDrawer");return w(),U("div",null,[h(i,{onRegister:e.registerTable},{tableTitle:m(()=>[e.showDeleteButton?(w(),y(n,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:m(()=>[R(_(e.t("common.delete")),1)]),_:1},8,["onClick"])):B("",!0)]),toolbar:m(()=>[h(r,{type:"primary",onClick:e.handleCreate},{default:m(()=>[R(_(e.t("wechat.chatRecords.addChatRecords")),1)]),_:1},8,["onClick"])]),bodyCell:m(({column:C,record:a})=>[C.key==="action"?(w(),y(t,{key:0,actions:[{icon:"clarity:note-edit-line",onClick:e.handleEdit.bind(null,a)},{icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,a)}}]},null,8,["actions"])):B("",!0)]),_:1},8,["onRegister"]),h(f,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const pe=E(W,[["render",j]]);export{pe as default};
|