首頁系統小卡修改

This commit is contained in:
koko 2024-10-21 10:31:55 +08:00
parent eeac33ca79
commit fa4009c1fb
32 changed files with 166 additions and 50 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

View File

@ -38,7 +38,7 @@ const toggleErrIcon = () => {
<div <div
:class=" :class="
twMerge( twMerge(
'drawer-side translate-y-16 max-h-[95vh] overflow-x-hidden', 'drawer-side translate-y-20 max-h-[90vh] overflow-x-hidden',
showErr ? 'overflow-y-scroll' : '' showErr ? 'overflow-y-scroll' : ''
) )
" "

View File

@ -357,17 +357,17 @@ watch(
@apply bg-normal px-8 py-4; @apply bg-normal px-8 py-4;
} }
.content-box .content-decoration::before { /* .content-box .content-decoration::before {
@apply absolute -top-3 -right-[10px] h-8 w-8 bg-no-repeat z-10 bg-[url('../../assets/img/table/content-box-background02.svg')] bg-center; @apply absolute -top-3 -right-[10px] h-8 w-8 bg-no-repeat z-10 bg-[url('../../assets/img/table/content-box-background02.svg')] bg-center;
content: ""; content: "";
} } */
.content-box .content-decoration2::before { .content-box .content-decoration2::before {
@apply absolute -bottom-1 -left-8 h-14 w-14 bg-no-repeat z-10 bg-[url('../../assets/img/table/content-box-background03.svg')] bg-center; @apply absolute -bottom-1 -left-8 h-14 w-14 bg-no-repeat z-10 bg-[url('../../assets/img/table/content-box-background03.svg')] bg-center;
content: ""; content: "";
} }
.content-box .content-decoration2::after { /* .content-box .content-decoration2::after {
content: ""; content: "";
background: url(../../assets/img/table/content-box-background04.svg) center background: url(../../assets/img/table/content-box-background04.svg) center
center; center;
@ -378,5 +378,5 @@ watch(
width: 50px; width: 50px;
background-repeat: no-repeat; background-repeat: no-repeat;
z-index: 2; z-index: 2;
} } */
</style> </style>

View File

@ -92,12 +92,11 @@ const src = import.meta.env.MODE === "production" ? "./logo.svg" : Logo;
class="dropdown-content translate-y-2 z-[100] menu py-3 shadow rounded w-32 bg-[#4c625e] border text-center" class="dropdown-content translate-y-2 z-[100] menu py-3 shadow rounded w-32 bg-[#4c625e] border text-center"
> >
<li class="text-white"> <li class="text-white">
<router-link <a
to="logout" href="/logout"
type="link"
class="flex flex-col justify-center items-center" class="flex flex-col justify-center items-center"
>{{ $t("sign_out") }}</router-link >{{ $t("sign_out") }}
> </a>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -17,23 +17,25 @@ const toggleLanguage = (lang) => {
type="button" type="button"
class="flex flex-col justify-center items-center btn-group" class="flex flex-col justify-center items-center btn-group"
> >
<span <font-awesome-icon
:class="`fi fi-${locale} fis text-3xl rounded-full border-1 border-white`" :icon="['fas', 'globe']"
></span> size="2x"
class="text-white w-10 m-auto"
/>
<span class="text-white">{{ $t("language") }}</span> <span class="text-white">{{ $t("language") }}</span>
</button> </button>
<ul <ul
tabindex="0" tabindex="0"
class="dropdown-content translate-y-2 z-[100] menu py-3 shadow rounded w-36 bg-[#4c625e] border text-center" class="dropdown-content translate-y-2 z-[100] menu py-3 shadow rounded w-28 bg-[#4c625e] border text-center"
> >
<li class="text-white" @click="toggleLanguage('tw')"> <li class="text-white" @click="toggleLanguage('tw')">
<span><span class="fi fi-tw"></span>繁體中文</span> <span> 繁體中文</span>
</li> </li>
<li class="text-white" @click="toggleLanguage('cn')"> <li class="text-white" @click="toggleLanguage('cn')">
<span><span class="fi fi-cn"></span>简体中文</span> <span> 简体中文</span>
</li> </li>
<li class="text-white" @click="toggleLanguage('us')"> <li class="text-white" @click="toggleLanguage('us')">
<span><span class="fi fi-us"></span>English</span> <span> English</span>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -56,6 +56,7 @@ import {
faWind, faWind,
faEye, faEye,
faEyeSlash, faEyeSlash,
faGlobe
} from "@fortawesome/free-solid-svg-icons"; } from "@fortawesome/free-solid-svg-icons";
/* add icons to the library */ /* add icons to the library */
@ -112,7 +113,8 @@ library.add(
faCar, faCar,
faWind, faWind,
faEye, faEye,
faEyeSlash faEyeSlash,
faGlobe
); );
export default library; export default library;

View File

@ -94,16 +94,6 @@ const router = createRouter({
name: "mytestfile", name: "mytestfile",
component: Test, component: Test,
}, },
{
path: "/logout",
name: "logout",
beforeEnter: (to, from, next) => {
const auth = useUserInfoStore();
document.cookie = "JWT-Authorization=";
auth.user.token = "";
next({ path: "/login", replace: true });
},
},
], ],
}); });
@ -115,6 +105,12 @@ router.beforeEach(async (to, from, next) => {
const auth = useUserInfoStore(); const auth = useUserInfoStore();
const token = useGetCookie("JWT-Authorization"); const token = useGetCookie("JWT-Authorization");
if (to.path === "/logout") {
document.cookie = "JWT-Authorization=";
auth.user.token = "";
next({ path: "/login" });
}
if ((authRequired && !token) || to.path === "/") { if ((authRequired && !token) || to.path === "/") {
auth.user.token = ""; auth.user.token = "";
next({ path: "/login" }); next({ path: "/login" });

View File

@ -40,9 +40,14 @@ watch(locale, () => {
const activeTab = computed(() => { const activeTab = computed(() => {
return items.value.find(({ active }) => active); return items.value.find(({ active }) => active);
}); });
const activeTitle = computed(() => {
return activeTab.value ? activeTab.value.title : '';
});
</script> </script>
<template> <template>
<h1 class="text-2xl font-extrabold mb-2">{{ activeTitle }}</h1>
<ButtonGroup <ButtonGroup
:items="items" :items="items"
:withLine="true" :withLine="true"

View File

@ -162,7 +162,6 @@ provide("alert_table", {
</script> </script>
<template> <template>
<h1 class="text-2xl font-extrabold mb-2">{{ $t("alert.query_title") }}</h1>
<AlertTableModal :editRecord="editRecord" /> <AlertTableModal :editRecord="editRecord" />
<div> <div>
<AlertSearch /> <AlertSearch />

View File

@ -26,7 +26,6 @@ provide("notify_table", { noticeList });
</script> </script>
<template> <template>
<h1 class="text-2xl font-extrabold mb-2">{{ $t("alert.setting_title") }}</h1>
<div> <div>
<AlertSubList /> <AlertSubList />
<AlertOutliersTable /> <AlertOutliersTable />

View File

@ -1,25 +1,132 @@
<script setup> <script setup>
import { ref } from "vue"; import { ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
// //
const mockData = ref([ const mockData = ref([
{ title: "Elevator system", icon: "building", isError: false }, {
{ title: "Air Conditioning System", icon: "fan", isError: false }, title: "Air Detection System",
{ title: "Environmental sensing equipment", icon: "temperature-high", isError: false }, icon: "temperature-high",
{ title: "Lighting system", icon: "lightbulb", isError: false }, isError: false,
{ title: "Meter system", icon: "bolt", isError: false }, main_system_tag: "Dust",
{ title: "High voltage switchboard", icon: "charging-station", isError: false }, sub_system_tag: "EM",
{ title: "Low voltage switchboard", icon: "charging-station", isError: false }, },
{ title: "Water supply system", icon: "tint", isError: false }, {
{ title: "Sewage and wastewater equipment", icon: "water", isError: false }, title: "Lighting System",
{ title: "Emergency generator", icon: "car-battery", isError: false }, icon: "lightbulb",
{ title: "Fire Equipment", icon: "fire-extinguisher", isError: false }, isError: false,
{ title: "CCTV system", icon: "video", isError: true }, main_system_tag: "LS",
{ title: "Access control system", icon: "door-open", isError: false }, sub_system_tag: "ECLS",
{ title: "Shutdown system", icon: "car", isError: false }, },
{ title: "Emergency rescue system", icon: "exclamation-triangle", isError: true }, {
{ title: "Air supply and exhaust system", icon: "wind", isError: false }, title: "Air Condition System",
icon: "fan",
isError: false,
main_system_tag: "ME",
sub_system_tag: "TH",
},
{
title: "Electricity System",
icon: "bolt",
isError: false,
main_system_tag: "EE",
sub_system_tag: "ECP3",
},
{
title: "Elevator system",
icon: "building",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "High voltage switchboard",
icon: "charging-station",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Low voltage switchboard",
icon: "charging-station",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Water supply system",
icon: "tint",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Sewage and wastewater equipment",
icon: "water",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Emergency generator",
icon: "car-battery",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Fire Equipment",
icon: "fire-extinguisher",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "CCTV system",
icon: "video",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Access control system",
icon: "door-open",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Shutdown system",
icon: "car",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Emergency rescue system",
icon: "exclamation-triangle",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
{
title: "Air supply and exhaust system",
icon: "wind",
isError: false,
main_system_tag: null,
sub_system_tag: null,
},
]); ]);
const navigateToSubSystem = (mainSystemId, subSystemId) => {
router.push({
name: "sub_system",
params: {
main_system_id: mainSystemId,
sub_system_id: subSystemId,
},
});
};
</script> </script>
<template> <template>
@ -27,7 +134,11 @@ const mockData = ref([
<div <div
v-for="(item, index) in mockData" v-for="(item, index) in mockData"
:key="index" :key="index"
class="w-full sm:w-1/2 lg:w-1/4 relative my-2" :class="[
'w-full sm:w-1/2 lg:w-1/4 relative my-2 cursor-pointer',
item.sub_system_tag ? '' : 'grayscale opacity-70 cursor-not-allowed'
]"
@click="navigateToSubSystem(item.main_system_tag, item.sub_system_tag)"
> >
<img <img
v-if="item.isError" v-if="item.isError"
@ -37,7 +148,10 @@ const mockData = ref([
<div class="equipment-item"> <div class="equipment-item">
<div class="w-16"> <div class="w-16">
<FontAwesomeIcon class="text-2xl mt-1 m-auto" :icon="['fas', item.icon]"></FontAwesomeIcon> <FontAwesomeIcon
class="text-2xl mt-1 m-auto"
:icon="['fas', item.icon]"
></FontAwesomeIcon>
</div> </div>
<div class="icon-text"> <div class="icon-text">
<div class="text-slate-300 text-sm">{{ item.title }}</div> <div class="text-slate-300 text-sm">{{ item.title }}</div>

View File

@ -211,7 +211,7 @@ onUnmounted(() => {
<template> <template>
<div <div
ref="sidebar" ref="sidebar"
class="border-2 border-info rounded-md py-2 px-4 sidebar" class="custom-border py-2 px-4 sidebar"
@contextmenu.prevent.stop="onAddRightClick" @contextmenu.prevent.stop="onAddRightClick"
> >
<Collapse <Collapse