| | |
| | | <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> |
| | |
| | | ota, |
| | | getDeviceFirmwareList, |
| | | getDevices, |
| | | deviceOffline |
| | | deviceOffline, |
| | | devicesUpdate |
| | | } from '@/api/device/device' |
| | | import { deleteByOssId, addOrUpdate as addOrUpdateOssBind } from '@/api/device/ossBind' |
| | | import { getListPage as getOssList } from '@/api/resource/oss' |
| | |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | indexLabel: '序号', |
| | | viewBtn: true, |
| | | delBtn: false, |
| | | selection: true, |
| | |
| | | { |
| | | label: '设备类型', |
| | | prop: 'domain', |
| | | editDisabled: true, |
| | | editDisabled: false, |
| | | editDisplay: false, //编辑显示 |
| | | viewDisplay: true, //查看显示 |
| | | viewDisplay: false, //查看显示 |
| | | search: false, |
| | | slot: true, |
| | | searchSpan: 4, |
| | | labelWidth: 130, |
| | | width: 120, |
| | | // formatter: (row) => row.domain == 3 ? '机巢' : '无人机' |
| | | // rules: [ |
| | | // { |
| | | // required: true, |
| | |
| | | // trigger: 'blur', |
| | | // }, |
| | | // ], |
| | | }, |
| | | { |
| | | label: '设备类型', |
| | | prop: 'domainTxt', |
| | | editDisabled: true, |
| | | editDisplay: false, //编辑显示 |
| | | viewDisplay: true, //查看显示 |
| | | labelWidth: 130, |
| | | width: 120, |
| | | hide: true |
| | | }, |
| | | { |
| | | label: '设备型号', |
| | |
| | | label: '设备名称', |
| | | prop: 'nickname', |
| | | labelWidth: 130, |
| | | width: 100, |
| | | width: 160, |
| | | searchSpan: 4, |
| | | search: true, |
| | | overHidden: true, |
| | |
| | | editDisplay: false, //编辑显示 |
| | | viewDisplay: false, //查看显示 |
| | | labelWidth: 130, |
| | | width: 100, |
| | | width: 200, |
| | | }, |
| | | { |
| | | label: '设备位置', |
| | |
| | | // }, |
| | | // ], |
| | | // }, |
| | | |
| | | |
| | | { |
| | | label: '负载设备', |
| | | prop: 'payload_str', |
| | | labelWidth: 130, |
| | | width: 100, |
| | | width: 160, |
| | | overHidden: true, |
| | | editDisabled: true, |
| | | // rules: [ |
| | |
| | | // }, |
| | | // ], |
| | | // }, |
| | | |
| | | |
| | | |
| | | { |
| | | hide: true, |
| | | // hide: true, |
| | | label: '保险有效期', |
| | | prop: 'duration_of_insurance', |
| | | labelWidth: 130, |
| | | width: 160, |
| | | type: 'daterange', |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | |
| | | that.$refs.firmwareManage.init(row) |
| | | }) |
| | | }, |
| | | // 设备下线 |
| | | 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}) |
| | | .then(res => { |
| | | ElMessage.success('下线成功') |
| | | this.init() |
| | | }) |
| | | .catch(error => { |
| | | ElMessage.error('下线失败') |
| | | }) |
| | | }) |
| | | .catch(() => { }) |
| | | }, |
| | | // 版本回退点击事件 |
| | | rollFirmware (row) { |
| | | if (row.status == 0) { |
| | |
| | | insure_start_time: row.duration_of_insurance[0], |
| | | insure_expired_time: row.duration_of_insurance[1], |
| | | } |
| | | |
| | | if (submitData.traffic_expire_time === '') { |
| | | delete submitData.traffic_expire_time |
| | | } |
| | | delete submitData.duration_of_insurance |
| | | |
| | | update(submitData).then( |
| | |
| | | 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 ? '机巢' : '未知', |
| | | // 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 || ''], |
| | | } |
| | |
| | | if (e.firmware_status == 4) { |
| | | this.connectWebSocket(e) |
| | | } |
| | | e.duration_of_insurance = [e.insure_start_time || '', e.insure_expired_time || ''] |
| | | }) |
| | | this.data = data.records |
| | | this.loading = false |