feat: confirm close while edit work name
This commit is contained in:
parent
a460fb5c61
commit
e06abf1e77
5 changed files with 43 additions and 14 deletions
|
|
@ -22,7 +22,7 @@ import useOptionStore from 'src/stores/options';
|
|||
import { Status } from 'src/stores/types';
|
||||
import NoData from 'components/NoData.vue';
|
||||
|
||||
import { dialog } from 'src/stores/utils';
|
||||
import { dialog, dialogWarningClose } from 'src/stores/utils';
|
||||
|
||||
import useProductServiceStore from 'src/stores/product-service';
|
||||
import {
|
||||
|
|
@ -647,16 +647,20 @@ function confirmDeleteWork(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function confirmCloseWork() {
|
||||
dialog({
|
||||
color: 'negative',
|
||||
icon: 'mdi-alert',
|
||||
title: t('deleteConfirmTitle'),
|
||||
actionText: t('delete'),
|
||||
message: t('deleteConfirmMessage'),
|
||||
action: async () => {},
|
||||
cancel: () => {},
|
||||
});
|
||||
function triggerConfirmCloseWork() {
|
||||
const isWorkNameEdit =
|
||||
workNameRef.value && workNameRef.value.isWorkNameEdit
|
||||
? workNameRef.value.isWorkNameEdit()
|
||||
: false;
|
||||
if (isWorkNameEdit) {
|
||||
dialogWarningClose(t, {
|
||||
action: () => {
|
||||
manageWorkNameDialog.value = false;
|
||||
},
|
||||
});
|
||||
} else {
|
||||
manageWorkNameDialog.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
const tempValueProperties = ref<Attributes>({
|
||||
|
|
@ -1785,8 +1789,9 @@ watch(currentStatus, async () => {
|
|||
no-footer
|
||||
height="65vh"
|
||||
width="65%"
|
||||
:title="$t('manage')"
|
||||
v-model:modal="manageWorkNameDialog"
|
||||
:title="$t('manage')"
|
||||
:close="triggerConfirmCloseWork"
|
||||
>
|
||||
<WorkNameManagement
|
||||
ref="workNameRef"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue