Browse Source

Merge remote-tracking branch 'origin/dev' into dev

hmm 7 months ago
parent
commit
933af6e511

+ 19 - 0
package-lock.json

@@ -50,6 +50,7 @@
         "pinia": "^2.1.7",
         "proj4": "^2.12.1",
         "screenfull": "6.0.2",
+        "swiper": "^11.1.14",
         "uuid": "^10.0.0",
         "vue": "3.4.25",
         "vue-cropper": "1.1.1",
@@ -11150,6 +11151,24 @@
       "integrity": "sha512-dn6wd0uw5GsdswPFfsgMp5NSB0/aDe6fK94YJV/AJDYXL6HVLWBsxeq7js7Ad+mU2K9LAlwpk6kN2D5mwCPVow==",
       "dev": true
     },
+    "node_modules/swiper": {
+      "version": "11.1.14",
+      "resolved": "https://registry.npmmirror.com/swiper/-/swiper-11.1.14.tgz",
+      "integrity": "sha512-VbQLQXC04io6AoAjIUWuZwW4MSYozkcP9KjLdrsG/00Q/yiwvhz9RQyt0nHXV10hi9NVnDNy1/wv7Dzq1lkOCQ==",
+      "funding": [
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/swiperjs"
+        },
+        {
+          "type": "open_collective",
+          "url": "http://opencollective.com/swiper"
+        }
+      ],
+      "engines": {
+        "node": ">= 4.7.0"
+      }
+    },
     "node_modules/synckit": {
       "version": "0.8.8",
       "resolved": "https://registry.npmmirror.com/synckit/-/synckit-0.8.8.tgz",

+ 1 - 0
package.json

@@ -59,6 +59,7 @@
     "pinia": "^2.1.7",
     "proj4": "^2.12.1",
     "screenfull": "6.0.2",
+    "swiper": "^11.1.14",
     "uuid": "^10.0.0",
     "vue": "3.4.25",
     "vue-cropper": "1.1.1",

BIN
src/assets/images/censusDataAnalysis/box4.png


BIN
src/assets/images/censusDataAnalysis/left.png


BIN
src/assets/images/censusDataAnalysis/map.png


BIN
src/assets/images/censusDataAnalysis/right.png


+ 2 - 0
src/components/Dialog/index.vue

@@ -51,6 +51,8 @@ const emit = defineEmits(['update:modelValue', 'close', 'confirm']);
 const computedWidth = computed(() => {
   if (!!props.width) {
     return props.width;
+  } else if (!!props.width) {
+    return props.width;
   } else if (props.type === 'xs') {
     return '404px';
   } else if (props.type === 'sm') {

+ 8 - 0
src/types/components.d.ts

@@ -23,6 +23,8 @@ declare module 'vue' {
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCarousel: typeof import('element-plus/es')['ElCarousel']
+    ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
@@ -40,11 +42,14 @@ declare module 'vue' {
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
+    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
+    ElRadio: typeof import('element-plus/es')['ElRadio']
+    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
@@ -59,6 +64,7 @@ declare module 'vue' {
     ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTree: typeof import('element-plus/es')['ElTree']
+    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
@@ -70,6 +76,8 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
+    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
+    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 30 - 7
src/views/censusDataAnalysis/ForestFire/index.vue

@@ -16,7 +16,7 @@
               v-for="(item, index) in analysisServices"
               :key="index"
               :class="activeIndex1 === index ? 'tag-item tag-active' : 'tag-item'"
-              @click="handleClick1(item, index)"
+              @click="handleClick1(item.value)"
             >
               <i :class="item.icon" />
               {{ item.name }}
@@ -56,10 +56,13 @@
         :points="points"
       />
       <div class="map-title">{{ mapTitle }}</div>
+      <div class="map-time">{{ mapTime }}</div>
     </div>
     <div class="right-box">
-      <RightSection />
+      <RightSection id="mapId" />
     </div>
+    <!--风险趋势分析-->
+    <RiskTrendAnalysis v-if="showRiskTrendAnalysis" v-model="showRiskTrendAnalysis" @confirm="handleRiskConfirm" />
   </div>
 </template>
 
@@ -67,6 +70,8 @@
 // 分析服务
 import RightSection from './RightSection.vue';
 import BaseService from './BaseService.vue';
+import RiskTrendAnalysis from '@/views/censusDataAnalysis/RiskTrendAnalysis.vue';
+import { parseTime } from '@/utils/ruoyi';
 
 let activeIndex = ref('1');
 let activeIndex1 = ref(0);
@@ -74,14 +79,15 @@ const analysisServices = ref([
   { name: '风险实时分析', value: '1', icon: 'icon1' },
   { name: '风险趋势分析', value: '2', icon: 'icon2' }
 ]);
+let showRiskTrendAnalysis = ref(false);
 const handleClick = (index) => {
 
-}
+};
 // 点击分析服务
-const handleClick1 = (item, index) => {
-  if (activeIndex1.value === index) return;
-  activeIndex1.value = index;
-  console.log('点击', item);
+const handleClick1 = (index) => {
+  if (index === '2') {
+    showRiskTrendAnalysis.value = true;
+  }
 };
 
 // 图层服务
@@ -91,6 +97,7 @@ const layerService = ref([]);
 // 使用地图地图
 let activeMap = ref('imageMap');
 let mapTitle = ref('森林火灾风险等级分布图');
+let mapTime = ref('');
 let distributionData = ref([]);
 let points = ref([]);
 // 点击图层分析
@@ -155,6 +162,10 @@ const getDistributionData = () => {
 const handleChange = (data) => {
   points.value = data;
 };
+const handleRiskConfirm = (data) => {
+  mapTime.value = data.title;
+  showRiskTrendAnalysis.value = false;
+};
 // 加载数据
 const initData = () => {
   layerService.value = [
@@ -164,6 +175,10 @@ const initData = () => {
     { name: '可燃物载量分布图', value: '4', icon: 'icon4' }
   ];
   getDistributionData();
+  const now = new Date();
+  const currentHour = now.getHours();
+  now.setHours(currentHour, 0, 0, 0);
+  mapTime.value = parseTime(now, '{y}年{m}月{d}日 {h}:{i}:{s}');
 };
 onMounted(() => {
   initData();
@@ -192,6 +207,14 @@ onMounted(() => {
       font-weight: bold;
       color: #ffffff;
     }
+    .map-time {
+      position: absolute;
+      top: 60px;
+      left: 50%;
+      transform: translateX(-50%);
+      font-size: 18px;
+      color: #ffffff;
+    }
   }
   .right-box {
     width: 535px !important;

+ 172 - 0
src/views/censusDataAnalysis/RiskTrendAnalysis.vue

@@ -0,0 +1,172 @@
+<template>
+  <Dialog custom-show title="风险趋势分析" width="1271px" @confirm="handleConfirm">
+    <div style="position: relative; height: 264px;">
+      <div class="swiper-button-prev"></div>
+      <swiper
+        ref="mySwiper"
+        :modules="modules"
+        :slides-per-view="3"
+        :space-between="15"
+        :navigation="navigation"
+        class="custom-swiper"
+        @swiper="onSwiper"
+        @slide-change="onSlideChange"
+      >
+        <swiper-slide v-for="(item, index) in slides" :key="index">
+          <div :class="activeIndex === index ? 'swiper-slide-content active' : 'swiper-slide-content'" @click="handleClick(index)">
+            <img class="img" :src="item.img" alt="" />
+            <div class="text-box">
+              <div class="text">{{ index === 0 ? '今天' + item.title : item.title }}</div>
+            </div>
+          </div>
+        </swiper-slide>
+      </swiper>
+      <div class="swiper-button-next"></div>
+    </div>
+  </Dialog>
+</template>
+
+<script lang="ts" setup name="RiskTrendAnalysis">
+import { Swiper, SwiperSlide } from 'swiper/vue';
+import { Navigation } from 'swiper/modules';
+import mapImg from '@/assets/images/censusDataAnalysis/map.png';
+// Import Swiper styles
+import 'swiper/css';
+import 'swiper/css/navigation';
+const props = defineProps({
+  modelValue: Boolean
+});
+const emits = defineEmits(['update:modelValue', 'confirm']);
+let modules = ref([Navigation]);
+const navigation = reactive({
+  enabled: true,
+  nextEl: '.swiper-button-next',
+  prevEl: '.swiper-button-prev'
+});
+const slides = ref([]);
+let mySwiper = ref(null);
+let activeIndex = ref(-1);
+const getDatesWithCurrentHour = (n) => {
+  const dates = [];
+  const now = new Date();
+  const currentHour = now.getHours();
+
+  for (let i = 0; i < n; i++) {
+    // 创建一个新的日期对象,设置为当前日期减去 i 天
+    let date = new Date(now);
+    date.setDate(date.getDate() - i);
+
+    // 设置小时、分钟、秒和毫秒为当前小时的值
+    date.setHours(currentHour, 0, 0, 0);
+
+    // 格式化日期为字符串
+    let formattedDate = `${date.getFullYear()}年${('0' + (date.getMonth() + 1)).slice(-2)}月${('0' + date.getDate()).slice(-2)}日 ${('0' + date.getHours()).slice(-2)}时`;
+
+    // // 检查是否是今天,并添加“今天”字样
+    // if (date.toDateString() === now.toDateString()) {
+    //   formattedDate = `今天 ${formattedDate}`;
+    // }
+    // 将格式化后的日期添加到数组中
+    dates.push(formattedDate);
+  }
+
+  return dates;
+};
+const handleClick = (index) => {
+  activeIndex.value = index;
+};
+const initData = () => {
+  const dates = getDatesWithCurrentHour(10);
+  let data = [];
+  dates.forEach((date) => {
+    data.push({
+      img: mapImg,
+      title: date
+    });
+  });
+  slides.value = data;
+};
+onMounted(() => {
+  initData();
+});
+const onSwiper = (swiper) => {
+  console.log(swiper);
+};
+const onSlideChange = () => {
+  console.log('slide change');
+};
+const handleConfirm = () => {
+  let data = slides.value[activeIndex.value];
+  emits('confirm', data);
+};
+</script>
+
+<style lang="scss" scoped>
+.custom-swiper {
+  position: relative;
+  width: 100%;
+  height: 100%;
+}
+.swiper-slide-content {
+  width: 100%;
+  height: 264px;
+  background: url('@/assets/images/censusDataAnalysis/box4.png') no-repeat;
+  background-size: 100% 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  position: relative;
+  cursor: pointer;
+  .img {
+    width: 370px;
+    height: 244px;
+  }
+  .text-box {
+    position: absolute;
+  }
+}
+.active {
+  position: relative;
+  &::after {
+    content: '';
+    position: absolute;
+    top: 15px;
+    right: 15px;
+    width: 13px;
+    height: 13px;
+    background: url('@/assets/images/censusDataAnalysis/checked2.png') no-repeat;
+    background-size: 100% 100%;
+  }
+}
+:deep(.dialog-content) {
+  overflow: auto;
+  padding: 0 22px !important;
+}
+.swiper-button-prev,
+.swiper-button-next {
+  position: absolute;
+  top: 50%;
+  border: none;
+  padding: 10px;
+  cursor: pointer;
+  z-index: 10;
+  width: 33px;
+  height: 33px;
+}
+.swiper-button-prev {
+  left: -22px;
+  background: url('@/assets/images/censusDataAnalysis/left.png') no-repeat;
+  background-size: 100% 100%;
+  &::after {
+    display: none;
+  }
+}
+.swiper-button-next {
+  right: -22px;
+  background: url('@/assets/images/censusDataAnalysis/right.png') no-repeat;
+  background-size: 100% 100%;
+  &::after {
+    display: none;
+  }
+}
+</style>