1 |
- var c=(e,l,o)=>new Promise((d,s)=>{var p=t=>{try{r(o.next(t))}catch(i){s(i)}},a=t=>{try{r(o.throw(t))}catch(i){s(i)}},r=t=>t.done?d(t.value):Promise.resolve(t.value).then(p,a);r((o=o.apply(e,l)).next())});import{i as T}from"./index-CmHCevOz.js";import{B as A,u as S}from"./useTable-BfBUHulV.js";import{T as v}from"./index-aybT_Y4v.js";import{ao as I,v as F,_ as R}from"./entry/index-J3oNdpPM-1725854857151.js";import{u as $}from"./index-psQvanR4.js";import{A as E,c as M,s as N}from"./AgentDrawer-Dc4ZjYCC.js";import{g as V,d as C}from"./agent-2xBYiWGf.js";import{M as L}from"./antd-DubAfnNp.js";import{d as O,f as D,k as f,a5 as m,_ as b,$ as U,a7 as u,a6 as _,G as k,a1 as B,a9 as y}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";const W=O({name:"AgentManagement",components:{BasicTable:A,AgentDrawer:E,TableAction:v,Button:I},setup(){const{t:e}=F.useI18n(),l=D(),o=D(!1),[d,{openDrawer:s}]=$(),[p,{reload:a}]=S({title:e("wechat.agent.agentList"),api:V,columns:M,formConfig:{labelWidth:120,schemas:N},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:80,title:e("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",columnWidth:20,onChange:(n,w)=>{l.value=n,o.value=n.length>0}}});function r(){s(!0,{isUpdate:!1})}function t(n){s(!0,{record:n,isUpdate:!0})}function i(n){return c(this,null,function*(){(yield C({ids:[n.id]})).code===0&&(yield a())})}function h(){return c(this,null,function*(){L.confirm({title:e("common.deleteConfirm"),icon:f(T.ExclamationCircleOutlined),onOk(){return c(this,null,function*(){(yield C({ids:l.value})).code===0&&(o.value=!1,yield a())})},onCancel(){}})})}function g(){return c(this,null,function*(){yield a()})}return{t:e,registerTable:p,registerDrawer:d,handleCreate:r,handleEdit:t,handleDelete:i,handleSuccess:g,handleBatchDelete:h,showDeleteButton:o}}});function j(e,l,o,d,s,p){const a=m("Button"),r=m("a-button"),t=m("TableAction"),i=m("BasicTable"),h=m("AgentDrawer");return b(),U("div",null,[f(i,{onRegister:e.registerTable},{tableTitle:u(()=>[e.showDeleteButton?(b(),_(a,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:u(()=>[k(B(e.t("common.delete")),1)]),_:1},8,["onClick"])):y("",!0)]),toolbar:u(()=>[f(r,{type:"primary",onClick:e.handleCreate},{default:u(()=>[k(B("添加AI角色"))]),_:1},8,["onClick"])]),bodyCell:u(({column:g,record:n})=>[g.key==="action"?(b(),_(t,{key:0,actions:[{label:"编辑",onClick:e.handleEdit.bind(null,n)},{label:"删除",color:"error",popConfirm:{title:e.t("common.deleteConfirm"),placement:"left",confirm:e.handleDelete.bind(null,n)}}]},null,8,["actions"])):y("",!0)]),_:1},8,["onRegister"]),f(h,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const fe=R(W,[["render",j]]);export{fe as default};
|