Browse Source

fix ui build error (#15732)

dev_wenjun_refactorMaster
xiangzihao 9 months ago committed by GitHub
parent
commit
faa794c39b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      dolphinscheduler-ui/src/common/common.ts
  2. 2
      dolphinscheduler-ui/src/components/chart/modules/Bar.tsx
  3. 8
      dolphinscheduler-ui/src/components/chart/modules/Gauge.tsx
  4. 8
      dolphinscheduler-ui/src/layouts/content/use-dataList.ts
  5. 39
      dolphinscheduler-ui/src/locales/en_US/project.ts
  6. 14
      dolphinscheduler-ui/src/locales/en_US/security.ts
  7. 31
      dolphinscheduler-ui/src/locales/zh_CN/project.ts
  8. 14
      dolphinscheduler-ui/src/locales/zh_CN/security.ts
  9. 7
      dolphinscheduler-ui/src/service/modules/lineages/index.ts
  10. 4
      dolphinscheduler-ui/src/service/modules/login/index.ts
  11. 8
      dolphinscheduler-ui/src/service/modules/login/types.ts
  12. 6
      dolphinscheduler-ui/src/service/modules/projects-preference/index.ts
  13. 1
      dolphinscheduler-ui/src/service/modules/projects-preference/types.ts
  14. 6
      dolphinscheduler-ui/src/service/modules/projects-worker-group/index.ts
  15. 6
      dolphinscheduler-ui/src/service/modules/projects-worker-group/types.ts
  16. 7
      dolphinscheduler-ui/src/service/modules/projects/index.ts
  17. 9
      dolphinscheduler-ui/src/service/modules/projects/types.ts
  18. 2
      dolphinscheduler-ui/src/store/timezone/types.ts
  19. 2
      dolphinscheduler-ui/src/views/home/use-process-state.ts
  20. 4
      dolphinscheduler-ui/src/views/home/use-task-state.ts
  21. 26
      dolphinscheduler-ui/src/views/login/index.tsx
  22. 7
      dolphinscheduler-ui/src/views/login/use-login.ts
  23. 42
      dolphinscheduler-ui/src/views/projects/components/dependencies/dependencies-modal.tsx
  24. 135
      dolphinscheduler-ui/src/views/projects/components/dependencies/use-dependencies.ts
  25. 28
      dolphinscheduler-ui/src/views/projects/list/components/use-worker-group.ts
  26. 9
      dolphinscheduler-ui/src/views/projects/list/components/worker-group-modal.tsx
  27. 2
      dolphinscheduler-ui/src/views/projects/list/index.tsx
  28. 6
      dolphinscheduler-ui/src/views/projects/list/use-table.ts
  29. 2
      dolphinscheduler-ui/src/views/projects/overview/use-process-state.ts
  30. 2
      dolphinscheduler-ui/src/views/projects/overview/use-task-state.ts
  31. 2
      dolphinscheduler-ui/src/views/projects/preference/use-form.ts
  32. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx
  33. 9
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dependent.ts
  34. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts
  35. 7
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-hive-cli.ts
  36. 1
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-k8s.ts
  37. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-queue.ts
  38. 8
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-spark.ts
  39. 41
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts
  40. 38
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-source-type.ts
  41. 50
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts
  42. 5
      dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-worker-group.ts
  43. 8
      dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts
  44. 2
      dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-mr.ts
  45. 23
      dolphinscheduler-ui/src/views/projects/task/components/node/use-task.ts
  46. 2
      dolphinscheduler-ui/src/views/projects/task/definition/batch-task.tsx
  47. 22
      dolphinscheduler-ui/src/views/projects/task/definition/use-table.ts
  48. 16
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx
  49. 12
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-toolbar.tsx
  50. 8
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx
  51. 5
      dolphinscheduler-ui/src/views/projects/workflow/components/dag/use-node-status.ts
  52. 2
      dolphinscheduler-ui/src/views/projects/workflow/definition/components/start-modal.tsx
  53. 9
      dolphinscheduler-ui/src/views/projects/workflow/definition/components/table-action.tsx
  54. 2
      dolphinscheduler-ui/src/views/projects/workflow/definition/components/timing-modal.tsx
  55. 5
      dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-modal.ts
  56. 2
      dolphinscheduler-ui/src/views/projects/workflow/definition/index.tsx
  57. 2
      dolphinscheduler-ui/src/views/projects/workflow/definition/timing/index.tsx
  58. 36
      dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts
  59. 29
      dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts
  60. 6
      dolphinscheduler-ui/src/views/projects/workflow/timing/index.tsx
  61. 10
      dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts
  62. 4
      dolphinscheduler-ui/src/views/resource/components/resource/index.tsx
  63. 18
      dolphinscheduler-ui/src/views/resource/components/resource/table/use-table.ts
  64. 11
      dolphinscheduler-ui/src/views/resource/task-group/option/use-table.ts
  65. 1
      dolphinscheduler-ui/src/views/security/user-manage/use-table.ts
  66. 8
      dolphinscheduler-ui/src/views/security/yarn-queue-manage/use-table.ts

2
dolphinscheduler-ui/src/common/common.ts

@ -400,7 +400,7 @@ export const workflowExecutionState = (
icon: HourglassOutlined, icon: HourglassOutlined,
isSpin: false, isSpin: false,
classNames: 'wait_to_run' classNames: 'wait_to_run'
}, }
}) })
/** /**

2
dolphinscheduler-ui/src/components/chart/modules/Bar.tsx

@ -49,7 +49,7 @@ const BarChart = defineComponent({
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
type: 'shadow' type: 'shadow'
}, }
}, },
grid: { grid: {
left: '3%', left: '3%',

8
dolphinscheduler-ui/src/components/chart/modules/Gauge.tsx

@ -15,13 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { import { defineComponent, onMounted, onBeforeUnmount, PropType, ref } from 'vue'
defineComponent,
onMounted,
onBeforeUnmount,
PropType,
ref
} from 'vue'
import initChart from '@/components/chart' import initChart from '@/components/chart'
import type { Ref } from 'vue' import type { Ref } from 'vue'

8
dolphinscheduler-ui/src/layouts/content/use-dataList.ts

@ -110,18 +110,18 @@ export function useDataList() {
{ {
label: t('menu.project_overview'), label: t('menu.project_overview'),
key: `/projects/${projectCode}`, key: `/projects/${projectCode}`,
payload: { projectName: projectName }, payload: { projectName: projectName }
}, },
{ {
label: t('menu.project_parameter'), label: t('menu.project_parameter'),
key: `/projects/${projectCode}/parameter`, key: `/projects/${projectCode}/parameter`,
payload: { projectName: projectName }, payload: { projectName: projectName }
}, },
{ {
label: t('menu.project_preferences'), label: t('menu.project_preferences'),
key: `/projects/${projectCode}/preferences`, key: `/projects/${projectCode}/preferences`,
payload: { projectName: projectName }, payload: { projectName: projectName }
}, }
] ]
}, },
{ {

39
dolphinscheduler-ui/src/locales/en_US/project.ts

@ -41,7 +41,7 @@ export default {
no_permission: 'No Permission', no_permission: 'No Permission',
read_permission: 'Read Permission', read_permission: 'Read Permission',
all_permission: 'All Permission', all_permission: 'All Permission',
assign_worker_group: 'Worker Group', assign_worker_group: 'Worker Group'
}, },
workflow: { workflow: {
on_line: 'Online', on_line: 'Online',
@ -239,12 +239,17 @@ export default {
time_to_online: 'Confirm to make the Scheduler online?', time_to_online: 'Confirm to make the Scheduler online?',
time_to_offline: 'Confirm to make the Scheduler offline?', time_to_offline: 'Confirm to make the Scheduler offline?',
warning_dependent_tasks_title: 'Warning', warning_dependent_tasks_title: 'Warning',
warning_dependent_tasks_desc: 'The downstream dependent tasks exists. Are you sure to make the workflow offline?', warning_dependent_tasks_desc:
'The downstream dependent tasks exists. Are you sure to make the workflow offline?',
warning_dependencies: 'Dependencies:', warning_dependencies: 'Dependencies:',
delete_validate_dependent_tasks_desc: 'The downstream dependent tasks exists. You can not delete the workflow.', delete_validate_dependent_tasks_desc:
warning_offline_scheduler_dependent_tasks_desc: 'The downstream dependent tasks exists. Are you sure to make the scheduler offline?', 'The downstream dependent tasks exists. You can not delete the workflow.',
delete_task_validate_dependent_tasks_desc: 'The downstream dependent tasks exists. You can not delete the task.', warning_offline_scheduler_dependent_tasks_desc:
warning_delete_scheduler_dependent_tasks_desc: 'The downstream dependent tasks exists. Are you sure to delete the scheduler?', 'The downstream dependent tasks exists. Are you sure to make the scheduler offline?',
delete_task_validate_dependent_tasks_desc:
'The downstream dependent tasks exists. You can not delete the task.',
warning_delete_scheduler_dependent_tasks_desc:
'The downstream dependent tasks exists. Are you sure to delete the scheduler?'
}, },
task: { task: {
on_line: 'Online', on_line: 'Online',
@ -314,7 +319,8 @@ export default {
whether_dry_run: 'Whether Dry-Run', whether_dry_run: 'Whether Dry-Run',
please_choose: 'Please Choose', please_choose: 'Please Choose',
remove_task_cache: 'Clear cache', remove_task_cache: 'Clear cache',
delete_validate_dependent_tasks_desc: 'The downstream dependent tasks exists. You can not delete the task.', delete_validate_dependent_tasks_desc:
'The downstream dependent tasks exists. You can not delete the task.'
}, },
dag: { dag: {
create: 'Create Workflow', create: 'Create Workflow',
@ -843,9 +849,12 @@ export default {
please_select_target_datasource: 'Please select target datasource id', please_select_target_datasource: 'Please select target datasource id',
please_select_target_database: 'Please select target database', please_select_target_database: 'Please select target database',
please_enter_target_table: 'Please select target table name', please_enter_target_table: 'Please select target table name',
please_enter_target_filter_expression: 'Please enter target filter expression', please_enter_target_filter_expression:
please_enter_comparison_name_the_alias_in_comparison_execute_sql: 'Please enter comparison name the alias in comparison execute sql', 'Please enter target filter expression',
please_enter_statistics_name_the_alias_in_statistics_execute_sql: 'Please enter statistics name the alias in statistics execute sql', please_enter_comparison_name_the_alias_in_comparison_execute_sql:
'Please enter comparison name the alias in comparison execute sql',
please_enter_statistics_name_the_alias_in_statistics_execute_sql:
'Please enter statistics name the alias in statistics execute sql',
please_enter_comparison_execute_sql: 'Please enter comparison execute sql', please_enter_comparison_execute_sql: 'Please enter comparison execute sql',
please_enter_statistics_execute_sql: 'Please enter statistics execute sql', please_enter_statistics_execute_sql: 'Please enter statistics execute sql',
please_enter_threshold_number_is_needed: please_enter_threshold_number_is_needed:
@ -899,8 +908,7 @@ export default {
yarn_queue_tips: 'Please input yarn queue(optional)', yarn_queue_tips: 'Please input yarn queue(optional)',
dependent_type: 'Dependency Type', dependent_type: 'Dependency Type',
dependent_on_workflow: 'Dependent on workflow', dependent_on_workflow: 'Dependent on workflow',
dependent_on_task: 'Dependent on task', dependent_on_task: 'Dependent on task'
}, },
menu: { menu: {
fav: 'Favorites', fav: 'Favorites',
@ -927,15 +935,16 @@ export default {
edit: 'Edit', edit: 'Edit',
delete: 'Delete', delete: 'Delete',
delete_confirm: 'Delete?', delete_confirm: 'Delete?',
success: 'Success', success: 'Success'
}, },
preference: { preference: {
edit_preference: 'Edit Preference', edit_preference: 'Edit Preference',
preference_manage: 'Project Preference Management', preference_manage: 'Project Preference Management',
instruction_tips: 'The settings below will affect all workflows and tasks under this project.When creating the workflow or task, these preferences will be the default value of their components.', instruction_tips:
'The settings below will affect all workflows and tasks under this project.When creating the workflow or task, these preferences will be the default value of their components.',
success: 'Success', success: 'Success',
submit: 'Submit', submit: 'Submit',
enabled: 'Enabled', enabled: 'Enabled',
disabled: 'Disabled' disabled: 'Disabled'
}, }
} }

14
dolphinscheduler-ui/src/locales/en_US/security.ts

@ -273,14 +273,14 @@ export default {
MsgType: 'Msg Type', MsgType: 'Msg Type',
// eslint-disable-next-line quotes // eslint-disable-next-line quotes
IsAtAll: "{'@'}All", IsAtAll: "{'@'}All",
calledNumber:"Called phone number", calledNumber: 'Called phone number',
calledShowNumber:"Call display number", calledShowNumber: 'Call display number',
ttsCode:"TTS Code", ttsCode: 'TTS Code',
address:'Address', address: 'Address',
accessKeyId:"AccessKeyId", accessKeyId: 'AccessKeyId',
accessKeySecret:"AccessKeySecret", accessKeySecret: 'AccessKeySecret',
annotations: 'Annotations', annotations: 'Annotations',
generatorURL: 'GeneratorURL', generatorURL: 'GeneratorURL'
}, },
k8s_namespace: { k8s_namespace: {
create_namespace: 'Create Namespace', create_namespace: 'Create Namespace',

31
dolphinscheduler-ui/src/locales/zh_CN/project.ts

@ -41,7 +41,7 @@ export default {
no_permission: '无权限', no_permission: '无权限',
read_permission: '读权限', read_permission: '读权限',
all_permission: '所有权限', all_permission: '所有权限',
assign_worker_group: '分配WorkerGroup', assign_worker_group: '分配WorkerGroup'
}, },
workflow: { workflow: {
on_line: '线上', on_line: '线上',
@ -237,12 +237,16 @@ export default {
time_to_online: '是否确定上线该定时?', time_to_online: '是否确定上线该定时?',
time_to_offline: '是否确定下线该定时?', time_to_offline: '是否确定下线该定时?',
warning_dependent_tasks_title: '警告', warning_dependent_tasks_title: '警告',
warning_dependent_tasks_desc: '下游存在依赖, 下线操作可能会对下游任务产生影响. 你确定要下线该工作流嘛?', warning_dependent_tasks_desc:
'下游存在依赖, 下线操作可能会对下游任务产生影响. 你确定要下线该工作流嘛?',
warning_dependencies: '依赖如下:', warning_dependencies: '依赖如下:',
delete_validate_dependent_tasks_desc: '下游存在依赖,你不能删除该工作流', delete_validate_dependent_tasks_desc: '下游存在依赖,你不能删除该工作流',
warning_offline_scheduler_dependent_tasks_desc: '下游存在依赖, 下线操作可能会对下游任务产生影响. 你确定要下线该定时嘛?', warning_offline_scheduler_dependent_tasks_desc:
delete_task_validate_dependent_tasks_desc: '下游存在依赖,你不能删除该任务.', '下游存在依赖, 下线操作可能会对下游任务产生影响. 你确定要下线该定时嘛?',
warning_delete_scheduler_dependent_tasks_desc: '下游存在依赖, 删除定时可能会对下游任务产生影响. 你确定要删除该定时嘛?', delete_task_validate_dependent_tasks_desc:
'下游存在依赖,你不能删除该任务.',
warning_delete_scheduler_dependent_tasks_desc:
'下游存在依赖, 删除定时可能会对下游任务产生影响. 你确定要删除该定时嘛?'
}, },
task: { task: {
on_line: '线上', on_line: '线上',
@ -312,7 +316,7 @@ export default {
whether_dry_run: '是否空跑', whether_dry_run: '是否空跑',
please_choose: '请选择', please_choose: '请选择',
remove_task_cache: '清除缓存', remove_task_cache: '清除缓存',
delete_validate_dependent_tasks_desc: '下游存在依赖,你不能删除该任务定义', delete_validate_dependent_tasks_desc: '下游存在依赖,你不能删除该任务定义'
}, },
dag: { dag: {
create: '创建工作流', create: '创建工作流',
@ -822,8 +826,10 @@ export default {
please_select_target_database: '请选择目标数据库', please_select_target_database: '请选择目标数据库',
please_enter_target_table: '请选择目标数据表', please_enter_target_table: '请选择目标数据表',
please_enter_target_filter_expression: '请输入目标表过滤条件', please_enter_target_filter_expression: '请输入目标表过滤条件',
please_enter_comparison_name_the_alias_in_comparison_execute_sql: '请输入期望值名', please_enter_comparison_name_the_alias_in_comparison_execute_sql:
please_enter_statistics_name_the_alias_in_statistics_execute_sql: '请输入实际值名', '请输入期望值名',
please_enter_statistics_name_the_alias_in_statistics_execute_sql:
'请输入实际值名',
please_enter_comparison_execute_sql: '请输入期望值计算SQL', please_enter_comparison_execute_sql: '请输入期望值计算SQL',
please_enter_statistics_execute_sql: '请输入实际值计算SQL', please_enter_statistics_execute_sql: '请输入实际值计算SQL',
custom_config: '自定义配置', custom_config: '自定义配置',
@ -872,7 +878,7 @@ export default {
yarn_queue_tips: '请输入Yarn队列(选填)', yarn_queue_tips: '请输入Yarn队列(选填)',
dependent_type: '依赖类型', dependent_type: '依赖类型',
dependent_on_workflow: '依赖于工作流', dependent_on_workflow: '依赖于工作流',
dependent_on_task: '依赖于任务', dependent_on_task: '依赖于任务'
}, },
menu: { menu: {
fav: '收藏组件', fav: '收藏组件',
@ -899,15 +905,16 @@ export default {
edit: '编辑', edit: '编辑',
delete: '删除', delete: '删除',
delete_confirm: '确定删除吗?', delete_confirm: '确定删除吗?',
success: '成功', success: '成功'
}, },
preference: { preference: {
edit_preference: '修改项目偏好设置', edit_preference: '修改项目偏好设置',
preference_manage: '项目偏好管理', preference_manage: '项目偏好管理',
instruction_tips: '下面这些项目偏好配置将影响这个项目下的所有工作流和任务。当创建工作流和任务时,这些配置将影响组件中的默认选项', instruction_tips:
'下面这些项目偏好配置将影响这个项目下的所有工作流和任务。当创建工作流和任务时,这些配置将影响组件中的默认选项',
success: '成功', success: '成功',
submit: '提交', submit: '提交',
enabled: '启用', enabled: '启用',
disabled: '未启用' disabled: '未启用'
}, }
} }

14
dolphinscheduler-ui/src/locales/zh_CN/security.ts

@ -272,14 +272,14 @@ export default {
MsgType: '消息类型', MsgType: '消息类型',
// eslint-disable-next-line quotes // eslint-disable-next-line quotes
IsAtAll: "{'@'}所有人", IsAtAll: "{'@'}所有人",
calledNumber:"被叫电话号码", calledNumber: '被叫电话号码',
calledShowNumber:"呼叫显示号码", calledShowNumber: '呼叫显示号码',
ttsCode:"语音模板", ttsCode: '语音模板',
address:'访问域名', address: '访问域名',
accessKeyId:"AccessKeyId", accessKeyId: 'AccessKeyId',
accessKeySecret:"AccessKeySecret", accessKeySecret: 'AccessKeySecret',
annotations: '注释', annotations: '注释',
generatorURL: '生成地址', generatorURL: '生成地址'
}, },
k8s_namespace: { k8s_namespace: {
create_namespace: '创建命名空间', create_namespace: '创建命名空间',

7
dolphinscheduler-ui/src/service/modules/lineages/index.ts

@ -16,7 +16,7 @@
*/ */
import { axios } from '@/service/service' import { axios } from '@/service/service'
import {DependentTaskReq, ProjectCodeReq, WorkflowCodeReq} from './types' import { DependentTaskReq, ProjectCodeReq, WorkflowCodeReq } from './types'
export function queryWorkFlowList(projectCode: ProjectCodeReq): any { export function queryWorkFlowList(projectCode: ProjectCodeReq): any {
return axios({ return axios({
@ -42,7 +42,10 @@ export function queryLineageByWorkFlowCode(
}) })
} }
export function queryDependentTasks(projectCode: number, params: DependentTaskReq): any { export function queryDependentTasks(
projectCode: number,
params: DependentTaskReq
): any {
return axios({ return axios({
url: `/projects/${projectCode}/lineages/query-dependent-tasks`, url: `/projects/${projectCode}/lineages/query-dependent-tasks`,
method: 'get', method: 'get',

4
dolphinscheduler-ui/src/service/modules/login/index.ts

@ -36,13 +36,13 @@ export function ssoLoginUrl(): any {
export function getOauth2Provider(): any { export function getOauth2Provider(): any {
return axios({ return axios({
url: '/oauth2-provider', url: '/oauth2-provider',
method: 'get', method: 'get'
}) })
} }
export function clearCookie(): any { export function clearCookie(): any {
return axios({ return axios({
url: '/cookies', url: '/cookies',
method: 'delete', method: 'delete'
}) })
} }

8
dolphinscheduler-ui/src/service/modules/login/types.ts

@ -26,10 +26,10 @@ interface LoginRes {
} }
interface OAuth2Provider { interface OAuth2Provider {
clientId: string, clientId: string
redirectUri: string, redirectUri: string
provider: string, provider: string
authorizationUri: string, authorizationUri: string
iconUri: string iconUri: string
} }

6
dolphinscheduler-ui/src/service/modules/projects-preference/index.ts

@ -22,9 +22,7 @@ import {
UpdateProjectPreferenceStateReq UpdateProjectPreferenceStateReq
} from './types' } from './types'
export function queryProjectPreferenceByProjectCode( export function queryProjectPreferenceByProjectCode(projectCode: number): any {
projectCode: number
): any {
return axios({ return axios({
url: `/projects/${projectCode}/project-preference`, url: `/projects/${projectCode}/project-preference`,
method: 'get' method: 'get'
@ -44,7 +42,7 @@ export function updateProjectPreference(
export function updateProjectPreferenceState( export function updateProjectPreferenceState(
data: UpdateProjectPreferenceStateReq, data: UpdateProjectPreferenceStateReq,
projectCode: number, projectCode: number
): any { ): any {
return axios({ return axios({
url: `/projects/${projectCode}/project-preference`, url: `/projects/${projectCode}/project-preference`,

1
dolphinscheduler-ui/src/service/modules/projects-preference/types.ts

@ -15,7 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
interface ProjectPreferenceReq { interface ProjectPreferenceReq {
projectPreferences: string projectPreferences: string
} }

6
dolphinscheduler-ui/src/service/modules/projects-worker-group/index.ts

@ -16,11 +16,9 @@
*/ */
import { axios } from '@/service/service' import { axios } from '@/service/service'
import { UpdateProjectWorkerGroupsReq } from "@/service/modules/projects-worker-group/types"; import { UpdateProjectWorkerGroupsReq } from '@/service/modules/projects-worker-group/types'
export function queryWorkerGroupsByProjectCode( export function queryWorkerGroupsByProjectCode(projectCode: number): any {
projectCode: number
): any {
return axios({ return axios({
url: `/projects/${projectCode}/worker-group`, url: `/projects/${projectCode}/worker-group`,
method: 'get' method: 'get'

6
dolphinscheduler-ui/src/service/modules/projects-worker-group/types.ts

@ -23,12 +23,8 @@ interface ProjectWorkerGroup {
updateTime: string updateTime: string
} }
interface UpdateProjectWorkerGroupsReq { interface UpdateProjectWorkerGroupsReq {
workerGroups: string workerGroups: string
} }
export { export { ProjectWorkerGroup, UpdateProjectWorkerGroupsReq }
ProjectWorkerGroup,
UpdateProjectWorkerGroupsReq
}

7
dolphinscheduler-ui/src/service/modules/projects/index.ts

@ -16,12 +16,7 @@
*/ */
import { axios } from '@/service/service' import { axios } from '@/service/service'
import { import { ListReq, ListIdReq, ProjectsReq, UserIdReq } from './types'
ListReq,
ListIdReq,
ProjectsReq,
UserIdReq
} from './types'
export function queryProjectListPaging(params: ListReq): any { export function queryProjectListPaging(params: ListReq): any {
return axios({ return axios({

9
dolphinscheduler-ui/src/service/modules/projects/types.ts

@ -60,11 +60,4 @@ interface ProjectRes {
start: number start: number
} }
export { export { ListReq, ListIdReq, ProjectsReq, UserIdReq, ProjectRes, ProjectList }
ListReq,
ListIdReq,
ProjectsReq,
UserIdReq,
ProjectRes,
ProjectList
}

2
dolphinscheduler-ui/src/store/timezone/types.ts

@ -17,7 +17,7 @@
import { timezoneList } from '@/common/timezone' import { timezoneList } from '@/common/timezone'
type Timezone = typeof timezoneList[number] type Timezone = (typeof timezoneList)[number]
interface timezoneStore { interface timezoneStore {
timezone: Timezone timezone: Timezone

2
dolphinscheduler-ui/src/views/home/use-process-state.ts

@ -36,7 +36,7 @@ export function useProcessState() {
const { state } = useAsyncState( const { state } = useAsyncState(
countProcessInstanceState({ countProcessInstanceState({
startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'), startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'),
endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss')
}).then((res: WorkflowInstanceCountVo): StateData => { }).then((res: WorkflowInstanceCountVo): StateData => {
const table = res.workflowInstanceStatusCounts.map((item) => { const table = res.workflowInstanceStatusCounts.map((item) => {
return { return {

4
dolphinscheduler-ui/src/views/home/use-task-state.ts

@ -20,7 +20,7 @@ import { format } from 'date-fns'
import { toLower } from 'lodash' import { toLower } from 'lodash'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { countTaskState } from '@/service/modules/projects-analysis' import { countTaskState } from '@/service/modules/projects-analysis'
import type {TaskInstanceCountVo} from '@/service/modules/projects-analysis/types' import type { TaskInstanceCountVo } from '@/service/modules/projects-analysis/types'
import type { StateData } from './types' import type { StateData } from './types'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'
@ -36,7 +36,7 @@ export function useTaskState() {
const { state } = useAsyncState( const { state } = useAsyncState(
countTaskState({ countTaskState({
startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'), startDate: !date ? '' : format(date[0], 'yyyy-MM-dd HH:mm:ss'),
endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss'), endDate: !date ? '' : format(date[1], 'yyyy-MM-dd HH:mm:ss')
}).then((res: TaskInstanceCountVo): StateData => { }).then((res: TaskInstanceCountVo): StateData => {
const table = res.taskInstanceStatusCounts.map((item, unused) => { const table = res.taskInstanceStatusCounts.map((item, unused) => {
return { return {

26
dolphinscheduler-ui/src/views/login/index.tsx

@ -49,7 +49,13 @@ const login = defineComponent({
window.$message = useMessage() window.$message = useMessage()
const { state, t, locale } = useForm() const { state, t, locale } = useForm()
const { handleChange } = useTranslate(locale) const { handleChange } = useTranslate(locale)
const { handleLogin, handleGetOAuth2Provider, oauth2Providers, gotoOAuth2Page, handleRedirect } = useLogin(state) const {
handleLogin,
handleGetOAuth2Provider,
oauth2Providers,
gotoOAuth2Page,
handleRedirect
} = useLogin(state)
const localesStore = useLocalesStore() const localesStore = useLocalesStore()
const themeStore = useThemeStore() const themeStore = useThemeStore()
@ -177,13 +183,21 @@ const login = defineComponent({
</NButton> </NButton>
</a> </a>
</div> </div>
{this.oauth2Providers.length > 0 && <NDivider > {this.oauth2Providers.length > 0 && (
{this.t('login.loginWithOAuth2')} <NDivider>{this.t('login.loginWithOAuth2')}</NDivider>
</NDivider>} )}
<NSpace class={styles['oauth2-provider']} justify="center"> <NSpace class={styles['oauth2-provider']} justify='center'>
{this.oauth2Providers?.map((e: OAuth2Provider) => { {this.oauth2Providers?.map((e: OAuth2Provider) => {
return (e.iconUri ? <div onClick={() => this.gotoOAuth2Page(e)}><NImage preview-disabled width="30" src={e.iconUri}></NImage> </div> : <NButton onClick={() => this.gotoOAuth2Page(e)}>{e.provider}</NButton>) return e.iconUri ? (
<div onClick={() => this.gotoOAuth2Page(e)}>
<NImage preview-disabled width='30' src={e.iconUri}></NImage>{' '}
</div>
) : (
<NButton onClick={() => this.gotoOAuth2Page(e)}>
{e.provider}
</NButton>
)
})} })}
</NSpace> </NSpace>
</div> </div>

7
dolphinscheduler-ui/src/views/login/use-login.ts

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { useRouter,useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'
import { clearCookie, getOauth2Provider, login } from '@/service/modules/login' import { clearCookie, getOauth2Provider, login } from '@/service/modules/login'
import { getUserInfo } from '@/service/modules/users' import { getUserInfo } from '@/service/modules/users'
import { useUserStore } from '@/store/user/user' import { useUserStore } from '@/store/user/user'
@ -64,8 +64,6 @@ export function useLogin(state: any) {
}) })
} }
const handleGetOAuth2Provider = () => { const handleGetOAuth2Provider = () => {
getOauth2Provider().then((res: Array<OAuth2Provider> | []) => { getOauth2Provider().then((res: Array<OAuth2Provider> | []) => {
oauth2Providers.value = res oauth2Providers.value = res
@ -76,7 +74,8 @@ export function useLogin(state: any) {
const gotoOAuth2Page = async (oauth2Provider: OAuth2Provider) => { const gotoOAuth2Page = async (oauth2Provider: OAuth2Provider) => {
await clearCookie() await clearCookie()
window.location.href = `${oauth2Provider.authorizationUri}?client_id=${oauth2Provider.clientId}` + window.location.href =
`${oauth2Provider.authorizationUri}?client_id=${oauth2Provider.clientId}` +
`&response_type=code&redirect_uri=${oauth2Provider.redirectUri}?provider=${oauth2Provider.provider}` `&response_type=code&redirect_uri=${oauth2Provider.redirectUri}?provider=${oauth2Provider.provider}`
} }

42
dolphinscheduler-ui/src/views/projects/components/dependencies/dependencies-modal.tsx

@ -15,16 +15,11 @@
* limitations under the License. * limitations under the License.
*/ */
import { import { defineComponent, PropType, h, ref, watch } from 'vue'
defineComponent,
PropType,
h,
ref, watch
} from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import {NEllipsis, NModal, NSpace} from 'naive-ui' import { NEllipsis, NModal, NSpace } from 'naive-ui'
import {IDefinitionData} from "@/views/projects/workflow/definition/types"; import { IDefinitionData } from '@/views/projects/workflow/definition/types'
import ButtonLink from "@/components/button-link"; import ButtonLink from '@/components/button-link'
const props = { const props = {
row: { row: {
@ -74,13 +69,11 @@ export default defineComponent({
<div>{t('project.workflow.warning_dependencies')}</div> <div>{t('project.workflow.warning_dependencies')}</div>
{props.taskLinks.map((item: any) => { {props.taskLinks.map((item: any) => {
return ( return (
<ButtonLink <ButtonLink onClick={item.action} disabled={false}>
onClick={item.action}
disabled={false}
>
{{ {{
default: () => default: () =>
h(NEllipsis, h(
NEllipsis,
{ {
style: 'max-width: 350px;line-height: 1.5' style: 'max-width: 350px;line-height: 1.5'
}, },
@ -94,12 +87,19 @@ export default defineComponent({
) )
} }
watch(()=> props.show, watch(
() => props.show,
() => { () => {
showRef.value = props.show showRef.value = props.show
}) }
)
return {renderDownstreamDependencies, confirmToHandle, cancelToHandle, showRef} return {
renderDownstreamDependencies,
confirmToHandle,
cancelToHandle,
showRef
}
}, },
render() { render() {
@ -109,9 +109,9 @@ export default defineComponent({
<NModal <NModal
v-model:show={this.showRef} v-model:show={this.showRef}
preset={'dialog'} preset={'dialog'}
type={this.$props.required? 'error':'warning'} type={this.$props.required ? 'error' : 'warning'}
title={t('project.workflow.warning_dependent_tasks_title')} title={t('project.workflow.warning_dependent_tasks_title')}
positiveText={this.$props.required? '':t('project.workflow.confirm')} positiveText={this.$props.required ? '' : t('project.workflow.confirm')}
negativeText={t('project.workflow.cancel')} negativeText={t('project.workflow.cancel')}
maskClosable={false} maskClosable={false}
onNegativeClick={this.cancelToHandle} onNegativeClick={this.cancelToHandle}
@ -119,9 +119,7 @@ export default defineComponent({
onClose={this.cancelToHandle} onClose={this.cancelToHandle}
> >
{{ {{
default: () => ( default: () => this.renderDownstreamDependencies()
this.renderDownstreamDependencies()
)
}} }}
</NModal> </NModal>
) )

135
dolphinscheduler-ui/src/views/projects/components/dependencies/use-dependencies.ts

@ -15,18 +15,29 @@
* limitations under the License. * limitations under the License.
*/ */
import {DependentTaskReq} from "@/service/modules/lineages/types"; import { DependentTaskReq } from '@/service/modules/lineages/types'
import {queryDependentTasks} from "@/service/modules/lineages"; import { queryDependentTasks } from '@/service/modules/lineages'
import {TASK_TYPES_MAP} from "@/store/project"; import { TASK_TYPES_MAP } from '@/store/project'
export function useDependencies() { export function useDependencies() {
const getDependentTasksBySingleTask = async (
const getDependentTasksBySingleTask = async (projectCode: any, workflowCode: any, taskCode: any) => { projectCode: any,
let tasks = [] as any workflowCode: any,
taskCode: any
) => {
const tasks = [] as any
if (workflowCode && taskCode) { if (workflowCode && taskCode) {
let dependentTaskReq = {workFlowCode: workflowCode, taskCode: taskCode} as DependentTaskReq const dependentTaskReq = {
workFlowCode: workflowCode,
taskCode: taskCode
} as DependentTaskReq
const res = await queryDependentTasks(projectCode, dependentTaskReq) const res = await queryDependentTasks(projectCode, dependentTaskReq)
res.filter((item: any) => item.processDefinitionCode !== workflowCode && item.taskType === TASK_TYPES_MAP.DEPENDENT.alias) res
.filter(
(item: any) =>
item.processDefinitionCode !== workflowCode &&
item.taskType === TASK_TYPES_MAP.DEPENDENT.alias
)
.forEach((item: any) => { .forEach((item: any) => {
tasks.push(item.processDefinitionName + '->' + item.taskName) tasks.push(item.processDefinitionName + '->' + item.taskName)
}) })
@ -34,12 +45,22 @@ export function useDependencies() {
return tasks return tasks
} }
const getDependentTasksByWorkflow = async (projectCode: any, workflowCode: any) => { const getDependentTasksByWorkflow = async (
let tasks = [] as any projectCode: any,
workflowCode: any
) => {
const tasks = [] as any
if (workflowCode) { if (workflowCode) {
let dependentTaskReq = {workFlowCode: workflowCode} as DependentTaskReq const dependentTaskReq = {
workFlowCode: workflowCode
} as DependentTaskReq
const res = await queryDependentTasks(projectCode, dependentTaskReq) const res = await queryDependentTasks(projectCode, dependentTaskReq)
res.filter((item: any) => item.processDefinitionCode !== workflowCode && item.taskType === TASK_TYPES_MAP.DEPENDENT.alias) res
.filter(
(item: any) =>
item.processDefinitionCode !== workflowCode &&
item.taskType === TASK_TYPES_MAP.DEPENDENT.alias
)
.forEach((item: any) => { .forEach((item: any) => {
tasks.push(item.processDefinitionName + '->' + item.taskName) tasks.push(item.processDefinitionName + '->' + item.taskName)
}) })
@ -47,12 +68,20 @@ export function useDependencies() {
return tasks return tasks
} }
const getDependentTasksByMultipleTasks = async (projectCode: any, workflowCode: any, taskCodes: any[]) => { const getDependentTasksByMultipleTasks = async (
projectCode: any,
workflowCode: any,
taskCodes: any[]
) => {
let tasks = [] as any let tasks = [] as any
if (workflowCode && taskCodes?.length>0) { if (workflowCode && taskCodes?.length > 0) {
for(const taskCode of taskCodes) { for (const taskCode of taskCodes) {
const res = await getDependentTasksBySingleTask(projectCode, workflowCode, taskCode) const res = await getDependentTasksBySingleTask(
if (res?.length >0) { projectCode,
workflowCode,
taskCode
)
if (res?.length > 0) {
tasks = tasks.concat(res) tasks = tasks.concat(res)
} }
} }
@ -60,11 +89,19 @@ export function useDependencies() {
return tasks return tasks
} }
const getDependentTaskLinksByMultipleTasks = async (projectCode: any, workflowCode: any, taskCodes: any[]) => { const getDependentTaskLinksByMultipleTasks = async (
projectCode: any,
workflowCode: any,
taskCodes: any[]
) => {
let dependentTaskLinks = [] as any let dependentTaskLinks = [] as any
if (workflowCode && projectCode) { if (workflowCode && projectCode) {
for (const taskCode of taskCodes) { for (const taskCode of taskCodes) {
await getDependentTaskLinksByTask(projectCode, workflowCode, taskCode).then((res: any) => { await getDependentTaskLinksByTask(
projectCode,
workflowCode,
taskCode
).then((res: any) => {
dependentTaskLinks = dependentTaskLinks.concat(res) dependentTaskLinks = dependentTaskLinks.concat(res)
}) })
} }
@ -73,50 +110,74 @@ export function useDependencies() {
} }
const getDependentTaskLinks = async (projectCode: any, workflowCode: any) => { const getDependentTaskLinks = async (projectCode: any, workflowCode: any) => {
let dependentTaskReq = {workFlowCode: workflowCode} as DependentTaskReq const dependentTaskReq = { workFlowCode: workflowCode } as DependentTaskReq
let dependentTaskLinks = [] as any const dependentTaskLinks = [] as any
if (workflowCode && projectCode) { if (workflowCode && projectCode) {
await queryDependentTasks(projectCode, dependentTaskReq).then((res: any) => { await queryDependentTasks(projectCode, dependentTaskReq).then(
res.filter((item: any) => item.processDefinitionCode !== workflowCode && item.taskType === TASK_TYPES_MAP.DEPENDENT.alias) (res: any) => {
res
.filter(
(item: any) =>
item.processDefinitionCode !== workflowCode &&
item.taskType === TASK_TYPES_MAP.DEPENDENT.alias
)
.forEach((item: any) => { .forEach((item: any) => {
dependentTaskLinks.push( dependentTaskLinks.push({
{
text: item.processDefinitionName + '->' + item.taskName, text: item.processDefinitionName + '->' + item.taskName,
show: true, show: true,
action: () => { action: () => {
const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}` const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}`
window.open(url, '_blank') window.open(url, '_blank')
},
} }
)
}) })
}) })
} }
)
}
return dependentTaskLinks return dependentTaskLinks
} }
const getDependentTaskLinksByTask = async (projectCode: any, workflowCode: any, taskCode: any) => { const getDependentTaskLinksByTask = async (
let dependentTaskReq = {workFlowCode: workflowCode, taskCode: taskCode} as DependentTaskReq projectCode: any,
let dependentTaskLinks = [] as any workflowCode: any,
taskCode: any
) => {
const dependentTaskReq = {
workFlowCode: workflowCode,
taskCode: taskCode
} as DependentTaskReq
const dependentTaskLinks = [] as any
if (workflowCode && projectCode) { if (workflowCode && projectCode) {
await queryDependentTasks(projectCode, dependentTaskReq).then((res: any) => { await queryDependentTasks(projectCode, dependentTaskReq).then(
res.filter((item: any) => item.processDefinitionCode !== workflowCode && item.taskType === TASK_TYPES_MAP.DEPENDENT.alias) (res: any) => {
res
.filter(
(item: any) =>
item.processDefinitionCode !== workflowCode &&
item.taskType === TASK_TYPES_MAP.DEPENDENT.alias
)
.forEach((item: any) => { .forEach((item: any) => {
dependentTaskLinks.push( dependentTaskLinks.push({
{
text: item.processDefinitionName + '->' + item.taskName, text: item.processDefinitionName + '->' + item.taskName,
show: true, show: true,
action: () => { action: () => {
const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}` const url = `/projects/${item.projectCode}/workflow/definitions/${item.processDefinitionCode}`
window.open(url, '_blank') window.open(url, '_blank')
},
} }
)
}) })
}) })
} }
)
}
return dependentTaskLinks return dependentTaskLinks
} }
return { getDependentTasksBySingleTask, getDependentTasksByMultipleTasks, getDependentTaskLinks, getDependentTasksByWorkflow, getDependentTaskLinksByTask, getDependentTaskLinksByMultipleTasks } return {
getDependentTasksBySingleTask,
getDependentTasksByMultipleTasks,
getDependentTaskLinks,
getDependentTasksByWorkflow,
getDependentTaskLinksByTask,
getDependentTaskLinksByMultipleTasks
}
} }

28
dolphinscheduler-ui/src/views/projects/list/components/use-worker-group.ts

@ -17,10 +17,13 @@
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { reactive, ref, SetupContext } from 'vue' import { reactive, ref, SetupContext } from 'vue'
import { Option } from "naive-ui/es/transfer/src/interface" import { Option } from 'naive-ui/es/transfer/src/interface'
import { queryAllWorkerGroups } from "@/service/modules/worker-groups" import { queryAllWorkerGroups } from '@/service/modules/worker-groups'
import { queryWorkerGroupsByProjectCode, assignWorkerGroups } from "@/service/modules/projects-worker-group" import {
import { UpdateProjectWorkerGroupsReq } from "@/service/modules/projects-worker-group/types" queryWorkerGroupsByProjectCode,
assignWorkerGroups
} from '@/service/modules/projects-worker-group'
import { UpdateProjectWorkerGroupsReq } from '@/service/modules/projects-worker-group/types'
export function useWorkerGroup( export function useWorkerGroup(
props: any, props: any,
@ -39,14 +42,18 @@ export function useWorkerGroup(
variables.model.workerGroupOptions = [] variables.model.workerGroupOptions = []
queryAllWorkerGroups().then((res: any) => { queryAllWorkerGroups().then((res: any) => {
for (const workerGroup of res) { for (const workerGroup of res) {
variables.model.workerGroupOptions.push({label: workerGroup, value: workerGroup, disabled: workerGroup==='default'}) variables.model.workerGroupOptions.push({
label: workerGroup,
value: workerGroup,
disabled: workerGroup === 'default'
})
} }
}) })
} }
const initAssignedWorkerGroups = (projectCode: number) => { const initAssignedWorkerGroups = (projectCode: number) => {
variables.model.assignedWorkerGroups = ref([] as any) variables.model.assignedWorkerGroups = ref([] as any)
queryWorkerGroupsByProjectCode(projectCode).then((res: any) =>{ queryWorkerGroupsByProjectCode(projectCode).then((res: any) => {
res.data.forEach((item: any) => { res.data.forEach((item: any) => {
variables.model.assignedWorkerGroups.push(item.workerGroup) variables.model.assignedWorkerGroups.push(item.workerGroup)
}) })
@ -56,7 +63,7 @@ export function useWorkerGroup(
initOptions() initOptions()
const handleValidate = () => { const handleValidate = () => {
if (variables.model?.assignedWorkerGroups.length>0) { if (variables.model?.assignedWorkerGroups.length > 0) {
submitModal() submitModal()
ctx.emit('confirmModal', props.showModalRef) ctx.emit('confirmModal', props.showModalRef)
} }
@ -64,8 +71,11 @@ export function useWorkerGroup(
const submitModal = async () => { const submitModal = async () => {
if (props.row.code) { if (props.row.code) {
let data: UpdateProjectWorkerGroupsReq = { const data: UpdateProjectWorkerGroupsReq = {
workerGroups: variables.model.assignedWorkerGroups.length>0? variables.model.assignedWorkerGroups.join(','):'' workerGroups:
variables.model.assignedWorkerGroups.length > 0
? variables.model.assignedWorkerGroups.join(',')
: ''
} }
assignWorkerGroups(data, props.row.code) assignWorkerGroups(data, props.row.code)
} }

9
dolphinscheduler-ui/src/views/projects/list/components/worker-group-modal.tsx

@ -22,10 +22,10 @@ import {
toRefs, toRefs,
watch watch
} from 'vue' } from 'vue'
import { NTransfer} from 'naive-ui' import { NTransfer } from 'naive-ui'
import Modal from '@/components/modal' import Modal from '@/components/modal'
import styles from "@/views/security/user-manage/index.module.scss"; import styles from '@/views/security/user-manage/index.module.scss'
import {useWorkerGroup} from "@/views/projects/list/components/use-worker-group"; import { useWorkerGroup } from '@/views/projects/list/components/use-worker-group'
const props = { const props = {
showModalRef: { showModalRef: {
@ -43,7 +43,8 @@ const WorkerGroupModal = defineComponent({
props, props,
emits: ['cancelModal', 'confirmModal'], emits: ['cancelModal', 'confirmModal'],
setup(props, ctx) { setup(props, ctx) {
const { variables, t, handleValidate, initAssignedWorkerGroups } = useWorkerGroup(props, ctx) const { variables, t, handleValidate, initAssignedWorkerGroups } =
useWorkerGroup(props, ctx)
const cancelModal = () => { const cancelModal = () => {
ctx.emit('cancelModal', props.showModalRef) ctx.emit('cancelModal', props.showModalRef)

2
dolphinscheduler-ui/src/views/projects/list/index.tsx

@ -29,7 +29,7 @@ import { useTable } from './use-table'
import Card from '@/components/card' import Card from '@/components/card'
import Search from '@/components/input-search' import Search from '@/components/input-search'
import ProjectModal from './components/project-modal' import ProjectModal from './components/project-modal'
import WorkerGroupModal from "@/views/projects/list/components/worker-group-modal"; import WorkerGroupModal from '@/views/projects/list/components/worker-group-modal'
const list = defineComponent({ const list = defineComponent({
name: 'list', name: 'list',

6
dolphinscheduler-ui/src/views/projects/list/use-table.ts

@ -39,9 +39,9 @@ import {
} from '@/common/column-width-config' } from '@/common/column-width-config'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import type { ProjectRes } from '@/service/modules/projects/types' import type { ProjectRes } from '@/service/modules/projects/types'
import {ControlOutlined, DeleteOutlined, EditOutlined} from '@vicons/antd' import { ControlOutlined, DeleteOutlined, EditOutlined } from '@vicons/antd'
import {useUserStore} from "@/store/user/user"; import { useUserStore } from '@/store/user/user'
import {UserInfoRes} from "@/service/modules/users/types"; import { UserInfoRes } from '@/service/modules/users/types'
export function useTable() { export function useTable() {
const { t } = useI18n() const { t } = useI18n()

2
dolphinscheduler-ui/src/views/projects/overview/use-process-state.ts

@ -21,7 +21,7 @@ import { countProcessInstanceState } from '@/service/modules/projects-analysis'
import { format } from 'date-fns' import { format } from 'date-fns'
import { toLower } from 'lodash' import { toLower } from 'lodash'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import type {WorkflowInstanceCountVo} from '@/service/modules/projects-analysis/types' import type { WorkflowInstanceCountVo } from '@/service/modules/projects-analysis/types'
import type { StateData } from './types' import type { StateData } from './types'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'

2
dolphinscheduler-ui/src/views/projects/overview/use-task-state.ts

@ -21,7 +21,7 @@ import { format } from 'date-fns'
import { toLower } from 'lodash' import { toLower } from 'lodash'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { countTaskState } from '@/service/modules/projects-analysis' import { countTaskState } from '@/service/modules/projects-analysis'
import type {TaskInstanceCountVo} from '@/service/modules/projects-analysis/types' import type { TaskInstanceCountVo } from '@/service/modules/projects-analysis/types'
import type { StateData } from './types' import type { StateData } from './types'
import { reactive, ref } from 'vue' import { reactive, ref } from 'vue'

2
dolphinscheduler-ui/src/views/projects/preference/use-form.ts

@ -120,7 +120,7 @@ export function useForm() {
] ]
const restructurePreferencesItems = (preferencesItems: any) => { const restructurePreferencesItems = (preferencesItems: any) => {
for (let item of preferencesItems) { for (const item of preferencesItems) {
if (item.validate?.required) { if (item.validate?.required) {
item.validate.required = false item.validate.required = false
item.span = 12 item.span = 12

2
dolphinscheduler-ui/src/views/projects/task/components/node/detail-modal.tsx

@ -130,7 +130,7 @@ const NodeDetailModal = defineComponent({
const restructureNodeData = (data: INodeData) => { const restructureNodeData = (data: INodeData) => {
if (!data?.id) { if (!data?.id) {
for (let item in projectPreferences.value) { for (const item in projectPreferences.value) {
if (projectPreferences.value[item] !== null && item in data) { if (projectPreferences.value[item] !== null && item in data) {
Object.assign(data, { item: projectPreferences.value[item] }) Object.assign(data, { item: projectPreferences.value[item] })
} }

9
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-dependent.ts

@ -282,8 +282,7 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
if (!dependItem.dependentType) { if (!dependItem.dependentType) {
if (dependItem.depTaskCode == 0) if (dependItem.depTaskCode == 0)
dependItem.dependentType = 'DEPENDENT_ON_WORKFLOW' dependItem.dependentType = 'DEPENDENT_ON_WORKFLOW'
else else dependItem.dependentType = 'DEPENDENT_ON_TASK'
dependItem.dependentType = 'DEPENDENT_ON_TASK'
} }
if (dependItem.projectCode) { if (dependItem.projectCode) {
itemListOptions.value[itemIndex].definitionCodeOptions = itemListOptions.value[itemIndex].definitionCodeOptions =
@ -326,7 +325,8 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
onUpdateValue: (dependentType: string) => { onUpdateValue: (dependentType: string) => {
const item = model.dependTaskList[i].dependItemList[j] const item = model.dependTaskList[i].dependItemList[j]
if (item.definitionCode) if (item.definitionCode)
item.depTaskCode = dependentType === 'DEPENDENT_ON_WORKFLOW' ? 0 : -1 item.depTaskCode =
dependentType === 'DEPENDENT_ON_WORKFLOW' ? 0 : -1
} }
}, },
options: DependentTypeOptions, options: DependentTypeOptions,
@ -388,7 +388,8 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] {
const item = model.dependTaskList[i].dependItemList[j] const item = model.dependTaskList[i].dependItemList[j]
selectOptions.value[i].dependItemList[j].depTaskCodeOptions = selectOptions.value[i].dependItemList[j].depTaskCodeOptions =
await getTaskList(item.projectCode, processCode) await getTaskList(item.projectCode, processCode)
item.depTaskCode = item.dependentType === 'DEPENDENT_ON_WORKFLOW' ? 0 : -1 item.depTaskCode =
item.dependentType === 'DEPENDENT_ON_WORKFLOW' ? 0 : -1
} }
}, },
options: options:

2
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts

@ -70,7 +70,7 @@ export function useEnvironmentName(
) )
if (model?.environmentCode) { if (model?.environmentCode) {
if (options.value) { if (options.value) {
let elementExists = const elementExists =
options.value.find( options.value.find(
(item) => item.value === model.environmentCode (item) => item.value === model.environmentCode
) !== undefined ) !== undefined

7
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-hive-cli.ts

@ -24,9 +24,7 @@ export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
const hiveSqlScriptSpan = computed(() => const hiveSqlScriptSpan = computed(() =>
model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0 model.hiveCliTaskExecutionType === 'SCRIPT' ? 24 : 0
) )
const resourcesRequired = ref( const resourcesRequired = ref(model.hiveCliTaskExecutionType !== 'SCRIPT')
model.hiveCliTaskExecutionType !== 'SCRIPT'
)
const resourcesLimit = computed(() => const resourcesLimit = computed(() =>
model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1 model.hiveCliTaskExecutionType === 'SCRIPT' ? -1 : 1
@ -46,8 +44,7 @@ export function useHiveCli(model: { [field: string]: any }): IJsonItem[] {
watch( watch(
() => model.hiveCliTaskExecutionType, () => model.hiveCliTaskExecutionType,
() => { () => {
resourcesRequired.value = resourcesRequired.value = model.hiveCliTaskExecutionType !== 'SCRIPT'
model.hiveCliTaskExecutionType !== 'SCRIPT'
} }
) )

1
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-k8s.ts

@ -111,7 +111,6 @@ export function useK8s(model: { [field: string]: any }): IJsonItem[] {
] ]
} }
export const IMAGE_PULL_POLICY_LIST = [ export const IMAGE_PULL_POLICY_LIST = [
{ {
value: 'IfNotPresent', value: 'IfNotPresent',

2
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-queue.ts

@ -27,6 +27,6 @@ export function useYarnQueue(): IJsonItem {
span: 12, span: 12,
props: { props: {
placeholder: t('project.node.yarn_queue_tips') placeholder: t('project.node.yarn_queue_tips')
}, }
} }
} }

8
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-spark.ts

@ -39,7 +39,9 @@ export function useSpark(model: { [field: string]: any }): IJsonItem[] {
const mainArgsSpan = computed(() => (model.programType === 'SQL' ? 0 : 24)) const mainArgsSpan = computed(() => (model.programType === 'SQL' ? 0 : 24))
const rawScriptSpan = computed(() => (model.programType === 'SQL' && model.sqlExecutionType === 'SCRIPT' ? 24 : 0)) const rawScriptSpan = computed(() =>
model.programType === 'SQL' && model.sqlExecutionType === 'SCRIPT' ? 24 : 0
)
const showCluster = computed(() => model.programType !== 'SQL') const showCluster = computed(() => model.programType !== 'SQL')
@ -51,7 +53,9 @@ export function useSpark(model: { [field: string]: any }): IJsonItem[] {
model.programType === 'SQL' && model.sqlExecutionType === 'FILE' ? 1 : -1 model.programType === 'SQL' && model.sqlExecutionType === 'FILE' ? 1 : -1
) )
const sqlExecutionTypeSpan = computed(() => (model.programType === 'SQL' ? 12 : 0)) const sqlExecutionTypeSpan = computed(() =>
model.programType === 'SQL' ? 12 : 0
)
const SQL_EXECUTION_TYPES = [ const SQL_EXECUTION_TYPES = [
{ {

41
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-datasource.ts

@ -15,11 +15,11 @@
* limitations under the License. * limitations under the License.
*/ */
import {onMounted, ref, Ref, watch} from 'vue' import { onMounted, ref, Ref, watch } from 'vue'
import {queryDataSourceList} from '@/service/modules/data-source' import { queryDataSourceList } from '@/service/modules/data-source'
import {useI18n} from 'vue-i18n' import { useI18n } from 'vue-i18n'
import type {IJsonItem, IDataBase} from '../types' import type { IJsonItem, IDataBase } from '../types'
import type {TypeReq} from '@/service/modules/data-source/types' import type { TypeReq } from '@/service/modules/data-source/types'
export function useDatasource( export function useDatasource(
model: { [field: string]: any }, model: { [field: string]: any },
@ -27,24 +27,28 @@ export function useDatasource(
fieldType: string, fieldType: string,
fieldDatasource: string fieldDatasource: string
): IJsonItem[] { ): IJsonItem[] {
const {t} = useI18n() const { t } = useI18n()
const dataSourceList = ref([]) const dataSourceList = ref([])
const loading = ref(false) const loading = ref(false)
const hadoopSourceTypes = ref(['HIVE', 'HDFS']) const hadoopSourceTypes = ref(['HIVE', 'HDFS'])
const getDataSource = async (type: IDataBase) => { const getDataSource = async (type: IDataBase) => {
if (hadoopSourceTypes.value.some(source => source === type)) { if (hadoopSourceTypes.value.some((source) => source === type)) {
loading.value = false; loading.value = false
return return
} }
loading.value = true loading.value = true
if (model.modelType === 'import') { if (model.modelType === 'import') {
model.sourceMysqlDatasource = model.sourceMysqlDatasource ? model.sourceMysqlDatasource : '' model.sourceMysqlDatasource = model.sourceMysqlDatasource
model.sourceMysqlType = type; ? model.sourceMysqlDatasource
: ''
model.sourceMysqlType = type
} else { } else {
model.sourceMysqlDatasource = model.targetMysqlDatasource ? model.targetMysqlDatasource : '' model.sourceMysqlDatasource = model.targetMysqlDatasource
model.targetMysqlType = type; ? model.targetMysqlDatasource
: ''
model.targetMysqlType = type
} }
const params = {type, testFlag: 0} as TypeReq const params = { type, testFlag: 0 } as TypeReq
const result = await queryDataSourceList(params) const result = await queryDataSourceList(params)
dataSourceList.value = result.map((item: { name: string; id: number }) => ({ dataSourceList.value = result.map((item: { name: string; id: number }) => ({
label: item.name, label: item.name,
@ -57,18 +61,14 @@ export function useDatasource(
}) })
watch( watch(
() => [ () => [model.sourceType],
model.sourceType,
],
() => { () => {
getDataSource(model.sourceType) getDataSource(model.sourceType)
} }
) )
watch( watch(
() => [ () => [model.targetType],
model.targetType,
],
() => { () => {
getDataSource(model.targetType) getDataSource(model.targetType)
} }
@ -80,8 +80,7 @@ export function useDatasource(
name: t('project.node.datasource'), name: t('project.node.datasource'),
span: 0, span: 0,
validate: { validate: {
required: true, required: true
} }
}, },
{ {

38
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-source-type.ts

@ -15,18 +15,18 @@
* limitations under the License. * limitations under the License.
*/ */
import {h, onMounted, Ref, ref, watch} from 'vue' import { h, onMounted, Ref, ref, watch } from 'vue'
import {useI18n} from 'vue-i18n' import { useI18n } from 'vue-i18n'
import {useDatasource} from './use-sqoop-datasource' import { useDatasource } from './use-sqoop-datasource'
import {useCustomParams} from '.' import { useCustomParams } from '.'
import styles from '../index.module.scss' import styles from '../index.module.scss'
import type {IJsonItem, IOption, ModelType} from '../types' import type { IJsonItem, IOption, ModelType } from '../types'
export function useSourceType( export function useSourceType(
model: { [field: string]: any }, model: { [field: string]: any },
unCustomSpan: Ref<number> unCustomSpan: Ref<number>
): IJsonItem[] { ): IJsonItem[] {
const {t} = useI18n() const { t } = useI18n()
const rdbmsSpan = ref(24) const rdbmsSpan = ref(24)
const tableSpan = ref(0) const tableSpan = ref(0)
const editorSpan = ref(24) const editorSpan = ref(24)
@ -57,7 +57,8 @@ export function useSourceType(
{ {
label: 'HIVE', label: 'HIVE',
value: 'HIVE' value: 'HIVE'
}, { },
{
label: 'HDFS', label: 'HDFS',
value: 'HDFS' value: 'HDFS'
} }
@ -65,14 +66,20 @@ export function useSourceType(
const sourceTypes = ref() const sourceTypes = ref()
const resetSpan = () => { const resetSpan = () => {
rdbmsSpan.value = rdbmsSpan.value =
unCustomSpan.value && rdbmsSourceTypes.value.some(source => source.value === model.sourceType) ? 24 : 0 unCustomSpan.value &&
rdbmsSourceTypes.value.some((source) => source.value === model.sourceType)
? 24
: 0
tableSpan.value = rdbmsSpan.value && model.srcQueryType === '0' ? 24 : 0 tableSpan.value = rdbmsSpan.value && model.srcQueryType === '0' ? 24 : 0
editorSpan.value = rdbmsSpan.value && model.srcQueryType === '1' ? 24 : 0 editorSpan.value = rdbmsSpan.value && model.srcQueryType === '1' ? 24 : 0
columnSpan.value = tableSpan.value && model.srcColumnType === '1' ? 24 : 0 columnSpan.value = tableSpan.value && model.srcColumnType === '1' ? 24 : 0
hiveSpan.value = unCustomSpan.value && model.sourceType === 'HIVE' ? 24 : 0 hiveSpan.value = unCustomSpan.value && model.sourceType === 'HIVE' ? 24 : 0
hdfsSpan.value = unCustomSpan.value && model.sourceType === 'HDFS' ? 24 : 0 hdfsSpan.value = unCustomSpan.value && model.sourceType === 'HDFS' ? 24 : 0
datasourceSpan.value = datasourceSpan.value =
unCustomSpan.value && rdbmsSourceTypes.value.some(source => source.value === model.sourceType) ? 24 : 0 unCustomSpan.value &&
rdbmsSourceTypes.value.some((source) => source.value === model.sourceType)
? 24
: 0
} }
const resetValue = () => { const resetValue = () => {
if (!isChange.value) { if (!isChange.value) {
@ -93,7 +100,6 @@ export function useSourceType(
default: default:
model.sourceMysqlDatasource = '' model.sourceMysqlDatasource = ''
} }
} }
const getSourceTypesByModelType = (modelType: ModelType): IOption[] => { const getSourceTypesByModelType = (modelType: ModelType): IOption[] => {
switch (modelType) { switch (modelType) {
@ -107,7 +113,7 @@ export function useSourceType(
} }
onMounted(() => { onMounted(() => {
sourceTypes.value = [...rdbmsSourceTypes.value]; sourceTypes.value = [...rdbmsSourceTypes.value]
}) })
watch( watch(
@ -125,8 +131,8 @@ export function useSourceType(
model.srcColumnType model.srcColumnType
], ],
() => { () => {
resetValue(); resetValue()
resetSpan(); resetSpan()
} }
) )
@ -137,7 +143,7 @@ export function useSourceType(
span: unCustomSpan, span: unCustomSpan,
widget: h( widget: h(
'div', 'div',
{class: styles['field-title']}, { class: styles['field-title'] },
t('project.node.data_source') t('project.node.data_source')
) )
}, },
@ -199,8 +205,8 @@ export function useSourceType(
name: t('project.node.column_type'), name: t('project.node.column_type'),
span: tableSpan, span: tableSpan,
options: [ options: [
{label: t('project.node.all_columns'), value: '0'}, { label: t('project.node.all_columns'), value: '0' },
{label: t('project.node.some_columns'), value: '1'} { label: t('project.node.some_columns'), value: '1' }
] ]
}, },
{ {

50
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-sqoop-target-type.ts

@ -15,17 +15,17 @@
* limitations under the License. * limitations under the License.
*/ */
import {h, onMounted, Ref, ref, watch} from 'vue' import { h, onMounted, Ref, ref, watch } from 'vue'
import {useI18n} from 'vue-i18n' import { useI18n } from 'vue-i18n'
import {useDatasource} from './use-sqoop-datasource' import { useDatasource } from './use-sqoop-datasource'
import styles from '../index.module.scss' import styles from '../index.module.scss'
import type {IJsonItem, IOption, SourceType} from '../types' import type { IJsonItem, IOption, SourceType } from '../types'
export function useTargetType( export function useTargetType(
model: { [field: string]: any }, model: { [field: string]: any },
unCustomSpan: Ref<number> unCustomSpan: Ref<number>
): IJsonItem[] { ): IJsonItem[] {
const {t} = useI18n() const { t } = useI18n()
const hiveSpan = ref(24) const hiveSpan = ref(24)
const hdfsSpan = ref(0) const hdfsSpan = ref(0)
const rdbmsSpan = ref(0) const rdbmsSpan = ref(0)
@ -54,7 +54,8 @@ export function useTargetType(
{ {
label: 'HIVE', label: 'HIVE',
value: 'HIVE' value: 'HIVE'
}, { },
{
label: 'HDFS', label: 'HDFS',
value: 'HDFS' value: 'HDFS'
} }
@ -65,9 +66,15 @@ export function useTargetType(
hiveSpan.value = unCustomSpan.value && model.targetType === 'HIVE' ? 24 : 0 hiveSpan.value = unCustomSpan.value && model.targetType === 'HIVE' ? 24 : 0
hdfsSpan.value = unCustomSpan.value && model.targetType === 'HDFS' ? 24 : 0 hdfsSpan.value = unCustomSpan.value && model.targetType === 'HDFS' ? 24 : 0
rdbmsSpan.value = rdbmsSpan.value =
unCustomSpan.value && rdbmsSourceTypes.value.some(target => target.value === model.targetType) ? 24 : 0 unCustomSpan.value &&
rdbmsSourceTypes.value.some((target) => target.value === model.targetType)
? 24
: 0
dataSourceSpan.value = dataSourceSpan.value =
unCustomSpan.value && rdbmsSourceTypes.value.some(target => target.value === model.targetType) ? 24 : 0 unCustomSpan.value &&
rdbmsSourceTypes.value.some((target) => target.value === model.targetType)
? 24
: 0
updateSpan.value = rdbmsSpan.value && model.targetMysqlIsUpdate ? 24 : 0 updateSpan.value = rdbmsSpan.value && model.targetMysqlIsUpdate ? 24 : 0
} }
@ -96,26 +103,25 @@ export function useTargetType(
} }
switch (model.modelType) { switch (model.modelType) {
case 'import': case 'import':
model.targetHiveDatabase = ''; model.targetHiveDatabase = ''
model.targetHiveTable = ''; model.targetHiveTable = ''
model.targetHdfsTargetPath = ''; model.targetHdfsTargetPath = ''
break break
case 'export': case 'export':
model.targetMysqlDatasource = ''; model.targetMysqlDatasource = ''
model.targetMysqlTable = ''; model.targetMysqlTable = ''
model.targetMysqlColumns = ''; model.targetMysqlColumns = ''
model.targetMysqlFieldsTerminated = ''; model.targetMysqlFieldsTerminated = ''
model.targetMysqlLinesTerminated = ''; model.targetMysqlLinesTerminated = ''
model.targetMysqlTable = ''; model.targetMysqlTable = ''
break break
default: default:
model.sourceMysqlDatasource = ''; model.sourceMysqlDatasource = ''
} }
} }
onMounted(() => { onMounted(() => {
targetTypes.value = [...hadoopSourceTypes.value]; targetTypes.value = [...hadoopSourceTypes.value]
}) })
watch( watch(
@ -129,7 +135,7 @@ export function useTargetType(
watch( watch(
() => [unCustomSpan.value, model.targetType, model.targetMysqlIsUpdate], () => [unCustomSpan.value, model.targetType, model.targetMysqlIsUpdate],
() => { () => {
resetValue(); resetValue()
resetSpan() resetSpan()
} }
) )
@ -141,7 +147,7 @@ export function useTargetType(
span: unCustomSpan, span: unCustomSpan,
widget: h( widget: h(
'div', 'div',
{class: styles['field-title']}, { class: styles['field-title'] },
t('project.node.data_target') t('project.node.data_target')
) )
}, },

5
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-worker-group.ts

@ -30,7 +30,10 @@ export function useWorkerGroup(projectCode: number): IJsonItem {
if (loading.value) return if (loading.value) return
loading.value = true loading.value = true
await queryWorkerGroupsByProjectCode(projectCode).then((res: any) => { await queryWorkerGroupsByProjectCode(projectCode).then((res: any) => {
options.value = res.data.map((item: any) =>({label: item.workerGroup, value: item.workerGroup })) options.value = res.data.map((item: any) => ({
label: item.workerGroup,
value: item.workerGroup
}))
}) })
loading.value = false loading.value = false
} }

8
dolphinscheduler-ui/src/views/projects/task/components/node/format-data.ts

@ -25,7 +25,7 @@ import type {
ILocalParam, ILocalParam,
IDependentParameters IDependentParameters
} from './types' } from './types'
import {ref} from "vue"; import { ref } from 'vue'
export function formatParams(data: INodeData): { export function formatParams(data: INodeData): {
processDefinitionCode: string processDefinitionCode: string
@ -132,7 +132,9 @@ export function formatParams(data: INodeData): {
fieldsTerminated: data.targetHdfsFieldsTerminated, fieldsTerminated: data.targetHdfsFieldsTerminated,
linesTerminated: data.targetHdfsLinesTerminated linesTerminated: data.targetHdfsLinesTerminated
} }
} else if (rdbmsSourceTypes.value.some(target => target === data.targetType)){ } else if (
rdbmsSourceTypes.value.some((target) => target === data.targetType)
) {
targetParams = { targetParams = {
targetType: data.targetMysqlType, targetType: data.targetMysqlType,
targetDatasource: data.targetMysqlDatasource, targetDatasource: data.targetMysqlDatasource,
@ -145,7 +147,7 @@ export function formatParams(data: INodeData): {
targetUpdateMode: data.targetMysqlUpdateMode targetUpdateMode: data.targetMysqlUpdateMode
} }
} }
if (rdbmsSourceTypes.value.some(target => target === data.sourceType)) { if (rdbmsSourceTypes.value.some((target) => target === data.sourceType)) {
sourceParams = { sourceParams = {
srcTable: data.srcQueryType === '1' ? '' : data.srcTable, srcTable: data.srcQueryType === '1' ? '' : data.srcTable,
srcColumnType: data.srcQueryType === '1' ? '0' : data.srcColumnType, srcColumnType: data.srcQueryType === '1' ? '0' : data.srcColumnType,

2
dolphinscheduler-ui/src/views/projects/task/components/node/tasks/use-mr.ts

@ -45,7 +45,7 @@ export function useMr({
timeout: 30, timeout: 30,
programType: 'SCALA', programType: 'SCALA',
timeoutNotifyStrategy: ['WARN'], timeoutNotifyStrategy: ['WARN'],
yarnQueue: '', yarnQueue: ''
} as INodeData) } as INodeData)
return { return {

23
dolphinscheduler-ui/src/views/projects/task/components/node/use-task.ts

@ -14,12 +14,19 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {ref, Ref, unref} from 'vue' import { ref, Ref, unref } from 'vue'
import nodes from './tasks' import nodes from './tasks'
import getElementByJson from '@/components/form/get-elements-by-json' import getElementByJson from '@/components/form/get-elements-by-json'
import {useTaskNodeStore} from '@/store/project/task-node' import { useTaskNodeStore } from '@/store/project/task-node'
import {TASK_TYPES_MAP} from '@/store/project/task-type' import { TASK_TYPES_MAP } from '@/store/project/task-type'
import type {EditWorkflowDefinition, FormRules, IFormItem, IJsonItem, INodeData, ITaskData} from './types' import type {
EditWorkflowDefinition,
FormRules,
IFormItem,
IJsonItem,
INodeData,
ITaskData
} from './types'
export function useTask({ export function useTask({
data, data,
@ -27,7 +34,7 @@ export function useTask({
from, from,
readonly, readonly,
definition definition
}: { }: {
data: ITaskData data: ITaskData
projectCode: number projectCode: number
from?: number from?: number
@ -56,7 +63,7 @@ export function useTask({
} }
} }
const {model, json} = nodes[data.taskType || 'SHELL'](params) const { model, json } = nodes[data.taskType || 'SHELL'](params)
jsonRef.value = json jsonRef.value = json
model.preTasks = taskStore.getPreTasks model.preTasks = taskStore.getPreTasks
model.name = taskStore.getName model.name = taskStore.getName
@ -64,12 +71,12 @@ export function useTask({
TASK_TYPES_MAP[data.taskType || 'SHELL'].taskExecuteType || 'BATCH' TASK_TYPES_MAP[data.taskType || 'SHELL'].taskExecuteType || 'BATCH'
const getElements = () => { const getElements = () => {
const {rules, elements} = getElementByJson(jsonRef.value, model) const { rules, elements } = getElementByJson(jsonRef.value, model)
elementsRef.value = elements elementsRef.value = elements
rulesRef.value = rules rulesRef.value = rules
} }
getElements() getElements()
return {elementsRef, rulesRef, model} return { elementsRef, rulesRef, model }
} }

2
dolphinscheduler-ui/src/views/projects/task/definition/batch-task.tsx

@ -41,7 +41,7 @@ import Card from '@/components/card'
import VersionModal from './components/version-modal' import VersionModal from './components/version-modal'
import TaskModal from '@/views/projects/task/components/node/detail-modal' import TaskModal from '@/views/projects/task/components/node/detail-modal'
import type { INodeData } from './types' import type { INodeData } from './types'
import DependenciesModal from "@/views/projects/components/dependencies/dependencies-modal"; import DependenciesModal from '@/views/projects/components/dependencies/dependencies-modal'
const BatchTaskDefinition = defineComponent({ const BatchTaskDefinition = defineComponent({
name: 'batch-task-definition', name: 'batch-task-definition',

22
dolphinscheduler-ui/src/views/projects/task/definition/use-table.ts

@ -56,7 +56,7 @@ export function useTable(onEdit: Function) {
const route = useRoute() const route = useRoute()
const projectCode = Number(route.params.projectCode) const projectCode = Number(route.params.projectCode)
const {getDependentTaskLinksByTask} = useDependencies() const { getDependentTaskLinksByTask } = useDependencies()
const createColumns = (variables: any) => { const createColumns = (variables: any) => {
variables.columns = [ variables.columns = [
@ -268,12 +268,22 @@ export function useTable(onEdit: Function) {
dependentTaskLinksRef: ref([]), dependentTaskLinksRef: ref([]),
row: {}, row: {},
loadingRef: ref(false), loadingRef: ref(false),
dependenciesData: ref({showRef: ref(false), taskLinks: ref([]), required: ref(false), tip: ref(''), action:() => {}}), dependenciesData: ref({
showRef: ref(false),
taskLinks: ref([]),
required: ref(false),
tip: ref(''),
action: () => {}
})
}) })
const handleDelete = (row: any) => { const handleDelete = (row: any) => {
variables.row = row variables.row = row
getDependentTaskLinksByTask(projectCode, row.processDefinitionCode, row.taskCode).then((res: any) =>{ getDependentTaskLinksByTask(
projectCode,
row.processDefinitionCode,
row.taskCode
).then((res: any) => {
if (res && res.length > 0) { if (res && res.length > 0) {
variables.dependenciesData = { variables.dependenciesData = {
showRef: true, showRef: true,
@ -283,7 +293,8 @@ export function useTable(onEdit: Function) {
action: () => {} action: () => {}
} }
} else { } else {
deleteTaskDefinition({ code: row.taskCode }, { projectCode }).then(() => { deleteTaskDefinition({ code: row.taskCode }, { projectCode }).then(
() => {
getTableData({ getTableData({
pageSize: variables.pageSize, pageSize: variables.pageSize,
pageNo: pageNo:
@ -294,7 +305,8 @@ export function useTable(onEdit: Function) {
searchWorkflowName: variables.searchWorkflowName, searchWorkflowName: variables.searchWorkflowName,
taskType: variables.taskType taskType: variables.taskType
}) })
}) }
)
} }
}) })
} }

16
dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx

@ -23,8 +23,8 @@ import { useRoute } from 'vue-router'
import styles from './menu.module.scss' import styles from './menu.module.scss'
import { uuid } from '@/common/common' import { uuid } from '@/common/common'
import { IWorkflowTaskInstance } from './types' import { IWorkflowTaskInstance } from './types'
import {NButton} from 'naive-ui' import { NButton } from 'naive-ui'
import {useDependencies} from "@/views/projects/components/dependencies/use-dependencies" import { useDependencies } from '@/views/projects/components/dependencies/use-dependencies'
const props = { const props = {
startDisplay: { startDisplay: {
@ -146,13 +146,19 @@ export default defineComponent({
} }
const handleDelete = async () => { const handleDelete = async () => {
let taskCode = props.cell?.id const taskCode = props.cell?.id
let res = await getDependentTaskLinksByTask(projectCode, workflowCode, taskCode) const res = await getDependentTaskLinksByTask(
projectCode,
workflowCode,
taskCode
)
dependenciesData.showRef = false dependenciesData.showRef = false
if (res.length > 0) { if (res.length > 0) {
dependenciesData.showRef = true dependenciesData.showRef = true
dependenciesData.taskLinks = res dependenciesData.taskLinks = res
dependenciesData.tip = t('project.task.delete_validate_dependent_tasks_desc') dependenciesData.tip = t(
'project.task.delete_validate_dependent_tasks_desc'
)
dependenciesData.required = true dependenciesData.required = true
} else { } else {
graph.value?.removeCell(props.cell) graph.value?.removeCell(props.cell)

12
dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-toolbar.tsx

@ -49,7 +49,7 @@ import type { Graph } from '@antv/x6'
import StartupParam from './dag-startup-param' import StartupParam from './dag-startup-param'
import VariablesView from '@/views/projects/workflow/instance/components/variables-view' import VariablesView from '@/views/projects/workflow/instance/components/variables-view'
import { WorkflowDefinition, WorkflowInstance } from './types' import { WorkflowDefinition, WorkflowInstance } from './types'
import { useDependencies } from "@/views/projects/components/dependencies/use-dependencies" import { useDependencies } from '@/views/projects/components/dependencies/use-dependencies'
const props = { const props = {
layoutToggle: { layoutToggle: {
@ -181,11 +181,17 @@ export default defineComponent({
const codes = cells const codes = cells
.filter((cell) => cell.isNode()) .filter((cell) => cell.isNode())
.map((cell) => +cell.id) .map((cell) => +cell.id)
const res = await getDependentTaskLinksByMultipleTasks(projectCode, workflowCode, codes) const res = await getDependentTaskLinksByMultipleTasks(
projectCode,
workflowCode,
codes
)
if (res.length > 0) { if (res.length > 0) {
dependenciesData.showRef = true dependenciesData.showRef = true
dependenciesData.taskLinks = res dependenciesData.taskLinks = res
dependenciesData.tip = t('project.task.delete_validate_dependent_tasks_desc') dependenciesData.tip = t(
'project.task.delete_validate_dependent_tasks_desc'
)
dependenciesData.required = true dependenciesData.required = true
} else { } else {
context.emit('removeTasks', codes, cells) context.emit('removeTasks', codes, cells)

8
dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx

@ -24,7 +24,8 @@ import {
toRef, toRef,
watch, watch,
onBeforeUnmount, onBeforeUnmount,
computed, reactive computed,
reactive
} from 'vue' } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
@ -57,7 +58,7 @@ import utils from '@/utils'
import { useUISettingStore } from '@/store/ui-setting/ui-setting' import { useUISettingStore } from '@/store/ui-setting/ui-setting'
import { executeTask } from '@/service/modules/executors' import { executeTask } from '@/service/modules/executors'
import { removeTaskInstanceCache } from '@/service/modules/task-instances' import { removeTaskInstanceCache } from '@/service/modules/task-instances'
import DependenciesModal from "@/views/projects/components/dependencies/dependencies-modal"; import DependenciesModal from '@/views/projects/components/dependencies/dependencies-modal'
const props = { const props = {
// If this prop is passed, it means from definition detail // If this prop is passed, it means from definition detail
@ -338,7 +339,8 @@ export default defineComponent({
showRef: ref(false), showRef: ref(false),
taskLinks: ref([]), taskLinks: ref([]),
required: ref(false), required: ref(false),
tip: ref(''), action: () => {} tip: ref(''),
action: () => {}
}) })
watch( watch(

5
dolphinscheduler-ui/src/views/projects/workflow/components/dag/use-node-status.ts

@ -81,7 +81,10 @@ export function useNodeStatus(options: Options) {
taskList.value.forEach((taskInstance: any) => { taskList.value.forEach((taskInstance: any) => {
setNodeStatus(taskInstance.taskCode, taskInstance.state, taskInstance) setNodeStatus(taskInstance.taskCode, taskInstance.state, taskInstance)
if (taskInstance.dependentResult) { if (taskInstance.dependentResult) {
Object.assign(allDependentResult, JSON.parse(taskInstance.dependentResult)) Object.assign(
allDependentResult,
JSON.parse(taskInstance.dependentResult)
)
} }
}) })
nodeStore.updateDependentResult(allDependentResult) nodeStore.updateDependentResult(allDependentResult)

2
dolphinscheduler-ui/src/views/projects/workflow/definition/components/start-modal.tsx

@ -191,7 +191,7 @@ export default defineComponent({
options: Array<any>, options: Array<any>,
findingValue: string findingValue: string
): boolean => { ): boolean => {
for (let { value } of options) { for (const { value } of options) {
if (findingValue === value) { if (findingValue === value) {
return true return true
} }

9
dolphinscheduler-ui/src/views/projects/workflow/definition/components/table-action.tsx

@ -169,7 +169,10 @@ export default defineComponent({
trigger: () => ( trigger: () => (
<NPopconfirm onPositiveClick={this.handleReleaseWorkflow}> <NPopconfirm onPositiveClick={this.handleReleaseWorkflow}>
{{ {{
default: () => releaseState === 'OFFLINE' ? t('project.workflow.confirm_to_online'):t('project.workflow.confirm_to_offline'), default: () =>
releaseState === 'OFFLINE'
? t('project.workflow.confirm_to_online')
: t('project.workflow.confirm_to_offline'),
trigger: () => ( trigger: () => (
<NButton <NButton
size='small' size='small'
@ -220,7 +223,9 @@ export default defineComponent({
<NPopconfirm onPositiveClick={this.handleReleaseScheduler}> <NPopconfirm onPositiveClick={this.handleReleaseScheduler}>
{{ {{
default: () => default: () =>
scheduleReleaseState === 'OFFLINE' ? t('project.workflow.time_to_online'):t('project.workflow.time_to_offline'), scheduleReleaseState === 'OFFLINE'
? t('project.workflow.time_to_online')
: t('project.workflow.time_to_offline'),
trigger: () => ( trigger: () => (
<NButton <NButton
size='small' size='small'

2
dolphinscheduler-ui/src/views/projects/workflow/definition/components/timing-modal.tsx

@ -210,7 +210,7 @@ export default defineComponent({
options: Array<any>, options: Array<any>,
findingValue: string findingValue: string
): boolean => { ): boolean => {
for (let { value } of options) { for (const { value } of options) {
if (findingValue === value) { if (findingValue === value) {
return true return true
} }

5
dolphinscheduler-ui/src/views/projects/workflow/definition/components/use-modal.ts

@ -229,7 +229,10 @@ export function useModal(
const getWorkerGroups = () => { const getWorkerGroups = () => {
queryWorkerGroupsByProjectCode(variables.projectCode).then((res: any) => { queryWorkerGroupsByProjectCode(variables.projectCode).then((res: any) => {
variables.workerGroups = res.data.map((item: any) =>({label: item.workerGroup, value: item.workerGroup })) variables.workerGroups = res.data.map((item: any) => ({
label: item.workerGroup,
value: item.workerGroup
}))
}) })
} }

2
dolphinscheduler-ui/src/views/projects/workflow/definition/index.tsx

@ -24,7 +24,7 @@ import {
NSpace, NSpace,
NTooltip, NTooltip,
NPopconfirm, NPopconfirm,
NModal, NModal
} from 'naive-ui' } from 'naive-ui'
import { import {
defineComponent, defineComponent,

2
dolphinscheduler-ui/src/views/projects/workflow/definition/timing/index.tsx

@ -24,7 +24,7 @@ import { useTable } from './use-table'
import Card from '@/components/card' import Card from '@/components/card'
import TimingModal from '../components/timing-modal' import TimingModal from '../components/timing-modal'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import DependenciesModal from "@/views/projects/components/dependencies/dependencies-modal"; import DependenciesModal from '@/views/projects/components/dependencies/dependencies-modal'
export default defineComponent({ export default defineComponent({
name: 'WorkflowDefinitionTiming', name: 'WorkflowDefinitionTiming',

36
dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts

@ -39,13 +39,13 @@ import {
import { format } from 'date-fns-tz' import { format } from 'date-fns-tz'
import { ISearchParam } from './types' import { ISearchParam } from './types'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import { useDependencies } from "@/views/projects/components/dependencies/use-dependencies" import { useDependencies } from '@/views/projects/components/dependencies/use-dependencies'
export function useTable() { export function useTable() {
const { t } = useI18n() const { t } = useI18n()
const router: Router = useRouter() const router: Router = useRouter()
const {getDependentTaskLinks} = useDependencies() const { getDependentTaskLinks } = useDependencies()
const variables = reactive({ const variables = reactive({
columns: [], columns: [],
@ -62,7 +62,13 @@ export function useTable() {
processDefinitionCode: router.currentRoute.value.params.definitionCode processDefinitionCode: router.currentRoute.value.params.definitionCode
? ref(Number(router.currentRoute.value.params.definitionCode)) ? ref(Number(router.currentRoute.value.params.definitionCode))
: ref(), : ref(),
dependenciesData: ref({showRef: false, taskLinks: ref([]), required: ref(false), tip: ref(''), action:() => {}}), dependenciesData: ref({
showRef: false,
taskLinks: ref([]),
required: ref(false),
tip: ref(''),
action: () => {}
})
}) })
const renderTime = (time: string, timeZone: string) => { const renderTime = (time: string, timeZone: string) => {
@ -165,7 +171,7 @@ export function useTable() {
? t('project.workflow.down_line') ? t('project.workflow.down_line')
: t('project.workflow.up_line') : t('project.workflow.up_line')
} }
), )
] ]
}) })
} }
@ -176,7 +182,6 @@ export function useTable() {
} }
} }
const createColumns = (variables: any) => { const createColumns = (variables: any) => {
variables.columns = [ variables.columns = [
{ {
@ -394,11 +399,16 @@ export function useTable() {
const handleReleaseState = (row: any) => { const handleReleaseState = (row: any) => {
if (row.releaseState === 'ONLINE') { if (row.releaseState === 'ONLINE') {
variables.row = row variables.row = row
getDependentTaskLinks(variables.projectCode, row.processDefinitionCode).then((res: any) =>{ getDependentTaskLinks(
variables.projectCode,
row.processDefinitionCode
).then((res: any) => {
if (res && res.length > 0) { if (res && res.length > 0) {
variables.dependenciesData.showRef = true variables.dependenciesData.showRef = true
variables.dependenciesData.taskLinks = res variables.dependenciesData.taskLinks = res
variables.dependenciesData.tip = t('project.workflow.warning_delete_scheduler_dependent_tasks_desc') variables.dependenciesData.tip = t(
'project.workflow.warning_delete_scheduler_dependent_tasks_desc'
)
variables.dependenciesData.required = false variables.dependenciesData.required = false
variables.dependenciesData.action = confirmToOfflineSchedule variables.dependenciesData.action = confirmToOfflineSchedule
} else { } else {
@ -412,7 +422,8 @@ export function useTable() {
processDefinitionCode: variables.processDefinitionCode processDefinitionCode: variables.processDefinitionCode
}) })
}) })
}}) }
})
} else { } else {
online(variables.projectCode, row.id).then(() => { online(variables.projectCode, row.id).then(() => {
window.$message.success(t('project.workflow.success')) window.$message.success(t('project.workflow.success'))
@ -461,11 +472,16 @@ export function useTable() {
variables.page -= 1 variables.page -= 1
} }
variables.row = row variables.row = row
getDependentTaskLinks(variables.projectCode, row.processDefinitionCode).then((res: any) =>{ getDependentTaskLinks(
variables.projectCode,
row.processDefinitionCode
).then((res: any) => {
if (res && res.length > 0) { if (res && res.length > 0) {
variables.dependenciesData.showRef = true variables.dependenciesData.showRef = true
variables.dependenciesData.taskLinks = res variables.dependenciesData.taskLinks = res
variables.dependenciesData.tip = t('project.workflow.warning_delete_scheduler_dependent_tasks_desc') variables.dependenciesData.tip = t(
'project.workflow.warning_delete_scheduler_dependent_tasks_desc'
)
variables.dependenciesData.required = false variables.dependenciesData.required = false
variables.dependenciesData.action = confirmToDeleteSchedule variables.dependenciesData.action = confirmToDeleteSchedule
} else { } else {

29
dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts

@ -43,7 +43,7 @@ import {
import type { IDefinitionParam } from './types' import type { IDefinitionParam } from './types'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import type { TableColumns, RowKey } from 'naive-ui/es/data-table/src/interface' import type { TableColumns, RowKey } from 'naive-ui/es/data-table/src/interface'
import {useDependencies} from '../../components/dependencies/use-dependencies' import { useDependencies } from '../../components/dependencies/use-dependencies'
export function useTable() { export function useTable() {
const { t } = useI18n() const { t } = useI18n()
@ -71,7 +71,13 @@ export function useTable() {
copyShowRef: ref(false), copyShowRef: ref(false),
loadingRef: ref(false), loadingRef: ref(false),
setTimingDialogShowRef: ref(false), setTimingDialogShowRef: ref(false),
dependenciesData: ref({showRef: false, taskLinks: ref([]), required: ref(false), tip: ref(''), action:() => {}}), dependenciesData: ref({
showRef: false,
taskLinks: ref([]),
required: ref(false),
tip: ref(''),
action: () => {}
})
}) })
const createColumns = (variables: any) => { const createColumns = (variables: any) => {
@ -404,7 +410,8 @@ export function useTable() {
}) })
}) })
} else { } else {
getDependentTaskLinks(variables.projectCode, row.code).then((res: any) => { getDependentTaskLinks(variables.projectCode, row.code).then(
(res: any) => {
if (res && res.length > 0) { if (res && res.length > 0) {
variables.dependenciesData = { variables.dependenciesData = {
showRef: true, showRef: true,
@ -423,7 +430,8 @@ export function useTable() {
}) })
}) })
} }
}) }
)
} }
} }
@ -454,12 +462,15 @@ export function useTable() {
variables.row = row variables.row = row
if (row.schedule) { if (row.schedule) {
if (row.schedule.releaseState === 'ONLINE') { if (row.schedule.releaseState === 'ONLINE') {
getDependentTaskLinks(variables.projectCode, row.code).then((res: any) => { getDependentTaskLinks(variables.projectCode, row.code).then(
(res: any) => {
if (res && res.length > 0) { if (res && res.length > 0) {
variables.dependenciesData = { variables.dependenciesData = {
showRef: true, showRef: true,
taskLinks: res, taskLinks: res,
tip: t('project.workflow.warning_offline_scheduler_dependent_tasks_desc'), tip: t(
'project.workflow.warning_offline_scheduler_dependent_tasks_desc'
),
required: false, required: false,
action: confirmToOfflineScheduler action: confirmToOfflineScheduler
} }
@ -472,7 +483,9 @@ export function useTable() {
searchVal: variables.searchVal searchVal: variables.searchVal
}) })
}) })
}}) }
}
)
} else { } else {
online(variables.projectCode, row.schedule.id).then(() => { online(variables.projectCode, row.schedule.id).then(() => {
window.$message.success(t('project.workflow.success')) window.$message.success(t('project.workflow.success'))
@ -566,6 +579,6 @@ export function useTable() {
getTableData, getTableData,
batchDeleteWorkflow, batchDeleteWorkflow,
batchExportWorkflow, batchExportWorkflow,
batchCopyWorkflow, batchCopyWorkflow
} }
} }

6
dolphinscheduler-ui/src/views/projects/workflow/timing/index.tsx

@ -15,15 +15,15 @@
* limitations under the License. * limitations under the License.
*/ */
import {NDataTable, NPagination, NSpace} from 'naive-ui' import { NDataTable, NPagination, NSpace } from 'naive-ui'
import {defineComponent, onMounted, toRefs, watch} from 'vue' import { defineComponent, onMounted, toRefs, watch } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useTable } from '../definition/timing/use-table' import { useTable } from '../definition/timing/use-table'
import Card from '@/components/card' import Card from '@/components/card'
import TimingModal from '../definition/components/timing-modal' import TimingModal from '../definition/components/timing-modal'
import TimingCondition from '@/views/projects/workflow/timing/components/timing-condition' import TimingCondition from '@/views/projects/workflow/timing/components/timing-condition'
import { ITimingSearch } from '@/views/projects/workflow/timing/types' import { ITimingSearch } from '@/views/projects/workflow/timing/types'
import DependenciesModal from "@/views/projects/components/dependencies/dependencies-modal"; import DependenciesModal from '@/views/projects/components/dependencies/dependencies-modal'
export default defineComponent({ export default defineComponent({
name: 'WorkflowTimingList', name: 'WorkflowTimingList',

10
dolphinscheduler-ui/src/views/resource/components/resource/edit/use-edit.ts

@ -63,10 +63,10 @@ export function useEdit(state: any) {
} }
} }
export const useIsDetailPageStore = defineStore("isDetailPage", { export const useIsDetailPageStore = defineStore('isDetailPage', {
state:() => { state: () => {
return { return {
isDetailPage:false isDetailPage: false
} }
}, },
getters: { getters: {
@ -82,9 +82,9 @@ export const useIsDetailPageStore = defineStore("isDetailPage", {
}) })
export const isEmpty = (string: any): boolean => { export const isEmpty = (string: any): boolean => {
if(string === '' || string === undefined || string === null){ if (string === '' || string === undefined || string === null) {
return true return true
}else{ } else {
return false return false
} }
} }

4
dolphinscheduler-ui/src/views/resource/components/resource/index.tsx

@ -110,14 +110,14 @@ export default defineComponent({
const isDetailPageStore = useIsDetailPageStore() const isDetailPageStore = useIsDetailPageStore()
const handleDetailBackList = () => { const handleDetailBackList = () => {
if(isDetailPageStore.getIsDetailPage){ if (isDetailPageStore.getIsDetailPage) {
variables.resourceType = detailPageStore.getResourceType variables.resourceType = detailPageStore.getResourceType
variables.fullName = detailPageStore.getFullName variables.fullName = detailPageStore.getFullName
variables.tenantCode = detailPageStore.getTenantCode variables.tenantCode = detailPageStore.getTenantCode
variables.searchRef = detailPageStore.getSearchValue variables.searchRef = detailPageStore.getSearchValue
variables.pagination.page = detailPageStore.getPage variables.pagination.page = detailPageStore.getPage
variables.pagination.pageSize = detailPageStore.getPageSize variables.pagination.pageSize = detailPageStore.getPageSize
if(!isEmpty(variables.searchRef)){ if (!isEmpty(variables.searchRef)) {
handleConditions() handleConditions()
} }
detailPageStore.$reset() detailPageStore.$reset()

18
dolphinscheduler-ui/src/views/resource/components/resource/table/use-table.ts

@ -245,16 +245,16 @@ export function useTable() {
handleCreateFile: createFile handleCreateFile: createFile
} }
} }
export const useDetailPageStore = defineStore("detailPage", { export const useDetailPageStore = defineStore('detailPage', {
state:() => { state: () => {
var resourceTypeInitValue:ResourceType let resourceTypeInitValue: ResourceType
return { return {
resourceType:resourceTypeInitValue!, resourceType: resourceTypeInitValue!,
fullName:'', fullName: '',
tenantCode:'', tenantCode: '',
searchValue:'', searchValue: '',
page:1, page: 1,
pageSize:10 pageSize: 10
} }
}, },
getters: { getters: {

11
dolphinscheduler-ui/src/views/resource/task-group/option/use-table.ts

@ -125,8 +125,10 @@ export function useTable(
const getTableData = (params: any) => { const getTableData = (params: any) => {
if (variables.loadingRef) return if (variables.loadingRef) return
variables.loadingRef = true variables.loadingRef = true
Promise.all([queryTaskGroupListPaging(params), queryProjectCreatedAndAuthorizedByUser()]).then( Promise.all([
(values: any[]) => { queryTaskGroupListPaging(params),
queryProjectCreatedAndAuthorizedByUser()
]).then((values: any[]) => {
variables.totalPage = values[0].totalPage variables.totalPage = values[0].totalPage
variables.tableData = values[0].totalList.map( variables.tableData = values[0].totalList.map(
(item: any, unused: number) => { (item: any, unused: number) => {
@ -147,15 +149,14 @@ export function useTable(
parseTime(item.updateTime), parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
item.status = (item.status == 'YES') ? 1 : 0 item.status = item.status == 'YES' ? 1 : 0
return { return {
...item ...item
} }
} }
) )
variables.loadingRef = false variables.loadingRef = false
} })
)
} }
return { getTableData, variables, columns } return { getTableData, variables, columns }

1
dolphinscheduler-ui/src/views/security/user-manage/use-table.ts

@ -22,7 +22,6 @@ import { parseTime } from '@/common/common'
import type { IRecord, TAuthType } from './types' import type { IRecord, TAuthType } from './types'
export function useTable() { export function useTable() {
const state = reactive({ const state = reactive({
page: 1, page: 1,
pageSize: 10, pageSize: 10,

8
dolphinscheduler-ui/src/views/security/yarn-queue-manage/use-table.ts

@ -17,12 +17,10 @@
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { reactive, h, ref } from 'vue' import { reactive, h, ref } from 'vue'
import {NButton, NIcon, NPopconfirm, NSpace, NTooltip} from 'naive-ui' import { NButton, NIcon, NPopconfirm, NSpace, NTooltip } from 'naive-ui'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { queryQueueListPaging, import { queryQueueListPaging, deleteQueueById } from '@/service/modules/queues'
deleteQueueById import { DeleteOutlined, EditOutlined } from '@vicons/antd'
} from '@/service/modules/queues'
import {DeleteOutlined, EditOutlined} from '@vicons/antd'
import type { QueueRes } from '@/service/modules/queues/types' import type { QueueRes } from '@/service/modules/queues/types'
export function useTable() { export function useTable() {

Loading…
Cancel
Save