fix: 配置-参数配置里面的删除按钮,建议点击后增加二次确认避免误触

This commit is contained in:
TsMask
2023-12-25 17:05:20 +08:00
parent 715471f950
commit 12f810d890

View File

@@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { reactive, ref, onMounted, watch, toRaw, nextTick } from 'vue'; import { reactive, ref, onMounted, watch, toRaw, nextTick } from 'vue';
import { PageContainer } from 'antdv-pro-layout'; import { PageContainer } from 'antdv-pro-layout';
import { message } from 'ant-design-vue/lib'; import { Modal, message } from 'ant-design-vue/lib';
import useI18n from '@/hooks/useI18n'; import useI18n from '@/hooks/useI18n';
import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue'; import TableColumnsDnd from '@/components/TableColumnsDnd/index.vue';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
@@ -403,27 +403,37 @@ function arrayEditOk(from: Record<string, any>) {
/**多列表删除单行 */ /**多列表删除单行 */
function arrayDelete(rowIndex: Record<string, any>) { function arrayDelete(rowIndex: Record<string, any>) {
const index = rowIndex.value; const index = rowIndex.value;
delParamConfigInfo({ const title = `${treeState.selectNode.topDisplay} Index-${index}`;
neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], Modal.confirm({
topTag: treeState.selectNode.topTag, title: t('common.tipTitle'),
loc: index, content: t('views.configManage.configParamForm.delItemTip', {
}).then(res => { num: title,
if (res.code === RESULT_CODE_SUCCESS) { }),
message.success({ onOk() {
content: t('views.configManage.configParamForm.delItemOk', { delParamConfigInfo({
num: `${treeState.selectNode.topDisplay} Index-${index}`, neType: neTypeSelect.value[0],
}), neId: neTypeSelect.value[1],
duration: 2, topTag: treeState.selectNode.topTag,
loc: index,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.delItemOk', {
num: title,
}),
duration: 2,
});
arrayEditClose();
fnActiveConfigNode('#');
} else {
message.error({
content: `${res.msg}`,
duration: 2,
});
}
}); });
arrayEditClose(); },
fnActiveConfigNode('#');
} else {
message.error({
content: `${res.msg}`,
duration: 2,
});
}
}); });
} }
@@ -721,27 +731,37 @@ function arrayChildEditOk(from: Record<string, any>) {
function arrayChildDelete(rowIndex: Record<string, any>) { function arrayChildDelete(rowIndex: Record<string, any>) {
const index = rowIndex.value; const index = rowIndex.value;
const loc = `${arrayChildState.loc}/${index}`; const loc = `${arrayChildState.loc}/${index}`;
delParamConfigInfo({ const title = `${arrayChildState.title} Index-${index}`;
neType: neTypeSelect.value[0],
neId: neTypeSelect.value[1], Modal.confirm({
topTag: treeState.selectNode.topTag, title: t('common.tipTitle'),
loc, content: t('views.configManage.configParamForm.delItemTip', {
}).then(res => { num: title,
if (res.code === RESULT_CODE_SUCCESS) { }),
message.success({ onOk() {
content: t('views.configManage.configParamForm.delItemOk', { delParamConfigInfo({
num: `${arrayChildState.title} Index-${index}`, neType: neTypeSelect.value[0],
}), neId: neTypeSelect.value[1],
duration: 2, topTag: treeState.selectNode.topTag,
loc,
}).then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success({
content: t('views.configManage.configParamForm.delItemOk', {
num: title,
}),
duration: 2,
});
arrayEditClose();
fnActiveConfigNode('#');
} else {
message.error({
content: `${res.msg}`,
duration: 2,
});
}
}); });
arrayEditClose(); },
fnActiveConfigNode('#');
} else {
message.error({
content: `${res.msg}`,
duration: 2,
});
}
}); });
} }