增加删除组合类型

This commit is contained in:
joylink_zhaoerwei 2023-09-14 09:27:01 +08:00
parent 0445149a7e
commit ff2f7655bf

View File

@ -54,13 +54,21 @@
{{ item }}
</q-chip>
</div>
<q-btn
v-show="combinationtype.refRelaysCode.length > 0"
style="width: 130px"
label="清空框选的继电器"
color="red"
@click="clearAllSelect(index)"
/>
<div>
<q-btn
v-show="combinationtype.refRelaysCode.length > 0"
style="width: 130px"
label="清空框选的继电器"
color="red"
class="q-mr-md"
@click="clearAllSelect(index)"
/>
<q-btn
label="删除组合类型"
color="secondary"
@click="deleteCombinationtype(index)"
/>
</div>
</q-item-section>
</q-item>
</q-card>
@ -271,6 +279,10 @@ function removeSelect(code: string) {
function clearAllSelect(index: number) {
relateRelayConfig.value.combinationtypes[index].refRelays = [];
relateRelayConfig.value.combinationtypes[index].refRelaysCode = [];
clearAllSelectAtCanvas();
}
function clearAllSelectAtCanvas() {
selectGraphic = [];
relayCabinetStore.getDrawApp().updateSelected();
}
@ -284,6 +296,11 @@ function addCombinationtype() {
});
}
function deleteCombinationtype(index: number) {
relateRelayConfig.value.combinationtypes.splice(index, 1);
clearAllSelectAtCanvas();
}
function onReset() {
clickIndex = null;
handleState.value = '新建设备关联继电器';
@ -294,8 +311,7 @@ function onReset() {
{ code: '组合类型', refRelays: [], refRelaysCode: [], expanded: false },
],
};
selectGraphic = [];
relayCabinetStore.getDrawApp().updateSelected();
clearAllSelectAtCanvas();
}
function goBack() {