update: 修改了一些TODO提到的问题,简化时间格式化方法

pull/45/head
puhui999 2023-03-23 00:33:40 +08:00
parent d44ceda588
commit 5fedc6674b
5 changed files with 11 additions and 15 deletions

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import dayjs from 'dayjs' import { parseTime } from '@/utils/formatTime'
import * as NotifyMessageApi from '@/api/system/notify/message' import * as NotifyMessageApi from '@/api/system/notify/message'
const { push } = useRouter() const { push } = useRouter()
@ -57,7 +57,7 @@ onMounted(() => {
{{ item.templateNickname }}{{ item.templateContent }} {{ item.templateNickname }}{{ item.templateContent }}
</span> </span>
<span class="message-date"> <span class="message-date">
{{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') }} {{ parseTime(item.createTime) }}
</span> </span>
</div> </div>
</div> </div>

View File

@ -34,13 +34,13 @@
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<Icon icon="ep:calendar" class="mr-5px" />{{ t('profile.user.createTime') }} <Icon icon="ep:calendar" class="mr-5px" />{{ t('profile.user.createTime') }}
<div class="pull-right">{{ dayjs(userInfo?.createTime).format('YYYY-MM-DD') }}</div> <div class="pull-right">{{ parseTime(userInfo?.createTime) }}</div>
</li> </li>
</ul> </ul>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import dayjs from 'dayjs' import { parseTime } from '@/utils/formatTime'
import UserAvatar from './UserAvatar.vue' import UserAvatar from './UserAvatar.vue'
import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile' import { getUserProfileApi, ProfileVO } from '@/api/system/user/profile'

View File

@ -112,13 +112,13 @@
</label> </label>
<label style="font-weight: normal" v-if="item.createTime"></label> <label style="font-weight: normal" v-if="item.createTime"></label>
<label style="color: #8a909c; font-weight: normal"> <label style="color: #8a909c; font-weight: normal">
{{ dayjs(item?.createTime).format('YYYY-MM-DD HH:mm:ss') }} {{ parseTime(item?.createTime) }}
</label> </label>
<label v-if="item.endTime" style="margin-left: 30px; font-weight: normal"> <label v-if="item.endTime" style="margin-left: 30px; font-weight: normal">
审批时间 审批时间
</label> </label>
<label v-if="item.endTime" style="color: #8a909c; font-weight: normal"> <label v-if="item.endTime" style="color: #8a909c; font-weight: normal">
{{ dayjs(item?.endTime).format('YYYY-MM-DD HH:mm:ss') }} {{ parseTime(item?.endTime) }}
</label> </label>
<label v-if="item.durationInMillis" style="margin-left: 30px; font-weight: normal"> <label v-if="item.durationInMillis" style="margin-left: 30px; font-weight: normal">
耗时 耗时
@ -192,7 +192,7 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import dayjs from 'dayjs' import { parseTime } from '@/utils/formatTime'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import * as ProcessInstanceApi from '@/api/bpm/processInstance' import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import * as DefinitionApi from '@/api/bpm/definition' import * as DefinitionApi from '@/api/bpm/definition'

View File

@ -12,11 +12,7 @@
/> />
</template> </template>
<template #beginTime_default="{ row }"> <template #beginTime_default="{ row }">
<span>{{ <span>{{ parseTime(row.beginTime) + ' ~ ' + parseTime(row.endTime) }}</span>
dayjs(row.beginTime).format('YYYY-MM-DD HH:mm:ss') +
' ~ ' +
dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss')
}}</span>
</template> </template>
<template #duration_default="{ row }"> <template #duration_default="{ row }">
<span>{{ row.duration + ' 毫秒' }}</span> <span>{{ row.duration + ' 毫秒' }}</span>
@ -48,7 +44,7 @@
</XModal> </XModal>
</template> </template>
<script setup lang="ts" name="JobLog"> <script setup lang="ts" name="JobLog">
import dayjs from 'dayjs' import { parseTime } from '@/utils/formatTime'
import * as JobLogApi from '@/api/infra/jobLog' import * as JobLogApi from '@/api/infra/jobLog'
import { allSchemas } from './jobLog.data' import { allSchemas } from './jobLog.data'

View File

@ -44,7 +44,7 @@
<li v-for="item in getList" class="mt-2" :key="item.time"> <li v-for="item in getList" class="mt-2" :key="item.time">
<div class="flex items-center"> <div class="flex items-center">
<span class="mr-2 text-primary font-medium">收到消息:</span> <span class="mr-2 text-primary font-medium">收到消息:</span>
<span>{{ dayjs(item.time).format('YYYY-MM-DD HH:mm:ss') }}</span> <span>{{ parseTime(item.time) }}</span>
</div> </div>
<div> <div>
{{ item.res }} {{ item.res }}
@ -56,7 +56,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import dayjs from 'dayjs' import { parseTime } from '@/utils/formatTime'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { useWebSocket } from '@vueuse/core' import { useWebSocket } from '@vueuse/core'