mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-18 13:29:03 +08:00
fix: 修改删除指令
This commit is contained in:
parent
e5da0736a6
commit
f3c23d8b06
3 changed files with 22 additions and 10 deletions
|
|
@ -18,6 +18,6 @@ ErrNotSupportType: "系统暂不支持当前类型: {{ .detail }}"
|
||||||
ErrNameIsExist: "名称已存在"
|
ErrNameIsExist: "名称已存在"
|
||||||
|
|
||||||
#app
|
#app
|
||||||
ErrPortInUsed: "{{ .detail }} 已被占用!"
|
ErrPortInUsed: "{{ .detail }} 端口已被占用!"
|
||||||
ErrAppLimit: "应用超出安装数量限制"
|
ErrAppLimit: "应用超出安装数量限制"
|
||||||
ErrAppRequired: "请先安装 {{ .detail }} 应用"
|
ErrAppRequired: "请先安装 {{ .detail }} 应用"
|
||||||
|
|
@ -20,18 +20,29 @@ export const useDeleteData = <P = any, R = any>(
|
||||||
ElMessageBox.confirm(i18n.global.t(`${message}`) + '?', i18n.global.t('commons.msg.deleteTitle'), {
|
ElMessageBox.confirm(i18n.global.t(`${message}`) + '?', i18n.global.t('commons.msg.deleteTitle'), {
|
||||||
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
confirmButtonText: i18n.global.t('commons.button.confirm'),
|
||||||
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
cancelButtonText: i18n.global.t('commons.button.cancel'),
|
||||||
|
closeOnClickModal: false,
|
||||||
|
closeOnPressEscape: false,
|
||||||
|
showClose: false,
|
||||||
type: confirmType,
|
type: confirmType,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
})
|
beforeClose: async (action, instance, done) => {
|
||||||
.then(async () => {
|
if (action === 'confirm') {
|
||||||
|
instance.confirmButtonLoading = true;
|
||||||
|
instance.cancelButtonLoading = true;
|
||||||
const res = await api(params);
|
const res = await api(params);
|
||||||
|
done();
|
||||||
if (!res) return reject(false);
|
if (!res) return reject(false);
|
||||||
|
resolve(true);
|
||||||
ElMessage({
|
ElMessage({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: i18n.global.t('commons.msg.operationSuccess'),
|
message: i18n.global.t('commons.msg.operationSuccess'),
|
||||||
});
|
});
|
||||||
resolve(true);
|
} else {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
.then(() => {})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ const openOperate = (row: any, op: string) => {
|
||||||
checkRef.value.acceptParams({ items: items });
|
checkRef.value.acceptParams({ items: items });
|
||||||
} else {
|
} else {
|
||||||
await useDeleteData(InstalledOp, operateReq, 'app.deleteWarn');
|
await useDeleteData(InstalledOp, operateReq, 'app.deleteWarn');
|
||||||
|
search();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue