From 0f16db42e4e331bfaf084c27ca602c275e87668d Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 28 Oct 2025 18:07:42 +0800
Subject: [PATCH] feat:渲染数据
---
src/views/device/airport.vue | 542 +++++++++++++++++++++++++++++------------------------
1 files changed, 295 insertions(+), 247 deletions(-)
diff --git a/src/views/device/airport.vue b/src/views/device/airport.vue
index 8411b2e..adfc18d 100644
--- a/src/views/device/airport.vue
+++ b/src/views/device/airport.vue
@@ -10,7 +10,8 @@
</el-button>
</template>
<template #dept_name="{ row }">
- <el-tag>{{ row.dept_name }}</el-tag>
+ <el-tag v-if="row.dept_name">{{ row.dept_name }}</el-tag>
+ <span v-else>/</span>
</template>
<template #status="{ row }">
<div v-if="row.status == true" class="onlineStatus">
@@ -51,52 +52,59 @@
</span>
</template>
<template #mode_code="{ row }">
- <span class="text" v-if="row.domain == 3 || row.domain == 0" :style="row.mode_code != '-1' ? 'color: #00ee8b' : 'color: #de5e5e'">
+ <span class="text" v-if="row.domain == 3 || row.domain == 0"
+ :style="row.mode_code != '-1' ? 'color: #00ee8b' : 'color: #de5e5e'">
{{ getModelText(row.mode_code) }}
</span>
</template>
<template #menu="scope">
<el-dropdown>
- <el-button type="primary" text icon="el-icon-folder-opened" v-if="permission.oss_set">更 多</el-button>
- <template #dropdown v-if="scope.row.domain == 3">
- <el-dropdown-menu teleported>
- <el-dropdown-item command="a">
- <el-button type="primary" text icon="el-icon-paperclip" v-if="permission.oss_set" @click.stop="handleOpenOssSet(scope.row, scope.index)">存储配置</el-button>
- </el-dropdown-item>
- <el-dropdown-item command="b">
- <el-button type="primary" text icon="el-icon-share" v-if="permission.per_share && scope.row.domain == 3"
- @click.stop="handleOpenDevicePerShare(scope.row, scope.index)">机场授权</el-button>
- </el-dropdown-item>
- <el-dropdown-item command="c"> <el-button type="primary" text icon="el-icon-position" :disabled="!scope.row.status"
- v-if="permission.rang_con && scope.row.domain == 3"
- @click.stop="handleOpenRemoteDebugging(scope.row, scope.index)">远程调试</el-button>
- </el-dropdown-item>
- <el-dropdown-item command="d"><el-button type="primary" text icon="el-icon-collection" v-if="permission.fly_device_offline"
- @click.stop="rollFirmware(scope.row)">固件版本管理</el-button>
- </el-dropdown-item>
- <el-dropdown-item command="d">
- <el-button type="primary" text icon="el-icon-collection" v-if="!scope.row.status" @click.stop="dockNotLine(scope.row)">
- {{ scope.row.hidden_flag == 1 ? '设备上线' : '设备下线'}}
- </el-button>
- </el-dropdown-item>
- <el-dropdown-item command="e"><el-button type="primary" text icon="el-icon-document-delete" v-if="permission.fly_device_offline"
- @click.stop="handleDeviceOffline(scope.row)">注销</el-button>
- </el-dropdown-item>
- </el-dropdown-menu>
- </template>
- <template #dropdown v-else>
- <el-dropdown-menu teleported>
- <el-dropdown-item command="a">
+ <el-button type="primary" text v-if="permission.oss_set"><el-icon>
+ <MoreFilled />
+ </el-icon>更多</el-button>
+ <template #dropdown v-if="scope.row.domain == 3">
+ <el-dropdown-menu teleported>
+ <el-dropdown-item command="a">
+ <el-button type="primary" text icon="el-icon-paperclip" v-if="permission.oss_set"
+ @click.stop="handleOpenOssSet(scope.row, scope.index)">存储配置</el-button>
+ </el-dropdown-item>
+ <el-dropdown-item command="b">
+ <el-button type="primary" text icon="el-icon-share" v-if="permission.per_share && scope.row.domain == 3"
+ @click.stop="handleOpenDevicePerShare(scope.row, scope.index)">机场授权</el-button>
+ </el-dropdown-item>
+ <el-dropdown-item command="c"> <el-button type="primary" text icon="el-icon-position"
+ :disabled="!scope.row.status" v-if="permission.rang_con && scope.row.domain == 3"
+ @click.stop="handleOpenRemoteDebugging(scope.row, scope.index)">远程调试</el-button>
+ </el-dropdown-item>
+ <el-dropdown-item command="d"><el-button type="primary" text icon="el-icon-collection"
+ v-if="permission.fly_device_offline" @click.stop="rollFirmware(scope.row)">固件版本管理</el-button>
+ </el-dropdown-item>
+ <el-dropdown-item command="d" v-if="!scope.row.status">
+ <el-button type="primary" text icon="el-icon-collection" @click.stop="dockNotLine(scope.row)">
+ {{ scope.row.hidden_flag === 1 ? '设备上线' : '设备下线' }}
+ </el-button>
+ </el-dropdown-item>
+ <el-dropdown-item command="e"><el-button type="primary" text icon="el-icon-document-delete"
+ v-if="permission.fly_device_offline" @click.stop="handleDeviceOffline(scope.row)">注销</el-button>
+ </el-dropdown-item>
+ </el-dropdown-menu>
+ </template>
+ <template #dropdown v-else>
+ <el-dropdown-menu teleported>
+ <!-- <el-dropdown-item command="a">
<el-button type="primary" text icon="el-icon-circle-close" @click.stop="rowDel(scope.row, scope.index)">删除</el-button>
- </el-dropdown-item>
- <el-dropdown-item command="a">
+ </el-dropdown-item> -->
+ <!-- <el-dropdown-item command="a">
<el-button type="primary" text icon="el-icon-key" v-if="permission.operate_password_set" @click.stop="handleOperatePassword(scope.row, scope.index)">操控密码设置</el-button>
- </el-dropdown-item>
- </el-dropdown-menu>
- </template>
- </el-dropdown>
+ </el-dropdown-item> -->
+ <el-dropdown-item command="d"><el-button type="primary" text icon="el-icon-collection"
+ @click.stop="rollFirmware(scope.row)">固件版本管理</el-button>
+ </el-dropdown-item>
+ </el-dropdown-menu>
+ </template>
+ </el-dropdown>
</template>
-
+
<!-- 添加行政区划显示模板 -->
<template #area_code="{ row }">
<span>{{ row.area_name }}</span>
@@ -122,6 +130,22 @@
<el-dialog title="操控密码查看" append-to-body v-model="operatePasswordViewBox" width="455px">
<el-input v-model="operate_password" disabled></el-input>
+ </el-dialog>
+
+ <el-dialog title="注销" class="ztzf-dialog-mange zx-cancel" append-to-body v-model="cancenOperate" width="560px">
+ <div class="txt-contain">
+ <img :src="warnSvg" />注销
+ <span class="name">
+ {{ cancelSNName }}
+ </span> 设备可能会影响相关数据,确认注销吗?
+ </div>
+ <div class="delete-txt">*删除相关图片、视频、事件</div>
+ <template #footer>
+ <span class="dialog-footer">
+ <el-button @click="cancenOperate = false">取 消</el-button>
+ <el-button type="primary" @click="cancenOperateDo">确 定</el-button>
+ </span>
+ </template>
</el-dialog>
<el-dialog title="固件升级" append-to-body v-model="firmwareBox" width="455px">
@@ -170,7 +194,7 @@
</template>
</el-dialog>
- <el-drawer class="ztzf-drawer-body-basic-container" title="机场授权管理" size="60%" append-to-body
+ <el-drawer class="ztzf-drawer-body-basic-container ztzf-el-card__body" title="机场授权管理" size="60%" append-to-body
v-model="devicePerShareVisible" :direction="'rtl'">
<DevicePerShare ref="devicePerShare" />
</el-drawer>
@@ -184,6 +208,7 @@
<script>
import { ElMessage, ElMessageBox } from 'element-plus'
+import { getRegionTreeAll } from '@/api/job/task'
import { pxToRem } from '@/utils/rem'
import {
getList,
@@ -196,7 +221,8 @@
getDeviceFirmwareList,
getDevices,
deviceOffline,
- devicesUpdate
+ devicesUpdate,
+ devicesUpAndDown
} from '@/api/device/device'
import { deleteByOssId, addOrUpdate as addOrUpdateOssBind } from '@/api/device/ossBind'
import { getListPage as getOssList } from '@/api/resource/oss'
@@ -208,6 +234,8 @@
import DockControlPanel from './components/DockControlPanel.vue'
import { getWebsocketUrl } from '@/utils/websocket/config';
import ConnectWebSocket from '@/utils/websocket';
+import warnSvg from '@/assets/images/warn.svg'
+
export default {
components: {
FirmwareManage,
@@ -215,6 +243,8 @@
DockControlPanel,
},
data () {
+ // const self = this
+
const validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入密码'))
@@ -232,10 +262,16 @@
}
}
return {
+ treeResolveMap: new Map(),
rules: {
password: [{ required: true, validator: validatePass, trigger: 'blur' }],
password2: [{ required: true, validator: validatePass2, trigger: 'blur' }],
},
+ warnSvg: warnSvg,
+ cancelSNName: '',
+ cancenOperate: false,
+ cancenOperateRow: {},
+ deleteFlag: false,
passwordForm: {
id: '',
password: '',
@@ -284,7 +320,10 @@
searchGutter: 30,
tip: false,
searchShow: true,
- searchMenuSpan: 6,
+ // searchMenuSpan: 16,
+ searchMenuPosition: 'left',
+ searchMenuSpan: 4,
+
border: true,
index: true,
indexLabel: '序号',
@@ -298,7 +337,7 @@
grid: false,
height: 'auto',
- calcHeight: 180,
+ calcHeight: 20,
column: [
{
@@ -310,7 +349,7 @@
search: false,
slot: true,
searchSpan: 4,
- labelWidth: 130,
+ labelWidth: 145,
width: 120,
// formatter: (row) => row.domain == 3 ? '机巢' : '无人机'
// rules: [
@@ -327,7 +366,7 @@
// editDisabled: true,
editDisplay: false, //编辑显示
viewDisplay: true, //查看显示
- labelWidth: 130,
+ labelWidth: 145,
width: 120,
hide: true
},
@@ -339,46 +378,20 @@
viewDisplay: true, //查看显示
search: false,
searchSpan: 4,
- labelWidth: 130,
+ labelWidth: 145,
width: 120,
- // rules: [
- // {
- // required: true,
- // message: '请输入设备型号',
- // trigger: 'blur',
- // },
- // ],
},
{
label: '设备SN',
prop: 'device_sn',
- labelWidth: 130,
+ labelWidth: 145,
width: 120,
overHidden: true,
searchSpan: 4,
// editDisabled: true,
editDisplay: false, //编辑显示
- // rules: [
- // {
- // required: true,
- // message: '请输入设备SN',
- // trigger: 'blur',
- // },
- // ],
},
- // {
- // label: '机巢编号',
- // prop: 'machine_nest_sn',
- // labelWidth: 130,
- // editDisabled: true,
- // rules: [
- // {
- // required: false,
- // message: '请输入机巢编号',
- // trigger: 'blur',
- // },
- // ],
- // },
+
{
label: '设备位置',// '行政区划',
prop: 'area_name',
@@ -386,29 +399,29 @@
overHidden: true,
editDisplay: false, //编辑显示
viewDisplay: false, //查看显示
- labelWidth: 130,
+ labelWidth: 145,
width: 200,
},
{
label: '设备位置',
prop: 'area_code',
- type: 'cascader',
- labelWidth: 130,
+ // type: 'cascader',
+ type: 'tree',
+ labelWidth: 145,
searchSpan: 4,
hide: true,
search: true,
// overHidden: true,
editDisplay: true,
viewDisplay: true,
+ checkStrictly: true,
+ defaultExpandAll: true,
+ dicData: [],
props: {
- label: 'title',
- value: 'value',
- emitPath: false,
- checkStrictly: true,
- multiple: false,
- expandTrigger: 'hover',
+ label: 'name',
+ value: 'id',
+ children: 'childrens',
},
- dataType: 'string',
rules: [
{
required: true,
@@ -416,44 +429,11 @@
trigger: 'change',
},
],
- lazy: true,
- lazyLoad (node, resolve) {
- let level = node.level
- let list = []
- let callback = () => {
- resolve(
- (list || []).map(ele => ({
- ...ele,
- value: ele.value,
- leaf: level >= 2,
- }))
- )
- }
-
- if (level === 0) {
- getLazyTree('000000000000').then(res => {
- list = res.data.data
- callback()
- })
- } else if (level === 1) {
- getLazyTree(node.value).then(res => {
- list = res.data.data
- callback()
- })
- } else if (level === 2) {
- getLazyTree(node.value).then(res => {
- list = res.data.data
- callback()
- })
- } else {
- callback()
- }
- },
},
{
label: '设备名称',
prop: 'nickname',
- labelWidth: 130,
+ labelWidth: 145,
width: 160,
searchSpan: 4,
search: true,
@@ -467,61 +447,60 @@
},
],
},
-
- // {
- // label: '设备位置',
- // prop: 'address',
- // labelWidth: 130,
- // width: 100,
- // overHidden: true,
- // rules: [
- // {
- // required: true,
- // message: '请输入设备位置',
- // trigger: 'blur',
- // },
- // ],
- // },
+ {
+ label: '4G增强',
+ prop: 'link_workmode',
+ labelWidth: 145,
+ width: 160,
+ overHidden: true,
+ editDisplay: false, //编辑显示
+ viewDisplay: false,
+ align: 'center',
+ formatter: (row, column, cellValue) => {
+ const statusMap = {
+ 0: '关',
+ 1: '开',
+ }
+ return statusMap[cellValue] || '/'
+ }
+ },
{
label: '负载设备',
prop: 'payload_str',
- labelWidth: 130,
+ labelWidth: 145,
width: 160,
overHidden: true,
editDisplay: false, //编辑显示
- // editDisabled: true,
- // rules: [
- // {
- // required: true,
- // message: '请输入负载设备',
- // trigger: 'blur',
- // },
- // ],
+
},
{
// hide: true,
label: '保险有效期',
prop: 'duration_of_insurance',
- labelWidth: 130,
+ labelWidth: 145,
width: 200,
type: 'daterange',
format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
+ valueFormat: 'YYYY-MM-DD',
startPlaceholder: '保险开始日期',
endPlaceholder: '保险结束日期',
+ align: 'center',
rules: [
{
- required: true,
+ required: false,
message: '请选择保险有效期',
trigger: 'blur',
},
],
+ formatter: (row, value) => {
+ return value[0] ? `${this.$dayjs(value[0]).format('YYYY-MM-DD')}~${this.$dayjs(value[1]).format('YYYY-MM-DD')}` : '/'
+ },
},
// {
// label: '保险有效期',
// prop: 'insureExpiredTime',
- // labelWidth: 130,
+ // labelWidth: 145,
// width: 110,
// rules: [
// {
@@ -532,10 +511,10 @@
// ],
// },
{
- label: '流量剩余',
+ label: '流量剩余(GB)',
prop: 'traffic_remaining',
- labelWidth: 130,
- width: 100,
+ labelWidth: 145,
+ width: 120,
// editDisabled: true,
editDisplay: false, //编辑显示
// rules: [
@@ -549,81 +528,58 @@
{
label: '流量到期时间',
prop: 'traffic_expire_time',
- labelWidth: 130,
+ labelWidth: 145,
width: 120,
type: 'date',
format: 'YYYY-MM-DD',
editDisplay: false, //编辑显示
- // editDisabled: true,
- // rules: [
- // {
- // required: true,
- // message: '请输入流量到期时间',
- // trigger: 'blur',
- // },
- // ],
},
{
label: '固件版本',
prop: 'firmware_version',
- labelWidth: 130,
+ labelWidth: 145,
width: 110,
editDisplay: false, //编辑显示
- // editDisabled: true,
- // rules: [
- // {
- // required: true,
- // message: '请输入固件版本',
- // trigger: 'blur',
- // },
- // ],
},
{
label: '固件升级',
prop: 'firmware_status',
- labelWidth: 130,
+ labelWidth: 145,
width: 100,
hide: true,
viewDisabled: true,
addDisabled: true,
editDisplay: false, //编辑显示
- // editDisabled: true,
addDisplay: false,
- editDisplay: false,
viewDisplay: false,
- // rules: [
- // {
- // required: true,
- // message: '请输入固件升级',
- // trigger: 'blur',
- // },
- // ],
},
{
- label: '所属单位',
+ label: '所属部门',
prop: 'dept_name',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
- labelWidth: 130,
+ align: 'center',
+ labelWidth: 145,
width: 180,
rules: [
{
required: true,
- message: '请输入所属单位',
+ message: '请输入所属部门',
trigger: 'blur',
},
],
},
{
- label: '所属单位',
+ label: '所属部门',
prop: 'dept_id',
hide: true,
type: 'tree',
- defaultExpandAll: true,
+
search: true,
searchSpan: 4,
- labelWidth: 130,
+ labelWidth: 145,
+ defaultExpandAll: true,
dicUrl: '/blade-system/dept/getTree',
props: {
label: 'name',
@@ -632,7 +588,7 @@
rules: [
{
required: true,
- message: '请输入所属单位',
+ message: '请输入所属部门',
trigger: 'blur',
},
],
@@ -643,7 +599,7 @@
// addDisplay: false,
// editDisplay: false,
// type: 'date',
- // labelWidth: 130,
+ // labelWidth: 145,
// width: 160,
// format: 'YYYY-MM-DD HH:mm:ss',
// // valueFormat: 'YYYY-MM-DD HH:mm:ss',
@@ -657,7 +613,7 @@
// },
-
+
{
label: '在线时间',
@@ -666,9 +622,9 @@
type: 'date',
editDisplay: false, //编辑显示
// editDisabled: true,
- viewDisplay: true, //查看显示
+ viewDisplay: false, //查看显示
addDisplay: true,
- labelWidth: 130,
+ labelWidth: 145,
width: 160,
overHidden: true,
format: 'YYYY-MM-DD HH:mm:ss',
@@ -683,16 +639,26 @@
// ],
},
{
+ label: '设备最新在线时间',
+ hide: true,
+ prop: 'login_time',
+ type: 'date',
+ viewDisplay: true, //查看显示
+ labelWidth: 145,
+ overHidden: true,
+ format: 'YYYY-MM-DD HH:mm:ss',
+ },
+ {
label: '注册时间',
prop: 'create_time',
type: 'date',
hide: true,
editDisplay: false, //编辑显示
// editDisabled: true,
- viewDisplay: true, //查看显示
+ viewDisplay: false, //查看显示
addDisplay: true,
overHidden: true,
- labelWidth: 130,
+ labelWidth: 145,
width: 160,
format: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
@@ -706,13 +672,24 @@
// ],
},
{
+ label: '设备注册时间',
+ prop: 'create_time',
+ type: 'date',
+ hide: true,
+ viewDisplay: true, //查看显示
+ overHidden: true,
+ labelWidth: 145,
+ width: 160,
+ format: 'YYYY-MM-DD HH:mm:ss',
+ },
+ {
label: '设备状态',
prop: 'cnstatus',
hide: true,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
- labelWidth: 130,
+ labelWidth: 145,
},
{
label: '设备状态',
@@ -742,7 +719,7 @@
addDisplay: false,
editDisplay: false,
viewDisplay: true,
- labelWidth: 130,
+ labelWidth: 145,
width: 110,
},
{
@@ -751,7 +728,7 @@
addDisplay: false,
editDisplay: false,
viewDisplay: false,
- labelWidth: 130,
+ labelWidth: 145,
searchSpan: 4,
search: true,
type: 'select',
@@ -790,8 +767,9 @@
},
}
},
+
computed: {
- ...mapGetters(['permission']),
+ ...mapGetters(['permission', 'userInfo']),
permissionList () {
return {
addBtn: this.validData(this.permission.air_add, true),
@@ -809,6 +787,7 @@
},
},
destroyed () {
+ this.treeResolveMap.clear()
this.websocketMap.forEach((k, v) => {
if (null != v) {
v.close()
@@ -817,8 +796,11 @@
}
})
},
- mounted() {
-
+ mounted () {
+ getRegionTreeAll({ parentCode: this.userInfo.detail.areaCode }).then(res => {
+ const column = this.findObject(this.option.column, 'area_code')
+ column.dicData = res.data.data ? [res.data.data] : []
+ })
},
methods: {
getDockModeText (value) {
@@ -828,11 +810,11 @@
let txt = '离线'
if (value === 0 || value === 4) {
txt = '在线'
- } else if(value === 1) {
+ } else if (value === 1) {
txt = '现场调试'
- } else if(value === 2) {
+ } else if (value === 2) {
txt = '远程调试'
- } else if(value === 3) {
+ } else if (value === 3) {
txt = '固件升级中'
}
return txt
@@ -913,25 +895,24 @@
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.cancenOperate = true
+ this.cancelSNName = row.nickname
+ this.cancenOperateRow = row
- this.init()
- })
- .catch(error => {
- ElMessage.error('注销失败')
- })
- })
- .catch(() => { })
+ },
+
+ cancenOperateDo () {
+ this.cancenOperate = false
+ this.deleteFlag = false
+ deviceOffline(this.cancenOperateRow.device_sn, true).then(res => {
+ ElMessage.success('注销成功')
+
+ this.init()
+ }).catch(error => {
+ ElMessage.error('注销失败')
+ })
},
// 打开存储对象配置页面
@@ -959,18 +940,18 @@
})
},
// 设备下线
- dockNotLine(row) {
- let txt = row.hidden_flag === 1?'上线':'下线'
+ dockNotLine (row) {
+ let txt = row.hidden_flag === 1 ? '上线' : '下线'
ElMessageBox.confirm(`确定${txt}该设备吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
- let hidden_flag = row.hidden_flag === 1?0:1
- devicesUpdate({id:row.id, hidden_flag:hidden_flag})
+ let hidden_flag = row.hidden_flag === 1 ? 0 : 1
+ devicesUpAndDown({ id: row.id, hidden_flag: hidden_flag })
.then(res => {
- ElMessage.success('下线成功')
+ ElMessage.success(`${txt}成功`)
this.init()
})
.catch(error => {
@@ -1254,8 +1235,10 @@
const submitData = {
...row,
area_code: row.area_code.split(',').pop(),
- insure_start_time: row.duration_of_insurance[0],
- insure_expired_time: row.duration_of_insurance[1],
+ insure_start_time: row.duration_of_insurance[0] || null,
+ insure_expired_time: row.duration_of_insurance[1] || null,
+ deptId: row.dept_id,
+ areaCode: row.area_code.split(',').pop(),
}
if (submitData.traffic_expire_time === '') {
delete submitData.traffic_expire_time
@@ -1264,7 +1247,25 @@
update(submitData).then(
() => {
- this.onLoad(this.page)
+ if (row.domain === 0) {
+ // 获取保存的 resolve 函数
+ const resolve = this.treeResolveMap.get(row.device_sn)
+ if (resolve) {
+ // 重新加载子节点数据
+ var params = {
+ childSn: row.device_sn,
+ }
+ getList(1, 10, params).then(res => {
+ const data = res.data.data.records
+ data.forEach(e => {
+ e.duration_of_insurance = [e.insure_start_time || '', e.insure_expired_time || '']
+ })
+ resolve(data)
+ })
+ }
+ } else {
+ this.onLoad(this.page)
+ }
this.$message({
type: 'success',
message: '操作成功!',
@@ -1334,6 +1335,7 @@
})
},
async getFullAreaCode (areaCode) {
+ console.log('getFullAreaCode', areaCode)
if (!areaCode) return ''
const code = areaCode.toString()
@@ -1355,13 +1357,11 @@
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(async res => {
const data = res.data.data
-
this.form = {
...data,
- area_code: await this.getFullAreaCode(data.area_code),
+ // area_code: await this.getFullAreaCode(data.area_code),
area_name: this.form.area_name,
cnmode_code: this.getDockModeText(this.form.mode_code),
- // domain: data.domain === 0 ? '无人机' : data.domain === 3 ? '机巢' : '未知',
domainTxt: data.domain === 0 ? '无人机' : data.domain === 3 ? '机巢' : '未知',
cnstatus: this.form.status === false ? '离线' : '在线',
duration_of_insurance: [data?.insure_start_time || '', data?.insure_expired_time || ''],
@@ -1397,7 +1397,7 @@
}
values['type'] = 1
if (values.area_code) {
- values['area_code'] = values.area_code.split(',').pop()
+ values['area_code'] = values.area_code.split(',').pop()
}
this.loading = true
getList(page.currentPage, page.pageSize, values).then(res => {
@@ -1416,31 +1416,36 @@
})
},
treeLoad (tree, treeNode, resolve) {
+ // 保存resolve
+ this.treeResolveMap.set(tree.child_sn, resolve)
var params = {
childSn: tree.child_sn,
}
getList(1, 10, params).then(res => {
const data = res.data.data.records
+ data.forEach(e => {
+ e.duration_of_insurance = [e.insure_start_time || '', e.insure_expired_time || '']
+ })
resolve(data)
})
},
- rowDel (row) {
- this.$confirm('确定将选择数据删除?', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- return remove(row.id)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: 'success',
- message: '操作成功!',
- })
- })
- },
+ // rowDel (row) {
+ // this.$confirm('确定将选择数据删除?', {
+ // confirmButtonText: '确定',
+ // cancelButtonText: '取消',
+ // type: 'warning',
+ // })
+ // .then(() => {
+ // return remove(row.id)
+ // })
+ // .then(() => {
+ // this.onLoad(this.page)
+ // this.$message({
+ // type: 'success',
+ // message: '操作成功!',
+ // })
+ // })
+ // },
// 设置无人机操作密码
setOperatePasswordConfirm () {
var that = this
@@ -1498,8 +1503,10 @@
display: flex;
flex-direction: column;
align-items: center;
- .el-tag:first-child{
- margin-bottom: 5px;}
+
+ .el-tag:first-child {
+ margin-bottom: 5px;
+ }
}
.onlineStatus {
@@ -1540,12 +1547,15 @@
border-color: #409eff;
}
}
+
:deep(.avue-crud__menu) {
display: flex;
}
+
.more-container {
position: relative;
}
+
.show-more-do {
position: absolute;
background-color: #ffffff;
@@ -1559,5 +1569,43 @@
right: 0;
}
+:deep(.avue-crud__pagination) {
+ position: fixed;
+ bottom: 10px;
+ right: 30px;
+}
+
+.force-center-dialog .el-dialog {
+
+}
+.zx-cancel {
+ .txt-contain {
+ display: flex;
+ justify-content: center;
+ margin-bottom: 20px;
+ font-family: Source Han Sans CN, Source Han Sans CN;
+ font-weight: 400;
+ font-size: 14px;
+ img {
+ width: 20px;
+ height: 20px;
+ }
+ .name {
+ color: #0E8BFF;
+ margin-left: 6px;
+ margin-right: 6px;
+ }
+
+ }
+ .delete-txt {
+ font-family: Source Han Sans CN, Source Han Sans CN;
+ font-weight: 400;
+ display: flex;
+ justify-content: center;
+ color: #FF0000;
+ font-size: 12px;
+ margin-bottom: 20px;
+ }
+}
</style>
--
Gitblit v1.9.3