refactor: add id close btn & delete work name
This commit is contained in:
parent
1a27674928
commit
fdc5781434
2 changed files with 6 additions and 6 deletions
|
|
@ -15,7 +15,7 @@ defineProps<{
|
|||
<slot name="title-after" />
|
||||
</div>
|
||||
<slot name="after">
|
||||
<CancelButton icon-only v-close-popup />
|
||||
<CancelButton id="btn-form-close" icon-only v-close-popup />
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1156,12 +1156,12 @@ function confirmDeleteWork(id: string, noDialog?: boolean) {
|
|||
if (noDialog) {
|
||||
deleteWork(id);
|
||||
} else {
|
||||
const currUseName =
|
||||
service.value?.map((v) => v.work.map((x) => x.name)).flat() || [];
|
||||
const currUseName = workItems.value?.map((v) => v.name) || [];
|
||||
const deleteTarget = workNameItems.value.find(
|
||||
(v: { id: string }) => v.id === id,
|
||||
).name;
|
||||
const isNameInUse = currUseName.includes(deleteTarget);
|
||||
);
|
||||
if (!deleteTarget) return;
|
||||
const isNameInUse = currUseName.includes(deleteTarget.name);
|
||||
|
||||
dialog({
|
||||
color: 'negative',
|
||||
|
|
@ -1169,7 +1169,7 @@ function confirmDeleteWork(id: string, noDialog?: boolean) {
|
|||
title: t('dialog.title.confirmDelete'),
|
||||
actionText: t('general.delete'),
|
||||
message: isNameInUse
|
||||
? `${t('dialog.message.beingUse', { msg: deleteTarget })} ${t('dialog.message.confirmDelete')}`
|
||||
? `${t('dialog.message.beingUse', { msg: deleteTarget.name })} ${t('dialog.message.confirmDelete')}`
|
||||
: t('dialog.message.confirmDelete'),
|
||||
action: async () => {
|
||||
deleteWork(id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue