|
@@ -10,8 +10,7 @@
|
|
|
</div>
|
|
|
<div class="home_container_header-left_tab">
|
|
|
<div class="button-container">
|
|
|
- <div v-for="(item, index) in buttons" :key="index" class="parallelogram-button"
|
|
|
- :class="{ highlight: commonStore.activeIndex === index }" @click="setActive(index, item)">
|
|
|
+ <div v-for="(item, index) in buttons" :key="index" class="parallelogram-button" :class="{ highlight: commonStore.activeIndex === index }" @click="setActive(index, item)">
|
|
|
<div class="text-container" :class="{ 'text-container-highlight': activeIndex === index }">
|
|
|
{{ item.title }}
|
|
|
</div>
|
|
@@ -37,94 +36,84 @@
|
|
|
<RightPage :activeIndex="activeIndex"></RightPage>
|
|
|
</div>
|
|
|
|
|
|
+ <div class="bg_left"></div>
|
|
|
+ <div class="bg_right"></div>
|
|
|
+
|
|
|
<!-- 底部片区图层按钮 -->
|
|
|
<AreaLayerSwitch></AreaLayerSwitch>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import UeMap from '../components/UeMap.vue';
|
|
|
-import AreaLayerSwitch from "../components/AreaLayerSwitch/index";
|
|
|
-import LeftPage from "./left/index.vue";
|
|
|
-import RightPage from "./right/index.vue";
|
|
|
-import { storeToRefs } from "pinia";
|
|
|
-import { useUserStore } from "../store/user";
|
|
|
-import { useCommonStore } from "../store/common.js";
|
|
|
-import {
|
|
|
- ref,
|
|
|
- reactive,
|
|
|
- toRefs,
|
|
|
- onBeforeMount,
|
|
|
- onMounted,
|
|
|
- onUnmounted,
|
|
|
- watch,
|
|
|
-} from "vue";
|
|
|
-import axios from 'axios';
|
|
|
-
|
|
|
-const submitForm = async (e) => {
|
|
|
+import UeMap from '../components/UeMap.vue'
|
|
|
+import AreaLayerSwitch from '../components/AreaLayerSwitch/index'
|
|
|
+import LeftPage from './left/index.vue'
|
|
|
+import RightPage from './right/index.vue'
|
|
|
+import { storeToRefs } from 'pinia'
|
|
|
+import { useUserStore } from '../store/user'
|
|
|
+import { useCommonStore } from '../store/common.js'
|
|
|
+import { ref, reactive, toRefs, onBeforeMount, onMounted, onUnmounted, watch } from 'vue'
|
|
|
+import { getAuth } from '../utils/ueMap.js'
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+async function getUEAuth() {
|
|
|
try {
|
|
|
- const response = await axios.post(import.meta.env.VITE_SERVICE_API_URL + '/auth/login', {
|
|
|
- // username: ruleForm.username,
|
|
|
- // password: ruleForm.password
|
|
|
- username: 'JKTest',
|
|
|
- password: '123456'
|
|
|
- });
|
|
|
- localStorage.setItem('token', response.data.access_token);
|
|
|
-
|
|
|
- // if (response.status === 201) {
|
|
|
- // localStorage.setItem('token', response.data.access_token);
|
|
|
- // // router.push('/home');
|
|
|
- // }
|
|
|
+ await getAuth({ username: 'JKTest', password: '123456' }).then(res => {
|
|
|
+ if (res.code === 201) {
|
|
|
+ console.log(res, 'res99')
|
|
|
+ localStorage.setItem('token', res.access_token)
|
|
|
+ }
|
|
|
+ })
|
|
|
} catch (error) {
|
|
|
- alert('登陆失败');
|
|
|
- console.log(error);
|
|
|
+ console.error('获取 UE token 失败', error)
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
|
|
|
-let userStore = useUserStore();
|
|
|
-let commonStore = useCommonStore();
|
|
|
+let userStore = useUserStore()
|
|
|
+let commonStore = useCommonStore()
|
|
|
|
|
|
-console.log(userStore, "useUserStore");
|
|
|
-let { name, age } = storeToRefs(userStore);
|
|
|
-const currentTime = ref("");
|
|
|
+console.log(userStore, 'useUserStore')
|
|
|
+let { name, age } = storeToRefs(userStore)
|
|
|
+const currentTime = ref('')
|
|
|
// 更新当前时间的函数
|
|
|
// 更新当前时间的函数
|
|
|
const updateTime = () => {
|
|
|
- const now = new Date();
|
|
|
+ const now = new Date()
|
|
|
|
|
|
// 格式化为 2025-02-25 10:39:05
|
|
|
- const year = now.getFullYear();
|
|
|
- const month = String(now.getMonth() + 1).padStart(2, "0"); // 月份从 0 开始,需加 1
|
|
|
- const day = String(now.getDate()).padStart(2, "0");
|
|
|
- const hours = String(now.getHours()).padStart(2, "0");
|
|
|
- const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
|
- const seconds = String(now.getSeconds()).padStart(2, "0");
|
|
|
-
|
|
|
- currentTime.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
-};
|
|
|
+ const year = now.getFullYear()
|
|
|
+ const month = String(now.getMonth() + 1).padStart(2, '0') // 月份从 0 开始,需加 1
|
|
|
+ const day = String(now.getDate()).padStart(2, '0')
|
|
|
+ const hours = String(now.getHours()).padStart(2, '0')
|
|
|
+ const minutes = String(now.getMinutes()).padStart(2, '0')
|
|
|
+ const seconds = String(now.getSeconds()).padStart(2, '0')
|
|
|
+
|
|
|
+ currentTime.value = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
|
|
|
+}
|
|
|
// 设置定时器每秒更新一次
|
|
|
-let timer;
|
|
|
+let timer
|
|
|
onMounted(() => {
|
|
|
- submitForm()
|
|
|
- updateTime(); // 初始化时更新时间
|
|
|
- timer = setInterval(updateTime, 1000); // 每秒更新
|
|
|
- activeIndex.value = commonStore.getActiveIndex();
|
|
|
-});
|
|
|
+ // getUEAuth()
|
|
|
+ updateTime() // 初始化时更新时间
|
|
|
+ timer = setInterval(updateTime, 1000) // 每秒更新
|
|
|
+ activeIndex.value = commonStore.getActiveIndex()
|
|
|
+})
|
|
|
|
|
|
// 清理定时器
|
|
|
onUnmounted(() => {
|
|
|
- clearInterval(timer);
|
|
|
-});
|
|
|
+ clearInterval(timer)
|
|
|
+})
|
|
|
|
|
|
let buttons = ref([
|
|
|
- { id: 0, title: "报告处置", active: true },
|
|
|
- { id: 1, title: "处置进展", active: false },
|
|
|
-]);
|
|
|
-let activeIndex = ref(0); // 存储当前高亮按钮的索引
|
|
|
+ { id: 0, title: '报告处置', active: true },
|
|
|
+ { id: 1, title: '处置进展', active: false }
|
|
|
+])
|
|
|
+let activeIndex = ref(0) // 存储当前高亮按钮的索引
|
|
|
|
|
|
-function setActive (index, item) {
|
|
|
+function setActive(index, item) {
|
|
|
// 切换高亮按钮,点击时高亮切换
|
|
|
- activeIndex.value = index;
|
|
|
- commonStore.setActiveIndex(index);
|
|
|
+ activeIndex.value = index
|
|
|
+ commonStore.setActiveIndex(index)
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
@@ -146,6 +135,7 @@ function setActive (index, item) {
|
|
|
background: url(../assets/img/大标题.png) no-repeat;
|
|
|
background-size: 100% 100%;
|
|
|
position: relative;
|
|
|
+ z-index: 999;
|
|
|
|
|
|
.home_container_header-left {
|
|
|
position: absolute;
|
|
@@ -266,7 +256,7 @@ function setActive (index, item) {
|
|
|
.icon-img {
|
|
|
width: 40px;
|
|
|
height: 40px;
|
|
|
- background-image: url("../assets/img/通讯录@2x.png");
|
|
|
+ background-image: url('../assets/img/通讯录@2x.png');
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
|
|
@@ -293,7 +283,7 @@ function setActive (index, item) {
|
|
|
.duoyun {
|
|
|
width: 35px;
|
|
|
height: 35px;
|
|
|
- background-image: url("../assets/img/多云.png");
|
|
|
+ background-image: url('../assets/img/多云.png');
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
|
|
@@ -313,6 +303,9 @@ function setActive (index, item) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 左侧样式
|
|
|
.home_content_left {
|
|
|
position: absolute;
|
|
@@ -320,7 +313,15 @@ function setActive (index, item) {
|
|
|
top: 108px;
|
|
|
width: 1124px;
|
|
|
height: 945px;
|
|
|
- // background-color: pink;
|
|
|
+
|
|
|
+ // left: 0px;
|
|
|
+ // top: 30px;
|
|
|
+ // height: 1080px;
|
|
|
+ // width: 1250px;
|
|
|
+ // background:rgba(0, 0, 0, 0.2) url(../assets/img/left_bg.png) no-repeat;
|
|
|
+ // background-size: 100% 100%;
|
|
|
+ // background: url(../assets/img/Snipaste_2025-03-31_15-55-37.png)no-repeat;
|
|
|
+ // background-size: 100% 100%;
|
|
|
}
|
|
|
|
|
|
// 右侧
|