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>
|
2023-12-27 06:08:10 +00:00
|
|
|
<el-dropdown-item v-for="item in language" :class="item.name == lang ? 'select' : ''" :command="item.name">{{ 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">
|
2023-08-03 03:37:01 +00:00
|
|
|
<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";
|
|
|
|
import { getStoredLanguage, saveStoredLanguage } from "@/utils/languageStorage";
|
2023-08-02 10:04:04 +00:00
|
|
|
import { useRoute } from 'vue-router'
|
2023-08-03 03:37:01 +00:00
|
|
|
import { getScreenByHash } from "@/http/rule/index"
|
2023-12-18 03:05:46 +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()
|
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
|
|
|
])
|
2023-08-03 03:37:01 +00:00
|
|
|
let routerList = ref()
|
|
|
|
let lang = ref(getStoredLanguage() || '简体中文')
|
|
|
|
function changelang(val) {
|
|
|
|
saveStoredLanguage(val)
|
|
|
|
location.reload()
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async function reqScreenByHash() {
|
|
|
|
let hash = sessionStorage.getItem('screen_hash')
|
|
|
|
let res:any = await getScreenByHash({hash});
|
|
|
|
if (res.code === 200) {
|
|
|
|
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,
|
2023-12-18 03:05:46 +00:00
|
|
|
url: isTrue?item.img:imgurlAddXhr(item.img),
|
2023-08-03 03:37:01 +00:00
|
|
|
hash: hash
|
|
|
|
}
|
|
|
|
})
|
2023-12-18 03:05:46 +00:00
|
|
|
|
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;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
overflow: auto !important;
|
|
|
|
}
|
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>
|