| | |
| | | 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 }"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | |
| | | import { |
| | | getList, |
| | | remove, |
| | |
| | | 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' |
| | |
| | | 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 |
| | |
| | | label: '保险有效期', |
| | | prop: 'duration_of_insurance', |
| | | labelWidth: 130, |
| | | type: "daterange", |
| | | type: 'daterange', |
| | | format: 'YYYY-MM-DD', |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | startPlaceholder: '保险开始日期', |
| | |
| | | }, |
| | | { |
| | | 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, |
| | |
| | | }, |
| | | { |
| | | 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, |
| | |
| | | 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 |
| | |
| | | this.$refs.crud.toggleSelection() |
| | | }) |
| | | }, |
| | | getFullAreaCode (areaCode) { |
| | | async getFullAreaCode (areaCode) { |
| | | if (!areaCode) return '' |
| | | |
| | | const code = areaCode.toString() |
| | |
| | | }, |
| | | 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 = { |
| | | ...data, |
| | | area_code: this.getFullAreaCode(data.area_code), |
| | | area_code: await this.getFullAreaCode(data.area_code), |
| | | area_name: this.form.area_name, |
| | | duration_of_insurance: [data?.insure_start_time || '', data?.insure_expired_time || ''] |
| | | cnmode_code: this.getDockModeText(this.form.mode_code), |
| | | cnstatus: this.form.status === false ? '离线' : '在线', |
| | | duration_of_insurance: [data?.insure_start_time || '', data?.insure_expired_time || ''], |
| | | } |
| | | console.log('this.form', this.form) |
| | | |
| | | done() |
| | | }) |