Skip to content

Commit 5fedc66

Browse files
author
puhui999
committed
update: 修改了一些TODO提到的问题,简化时间格式化方法
1 parent d44ceda commit 5fedc66

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

src/layout/components/Message/src/Message.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import dayjs from 'dayjs'
2+
import { parseTime } from '@/utils/formatTime'
33
import * as NotifyMessageApi from '@/api/system/notify/message'
44
55
const { push } = useRouter()
@@ -57,7 +57,7 @@ onMounted(() => {
5757
{{ item.templateNickname }}:{{ item.templateContent }}
5858
</span>
5959
<span class="message-date">
60-
{{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') }}
60+
{{ parseTime(item.createTime) }}
6161
</span>
6262
</div>
6363
</div>

src/views/Profile/components/ProfileUser.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
</li>
3535
<li class="list-group-item">
3636
<Icon icon="ep:calendar" class="mr-5px" />{{ t('profile.user.createTime') }}
37-
<div class="pull-right">{{ dayjs(userInfo?.createTime).format('YYYY-MM-DD') }}</div>
37+
<div class="pull-right">{{ parseTime(userInfo?.createTime) }}</div>
3838
</li>
3939
</ul>
4040
</div>
4141
</template>
4242
<script setup lang="ts">
43-
import dayjs from 'dayjs'
43+
import { parseTime } from '@/utils/formatTime'
4444
import UserAvatar from './UserAvatar.vue'
4545
4646
import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile'

src/views/bpm/processInstance/detail.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,13 @@
112112
</label>
113113
<label style="font-weight: normal" v-if="item.createTime">创建时间:</label>
114114
<label style="color: #8a909c; font-weight: normal">
115-
{{ dayjs(item?.createTime).format('YYYY-MM-DD HH:mm:ss') }}
115+
{{ parseTime(item?.createTime) }}
116116
</label>
117117
<label v-if="item.endTime" style="margin-left: 30px; font-weight: normal">
118118
审批时间:
119119
</label>
120120
<label v-if="item.endTime" style="color: #8a909c; font-weight: normal">
121-
{{ dayjs(item?.endTime).format('YYYY-MM-DD HH:mm:ss') }}
121+
{{ parseTime(item?.endTime) }}
122122
</label>
123123
<label v-if="item.durationInMillis" style="margin-left: 30px; font-weight: normal">
124124
耗时:
@@ -192,7 +192,7 @@
192192
</ContentWrap>
193193
</template>
194194
<script setup lang="ts">
195-
import dayjs from 'dayjs'
195+
import { parseTime } from '@/utils/formatTime'
196196
import * as UserApi from '@/api/system/user'
197197
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
198198
import * as DefinitionApi from '@/api/bpm/definition'

src/views/infra/job/JobLog.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@
1212
/>
1313
</template>
1414
<template #beginTime_default="{ row }">
15-
<span>{{
16-
dayjs(row.beginTime).format('YYYY-MM-DD HH:mm:ss') +
17-
' ~ ' +
18-
dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss')
19-
}}</span>
15+
<span>{{ parseTime(row.beginTime) + ' ~ ' + parseTime(row.endTime) }}</span>
2016
</template>
2117
<template #duration_default="{ row }">
2218
<span>{{ row.duration + ' 毫秒' }}</span>
@@ -48,7 +44,7 @@
4844
</XModal>
4945
</template>
5046
<script setup lang="ts" name="JobLog">
51-
import dayjs from 'dayjs'
47+
import { parseTime } from '@/utils/formatTime'
5248
5349
import * as JobLogApi from '@/api/infra/jobLog'
5450
import { allSchemas } from './jobLog.data'

src/views/infra/webSocket/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<li v-for="item in getList" class="mt-2" :key="item.time">
4545
<div class="flex items-center">
4646
<span class="mr-2 text-primary font-medium">收到消息:</span>
47-
<span>{{ dayjs(item.time).format('YYYY-MM-DD HH:mm:ss') }}</span>
47+
<span>{{ parseTime(item.time) }}</span>
4848
</div>
4949
<div>
5050
{{ item.res }}
@@ -56,7 +56,7 @@
5656
</div>
5757
</template>
5858
<script setup lang="ts">
59-
import dayjs from 'dayjs'
59+
import { parseTime } from '@/utils/formatTime'
6060
import { useUserStore } from '@/store/modules/user'
6161
import { useWebSocket } from '@vueuse/core'
6262

0 commit comments

Comments
 (0)