1 |
- var u=(e,a,r)=>new Promise((s,l)=>{var c=o=>{try{n(r.next(o))}catch(i){l(i)}},m=o=>{try{n(r.throw(o))}catch(i){l(i)}},n=o=>o.done?s(o.value):Promise.resolve(o.value).then(c,m);n((r=r.apply(e,a)).next())});import{i as v}from"./index-DFDl5oQd.js";import{B as I,u as E}from"./useTable-DU9O3F9E.js";import{T as R}from"./index-BwNIrZEG.js";import{ao as $,v as N,P as x,_ as F}from"./entry/index-CgYc8-8R-1727925932396.js";import{u as M}from"./index-YjO3zeaG.js";import{A as V,c as G,s as L}from"./AgentDrawer-xzxJ3WnA.js";import{g as O,d as B}from"./agent-B0dB8DaI.js";import{d as P,S as U,f as k,k as h,a6 as d,_ as w,$ as W,a8 as p,a7 as A,G as D,a2 as y,a0 as T}from"./vue-CmlY4eyV.js";import{M as j}from"./antd-Cvjlt_sO.js";import"./ExclamationCircleOutlined-Dz0Nkfk7.js";import"./useForm-SslrZYTo.js";import"./index-CBPpQ5CQ.js";import"./tree-D9Ak_BA7.js";import"./copyTextToClipboard-LUvYn9Ax.js";import"./index-BbeMNUYt.js";import"./index-B_8huA1N.js";import"./index-N67TOMH6.js";import"./index-COrb8hQh.js";import"./index-B9lQzmCM.js";import"./useWindowSizeFn-V_14vZqv.js";import"./plugin-h6t_th82.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C4hclMrd.js";import"./sortable.esm-CnNXHMH-.js";import"./useSortable-CnIIRr1x.js";const q=P({name:"AgentManagement",components:{BasicTable:I,AgentDrawer:V,TableAction:R,Button:$},setup(){const e=U(),{t:a}=N.useI18n(),r=k(),s=k(!1),[l,{openDrawer:c}]=M(),[m,{reload:n}]=E({title:a("wechat.agent.agentList"),api:O,columns:G,formConfig:{labelWidth:120,schemas:L},useSearchForm:!0,showTableSetting:!0,bordered:!0,showIndexColumn:!1,clickToRowSelect:!1,actionColumn:{width:80,title:a("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",columnWidth:20,onChange:(t,_)=>{r.value=t,s.value=t.length>0}}});function o(){c(!0,{isUpdate:!1})}function i(t){c(!0,{record:t,isUpdate:!0})}function f(t){return u(this,null,function*(){(yield B({ids:[t.id]})).code===0&&(yield n())})}function g(){return u(this,null,function*(){j.confirm({title:a("common.deleteConfirm"),icon:h(v.ExclamationCircleOutlined),onOk(){return u(this,null,function*(){(yield B({ids:r.value})).code===0&&(s.value=!1,yield n())})},onCancel(){}})})}function b(){return u(this,null,function*(){yield n()})}function C(t){e.push({path:x.AGENT_BASE,query:{collectionId:t.collection_id}})}function S(t){return[{label:"编辑",onClick:i.bind(null,t)},{label:"删除",color:"error",popConfirm:{title:a("common.deleteConfirm"),placement:"left",confirm:f.bind(null,t)}},{onClick:C.bind(null,t),label:"知识库",ifShow:!0}]}return{t:a,registerTable:m,registerDrawer:l,handleCreate:o,handleEdit:i,handleDelete:f,handleSuccess:b,handleBatchDelete:g,showDeleteButton:s,handleDataBase:C,getActions:S}}});function z(e,a,r,s,l,c){const m=d("Button"),n=d("a-button"),o=d("TableAction"),i=d("BasicTable"),f=d("AgentDrawer");return w(),W("div",null,[h(i,{onRegister:e.registerTable},{tableTitle:p(()=>[e.showDeleteButton?(w(),A(m,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:e.handleBatchDelete},{default:p(()=>[D(y(e.t("common.delete")),1)]),_:1},8,["onClick"])):T("",!0)]),toolbar:p(()=>[h(n,{type:"primary",onClick:e.handleCreate},{default:p(()=>[D(y("添加AI角色"))]),_:1},8,["onClick"])]),bodyCell:p(({column:g,record:b})=>[g.key==="action"?(w(),A(o,{key:0,actions:e.getActions(b)},null,8,["actions"])):T("",!0)]),_:1},8,["onRegister"]),h(f,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const Ce=F(q,[["render",z]]);export{Ce as default};
|