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" />
|
<slot name="title-after" />
|
||||||
</div>
|
</div>
|
||||||
<slot name="after">
|
<slot name="after">
|
||||||
<CancelButton icon-only v-close-popup />
|
<CancelButton id="btn-form-close" icon-only v-close-popup />
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -1156,12 +1156,12 @@ function confirmDeleteWork(id: string, noDialog?: boolean) {
|
||||||
if (noDialog) {
|
if (noDialog) {
|
||||||
deleteWork(id);
|
deleteWork(id);
|
||||||
} else {
|
} else {
|
||||||
const currUseName =
|
const currUseName = workItems.value?.map((v) => v.name) || [];
|
||||||
service.value?.map((v) => v.work.map((x) => x.name)).flat() || [];
|
|
||||||
const deleteTarget = workNameItems.value.find(
|
const deleteTarget = workNameItems.value.find(
|
||||||
(v: { id: string }) => v.id === id,
|
(v: { id: string }) => v.id === id,
|
||||||
).name;
|
);
|
||||||
const isNameInUse = currUseName.includes(deleteTarget);
|
if (!deleteTarget) return;
|
||||||
|
const isNameInUse = currUseName.includes(deleteTarget.name);
|
||||||
|
|
||||||
dialog({
|
dialog({
|
||||||
color: 'negative',
|
color: 'negative',
|
||||||
|
|
@ -1169,7 +1169,7 @@ function confirmDeleteWork(id: string, noDialog?: boolean) {
|
||||||
title: t('dialog.title.confirmDelete'),
|
title: t('dialog.title.confirmDelete'),
|
||||||
actionText: t('general.delete'),
|
actionText: t('general.delete'),
|
||||||
message: isNameInUse
|
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'),
|
: t('dialog.message.confirmDelete'),
|
||||||
action: async () => {
|
action: async () => {
|
||||||
deleteWork(id);
|
deleteWork(id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue