增加用户更新日志
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询用户
|
||||||
|
* @param params 查询条件
|
||||||
|
*/
|
||||||
|
export async function pageUserLog(params) {
|
||||||
|
const res = await request.get('/organization/userLog/page', {
|
||||||
|
params
|
||||||
|
});
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
label-width="77px"
|
||||||
|
class="ele-form-search"
|
||||||
|
@keyup.enter.native="search"
|
||||||
|
@submit.native.prevent
|
||||||
|
>
|
||||||
|
<el-row :gutter="15">
|
||||||
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||||
|
<el-form-item label="用户姓名">
|
||||||
|
<el-input clearable v-model="where.username" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||||
|
<el-form-item label="工号">
|
||||||
|
<el-input clearable v-model="where.userCode" placeholder="请输入" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||||
|
<div class="ele-form-actions">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
class="ele-btn-icon"
|
||||||
|
@click="search"
|
||||||
|
>
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="reset">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
components: {},
|
||||||
|
data() {
|
||||||
|
// 默认表单数据
|
||||||
|
const defaultWhere = {
|
||||||
|
username: '',
|
||||||
|
userCode: ''
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
// 表单数据
|
||||||
|
where: { ...defaultWhere },
|
||||||
|
teamList: [],
|
||||||
|
groupList: [],
|
||||||
|
centerList: [],
|
||||||
|
orgNameList: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
// 是否开启响应式布局
|
||||||
|
styleResponsive() {
|
||||||
|
return this.$store.state.theme.styleResponsive;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
/* 搜索 */
|
||||||
|
search() {
|
||||||
|
this.$emit('search', this.where);
|
||||||
|
},
|
||||||
|
/* 重置 */
|
||||||
|
reset() {
|
||||||
|
this.where = { ...this.defaultWhere };
|
||||||
|
this.search();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<template>
|
||||||
|
<div class="ele-body">
|
||||||
|
<el-card shadow="never">
|
||||||
|
<!-- 搜索表单 -->
|
||||||
|
<search @search="reload" />
|
||||||
|
<!-- 数据表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
ref="table"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:selection.sync="selection"
|
||||||
|
cache-key="pinanUserTable"
|
||||||
|
>
|
||||||
|
<!-- 表头工具栏 -->
|
||||||
|
<template v-slot:toolbar></template>
|
||||||
|
<template v-slot:userInfo="{ row }">
|
||||||
|
<div>{{ row.userInfo.username }}</div>
|
||||||
|
<div>{{ row.userInfo.userCode }}</div>
|
||||||
|
</template>
|
||||||
|
<!-- 操作列 -->
|
||||||
|
<template v-slot:content="{ row }">
|
||||||
|
更新前:{{ row.beforeContent }}<br />
|
||||||
|
更新后:{{ row.afterContent }}
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Search from './components/search.vue';
|
||||||
|
import { pageUserLog } from '@/api/organization/user-log';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'UserLog',
|
||||||
|
components: {
|
||||||
|
Search
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
// {
|
||||||
|
// columnKey: 'selection',
|
||||||
|
// type: 'selection',
|
||||||
|
// width: 50,
|
||||||
|
// align: 'center',
|
||||||
|
// fixed: 'left'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
prop: 'optUserName',
|
||||||
|
label: '操作用户',
|
||||||
|
align: 'center',
|
||||||
|
showOverflowTooltip: true,
|
||||||
|
width: 180,
|
||||||
|
fixed: 'left'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'userInfo',
|
||||||
|
label: '更新用户',
|
||||||
|
align: 'center',
|
||||||
|
showOverflowTooltip: true,
|
||||||
|
width: 180,
|
||||||
|
slot: 'userInfo'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'typeCn',
|
||||||
|
label: '操作类型',
|
||||||
|
align: 'center',
|
||||||
|
showOverflowTooltip: true,
|
||||||
|
width: 100
|
||||||
|
},
|
||||||
|
{
|
||||||
|
columnKey: 'content',
|
||||||
|
label: '更新内容',
|
||||||
|
minWidth: 150,
|
||||||
|
align: 'center',
|
||||||
|
resizable: false,
|
||||||
|
slot: 'content',
|
||||||
|
showOverflowTooltip: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'optTime',
|
||||||
|
label: '操作时间',
|
||||||
|
showOverflowTooltip: true,
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
formatter: (_row, _column, cellValue) => {
|
||||||
|
return this.$util.toDateString(cellValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 表格选中数据
|
||||||
|
selection: [],
|
||||||
|
// 当前编辑数据
|
||||||
|
current: null,
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
showEdit: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/* 表格数据源 */
|
||||||
|
datasource({ page, limit, where, order }) {
|
||||||
|
return pageUserLog({ ...where, ...order, page, limit });
|
||||||
|
},
|
||||||
|
/* 刷新表格 */
|
||||||
|
reload(where) {
|
||||||
|
this.$refs.table.reload({ page: 1, where: where });
|
||||||
|
},
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
openEdit(row) {
|
||||||
|
this.current = row;
|
||||||
|
this.showEdit = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user