1
This commit is contained in:
parent
8f1af839ce
commit
0a7b9d6f89
|
|
@ -98,8 +98,6 @@ import { Swiper, SwiperSlide } from "swiper/vue"
|
||||||
import { Navigation, Pagination, EffectCoverflow, Mousewheel } from "swiper/modules"
|
import { Navigation, Pagination, EffectCoverflow, Mousewheel } from "swiper/modules"
|
||||||
import { nowSize } from "@/utils/echarts-self-adaption"
|
import { nowSize } from "@/utils/echarts-self-adaption"
|
||||||
import { useRouter } from "vue-router"
|
import { useRouter } from "vue-router"
|
||||||
|
|
||||||
// Swiper 样式
|
|
||||||
import "swiper/css"
|
import "swiper/css"
|
||||||
import "swiper/css/navigation"
|
import "swiper/css/navigation"
|
||||||
import "swiper/css/pagination"
|
import "swiper/css/pagination"
|
||||||
|
|
@ -107,7 +105,7 @@ import "swiper/css/pagination"
|
||||||
const modules = [Navigation, Pagination, EffectCoverflow, Mousewheel]
|
const modules = [Navigation, Pagination, EffectCoverflow, Mousewheel]
|
||||||
|
|
||||||
// 10 个导航项
|
// 10 个导航项
|
||||||
const navItems = ref([
|
const navItems = [
|
||||||
"重大舆情事件锚点",
|
"重大舆情事件锚点",
|
||||||
"传播意见领袖",
|
"传播意见领袖",
|
||||||
"传播桥梁节点",
|
"传播桥梁节点",
|
||||||
|
|
@ -118,7 +116,7 @@ const navItems = ref([
|
||||||
"群体结构演化",
|
"群体结构演化",
|
||||||
"群体成员演化",
|
"群体成员演化",
|
||||||
"异常群体"
|
"异常群体"
|
||||||
])
|
]
|
||||||
|
|
||||||
// 批量把 /src/assets/... 变成可用 URL
|
// 批量把 /src/assets/... 变成可用 URL
|
||||||
const assets = import.meta.glob("/src/assets/images/navigation/nav-item-*.png", {
|
const assets = import.meta.glob("/src/assets/images/navigation/nav-item-*.png", {
|
||||||
|
|
@ -174,7 +172,7 @@ const onSwiper = (swiper) => {
|
||||||
// 初始化标题为关键节点识别
|
// 初始化标题为关键节点识别
|
||||||
currentTitle.value = "关键节点识别"
|
currentTitle.value = "关键节点识别"
|
||||||
// 初始化中间导航项为
|
// 初始化中间导航项为
|
||||||
const initIndex = navItems.value.indexOf("传播意见领袖")
|
const initIndex = navItems.indexOf("传播意见领袖")
|
||||||
if (initIndex !== -1) {
|
if (initIndex !== -1) {
|
||||||
swiper.slideToLoop(initIndex)
|
swiper.slideToLoop(initIndex)
|
||||||
}
|
}
|
||||||
|
|
@ -196,7 +194,7 @@ const handleCategoryNext = () => {
|
||||||
// 获取下一个类别的中心项
|
// 获取下一个类别的中心项
|
||||||
const centerItem = categoryCenterItems[nextCategory]
|
const centerItem = categoryCenterItems[nextCategory]
|
||||||
// 找到中心项在navItems中的索引
|
// 找到中心项在navItems中的索引
|
||||||
const centerIndex = navItems.value.indexOf(centerItem)
|
const centerIndex = navItems.indexOf(centerItem)
|
||||||
if (centerIndex !== -1) {
|
if (centerIndex !== -1) {
|
||||||
// 滑动到对应的位置
|
// 滑动到对应的位置
|
||||||
swiperRef.value.slideToLoop(centerIndex)
|
swiperRef.value.slideToLoop(centerIndex)
|
||||||
|
|
@ -219,7 +217,7 @@ const handleCategoryPrev = () => {
|
||||||
// 获取上一个类别的中心项
|
// 获取上一个类别的中心项
|
||||||
const centerItem = categoryCenterItems[prevCategory]
|
const centerItem = categoryCenterItems[prevCategory]
|
||||||
// 找到中心项在navItems中的索引
|
// 找到中心项在navItems中的索引
|
||||||
const centerIndex = navItems.value.indexOf(centerItem)
|
const centerIndex = navItems.indexOf(centerItem)
|
||||||
if (centerIndex !== -1) {
|
if (centerIndex !== -1) {
|
||||||
// 滑动到对应的位置
|
// 滑动到对应的位置
|
||||||
swiperRef.value.slideToLoop(centerIndex)
|
swiperRef.value.slideToLoop(centerIndex)
|
||||||
|
|
@ -228,13 +226,10 @@ const handleCategoryPrev = () => {
|
||||||
|
|
||||||
const updateCurrentTitle = () => {
|
const updateCurrentTitle = () => {
|
||||||
if (!swiperRef.value) return
|
if (!swiperRef.value) return
|
||||||
|
|
||||||
// 获取当前活动的slide索引
|
|
||||||
const activeIndex = swiperRef.value.activeIndex
|
|
||||||
// 获取实际数据索引(考虑loop模式)
|
// 获取实际数据索引(考虑loop模式)
|
||||||
const realIndex = swiperRef.value.realIndex
|
const realIndex = swiperRef.value.realIndex
|
||||||
// 获取当前居中的导航项
|
// 获取当前居中的导航项
|
||||||
const activeItem = navItems.value[realIndex]
|
const activeItem = navItems[realIndex]
|
||||||
|
|
||||||
// 判断所属类别并更新标题
|
// 判断所属类别并更新标题
|
||||||
for (const [category, items] of Object.entries(navCategories)) {
|
for (const [category, items] of Object.entries(navCategories)) {
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,7 @@
|
||||||
placeholder="请输入用户名"
|
placeholder="请输入用户名"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<img
|
<img src="@/assets/images/login/user-name.png" alt="user-name" class="username" />
|
||||||
src="@/assets/images/login/user-name.png"
|
|
||||||
alt="user-name"
|
|
||||||
style="width: 16px; height: 16px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -36,11 +32,7 @@
|
||||||
placeholder="请输入密码"
|
placeholder="请输入密码"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<img
|
<img src="@/assets/images/login/password.png" alt="password" class="password" />
|
||||||
src="@/assets/images/login/password.png"
|
|
||||||
alt="password"
|
|
||||||
style="width: 16px; height: 16px"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -58,14 +50,14 @@ import { useLoginStore } from "@/store/authentication/index"
|
||||||
const ruleFormRef = ref(null)
|
const ruleFormRef = ref(null)
|
||||||
const loginStore = useLoginStore()
|
const loginStore = useLoginStore()
|
||||||
|
|
||||||
const validateUsername = (rule, value, callback) => {
|
const validateUsername = (_, value, callback) => {
|
||||||
if (value === "") {
|
if (value === "") {
|
||||||
callback(new Error("账号不得为空!"))
|
callback(new Error("账号不得为空!"))
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const validatePassword = (rule, value, callback) => {
|
const validatePassword = (_, value, callback) => {
|
||||||
if (value === "") {
|
if (value === "") {
|
||||||
callback(new Error("密码不得为空!"))
|
callback(new Error("密码不得为空!"))
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -120,6 +112,11 @@ const submitForm = (formEl) => {
|
||||||
margin-bottom: vh(46);
|
margin-bottom: vh(46);
|
||||||
font-size: vw(32);
|
font-size: vw(32);
|
||||||
}
|
}
|
||||||
|
.username,
|
||||||
|
.password {
|
||||||
|
width: vw(16);
|
||||||
|
height: vh(16);
|
||||||
|
}
|
||||||
/* 修改 el-input 样式 */
|
/* 修改 el-input 样式 */
|
||||||
:deep(.el-input__wrapper) {
|
:deep(.el-input__wrapper) {
|
||||||
background: rgba(0, 166, 255, 0.1) !important; /* 背景颜色 */
|
background: rgba(0, 166, 255, 0.1) !important; /* 背景颜色 */
|
||||||
|
|
@ -152,7 +149,7 @@ const submitForm = (formEl) => {
|
||||||
radial-gradient(77.05% 52.73% at 50% 131.82%, #00a6ff 12.05%, rgba(63, 129, 207, 0) 95.88%),
|
radial-gradient(77.05% 52.73% at 50% 131.82%, #00a6ff 12.05%, rgba(63, 129, 207, 0) 95.88%),
|
||||||
rgba(0, 166, 255, 0.3) !important;
|
rgba(0, 166, 255, 0.3) !important;
|
||||||
border-color: #00a6ff !important;
|
border-color: #00a6ff !important;
|
||||||
transform: translateY(1px);
|
transform: translateY(vw(1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user