|
@@ -1,7 +1,7 @@
|
|
|
<script setup lang="tsx">
|
|
|
import { useTable, useTableOperate, useTableScroll } from '@/hooks/common/table';
|
|
|
import { $t } from '@/locales';
|
|
|
-import { fetchOperDel, fetchOperList, getDicts } from '@/service/api';
|
|
|
+import { fetchOperDel, fetchOperList } from '@/service/api';
|
|
|
import { Button } from 'ant-design-vue';
|
|
|
import { map, pick } from 'lodash';
|
|
|
import dayjs from 'dayjs';
|
|
@@ -9,6 +9,9 @@ import { ref } from 'vue';
|
|
|
import MOperateDrawer from './modules/m-operate-drawer.vue';
|
|
|
import MSearch from './modules/m-search.vue';
|
|
|
import { excel } from '@/utils/download'
|
|
|
+import { useDictStore } from '@/store/modules/dict'
|
|
|
+const { findNameByDict, findNameByValue } = useDictStore()
|
|
|
+
|
|
|
const { tableWrapperRef, scrollConfig } = useTableScroll();
|
|
|
const apiParams = ref({
|
|
|
pageIndex: 1,
|
|
@@ -59,15 +62,8 @@ const {
|
|
|
align: 'center',
|
|
|
minWidth: 100,
|
|
|
customRender: ({ record }) => {
|
|
|
- let statusMap = {
|
|
|
- '1': '停用',
|
|
|
- '2': '正常',
|
|
|
- }
|
|
|
- let typeMap = {
|
|
|
- '1': 'error',
|
|
|
- '2': 'success',
|
|
|
- }
|
|
|
- return <a-tag color={typeMap[record.status]}>{statusMap[record.status]}</a-tag>
|
|
|
+ let colors = [{ label: 'error', value: '1' }, { label: 'success', value: '2' }]
|
|
|
+ return <a-tag color={findNameByValue(colors, record.status)}>{findNameByDict('sys_common_status', record.status)}</a-tag>
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -132,13 +128,6 @@ function handleRowDetail(row: AntDesign.TableData) {
|
|
|
openDrawer()
|
|
|
}
|
|
|
|
|
|
-const deptStatus = ref<CommonType.Option<string>[]>([]);
|
|
|
-async function getDeptStatusOptions() {
|
|
|
- const { data } = await getDicts('sys_common_status')
|
|
|
- deptStatus.value = data || []
|
|
|
-}
|
|
|
-getDeptStatusOptions()
|
|
|
-
|
|
|
// 导出excel
|
|
|
function handleExcel() {
|
|
|
let keysToPick = ['id', 'title', 'businessType', 'method', 'operName', 'operIp', 'operLocation', 'status', 'operUrl', 'operTime']
|