Commit 2d882c49 authored by 拾柒's avatar 拾柒

修改页面布局,添加历史记录页面

parent 88afe44f
import request from '@/utils/request'
// 查询www列表
export function listHistable(query) {
return request({
url: '/system/histable/list',
method: 'get',
params: query
})
}
// 查询www详细
export function getHistable(ID) {
return request({
url: '/system/histable/' + ID,
method: 'get'
})
}
// 新增www
export function addHistable(data) {
return request({
url: '/system/histable',
method: 'post',
data: data
})
}
// 修改www
export function updateHistable(data) {
return request({
url: '/system/histable',
method: 'put',
data: data
})
}
// 删除www
export function delHistable(ID) {
return request({
url: '/system/histable/' + ID,
method: 'delete'
})
}
......@@ -106,15 +106,29 @@ export const constantRoutes = [
path: '/monitoringPlayback',
component: Layout,
hidden: false,
redirect: 'noredirect',
redirect: 'monitoringPlayback/playback',
children: [
{
path: 'video',
path: 'playback',
component: () => import('@/views/video/playback'),
name: 'Video',
name: 'Playback',
meta: { title: '视频回放', icon: 'user' }
}
]
},
{
path: '/monitoringhistory',
component: Layout,
hidden: false,
redirect: 'monitoringhistory/history',
children: [
{
path: 'history',
component: () => import('@/views/history/index'),
name: 'History',
meta: { title: '历史记录', icon: 'user' }
}
]
}
]
......
<template>
<div class="app-container">
<div style="background-color: #F6F6FA;height: 95vh;" >
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="监控点名称" prop="monitoringName">
<el-input
v-model="queryParams.monitoringName"
placeholder="请输入监控点名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="监控时间" prop="monitorTime">
<el-date-picker clearable
v-model="queryParams.monitorTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择监控时间">
</el-date-picker>
</el-form-item>
<el-form-item label="监控状态" prop="monitorState">
<el-input
v-model="queryParams.monitorState"
placeholder="请输入监控状态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<!-- <el-table v-loading="loading" :data="histableList" @selection-change="handleSelectionChange">-->
<el-table :data="histableList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" />
<!-- <template slot-scope="scope">-->
<!-- <span> {{ queryParams.pageNum * queryParams.pageSize + scope.$index}}</span>-->
<!-- </template>-->
<el-table-column label="监控点名称" align="center" prop="monitoringName" />
<el-table-column label="监控开始时间" align="center" prop="monitoringStarttime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.monitoringStarttime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="监控结束时间" align="center" prop="monitoringFinallytime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.monitoringFinallytime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="监控时间" align="center" prop="monitorTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.monitorTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="监控状态" align="center" prop="monitorState" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改history对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import { listHistable, getHistable, delHistable, addHistable, updateHistable } from "@/api/system/histable";
import {parseTime} from "../../utils/ruoyi";
export default {
name: "Histable",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// history表格数据
histableList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
monitoringName: null,
monitorTime: null,
monitorState: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
parseTime,
/** 查询history列表 */
getList() {
this.loading = true;
listHistable(this.queryParams).then(response => {
this.histableList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
ID: null,
monitoringName: null,
monitoringStarttime: null,
monitoringFinallytime: null,
monitorTime: null,
monitorState: null,
CREATETIME: null,
CREATEBY: null,
UPDATETIME: null,
UPDATEBY: null,
delFlag: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.ID)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加history";
},
/** 修改按钮操作 */
handleUpdate(row) {
// 查看详情页面(把id换成code)
this.$router.push({ path: '/monitoringPlayback/playback', query: { code: row.ID } })
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.ID != null) {
updateHistable(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHistable(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const IDs = row.ID || this.ids;
this.$modal.confirm('是否确认删除history编号为"' + IDs + '"的数据项?').then(function() {
return delHistable(IDs);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/histable/export', {
...this.queryParams
}, `histable_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<template>
<div class="app-container">
<div style="background-color: #F6F6FA;height: 95vh;" >
<div style="background-color: #F6F6FA;height: 95vh;padding-left: 30px;padding-right: 30px" >
<div>
<span style="display: flex;justify-content: flex-start;align-items: center;"><div style="border: 1px solid #116FBB;width: 2px;height: 20px;margin-right: 5px"></div><h5 style="color: #116FBB">员工信息管理</h5></span>
</div>
<el-row :gutter="20">
<!--部门数据-->
<el-col :span="4" :xs="24">
......
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