Commit 8040ad8c authored by 马小法's avatar 马小法
Browse files

修改数据字典回显

parent c628aa5b
This diff is collapsed.
...@@ -110,10 +110,18 @@ ...@@ -110,10 +110,18 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="日志编号" width="80" align="center" prop="jobLogId" /> <el-table-column label="日志编号" width="80" align="center" prop="jobLogId" />
<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" /> <el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
<el-table-column label="任务组名" align="center" prop="jobGroup" :formatter="jobGroupFormat" :show-overflow-tooltip="true" /> <el-table-column label="任务组名" align="center" prop="jobGroup" :show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="jobGroupOptions" :value="scope.row.jobGroup"/>
</template>
</el-table-column>
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" /> <el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
<el-table-column label="日志信息" align="center" prop="jobMessage" :show-overflow-tooltip="true" /> <el-table-column label="日志信息" align="center" prop="jobMessage" :show-overflow-tooltip="true" />
<el-table-column label="执行状态" align="center" prop="status" :formatter="statusFormat" /> <el-table-column label="执行状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="statusOptions" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="执行时间" align="center" prop="createTime" width="180"> <el-table-column label="执行时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
...@@ -247,14 +255,6 @@ export default { ...@@ -247,14 +255,6 @@ export default {
} }
); );
}, },
// 执行状态字典翻译
statusFormat(row, column) {
return this.selectDictLabel(this.statusOptions, row.status);
},
// 任务组名字典翻译
jobGroupFormat(row, column) {
return this.selectDictLabel(this.jobGroupOptions, row.jobGroup);
},
// 返回按钮 // 返回按钮
handleClose() { handleClose() {
this.$store.dispatch("tagsView/delView", this.$route); this.$store.dispatch("tagsView/delView", this.$route);
...@@ -325,4 +325,4 @@ export default { ...@@ -325,4 +325,4 @@ export default {
} }
} }
}; };
</script> </script>
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="登录地址" prop="ipaddr"> <el-form-item label="登录地址" prop="ipaddr">
<el-input <el-input
v-model="queryParams.ipaddr" v-model="queryParams.ipaddr"
placeholder="请输入登录地址" placeholder="请输入登录地址"
clearable clearable
style="width: 240px;" style="width: 240px;"
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用户名称" prop="userName"> <el-form-item label="用户名称" prop="userName">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
placeholder="请输入用户名称" placeholder="请输入用户名称"
clearable clearable
style="width: 240px;" style="width: 240px;"
size="small" size="small"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
placeholder="登录状态" placeholder="登录状态"
clearable clearable
size="small" size="small"
style="width: 240px" style="width: 240px"
> >
<el-option <el-option
v-for="dict in statusOptions" v-for="dict in statusOptions"
:key="dict.dictValue" :key="dict.dictValue"
:label="dict.dictLabel" :label="dict.dictLabel"
:value="dict.dictValue" :value="dict.dictValue"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="登录时间"> <el-form-item label="登录时间">
<el-date-picker <el-date-picker
v-model="dateRange" v-model="dateRange"
size="small" size="small"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="daterange" type="daterange"
range-separator="-" range-separator="-"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
plain plain
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['monitor:logininfor:remove']" v-hasPermi="['monitor:logininfor:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="danger" type="danger"
plain plain
icon="el-icon-delete" icon="el-icon-delete"
size="mini" size="mini"
@click="handleClean" @click="handleClean"
v-hasPermi="['monitor:logininfor:remove']" v-hasPermi="['monitor:logininfor:remove']"
>清空</el-button> >清空</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
:loading="exportLoading" :loading="exportLoading"
@click="handleExport" @click="handleExport"
v-hasPermi="['monitor:logininfor:export']" v-hasPermi="['monitor:logininfor:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> <el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="访问编号" align="center" prop="infoId" /> <el-table-column label="访问编号" align="center" prop="infoId" />
<el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" /> <el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" /> <el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" /> <el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" /> <el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
<el-table-column label="操作系统" align="center" prop="os" /> <el-table-column label="操作系统" align="center" prop="os" />
<el-table-column label="登录状态" align="center" prop="status" :formatter="statusFormat" /> <el-table-column label="登录状态" align="center" prop="status">
<el-table-column label="操作信息" align="center" prop="msg" /> <template slot-scope="scope">
<el-table-column label="登录日期" align="center" prop="loginTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180"> <dict-tag :options="statusOptions" :value="scope.row.status"/>
<template slot-scope="scope"> </template>
<span>{{ parseTime(scope.row.loginTime) }}</span> </el-table-column>
</template> <el-table-column label="操作信息" align="center" prop="msg" />
</el-table-column> <el-table-column label="登录日期" align="center" prop="loginTime" sortable="custom" :sort-orders="['descending', 'ascending']" width="180">
</el-table> <template slot-scope="scope">
<span>{{ parseTime(scope.row.loginTime) }}</span>
<pagination </template>
v-show="total>0" </el-table-column>
:total="total" </el-table>
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" <pagination
@pagination="getList" v-show="total>0"
/> :total="total"
</div> :page.sync="queryParams.pageNum"
</template> :limit.sync="queryParams.pageSize"
@pagination="getList"
<script> />
import { list, delLogininfor, cleanLogininfor, exportLogininfor } from "@/api/monitor/logininfor"; </div>
</template>
export default {
name: "Logininfor", <script>
data() { import { list, delLogininfor, cleanLogininfor, exportLogininfor } from "@/api/monitor/logininfor";
return {
// 遮罩层 export default {
loading: true, name: "Logininfor",
// 导出遮罩层 data() {
exportLoading: false, return {
// 选中数组 // 遮罩层
ids: [], loading: true,
// 非多个禁用 // 导出遮罩层
multiple: true, exportLoading: false,
// 显示搜索条件 // 选中数组
showSearch: true, ids: [],
// 总条数 // 非多个禁用
total: 0, multiple: true,
// 表格数据 // 显示搜索条件
list: [], showSearch: true,
// 状态数据字典 // 总条数
statusOptions: [], total: 0,
// 日期范围 // 表格数据
dateRange: [], list: [],
// 默认排序 // 状态数据字典
defaultSort: {prop: 'loginTime', order: 'descending'}, statusOptions: [],
// 查询参数 // 日期范围
queryParams: { dateRange: [],
pageNum: 1, // 默认排序
pageSize: 10, defaultSort: {prop: 'loginTime', order: 'descending'},
ipaddr: undefined, // 查询参数
userName: undefined, queryParams: {
status: undefined pageNum: 1,
} pageSize: 10,
}; ipaddr: undefined,
}, userName: undefined,
created() { status: undefined
this.getList(); }
this.getDicts("sys_common_status").then(response => { };
this.statusOptions = response.data; },
}); created() {
}, this.getList();
methods: { this.getDicts("sys_common_status").then(response => {
/** 查询登录日志列表 */ this.statusOptions = response.data;
getList() { });
this.loading = true; },
list(this.addDateRange(this.queryParams, this.dateRange)).then(response => { methods: {
this.list = response.rows; /** 查询登录日志列表 */
this.total = response.total; getList() {
this.loading = false; this.loading = true;
} list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
); this.list = response.rows;
}, this.total = response.total;
// 登录状态字典翻译 this.loading = false;
statusFormat(row, column) { }
return this.selectDictLabel(this.statusOptions, row.status); );
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.resetForm("queryForm");
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order) this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
this.handleQuery(); this.handleQuery();
}, },
/** 多选框选中数据 */ /** 多选框选中数据 */
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.infoId) this.ids = selection.map(item => item.infoId)
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 排序触发事件 */ /** 排序触发事件 */
handleSortChange(column, prop, order) { handleSortChange(column, prop, order) {
this.queryParams.orderByColumn = column.prop; this.queryParams.orderByColumn = column.prop;
this.queryParams.isAsc = column.order; this.queryParams.isAsc = column.order;
this.getList(); this.getList();
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const infoIds = row.infoId || this.ids; const infoIds = row.infoId || this.ids;
this.$confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?', "警告", { this.$confirm('是否确认删除访问编号为"' + infoIds + '"的数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(function() {
return delLogininfor(infoIds); return delLogininfor(infoIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.msgSuccess("删除成功"); this.msgSuccess("删除成功");
}).catch(() => {}); }).catch(() => {});
}, },
/** 清空按钮操作 */ /** 清空按钮操作 */
handleClean() { handleClean() {
this.$confirm('是否确认清空所有登录日志数据项?', "警告", { this.$confirm('是否确认清空所有登录日志数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(function() { }).then(function() {
return cleanLogininfor(); return cleanLogininfor();
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.msgSuccess("清空成功"); this.msgSuccess("清空成功");
}).catch(() => {}); }).catch(() => {});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$confirm('是否确认导出所有操作日志数据项?', "警告", { this.$confirm('是否确认导出所有操作日志数据项?', "警告", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportLogininfor(queryParams); return exportLogininfor(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
} }
} }
}; };
</script> </script>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment