mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-23 11:23:42 +08:00
fix dayjs
This commit is contained in:
11
frontend/src/utils/dateUtil.ts
Normal file
11
frontend/src/utils/dateUtil.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import dayjs from "dayjs";
|
||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import "dayjs/locale/zh-cn";
|
||||
|
||||
dayjs.extend(localizedFormat);
|
||||
dayjs.locale("zh-cn");
|
||||
dayjs.extend(timezone);
|
||||
dayjs.tz.setDefault("Asia/Shanghai");
|
||||
|
||||
export default dayjs;
|
||||
@@ -5,7 +5,7 @@
|
||||
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl ">部门管理</h1>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<form class="max-w-sm mb-4">
|
||||
<form class="max-w-xs mb-4">
|
||||
<label for="default-search" class="mb-2 text-sm font-medium text-gray-900 sr-only ">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl ">权限管理</h1>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<form class="max-w-sm mb-4">
|
||||
<form class="max-w-xs mb-4">
|
||||
<label for="default-search" class="mb-2 text-sm font-medium text-gray-900 sr-only ">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl ">岗位管理</h1>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<form class="max-w-sm mb-4 ">
|
||||
<form class="max-w-xs mb-4 ">
|
||||
<label for="default-search" class="mb-2 text-sm font-medium text-gray-900 sr-only ">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl ">角色管理</h1>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<form class="max-w-sm mb-4">
|
||||
<form class="max-w-xs mb-4">
|
||||
<label for="default-search" class="mb-2 text-sm font-medium text-gray-900 sr-only ">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl ">任务管理</h1>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<form class="max-w-sm mb-4 ">
|
||||
<form class="max-w-xs mb-4 ">
|
||||
<label for="default-search" class="mb-2 text-sm font-medium text-gray-900 sr-only ">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
||||
@@ -59,22 +59,21 @@
|
||||
<label :for="'checkbox-table-search-' + job.triggerName" class="sr-only">checkbox</label>
|
||||
</div>
|
||||
</td>
|
||||
<td class="px-6 py-4 font-medium text-gray-900 whitespace-nowrap ">{{
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis font-medium text-gray-900 whitespace-nowrap ">{{
|
||||
`${job.name}:${job.group}` }}</td>
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis">{{
|
||||
`${job.triggerName}:${job.triggerGroup}` }}
|
||||
</td>
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis">{{ new
|
||||
Date(job.startTime!).toLocaleString() }}
|
||||
<td class="px-6 py-4 min-w-3xs max-w-sm overflow-hidden text-ellipsis">{{
|
||||
dayjs(job.startTime!).format("llll") }}
|
||||
</td>
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis">{{ job.endTime ? new
|
||||
Date(job.endTime).toLocaleString() : undefined }}</td>
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis">{{ job.nextFireTime ? new
|
||||
Date(job.nextFireTime).toLocaleString() : undefined}}</td>
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis">{{ job.previousFireTime &&
|
||||
<td class="px-6 py-4 min-w-3xs max-w-sm overflow-hidden text-ellipsis">{{ job.endTime ?
|
||||
dayjs(job.endTime).format("llll") : undefined }}</td>
|
||||
<td class="px-6 py-4 min-w-3xs max-w-sm overflow-hidden text-ellipsis">{{ job.nextFireTime ?
|
||||
dayjs(job.nextFireTime).format("llll") : undefined}}</td>
|
||||
<td class="px-6 py-4 min-w-3xs max-w-sm overflow-hidden text-ellipsis">{{ job.previousFireTime &&
|
||||
job.previousFireTime
|
||||
> 0 ? new
|
||||
Date(job.previousFireTime).toLocaleString() :
|
||||
> 0 ? dayjs(job.previousFireTime).format("llll") :
|
||||
undefined
|
||||
}}
|
||||
</td>
|
||||
@@ -138,6 +137,7 @@ import { useJobControl } from "@/composables/job/useJobControl";
|
||||
import { useJobsPaginationQuery } from "@/composables/job/useJobQuery";
|
||||
import { useJobUpdate } from "@/composables/job/useJobUpdate";
|
||||
import useAlertStore from "@/composables/store/useAlertStore";
|
||||
import dayjs from "@/utils/dateUtil";
|
||||
import { Modal, type ModalInterface, initFlowbite } from "flowbite";
|
||||
import { nextTick, onMounted, ref } from "vue";
|
||||
import type { components } from "../api/types/schema";
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<h1 class="text-xl font-semibold text-gray-900 sm:text-2xl ">用户管理</h1>
|
||||
</div>
|
||||
<div class="relative">
|
||||
<form class="max-w-sm mb-4 ">
|
||||
<form class="max-w-xs mb-4 ">
|
||||
<label for="default-search" class="mb-2 text-sm font-medium text-gray-900 sr-only ">Search</label>
|
||||
<div class="relative">
|
||||
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none">
|
||||
@@ -72,7 +72,7 @@
|
||||
{{ user.username }}
|
||||
</td>
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis">
|
||||
{{ user.createTime }}
|
||||
{{ dayjs(user.createTime).format("llll") }}
|
||||
</td>
|
||||
<td class="px-6 py-4 max-w-sm overflow-hidden text-ellipsis">
|
||||
<div class="flex items-center">
|
||||
@@ -145,20 +145,21 @@
|
||||
<script setup lang="ts">
|
||||
import Breadcrumbs from "@/components/Breadcrumbs.vue";
|
||||
import UserDeleteModal from "@/components/PopupModal.vue";
|
||||
import SortIcon from "@/components/SortIcon.vue";
|
||||
import TablePagination from "@/components/TablePagination.vue";
|
||||
import UserUpsertModal from "@/components/UserUpsertModal.vue";
|
||||
import { useSort } from "@/composables/sort";
|
||||
import useUserDelete from "@/composables/user/useUserDelete";
|
||||
import { useUserQuery } from "@/composables/user/useUserQuery";
|
||||
import { RouteName } from "@/router/constants";
|
||||
import type { UserUpsertSubmitModel } from "@/types/user";
|
||||
import dayjs from "@/utils/dateUtil";
|
||||
import { Modal, type ModalInterface, initFlowbite } from "flowbite";
|
||||
import { nextTick, onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import type { components } from "../api/types/schema";
|
||||
import useAlertStore from "../composables/store/useAlertStore";
|
||||
import { useUserUpsert } from "../composables/user/useUserUpsert";
|
||||
import { useSort } from "@/composables/sort";
|
||||
import SortIcon from "@/components/SortIcon.vue";
|
||||
|
||||
const username = ref<string>("");
|
||||
const selectedUser = ref<components["schemas"]["UserRolePermissionDto"]>();
|
||||
|
||||
Reference in New Issue
Block a user