2023-05-12 08:41:33 +00:00
|
|
|
<!--
|
2023-06-06 08:57:53 +00:00
|
|
|
* @FilePath: \code\gitscreenFront\src\views\index.vue
|
2023-05-12 08:41:33 +00:00
|
|
|
* @Author: 王路平
|
|
|
|
* @文件版本: V1.0.0
|
|
|
|
* @Date: 2023-01-29 15:34:48
|
|
|
|
* @Description:
|
|
|
|
*
|
|
|
|
* 版权信息 : 2023 by ${再登软件}, All Rights Reserved.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div :class="$style['container']" ref="appRef">
|
|
|
|
<div class="navbar">
|
2023-08-07 09:14:54 +00:00
|
|
|
<h2 class="title">物联大屏系统</h2>
|
2023-08-07 09:09:03 +00:00
|
|
|
<div class="dropdown">
|
|
|
|
<el-dropdown @command="changelang">
|
|
|
|
<span class="el-dropdown-link">
|
|
|
|
<!-- <img src="../assets/svg/gateway.svg" alt="" class="langimg" height="20px" width="20px"> -->
|
|
|
|
<i class="iconfont icon-zhongyingwen langimg"></i>
|
|
|
|
</span>
|
|
|
|
<template #dropdown>
|
|
|
|
<el-dropdown-menu>
|
2024-01-25 09:09:25 +00:00
|
|
|
<el-dropdown-item v-for="item in language" :class="item.name == lang ? 'select' : ''"
|
|
|
|
:command="item.value">{{ item.simple }}</el-dropdown-item>
|
|
|
|
|
2023-08-07 09:09:03 +00:00
|
|
|
</el-dropdown-menu>
|
|
|
|
</template>
|
|
|
|
</el-dropdown>
|
|
|
|
</div>
|
2023-05-12 08:41:33 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="itemlist">
|
2024-11-13 08:03:59 +00:00
|
|
|
<div class="category" v-for="(value, key) in categoryList">
|
|
|
|
<h2 class="category-title">{{ key }}</h2>
|
|
|
|
<div class="category-item">
|
|
|
|
<list v-for="res in value" :hash="res.hash" :path="res.path" :is-link="res.isLink" :title="res.title"
|
|
|
|
:key="res.id" :url="res.url"></list>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- <list v-for="res in routerList" :hash="res.hash" :path="res.path" :is-link="res.isLink" :title="res.title"
|
|
|
|
:key="res.id" :url="res.url"></list> -->
|
2023-05-12 08:41:33 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2023-12-27 06:08:10 +00:00
|
|
|
import { ref, reactive, onMounted, onUnmounted } from "vue";
|
2023-05-12 08:41:33 +00:00
|
|
|
import list from "@/components/assembly/indexList.vue";
|
|
|
|
import { useI18n } from "vue-i18n";
|
2024-01-25 09:09:25 +00:00
|
|
|
import { getStoredLanguage, saveStoredLanguage, languageHash } from "@/utils/languageStorage";
|
2024-11-13 08:03:59 +00:00
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
2023-08-03 03:37:01 +00:00
|
|
|
import { getScreenByHash } from "@/http/rule/index"
|
2024-01-25 09:09:25 +00:00
|
|
|
import { imgurlAddXhr } from "@/utils/devSever"
|
2023-08-03 03:37:01 +00:00
|
|
|
let langicon = require("@/assets/svg/language.svg")
|
2023-08-02 10:04:04 +00:00
|
|
|
let route = useRoute()
|
2024-01-25 09:09:25 +00:00
|
|
|
let router = useRouter()
|
2023-05-12 08:41:33 +00:00
|
|
|
window.document.title = "大屏物联管理系统";
|
|
|
|
let { t } = useI18n();
|
2023-12-27 06:08:10 +00:00
|
|
|
let language = reactive([
|
|
|
|
{
|
|
|
|
name: "简体中文",
|
|
|
|
simple: "简体中文",
|
|
|
|
value: "zh",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "English/USD",
|
|
|
|
simple: "English",
|
|
|
|
value: "en",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: "Spanish/USD",
|
|
|
|
simple: "Español",
|
|
|
|
value: "es",
|
2023-08-03 03:37:01 +00:00
|
|
|
}
|
2023-12-27 06:08:10 +00:00
|
|
|
])
|
2024-01-25 09:09:25 +00:00
|
|
|
let routerList = ref()
|
2023-08-03 03:37:01 +00:00
|
|
|
let lang = ref(getStoredLanguage() || '简体中文')
|
|
|
|
function changelang(val) {
|
2024-01-25 09:09:25 +00:00
|
|
|
saveStoredLanguage(languageHash(val))
|
2023-08-03 03:37:01 +00:00
|
|
|
location.reload()
|
|
|
|
}
|
2024-11-13 08:03:59 +00:00
|
|
|
function convertChineseToArabic(str) {
|
|
|
|
const nums = {
|
|
|
|
零: 0, 一: 1, 二: 2, 两: 2, 三: 3, 四: 4, 五: 5, 六: 6, 七: 7, 八: 8, 九: 9
|
|
|
|
};
|
|
|
|
let result = str.replace(/[零一二两三四五六七八九]/g, (match) => {
|
|
|
|
return nums[match];
|
|
|
|
});
|
|
|
|
return parseInt(result, 10);
|
|
|
|
}
|
|
|
|
const categoryList: any = ref({})
|
2023-08-03 03:37:01 +00:00
|
|
|
async function reqScreenByHash() {
|
|
|
|
let hash = sessionStorage.getItem('screen_hash')
|
2024-01-25 09:09:25 +00:00
|
|
|
let res: any = await getScreenByHash({ hash });
|
2023-08-03 03:37:01 +00:00
|
|
|
if (res.code === 200) {
|
2024-01-25 09:09:25 +00:00
|
|
|
let { data } = res
|
|
|
|
routerList.value = data.map((item: any) => {
|
2023-12-18 03:05:46 +00:00
|
|
|
const regex = /^(http|https):\/\/[^ "]+$/;
|
|
|
|
let isTrue = regex.test(item.img);
|
2023-08-03 03:37:01 +00:00
|
|
|
return {
|
|
|
|
id: item.id,
|
|
|
|
isLink: false,
|
|
|
|
path: item.path,
|
|
|
|
title: item.title,
|
2024-01-25 09:09:25 +00:00
|
|
|
url: isTrue ? item.img : imgurlAddXhr(item.img),
|
2024-11-13 08:03:59 +00:00
|
|
|
hash: hash,
|
|
|
|
screenType: item.screenType
|
2023-08-03 03:37:01 +00:00
|
|
|
}
|
|
|
|
})
|
2024-01-25 09:09:25 +00:00
|
|
|
|
2024-11-13 08:03:59 +00:00
|
|
|
routerList.value.forEach(element => {
|
|
|
|
if (element.screenType !== null) {
|
|
|
|
if (categoryList.value.hasOwnProperty(element.screenType)) {
|
|
|
|
categoryList.value[element.screenType].push(element)
|
|
|
|
} else {
|
|
|
|
categoryList.value[element.screenType] = [element]
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (categoryList.value.hasOwnProperty('其他')) {
|
|
|
|
categoryList.value['其他'].push(element)
|
|
|
|
} else {
|
|
|
|
categoryList.value['其他'] = [element]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
console.log(categoryList.value);
|
|
|
|
|
2023-08-03 03:37:01 +00:00
|
|
|
}
|
2023-05-12 08:58:35 +00:00
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
}
|
2023-08-02 10:04:04 +00:00
|
|
|
onMounted(() => {
|
2023-08-03 03:37:01 +00:00
|
|
|
reqScreenByHash()
|
|
|
|
|
2023-08-02 10:04:04 +00:00
|
|
|
});
|
2023-08-03 03:37:01 +00:00
|
|
|
onUnmounted(() => { });
|
2023-05-12 08:41:33 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style module>
|
|
|
|
.container {
|
|
|
|
height: 1080px;
|
|
|
|
width: 1920px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<style scoped>
|
2023-05-12 08:58:35 +00:00
|
|
|
@import '../assets/css/iconfont.css';
|
2023-08-03 03:37:01 +00:00
|
|
|
|
|
|
|
.langimg {
|
2023-05-12 08:58:35 +00:00
|
|
|
width: 50px;
|
|
|
|
height: 50px;
|
|
|
|
font-size: 50px;
|
|
|
|
color: #fff;
|
|
|
|
}
|
2023-08-03 03:37:01 +00:00
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
.itemlist {
|
2023-08-15 06:59:32 +00:00
|
|
|
height: 990px;
|
2023-05-12 08:41:33 +00:00
|
|
|
width: 1920px;
|
|
|
|
color: #20aec5;
|
|
|
|
background-color: #100c2a;
|
2024-11-13 08:03:59 +00:00
|
|
|
overflow: scroll !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.category {
|
|
|
|
width: 1920px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.category-title {
|
|
|
|
padding-left: 40px;
|
|
|
|
font-size: 32px;
|
|
|
|
text-align: left;
|
|
|
|
font-weight: bold;
|
|
|
|
color: whitesmoke;
|
|
|
|
|
|
|
|
}
|
|
|
|
.category-item {
|
|
|
|
width: 1920px;
|
2023-05-12 08:41:33 +00:00
|
|
|
display: flex;
|
2024-11-13 08:03:59 +00:00
|
|
|
justify-content: flex-start;
|
2023-05-12 08:41:33 +00:00
|
|
|
align-items: center;
|
|
|
|
flex-wrap: wrap;
|
2024-11-13 08:03:59 +00:00
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
}
|
2023-08-03 03:37:01 +00:00
|
|
|
|
2023-08-07 09:09:03 +00:00
|
|
|
.title {
|
|
|
|
font-size: 40px;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
color: white;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
right: 90px;
|
|
|
|
}
|
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
.navbar {
|
2023-10-08 06:34:40 +00:00
|
|
|
position: relative;
|
2023-05-12 08:41:33 +00:00
|
|
|
height: 50px;
|
|
|
|
font-size: 20px;
|
2023-10-08 06:34:40 +00:00
|
|
|
margin: 20px;
|
|
|
|
margin-top: 40px;
|
2023-05-12 08:41:33 +00:00
|
|
|
display: flex;
|
2023-10-08 06:34:40 +00:00
|
|
|
justify-content: center;
|
2023-05-12 08:41:33 +00:00
|
|
|
align-items: center;
|
|
|
|
}
|
2023-08-03 03:37:01 +00:00
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
.el-dropdown-link {
|
|
|
|
font-size: 30px;
|
|
|
|
color: #fff;
|
|
|
|
}
|
2023-05-12 08:58:35 +00:00
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
.el-dropdown-menu {
|
|
|
|
background-color: #303133 !important;
|
|
|
|
color: #fff;
|
|
|
|
}
|
2023-08-03 03:37:01 +00:00
|
|
|
|
|
|
|
.el-dropdown-menu__item {
|
|
|
|
color: #fff !important;
|
2023-05-12 08:41:33 +00:00
|
|
|
}
|
2023-08-03 03:37:01 +00:00
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
.el-popper.is-light .el-popper__arrow::before {
|
|
|
|
background-color: #303133 !important;
|
|
|
|
color: #fff;
|
|
|
|
}
|
2023-08-03 03:37:01 +00:00
|
|
|
|
2023-05-12 08:58:35 +00:00
|
|
|
:deep(.select) {
|
|
|
|
background-color: #e4f5f5 !important;
|
|
|
|
color: #409EFF !important;
|
|
|
|
}
|
2023-05-12 08:41:33 +00:00
|
|
|
</style>
|
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
--header: 150px;
|
|
|
|
/* --content:calc(100vh - var(--header)) */
|
|
|
|
overflow: hidden !important;
|
|
|
|
-ms-overflow-style: none;
|
|
|
|
/* IE + Edge */
|
|
|
|
scrollbar-width: none;
|
|
|
|
/* Firefox */
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|