Commit 12101ec5 authored by 69237's avatar 69237

sunyu 序号凑合用了QAQ

parent 4e9dc9ee
This diff is collapsed.
...@@ -35,12 +35,16 @@ ...@@ -35,12 +35,16 @@
label-width="100px" label-width="100px"
> >
<el-form-item prop="monitoringName"> <el-form-item prop="monitoringName">
<el-input <el-select
v-model.trim="queryParams.monitoringName" v-model="queryParams.monitoringName"
placeholder="请输入监控点名称" placeholder="请输入监控点名称"
clearable clearable
@keyup.enter.native="handleQuery" >
/> <el-option value="01">Camera 01</el-option>
<el-option value="02">Camera 02</el-option>
<el-option value="03">Camera 03</el-option>
<el-option value="04">Camera 04</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item prop="monitorState"> <el-form-item prop="monitorState">
...@@ -58,11 +62,8 @@ ...@@ -58,11 +62,8 @@
<el-date-picker <el-date-picker
placeholder="请选择监控时间" placeholder="请选择监控时间"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
v-model="queryParams.monitorTime" v-model="queryParams.monitoringStarttime"
type="datetimerange" type="date"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
> >
</el-date-picker> </el-date-picker>
<!-- <el-date-picker clearable--> <!-- <el-date-picker clearable-->
...@@ -103,7 +104,12 @@ ...@@ -103,7 +104,12 @@
style="min-height: 650px" style="min-height: 650px"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="100" prop="id" />
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">
<span>{{ calculateIndex(scope.$index) }}</span>
</template>
</el-table-column>
<!-- <template slot-scope="scope">--> <!-- <template slot-scope="scope">-->
<!-- <span>{{ (scope.$index+1)+(queryParams.pageNum-1)*queryParams.pageSize }}</span>--> <!-- <span>{{ (scope.$index+1)+(queryParams.pageNum-1)*queryParams.pageSize }}</span>-->
<!-- </template>--> <!-- </template>-->
...@@ -198,6 +204,10 @@ ...@@ -198,6 +204,10 @@
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
:current-page.sync="currentPage"
:page-size="pageSize"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
@pagination="getList" @pagination="getList"
/> />
...@@ -234,7 +244,6 @@ export default { ...@@ -234,7 +244,6 @@ export default {
dicts: ["history_state"], dicts: ["history_state"],
data() { data() {
return { return {
backTag: true,
carryRowCode: { carryRowCode: {
id: "", id: "",
monitoringName: "", monitoringName: "",
...@@ -257,6 +266,9 @@ export default { ...@@ -257,6 +266,9 @@ export default {
total: 0, total: 0,
// history表格数据 // history表格数据
histableList: [], histableList: [],
currentPage: 1,
pageSize: 10,
currentPageData: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
...@@ -265,10 +277,10 @@ export default { ...@@ -265,10 +277,10 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
monitoringName: null, monitoringName: undefined,
monitorTime: null, monitorTime: undefined,
monitorState: null, monitorState: undefined,
id: null, id: undefined,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
...@@ -278,8 +290,43 @@ export default { ...@@ -278,8 +290,43 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.updateCurrentPageData();
},
computed: {
startIndexOfPage() {
return (this.currentPage - 1) * this.total;
},
}, },
methods: { methods: {
handleSizeChange(val) {
this.total = val;
this.updateCurrentPageData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.updateCurrentPageData();
},
updateCurrentPageData() {
const startIndex = (this.currentPage - 1) * this.total;
const endIndex = startIndex + this.total;
this.currentPageData = this.histableList.slice(startIndex, endIndex);
},
calculateIndex(index) {
return this.startIndexOfPage + index + 1;
},
prevPage() {
if (this.currentPage > 1) {
this.currentPage--;
}
},
nextPage() {
const maxPage = Math.ceil(this.items.length / this.total);
if (this.currentPage < maxPage) {
this.currentPage++;
}
},
formatHoursAsHMS(hours) { formatHoursAsHMS(hours) {
// 确保小时数为整数 // 确保小时数为整数
const intHours = Math.floor(hours); const intHours = Math.floor(hours);
...@@ -308,17 +355,12 @@ export default { ...@@ -308,17 +355,12 @@ export default {
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
ID: null, ID: undefined,
monitoringName: null, monitoringName: undefined,
monitoringStarttime: null, monitoringStarttime: undefined,
monitoringFinallytime: null, monitoringFinallytime: undefined,
monitorTime: null, monitorTime: undefined,
monitorState: null, monitorState: undefined,
CREATETIME: null,
CREATEBY: null,
UPDATETIME: null,
UPDATEBY: null,
delFlag: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -346,12 +388,6 @@ export default { ...@@ -346,12 +388,6 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.$router.push({
name: "back",
query: {
backTag: true,
},
});
this.carryRowCode = row; this.carryRowCode = row;
// 查看详情页面(把id换成code) // 查看详情页面(把id换成code)
this.$router.push({ this.$router.push({
......
Markdown is supported
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