|
@@ -1,13 +1,26 @@
|
|
|
<template>
|
|
|
<div class="table-container">
|
|
|
<vab-query-form>
|
|
|
+ <el-form
|
|
|
+ ref="searchForm"
|
|
|
+ :model="searchForm"
|
|
|
+ :inline="true"
|
|
|
+ @submit.native.prevent
|
|
|
+ >
|
|
|
<vab-query-form-left-panel>
|
|
|
- <el-form
|
|
|
- ref="searchForm"
|
|
|
- :model="searchForm"
|
|
|
- :inline="true"
|
|
|
- @submit.native.prevent
|
|
|
- >
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="times"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item>
|
|
|
<el-select
|
|
|
v-model="searchForm.stationCode"
|
|
@@ -21,14 +34,9 @@
|
|
|
:value="item.stationCode"
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
-
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-select
|
|
|
- v-model="searchForm.inCode"
|
|
|
- clearable
|
|
|
- placeholder="公司"
|
|
|
- >
|
|
|
+ <el-select v-model="searchForm.inCode" clearable placeholder="公司">
|
|
|
<el-option
|
|
|
v-for="item in companys"
|
|
|
:key="item.code"
|
|
@@ -37,18 +45,25 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button
|
|
|
- icon="el-icon-search"
|
|
|
- type="primary"
|
|
|
- native-type="submit"
|
|
|
- @click="handleQuery"
|
|
|
- >
|
|
|
- 查询
|
|
|
- </el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+
|
|
|
+
|
|
|
</vab-query-form-left-panel>
|
|
|
+
|
|
|
+
|
|
|
+ <vab-query-form-right-panel :span="1">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-search"
|
|
|
+ type="primary"
|
|
|
+ native-type="submit"
|
|
|
+ @click="handleQuery"
|
|
|
+ >
|
|
|
+ 查询
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </vab-query-form-right-panel>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
</vab-query-form>
|
|
|
|
|
|
<el-table
|
|
@@ -79,17 +94,22 @@
|
|
|
prop="stationCode"
|
|
|
:formatter="formatStation"
|
|
|
/>
|
|
|
- <el-table-column
|
|
|
- show-overflow-tooltip
|
|
|
- label="日志类型"
|
|
|
- prop="type"
|
|
|
-
|
|
|
- />
|
|
|
+ <el-table-column show-overflow-tooltip label="日志类型" prop="type" />
|
|
|
|
|
|
<el-table-column show-overflow-tooltip label="状态" prop="state" />
|
|
|
<el-table-column show-overflow-tooltip label="状态" prop="stateContent" />
|
|
|
- <el-table-column show-overflow-tooltip label="时间" prop="time" :formatter="formatDate"/>
|
|
|
- <el-table-column show-overflow-tooltip label="创建时间" prop="createTime" :formatter="formatDate"/>
|
|
|
+ <el-table-column
|
|
|
+ show-overflow-tooltip
|
|
|
+ label="时间"
|
|
|
+ prop="time"
|
|
|
+ :formatter="formatDate"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ show-overflow-tooltip
|
|
|
+ label="创建时间"
|
|
|
+ prop="createTime"
|
|
|
+ :formatter="formatDate"
|
|
|
+ />
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
|
:background="background"
|
|
@@ -116,7 +136,11 @@
|
|
|
tableData: [],
|
|
|
companys: [],
|
|
|
stations: [],
|
|
|
- searchForm:{},
|
|
|
+ searchForm: {},
|
|
|
+ times: [
|
|
|
+ this.dateFormat("yyyy-MM-dd HH:mm:ss",new Date(new Date().setHours(0, 0, 0, 0))),
|
|
|
+ this.dateFormat("yyyy-MM-dd HH:mm:ss",new Date(new Date().setHours(23, 59, 59, 59))),
|
|
|
+ ],
|
|
|
listLoading: true,
|
|
|
layout: 'total, sizes, prev, pager, next, jumper',
|
|
|
total: 0,
|
|
@@ -163,6 +187,8 @@
|
|
|
},
|
|
|
async fetchData() {
|
|
|
this.listLoading = true
|
|
|
+ this.searchForm.startTime = this.times[0]
|
|
|
+ this.searchForm.endTime = this.times[1]
|
|
|
fetchList(
|
|
|
Object.assign(
|
|
|
{
|
|
@@ -208,17 +234,40 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- formatStation(row, column){
|
|
|
+ formatStation(row, column) {
|
|
|
const selectedItem = this.stations.find((item) => {
|
|
|
return item.stationCode === row.stationCode
|
|
|
})
|
|
|
return selectedItem.name
|
|
|
},
|
|
|
- formatDate(row, column){
|
|
|
+ formatDate(row, column) {
|
|
|
let pro = column.property
|
|
|
- console.log(row[pro])
|
|
|
+ console.log(row[pro])
|
|
|
return row[pro]
|
|
|
},
|
|
|
+
|
|
|
+ dateFormat(fmt, date) {
|
|
|
+ let ret
|
|
|
+ const opt = {
|
|
|
+ 'y+': date.getFullYear().toString(), // 年
|
|
|
+ 'M+': (date.getMonth() + 1).toString(), // 月
|
|
|
+ 'd+': date.getDate().toString(), // 日
|
|
|
+ 'H+': date.getHours().toString(), // 时
|
|
|
+ 'm+': date.getMinutes().toString(), // 分
|
|
|
+ 's+': date.getSeconds().toString(), // 秒
|
|
|
+ // 有其他格式化字符需求可以继续添加,必须转化成字符串
|
|
|
+ }
|
|
|
+ for (let k in opt) {
|
|
|
+ ret = new RegExp('(' + k + ')').exec(fmt)
|
|
|
+ if (ret) {
|
|
|
+ fmt = fmt.replace(
|
|
|
+ ret[1],
|
|
|
+ ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
|
|
|
+ )
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return fmt
|
|
|
+ },
|
|
|
},
|
|
|
}
|
|
|
</script>
|