| | |
| | | <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" |
| | |
| | | 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> |
| | | </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> |
| | | |
| | |
| | | <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, |
| | |
| | | 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' |
| | |
| | | option: { |
| | | lazy: true, |
| | | tree: true, |
| | | height: '460', |
| | | calcHeight: 32, |
| | | |
| | | dialogWidth: 1050, |
| | | tip: false, |
| | | searchShow: true, |
| | |
| | | addBtn: false, |
| | | dialogClickModal: false, |
| | | grid: false, |
| | | |
| | | height: 'auto', |
| | | calcHeight: 180, |
| | | |
| | | column: [ |
| | | { |
| | | label: '设备型号', |
| | |
| | | }, |
| | | { |
| | | 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', |
| | |
| | | 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, |
| | |
| | | ...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 () { |
| | |
| | | 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 = { |
| | | 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() |
| | | |
| | | }) |
| | | } |
| | | }, |