2024-01-16 16:31:11 +08:00
|
|
|
<template>
|
2024-01-26 16:15:40 +08:00
|
|
|
<div class='default-main'>
|
2024-01-16 16:31:11 +08:00
|
|
|
<TableHeader>
|
|
|
|
|
<template v-slot:select>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='设备类型'>
|
2024-01-16 16:31:11 +08:00
|
|
|
<!-- <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入设备类型" /> -->
|
2024-01-17 14:29:31 +08:00
|
|
|
<el-select
|
2024-01-26 16:15:40 +08:00
|
|
|
v-model='tableStore.table.params.devType'
|
2024-01-17 14:29:31 +08:00
|
|
|
clearable
|
2024-01-26 16:15:40 +08:00
|
|
|
@change='devTypeChange'
|
|
|
|
|
placeholder='请选择设备类型'
|
2024-01-17 14:29:31 +08:00
|
|
|
>
|
2024-01-16 16:31:11 +08:00
|
|
|
<el-option
|
2024-01-26 16:15:40 +08:00
|
|
|
v-for='item in devTypeOptions'
|
|
|
|
|
:key='item.value'
|
|
|
|
|
:label='item.label'
|
|
|
|
|
:value='item.value'
|
2024-01-16 16:31:11 +08:00
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='设备型号'>
|
|
|
|
|
<el-select v-model='tableStore.table.params.devModel' clearable placeholder='请选择设备型号'>
|
2024-01-16 16:31:11 +08:00
|
|
|
<el-option
|
2024-01-26 16:15:40 +08:00
|
|
|
v-for='item in devModelOptionsFilter'
|
|
|
|
|
:key='item.value'
|
|
|
|
|
:label='item.label'
|
|
|
|
|
:value='item.value'
|
2024-01-16 16:31:11 +08:00
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='通讯协议'>
|
|
|
|
|
<el-select v-model='tableStore.table.params.devAccessMethod' clearable placeholder='请选择通讯协议'>
|
|
|
|
|
<el-option label='MQTT' value='mqtt'></el-option>
|
|
|
|
|
<el-option label='CLD' value='cloud'></el-option>
|
2024-01-16 16:31:11 +08:00
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='状态'>
|
|
|
|
|
<el-select v-model='tableStore.table.params.status' clearable placeholder='请选择状态'>
|
|
|
|
|
<el-option label='未注册' :value='1'></el-option>
|
|
|
|
|
<el-option label='注册' :value='2'></el-option>
|
|
|
|
|
<el-option label='接入' :value='3'></el-option>
|
2024-01-16 16:31:11 +08:00
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
2024-01-17 14:29:31 +08:00
|
|
|
<template v-slot:operation>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-button type='primary' @click='downLoadFile' class='ml10' icon='el-icon-Download'>
|
2024-01-17 14:29:31 +08:00
|
|
|
模版下载
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-upload
|
2024-01-26 16:15:40 +08:00
|
|
|
style='display: inline-block'
|
|
|
|
|
action=''
|
|
|
|
|
accept='.xlsx'
|
|
|
|
|
class='upload-demo'
|
|
|
|
|
:show-file-list='false'
|
|
|
|
|
:auto-upload='false'
|
|
|
|
|
:on-change='bulkImport'
|
2024-01-17 14:29:31 +08:00
|
|
|
>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-button type='primary' class='ml10' icon='el-icon-Tickets'>批量导入</el-button>
|
2024-01-17 14:29:31 +08:00
|
|
|
</el-upload>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-button type='primary' class='ml10' @click='add' icon='el-icon-Plus'>新增设备</el-button>
|
2024-01-17 14:29:31 +08:00
|
|
|
</template>
|
2024-01-16 16:31:11 +08:00
|
|
|
</TableHeader>
|
2024-01-26 16:15:40 +08:00
|
|
|
<Table ref='tableRef'></Table>
|
2024-01-17 14:29:31 +08:00
|
|
|
|
|
|
|
|
<el-dialog
|
2024-01-26 16:15:40 +08:00
|
|
|
:title='dialogTitle'
|
|
|
|
|
v-model='dialogFormVisible'
|
|
|
|
|
:close-on-click-modal='false'
|
|
|
|
|
width='600px'
|
|
|
|
|
:before-close='resetForm'
|
2024-01-17 14:29:31 +08:00
|
|
|
>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form :model='form' label-width='120px' :rules='rules' ref='ruleFormRef'>
|
|
|
|
|
<el-form-item label='设备名称:' prop='name'>
|
2024-01-17 14:29:31 +08:00
|
|
|
<el-input
|
2024-01-26 16:15:40 +08:00
|
|
|
v-model='form.name'
|
|
|
|
|
autocomplete='off'
|
2024-01-17 14:29:31 +08:00
|
|
|
clearable
|
2024-01-26 16:15:40 +08:00
|
|
|
placeholder='请输入(项目名称+设备名称)'
|
2024-01-17 14:29:31 +08:00
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='网络设备ID:' prop='ndid' class='top'>
|
|
|
|
|
<el-input v-model='form.ndid' autocomplete='off' placeholder='请输入'></el-input>
|
2024-01-17 14:29:31 +08:00
|
|
|
</el-form-item>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='设备类型:' prop='devType' class='top'>
|
2024-01-17 14:29:31 +08:00
|
|
|
<el-select
|
2024-01-26 16:15:40 +08:00
|
|
|
v-model='form.devType'
|
|
|
|
|
placeholder='请选择'
|
|
|
|
|
style='width: 100%'
|
|
|
|
|
@change='formDevTypeChange'
|
2024-01-17 14:29:31 +08:00
|
|
|
clearable
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
2024-01-26 16:15:40 +08:00
|
|
|
v-for='item in devTypeOptions'
|
|
|
|
|
:key='item.value'
|
|
|
|
|
:label='item.label'
|
|
|
|
|
:value='item.value'
|
2024-01-17 14:29:31 +08:00
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='设备型号:' prop='devModel' class='top'>
|
|
|
|
|
<el-select v-model='form.devModel' placeholder='请选择' style='width: 100%' clearable>
|
2024-01-17 14:29:31 +08:00
|
|
|
<el-option
|
2024-01-26 16:15:40 +08:00
|
|
|
v-for='item in formDevModelOptionsFilter'
|
|
|
|
|
:key='item.value'
|
|
|
|
|
:label='item.label'
|
|
|
|
|
:value='item.value'
|
2024-01-17 14:29:31 +08:00
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='通讯协议:' prop='devAccessMethod' class='top'>
|
|
|
|
|
<el-select v-model='form.devAccessMethod' placeholder='请选择' style='width: 100%' clearable>
|
|
|
|
|
<el-option label='MQTT' value='MQTT'></el-option>
|
|
|
|
|
<el-option label='CLD' value='cloud'></el-option>
|
2024-01-17 14:29:31 +08:00
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-form-item label='合同号:' prop='cntractNo' class='top'>
|
|
|
|
|
<el-input v-model='form.cntractNo' autocomplete='off' placeholder='请输入'></el-input>
|
2024-01-17 14:29:31 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
2024-01-26 16:15:40 +08:00
|
|
|
<el-button @click='resetForm'>取 消</el-button>
|
|
|
|
|
<el-button type='primary' @click='onSubmit'>确 定</el-button>
|
2024-01-17 14:29:31 +08:00
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
2024-01-26 16:15:40 +08:00
|
|
|
<div class='qrcode-label'>
|
|
|
|
|
<div class='qrcode-label-title'>{{ deivce.mac }}</div>
|
|
|
|
|
<img class='qrcode-label-img' alt='二维码加载失败' :src='deivce.qrPath' />
|
2024-01-17 14:29:31 +08:00
|
|
|
</div>
|
2024-01-16 16:31:11 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
2024-01-26 16:15:40 +08:00
|
|
|
<script setup lang='ts'>
|
2024-01-18 15:50:17 +08:00
|
|
|
import { ref, onMounted, provide, computed, reactive, nextTick } from 'vue'
|
2024-01-16 16:31:11 +08:00
|
|
|
import TableStore from '@/utils/tableStore'
|
|
|
|
|
import Table from '@/components/table/index.vue'
|
|
|
|
|
import TableHeader from '@/components/table/header/index.vue'
|
2024-01-17 14:29:31 +08:00
|
|
|
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
|
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
import {
|
|
|
|
|
addEquipmentDelivery,
|
|
|
|
|
deleteEquipmentDelivery,
|
|
|
|
|
editEquipmentDelivery,
|
|
|
|
|
batchImportDevice,
|
|
|
|
|
resetEquipmentDelivery
|
|
|
|
|
} from '@/api/cs-system-boot/device'
|
|
|
|
|
import html2canvas from 'html2canvas'
|
2024-01-19 14:08:07 +08:00
|
|
|
import { fullUrl } from '@/utils/common'
|
2024-01-26 16:15:40 +08:00
|
|
|
|
2024-01-16 16:31:11 +08:00
|
|
|
defineOptions({
|
|
|
|
|
name: 'govern/log/debug'
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const devTypeOptions: any = ref([])
|
2024-01-17 14:29:31 +08:00
|
|
|
const deivce: any = ref({})
|
|
|
|
|
const ruleFormRef = ref()
|
|
|
|
|
const form = reactive({
|
|
|
|
|
cntractNo: '',
|
|
|
|
|
devAccessMethod: 'mqtt',
|
|
|
|
|
devModel: '',
|
|
|
|
|
devType: '',
|
|
|
|
|
name: '',
|
|
|
|
|
ndid: ''
|
|
|
|
|
})
|
|
|
|
|
const rules = reactive({
|
|
|
|
|
name: [{ required: true, message: '设备名不能为空', trigger: 'blur' }],
|
|
|
|
|
ndid: [{ required: true, message: '网络设备id不能为空', trigger: 'blur' }],
|
|
|
|
|
devType: [{ required: true, message: '设备类型不能为空', trigger: 'change' }],
|
|
|
|
|
devModel: [{ required: true, message: '设备型号不能为空', trigger: 'change' }],
|
|
|
|
|
devAccessMethod: [{ required: true, message: '接入方式不能为空', trigger: 'blur' }],
|
|
|
|
|
cntractNo: [{ required: true, message: '合同号不能为空', trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
const dialogFormVisible = ref(false)
|
|
|
|
|
const dialogTitle = ref('新增设备')
|
|
|
|
|
|
|
|
|
|
const devModelOptions: any = ref([])
|
2024-01-18 15:50:17 +08:00
|
|
|
queryByCode('Device_Type').then(res => {
|
|
|
|
|
queryCsDictTree(res.data.id).then(res => {
|
|
|
|
|
devTypeOptions.value = res.data.map((item: any) => {
|
|
|
|
|
return {
|
|
|
|
|
value: item.id,
|
|
|
|
|
label: item.name,
|
|
|
|
|
...item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
queryByid(res.data.id).then(res => {
|
|
|
|
|
devModelOptions.value = res.data.map((item: any) => {
|
|
|
|
|
return {
|
|
|
|
|
value: item.id,
|
|
|
|
|
label: item.name,
|
|
|
|
|
...item
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
2024-01-17 14:29:31 +08:00
|
|
|
const devModelOptionsFilter = computed(() => {
|
|
|
|
|
return devModelOptions.value.filter((item: any) => {
|
|
|
|
|
if (tableStore.table.params.devType) {
|
|
|
|
|
return item.pid == tableStore.table.params.devType
|
|
|
|
|
} else {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
const formDevModelOptionsFilter = computed(() => {
|
|
|
|
|
return devModelOptions.value.filter((item: any) => {
|
|
|
|
|
if (form.devType) {
|
|
|
|
|
return item.pid == form.devType
|
|
|
|
|
} else {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
2024-01-16 16:31:11 +08:00
|
|
|
|
|
|
|
|
const tableStore = new TableStore({
|
|
|
|
|
url: '/cs-device-boot/EquipmentDelivery/list',
|
|
|
|
|
method: 'POST',
|
2024-01-18 15:50:17 +08:00
|
|
|
column: [
|
|
|
|
|
{ title: '设备名称', field: 'name' },
|
|
|
|
|
{
|
|
|
|
|
title: '设备类型',
|
|
|
|
|
field: 'devType',
|
|
|
|
|
formatter: row => {
|
|
|
|
|
return (
|
|
|
|
|
devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0] &&
|
|
|
|
|
devTypeOptions.value.filter((item: any) => item.value == row.cellValue)[0].label
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '设备型号',
|
|
|
|
|
field: 'devModel',
|
|
|
|
|
formatter: row => {
|
|
|
|
|
return (
|
|
|
|
|
devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0] &&
|
|
|
|
|
devModelOptions.value.filter((item: any) => item.value == row.cellValue)[0].label
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '通讯协议',
|
|
|
|
|
field: 'devAccessMethod',
|
|
|
|
|
formatter: row => {
|
|
|
|
|
return row.cellValue === 'MQTT' ? 'MQTT' : row.cellValue === 'cloud' ? 'CLD' : row.cellValue
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{ title: '录入时间', field: 'createTime' },
|
|
|
|
|
{ title: '网络设备ID', field: 'ndid' },
|
|
|
|
|
{
|
|
|
|
|
title: '状态',
|
|
|
|
|
field: 'status',
|
|
|
|
|
formatter: row => {
|
|
|
|
|
return row.cellValue == 1 ? '未注册' : row.cellValue == 2 ? '注册' : '接入'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
align: 'center',
|
2024-01-26 09:35:33 +08:00
|
|
|
width: '180',
|
2024-01-18 15:50:17 +08:00
|
|
|
render: 'buttons',
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
name: 'edit',
|
2024-01-26 16:15:40 +08:00
|
|
|
title: '编辑',
|
2024-01-18 15:50:17 +08:00
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-Edit',
|
2024-01-26 09:35:33 +08:00
|
|
|
render: 'tipButton',
|
2024-01-18 15:50:17 +08:00
|
|
|
|
|
|
|
|
click: async row => {
|
|
|
|
|
dialogFormVisible.value = true
|
|
|
|
|
dialogTitle.value = '编辑设备'
|
|
|
|
|
for (let key in form) {
|
|
|
|
|
form[key] = row[key]
|
|
|
|
|
}
|
|
|
|
|
form.id = row.id
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-26 09:35:33 +08:00
|
|
|
title: '二维码',
|
2024-01-18 15:50:17 +08:00
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-Grid',
|
2024-01-26 09:35:33 +08:00
|
|
|
render: 'tipButton',
|
2024-01-18 15:50:17 +08:00
|
|
|
|
|
|
|
|
click: row => {
|
|
|
|
|
deivce.value = row
|
2024-01-19 14:08:07 +08:00
|
|
|
deivce.value.qrPath = fullUrl(deivce.value.qrPath)
|
2024-01-18 15:50:17 +08:00
|
|
|
setTimeout(() => {
|
|
|
|
|
html2canvas(document.querySelector('.qrcode-label'), {
|
|
|
|
|
useCORS: true
|
|
|
|
|
}).then(canvas => {
|
|
|
|
|
let url = canvas.toDataURL('image/png')
|
|
|
|
|
// 下载图片
|
|
|
|
|
let a = document.createElement('a')
|
|
|
|
|
let event = new MouseEvent('click')
|
|
|
|
|
a.href = url
|
|
|
|
|
a.download = row.mac + '.png'
|
|
|
|
|
a.dispatchEvent(event)
|
|
|
|
|
})
|
|
|
|
|
}, 0)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'del',
|
2024-01-26 09:35:33 +08:00
|
|
|
title: '删除',
|
2024-01-18 15:50:17 +08:00
|
|
|
type: 'danger',
|
|
|
|
|
icon: 'el-icon-Delete',
|
2024-01-26 09:35:33 +08:00
|
|
|
render: 'tipButton',
|
2024-01-18 15:50:17 +08:00
|
|
|
|
|
|
|
|
click: row => {
|
|
|
|
|
ElMessageBox.confirm('确定删除该设备吗?', '提示', {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
deleteEquipmentDelivery(row.id).then(res => {
|
|
|
|
|
ElMessage.success('删除成功!')
|
|
|
|
|
tableStore.onTableAction('search', {})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
2024-01-17 14:29:31 +08:00
|
|
|
beforeSearchFun: () => {
|
|
|
|
|
for (let key in tableStore.table.params) {
|
|
|
|
|
if (tableStore.table.params[key] === '') {
|
|
|
|
|
delete tableStore.table.params[key]
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-01-16 16:31:11 +08:00
|
|
|
}
|
|
|
|
|
})
|
2024-01-17 14:29:31 +08:00
|
|
|
tableStore.table.params.orderBy = 'desc'
|
2024-01-18 15:50:17 +08:00
|
|
|
|
2024-01-17 14:29:31 +08:00
|
|
|
// 设备类型
|
|
|
|
|
const devTypeChange = (e: any) => {
|
|
|
|
|
if (!e) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
tableStore.table.params.devModel = ''
|
|
|
|
|
}
|
|
|
|
|
// 下载模版
|
|
|
|
|
const downLoadFile = () => {
|
|
|
|
|
window.open(window.location.origin + '/api/cs-device-boot/EquipmentDelivery/getExcelTemplate')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 导入模版
|
|
|
|
|
const bulkImport = (e: any) => {
|
|
|
|
|
batchImportDevice(e.raw).then((res: any) => {
|
|
|
|
|
if (res.type === 'application/json') {
|
|
|
|
|
const reader = new FileReader()
|
|
|
|
|
reader.readAsText(res)
|
|
|
|
|
reader.onload = (e: any) => {
|
|
|
|
|
let data = JSON.parse(e.target.result)
|
|
|
|
|
if (data.code === 'A0000') {
|
|
|
|
|
ElMessage.success(data.message)
|
|
|
|
|
tableStore.onTableAction('search', {})
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(data.message)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error('导入失败!')
|
|
|
|
|
let url = window.URL.createObjectURL(res)
|
|
|
|
|
let link = document.createElement('a')
|
|
|
|
|
link.style.display = 'none'
|
|
|
|
|
link.href = url
|
|
|
|
|
link.setAttribute('download', '导入失败.xlsx')
|
|
|
|
|
document.body.appendChild(link)
|
|
|
|
|
link.click()
|
|
|
|
|
document.body.removeChild(link)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 新增
|
|
|
|
|
const add = () => {
|
|
|
|
|
dialogFormVisible.value = true
|
|
|
|
|
dialogTitle.value = '新增设备'
|
|
|
|
|
}
|
2024-01-18 15:50:17 +08:00
|
|
|
|
2024-01-17 14:29:31 +08:00
|
|
|
// 确认
|
|
|
|
|
const onSubmit = () => {
|
|
|
|
|
ruleFormRef.value.validate((valid: any) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (dialogTitle.value == '新增设备') {
|
|
|
|
|
addEquipmentDelivery(form).then(res => {
|
|
|
|
|
ElMessage.success('新增成功')
|
|
|
|
|
resetForm()
|
|
|
|
|
tableStore.onTableAction('search', {})
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
editEquipmentDelivery(form).then(res => {
|
|
|
|
|
ElMessage.success('修改成功')
|
|
|
|
|
resetForm()
|
|
|
|
|
tableStore.onTableAction('search', {})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// 清空表格
|
|
|
|
|
const resetForm = () => {
|
|
|
|
|
ruleFormRef.value.resetFields()
|
|
|
|
|
dialogFormVisible.value = false
|
2024-01-18 15:50:17 +08:00
|
|
|
nextTick(() => {
|
|
|
|
|
// 模拟待编辑数据
|
|
|
|
|
let user = {
|
|
|
|
|
cntractNo: '',
|
|
|
|
|
devAccessMethod: 'mqtt',
|
|
|
|
|
devModel: '',
|
|
|
|
|
devType: '',
|
|
|
|
|
name: '',
|
|
|
|
|
ndid: ''
|
|
|
|
|
}
|
|
|
|
|
Object.assign(form, user)
|
2024-01-17 14:29:31 +08:00
|
|
|
})
|
|
|
|
|
}
|
2024-01-16 16:31:11 +08:00
|
|
|
|
2024-01-17 14:29:31 +08:00
|
|
|
const formDevTypeChange = (e: any) => {
|
|
|
|
|
if (!e) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
form.devModel = ''
|
|
|
|
|
}
|
2024-01-16 16:31:11 +08:00
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
2024-01-18 15:50:17 +08:00
|
|
|
setTimeout(() => {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
}, 100)
|
2024-01-16 16:31:11 +08:00
|
|
|
})
|
|
|
|
|
|
2024-01-26 16:15:40 +08:00
|
|
|
const addMenu = () => {
|
|
|
|
|
}
|
2024-01-16 16:31:11 +08:00
|
|
|
</script>
|
2024-01-26 16:15:40 +08:00
|
|
|
<style lang='scss' scoped>
|
2024-01-17 14:29:31 +08:00
|
|
|
.qrcode-label {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
z-index: -99;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
width: 180px;
|
|
|
|
|
height: 180px;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
background: #fff;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
.qrcode-label-title {
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.qrcode-label-img {
|
|
|
|
|
width: 140px;
|
|
|
|
|
height: 140px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|