From f13afcb61276061871b30bce17a7877287df0b67 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Sat, 20 Jan 2024 09:56:43 +0800
Subject: [PATCH] 1

---
 src/components/warningSelect/index.vue |   99 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 67 insertions(+), 32 deletions(-)

diff --git a/src/components/warningSelect/index.vue b/src/components/warningSelect/index.vue
index 3116912..fda669a 100644
--- a/src/components/warningSelect/index.vue
+++ b/src/components/warningSelect/index.vue
@@ -2,7 +2,7 @@
  * @Author: shuishen 1109946754@qq.com
  * @Date: 2023-04-04 16:24:42
  * @LastEditors: shuishen 1109946754@qq.com
- * @LastEditTime: 2023-07-07 15:09:44
+ * @LastEditTime: 2023-07-13 15:24:08
  * @FilePath: \srs-police-affairs\src\components\warningSelect\index.vue
  * @Description: 
  * 
@@ -21,7 +21,60 @@
 </template>
 
 <script>
-import { getIconsAll } from "@/api/icons/index"
+import { getWarningsAll } from "@/api/icons/index"
+
+
+let warningImgData = [
+    {
+        title: '核心区1',
+        url: 'hxq-one'
+    },
+    {
+        title: '核心区2',
+        url: 'hxq-two'
+    },
+    {
+        title: '核心区3',
+        url: 'hxq-three'
+    },
+    {
+        title: '防范区1',
+        url: 'ffq-one'
+    },
+    {
+        title: '防范区2',
+        url: 'ffq-two'
+    },
+    {
+        title: '防范区3',
+        url: 'ffq-three'
+    },
+    {
+        title: '缓冲区1',
+        url: 'hcq-one'
+    },
+    {
+        title: '缓冲区2',
+        url: 'hcq-two'
+    },
+    {
+        title: '缓冲区3',
+        url: 'hcq-three'
+    },
+    {
+        title: '警戒线1',
+        url: 'jjx-one'
+    },
+    {
+        title: '警戒线2',
+        url: 'jjx-two'
+    },
+    {
+        title: '警戒线3',
+        url: 'jjx-three'
+    },
+]
+
 export default {
     name: 'WarningSelect',
 
@@ -38,39 +91,21 @@
 
     methods: {
         requireImage () {
-            this.imageUrls = [
-                {
-                    url: '/warnings/防范区1.png',
-                    title: '防范区1',
-                },
-                {
-                    url: '/warnings/防范区2.png',
-                    title: '防范区2',
-                },
-                {
-                    url: '/warnings/防范区3.png',
-                    title: '防范区3',
-                },
-                {
-                    url: '/warnings/核心区1.png',
-                    title: '核心区1',
-                },
-            ]
+            getWarningsAll().then(res => {
+                res.data.data.forEach(item => {
+                    let imgArr = item.split('/')
 
+                    let title = imgArr[imgArr.length - 1].split('.')[0]
 
-            // getIconsAll().then(res => {
-            //     res.data.data.forEach(item => {
-            //         let imgArr = item.split('/')
+                    let cur = warningImgData.find(i => i.url == title)
 
-            //         let title = imgArr[imgArr.length - 1].split('.')[0]
-
-            //         this.imageUrls.push({
-            //             url: item,
-            //             title
-            //         })
-            //     })
-            //     this.loading = false
-            // })
+                    this.imageUrls.push({
+                        url: item,
+                        title: cur.title
+                    })
+                })
+                this.loading = false
+            })
         },
 
         curImgClick (item) {

--
Gitblit v1.9.3