Merge branch 'refs/heads/1.1.0-beta3' into preview
This commit is contained in:
commit
eed4d14096
@ -1,40 +1,46 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
import { useAuthStore } from '@/store/modules/auth';
|
import { useAuthStore } from '@/store/modules/auth';
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
|
|
||||||
const type = defineModel<'job-task' | 'retry-scene' | 'workflow-task'>('type', { required: true });
|
const type = route.name as string;
|
||||||
|
|
||||||
const text = computed(() => {
|
const text = computed(() => {
|
||||||
if (type.value === 'job-task') {
|
if (type === 'job_task') {
|
||||||
return '删除前请检查待删除定时任务是存在通知配置或者工作流任务';
|
return '删除前请检查待删除定时任务是存在通知配置或者工作流任务;';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.value === 'retry-scene') {
|
if (type === 'retry_scene') {
|
||||||
return '删除前请检查待删除重试场景是存在通知配置或者重试任务';
|
return '删除前请检查待删除重试场景是存在通知配置或者重试任务;';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.value === 'workflow-task') {
|
if (type === 'workflow_task') {
|
||||||
return '删除前请检查待删除工作流任务是存在通知配置';
|
return '删除前请检查待删除工作流任务是存在通知配置;';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === 'notify_recipient') {
|
||||||
|
return '删除前请检查通知配置是存在关联通知人;';
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
const show = computed(() => authStore.getDeleteAlert(type.value));
|
const show = computed(() => authStore.getDeleteAlert(type) !== false);
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
authStore.setDeleteAlert(type.value, false);
|
authStore.setDeleteAlert(type, false);
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NAlert v-if="text && show" :show-icon="false" type="warning" closable @close="handleClose">
|
<NAlert v-if="show" :show-icon="false" type="warning" closable @close="handleClose">
|
||||||
<div class="color-warning font-500">
|
<div class="color-warning font-500">
|
||||||
<!-- <span class="font-600">提示:</span> -->
|
<!-- <span class="font-600">提示:</span> -->
|
||||||
📢 {{ text }};该删除为
|
📢 {{ text }}该删除为
|
||||||
<span class="color-error font-600">物理删除</span>
|
<span class="color-error font-600">物理删除</span>
|
||||||
,删除后不可恢复,必要时可以先导出备份
|
,删除后不可恢复,必要时可以先导出备份
|
||||||
</div>
|
</div>
|
||||||
@ -44,13 +50,10 @@ const handleClose = () => {
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.n-alert {
|
.n-alert {
|
||||||
--n-padding: 5px 13px !important;
|
--n-padding: 5px 13px !important;
|
||||||
--n-close-margin: 0 13px 0 0 !important;
|
--n-close-margin: 5px 13px 0 0 !important;
|
||||||
|
|
||||||
:deep(.n-alert__close) {
|
:deep(.n-alert-body) {
|
||||||
display: flex;
|
padding-right: calc(var(--n-close-size) + 15px);
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
height: 100% !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -36,11 +36,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
roles: [],
|
roles: [],
|
||||||
buttons: [],
|
buttons: [],
|
||||||
namespaceIds: [],
|
namespaceIds: [],
|
||||||
deleteAlert: {
|
deleteAlert: {}
|
||||||
'job-task': true,
|
|
||||||
'retry-scene': true,
|
|
||||||
'workflow-task': true
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/** is super role in static route */
|
/** is super role in static route */
|
||||||
@ -184,12 +180,12 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
|
|||||||
localStg.set('namespaceId', namespaceId);
|
localStg.set('namespaceId', namespaceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setDeleteAlert(type: Api.Auth.DeleteAlertType, value: boolean) {
|
function setDeleteAlert(type: string, value: boolean) {
|
||||||
userInfo.deleteAlert[type] = value;
|
userInfo.deleteAlert[type] = value;
|
||||||
localStg.set('deleteAlert', userInfo.deleteAlert);
|
localStg.set('deleteAlert', userInfo.deleteAlert);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDeleteAlert(type: Api.Auth.DeleteAlertType) {
|
function getDeleteAlert(type: string) {
|
||||||
const deleteAlert = localStg.get('deleteAlert') || userInfo.deleteAlert;
|
const deleteAlert = localStg.get('deleteAlert') || userInfo.deleteAlert;
|
||||||
return deleteAlert[type];
|
return deleteAlert[type];
|
||||||
}
|
}
|
||||||
|
2
src/typings/api.d.ts
vendored
2
src/typings/api.d.ts
vendored
@ -143,7 +143,7 @@ declare namespace Api {
|
|||||||
buttons: string[];
|
buttons: string[];
|
||||||
namespaceIds: NamespaceId[];
|
namespaceIds: NamespaceId[];
|
||||||
deleteAlert: {
|
deleteAlert: {
|
||||||
[key in DeleteAlertType]: boolean;
|
[key: string]: boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
src/typings/storage.d.ts
vendored
2
src/typings/storage.d.ts
vendored
@ -50,7 +50,7 @@ declare namespace StorageType {
|
|||||||
data: Api.JobLog.JobMessage[];
|
data: Api.JobLog.JobMessage[];
|
||||||
};
|
};
|
||||||
deleteAlert: {
|
deleteAlert: {
|
||||||
[key in Api.Auth.DeleteAlertType]: boolean;
|
[key: string]: boolean;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,6 +192,7 @@ function handleExport() {
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||||
<GroupSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
<GroupSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
||||||
|
<DeleteAlert />
|
||||||
<NCard
|
<NCard
|
||||||
:title="$t('page.groupConfig.title')"
|
:title="$t('page.groupConfig.title')"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
|
@ -281,7 +281,7 @@ function handleExport() {
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||||
<JobTaskSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
<JobTaskSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
||||||
<DeleteAlert type="job-task" />
|
<DeleteAlert />
|
||||||
<NCard
|
<NCard
|
||||||
:title="$t('page.jobTask.title')"
|
:title="$t('page.jobTask.title')"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
@ -294,6 +294,7 @@ function handleExport() {
|
|||||||
v-model:columns="columnChecks"
|
v-model:columns="columnChecks"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:disabled-delete="checkedRowKeys.length === 0"
|
:disabled-delete="checkedRowKeys.length === 0"
|
||||||
|
:show-delete="hasAuth('R_ADMIN')"
|
||||||
@add="handleAdd"
|
@add="handleAdd"
|
||||||
@delete="handleBatchDelete"
|
@delete="handleBatchDelete"
|
||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
|
@ -135,6 +135,7 @@ async function handleDelete(uniqueId: string) {
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||||
<NamespaceSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
<NamespaceSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
||||||
|
<DeleteAlert />
|
||||||
<NCard
|
<NCard
|
||||||
:title="$t('page.namespace.title')"
|
:title="$t('page.namespace.title')"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
|
@ -218,6 +218,7 @@ function edit(id: string) {
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||||
<NotifyConfigSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
<NotifyConfigSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
||||||
|
<DeleteAlert />
|
||||||
<NCard
|
<NCard
|
||||||
:title="$t('page.notifyConfig.title')"
|
:title="$t('page.notifyConfig.title')"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
@ -230,6 +231,7 @@ function edit(id: string) {
|
|||||||
v-model:columns="columnChecks"
|
v-model:columns="columnChecks"
|
||||||
:disabled-delete="checkedRowKeys.length === 0"
|
:disabled-delete="checkedRowKeys.length === 0"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:show-delete="hasAuth('R_ADMIN')"
|
||||||
@add="handleAdd"
|
@add="handleAdd"
|
||||||
@delete="handleBatchDelete"
|
@delete="handleBatchDelete"
|
||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
|
@ -154,6 +154,7 @@ function handleExport() {
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||||
<NotifyRecipientSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
<NotifyRecipientSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
||||||
|
<DeleteAlert />
|
||||||
<NCard
|
<NCard
|
||||||
:title="$t('page.notifyRecipient.title')"
|
:title="$t('page.notifyRecipient.title')"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
@ -166,6 +167,7 @@ function handleExport() {
|
|||||||
v-model:columns="columnChecks"
|
v-model:columns="columnChecks"
|
||||||
:disabled-delete="checkedRowKeys.length === 0"
|
:disabled-delete="checkedRowKeys.length === 0"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:show-delete="hasAuth('R_ADMIN')"
|
||||||
@add="handleAdd"
|
@add="handleAdd"
|
||||||
@delete="handleBatchDelete"
|
@delete="handleBatchDelete"
|
||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
|
@ -238,7 +238,7 @@ function handleExport() {
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||||
<SceneSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
<SceneSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
||||||
<DeleteAlert type="retry-scene" />
|
<DeleteAlert />
|
||||||
<NCard
|
<NCard
|
||||||
:title="$t('page.retryScene.title')"
|
:title="$t('page.retryScene.title')"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
@ -251,6 +251,7 @@ function handleExport() {
|
|||||||
v-model:columns="columnChecks"
|
v-model:columns="columnChecks"
|
||||||
:disabled-delete="checkedRowKeys.length === 0"
|
:disabled-delete="checkedRowKeys.length === 0"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
|
:show-delete="hasAuth('R_ADMIN')"
|
||||||
@add="handleAdd"
|
@add="handleAdd"
|
||||||
@delete="handleBatchDelete"
|
@delete="handleBatchDelete"
|
||||||
@refresh="getData"
|
@refresh="getData"
|
||||||
|
@ -282,7 +282,7 @@ function goToBatch(workflowId: string) {
|
|||||||
<template>
|
<template>
|
||||||
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
<div class="min-h-500px flex-col-stretch gap-16px overflow-hidden lt-sm:overflow-auto">
|
||||||
<WorkflowSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
<WorkflowSearch v-model:model="searchParams" @reset="resetSearchParams" @search="getData" />
|
||||||
<DeleteAlert type="workflow-task" />
|
<DeleteAlert />
|
||||||
<NCard
|
<NCard
|
||||||
:title="$t('page.workflow.title')"
|
:title="$t('page.workflow.title')"
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
|
Loading…
Reference in New Issue
Block a user