修改自定义弹出框处理逻辑

v1.2.0
于肖磊 2025-01-10 16:37:45 +08:00
parent 9f77f26bad
commit 5bfa9eb9e5
2 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<template>
<Dialog v-model:visible="dialogVisible" :title="configType == 'custom' ? '编辑自定义' : '编辑自定义组'" @accomplish="accomplish">
<Dialog v-model:visible="dialogVisible" :title="configType == 'custom' ? '编辑自定义' : '编辑自定义组'" @accomplish="accomplish" @close_event="close_event">
<div class="flex-row h w">
<!-- 左侧和中间区域 -->
<DragIndex ref="draglist" :key="dragkey" v-model:height="center_height" v-model:width="center_width" :config-type="configType" :source-list="sourceList" :custom-group-field-id="customGroupFieldId" :is-custom="configType == 'custom'? isCustom : false" :show-data="showData" :list="new_list" @right-update="right_update" @operation_end="operation_end"></DragIndex>
@ -107,6 +107,19 @@ const right_update = (item: any) => {
};
const draglist = ref<diy_data | null>(null);
const emits = defineEmits(['accomplish', 'custom_edit']);
//
const close_event = () => {
//
if (props.configType == 'custom') {
//
data_source_store.set_custom_records([]);
data_source_store.set_custom_records_index(-1);
} else {
//
data_source_store.set_custom_group_records([]);
data_source_store.set_custom_group_records_index(-1);
}
}
//
const accomplish = () => {
//

View File

@ -74,9 +74,10 @@ const table_select = (val: any) => {
}
select_data.value = val;
};
const emit = defineEmits(['confirm_event']);
const emit = defineEmits(['confirm_event', 'close_event']);
const close_event = () => {
dialogVisible.value = false;
emit('close_event');
};
const confirm_event = () => {
if (init_data()) {