Files
xk-admin/apps/web-antd/src/views/system/oa-robot/config/table.ts
李琦 f0a33a628b feat:
1. 更新框架
2. 修复框架更新后导致的问题
2026-08-10 18:44:39 +08:00

77 lines
2.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getOaRobotList } from '#/views/system/oa-robot/api';
interface RowType {
id: number;
platform_code: string;
name: string;
webhook_url: string;
secret: string;
status: number;
remark: string;
chat_ids: number[];
chat_names: string;
created_at: string;
}
/**
* 机器人列表表格配置
* 列表中的 webhook_url 和 secret 字段由后端做了 mask('****' 或 ''),不会泄露明文
* chat_names:后端按「、」拼接的群聊名称串(展示用),详情接口才返回 chat_ids 数组(编辑回显用)
*/
export const gridOptions: VxeGridProps<RowType> = {
checkboxConfig: {
highlight: true,
labelField: '',
},
columnConfig: {
useKey: true,
},
rowConfig: {
useKey: true,
},
columns: [
{ type: 'checkbox', width: 60 },
{ field: 'id', align: 'left', title: 'ID', width: 80 },
{ field: 'platform_code', align: 'left', title: '平台', width: 120, slots: { default: 'platform_code' } },
{ field: 'name', align: 'left', title: '机器人名称' },
{ field: 'chat_names', align: 'left', title: '绑定群聊/群ID', slots: { default: 'chat_names' } },
{ field: 'webhook_url', align: 'left', title: '凭证', width: 130, slots: { default: 'webhook_status' } },
{ field: 'secret', align: 'left', title: '密钥', width: 100, slots: { default: 'secret_status' } },
{ field: 'status', align: 'left', title: '状态', width: 100, slots: { default: 'status' } },
{ field: 'remark', align: 'left', title: '备注' },
{ field: 'created_at', align: 'left', title: '创建时间', width: 180 },
{ type: 'html', title: '操作', slots: { default: 'action' }, width: 320, fixed: 'right' },
],
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
return await getOaRobotList({
page: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
height: 'auto',
border: false,
toolbarConfig: {
search: true,
refresh: true,
print: false,
export: false,
zoom: true,
slots: {
buttons: 'toolbar-actions',
},
custom: {
icon: 'vxe-icon-menu',
},
},
showOverflow: false,
};