| | |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" |
| | | :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad" @tree-load="treeLoad"> |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text icon="el-icon-copy-document" @click.stop="copyInfo(scope.row, scope.index)" |
| | |
| | | import { getWebsocketUrl } from '@/websocket/util/config'; |
| | | import ConnectWebSocket from '@/websocket'; |
| | | import { $Clipboard } from "@smallwei/avue"; |
| | | |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: '设备类型', |
| | | prop: 'type', |
| | | type: 'radio', |
| | | labelWidth: 130, |
| | | value: 0, |
| | | dicData: [ |
| | | { |
| | | label: '机场', |
| | | value: 0 |
| | | }, |
| | | { |
| | | label: '遥控器', |
| | | value: 1 |
| | | } |
| | | ], |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择设备类型', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | | prop: 'create_time', |
| | | addDisplay: false, |
| | |
| | | methods: { |
| | | |
| | | copyInfo(row, index) { |
| | | let params = `host: tcp://139.196.74.78:1883 账号:drone 密码:123456 组织id:${row.bing_id} 设备码:${row.bind_code} 机场名称:${row.workspace_name} aircrattName:${row.workspace_desc}`; |
| | | if(import.meta.env.VITE_APP_ENV==='development'){ |
| | | // alert('地址'+import.meta.env.VITE_APP_ENV); |
| | | let params = ` |
| | | host: tcp://139.196.74.78:1883 |
| | | 账号:drone |
| | | 密码:123456 |
| | | 组织id:${row.bing_id} |
| | | 设备码:${row.bind_code} |
| | | 机场名称:${row.workspace_name} |
| | | aircrattName:${row.workspace_desc}`; |
| | | $Clipboard({ |
| | | text: params, |
| | | }).then(() => { |
| | |
| | | }).catch(() => { |
| | | this.$message.error("复制失败"); |
| | | }); |
| | | }else{ |
| | | // alert('地址'+import.meta.env.VITE_APP_ENV); |
| | | let params = ` |
| | | host: tcp://101.132.85.201:1883 |
| | | 账号:drone |
| | | 密码:drone@123 |
| | | 组织id:${row.bing_id} |
| | | 设备码:${row.bind_code} |
| | | 机场名称:${row.workspace_name} |
| | | aircrattName:${row.workspace_desc}`; |
| | | $Clipboard({ |
| | | text: params, |
| | | }).then(() => { |
| | | this.$message.success("复制成功"); |
| | | }).catch(() => { |
| | | this.$message.error("复制失败"); |
| | | });} |
| | | }, |
| | | init() { |
| | | this.onLoad(this.page); |
| | |
| | | getList(page.currentPage, page.pageSize, values).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | data.records.forEach(e => { |
| | | e['hasChildren'] = e.has_children; |
| | | if (e.firmware_status == 4) { |
| | | this.connectWebSocket(e); |
| | | } |
| | | }); |
| | | // data.records.forEach(e => { |
| | | // e['hasChildren'] = e.has_children; |
| | | // if (e.firmware_status == 4) { |
| | | // this.connectWebSocket(e); |
| | | // } |
| | | // }); |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |