From 38fba609cbc046c11678bbfc17253cc3f70aa8e9 Mon Sep 17 00:00:00 2001 From: labbomb <739955946@qq.com> Date: Thu, 10 Mar 2022 12:57:08 +0800 Subject: [PATCH] [Feature][UI Next][V1.0.0-Alpha]Unified processing of back-end error messages (#8779) * Unified processing of back-end error messages * Fixed the problem of English and Chinese being unified on the front and back ends * Fix the $message mount problem * Delete messages that are processed separately * Delete all try catch related operations --- .../src/service/service.ts | 17 +- dolphinscheduler-ui-next/src/utils/index.ts | 4 +- dolphinscheduler-ui-next/src/utils/log.ts | 64 ++++++++ .../src/views/datasource/list/use-detail.ts | 55 +++---- .../src/views/datasource/list/use-form.ts | 6 +- .../src/views/datasource/list/use-table.ts | 30 ++-- .../src/views/login/index.tsx | 7 +- .../src/views/login/use-translate.ts | 2 + .../components/node/fields/use-child-node.ts | 22 +-- .../node/fields/use-datasource-type.ts | 28 ++-- .../components/node/fields/use-datasource.ts | 8 +- .../task/components/node/fields/use-datax.ts | 12 +- .../components/node/fields/use-dependent.ts | 62 ++++--- .../node/fields/use-environment-name.ts | 28 ++-- .../task/components/node/fields/use-flink.ts | 16 +- .../task/components/node/fields/use-mr.ts | 16 +- .../node/fields/use-process-name.ts | 22 +-- .../task/components/node/fields/use-rules.ts | 152 ++++++++---------- .../components/node/fields/use-sea-tunnel.ts | 14 +- .../task/components/node/fields/use-shell.ts | 12 +- .../task/components/node/fields/use-spark.ts | 16 +- .../components/node/fields/use-sql-type.ts | 14 +- .../task/components/node/fields/use-sql.ts | 12 +- .../node/fields/use-sqoop-datasource.ts | 20 +-- .../task/components/node/fields/use-switch.ts | 24 ++- .../components/node/fields/use-task-group.ts | 24 ++- .../node/fields/use-worker-group.ts | 10 +- .../projects/task/definition/use-task.ts | 52 +++--- .../components/dag/dag-save-modal.tsx | 3 - .../components/dag/use-custom-cell-builder.ts | 4 +- .../definition/components/use-modal.ts | 54 ++----- .../definition/components/use-table.ts | 6 - .../workflow/definition/create/index.tsx | 3 - .../workflow/definition/detail/index.tsx | 3 - .../workflow/definition/timing/use-table.ts | 3 - .../projects/workflow/definition/use-table.ts | 12 -- .../instance/components/log-modal.tsx | 10 +- .../projects/workflow/instance/use-table.ts | 16 -- .../views/resource/file/create/use-create.ts | 18 +-- .../src/views/resource/file/edit/use-edit.ts | 20 +-- .../views/resource/file/folder/use-folder.ts | 16 +- .../views/resource/file/rename/use-rename.ts | 20 +-- .../views/resource/file/upload/use-upload.ts | 10 +- .../udf/function/components/use-modal.ts | 28 ++-- .../udf/resource/components/use-modal.ts | 26 ++- .../views/resource/udf/resource/use-table.ts | 3 - .../alarm-instance-manage/use-detail.ts | 44 +++-- .../alarm-instance-manage/use-form.ts | 30 ++-- .../alarm-instance-manage/use-table.ts | 49 +++--- 49 files changed, 474 insertions(+), 653 deletions(-) create mode 100644 dolphinscheduler-ui-next/src/utils/log.ts diff --git a/dolphinscheduler-ui-next/src/service/service.ts b/dolphinscheduler-ui-next/src/service/service.ts index 3d9ac1e08b..58d3a5b169 100644 --- a/dolphinscheduler-ui-next/src/service/service.ts +++ b/dolphinscheduler-ui-next/src/service/service.ts @@ -21,9 +21,23 @@ import qs from 'qs' import _ from 'lodash' import cookies from 'js-cookie' import router from '@/router' +import utils from '@/utils' const userStore = useUserStore() +/** + * @description Log and display errors + * @param {Error} error Error object + */ + const handleError = (res: AxiosResponse) => { + // Print to console + if (import.meta.env.MODE === 'development') { + utils.log.capsule('DolphinScheduler', 'UI-NEXT') + utils.log.error(res) + } + window.$message.error(res.data.msg) +} + const baseRequestConfig: AxiosRequestConfig = { baseURL: import.meta.env.MODE === 'development' @@ -76,7 +90,8 @@ service.interceptors.response.use((res: AxiosResponse) => { case 0: return res.data.data default: - throw new Error(`${res.data.msg}: ${res.config.url}`) + handleError(res) + throw new Error() } }, err) diff --git a/dolphinscheduler-ui-next/src/utils/index.ts b/dolphinscheduler-ui-next/src/utils/index.ts index c6a02b2259..2805529def 100644 --- a/dolphinscheduler-ui-next/src/utils/index.ts +++ b/dolphinscheduler-ui-next/src/utils/index.ts @@ -18,11 +18,13 @@ import mapping from './mapping' import regex from './regex' import truncateText from './truncate-text' +import log from './log' const utils = { mapping, regex, - truncateText + truncateText, + log } export default utils diff --git a/dolphinscheduler-ui-next/src/utils/log.ts b/dolphinscheduler-ui-next/src/utils/log.ts new file mode 100644 index 0000000000..cb7cc95412 --- /dev/null +++ b/dolphinscheduler-ui-next/src/utils/log.ts @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const log = { + capsule: (title: string, text: string, type?: string) => {}, + error: (info: any) => {} +} + +/** + * @description Returns the color value of the style + * @param {String} type The style name [ primary | success | warning | error ] + */ +const typeColor = (type = 'primary') => { + let color = '' + switch (type) { + case 'primary': color = '#1890ff'; break + case 'success': color = '#52c41a'; break + case 'warning': color = '#faad14'; break + case 'error': color = '#ff4d4f'; break + default:; break + } + return color +} + +/** + * @description capsule + * @param {String} title title text + * @param {String} text info text + * @param {String} type style + */ + log.capsule = (title: string, text: string, type: string = 'primary') => { + console.log( + `%c ${title} %c ${text} %c`, + 'background:#35495E; padding: 2px ; border-radius: 3px 0 0 3px; color: #fff;', + `background:${typeColor(type)}; padding: 2px; border-radius: 0 3px 3px 0; color: #fff;`, + 'background:transparent' + ) +} + +/** + * @description Prints text in error style + */ +log.error = function (info) { + console.group('error info') + console.log('responseURL: ', `${info.config.baseURL}${info.config.url}`) + console.log('msg: ', info.data.msg) + console.groupEnd() +} + +export default log \ No newline at end of file diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts b/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts index a8d0f33aad..d58fdd5e68 100644 --- a/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts +++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-detail.ts @@ -47,33 +47,22 @@ export function useDetail(getFieldsValue: Function) { const queryById = async (id: number) => { if (status.loading) return {} status.loading = true - try { - const dataSourceRes = await queryDataSource(id) - status.loading = false - PREV_NAME = dataSourceRes.name - return dataSourceRes - } catch (e) { - window.$message.error((e as Error).message) - status.loading = false - return {} - } + const dataSourceRes = await queryDataSource(id) + status.loading = false + PREV_NAME = dataSourceRes.name + return dataSourceRes } const testConnect = async () => { if (status.testing) return status.testing = true - try { - const res = await connectDataSource(formatParams()) - window.$message.success( - res - ? res.msg - : `${t('datasource.test_connect')} ${t('datasource.success')}` - ) - status.testing = false - } catch (e) { - window.$message.error((e as Error).message) - status.testing = false - } + const res = await connectDataSource(formatParams()) + window.$message.success( + res + ? res.msg + : `${t('datasource.test_connect')} ${t('datasource.success')}` + ) + status.testing = false } const createOrUpdate = async (id?: number) => { @@ -81,22 +70,16 @@ export function useDetail(getFieldsValue: Function) { if (status.saving || !values.name) return false status.saving = true - try { - if (PREV_NAME !== values.name) { - await verifyDataSourceName({ name: values.name }) - } + if (PREV_NAME !== values.name) { + await verifyDataSourceName({ name: values.name }) + } - id - ? await updateDataSource(formatParams(), id) - : await createDataSource(formatParams()) + id + ? await updateDataSource(formatParams(), id) + : await createDataSource(formatParams()) - status.saving = false - return true - } catch (e) { - window.$message.error((e as Error).message) - status.saving = false - return false - } + status.saving = false + return true } return { status, queryById, testConnect, createOrUpdate } diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts index 9ea39ad978..575a05ac0b 100644 --- a/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts +++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-form.ts @@ -123,11 +123,7 @@ export function useForm(id?: number) { state.showConnectType = type === 'ORACLE' if (type === 'HIVE' || type === 'SPARK') { - try { - state.showPrincipal = await getKerberosStartupState() - } catch (e) { - window.$message.error((e as Error).message) - } + state.showPrincipal = await getKerberosStartupState() } else { state.showPrincipal = false } diff --git a/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts b/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts index cc64ddb3bc..e8f5846e8d 100644 --- a/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts +++ b/dolphinscheduler-ui-next/src/views/datasource/list/use-table.ts @@ -35,20 +35,14 @@ export function useTable() { if (data.loading) return data.loading = true - try { - const listRes = await queryDataSourceListPaging({ - pageNo: data.page, - pageSize: data.pageSize, - searchVal: data.searchVal - }) - data.loading = false - data.list = listRes.totalList - data.itemCount = listRes.total - } catch (e) { - window.$message.error((e as Error).message) - data.loading = false - data.list = [] - } + const listRes = await queryDataSourceListPaging({ + pageNo: data.page, + pageSize: data.pageSize, + searchVal: data.searchVal + }) + data.loading = false + data.list = listRes.totalList + data.itemCount = listRes.total } const updateList = () => { @@ -59,12 +53,8 @@ export function useTable() { } const deleteRecord = async (id: number) => { - try { - const ignored = await deleteDataSource(id) - updateList() - } catch (e) { - window.$message.error((e as Error).message) - } + const ignored = await deleteDataSource(id) + updateList() } const changePage = (page: number) => { diff --git a/dolphinscheduler-ui-next/src/views/login/index.tsx b/dolphinscheduler-ui-next/src/views/login/index.tsx index 85c0cae33a..30e84bb148 100644 --- a/dolphinscheduler-ui-next/src/views/login/index.tsx +++ b/dolphinscheduler-ui-next/src/views/login/index.tsx @@ -17,16 +17,19 @@ import { defineComponent, toRefs, withKeys } from 'vue' import styles from './index.module.scss' -import { NInput, NButton, NSwitch, NForm, NFormItem } from 'naive-ui' +import { NInput, NButton, NSwitch, NForm, NFormItem, useMessage } from 'naive-ui' import { useForm } from './use-form' import { useTranslate } from './use-translate' import { useLogin } from './use-login' import { useLocalesStore } from '@/store/locales/locales' import { useThemeStore } from '@/store/theme/theme' +import cookies from 'js-cookie' const login = defineComponent({ name: 'login', setup() { + window.$message = useMessage() + const { state, t, locale } = useForm() const { handleChange } = useTranslate(locale) const { handleLogin } = useLogin(state) @@ -37,6 +40,8 @@ const login = defineComponent({ themeStore.setDarkTheme() } + cookies.set('language', localesStore.getLocales, { path: '/' }) + return { t, handleChange, handleLogin, ...toRefs(state), localesStore } }, render() { diff --git a/dolphinscheduler-ui-next/src/views/login/use-translate.ts b/dolphinscheduler-ui-next/src/views/login/use-translate.ts index 868e700a0b..a88ba628a7 100644 --- a/dolphinscheduler-ui-next/src/views/login/use-translate.ts +++ b/dolphinscheduler-ui-next/src/views/login/use-translate.ts @@ -18,6 +18,7 @@ import { WritableComputedRef } from 'vue' import { useLocalesStore } from '@/store/locales/locales' import type { Locales } from '@/store/locales/types' +import cookies from 'js-cookie' export function useTranslate(locale: WritableComputedRef) { const localesStore = useLocalesStore() @@ -25,6 +26,7 @@ export function useTranslate(locale: WritableComputedRef) { const handleChange = (value: Locales) => { locale.value = value localesStore.setLocales(value) + cookies.set('language', locale.value, { path: '/' }) } return { handleChange diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts index 130b476f92..97dbbae256 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-child-node.ts @@ -45,23 +45,17 @@ export function useChildNode({ const getProcessList = async () => { if (loading.value) return loading.value = true - try { - const res = await querySimpleList(projectCode) - options.value = res.map((option: { name: string; code: number }) => ({ - label: option.name, - value: option.code - })) - loading.value = false - } catch (err) { - loading.value = false - } + const res = await querySimpleList(projectCode) + options.value = res.map((option: { name: string; code: number }) => ({ + label: option.name, + value: option.code + })) + loading.value = false } const getProcessListByCode = async (processCode: number) => { if (!processCode) return - try { - const res = await queryProcessDefinitionByCode(processCode, projectCode) - getTaskOptions(res) - } catch (err) {} + const res = await queryProcessDefinitionByCode(processCode, projectCode) + getTaskOptions(res) } const getTaskOptions = (processDefinition: { processTaskRelationList: [] diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts index 13368029d8..8f276b47a0 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource-type.ts @@ -86,22 +86,18 @@ export function useDatasourceType( const getDatasourceTypes = async () => { if (loading.value) return loading.value = true - try { - options.value = datasourceTypes - .filter((item) => { - if (item.disabled) { - return false - } - if (supportedDatasourceType) { - return indexOf(supportedDatasourceType, item.code) !== -1 - } - return true - }) - .map((item) => ({ label: item.code, value: item.code })) - loading.value = false - } catch (err) { - loading.value = false - } + options.value = datasourceTypes + .filter((item) => { + if (item.disabled) { + return false + } + if (supportedDatasourceType) { + return indexOf(supportedDatasourceType, item.code) !== -1 + } + return true + }) + .map((item) => ({ label: item.code, value: item.code })) + loading.value = false } const onChange = (type: string) => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts index 6ed8ab60c8..0c9dfed269 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datasource.ts @@ -35,12 +35,8 @@ export function useDatasource( const getDatasources = async () => { if (loading.value) return loading.value = true - try { - await refreshOptions() - loading.value = false - } catch (err) { - loading.value = false - } + await refreshOptions() + loading.value = false } const refreshOptions = async () => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts index cd18514233..9821ad94f5 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-datax.ts @@ -153,14 +153,10 @@ export function useDataX(model: { [field: string]: any }): IJsonItem[] { const getDatasourceTypes = async () => { if (loading.value) return loading.value = true - try { - datasourceTypeOptions.value = datasourceTypes - .filter((item) => !item.disabled) - .map((item) => ({ label: item.code, value: item.code })) - loading.value = false - } catch (err) { - loading.value = false - } + datasourceTypeOptions.value = datasourceTypes + .filter((item) => !item.disabled) + .map((item) => ({ label: item.code, value: item.code })) + loading.value = false } const getDatasourceInstances = async () => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts index 66f71da2aa..1ff22cb723 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-dependent.ts @@ -157,52 +157,46 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { } const getProjectList = async () => { - try { - const result = await queryProjectCreatedAndAuthorizedByUser() - projectList.value = result.map( - (item: { code: number; name: string }) => ({ - value: item.code, - label: item.name - }) - ) - return projectList - } catch (err) {} + const result = await queryProjectCreatedAndAuthorizedByUser() + projectList.value = result.map( + (item: { code: number; name: string }) => ({ + value: item.code, + label: item.name + }) + ) + return projectList } const getProcessList = async (code: number) => { if (processCache[code]) { return processCache[code] } - try { - const result = await queryAllByProjectCode(code) - const processList = result.map( - (item: { processDefinition: { code: number; name: string } }) => ({ - value: item.processDefinition.code, - label: item.processDefinition.name - }) - ) - processCache[code] = processList + const result = await queryAllByProjectCode(code) + const processList = result.map( + (item: { processDefinition: { code: number; name: string } }) => ({ + value: item.processDefinition.code, + label: item.processDefinition.name + }) + ) + processCache[code] = processList - return processList - } catch (err) {} + return processList } const getTaskList = async (code: number, processCode: number) => { if (taskCache[processCode]) { return taskCache[processCode] } - try { - const result = await getTasksByDefinitionCode(code, processCode) - const taskList = result.map((item: { code: number; name: string }) => ({ - value: item.code, - label: item.name - })) - taskList.unshift({ - value: 0, - label: 'ALL' - }) - taskCache[processCode] = taskList - return taskList - } catch (err) {} + const result = await getTasksByDefinitionCode(code, processCode) + const taskList = result.map((item: { code: number; name: string }) => ({ + value: item.code, + label: item.name + })) + taskList.unshift({ + value: 0, + label: 'ALL' + }) + taskCache[processCode] = taskList + return taskList } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts index 3cb6523ed0..772079d418 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-environment-name.ts @@ -34,22 +34,18 @@ export function useEnvironmentName( const getEnvironmentList = async () => { if (loading.value) return loading.value = true - try { - const res = await queryAllEnvironmentList() - environmentList = res.map( - (item: { code: string; name: string; workerGroups: string[] }) => ({ - label: item.name, - value: item.code, - workerGroups: item.workerGroups - }) - ) - options.value = environmentList.filter((option: IEnvironmentNameOption) => - filterByWorkerGroup(option) - ) - loading.value = false - } catch (err) { - loading.value = false - } + const res = await queryAllEnvironmentList() + environmentList = res.map( + (item: { code: string; name: string; workerGroups: string[] }) => ({ + label: item.name, + value: item.code, + workerGroups: item.workerGroups + }) + ) + options.value = environmentList.filter((option: IEnvironmentNameOption) => + filterByWorkerGroup(option) + ) + loading.value = false } const filterByWorkerGroup = (option: IEnvironmentNameOption) => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts index 1f80b2406b..bbe160b757 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-flink.ts @@ -44,15 +44,13 @@ export function useFlink(model: { [field: string]: any }): IJsonItem[] { mainJarOptions.value = resources[programType] return } - try { - const res = await queryResourceByProgramType({ - type: 'FILE', - programType - }) - removeUselessChildren(res) - mainJarOptions.value = res || [] - resources[programType] = res - } catch (err) {} + const res = await queryResourceByProgramType({ + type: 'FILE', + programType + }) + removeUselessChildren(res) + mainJarOptions.value = res || [] + resources[programType] = res } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts index a13f32e84e..68313443e0 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-mr.ts @@ -37,15 +37,13 @@ export function useMr(model: { [field: string]: any }): IJsonItem[] { mainJarOptions.value = resources[programType] return } - try { - const res = await queryResourceByProgramType({ - type: 'FILE', - programType - }) - removeUselessChildren(res) - mainJarOptions.value = res || [] - resources[programType] = res - } catch (err) {} + const res = await queryResourceByProgramType({ + type: 'FILE', + programType + }) + removeUselessChildren(res) + mainJarOptions.value = res || [] + resources[programType] = res } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts index b07e055baa..8997e5cb6c 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-process-name.ts @@ -47,23 +47,17 @@ export function useProcessName({ const getProcessList = async () => { if (loading.value) return loading.value = true - try { - const res = await querySimpleList(projectCode) - options.value = res.map((option: { name: string; code: number }) => ({ - label: option.name, - value: option.code - })) - loading.value = false - } catch (err) { - loading.value = false - } + const res = await querySimpleList(projectCode) + options.value = res.map((option: { name: string; code: number }) => ({ + label: option.name, + value: option.code + })) + loading.value = false } const getProcessListByCode = async (processCode: number) => { if (!processCode) return - try { - const res = await queryProcessDefinitionByCode(processCode, projectCode) - getTaskOptions(res) - } catch (err) {} + const res = await queryProcessDefinitionByCode(processCode, projectCode) + getTaskOptions(res) } const getTaskOptions = (processDefinition: { processTaskRelationList: [] diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts index 51653eb950..b7bb88faf6 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-rules.ts @@ -47,38 +47,30 @@ export function useRules( const getRuleList = async () => { if (ruleLoading.value) return ruleLoading.value = true - try { - const result = await queryRuleList() - rules.value = result.map((item: { id: number; name: string }) => { - let name = '' - if (item.name) { - name = item.name.replace('$t(', '').replace(')', '') - } - return { - value: item.id, - label: name ? t(`project.node.${name}`) : '' - } - }) - ruleLoading.value = false - } catch (err) { - ruleLoading.value = false - } + const result = await queryRuleList() + rules.value = result.map((item: { id: number; name: string }) => { + let name = '' + if (item.name) { + name = item.name.replace('$t(', '').replace(')', '') + } + return { + value: item.id, + label: name ? t(`project.node.${name}`) : '' + } + }) + ruleLoading.value = false } const getRuleById = async (ruleId: number) => { if (ruleLoading.value) return ruleLoading.value = true - try { - const result = await getRuleFormCreateJson(ruleId) - const items = JSON.parse(result).map((item: IResponseJsonItem) => - formatResponseJson(item) - ) - updateRules(items, preItemLen) - preItemLen = items.length - ruleLoading.value = false - } catch (err) { - ruleLoading.value = false - } + const result = await getRuleFormCreateJson(ruleId) + const items = JSON.parse(result).map((item: IResponseJsonItem) => + formatResponseJson(item) + ) + updateRules(items, preItemLen) + preItemLen = items.length + ruleLoading.value = false } const formatResponseJson = ( @@ -138,60 +130,58 @@ export function useRules( } const onFieldChange = async (value: string | number, field: string) => { - try { - if (field === 'src_connector_type' && typeof value === 'number') { - const result = await getDatasourceOptionsById(value) - srcDatasourceOptions.value = result || [] - srcTableOptions.value = [] - model.src_datasource_id = null - model.src_table = null - model.src_field = null - return - } - if (field === 'target_connector_type' && typeof value === 'number') { - const result = await getDatasourceOptionsById(value) - targetDatasourceOptions.value = result || [] - targetTableOptions.value = [] - model.target_datasource_id = null - model.target_table = null - model.target_field = null - return - } - if (field === 'writer_connector_type' && typeof value === 'number') { - const result = await getDatasourceOptionsById(value) - writerDatasourceOptions.value = result || [] - model.writer_datasource_id = null - return - } - if (field === 'src_datasource_id' && typeof value === 'number') { - const result = await getDatasourceTablesById(value) - srcTableOptions.value = result || [] - model.src_table = null - model.src_field = null - } - if (field === 'target_datasource_id' && typeof value === 'number') { - const result = await getDatasourceTablesById(value) - targetTableOptions.value = result || [] - model.target_table = null - model.target_field = null - } - if (field === 'src_table' && typeof value === 'string') { - const result = await getDatasourceTableColumnsById( - model.src_datasource_id, - value - ) - srcTableColumnOptions.value = result || [] - model.src_field = null - } - if (field === 'target_table' && typeof value === 'string') { - const result = await getDatasourceTableColumnsById( - model.target_datasource_id, - value - ) - targetTableColumnOptions.value = result || [] - model.target_field = null - } - } catch (err) {} + if (field === 'src_connector_type' && typeof value === 'number') { + const result = await getDatasourceOptionsById(value) + srcDatasourceOptions.value = result || [] + srcTableOptions.value = [] + model.src_datasource_id = null + model.src_table = null + model.src_field = null + return + } + if (field === 'target_connector_type' && typeof value === 'number') { + const result = await getDatasourceOptionsById(value) + targetDatasourceOptions.value = result || [] + targetTableOptions.value = [] + model.target_datasource_id = null + model.target_table = null + model.target_field = null + return + } + if (field === 'writer_connector_type' && typeof value === 'number') { + const result = await getDatasourceOptionsById(value) + writerDatasourceOptions.value = result || [] + model.writer_datasource_id = null + return + } + if (field === 'src_datasource_id' && typeof value === 'number') { + const result = await getDatasourceTablesById(value) + srcTableOptions.value = result || [] + model.src_table = null + model.src_field = null + } + if (field === 'target_datasource_id' && typeof value === 'number') { + const result = await getDatasourceTablesById(value) + targetTableOptions.value = result || [] + model.target_table = null + model.target_field = null + } + if (field === 'src_table' && typeof value === 'string') { + const result = await getDatasourceTableColumnsById( + model.src_datasource_id, + value + ) + srcTableColumnOptions.value = result || [] + model.src_field = null + } + if (field === 'target_table' && typeof value === 'string') { + const result = await getDatasourceTableColumnsById( + model.target_datasource_id, + value + ) + targetTableColumnOptions.value = result || [] + model.target_field = null + } } onMounted(async () => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts index c8dfdb6d14..b67112c515 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sea-tunnel.ts @@ -55,15 +55,11 @@ export function useSeaTunnel(model: { [field: string]: any }): IJsonItem[] { const getResourceList = async () => { if (loading.value) return loading.value = true - try { - model.resourceFiles = [] - const res = await queryResourceList({ type: 'FILE' }) - removeUselessChildren(res) - options.value = res || [] - loading.value = false - } catch (err) { - loading.value = false - } + model.resourceFiles = [] + const res = await queryResourceList({ type: 'FILE' }) + removeUselessChildren(res) + options.value = res || [] + loading.value = false } function removeUselessChildren( diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts index c36933b5c4..3b54567d0d 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-shell.ts @@ -29,14 +29,10 @@ export function useShell(model: { [field: string]: any }): IJsonItem[] { const getResourceList = async () => { if (loading.value) return loading.value = true - try { - const res = await queryResourceList({ type: 'FILE' }) - removeUselessChildren(res) - options.value = res || [] - loading.value = false - } catch (err) { - loading.value = false - } + const res = await queryResourceList({ type: 'FILE' }) + removeUselessChildren(res) + options.value = res || [] + loading.value = false } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts index c6f87ee1ec..4eddb7173b 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-spark.ts @@ -44,15 +44,13 @@ export function useSpark(model: { [field: string]: any }): IJsonItem[] { mainJarOptions.value = resources[programType] return } - try { - const res = await queryResourceByProgramType({ - type: 'FILE', - programType - }) - removeUselessChildren(res) - mainJarOptions.value = res || [] - resources[programType] = res - } catch (err) {} + const res = await queryResourceByProgramType({ + type: 'FILE', + programType + }) + removeUselessChildren(res) + mainJarOptions.value = res || [] + resources[programType] = res } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts index c005f9ea57..e5740487bf 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql-type.ts @@ -39,15 +39,11 @@ export function useSqlType(unusedModel: { [field: string]: any }): IJsonItem { const getSqlTypes = async () => { if (loading.value) return loading.value = true - try { - options.value = sqlTypes.map((item) => ({ - label: item.code, - value: item.id - })) - loading.value = false - } catch (err) { - loading.value = false - } + options.value = sqlTypes.map((item) => ({ + label: item.code, + value: item.id + })) + loading.value = false } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts index 21e67af624..fc10d08119 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sql.ts @@ -28,14 +28,10 @@ export function useSql(model: { [field: string]: any }): IJsonItem[] { const getResourceList = async () => { if (loading.value) return loading.value = true - try { - const res = await queryResourceList({ type: 'FILE' }) - removeUselessChildren(res) - options.value = res || [] - loading.value = false - } catch (err) { - loading.value = false - } + const res = await queryResourceList({ type: 'FILE' }) + removeUselessChildren(res) + options.value = res || [] + loading.value = false } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts index 5904fe3ea4..613a6b6155 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts @@ -33,18 +33,14 @@ export function useDatasource( const getDataSource = async (type: IDataBase) => { if (loading.value) return loading.value = true - try { - const result = await queryDataSourceList({ type }) - dataSourceList.value = result.map( - (item: { name: string; id: number }) => ({ - label: item.name, - value: item.id - }) - ) - loading.value = false - } catch (err) { - loading.value = false - } + const result = await queryDataSourceList({ type }) + dataSourceList.value = result.map( + (item: { name: string; id: number }) => ({ + label: item.name, + value: item.id + }) + ) + loading.value = false } onMounted(() => { getDataSource('MYSQL') diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts index a58b8bcb9a..d65d77ac14 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-switch.ts @@ -32,20 +32,16 @@ export function useSwitch( if (loading.value) return loading.value = true branchFlowOptions.value = [] - try { - const res = await queryProcessDefinitionByCode( - model.processName, - projectCode - ) - res?.taskDefinitionList.forEach((item: any) => { - if (item.code != model.code) { - branchFlowOptions.value.push({ label: item.name, value: item.code }) - } - }) - loading.value = false - } catch (err) { - loading.value = false - } + const res = await queryProcessDefinitionByCode( + model.processName, + projectCode + ) + res?.taskDefinitionList.forEach((item: any) => { + if (item.code != model.code) { + branchFlowOptions.value.push({ label: item.name, value: item.code }) + } + }) + loading.value = false } watch( diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts index 7f607bfe50..f22dba5523 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-task-group.ts @@ -33,20 +33,16 @@ export function useTaskGroup( const getTaskGroupList = async () => { if (loading.value) return loading.value = true - try { - const { totalList = [] } = await queryTaskGroupListPagingByProjectCode({ - pageNo: 1, - pageSize: 2147483647, - projectCode - }) - options.value = totalList.map((item: { id: string; name: string }) => ({ - label: item.name, - value: item.id - })) - loading.value = false - } catch (err) { - loading.value = false - } + const { totalList = [] } = await queryTaskGroupListPagingByProjectCode({ + pageNo: 1, + pageSize: 2147483647, + projectCode + }) + options.value = totalList.map((item: { id: string; name: string }) => ({ + label: item.name, + value: item.id + })) + loading.value = false } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts index b37152af29..d06e8b7ec3 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/fields/use-worker-group.ts @@ -29,13 +29,9 @@ export function useWorkerGroup(): IJsonItem { const getWorkerGroups = async () => { if (loading.value) return loading.value = true - try { - const res = await queryAllWorkerGroups() - options.value = res.map((item: string) => ({ label: item, value: item })) - loading.value = false - } catch (err) { - loading.value = false - } + const res = await queryAllWorkerGroups() + options.value = res.map((item: string) => ({ label: item, value: item })) + loading.value = false } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts b/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts index 69e64cadec..9b8e53758b 100644 --- a/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts +++ b/dolphinscheduler-ui-next/src/views/projects/task/definition/use-task.ts @@ -60,42 +60,32 @@ export function useTask(projectCode: number) { task.taskShow = show } const onTaskSave = async (data: INodeData) => { - try { - if (task.taskSaving) return - task.taskSaving = true - if (data.id) { - data.code && - (await updateWithUpstream( - projectCode, - data.code, - formatParams({ ...data, code: data.code }, false) - )) - } else { - const taskCode = await getTaskCode() - await saveSingle( + if (task.taskSaving) return + task.taskSaving = true + if (data.id) { + data.code && + (await updateWithUpstream( projectCode, - formatParams({ ...data, code: taskCode }, true) - ) - } - - task.taskSaving = false - return true - } catch (e) { - window.$message.error((e as Error).message) - task.taskSaving = false - return false + data.code, + formatParams({ ...data, code: data.code }, false) + )) + } else { + const taskCode = await getTaskCode() + await saveSingle( + projectCode, + formatParams({ ...data, code: taskCode }, true) + ) } + + task.taskSaving = false + return true } const onEditTask = async (row: IRecord, readonly: boolean) => { - try { - const result = await queryTaskDefinitionByCode(row.taskCode, projectCode) - task.taskData = { ...result, processName: row.processDefinitionCode } - task.taskShow = true - task.taskReadonly = readonly - } catch (e) { - window.$message.error((e as Error).message) - } + const result = await queryTaskDefinitionByCode(row.taskCode, projectCode) + task.taskData = { ...result, processName: row.processDefinitionCode } + task.taskShow = true + task.taskReadonly = readonly } const onInitTask = () => { diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx index 8c83650960..b25ad7fa3a 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx @@ -133,9 +133,6 @@ export default defineComponent({ ) { verifyName(params, projectCode) .then(() => context.emit('save', formValue.value)) - .catch((error: any) => { - window.$message.error(error.message) - }) } else { context.emit('save', formValue.value) } diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts index d040993efe..db5c1bc59e 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-custom-cell-builder.ts @@ -29,9 +29,7 @@ export function useCustomCellBuilder() { function parseLocationStr(locationStr: string) { let locations = null if (!locationStr) return locations - try { - locations = JSON.parse(locationStr) - } catch (error) {} + locations = JSON.parse(locationStr) return Array.isArray(locations) ? locations : null } diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts index 750319d617..8238a3af04 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts @@ -61,18 +61,14 @@ export function useModal( const handleImportDefinition = () => { state.importFormRef.validate(async (valid: any) => { if (!valid) { - try { - const formData = new FormData() - formData.append('file', state.importForm.file) - const code = Number(router.currentRoute.value.params.projectCode) - await importProcessDefinition(formData, code) - window.$message.success(t('project.workflow.success')) - ctx.emit('updateList') - ctx.emit('update:show') - resetImportForm() - } catch (error: any) { - window.$message.error(error.message) - } + const formData = new FormData() + formData.append('file', state.importForm.file) + const code = Number(router.currentRoute.value.params.projectCode) + await importProcessDefinition(formData, code) + window.$message.success(t('project.workflow.success')) + ctx.emit('updateList') + ctx.emit('update:show') + resetImportForm() } }) } @@ -103,14 +99,10 @@ export function useModal( ? JSON.stringify(startParams) : '' - try { await startProcessInstance(state.startForm, variables.projectCode) window.$message.success(t('project.workflow.success')) ctx.emit('updateList') ctx.emit('update:show') - } catch (error: any) { - window.$message.error(error.message) - } } }) } @@ -121,14 +113,10 @@ export function useModal( const data: any = getTimingData() data.processDefinitionCode = code - try { - await createSchedule(data, variables.projectCode) - window.$message.success(t('project.workflow.success')) - ctx.emit('updateList') - ctx.emit('update:show') - } catch (error: any) { - window.$message.error(error.message) - } + await createSchedule(data, variables.projectCode) + window.$message.success(t('project.workflow.success')) + ctx.emit('updateList') + ctx.emit('update:show') } }) } @@ -139,14 +127,10 @@ export function useModal( const data: any = getTimingData() data.id = id - try { - await updateSchedule(data, variables.projectCode, id) - window.$message.success(t('project.workflow.success')) - ctx.emit('updateList') - ctx.emit('update:show') - } catch (error: any) { - window.$message.error(error.message) - } + await updateSchedule(data, variables.projectCode, id) + window.$message.success(t('project.workflow.success')) + ctx.emit('updateList') + ctx.emit('update:show') } }) } @@ -214,9 +198,6 @@ export function useModal( .then((res: any) => { variables.startParamsList = res.processDefinition.globalParamList }) - .catch((error: any) => { - window.$message.error(error.message) - }) } const getPreviewSchedule = () => { @@ -242,9 +223,6 @@ export function useModal( .then((res: any) => { variables.schedulePreviewList = res }) - .catch((error: any) => { - window.$message.error(error.message) - }) } }) } diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts index 2f1b0d9953..027c911ef1 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-table.ts @@ -178,9 +178,6 @@ export function useTable( ctx.emit('updateList') getTableData(variables.row) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } const handleDeleteVersion = (version: number) => { @@ -190,9 +187,6 @@ export function useTable( ctx.emit('updateList') getTableData(variables.row) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } return { diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx index 90974a9abd..43846062ea 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx @@ -80,9 +80,6 @@ export default defineComponent({ message.success(t('project.dag.success')) router.push({ path: `/projects/${projectCode}/workflow-definition` }) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } return () => ( diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx index d80a26afbd..2e19ead249 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx @@ -99,9 +99,6 @@ export default defineComponent({ message.success(t('project.dag.success')) router.push({ path: `/projects/${projectCode}/workflow-definition` }) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } onMounted(() => { diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts index 67615478cf..4c4b2d01a9 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/timing/use-table.ts @@ -262,9 +262,6 @@ export function useTable() { searchVal: variables.searchVal }) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } return { diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts index 956687d53b..547381b3a9 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts @@ -200,9 +200,6 @@ export function useTable() { searchVal: variables.searchVal }) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } const releaseWorkflow = (row: any) => { @@ -221,9 +218,6 @@ export function useTable() { searchVal: variables.searchVal }) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } const copyWorkflow = (row: any) => { @@ -240,9 +234,6 @@ export function useTable() { searchVal: variables.searchVal }) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } const downloadBlob = (data: any, fileNameS = 'json') => { @@ -280,9 +271,6 @@ export function useTable() { .then((res: any) => { downloadBlob(res, fileName) }) - .catch((error: any) => { - window.$message.error(error.message) - }) } const gotoTimingManage = (row: any) => { diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx index 68119ed5ac..1b328ac165 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/instance/components/log-modal.tsx @@ -96,10 +96,6 @@ export default defineComponent({ }, 1500) textareaLog.value.innerHTML = res || t('project.workflow.no_log') }) - .catch((error: any) => { - window.$message.error(error.message || '') - loadingRef.value = false - }) } const showLog = () => { @@ -126,9 +122,6 @@ export default defineComponent({ }, 800) } }) - .catch((error: any) => { - window.$message.error(error.message || '') - }) } const initLog = () => { @@ -259,7 +252,7 @@ export default defineComponent({ render() { return (
- + {this.taskInstanceId && this.taskInstanceType !== 'SUB_PROCESS' && ( {renderSlot(this.$slots, 'history')} @@ -349,7 +342,6 @@ export default defineComponent({