|
|
@@ -150,6 +150,7 @@ async function openConfig(row: WebtopoProjectVO) {
|
|
|
linkedDeviceIds: getLinkedDeviceIds(row),
|
|
|
remark: row.remark
|
|
|
}
|
|
|
+ deviceOptions.value = []
|
|
|
createVisible.value = true
|
|
|
await loadDeviceOptions(deptId)
|
|
|
await nextTick()
|
|
|
@@ -161,7 +162,7 @@ function handleCreateClose() {
|
|
|
}
|
|
|
|
|
|
async function submitCreate() {
|
|
|
- if (!formRef.value) return
|
|
|
+ if (!formRef.value || deviceLoading.value) return
|
|
|
|
|
|
try {
|
|
|
createLoading.value = true
|
|
|
@@ -188,7 +189,7 @@ async function submitCreate() {
|
|
|
}
|
|
|
|
|
|
async function submitConfig() {
|
|
|
- if (!formRef.value || !createForm.value.id) return
|
|
|
+ if (!formRef.value || !createForm.value.id || deviceLoading.value) return
|
|
|
|
|
|
try {
|
|
|
createLoading.value = true
|
|
|
@@ -402,6 +403,8 @@ watch(
|
|
|
destroy-on-close>
|
|
|
<el-form
|
|
|
ref="formRef"
|
|
|
+ v-loading="deviceLoading"
|
|
|
+ element-loading-text="设备选项加载中..."
|
|
|
:model="createForm"
|
|
|
:rules="rules"
|
|
|
label-position="top"
|
|
|
@@ -421,8 +424,9 @@ watch(
|
|
|
collapse-tags-tooltip
|
|
|
:max-collapse-tags="3"
|
|
|
:loading="deviceLoading"
|
|
|
+ :disabled="deviceLoading"
|
|
|
class="w-full"
|
|
|
- placeholder="请选择绑定设备">
|
|
|
+ :placeholder="deviceLoading ? '设备选项加载中...' : '请选择绑定设备'">
|
|
|
<el-option
|
|
|
v-for="item in deviceOptions"
|
|
|
:key="item.value"
|
|
|
@@ -445,7 +449,13 @@ watch(
|
|
|
|
|
|
<template #footer>
|
|
|
<el-button @click="handleCreateClose">取消</el-button>
|
|
|
- <el-button type="primary" :loading="createLoading" @click="submitForm">保存</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ :loading="createLoading"
|
|
|
+ :disabled="deviceLoading"
|
|
|
+ @click="submitForm">
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</template>
|