mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-27 22:03:42 +08:00
fix dayjs
This commit is contained in:
7
frontend/package-lock.json
generated
7
frontend/package-lock.json
generated
@@ -11,6 +11,7 @@
|
||||
"@tailwindcss/vite": "^4.0.14",
|
||||
"@vueuse/core": "^13.0.0",
|
||||
"apexcharts": "^3.46.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"flowbite": "^3.1.2",
|
||||
"openapi-fetch": "^0.13.5",
|
||||
"pinia": "^3.0.1",
|
||||
@@ -3200,6 +3201,12 @@
|
||||
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/dayjs": {
|
||||
"version": "1.11.13",
|
||||
"resolved": "http://mirrors.tencent.com/npm/dayjs/-/dayjs-1.11.13.tgz",
|
||||
"integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/de-indent": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"@tailwindcss/vite": "^4.0.14",
|
||||
"@vueuse/core": "^13.0.0",
|
||||
"apexcharts": "^3.46.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"flowbite": "^3.1.2",
|
||||
"openapi-fetch": "^0.13.5",
|
||||
"pinia": "^3.0.1",
|
||||
@@ -50,6 +51,8 @@
|
||||
"vue-tsc": "^2.2.8"
|
||||
},
|
||||
"msw": {
|
||||
"workerDirectory": ["public"]
|
||||
"workerDirectory": [
|
||||
"public"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
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