From f346dcb4e26bfca845b4825006af03affe089b8a Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 02 八月 2024 17:23:42 +0800 Subject: [PATCH] 对外支持模块 --- src/views/fysp/support/components/DeviceMatch.vue | 30 ++++++++++++++++++++++++++++-- 1 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/views/fysp/support/components/DeviceMatch.vue b/src/views/fysp/support/components/DeviceMatch.vue index 338bbe7..e9b046f 100644 --- a/src/views/fysp/support/components/DeviceMatch.vue +++ b/src/views/fysp/support/components/DeviceMatch.vue @@ -11,11 +11,20 @@ <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> @@ -23,11 +32,16 @@ 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(() => { @@ -48,4 +62,16 @@ 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> -- Gitblit v1.9.3