Commit 64123b45 by jack

修改日志管理

1 parent 50b03ced
<template> <template>
<div class="system-container"> <div class="system-container">
<div class="container"> <div class="container">
<search-form <!-- <search-form class="searchTop border-shadow log_search" :formModel="searchForm" :formList="worklogFormList">
class="searchTop border-shadow"
:formModel="searchForm"
:formList="worklogFormList"
>
<span slot="form-slot"> <span slot="form-slot">
<el-button <el-button type="primary" :size="btn_size" icon="el-icon-search" :id="tableParams.btnId">搜索</el-button>
type="primary" <el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button>
:size="btn_size"
icon="el-icon-search"
:id="tableParams.btnId"
>搜索</el-button>
<el-button
type="primary"
:size="btn_size"
icon="el-icon-refresh"
@click="refresh"
>重置</el-button>
</span> </span>
</search-form> </search-form> -->
<div class="log_search border-shadow">
<el-form :model="searchDataForm" label-width="80px" :inline="true" size="small">
<el-form-item label="">
<el-date-picker v-model="searchDataForm.daterange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="操作类型">
<el-select v-model="searchDataForm.term">
<el-option label="车辆绑定" value="车辆绑定"></el-option>
<el-option label="车辆解绑" value="车辆解绑"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="btn_size" icon="el-icon-search" :id="tableParams.btnId">搜索</el-button>
<el-button type="primary" :size="btn_size" icon="el-icon-refresh" @click="refresh">重置</el-button>
</el-form-item>
</el-form>
</div>
<h3>操作日志 <h3>操作日志
<div class="pull-right"> <div class="pull-right">
<el-button <el-button type="primary" :size="btn_size" @click="exportTable">导出</el-button>
type="primary"
:size="btn_size"
@click="exportTable"
>导出</el-button>
</div> </div>
</h3> </h3>
<basic-table <basic-table ref="worklogTable" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :searchForm="searchDataForm" :hasNum="false">
ref="worklogTable"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
:searchForm="searchDataForm"
:hasNum="false"
>
</basic-table> </basic-table>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import store from '@/store'; import store from "@/store";
import { WORKLOG_API } from '@/config/config' import { WORKLOG_API } from "@/config/config";
import { getWorkLogList, exportWorkLog } from 'services/worklog'; import { getWorkLogList, exportWorkLog } from "services/worklog";
export default { export default {
data() { data() {
return { return {
WORKLOGSTATUS: this.$Constants.WORKLOG_STATUS, WORKLOGSTATUS: this.$Constants.WORKLOG_STATUS,
searchForm: {}, searchForm: {},
searchDataForm: {}, searchDataForm: {},
pickerOptions: {
disabledDate(time) {
return (
time.getTime() > Date.now() ||
time.getTime() < new Date("2017-12-31").getTime()
);
},
},
worklogFormList: [ worklogFormList: [
{ {
type: 'daterange', type: "daterange",
prop: 'daterange', prop: "daterange",
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime() return (
} time.getTime() > Date.now() ||
} time.getTime() < new Date("2017-12-31").getTime()
} );
},
},
},
{
type: "select",
prop: "term",
label: "操作类型",
width: "80px",
placeholder: "请选择",
options: [
{ label: "车辆绑定", value: "车辆绑定" },
{ label: "车辆解绑", value: "车辆解绑" },
],
},
], ],
tableParams: { tableParams: {
// mutiSelectName: 'worklog', // mutiSelectName: 'worklog',
// mutiSelectUniqueKey: 'id', // mutiSelectUniqueKey: 'id',
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list', listName: "list",
tableColumns: [ tableColumns: [
{ {
label: '日志编号', label: "日志编号",
prop: 'id', prop: "id",
width: 200 width: 200,
}, { },
label: '系统菜单', {
prop: 'module' label: "系统菜单",
}, { prop: "module",
label: '操作类型', },
prop: 'action' {
}, { label: "操作类型",
label: '操作账号', prop: "action",
prop: 'operatorName' },
}, { {
label: '所属组织', label: "操作账号",
prop: 'belongOrg' prop: "operatorName",
}, { },
label: '主机IP', {
prop: 'ip', label: "所属组织",
}, { prop: "belongOrg",
label: '操作状态', },
prop: 'result', {
label: "主机IP",
prop: "ip",
},
{
label: "操作状态",
prop: "result",
// addHtml: 'status' // addHtml: 'status'
}, { },
label: '创建时间', {
prop: 'createdDate', label: "创建时间",
width: 150 prop: "createdDate",
} width: 150,
] },
],
}, },
getListApi: getWorkLogList getListApi: getWorkLogList,
} };
}, },
methods: { methods: {
refresh() { refresh() {
this.searchForm = {} this.searchForm = {};
this.searchDataForm = {} this.searchDataForm = {};
this.$refs.worklogTable.refreshTable() this.$refs.worklogTable.refreshTable();
}, },
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (this.searchForm.daterange) { if (this.searchForm.daterange) {
this.searchDataForm.sDate = this.searchForm.daterange[0] this.searchDataForm.sDate = this.searchForm.daterange[0];
this.searchDataForm.eDate = this.searchForm.daterange[1] this.searchDataForm.eDate = this.searchForm.daterange[1];
} else { } else {
if (this.searchDataForm.sDate) delete this.searchDataForm.sDate && delete this.searchDataForm.eDate if (this.searchDataForm.sDate)
delete this.searchDataForm.sDate &&
delete this.searchDataForm.eDate;
} }
resolve() resolve();
}) });
}, },
// 导出列表 // 导出列表
exportTable() { exportTable() {
const params = this.$refs.worklogTable.page const params = this.$refs.worklogTable.page;
this.$Common.exportExcel({ this.$Common.exportExcel({
url: store.state.baseURL + WORKLOG_API.WORKLOG_EXPORT, url: store.state.baseURL + WORKLOG_API.WORKLOG_EXPORT,
data: params, data: params,
method: 'GET', method: "GET",
fileName: '操作日志.xlsx' fileName: "操作日志.xlsx",
}) });
} },
} },
};
</script>
<style lang="scss" scoped>
.log_search {
padding: 18px 18px 0 18px;
} }
</script>
\ No newline at end of file \ No newline at end of file
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!