Browse Source

[Fix-8615][UI Next][V1.0.0-Alpha] Fix workflow startup time invalid bug (#8681)

3.0.0/version-upgrade
Devosend 3 years ago committed by GitHub
parent
commit
4881ab8c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-ui-next/src/utils/common.ts
  2. 7
      dolphinscheduler-ui-next/src/views/data-quality/rule/use-table.ts
  3. 7
      dolphinscheduler-ui-next/src/views/data-quality/task-result/use-table.ts
  4. 7
      dolphinscheduler-ui-next/src/views/monitor/statistics/audit-log/use-table.ts
  5. 7
      dolphinscheduler-ui-next/src/views/projects/list/use-table.ts
  6. 16
      dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts
  7. 15
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/use-modal.ts
  8. 9
      dolphinscheduler-ui-next/src/views/projects/workflow/instance/use-table.ts
  9. 7
      dolphinscheduler-ui-next/src/views/resource/task-group/option/use-table.ts
  10. 7
      dolphinscheduler-ui-next/src/views/resource/task-group/queue/use-table.ts
  11. 7
      dolphinscheduler-ui-next/src/views/security/alarm-group-manage/use-table.ts
  12. 7
      dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts
  13. 7
      dolphinscheduler-ui-next/src/views/security/environment-manage/use-table.ts
  14. 7
      dolphinscheduler-ui-next/src/views/security/k8s-namespace-manage/use-table.ts
  15. 9
      dolphinscheduler-ui-next/src/views/security/token-manage/use-table.ts

10
dolphinscheduler-ui-next/src/utils/common.ts

@ -32,6 +32,8 @@ import {
GlobalOutlined,
IssuesCloseOutlined
} from '@vicons/antd'
import { parseISO } from 'date-fns'
import _ from 'lodash'
import { ITaskState } from './types'
/**
@ -350,3 +352,11 @@ export const warningTypeList = [
code: 'project.workflow.all_send'
}
]
export const parseTime = (dateTime: string | number) => {
if (_.isString(dateTime) === true) {
return parseISO(dateTime as string)
} else {
return new Date(dateTime)
}
}

7
dolphinscheduler-ui-next/src/views/data-quality/rule/use-table.ts

@ -22,8 +22,9 @@ import { queryRuleListPaging } from '@/service/modules/data-quality'
import type { RuleRes } from '@/service/modules/data-quality/types'
import TableAction from './components/table-action'
import _ from 'lodash'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { parseTime } from '@/utils/common'
export function useTable(viewRuleEntry = (unusedRuleJson: string): void => {}) {
const { t } = useI18n()
@ -120,11 +121,11 @@ export function useTable(viewRuleEntry = (unusedRuleJson: string): void => {}) {
}
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)

7
dolphinscheduler-ui-next/src/views/data-quality/task-result/use-table.ts

@ -19,11 +19,12 @@ import { useI18n } from 'vue-i18n'
import { reactive, ref } from 'vue'
import { useAsyncState } from '@vueuse/core'
import { queryExecuteResultListPaging } from '@/service/modules/data-quality'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import type {
ResultItem,
ResultListRes
} from '@/service/modules/data-quality/types'
import { parseTime } from '@/utils/common'
export function useTable() {
const { t } = useI18n()
@ -171,10 +172,10 @@ export function useTable() {
state: params.state,
searchVal: params.searchVal,
startDate: params.datePickerRange
? format(parseISO(params.datePickerRange[0]), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(params.datePickerRange[0]), 'yyyy-MM-dd HH:mm:ss')
: '',
endDate: params.datePickerRange
? format(parseISO(params.datePickerRange[1]), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(params.datePickerRange[1]), 'yyyy-MM-dd HH:mm:ss')
: ''
}

7
dolphinscheduler-ui-next/src/views/monitor/statistics/audit-log/use-table.ts

@ -19,7 +19,8 @@ import { useI18n } from 'vue-i18n'
import { reactive, ref } from 'vue'
import { useAsyncState } from '@vueuse/core'
import { queryAuditLogListPaging } from '@/service/modules/audit'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { parseTime } from '@/utils/common'
import type { AuditListRes } from '@/service/modules/audit/types'
export function useTable() {
@ -75,10 +76,10 @@ export function useTable() {
operationType: params.operationType,
userName: params.userName,
startDate: params.datePickerRange
? format(parseISO(params.datePickerRange[0]), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(params.datePickerRange[0]), 'yyyy-MM-dd HH:mm:ss')
: '',
endDate: params.datePickerRange
? format(parseISO(params.datePickerRange[1]), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(params.datePickerRange[1]), 'yyyy-MM-dd HH:mm:ss')
: ''
}

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

@ -19,11 +19,12 @@ import { h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useAsyncState } from '@vueuse/core'
import { queryProjectListPaging } from '@/service/modules/projects'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { useRouter } from 'vue-router'
import { useMenuStore } from '@/store/menu/menu'
import { NEllipsis } from 'naive-ui'
import TableAction from './components/table-action'
import { parseTime } from '@/utils/common'
import type { Router } from 'vue-router'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import type { ProjectRes } from '@/service/modules/projects/types'
@ -110,11 +111,11 @@ export function useTable(
variables.totalPage = res.totalPage
variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)
return {

16
dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts

@ -29,8 +29,9 @@ import {
CheckCircleOutlined,
DownloadOutlined
} from '@vicons/antd'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { useRoute } from 'vue-router'
import { parseTime } from '@/utils/common'
import type { TaskInstancesRes } from '@/service/modules/task-instances/types'
export function useTable() {
@ -237,10 +238,10 @@ export function useTable() {
host: params.host,
stateType: params.stateType,
startDate: params.datePickerRange
? format(parseISO(params.datePickerRange[0]), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(params.datePickerRange[0]), 'yyyy-MM-dd HH:mm:ss')
: '',
endDate: params.datePickerRange
? format(parseISO(params.datePickerRange[1]), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(params.datePickerRange[1]), 'yyyy-MM-dd HH:mm:ss')
: '',
executorName: params.executorName,
processInstanceName: params.processInstanceName
@ -251,14 +252,17 @@ export function useTable() {
(res: TaskInstancesRes) => {
variables.tableData = res.totalList.map((item, unused) => {
item.submitTime = format(
parseISO(item.submitTime),
parseTime(item.submitTime),
'yyyy-MM-dd HH:mm:ss'
)
item.startTime = format(
parseISO(item.startTime),
parseTime(item.startTime),
'yyyy-MM-dd HH:mm:ss'
)
item.endTime = format(
parseTime(item.endTime),
'yyyy-MM-dd HH:mm:ss'
)
item.endTime = format(parseISO(item.endTime), 'yyyy-MM-dd HH:mm:ss')
return {
...item
}

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

@ -20,7 +20,7 @@ import { reactive, SetupContext } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
import type { Router } from 'vue-router'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { importProcessDefinition } from '@/service/modules/process-definition'
import { queryAllWorkerGroups } from '@/service/modules/worker-groups'
import { queryAllEnvironmentList } from '@/service/modules/environment'
@ -31,6 +31,7 @@ import {
updateSchedule,
previewSchedule
} from '@/service/modules/schedules'
import { parseTime } from '@/utils/common'
export function useModal(
state: any,
@ -78,11 +79,11 @@ export function useModal(
state.startForm.processDefinitionCode = code
if (state.startForm.startEndTime) {
const start = format(
parseISO(state.startForm.startEndTime[0]),
new Date(state.startForm.startEndTime[0]),
'yyyy-MM-dd hh:mm:ss'
)
const end = format(
parseISO(state.startForm.startEndTime[1]),
new Date(state.startForm.startEndTime[1]),
'yyyy-MM-dd hh:mm:ss'
)
state.startForm.scheduleTime = `${start},${end}`
@ -148,11 +149,11 @@ export function useModal(
const getTimingData = () => {
const start = format(
parseISO(state.timingForm.startEndTime[0]),
parseTime(state.timingForm.startEndTime[0]),
'yyyy-MM-dd hh:mm:ss'
)
const end = format(
parseISO(state.timingForm.startEndTime[1]),
parseTime(state.timingForm.startEndTime[1]),
'yyyy-MM-dd hh:mm:ss'
)
@ -210,11 +211,11 @@ export function useModal(
const projectCode = Number(router.currentRoute.value.params.projectCode)
const start = format(
parseISO(state.timingForm.startEndTime[0]),
new Date(state.timingForm.startEndTime[0]),
'yyyy-MM-dd hh:mm:ss'
)
const end = format(
parseISO(state.timingForm.startEndTime[1]),
new Date(state.timingForm.startEndTime[1]),
'yyyy-MM-dd hh:mm:ss'
)

9
dolphinscheduler-ui-next/src/views/projects/workflow/instance/use-table.ts

@ -16,7 +16,7 @@
*/
import _ from 'lodash'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { reactive, h, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router'
@ -34,6 +34,7 @@ import { runningType, tasksState } from '@/utils/common'
import { IWorkflowInstance } from '@/service/modules/process-instances/types'
import { ICountDownParam } from './types'
import { ExecuteReq } from '@/service/modules/executors/types'
import { parseTime } from '@/utils/common'
import styles from './index.module.scss'
export function useTable() {
@ -149,7 +150,7 @@ export function useTable() {
key: 'scheduleTime',
render: (_row: IWorkflowInstance) =>
_row.scheduleTime
? format(parseISO(_row.scheduleTime), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(_row.scheduleTime), 'yyyy-MM-dd HH:mm:ss')
: '-'
},
{
@ -157,7 +158,7 @@ export function useTable() {
key: 'startTime',
render: (_row: IWorkflowInstance) =>
_row.startTime
? format(parseISO(_row.startTime), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(_row.startTime), 'yyyy-MM-dd HH:mm:ss')
: '-'
},
{
@ -165,7 +166,7 @@ export function useTable() {
key: 'endTime',
render: (_row: IWorkflowInstance) =>
_row.endTime
? format(parseISO(_row.endTime), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(_row.endTime), 'yyyy-MM-dd HH:mm:ss')
: '-'
},
{

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

@ -17,12 +17,13 @@
import { h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { queryTaskGroupListPaging } from '@/service/modules/task-group'
import { queryAllProjectList } from '@/service/modules/projects'
import TableAction from './components/table-action'
import _ from 'lodash'
import { parseTime } from '@/utils/common'
export function useTable(
updateItem = (
@ -103,11 +104,11 @@ export function useTable(
item.projectName = projectName
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)
return {

7
dolphinscheduler-ui-next/src/views/resource/task-group/queue/use-table.ts

@ -17,7 +17,7 @@
import { h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import {
queryTaskGroupListPaging,
@ -25,6 +25,7 @@ import {
} from '@/service/modules/task-group'
import TableAction from './components/table-action'
import _ from 'lodash'
import { parseTime } from '@/utils/common'
export function useTable(
updatePriority = (unusedQueueId: number, unusedPriority: number): void => {},
@ -104,11 +105,11 @@ export function useTable(
item.taskGroupName = taskGroupName
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)
return {

7
dolphinscheduler-ui-next/src/views/security/alarm-group-manage/use-table.ts

@ -17,7 +17,7 @@
import { useAsyncState } from '@vueuse/core'
import { reactive, h, ref } from 'vue'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { NButton, NIcon, NPopconfirm, NSpace, NTooltip } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import {
@ -25,6 +25,7 @@ import {
delAlertGroupById
} from '@/service/modules/alert-group'
import { DeleteOutlined, EditOutlined } from '@vicons/antd'
import { parseTime } from '@/utils/common'
import type { AlarmGroupRes } from '@/service/modules/alert-group/types'
export function useTable() {
@ -159,11 +160,11 @@ export function useTable() {
queryAlertGroupListPaging({ ...params }).then((res: AlarmGroupRes) => {
variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)
return {

7
dolphinscheduler-ui-next/src/views/security/alarm-instance-manage/use-table.ts

@ -20,7 +20,8 @@ import {
queryAlertPluginInstanceListPaging,
deleteAlertPluginInstance
} from '@/service/modules/alert-plugin'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { parseTime } from '@/utils/common'
import type { IRecord } from './types'
export function useTable() {
@ -47,10 +48,10 @@ export function useTable() {
if (!totalList) throw Error()
data.list = totalList.map((record: IRecord) => {
record.createTime = record.createTime
? format(parseISO(record.createTime), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(record.createTime), 'yyyy-MM-dd HH:mm:ss')
: ''
record.updateTime = record.updateTime
? format(parseISO(record.updateTime), 'yyyy-MM-dd HH:mm:ss')
? format(parseTime(record.updateTime), 'yyyy-MM-dd HH:mm:ss')
: ''
return record
})

7
dolphinscheduler-ui-next/src/views/security/environment-manage/use-table.ts

@ -17,7 +17,7 @@
import { useAsyncState } from '@vueuse/core'
import { reactive, h, ref } from 'vue'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { NButton, NPopconfirm, NSpace, NTooltip, NTag, NIcon } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import {
@ -29,6 +29,7 @@ import type {
EnvironmentRes,
EnvironmentItem
} from '@/service/modules/environment/types'
import { parseTime } from '@/utils/common'
export function useTable() {
const { t } = useI18n()
@ -184,11 +185,11 @@ export function useTable() {
queryEnvironmentListPaging({ ...params }).then((res: EnvironmentRes) => {
variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)
return {

7
dolphinscheduler-ui-next/src/views/security/k8s-namespace-manage/use-table.ts

@ -19,7 +19,7 @@ import { useAsyncState } from '@vueuse/core'
import { reactive, h, ref } from 'vue'
import { NButton, NIcon, NPopconfirm, NSpace, NTooltip } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { DeleteOutlined, EditOutlined } from '@vicons/antd'
import {
queryNamespaceListPaging,
@ -29,6 +29,7 @@ import type {
NamespaceListRes,
NamespaceItem
} from '@/service/modules/k8s-namespace/types'
import { parseTime } from '@/utils/common'
export function useTable() {
const { t } = useI18n()
@ -178,11 +179,11 @@ export function useTable() {
queryNamespaceListPaging({ ...params }).then((res: NamespaceListRes) => {
variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)
return {

9
dolphinscheduler-ui-next/src/views/security/token-manage/use-table.ts

@ -17,11 +17,12 @@
import { useAsyncState } from '@vueuse/core'
import { reactive, h, ref } from 'vue'
import { parseISO, format } from 'date-fns'
import { format } from 'date-fns'
import { NButton, NIcon, NPopconfirm, NSpace, NTooltip } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import { DeleteOutlined, EditOutlined } from '@vicons/antd'
import { queryAccessTokenList, deleteToken } from '@/service/modules/token'
import { parseTime } from '@/utils/common'
import type { TokenRes } from '@/service/modules/token/types'
export function useTable() {
@ -164,15 +165,15 @@ export function useTable() {
queryAccessTokenList({ ...params }).then((res: TokenRes) => {
variables.tableData = res.totalList.map((item, unused) => {
item.expireTime = format(
parseISO(item.expireTime),
parseTime(item.expireTime),
'yyyy-MM-dd HH:mm:ss'
)
item.createTime = format(
parseISO(item.createTime),
parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss'
)
item.updateTime = format(
parseISO(item.updateTime),
parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss'
)
return {

Loading…
Cancel
Save