|
@@ -17,42 +17,31 @@
|
|
|
<el-row class="m-top-15">
|
|
|
<el-table v-loading="listLoading" class="page-table" border fit :data="dataList">
|
|
|
<el-table-column type="index" label="序号" header-align="center" align="center" width="60" />
|
|
|
- <el-table-column prop="goafDevName" label="设备名称" />
|
|
|
- <el-table-column prop="goafDevIp" label="设备IP" />
|
|
|
- <el-table-column prop="goafDevLocation" label="安装地点" />
|
|
|
- <el-table-column prop="goafDevTypename" label="设备类型" />
|
|
|
- <el-table-column prop="goafDevGroupname" label="设备负责人部门" />
|
|
|
- <el-table-column prop="goafDevAccountName" label="设备责任人" />
|
|
|
- <el-table-column prop="goafInstallTime" label="安装时间" />
|
|
|
+ <el-table-column prop="transTimedifferenceThreshold" label=" 时间差阈值(分钟)" />
|
|
|
+ <el-table-column prop="transWeightdifferenceThreshold" label="重量差阈值(吨)" />
|
|
|
<el-table-column label="操作" header-align="center" align="center" width="170">
|
|
|
<template v-slot="{row}">
|
|
|
<el-button size="mini" type="primary" icon="el-icon-edit" @click="handleUpdate(row)">修改</el-button>
|
|
|
- <el-button size="mini" type="danger" icon="el-icon-edit" @click="handleDelete(row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div class="pagination-container" style="float:right;margin-right:40px;">
|
|
|
- <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
|
|
|
- </div>
|
|
|
</el-row>
|
|
|
- <hand-Model ref="Camera" @formSuccess="getData" />
|
|
|
+ <hand-Model ref="model" @formSuccess="getData" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { getCamera, delCamera } from '@/api/camera'
|
|
|
-import { Pagination } from '@/components'
|
|
|
+import { getThresholdList } from '@/api/threshold'
|
|
|
import { NumConvertLM } from '@/utils'
|
|
|
import handModel from './Model.vue'
|
|
|
export default {
|
|
|
- components: { Pagination, handModel },
|
|
|
+ components: { handModel },
|
|
|
data() {
|
|
|
return {
|
|
|
dataList: [],
|
|
|
total: 0,
|
|
|
listLoading: false,
|
|
|
conditions: {
|
|
|
- page: 1,
|
|
|
- limit: 10
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -64,54 +53,22 @@ export default {
|
|
|
NumConvertLM,
|
|
|
getData() {
|
|
|
this.listLoading = true
|
|
|
- getCamera(this.conditions).then((resp) => {
|
|
|
+ getThresholdList(this.conditions).then((resp) => {
|
|
|
this.listLoading = false
|
|
|
- const { code, msg, data } = resp
|
|
|
- if (code === 0) {
|
|
|
- const start = (this.conditions.page - 1) * this.conditions.limit
|
|
|
- const end = this.conditions.page * this.conditions.limit
|
|
|
- const dataList = data.filter((item) => item.goafDevTypename.includes('摄像头'))
|
|
|
- this.dataList = dataList.filter((item, index) => index >= start && index < end)
|
|
|
- this.total = dataList.length
|
|
|
- } else {
|
|
|
- this.$message.error(msg)
|
|
|
- }
|
|
|
+ const { data } = resp
|
|
|
+ this.dataList = data
|
|
|
}).catch((error) => {
|
|
|
console.log(error)
|
|
|
})
|
|
|
},
|
|
|
// "Add Risk" Model
|
|
|
handleAdd() {
|
|
|
- this.$refs['Camera'].showAddModel('摄像头')
|
|
|
+ this.$refs['model'].showAddModel('阈值')
|
|
|
},
|
|
|
|
|
|
// "Edit Risk" Model
|
|
|
handleUpdate(data) {
|
|
|
- this.$refs['Camera'].showEditModel(JSON.parse(JSON.stringify(data)))
|
|
|
- },
|
|
|
-
|
|
|
- // Delete Action
|
|
|
- handleDelete(data) {
|
|
|
- const { typeId, riskSource } = data
|
|
|
- this.$confirm(`此操作将删除该数据${riskSource}, 是否继续?`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- delCamera(typeId).then((resp) => {
|
|
|
- const { code, msg } = resp
|
|
|
- if (code === 0) {
|
|
|
- this.getData()
|
|
|
- this.$message.success(msg)
|
|
|
- } else {
|
|
|
- this.$message.error(msg)
|
|
|
- }
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error)
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- this.$message.info('已取消删除')
|
|
|
- })
|
|
|
+ this.$refs['model'].showEditModel(JSON.parse(JSON.stringify(data)))
|
|
|
}
|
|
|
}
|
|
|
}
|