|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-09-13 17:52:31
|
|
|
- * @LastEditTime: 2021-09-26 14:23:00
|
|
|
+ * @LastEditTime: 2021-11-18 19:37:02
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: \hyyfClient\src\views\BioSafety\CarAdmin.vue
|
|
@@ -36,6 +36,15 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</template>
|
|
|
+ <template v-slot:carNum="slotProps">
|
|
|
+ {{ slotProps.row.carNum? slotProps.row.carNum: '未识别' }}
|
|
|
+ </template>
|
|
|
+ <template v-slot:originalPicPath="slotProps">
|
|
|
+ <img :src="slotProps.row.originalPicPath" @click="clickImg(slotProps.row.originalPicPath)" alt="车辆通行" width="120"/>
|
|
|
+ </template>
|
|
|
+ <template v-slot:handler="slotProps">
|
|
|
+ <el-button size="mini" @click="clickEvent(slotProps.row)">黑名单</el-button>
|
|
|
+ </template>
|
|
|
</new-table>
|
|
|
<table-footer
|
|
|
:totals="total"
|
|
@@ -43,6 +52,16 @@
|
|
|
@sizeChange="sizeChange"
|
|
|
@pageChange="pageChange">
|
|
|
</table-footer>
|
|
|
+ <el-dialog
|
|
|
+ title="车辆图片"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="50%">
|
|
|
+ <img :src="imgUrl" alt="车辆通行" width="100%"/>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -55,6 +74,8 @@ import TableFooter from "../../components/TableFooter";
|
|
|
import { formItems, propFormData } from './carAdmin/queryCondition.config'
|
|
|
import { titles, tableItems, tableShows } from './carAdmin/table.config'
|
|
|
|
|
|
+import { getCarPassage, getCarWash } from '../../utils/chenApi'
|
|
|
+
|
|
|
export default {
|
|
|
name: "CarAdmin",
|
|
|
components: {
|
|
@@ -66,11 +87,11 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
btnNames: [ // 按钮情况
|
|
|
- { id: 1, name: '车辆档案' },
|
|
|
+ { id: 1, name: '车辆通行' },
|
|
|
{ id: 2, name: '车辆洗消' },
|
|
|
{ id: 3, name: '车辆烘干' }
|
|
|
],
|
|
|
- btnSelected: 1, // 选中的按钮
|
|
|
+ btnSelected: 2, // 选中的按钮
|
|
|
formItems: [], // 传给 QueryCondition 组件的 formItems
|
|
|
propFormData: {}, // 传给 QueryCondition 组件的 propFormData
|
|
|
title: '', // 传给 BioTable 组件的 title
|
|
@@ -81,7 +102,10 @@ export default {
|
|
|
total: 0,
|
|
|
size: 20,
|
|
|
pageNum: 1,
|
|
|
- selectId: ''
|
|
|
+ selectId: '',
|
|
|
+ params: {},
|
|
|
+ dialogVisible: false,
|
|
|
+ imgUrl: '' // 点击图片后放大的图片路径
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
@@ -90,6 +114,11 @@ export default {
|
|
|
this.title = titles[this.btnSelected - 1]
|
|
|
this.tableItems = tableItems[this.btnSelected - 1]
|
|
|
this.tableShows = tableShows
|
|
|
+ if (this.btnSelected === 1) {
|
|
|
+ this.carPassage()
|
|
|
+ } else if (this.btnSelected === 2) {
|
|
|
+ this.carWash()
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
getBtnSelected(id) {
|
|
@@ -98,20 +127,39 @@ export default {
|
|
|
this.propFormData = propFormData[id - 1]
|
|
|
this.title = titles[id - 1]
|
|
|
this.tableItems = tableItems[id - 1]
|
|
|
+ if (this.btnSelected === 1) {
|
|
|
+ this.carPassage()
|
|
|
+ } else if (this.btnSelected === 2) {
|
|
|
+ this.carWash()
|
|
|
+ }
|
|
|
},
|
|
|
// 获取查询条件
|
|
|
handleQuery(params) {
|
|
|
console.log(params)
|
|
|
+ this.params = params
|
|
|
+ if (this.btnSelected === 1) {
|
|
|
+ this.carPassage()
|
|
|
+ } else if (this.btnSelected === 2) {
|
|
|
+ this.carWash()
|
|
|
+ }
|
|
|
},
|
|
|
// 修改size
|
|
|
sizeChange(val) {
|
|
|
this.size = val;
|
|
|
- this.init();
|
|
|
+ if (this.btnSelected === 1) {
|
|
|
+ this.carPassage()
|
|
|
+ } else if (this.btnSelected === 2) {
|
|
|
+ this.carWash()
|
|
|
+ }
|
|
|
},
|
|
|
// 修改页数
|
|
|
pageChange(val) {
|
|
|
this.pageNum= val;
|
|
|
- this.init();
|
|
|
+ if (this.btnSelected === 1) {
|
|
|
+ this.carPassage()
|
|
|
+ } else if (this.btnSelected === 2) {
|
|
|
+ this.carWash()
|
|
|
+ }
|
|
|
},
|
|
|
init() {
|
|
|
let params = {
|
|
@@ -121,6 +169,51 @@ export default {
|
|
|
}
|
|
|
console.log(params)
|
|
|
// 获取后端数据
|
|
|
+ },
|
|
|
+ // 车辆通行 查询
|
|
|
+ carPassage() {
|
|
|
+ let queryParams = {
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ pageSize: this.size,
|
|
|
+ carNum: this.params.name || undefined
|
|
|
+ }
|
|
|
+ getCarPassage(queryParams).then(res => {
|
|
|
+ console.log('res:', JSON.parse(res.result))
|
|
|
+ const result = JSON.parse(res.result)
|
|
|
+ this.listData = result.data.pageData
|
|
|
+ this.listData.forEach(item => {
|
|
|
+ item.originalPicPath = `https://36.26.62.70:447/evo-apigw/${item.originalPicPath}`
|
|
|
+ item.devChnName = item.devChnName.split('_')[0]
|
|
|
+ })
|
|
|
+ this.total = parseInt(result.data.totalRows)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 点击图片放大
|
|
|
+ clickImg(url) {
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.imgUrl = url
|
|
|
+ },
|
|
|
+ // 车辆洗消
|
|
|
+ carWash() {
|
|
|
+ let queryParams = {
|
|
|
+ pageNum: this.pageNum,
|
|
|
+ pageSize: this.size,
|
|
|
+ alarmStartDateString: this.params.time[0] + ' 00:00:00',
|
|
|
+ alarmEndDateString: this.params.time[1] + ' 23:59:59',
|
|
|
+ nodeCodeList: ["1002871$1$0$0", "1002872$1$0$0", "1002873$1$0$0"],
|
|
|
+ deviceCategory: 1,
|
|
|
+ alarmType: 303,
|
|
|
+ dbType: 0
|
|
|
+ }
|
|
|
+ getCarWash(queryParams).then(res => {
|
|
|
+ console.log('res:', JSON.parse(res.result))
|
|
|
+ const result = JSON.parse(res.result)
|
|
|
+ this.listData = result.data.pageData
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 车辆洗消 - 按钮
|
|
|
+ clickEvent(row) {
|
|
|
+ console.log(row)
|
|
|
}
|
|
|
},
|
|
|
}
|