From df007d0b7f677240d9ab9b01e6bebdbad0762a0f Mon Sep 17 00:00:00 2001
From: lxl <lixuliang_hd@126.com>
Date: 星期一, 07 十一月 2022 16:22:12 +0800
Subject: [PATCH] 菜单

---
 src/views/Synthesis/inquire.vue |  180 +++++++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 119 insertions(+), 61 deletions(-)

diff --git a/src/views/Synthesis/inquire.vue b/src/views/Synthesis/inquire.vue
index 0638132..a6734cc 100644
--- a/src/views/Synthesis/inquire.vue
+++ b/src/views/Synthesis/inquire.vue
@@ -1,14 +1,5 @@
 <template>
   <div class="box">
-    <!-- <input  type="file" name="file" id="getF" @change="clickF()"></input> -->
-    <input
-      style="display: none"
-      type="file"
-      name="file"
-      id="getF"
-      @change="setBlogrollImageName()"
-    />
-
     <ul>
       <li
         style="margin-left: 20px"
@@ -25,72 +16,130 @@
 </template>
 
 <script>
-import $ from "jquery";
+import $ from 'jquery';
+import { removeToken, getToken } from '@/utils/auth';
+import { comprehensive_uploadShp } from '../../api/api';
 export default {
   data() {
     return {
       itemsOne: [
         {
-          id: "1",
-          name: "synthesis.somequery",
-          class: "e1",
+          id: '1',
+          name: 'synthesis.somequery',
+          class: 'e1',
         },
         {
-          id: "2",
-          name: "synthesis.linequery",
-          class: "e2",
+          id: '2',
+          name: 'synthesis.linequery',
+          class: 'e2',
         },
         {
-          id: "3",
-          name: "synthesis.rectangularquery",
-          class: "e3",
+          id: '3',
+          name: 'synthesis.rectangularquery',
+          class: 'e3',
         },
         {
-          id: "4",
-          name: "synthesis.gardenquery",
-          class: "e4",
+          id: '4',
+          name: 'synthesis.gardenquery',
+          class: 'e4',
         },
         {
-          id: "5",
-          name: "synthesis.polygonquery",
-          class: "e5",
+          id: '5',
+          name: 'synthesis.polygonquery',
+          class: 'e5',
         },
         {
-          id: "6",
-          name: "synthesis.attributequery",
-          class: "e6",
+          id: '6',
+          name: 'synthesis.attributequery',
+          class: 'e6',
         },
         {
-          id: "7",
-          name: "synthesis.rangequery",
-          class: "e7",
+          id: '7',
+          name: 'synthesis.rangequery',
+          class: 'e7',
         },
       ],
       rel_name: null,
+      analyStatus: {
+        upload: false,
+        download: false,
+      },
     };
   },
+  created() {
+    var cover_Id = this.$store.state.syntiesis.menu;
+    var cover_perms = this.$store.state.permsEntity;
+
+    for (var i = 0; i < cover_perms.length; i++) {
+      if (cover_perms[i].pid == cover_Id) {
+        this.showViewMenu(cover_perms[i]);
+      }
+    }
+  },
   methods: {
-    changeIquery(res) {
-      if (res.name != "鑼冨洿妗嗘煡鍥�") {
-        var res_val = {
-          url: "",
-          name: res.name,
-        };
-        this.$bus.$emit("changetool", res_val);
-      } else if (res.name == "鑼冨洿妗嗘煡鍥�") {
-        this.rel_name = res.name;
-        $("#getF").click();
+    showViewMenu(res) {
+      if (res.cnName != '鏌ヨ') return;
+
+      switch (res.tag) {
+        case '/upload':
+          this.analyStatus.upload = true;
+          break;
+        case '/download':
+          this.analyStatus.download = true;
+          break;
       }
     },
-    setBlogrollImageName() {
-      var filename = $("#getF").val();
-      if (filename == null || filename == undefined || filename == "") return;
-      var res = {
-        url: filename,
-        name: this.rel_name,
-      };
-      this.$bus.$emit("changetool", res);
-      $("#getF").val("");
+    changeIquery(res) {
+      this.$store.state.mapMenuBoolean = false;
+      this.$store.state.mapMenuBoxFlag = null;
+      this.$store.state.mapPopBoolean = false;
+      this.$store.state.mapPopBoxFlag = null;
+      switch (res.id) {
+        case '6':
+          this.$store.state.mapMenuBoolean = true;
+          this.$store.state.mapMenuBoxFlag = '2';
+          break;
+        case '7':
+          this.$store.state.mapMenuBoolean = true;
+          this.$store.state.mapMenuBoxFlag = '1';
+          break;
+      }
+    },
+    getQueryFile() {
+      $('#getF').click();
+    },
+    async setQueryFile() {
+      var val = document.getElementById('getF').files;
+      if (!val || !val.length) return;
+      var formData = new FormData();
+      var exts = ['.shp', '.shx', '.dbf', '.prj'];
+      var count = 0;
+      for (var i = 0; i < val.length; i++) {
+        var name = val[i].name.toLocaleLowerCase();
+        var ext = name.substring(name.lastIndexOf('.'));
+        if (exts.indexOf(ext) > -1) {
+          count++;
+          formData.append(val[i].name, val[i]); // fs.files[i].name,file
+        }
+      }
+      if (count != 4) {
+        alert('ShapeFile鏂囦欢閫夋嫨涓嶅叏锛�');
+        return;
+      }
+      const data = await comprehensive_uploadShp(formData);
+
+      // $.ajax(BASE_URL + '/comprehensive/uploadShp?token=' + getToken(), {
+      //   type: 'post',
+      //   data: formData,
+      //   async: true,
+      //   cache: false,
+      //   processData: false,
+      //   contentType: false,
+      //   success: function (rs) {},
+      //   error: function (e) {
+      //     console.error(e);
+      //   },
+      // });
     },
   },
 };
@@ -116,29 +165,35 @@
   margin: 0px;
 }
 .e1 {
-  background: url("../../assets/img/synthesis/妞渾 2 鍓湰 鎷疯礉 3.png") no-repeat
+  background: url('../../assets/img/synthesis/妞渾 2 鍓湰 鎷疯礉 3.png') no-repeat
     center;
 }
 .e2 {
-  background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 9.png") no-repeat
+  background: url('../../assets/img/synthesis/妞渾 3 鎷疯礉 9.png') no-repeat
     center;
 }
 .e3 {
-  background: url("../../assets/img/synthesis/鍥惧眰 36.png") no-repeat center;
+  background: url('../../assets/img/synthesis/鍥惧眰 36.png') no-repeat center;
 }
 .e4 {
-  background: url("../../assets/img/synthesis/妞渾 3 鎷疯礉 10.png") no-repeat
+  background: url('../../assets/img/synthesis/妞渾 3 鎷疯礉 10.png') no-repeat
     center;
 }
 .e5 {
-  background: url("../../assets/img/synthesis/鍦嗚鐭╁舰 12 鎷疯礉 8.png") no-repeat
+  background: url('../../assets/img/synthesis/鍦嗚鐭╁舰 12 鎷疯礉 8.png') no-repeat
     center;
 }
 .e6 {
-  background: url("../../assets/img/synthesis/鍥惧眰 23.png") no-repeat center;
+  background: url('../../assets/img/synthesis/鍥惧眰 23.png') no-repeat center;
 }
 .e7 {
-  background: url("../../assets/img/synthesis/鍥惧眰 24.png") no-repeat center;
+  background: url('../../assets/img/synthesis/鍥惧眰 24.png') no-repeat center;
+}
+
+.divli {
+  width: 100%;
+  height: 50%;
+  position: relative;
 }
 .backimge5 {
   width: 30px;
@@ -148,9 +203,12 @@
   background-size: 100% 100%;
   margin: 0% 30%;
 }
-.divli {
-  width: 100%;
-  height: 50%;
-  position: relative;
+.backimgex {
+  width: 30px;
+  height: 30px;
+  margin-left: 25px;
+  position: absolute;
+  background-size: 100% 100%;
+  margin: 0% 30%;
 }
 </style>

--
Gitblit v1.9.3