1 |
- var u=(e,n,r)=>new Promise((s,l)=>{var c=o=>{try{a(r.next(o))}catch(i){l(i)}},m=o=>{try{a(r.throw(o))}catch(i){l(i)}},a=o=>o.done?s(o.value):Promise.resolve(o.value).then(c,m);a((r=r.apply(e,n)).next())});import{i as v}from"./index-BwFer0gF.js";import{B as I,u as E}from"./useTable-BvGx2hOb.js";import{T as R}from"./index-cfTHEGJC.js";import{ao as $,v as N,P as x,_ as F}from"./entry/index-_47knzYp-1731674619279.js";import{u as M}from"./index-CXzpB-hr.js";import{A as V,c as G,s as L}from"./AgentDrawer-Bj00ksOb.js";import{g as O,d as B}from"./agent-C_87G13Q.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-CBeLo_oO.js";import"./ExclamationCircleOutlined-DKZl6vgb.js";import"./useForm-Bx3dD47S.js";import"./index-DzmEi_Cz.js";import"./tree-DzWyTcw6.js";import"./copyTextToClipboard-wHy60X1A.js";import"./index-CuMkjCMo.js";import"./index-Ck_gyeb3.js";import"./index-CJOsG-Mp.js";import"./index-DkGmfgEA.js";import"./index-CTfnwg9z.js";import"./useWindowSizeFn-CK_IE3dL.js";import"./plugin-C2XGVjF6.js";import"./uuid-BUBnBT7J.js";import"./onMountedOrActivated-C3HH8-CK.js";import"./sortable.esm-BEDva30o.js";import"./useSortable-YaPA5f_C.js";const q=P({name:"AgentManagement",components:{BasicTable:I,AgentDrawer:V,TableAction:R,Button:$},setup(){const e=U(),{t:n}=N.useI18n(),r=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:(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 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:r.value})).code===0&&(s.value=!1,yield a())})},onCancel(){}})})}function b(){return u(this,null,function*(){yield a()})}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:n("common.deleteConfirm"),placement:"left",confirm:f.bind(null,t)}},{onClick:C.bind(null,t),label:"知识库",ifShow:!0}]}return{t:n,registerTable:m,registerDrawer:l,handleCreate:o,handleEdit:i,handleDelete:f,handleSuccess:b,handleBatchDelete:h,showDeleteButton:s,handleDataBase:C,getActions:S}}});function z(e,n,r,s,l,c){const m=d("Button"),a=d("a-button"),o=d("TableAction"),i=d("BasicTable"),f=d("AgentDrawer");return w(),W("div",null,[g(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(()=>[g(a,{type:"primary",onClick:e.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:e.getActions(b)},null,8,["actions"])):T("",!0)]),_:1},8,["onRegister"]),g(f,{onRegister:e.registerDrawer,onSuccess:e.handleSuccess},null,8,["onRegister","onSuccess"])])}const Ce=F(q,[["render",z]]);export{Ce as default};
|