🐛 Fixing a bug. 固定用户列和序号,日志增加创建人

This commit is contained in:
aeizzz 2023-03-08 14:13:00 +08:00
parent 7e4085ca58
commit 8b543e5c2d
8 changed files with 200 additions and 225 deletions

View File

@ -9,6 +9,7 @@
<el-descriptions-item :label="$t('syslog.createTime')">{{ data.createTime }}</el-descriptions-item>
<el-descriptions-item :label="$t('syslog.requestUri')">{{ data.requestUri }}</el-descriptions-item>
<el-descriptions-item :label="$t('syslog.exception')">{{ data.exception }}</el-descriptions-item>
<el-descriptions-item :label="$t('syslog.createBy')">{{ data.createBy }}</el-descriptions-item>
</el-descriptions>
</el-drawer>
</template>
@ -21,7 +22,6 @@ const data = reactive({} as any);
const openDialog = (row: any) => {
visible.value = true;
Object.assign(data, row);
console.log(data, 'dadadadada');
};
//

View File

@ -10,6 +10,7 @@ export default {
createTime: 'createTime',
requestUri: 'requestUri',
exception: 'exception',
createBy: 'createBy',
action: 'action',
inputLogTypeTip: 'select logType',
inputStartPlaceholderTip: 'Start Time',

View File

@ -10,6 +10,7 @@ export default {
createTime: '创建时间',
requestUri: '请求地址',
exception: '异常信息',
createBy: '创建人',
action: '操作',
inputLogTypeTip: '请选择类型',
inputStartPlaceholderTip: '开始时间',

View File

@ -26,10 +26,10 @@
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary" v-auth="'sys_user_export'">
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary" v-auth="'sys_user_del'">
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete" type="primary">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
@ -60,12 +60,13 @@
<el-table-column :label="$t('syslog.serviceId')" prop="serviceId" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('syslog.time')" prop="time" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('syslog.createTime')" prop="createTime" show-overflow-tooltip sortable="custom" width="200"></el-table-column>
<el-table-column :label="$t('syslog.createBy')" prop="createBy" show-overflow-tooltip sortable="custom" width="200"></el-table-column>
<el-table-column :label="$t('common.action')" width="100">
<template #default="scope">
<el-button @click="LogDetailRef.openDialog(scope.row)" size="small" text type="primary">
{{ $t('common.detailBtn') }}
</el-button>
<el-button @click="handleDelete([scope.row.id])" size="small" text type="primary" v-auth="'sys_user_del'">
<el-button @click="handleDelete([scope.row.id])" size="small" text type="primary">
{{ $t('common.delBtn') }}
</el-button>
</template>

View File

@ -1,225 +1,204 @@
<template>
<div class="layout-padding">
<el-row :gutter="20">
<el-col :span="4" :xs="24">
<el-card class="layout-padding-auto" shadow="hover">
<query-tree :placeholder="$t('common.queryDeptTip')" :query="deptData.queryList"
@node-click="handleNodeClick"/>
</el-card>
</el-col>
<el-col :span="20" :xs="24">
<div class="layout-padding-auto layout-padding-view">
<el-row class="mb8" v-show="showSearch">
<el-form :inline="true" :model="state.queryForm" @keyup.enter="getDataList" ref="queryRef">
<el-form-item :label="$t('sysuser.username')" prop="username">
<el-input :placeholder="$t('sysuser.inputUsernameTip')"
clearable style="width: 240px"
v-model="state.queryForm.username"/>
</el-form-item>
<el-form-item :label="$t('sysuser.phone')" prop="phone">
<el-input :placeholder="$t('sysuser.inputPhoneTip')" clearable
style="width: 240px"
v-model="state.queryForm.phone"/>
</el-form-item>
<el-form-item>
<el-button @click="getDataList" icon="Search" type="primary">{{ $t('common.queryBtn')
}}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button @click="userDialogRef.openDialog()" class="ml10" icon="folder-add" type="primary"
v-auth="'sys_user_add'">
{{ $t('common.addBtn') }}
</el-button>
<el-button @click="excelUploadRef.show()" class="ml10" icon="upload-filled" type="primary"
v-auth="'sys_user_add'">
{{ $t('common.importBtn') }}
</el-button>
<el-button @click="exportExcel" class="ml10" icon="Download" type="primary"
v-auth="'sys_user_export'">
{{ $t('common.exportBtn') }}
</el-button>
<el-button :disabled="multiple" @click="handleDelete(selectObjs)" class="ml10" icon="Delete"
type="primary"
v-auth="'sys_user_del'">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar @queryTable="getDataList" class="ml10"
style="float: right;margin-right: 20px"
v-model:showSearch="showSearch"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" @selection-change="handleSelectionChange" border
max-height="450" style="width: 100%" v-loading="state.loading">
<el-table-column :selectable='handleSelectable' align="center" type="selection" width="50"/>
<el-table-column :label="$t('sysuser.index')" type="index" width="60"/>
<el-table-column :label="$t('sysuser.username')" prop="username"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column :label="$t('sysuser.name')" fixed
prop="name" show-overflow-tooltip width="100"></el-table-column>
<el-table-column :label="$t('sysuser.phone')" prop="phone"
show-overflow-tooltip width="120"></el-table-column>
<el-table-column :label="$t('sysuser.post')" show-overflow-tooltip width="120">
<template #default="scope">
<el-tag :key="index" type="success" v-for="(item, index) in scope.row.postList">{{
item.postName }}
</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('sysuser.role')" show-overflow-tooltip width="100">
<template #default="scope">
<el-tag :key="index" type="success" v-for="(item, index) in scope.row.roleList">{{
item.roleName }}
</el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('sysuser.lockFlag')" show-overflow-tooltip width="100">
<template #default="scope">
<dict-tag :options="lock_flag" :value="scope.row.lockFlag"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('sysuser.createTime')" prop="createTime"
show-overflow-tooltip width="180"></el-table-column>
<el-table-column :label="$t('common.action')" fixed="right" width="160">
<template #default="scope">
<el-button @click="userDialogRef.openDialog(scope.row.userId)" text type="primary"
v-auth="'sys_user_edit'"> {{
$t('common.editBtn')
}}
</el-button>
<el-tooltip :content="$t('sysuser.deleteDisabledTip')"
:disabled="scope.row.userId !== '1'"
placement="top">
<span style="margin-left: 12px">
<el-button :disabled="scope.row.userId === '1'" @click="handleDelete([scope.row.userId])" text
type="primary"
v-auth="'sys_user_del'">{{
$t('common.delBtn')
}}
</el-button>
</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<div class="layout-padding">
<el-row :gutter="20">
<el-col :span="4" :xs="24">
<el-card class="layout-padding-auto" shadow="hover">
<query-tree :placeholder="$t('common.queryDeptTip')" :query="deptData.queryList" @node-click="handleNodeClick" />
</el-card>
</el-col>
<el-col :span="20" :xs="24">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch" class="mb8">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form-item :label="$t('sysuser.username')" prop="username">
<el-input v-model="state.queryForm.username" :placeholder="$t('sysuser.inputUsernameTip')" clearable style="width: 240px" />
</el-form-item>
<el-form-item :label="$t('sysuser.phone')" prop="phone">
<el-input v-model="state.queryForm.phone" :placeholder="$t('sysuser.inputPhoneTip')" clearable style="width: 240px" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t('common.queryBtn') }} </el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button v-auth="'sys_user_add'" class="ml10" icon="folder-add" type="primary" @click="userDialogRef.openDialog()">
{{ $t('common.addBtn') }}
</el-button>
<el-button v-auth="'sys_user_add'" class="ml10" icon="upload-filled" type="primary" @click="excelUploadRef.show()">
{{ $t('common.importBtn') }}
</el-button>
<el-button v-auth="'sys_user_export'" class="ml10" icon="Download" type="primary" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button v-auth="'sys_user_del'" :disabled="multiple" class="ml10" icon="Delete" type="primary" @click="handleDelete(selectObjs)">
{{ $t('common.delBtn') }}
</el-button>
<right-toolbar
v-model:showSearch="showSearch"
class="ml10"
style="float: right; margin-right: 20px"
@queryTable="getDataList"
></right-toolbar>
</div>
</el-row>
<el-table v-loading="state.loading" :data="state.dataList" max-height="450" style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column :selectable="handleSelectable" align="center" type="selection" width="50" />
<el-table-column :label="$t('sysuser.index')" type="index" width="60" fixed="left" />
<el-table-column :label="$t('sysuser.username')" prop="username" fixed="left" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('sysuser.name')" prop="name" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('sysuser.phone')" prop="phone" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('sysuser.post')" show-overflow-tooltip>
<template #default="scope">
<el-tag v-for="(item, index) in scope.row.postList" :key="index" type="success">{{ item.postName }} </el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('sysuser.role')" show-overflow-tooltip>
<template #default="scope">
<el-tag v-for="(item, index) in scope.row.roleList" :key="index" type="success">{{ item.roleName }} </el-tag>
</template>
</el-table-column>
<el-table-column :label="$t('sysuser.lockFlag')" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="lock_flag" :value="scope.row.lockFlag"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('sysuser.createTime')" prop="createTime" show-overflow-tooltip width="180"></el-table-column>
<el-table-column :label="$t('common.action')" width="160" fixed="right">
<template #default="scope">
<el-button v-auth="'sys_user_edit'" text type="primary" @click="userDialogRef.openDialog(scope.row.userId)">
{{ $t('common.editBtn') }}
</el-button>
<el-tooltip :content="$t('sysuser.deleteDisabledTip')" :disabled="scope.row.userId !== '1'" placement="top">
<span style="margin-left: 12px">
<el-button
v-auth="'sys_user_del'"
:disabled="scope.row.userId === '1'"
text
type="primary"
@click="handleDelete([scope.row.userId])"
>{{ $t('common.delBtn') }}
</el-button>
</span>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination @current-change="currentChangeHandle" @size-change="sizeChangeHandle"
v-bind="state.pagination">
</pagination>
</div>
</el-col>
</el-row>
<pagination v-bind="state.pagination" @current-change="currentChangeHandle" @size-change="sizeChangeHandle"> </pagination>
</div>
</el-col>
</el-row>
<user-form @refresh="getDataList(false)" ref="userDialogRef"/>
<user-form ref="userDialogRef" @refresh="getDataList(false)" />
<upload-excel :title="$t('sysuser.importUserTip')" @refreshDataList="getDataList" ref="excelUploadRef"
temp-url="/admin/sys-file/local/file/user.xlsx" url="/admin/user/import"/>
</div>
<upload-excel
ref="excelUploadRef"
:title="$t('sysuser.importUserTip')"
temp-url="/admin/sys-file/local/file/user.xlsx"
url="/admin/user/import"
@refreshDataList="getDataList"
/>
</div>
</template>
<script lang="ts" name="systemUser" setup>
import {delObj, pageList} from '/@/api/admin/user'
import {depttree} from '/@/api/admin/dept'
import {BasicTableProps, useTable} from '/@/hooks/table'
import {useDict} from '/@/hooks/dict'
import {useMessage, useMessageBox} from '/@/hooks/message'
import {useI18n} from 'vue-i18n'
import { delObj, pageList } from '/@/api/admin/user';
import { depttree } from '/@/api/admin/dept';
import { BasicTableProps, useTable } from '/@/hooks/table';
import { useDict } from '/@/hooks/dict';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
//
const UserForm = defineAsyncComponent(() => import('./form.vue'));
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'))
//
const UserForm = defineAsyncComponent(() => import('./form.vue'));
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'));
const {lock_flag} = useDict('lock_flag')
const {t} = useI18n()
const { lock_flag } = useDict('lock_flag');
const { t } = useI18n();
//
const userDialogRef = ref();
const excelUploadRef = ref();
const queryRef = ref();
const showSearch = ref(true)
//
const userDialogRef = ref();
const excelUploadRef = ref();
const queryRef = ref();
const showSearch = ref(true);
// rows
const selectObjs = ref([]) as any;
//
const multiple = ref(true);
// rows
const selectObjs = ref([]) as any
//
const multiple = ref(true)
// API
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
deptId: '',
username: '',
phone: '',
},
pageList: pageList,
});
// API
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
deptId: '',
username: '',
phone: ''
},
pageList: pageList
});
// 使
const deptData = reactive({
queryList: (name: String) => {
return depttree({
deptName: name,
});
},
});
// 使
const deptData = reactive({
queryList: (name: String) => {
return depttree({
deptName: name
})
}
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile } = useTable(state);
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
downBlobFile
} = useTable(state)
//
const resetQuery = () => {
queryRef.value.resetFields();
getDataList();
};
//
const resetQuery = () => {
queryRef.value.resetFields()
getDataList()
}
//
const handleNodeClick = (e: any) => {
state.queryForm.deptId = e.id;
getDataList();
};
//
const handleNodeClick = (e: any) => {
state.queryForm.deptId = e.id
getDataList()
}
// excel
const exportExcel = () => {
downBlobFile('/admin/user/export', state.queryForm, 'users.xlsx');
};
// excel
const exportExcel = () => {
downBlobFile('/admin/user/export', state.queryForm, 'users.xlsx')
}
//
const handleSelectable = (row: any) => {
return row.userId !== '1';
};
//
const handleSelectable = (row: any) => {
return row.userId !== '1'
}
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.userId);
});
multiple.value = !objs.length;
};
//
const handleSelectionChange = (objs: any) => {
objs.forEach((val: any) => {
selectObjs.value.push(val.userId)
});
multiple.value = !objs.length
}
//
const handleDelete = (ids: string[]) => {
useMessageBox()
.confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids)
.then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
})
.catch((err: any) => {
useMessage().error(err.msg);
});
});
};
//
const handleDelete = (ids: string[]) => {
useMessageBox().confirm(t('common.delConfirmText'))
.then(() => {
delObj(ids).then(() => {
getDataList(false);
useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => {
useMessage().error(err.msg)
})
})
};
onMounted(() => {
state.dataList
})
onMounted(() => {
state.dataList;
});
</script>

View File

@ -6,9 +6,7 @@
<div class="flex-warp-item-box">
<div class="flex-margin">
<i :class="v.meta.icon"></i>
<el-tag :key="v.path" @click="HandleRoute(v)" class="mx-1" closable :type="v.path" @close="handleCloseFavorite(v)">{{
$t(v.name)
}}</el-tag>
<el-tag :key="v.path" @click="HandleRoute(v)" class="mx-1" closable @close="handleCloseFavorite(v)">{{ $t(v.name) }}</el-tag>
</div>
</div>
</div>

View File

@ -6,7 +6,9 @@
</div>
</template>
<el-timeline v-if="newsList.length > 0">
<el-timeline-item v-for="(item, index) in newsList" :key="index" :timestamp="item.time"> {{ item.label }} - {{ item.value }} </el-timeline-item>
<el-timeline-item v-for="(item, index) in newsList.slice(0, 5)" :key="index" :timestamp="item.time">
{{ item.label }} - {{ item.value }}
</el-timeline-item>
</el-timeline>
<el-empty v-else />
</el-card>
@ -15,7 +17,9 @@
<script setup lang="ts" name="SysFavoriteDashboard">
import { useMsg } from '/@/stores/msg';
const mes = useMsg();
const newsList = computed(() => {
return useMsg().getAllMsg();
return mes.getAllMsg();
});
</script>

View File

@ -24,17 +24,10 @@
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button
formDialogRef
icon="folder-add"
type="primary"
class="ml10"
@click="formDialogRef.openDialog(null, state.queryForm)"
v-auth="'admin_schedule_add'"
>
<el-button formDialogRef icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog(null, state.queryForm)">
{{ $t('common.addBtn') }}
</el-button>
<el-button formDialogRef icon="Download" type="primary" class="ml10" @click="exportExcel" v-auth="'admin_schedule_export'">
<el-button formDialogRef icon="Download" type="primary" class="ml10" @click="exportExcel">
{{ $t('common.exportBtn') }}
</el-button>
<el-button
@ -82,10 +75,8 @@
<el-table-column prop="createTime" :label="t('schedule.createTime')" show-overflow-tooltip />
<el-table-column :label="$t('common.action')" width="150">
<template #default="scope">
<el-button text type="primary" v-auth="'admin_schedule_edit'" @click="formDialogRef.openDialog(scope.row.id)">{{
$t('common.editBtn')
}}</el-button>
<el-button text type="primary" v-auth="'admin_schedule_del'" @click="handleDelete([scope.row.id])">{{ $t('common.delBtn') }}</el-button>
<el-button text type="primary" @click="formDialogRef.openDialog(scope.row.id)">{{ $t('common.editBtn') }}</el-button>
<el-button text type="primary" @click="handleDelete([scope.row.id])">{{ $t('common.delBtn') }}</el-button>
</template>
</el-table-column>
</el-table>