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