1 |
- var u=(t,n,i)=>new Promise((s,l)=>{var c=o=>{try{a(i.next(o))}catch(r){l(r)}},m=o=>{try{a(i.throw(o))}catch(r){l(r)}},a=o=>o.done?s(o.value):Promise.resolve(o.value).then(c,m);a((i=i.apply(t,n)).next())});import{i as v}from"./index-B8miXP3d.js";import{B as I,u as E}from"./useTable-Ol_P-TxG.js";import{T as R}from"./index-BEZBHtc2.js";import{ao as $,v as N,P as x,_ as F}from"./entry/index-BOVpYCVt-1731915664217.js";import{u as M}from"./index-CwBw3p8r.js";import{A as V,c as G,s as L}from"./AgentDrawer-ansN3uMw.js";import{g as O,d as B}from"./agent-DM9unSK_.js";import{d as P,S as U,f as k,k as g,a9 as d,_ as w,$ as W,a7 as p,a6 as A,G as D,a2 as y,a0 as T}from"./vue-B5pbXMv7.js";import{M as j}from"./antd-DXvsKA0x.js";import"./ExclamationCircleOutlined-BaVgfZo1.js";import"./useForm-B-PbqzOc.js";import"./index-x2bUusKH.js";import"./tree-Nv0Zt4Ov.js";import"./copyTextToClipboard-7uPthhEV.js";import"./index-DKfaJplO.js";import"./index-EdNvCi60.js";import"./index-DTfAZuwl.js";import"./index-BcSUkfeU.js";import"./index-DaqRmjER.js";import"./useWindowSizeFn-CzjmevD7.js";import"./plugin-CRRssOeV.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-CRwDSVfI.js";const q=P({name:"AgentManagement",components:{BasicTable:I,AgentDrawer:V,TableAction:R,Button:$},setup(){const t=U(),{t:n}=N.useI18n(),i=k(),s=k(!1),[l,{openDrawer:c}]=M(),[m,{reload:a}]=E({title:n("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:n("common.action"),dataIndex:"action",fixed:void 0},rowKey:"id",rowSelection:{type:"checkbox",columnWidth:20,onChange:(e,_)=>{i.value=e,s.value=e.length>0}}});function o(){c(!0,{isUpdate:!1})}function r(e){c(!0,{record:e,isUpdate:!0})}function f(e){return u(this,null,function*(){(yield B({ids:[e.id]})).code===0&&(yield a())})}function h(){return u(this,null,function*(){j.confirm({title:n("common.deleteConfirm"),icon:g(v.ExclamationCircleOutlined),onOk(){return u(this,null,function*(){(yield B({ids:i.value})).code===0&&(s.value=!1,yield a())})},onCancel(){}})})}function b(){return u(this,null,function*(){yield a()})}function C(e){t.push({path:x.AGENT_BASE,query:{collectionId:e.collection_id,agentId:e.id}})}function S(e){return[{label:"编辑",onClick:r.bind(null,e)},{label:"删除",color:"error",popConfirm:{title:n("common.deleteConfirm"),placement:"left",confirm:f.bind(null,e)}},{onClick:C.bind(null,e),label:"知识库",ifShow:!0}]}return{t:n,registerTable:m,registerDrawer:l,handleCreate:o,handleEdit:r,handleDelete:f,handleSuccess:b,handleBatchDelete:h,showDeleteButton:s,handleDataBase:C,getActions:S}}});function z(t,n,i,s,l,c){const m=d("Button"),a=d("a-button"),o=d("TableAction"),r=d("BasicTable"),f=d("AgentDrawer");return w(),W("div",null,[g(r,{onRegister:t.registerTable},{tableTitle:p(()=>[t.showDeleteButton?(w(),A(m,{key:0,type:"primary",danger:"",preIcon:"ant-design:delete-outlined",onClick:t.handleBatchDelete},{default:p(()=>[D(y(t.t("common.delete")),1)]),_:1},8,["onClick"])):T("",!0)]),toolbar:p(()=>[g(a,{type:"primary",onClick:t.handleCreate},{default:p(()=>n[0]||(n[0]=[D(y("添加AI角色"))])),_:1},8,["onClick"])]),bodyCell:p(({column:h,record:b})=>[h.key==="action"?(w(),A(o,{key:0,actions:t.getActions(b)},null,8,["actions"])):T("",!0)]),_:1},8,["onRegister"]),g(f,{onRegister:t.registerDrawer,onSuccess:t.handleSuccess},null,8,["onRegister","onSuccess"])])}const Ce=F(q,[["render",z]]);export{Ce as default};
|