From c832bf2e80ac465e71b7a1c1f7a59d4252030989 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 05 Aug 2025 17:33:08 +0800
Subject: [PATCH] feat:事件工单滚动条
---
src/views/device/airport.vue | 119 ++++++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 85 insertions(+), 34 deletions(-)
diff --git a/src/views/device/airport.vue b/src/views/device/airport.vue
index 8b7203d..eb61ea9 100644
--- a/src/views/device/airport.vue
+++ b/src/views/device/airport.vue
@@ -1,5 +1,5 @@
<template>
- <basic-container>
+ <basic-main-content>
<avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" ref="crud" @row-del="rowDel"
v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
@search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
@@ -62,6 +62,10 @@
v-if="permission.rang_con && scope.row.domain == 3"
@click.stop="handleOpenRemoteDebugging(scope.row, scope.index)">远程调试
</el-button>
+
+ <el-button type="primary" text icon="el-icon-setting" v-if="permission.fly_device_offline"
+ @click.stop="handleDeviceOffline(scope.row)">设备下线
+ </el-button>
</template>
<!-- 添加行政区划显示模板 -->
<template #area_code="{ row }">
@@ -115,7 +119,8 @@
</template>
</el-dialog>
- <el-drawer title="机场授权管理" size="60%" append-to-body v-model="devicePerShareVisible" :direction="'rtl'">
+ <el-drawer class="ztzf-drawer-body-basic-container" title="机场授权管理" size="60%" append-to-body
+ v-model="devicePerShareVisible" :direction="'rtl'">
<DevicePerShare ref="devicePerShare" />
</el-drawer>
@@ -123,10 +128,12 @@
<DockControlPanel v-if="remoteDebuggingShow" :sn="curDeviceInfo.device_sn" :deviceInfo="curDeviceInfo">
</DockControlPanel>
</el-drawer>
- </basic-container>
+ </basic-main-content>
</template>
<script>
+import { ElMessage, ElMessageBox } from 'element-plus'
+
import {
getList,
remove,
@@ -137,6 +144,7 @@
ota,
getDeviceFirmwareList,
getDevices,
+ deviceOffline
} from '@/api/device/device'
import { deleteByOssId, addOrUpdate as addOrUpdateOssBind } from '@/api/device/ossBind'
import { getListPage as getOssList } from '@/api/resource/oss'
@@ -191,8 +199,7 @@
option: {
lazy: true,
tree: true,
- height: '460',
- calcHeight: 32,
+
dialogWidth: 1050,
tip: false,
searchShow: true,
@@ -205,6 +212,10 @@
addBtn: false,
dialogClickModal: false,
grid: false,
+
+ height: 'auto',
+ calcHeight: 180,
+
column: [
{
label: '设备型号',
@@ -349,10 +360,20 @@
},
{
label: '行政区划',
+ prop: 'area_name',
+ hide: true,
+ editDisplay: false, //编辑显示
+ viewDisplay: true, //查看显示
+ labelWidth: 130,
+ },
+ {
+ label: '行政区划',
prop: 'area_code',
type: 'cascader',
labelWidth: 130,
hide: true,
+ editDisplay: true,
+ viewDisplay: false,
props: {
label: 'title',
value: 'value',
@@ -369,18 +390,6 @@
trigger: 'change',
},
],
- change: ({ value }) => {
- if (!value) {
- this.form.area_code = null
- } else {
- if (typeof value === 'string' && value.includes(',')) {
- const codes = value.split(',')
- this.form.area_code = codes[codes.length - 1]
- } else {
- this.form.area_code = value
- }
- }
- },
lazy: true,
lazyLoad (node, resolve) {
let level = node.level
@@ -421,7 +430,7 @@
label: '保险有效期',
prop: 'duration_of_insurance',
labelWidth: 130,
- type: "daterange",
+ type: 'daterange',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
startPlaceholder: '保险开始日期',
@@ -456,12 +465,23 @@
},
{
label: '在线状态',
+ prop: 'cnstatus',
+ hide: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: true,
+ labelWidth: 130,
+ },
+ {
+ label: '在线状态',
prop: 'status',
addDisplay: false,
editDisplay: false,
+ viewDisplay: false,
labelWidth: 130,
slot: true,
width: 100,
+
rules: [
{
required: true,
@@ -472,12 +492,24 @@
},
{
label: '机场状态',
- prop: 'mode_code',
+ prop: 'cnmode_code',
+ hide: true,
addDisplay: false,
editDisplay: false,
+ viewDisplay: true,
+ labelWidth: 130,
+ },
+ {
+ label: '机场状态',
+ prop: 'mode_code',
+
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
labelWidth: 130,
slot: true,
width: 100,
+
rules: [
{
required: true,
@@ -507,10 +539,10 @@
...mapGetters(['permission']),
permissionList () {
return {
- addBtn: this.validData(this.permission.airport_add, true),
- viewBtn: this.validData(this.permission.airport_view, true),
- delBtn: this.validData(this.permission.airport_delete, true),
- editBtn: this.validData(this.permission.airport_edit, true),
+ addBtn: this.validData(this.permission.air_add, true),
+ viewBtn: this.validData(this.permission.air_view, true),
+ delBtn: this.validData(this.permission.air_delete, true),
+ editBtn: this.validData(this.permission.air_edit, true),
}
},
ids () {
@@ -609,6 +641,28 @@
this.remoteDebuggingShow = true
this.operateTitle = row.nickname + ' - ' + row.device_sn
},
+
+ // 设备下线
+ handleDeviceOffline (row) {
+ ElMessageBox.confirm('确定下线该设备吗?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning',
+ })
+ .then(() => {
+ deviceOffline(row.device_sn)
+ .then(res => {
+ ElMessage.success('下线成功')
+
+ this.init()
+ })
+ .catch(error => {
+ ElMessage.error('下线失败')
+ })
+ })
+ .catch(() => { })
+ },
+
// 打开存储对象配置页面
handleOpenOssSet (row) {
var that = this
@@ -985,7 +1039,7 @@
this.$refs.crud.toggleSelection()
})
},
- getFullAreaCode (areaCode) {
+ async getFullAreaCode (areaCode) {
if (!areaCode) return ''
const code = areaCode.toString()
@@ -1005,22 +1059,19 @@
},
beforeOpen (done, type) {
if (['edit', 'view'].includes(type)) {
- getDetail(this.form.id).then(res => {
+ getDetail(this.form.id).then(async res => {
const data = res.data.data
this.form = {
- duration_of_insurance: [data?.insure_start_time || '', data?.insure_expired_time || '']
+ ...data,
+ area_code: await this.getFullAreaCode(data.area_code),
+ area_name: this.form.area_name,
+ cnmode_code: this.getDockModeText(this.form.mode_code),
+ cnstatus: this.form.status === false ? '离线' : '在线',
+ duration_of_insurance: [data?.insure_start_time || '', data?.insure_expired_time || ''],
}
- // {
- // ...data,
- // area_code: this.getFullAreaCode(data.area_code),
- // }
-
- console.log(this.form, this.data, 11111111111111, res)
-
done()
-
})
}
},
--
Gitblit v1.9.3