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, GlobalOutlined,
IssuesCloseOutlined IssuesCloseOutlined
} from '@vicons/antd' } from '@vicons/antd'
import { parseISO } from 'date-fns'
import _ from 'lodash'
import { ITaskState } from './types' import { ITaskState } from './types'
/** /**
@ -350,3 +352,11 @@ export const warningTypeList = [
code: 'project.workflow.all_send' 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 type { RuleRes } from '@/service/modules/data-quality/types'
import TableAction from './components/table-action' import TableAction from './components/table-action'
import _ from 'lodash' 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 { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { parseTime } from '@/utils/common'
export function useTable(viewRuleEntry = (unusedRuleJson: string): void => {}) { export function useTable(viewRuleEntry = (unusedRuleJson: string): void => {}) {
const { t } = useI18n() const { t } = useI18n()
@ -120,11 +121,11 @@ export function useTable(viewRuleEntry = (unusedRuleJson: string): void => {}) {
} }
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
item.updateTime = format( item.updateTime = format(
parseISO(item.updateTime), parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss' '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 { reactive, ref } from 'vue'
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { queryExecuteResultListPaging } from '@/service/modules/data-quality' import { queryExecuteResultListPaging } from '@/service/modules/data-quality'
import { parseISO, format } from 'date-fns' import { format } from 'date-fns'
import type { import type {
ResultItem, ResultItem,
ResultListRes ResultListRes
} from '@/service/modules/data-quality/types' } from '@/service/modules/data-quality/types'
import { parseTime } from '@/utils/common'
export function useTable() { export function useTable() {
const { t } = useI18n() const { t } = useI18n()
@ -171,10 +172,10 @@ export function useTable() {
state: params.state, state: params.state,
searchVal: params.searchVal, searchVal: params.searchVal,
startDate: params.datePickerRange 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 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 { reactive, ref } from 'vue'
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { queryAuditLogListPaging } from '@/service/modules/audit' 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' import type { AuditListRes } from '@/service/modules/audit/types'
export function useTable() { export function useTable() {
@ -75,10 +76,10 @@ export function useTable() {
operationType: params.operationType, operationType: params.operationType,
userName: params.userName, userName: params.userName,
startDate: params.datePickerRange 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 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 { useI18n } from 'vue-i18n'
import { useAsyncState } from '@vueuse/core' import { useAsyncState } from '@vueuse/core'
import { queryProjectListPaging } from '@/service/modules/projects' import { queryProjectListPaging } from '@/service/modules/projects'
import { parseISO, format } from 'date-fns' import { format } from 'date-fns'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useMenuStore } from '@/store/menu/menu' import { useMenuStore } from '@/store/menu/menu'
import { NEllipsis } from 'naive-ui' import { NEllipsis } from 'naive-ui'
import TableAction from './components/table-action' import TableAction from './components/table-action'
import { parseTime } from '@/utils/common'
import type { Router } from 'vue-router' import type { Router } from 'vue-router'
import type { TableColumns } from 'naive-ui/es/data-table/src/interface' import type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import type { ProjectRes } from '@/service/modules/projects/types' import type { ProjectRes } from '@/service/modules/projects/types'
@ -110,11 +111,11 @@ export function useTable(
variables.totalPage = res.totalPage variables.totalPage = res.totalPage
variables.tableData = res.totalList.map((item, unused) => { variables.tableData = res.totalList.map((item, unused) => {
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
item.updateTime = format( item.updateTime = format(
parseISO(item.updateTime), parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
return { return {

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

@ -29,8 +29,9 @@ import {
CheckCircleOutlined, CheckCircleOutlined,
DownloadOutlined DownloadOutlined
} from '@vicons/antd' } from '@vicons/antd'
import { parseISO, format } from 'date-fns' import { format } from 'date-fns'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { parseTime } from '@/utils/common'
import type { TaskInstancesRes } from '@/service/modules/task-instances/types' import type { TaskInstancesRes } from '@/service/modules/task-instances/types'
export function useTable() { export function useTable() {
@ -237,10 +238,10 @@ export function useTable() {
host: params.host, host: params.host,
stateType: params.stateType, stateType: params.stateType,
startDate: params.datePickerRange 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 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, executorName: params.executorName,
processInstanceName: params.processInstanceName processInstanceName: params.processInstanceName
@ -251,14 +252,17 @@ export function useTable() {
(res: TaskInstancesRes) => { (res: TaskInstancesRes) => {
variables.tableData = res.totalList.map((item, unused) => { variables.tableData = res.totalList.map((item, unused) => {
item.submitTime = format( item.submitTime = format(
parseISO(item.submitTime), parseTime(item.submitTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
item.startTime = format( 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' 'yyyy-MM-dd HH:mm:ss'
) )
item.endTime = format(parseISO(item.endTime), 'yyyy-MM-dd HH:mm:ss')
return { return {
...item ...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 { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import type { Router } 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 { importProcessDefinition } from '@/service/modules/process-definition'
import { queryAllWorkerGroups } from '@/service/modules/worker-groups' import { queryAllWorkerGroups } from '@/service/modules/worker-groups'
import { queryAllEnvironmentList } from '@/service/modules/environment' import { queryAllEnvironmentList } from '@/service/modules/environment'
@ -31,6 +31,7 @@ import {
updateSchedule, updateSchedule,
previewSchedule previewSchedule
} from '@/service/modules/schedules' } from '@/service/modules/schedules'
import { parseTime } from '@/utils/common'
export function useModal( export function useModal(
state: any, state: any,
@ -78,11 +79,11 @@ export function useModal(
state.startForm.processDefinitionCode = code state.startForm.processDefinitionCode = code
if (state.startForm.startEndTime) { if (state.startForm.startEndTime) {
const start = format( const start = format(
parseISO(state.startForm.startEndTime[0]), new Date(state.startForm.startEndTime[0]),
'yyyy-MM-dd hh:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
const end = format( const end = format(
parseISO(state.startForm.startEndTime[1]), new Date(state.startForm.startEndTime[1]),
'yyyy-MM-dd hh:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
state.startForm.scheduleTime = `${start},${end}` state.startForm.scheduleTime = `${start},${end}`
@ -148,11 +149,11 @@ export function useModal(
const getTimingData = () => { const getTimingData = () => {
const start = format( const start = format(
parseISO(state.timingForm.startEndTime[0]), parseTime(state.timingForm.startEndTime[0]),
'yyyy-MM-dd hh:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
const end = format( const end = format(
parseISO(state.timingForm.startEndTime[1]), parseTime(state.timingForm.startEndTime[1]),
'yyyy-MM-dd hh:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
@ -210,11 +211,11 @@ export function useModal(
const projectCode = Number(router.currentRoute.value.params.projectCode) const projectCode = Number(router.currentRoute.value.params.projectCode)
const start = format( const start = format(
parseISO(state.timingForm.startEndTime[0]), new Date(state.timingForm.startEndTime[0]),
'yyyy-MM-dd hh:mm:ss' 'yyyy-MM-dd hh:mm:ss'
) )
const end = format( const end = format(
parseISO(state.timingForm.startEndTime[1]), new Date(state.timingForm.startEndTime[1]),
'yyyy-MM-dd hh:mm:ss' '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 _ from 'lodash'
import { parseISO, format } from 'date-fns' import { format } from 'date-fns'
import { reactive, h, ref } from 'vue' import { reactive, h, ref } from 'vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@ -34,6 +34,7 @@ import { runningType, tasksState } from '@/utils/common'
import { IWorkflowInstance } from '@/service/modules/process-instances/types' import { IWorkflowInstance } from '@/service/modules/process-instances/types'
import { ICountDownParam } from './types' import { ICountDownParam } from './types'
import { ExecuteReq } from '@/service/modules/executors/types' import { ExecuteReq } from '@/service/modules/executors/types'
import { parseTime } from '@/utils/common'
import styles from './index.module.scss' import styles from './index.module.scss'
export function useTable() { export function useTable() {
@ -149,7 +150,7 @@ export function useTable() {
key: 'scheduleTime', key: 'scheduleTime',
render: (_row: IWorkflowInstance) => render: (_row: IWorkflowInstance) =>
_row.scheduleTime _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', key: 'startTime',
render: (_row: IWorkflowInstance) => render: (_row: IWorkflowInstance) =>
_row.startTime _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', key: 'endTime',
render: (_row: IWorkflowInstance) => render: (_row: IWorkflowInstance) =>
_row.endTime _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 { h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n' 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 type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { queryTaskGroupListPaging } from '@/service/modules/task-group' import { queryTaskGroupListPaging } from '@/service/modules/task-group'
import { queryAllProjectList } from '@/service/modules/projects' import { queryAllProjectList } from '@/service/modules/projects'
import TableAction from './components/table-action' import TableAction from './components/table-action'
import _ from 'lodash' import _ from 'lodash'
import { parseTime } from '@/utils/common'
export function useTable( export function useTable(
updateItem = ( updateItem = (
@ -103,11 +104,11 @@ export function useTable(
item.projectName = projectName item.projectName = projectName
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
item.updateTime = format( item.updateTime = format(
parseISO(item.updateTime), parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
return { 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 { h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n' 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 type { TableColumns } from 'naive-ui/es/data-table/src/interface'
import { import {
queryTaskGroupListPaging, queryTaskGroupListPaging,
@ -25,6 +25,7 @@ import {
} from '@/service/modules/task-group' } from '@/service/modules/task-group'
import TableAction from './components/table-action' import TableAction from './components/table-action'
import _ from 'lodash' import _ from 'lodash'
import { parseTime } from '@/utils/common'
export function useTable( export function useTable(
updatePriority = (unusedQueueId: number, unusedPriority: number): void => {}, updatePriority = (unusedQueueId: number, unusedPriority: number): void => {},
@ -104,11 +105,11 @@ export function useTable(
item.taskGroupName = taskGroupName item.taskGroupName = taskGroupName
item.createTime = format( item.createTime = format(
parseISO(item.createTime), parseTime(item.createTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
item.updateTime = format( item.updateTime = format(
parseISO(item.updateTime), parseTime(item.updateTime),
'yyyy-MM-dd HH:mm:ss' 'yyyy-MM-dd HH:mm:ss'
) )
return { return {

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

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

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

@ -20,7 +20,8 @@ import {
queryAlertPluginInstanceListPaging, queryAlertPluginInstanceListPaging,
deleteAlertPluginInstance deleteAlertPluginInstance
} from '@/service/modules/alert-plugin' } 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' import type { IRecord } from './types'
export function useTable() { export function useTable() {
@ -47,10 +48,10 @@ export function useTable() {
if (!totalList) throw Error() if (!totalList) throw Error()
data.list = totalList.map((record: IRecord) => { data.list = totalList.map((record: IRecord) => {
record.createTime = record.createTime 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 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 return record
}) })

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

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

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

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

Loading…
Cancel
Save