| | |
| | | <el-row justify="space-between"> |
| | | <div> |
| | | <!-- <el-button type="primary" plain :disabled="!enabled">名称同步</el-button> --> |
| | | <el-button type="primary" plain :disabled="!enabled">录入设备信息</el-button> |
| | | <el-button type="primary" plain :disabled="!enabled" @click="setNewDevice" |
| | | >录入设备信息</el-button |
| | | > |
| | | </div> |
| | | <el-button type="danger" :disabled="!enabled">上传匹配信息</el-button> |
| | | </el-row> |
| | | <el-row></el-row> |
| | | <div v-if="newDevice"> |
| | | <el-text>新增设备</el-text> |
| | | <FormDevice :form-info="newDevice" :is-edit="true" ></FormDevice> |
| | | </div> |
| | | <div v-if="deviceList.length > 0"> |
| | | <el-text>已有设备</el-text> |
| | | <FormDevice v-for="item in deviceList" :key="item.diId" :form-info="item"></FormDevice> |
| | | </div> |
| | | </template> |
| | | </el-card> |
| | | </template> |
| | |
| | | import { ref, computed, watch } from 'vue'; |
| | | import deviceApi from '@/api/fysp/deviceApi'; |
| | | |
| | | import FormDevice from './FormDevice.vue'; |
| | | |
| | | const props = defineProps({ |
| | | device: Object, |
| | | scene: Object |
| | | }); |
| | | |
| | | // 新增设备信息 |
| | | const newDevice = ref(); |
| | | // 场景已有设备信息 |
| | | const deviceList = ref([]); |
| | | |
| | | const enabled = computed(() => { |
| | |
| | | deviceList.value = res.data; |
| | | }); |
| | | } |
| | | |
| | | function setNewDevice() { |
| | | newDevice.value = { |
| | | diName: props.device.name, |
| | | diMnCode: props.device.code, |
| | | diType: 1, |
| | | diSupplier: null, |
| | | diMaintainer: null, |
| | | diRunningStatus: true, |
| | | diRemoved: false |
| | | }; |
| | | } |
| | | </script> |