|
@@ -1,81 +1,105 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="tab3">
|
|
<div class="tab3">
|
|
|
- <div class="search">
|
|
|
|
|
- <div :class="{ active: topInd === 1 }" @click="topInd = 1">安防设备</div>
|
|
|
|
|
- <div :class="{ active: topInd === 2 }" @click="topInd = 2">监控画面</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <!-- 表格 -->
|
|
|
|
|
- <div class="table" v-show="topInd === 1">
|
|
|
|
|
- <el-table :data="tableData" border style="width: 100%">
|
|
|
|
|
- <el-table-column prop="id" label="序列" width="80"></el-table-column>
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- prop="type"
|
|
|
|
|
- label="栏目类型"
|
|
|
|
|
- width="240"
|
|
|
|
|
- ></el-table-column>
|
|
|
|
|
- <el-table-column prop="conten" label="数据字段"></el-table-column>
|
|
|
|
|
- <el-table-column prop="time" label="更新时间" width="200">
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="操作" width="120">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-button type="text" @click="edit(row.data, row.id)"
|
|
|
|
|
- >修 改</el-button
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </div>
|
|
|
|
|
- <!-- 表格 -->
|
|
|
|
|
- <div class="table" v-show="topInd === 2">
|
|
|
|
|
|
|
+ <div class="insideTop">
|
|
|
|
|
+ 学籍管理
|
|
|
<div class="add">
|
|
<div class="add">
|
|
|
- <el-button type="primary" @click="addVideo">新 增</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="$router.push('/layout/tab3Add')">新增学籍信息</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="obstruct"></div>
|
|
|
|
|
+ <!-- 主要内容 -->
|
|
|
|
|
+ <div class="conten">
|
|
|
|
|
+ <div class="classify">全部</div>
|
|
|
|
|
+ <div class="search">
|
|
|
|
|
+ <span>发布时间:</span>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ style="width: 240px"
|
|
|
|
|
+ v-model="time"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ range-separator="-"
|
|
|
|
|
+ start-placeholder="开始时间"
|
|
|
|
|
+ end-placeholder="结束时间"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ <span class="search_k">姓名关键字:</span>
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="formData.searchKey"
|
|
|
|
|
+ placeholder="请输入"
|
|
|
|
|
+ style="width: 240px"
|
|
|
|
|
+ ></el-input>
|
|
|
|
|
+ <span class="search_k">排序:</span>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="formData.type"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ style="width: 240px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option label="发布时间" value="time"></el-option>
|
|
|
|
|
+ <el-option label="排序编号" value="number"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ <!-- 右侧按钮 -->
|
|
|
|
|
+ <div class="search_btn">
|
|
|
|
|
+ <el-button type="primary">查 询</el-button>
|
|
|
|
|
+ <el-button>重 置</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <!-- 表格 -->
|
|
|
|
|
+ <div class="table">
|
|
|
|
|
+ <el-table :data="tableData" style="width: 100%">
|
|
|
|
|
+ <el-table-column label="序号" width="80">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ {{
|
|
|
|
|
+ scope.$index + (formData.pageNum - 1) * formData.pageSize + 1
|
|
|
|
|
+ }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="姓名" width="200">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span class="table_name" :title="row.name1">{{ row.name1 }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="学籍号" width="200">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span class="table_name" :title="row.name1">{{ row.name1 }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="封面图片" width="120">
|
|
|
|
|
+ <template #default>
|
|
|
|
|
+ <img class="table_img" src="../../assets/img/demo.png" alt="" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="name1" label="阅读"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="name1" label="发布人"> </el-table-column>
|
|
|
|
|
+ <el-table-column prop="name2" label="发布时间" width="200">
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="address" label="排序" width="80">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <el-input type="text" v-model="row.name1"></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="name3" label="是否显示">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <el-switch v-model="row.name3" active-color="#b9412e">
|
|
|
|
|
+ </el-switch>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="操作">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <el-button type="text" @click="lookGood(row.id)"
|
|
|
|
|
+ >查看</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button type="text" v-if="!row.name3">编辑</el-button>
|
|
|
|
|
+ <el-button type="text" v-if="!row.name3">删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-table :data="tableData2" border style="width: 100%">
|
|
|
|
|
- <el-table-column label="序列" width="80">
|
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
|
- {{ scope.$index + (from2.pageNum - 1) * from2.pageSize + 1 }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column prop="name" label="视频名称"></el-table-column>
|
|
|
|
|
- <el-table-column label="视频封面">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-image
|
|
|
|
|
- style="height: 50px"
|
|
|
|
|
- :src="baseURL + row.thumb"
|
|
|
|
|
- :preview-src-list="srcList"
|
|
|
|
|
- >
|
|
|
|
|
- </el-image>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="视频文件">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <a
|
|
|
|
|
- :href="baseURL + row.video"
|
|
|
|
|
- target="_blank"
|
|
|
|
|
- :download="baseURL + row.video"
|
|
|
|
|
- class="mydown"
|
|
|
|
|
- >下 载</a
|
|
|
|
|
- >
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="操作" width="200">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-button type="text" @click="editVideo(row.id)">修 改</el-button>
|
|
|
|
|
- <el-button type="text" @click="delVideo(row.id)" style="color:#b6242b;">删 除</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- 新增弹窗 -->
|
|
|
|
|
- <Tab3Dialog :isShow.sync="isShow" @refresh="securityVideoList(from2)" ref="Tab3DialogRef"/>
|
|
|
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
|
- <div class="paging" v-show="topInd === 2">
|
|
|
|
|
- <span class="zong">共 {{total}} 条</span>
|
|
|
|
|
|
|
+ <div class="paging">
|
|
|
<el-pagination
|
|
<el-pagination
|
|
|
- layout="sizes,prev,pager,next,jumper"
|
|
|
|
|
|
|
+ layout="sizes,prev, pager, next,jumper"
|
|
|
:total="total"
|
|
:total="total"
|
|
|
- :page-sizes="[15, 30, 45, 60]"
|
|
|
|
|
- :current-page="from2.pageNum"
|
|
|
|
|
|
|
+ :current-page="formData.pageNum"
|
|
|
@current-change="currentChange"
|
|
@current-change="currentChange"
|
|
|
@size-change="sizeChange"
|
|
@size-change="sizeChange"
|
|
|
>
|
|
>
|
|
@@ -85,117 +109,97 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import axios from '@/utils/request'
|
|
|
|
|
-import Tab3Dialog from '@/components/tab3Dialog.vue'
|
|
|
|
|
-import { securityList, securityVideoList, videoRemove } from '@/apis/tab3'
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'tab3',
|
|
name: 'tab3',
|
|
|
- components: { Tab3Dialog },
|
|
|
|
|
|
|
+ components: {},
|
|
|
data () {
|
|
data () {
|
|
|
// 这里存放数据
|
|
// 这里存放数据
|
|
|
return {
|
|
return {
|
|
|
- total: 0,
|
|
|
|
|
- srcList: [], // 查看大图的图片数组合集
|
|
|
|
|
- baseURL: '',
|
|
|
|
|
- isShow: false,
|
|
|
|
|
- topInd: 1,
|
|
|
|
|
- from: {
|
|
|
|
|
|
|
+ total: 100,
|
|
|
|
|
+ time: '',
|
|
|
|
|
+ formData: {
|
|
|
|
|
+ startTime: '',
|
|
|
|
|
+ endTime: '',
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
|
pageSize: 9999,
|
|
pageSize: 9999,
|
|
|
searchKey: '',
|
|
searchKey: '',
|
|
|
- type: ''
|
|
|
|
|
- },
|
|
|
|
|
- from2: {
|
|
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 15,
|
|
|
|
|
- searchKey: ''
|
|
|
|
|
|
|
+ type: 'time'
|
|
|
},
|
|
},
|
|
|
- tableData: [],
|
|
|
|
|
- tableData2: []
|
|
|
|
|
|
|
+ tableData: [
|
|
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
|
|
+ { name1: '123', name2: '123', name3: false },
|
|
|
|
|
+ { name1: '123', name2: '2013-12-26 13:33:23', name3: true },
|
|
|
|
|
+ { name1: '123', name2: '123', name3: false }
|
|
|
|
|
+ ]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
// 监听属性 类似于data概念
|
|
|
computed: {},
|
|
computed: {},
|
|
|
// 监控data中的数据变化
|
|
// 监控data中的数据变化
|
|
|
- watch: {},
|
|
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ time (val) {
|
|
|
|
|
+ this.handleSelect(val)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 方法集合
|
|
// 方法集合
|
|
|
methods: {
|
|
methods: {
|
|
|
// 分页器方法
|
|
// 分页器方法
|
|
|
currentChange (val) {
|
|
currentChange (val) {
|
|
|
// console.log('当前页改变了', val)
|
|
// console.log('当前页改变了', val)
|
|
|
- this.from2.pageNum = val
|
|
|
|
|
- this.securityVideoList(this.from2)
|
|
|
|
|
},
|
|
},
|
|
|
sizeChange (val) {
|
|
sizeChange (val) {
|
|
|
// console.log('条数改变了', val)
|
|
// console.log('条数改变了', val)
|
|
|
- this.from2.pageNum = 1
|
|
|
|
|
- this.from2.pageSize = val
|
|
|
|
|
- this.securityVideoList(this.from2)
|
|
|
|
|
- },
|
|
|
|
|
- // 点击监控画面新增
|
|
|
|
|
- addVideo () {
|
|
|
|
|
- this.isShow = true
|
|
|
|
|
- },
|
|
|
|
|
- // 点击安防设备修改
|
|
|
|
|
- edit (val, id) {
|
|
|
|
|
|
|
+ }, // 点击查看
|
|
|
|
|
+ lookGood (id) {
|
|
|
this.$router.push({
|
|
this.$router.push({
|
|
|
- path: '/layout/tab3Edit1',
|
|
|
|
|
- query: { ...val, id }
|
|
|
|
|
|
|
+ path: '/layout/tab3Look'
|
|
|
|
|
+ // query: { conLeftId: this.conLeft }
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- // 点击监控画面修改
|
|
|
|
|
- editVideo (id) {
|
|
|
|
|
- this.$refs.Tab3DialogRef.videoDetailById(id)
|
|
|
|
|
- this.isShow = true
|
|
|
|
|
|
|
+ // 时间处理----------------
|
|
|
|
|
+ handleSelect (e) {
|
|
|
|
|
+ const date = []
|
|
|
|
|
+ for (const i in e) {
|
|
|
|
|
+ date.push(this.gettime(e[i]))
|
|
|
|
|
+ }
|
|
|
|
|
+ this.formData.startTime = date[0]
|
|
|
|
|
+ if (date[1]) {
|
|
|
|
|
+ this.formData.endTime = date[1].replace('00:00:00', '23:59:59')
|
|
|
|
|
+ }
|
|
|
|
|
+ if (e === null) this.formData.endTime = ''
|
|
|
},
|
|
},
|
|
|
- // 点击删除
|
|
|
|
|
- delVideo (id) {
|
|
|
|
|
- this.$confirm('确定删除吗?', '提示', {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- })
|
|
|
|
|
- .then(async () => {
|
|
|
|
|
- await videoRemove(id)
|
|
|
|
|
- this.$message.success('删除成功!')
|
|
|
|
|
- this.securityVideoList(this.from2)
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
- this.$message.info('已取消删除')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ gettime (data) {
|
|
|
|
|
+ const value =
|
|
|
|
|
+ data.getFullYear() +
|
|
|
|
|
+ '-' +
|
|
|
|
|
+ this.checkTime(data.getMonth() + 1) +
|
|
|
|
|
+ '-' +
|
|
|
|
|
+ this.checkTime(data.getDate()) +
|
|
|
|
|
+ ' ' +
|
|
|
|
|
+ this.checkTime(data.getHours()) +
|
|
|
|
|
+ ':' +
|
|
|
|
|
+ this.checkTime(data.getMinutes()) +
|
|
|
|
|
+ ':' +
|
|
|
|
|
+ this.checkTime(data.getSeconds())
|
|
|
|
|
+ return value
|
|
|
},
|
|
},
|
|
|
- // 封装获取列表方法
|
|
|
|
|
- async securityList (data) {
|
|
|
|
|
- const res = await securityList(data)
|
|
|
|
|
- res.data.forEach((v) => {
|
|
|
|
|
- const temp = {}
|
|
|
|
|
- temp.id = v.id
|
|
|
|
|
- temp.type = '安防设备'
|
|
|
|
|
- temp.data = JSON.parse(v.data)
|
|
|
|
|
- temp.time = v.userUpdateTime
|
|
|
|
|
- temp.conten = `摄像头总数:${temp.data.total}个;运行中摄像头:${temp.data.alive}个;正常摄像头:${temp.data.normal}个;故障摄像头:${temp.data.error}个;室内摄像头:${temp.data.indoor}个;室外摄像头:${temp.data.outdoor}个;`
|
|
|
|
|
- this.tableData.push(temp)
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- // 封装获取监控画面列表方法
|
|
|
|
|
- async securityVideoList (data) {
|
|
|
|
|
- this.srcList = []
|
|
|
|
|
- const res = await securityVideoList(data)
|
|
|
|
|
- this.total = res.data.total
|
|
|
|
|
- this.tableData2 = res.data.records
|
|
|
|
|
- this.tableData2.forEach((v) => {
|
|
|
|
|
- this.srcList.push(this.baseURL + v.thumb)
|
|
|
|
|
- })
|
|
|
|
|
- // console.log(998, res)
|
|
|
|
|
|
|
+ checkTime (i) {
|
|
|
|
|
+ if (i < 10) {
|
|
|
|
|
+ i = '0' + i
|
|
|
|
|
+ }
|
|
|
|
|
+ return i
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created () {
|
|
|
|
|
- // 获取服务器前缀地址
|
|
|
|
|
- this.baseURL = axios.defaults.baseURL
|
|
|
|
|
- this.securityList(this.from)
|
|
|
|
|
- this.securityVideoList(this.from2)
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ created () {},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted () {},
|
|
mounted () {},
|
|
|
beforeCreate () {}, // 生命周期 - 创建之前
|
|
beforeCreate () {}, // 生命周期 - 创建之前
|
|
@@ -209,43 +213,49 @@ export default {
|
|
|
</script>
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
<style lang='less' scoped>
|
|
|
.tab3 {
|
|
.tab3 {
|
|
|
-
|
|
|
|
|
- /deep/.el-table__body-wrapper{
|
|
|
|
|
- max-height: 600px;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ .insideTop .add{
|
|
|
|
|
+ right: 55px;
|
|
|
}
|
|
}
|
|
|
- .search {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- font-size: 24px;
|
|
|
|
|
- margin-bottom: 30px;
|
|
|
|
|
- & > div {
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- margin-right: 40px;
|
|
|
|
|
- }
|
|
|
|
|
- .active {
|
|
|
|
|
- font-weight: 700;
|
|
|
|
|
- border-bottom: 5px solid #1482b4;
|
|
|
|
|
|
|
+ .conten {
|
|
|
|
|
+ padding: 15px 30px 0;
|
|
|
|
|
+ height: calc(100% - 32px);
|
|
|
|
|
+ .classify {
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ width: 40px;
|
|
|
padding-bottom: 10px;
|
|
padding-bottom: 10px;
|
|
|
|
|
+ color: #b9412e;
|
|
|
|
|
+ border-bottom: 2px solid #b9412e;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- .table {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- .add {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- top: -50px;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- .paging {
|
|
|
|
|
- width: auto;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- bottom: 40px;
|
|
|
|
|
- right: 50px;
|
|
|
|
|
- .zong{
|
|
|
|
|
- margin-right: 20px;
|
|
|
|
|
- margin-top: 4px;
|
|
|
|
|
|
|
+ .search {
|
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ margin-top: 12px;
|
|
|
|
|
+ height: 40px;
|
|
|
|
|
+ .search_k {
|
|
|
|
|
+ margin-left: 30px;
|
|
|
}
|
|
}
|
|
|
|
|
+ .search_btn {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ right: 22px;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .table {
|
|
|
|
|
+ max-width: 1533px;
|
|
|
}
|
|
}
|
|
|
|
|
+ /deep/.el-table__body-wrapper {
|
|
|
|
|
+ max-height: 485px;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .paging {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ bottom: 15px;
|
|
|
|
|
+ right: 50px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|