Browse Source

feat(系统模块-异常信息): 异常信息功能完善

shizhongming 3 years ago
parent
commit
2e276c26c6
  1. 9
      src/modules/system/views/exception/SysExceptionListView.api.ts
  2. 5
      src/modules/system/views/exception/SysExceptionListView.config.ts
  3. 55
      src/modules/system/views/exception/SysExceptionListView.vue
  4. 11
      src/modules/system/views/exception/lang/en_US.ts
  5. 13
      src/modules/system/views/exception/lang/zh_CN.ts
  6. 1
      src/modules/system/views/userGroup/UserGroupListView.vue

9
src/modules/system/views/exception/SysExceptionListView.api.ts

@ -3,6 +3,7 @@ import { ApiServiceEnum, defHttp } from '@/utils/http/axios';
enum Api {
list = 'sys/exception/list',
getById = 'sys/exception/getById',
markResolved = 'sys/exception/markResolved',
}
export const listApi = (params) => {
@ -20,3 +21,11 @@ export const getById = (id) => {
data: id,
});
};
export const markResolvedApi = (data) => {
return defHttp.post({
service: ApiServiceEnum.SMART_SYSTEM,
url: Api.markResolved,
data,
});
};

5
src/modules/system/views/exception/SysExceptionListView.config.ts

@ -37,7 +37,7 @@ export const getTableColumns = (): SmartColumn[] => {
width: 200,
},
{
field: 'operateBy',
field: 'operationBy',
title: '{system.views.exception.title.operateUser}',
width: 120,
},
@ -76,6 +76,9 @@ export const getTableColumns = (): SmartColumn[] => {
field: 'resolvedUserId',
title: '{system.views.exception.title.resolvedUserId}',
width: 120,
formatter({ row }) {
return row.resolvedUser?.fullName;
},
},
{
field: 'resolvedTime',

55
src/modules/system/views/exception/SysExceptionListView.vue

@ -9,7 +9,7 @@
</div>
</template>
<script lang="ts" setup>
<script lang="tsx" setup>
import {
useSmartTable,
SmartTable,
@ -19,10 +19,13 @@
import { useModal } from '@/components/Modal';
import { useI18n } from '@/hooks/web/useI18n';
import { useSizeSetting } from '@/hooks/setting/UseSizeSetting';
import { Textarea } from 'ant-design-vue';
import { getSearchFormSchemas, getTableColumns } from './SysExceptionListView.config';
import { listApi } from './SysExceptionListView.api';
import { listApi, markResolvedApi } from './SysExceptionListView.api';
import ExceptionDetailModal from './components/ExceptionDetailModal.vue';
import { createConfirm, successMessage, warnMessage } from '@/utils/message/SystemNotice';
import { ref, unref } from 'vue';
const { t } = useI18n();
const { getTableSize } = useSizeSetting();
@ -40,7 +43,42 @@
const [registerModal, { openModal }] = useModal();
const [registerTable] = useSmartTable({
const resolvedMessageRef = ref('');
/**
* 标记已处理
*/
const handlerMarkResolved = () => {
const selectRows = getCheckboxRecords();
console.log(selectRows);
if (selectRows.length === 0) {
warnMessage(t('system.views.exception.message.noSelect'));
return false;
}
resolvedMessageRef.value = '';
createConfirm({
iconType: 'warning',
title: t('system.views.exception.button.markResolved'),
content: () => {
return (
<Textarea
rows={4}
v-model={[resolvedMessageRef.value, 'value']}
placeholder={t('system.views.exception.validate.resolvedMessage')}
/>
);
},
onOk: async () => {
await markResolvedApi({
resolvedMessage: unref(resolvedMessageRef),
exceptionIdList: selectRows.map((item) => item.id),
});
successMessage(t('system.views.exception.message.resolvedSuccess'));
query();
},
});
};
const [registerTable, { getCheckboxRecords, query }] = useSmartTable({
id: 'smart-system-tool-exception',
customConfig: { storage: true },
border: true,
@ -63,6 +101,17 @@
refresh: true,
zoom: true,
column: { columnOrder: true },
buttons: [
{
name: t('system.views.exception.button.markResolved'),
customRender: 'ant',
props: {
type: 'primary',
preIcon: 'ant-design:check-outlined',
onClick: handlerMarkResolved,
},
},
],
},
sortConfig: {
remote: true,

11
src/modules/system/views/exception/lang/en_US.ts

@ -21,12 +21,21 @@ export default {
showStackTrace: 'Show stackTrace',
stackTrace: 'Stack trace',
},
validate: {},
validate: {
resolvedMessage: 'Please enter processing information',
},
rules: {},
search: {
exceptionMessage: 'Please select the error message',
requestIp: 'Please select the request IP',
serverIp: 'Please select the server IP',
},
button: {
markResolved: 'Processed',
},
message: {
noSelect: 'Please select record',
resolvedSuccess: 'Mark success',
},
},
};

13
src/modules/system/views/exception/lang/zh_CN.ts

@ -16,17 +16,26 @@ export default {
feedbackTime: '反馈时间',
resolved: '是否已处理',
resolvedMessage: '处理信息',
resolvedUserId: '处理人员ID',
resolvedUserId: '处理人员',
resolvedTime: '处理时间',
showStackTrace: '查看堆栈信息',
stackTrace: '堆栈信息',
},
validate: {},
validate: {
resolvedMessage: '请输入处理信息',
},
rules: {},
search: {
exceptionMessage: '请输入异常信息',
requestIp: '请输入请求IP',
serverIp: '请输入服务器IP',
},
button: {
markResolved: '标记已处理',
},
message: {
noSelect: '请选择记录',
resolvedSuccess: '标记成功',
},
},
};

1
src/modules/system/views/userGroup/UserGroupListView.vue

@ -85,6 +85,7 @@
actionColOptions: {
span: undefined,
},
compact: true,
},
addEditConfig: {
formConfig: {

Loading…
Cancel
Save