=> ({
+ filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters, close }) => (
+ e.stopPropagation()}>
+ {
+ setSelectedKeys(e.target.value && e.target.value !== '' ? [e.target.value] : [])
+ }}
+ onSearch={(value) => {
+ if (value === '' && clearFilters) {
+ clearFilters!!()
+ }
+ confirm();
+ }}
+ onPressEnter={() => confirm()}
+ allowClear
+ style={{ marginBottom: 8, display: 'block' }}
+ enterButton="搜索"
+ size="middle"
+ loading={onSearching}
+ />
+
+ ),
+ filterIcon: (filtered: boolean) => (
+
+ ),
+ onFilterDropdownOpenChange: (visible) => {
+ if (visible) {
+ setTimeout(() => searchInput.current?.select(), 100);
+ }
+ },
+ });
+
+ const handleUpdateApiErrorLogStatus = async function (item: ApiErrorLogVO, status: number) {
+ antdUtils.modal?.confirm({
+ title: '温馨提示',
+ icon: ,
+ content: `确认标记为已${status === 1 ? '处理' : '忽略'}?`,
+ okText: '确定',
+ cancelText: '取消',
+ onOk() {
+ return new Promise(async (resolve) => {
+ const [error, { code, msg }] = await updateApiErrorLogStatus(item.id, status);
+ if (error || code !== 0) {
+ antdUtils.message?.open({ type: 'error', content: msg ?? '操作失败' })
+ } else {
+ antdUtils.message?.open({ type: 'success', content: '操作成功' })
+ }
+ await load();
+ resolve('')
+ }).catch(() => antdUtils.message?.open({
+ type: 'error',
+ content: '操作失败',
+ }));
+ },
+ onCancel() {
+ },
+ });
+ }
+
+ const columns: TableColumnsType = [
+ {
+ title: '日志编号',
+ dataIndex: 'id',
+ key: 'id',
+ align: 'center',
+ fixed: 'left',
+ width: 100,
+ },
+ {
+ title: '用户编号',
+ dataIndex: 'userId',
+ key: 'userId',
+ align: 'center',
+ width: 100,
+ ...getColumnSearchProps('userId', "请输入用户编号")
+ },
+ {
+ title: '用户类型',
+ dataIndex: 'userType',
+ key: 'userType',
+ fixed: 'left',
+ filterSearch: true,
+ align: 'center',
+ width: 100,
+ render: (value: number) => {
+ if (value === 1) {
+ return 会员
+ } else if (value === 2) {
+ return 管理员
+ } else {
+ return 未知
+ }
+ }
+ },
+ {
+ title: '应用名',
+ dataIndex: 'applicationName',
+ key: 'applicationName',
+ align: 'center',
+ width: 120,
+ ...getColumnSearchProps('applicationName', "请输入应用名")
+ },
+ {
+ title: '请求方法',
+ dataIndex: 'requestMethod',
+ key: 'requestMethod',
+ align: 'center',
+ width: 100,
+ },
+ {
+ title: '请求地址',
+ dataIndex: 'requestUrl',
+ key: 'requestUrl',
+ align: 'center',
+ width: 150,
+ ...getColumnSearchProps('requestUrl', "请输入请求地址")
+ },
+ {
+ title: '异常时间',
+ dataIndex: 'exceptionTime',
+ key: 'exceptionTime',
+ align: 'center',
+ width: 150,
+ render: (value: number) => {
+ return formatDate(new Date(value), "YYYY-mm-dd HH:MM:SS")
+ }
+ },
+ {
+ title: '异常名',
+ dataIndex: 'exceptionName',
+ key: 'exceptionName',
+ align: 'center',
+ width: 150,
+ },
+ {
+ title: '处理状态',
+ dataIndex: 'processStatus',
+ key: 'processStatus',
+ align: 'center',
+ width: 150,
+ render: (value: number) => {
+ if (value === 0) {
+ return 未处理
+ } else if (value === 1) {
+ return 已处理
+ } else if (value === 2) {
+ return 已忽略
+ } else {
+ return 内置
+ }
+ }
+ },
+ {
+ title: t("QkOmYwne" /* 操作 */),
+ key: 'action',
+ fixed: 'right',
+ align: 'center',
+ width: 250,
+ render: (value: ApiErrorLogVO, record) => (
+ )}>
+ {
+
+ }}> 详情
+ {
+ (value.processStatus === 0 ? ( {
+ handleUpdateApiErrorLogStatus(value, 1)
+ }}> 已处理 ) : null)
+ }
+ {
+ (value.processStatus === 0 ? ( {
+ handleUpdateApiErrorLogStatus(value, 2)
+ }}> 已忽略 ) : null)
+ }
+
+ ),
+ },
+ ];
+
+ const exportLogs = async () => {
+ await exportOperateLog()
+ }
+
+ useEffect(() => {
+ load();
+ }, [searchState]);
+
+ const onChange: TableProps['onChange'] = (pagination, filters, sorter, extra) => {
+ const state: ApiErrorLogPageReqVO = {
+ applicationName: filters.applicationName ? filters.applicationName[0] as string : undefined,
+ requestUrl: filters.requestUrl ? filters.requestUrl[0] as string : undefined,
+ userId: filters.userId ? parseInt(filters.userId[0] as string) : undefined,
+ pageNo: pagination.current,
+ pageSize: pagination.pageSize
+ }
+ setOnSearching(true);
+ setSearchState(state);
+ };
+
+ return (
+ <>
+ }
+ icon={}
+ onClick={exportLogs}
+ />
+
+ >
+ );
+};
diff --git a/src/pages/system/role/index.tsx b/src/pages/system/role/index.tsx
index 877ffa4..6dff3e1 100644
--- a/src/pages/system/role/index.tsx
+++ b/src/pages/system/role/index.tsx
@@ -84,7 +84,7 @@ export default () => {
align: 'center',
width: 150,
render: (value: number) => {
- return (value === 1 ? 内置 : 内置)
+ return (value === 1 ? 内置 : 自定义)
}
},
{