From e0a68e0426c7d883f720831ebfeb843c70df697c Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期一, 03 四月 2023 09:05:13 +0800
Subject: [PATCH] 1

---
 src/views/Synthesis/LeftMenu.vue |  351 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 344 insertions(+), 7 deletions(-)

diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue
index ce5f276..f5a922c 100644
--- a/src/views/Synthesis/LeftMenu.vue
+++ b/src/views/Synthesis/LeftMenu.vue
@@ -192,6 +192,156 @@
 
       </div>
     </el-dialog>
+    <el-dialog
+      title="鏁版嵁鐢宠"
+      :visible.sync="dialogInsertVisible"
+      width="30%"
+      top="35vh"
+      :modal="false"
+      :before-close="handleInsertClose"
+    >
+      <div style="width: 100%; max-height: 450px; overflow-y: auto">
+        <el-form
+          ref="form"
+          :model="ruleForm"
+          label-width="100px"
+        >
+          <el-form-item label="瀹℃牳鍗曚綅">
+            <div>
+              <ul>
+                <li v-for="item in ruleForm.depid">
+                  {{ item.name }}
+                </li>
+              </ul>
+            </div>
+          </el-form-item>
+          <el-form-item label="琛ㄥ悕">
+            <div>
+              <ul>
+                <li v-for="item in ruleForm.tabs">
+                  {{ item.tabDesc }}
+                </li>
+              </ul>
+            </div>
+          </el-form-item>
+          <el-form-item label="鏉′欢">
+            <el-input
+              :title="ruleForm.wkt"
+              v-model="ruleForm.wkt"
+              disabled
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="鎻忚堪">
+            <el-input
+              type="textarea"
+              placeholder="璇疯緭鍏ュ唴瀹�"
+              v-model="ruleForm.descr"
+              maxlength="50"
+              show-word-limit
+            >
+            </el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              class="primary"
+              size="small"
+              @click="getInsertDown"
+            >{{
+              $t("common.confirm")
+            }}</el-button>
+            <el-button
+              type="info"
+              size="small"
+              @click="closeInsertDown"
+            >{{
+              $t("common.cancel")
+            }}</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-dialog>
+    <el-dialog
+      :title="$t('common.passworld')"
+      :visible.sync="dialogVisible1"
+      width="30%"
+      top="35vh"
+      :modal="false"
+      :before-close="handleCloseDown1"
+    >
+      <el-form
+        :model="codeForm"
+        :rules="rules"
+        ref="codeForm"
+        label-width="100px"
+        class="codeForm"
+      >
+        <el-form-item
+          :label="$t('common.passworld')"
+          prop="password"
+        >
+          <el-input
+            type="password"
+            v-model="codeForm.password"
+            show-password
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          :label="$t('common.SPassword')"
+          prop="repassword"
+        >
+          <el-input
+            type="password"
+            v-model="codeForm.repassword"
+            show-password
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            class="primary"
+            size="small"
+            @click="downloadx('codeForm')"
+          >{{ $t("common.confirm") }}</el-button>
+          <el-button
+            type="info"
+            size="small"
+            @click="closeDownx('codeForm')"
+          >{{
+            $t("common.cancel")
+          }}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+    <el-dialog
+      title="鑼冨洿"
+      :visible.sync="dialogExtentVisible"
+      width="30%"
+      :before-close="handleExtentClose"
+      :modal="false"
+      :lock-scroll="false"
+      :close-on-click-modal="false"
+    >
+
+      <el-row :gutter="20">
+        <el-col :span="16">
+          <el-input v-model="setExtent"></el-input>
+        </el-col>
+        <el-col :span="6">
+          <div>
+            鍗曚綅锛氾紙m锛�
+          </div>
+        </el-col>
+      </el-row>
+      <span
+        slot="footer"
+        class="dialog-footer"
+      >
+        <el-button @click="handleExtentClose">鍙� 娑�</el-button>
+        <el-button
+          @click="handleExtentinsert"
+          type="primary"
+        >纭� 瀹�</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -237,7 +387,38 @@
 export default {
   components: { mapinfo, maplayer, queryinfo, terrainDig, modelAttach, undergroundModel, setPellucidity },
   data() {
+    var repasswordValidator = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('璇峰啀娆¤緭鍏ュ瘑鐮�'));
+      } else if (value !== this.codeForm.password) {
+        callback(new Error('涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷�!'));
+      } else {
+        callback();
+      }
+    };
+    var passwordValidator = (rule, value, callback) => {
+      var passwordreg =
+        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/;
+      if (!passwordreg.test(value)) {
+        callback(
+          new Error('瀵嗙爜蹇呴』鐢辨暟瀛椼�佸瓧姣嶃�佺壒娈婂瓧绗︾粍鍚�,璇疯緭鍏�13-20浣�')
+        );
+      } else {
+        callback();
+      }
+    };
     return {
+      rules: {
+        password: [{ required: true, message: '璇疯緭鍏ュ瘑鐮�', trigger: 'blur' }, { validator: passwordValidator, trigger: 'blur' }],
+        repassword: [
+          { required: true, message: '璇疯緭鍏ョ‘璁ゅ瘑鐮�', trigger: 'blur' },
+          { validator: repasswordValidator, trigger: 'blur' },
+        ],
+      },
+      codeForm: {
+        password: '',
+        repassword: '',
+      },
       showTwoMenuFlag: false,
       setListTwoMenu: [],
       setListTwoMenuAll: [
@@ -641,6 +822,18 @@
         }],
       modelClip: false,
       showPickUp: false,
+      dialogInsertVisible: false,
+      dialogVisible1: false,
+      ruleForm: {
+        depname: [],
+        tabs: [],
+        pwd: null,
+        repwd: null,
+        wkt: null,
+        descr: null,
+      },
+      dialogExtentVisible: false,
+      setExtent: 10,
     };
   },
   methods: {
@@ -1835,10 +2028,10 @@
       //   }
       // }
       window.model.clippingPlanes = clippingPlanes;
-      if (window.modelHeight && window.modelHeight != 0){
+      if (window.modelHeight && window.modelHeight != 0) {
         // console.log("window.modelHeight---",window.modelHeight)
         window.model.clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(
-            new Cesium.Cartesian3(0.0, 0.0, window.modelHeight)
+          new Cesium.Cartesian3(0.0, 0.0, window.modelHeight)
         );
       }
       // 缁戝畾涓婄Щ鍔ㄤ簨浠�
@@ -2241,6 +2434,8 @@
       var that = this;
       var checkKey = [];
       let checkedLayers = [];
+      this.$store.state.isProjectLayer = [];
+
       var val = std.filter((str) => {
         if (str.type == 1) {
           return str;
@@ -2256,12 +2451,15 @@
         if (str.url != null && str.type == 2 && str.isShow == 1) {
           return str;
         }
+        if (str.isProject == 1 && str.type == 2) {
+          this.$store.state.isProjectLayer.push(str);
+        }
       })
 
       this.setAddLayers(value);
 
       var res = this.setTreeData(val);
-
+      this.$store.state.pigCode = null;
       //瀛樺偍閫変腑鍥惧眰
       // sessionStorage.setItem("checkedLayers", JSON.stringify(checkedLayers));
 
@@ -2299,9 +2497,74 @@
         }
       }
       if (std[0].length != 0) {
-        this.setAddWmsLayer(std[0])
+        if (this.$store.state.pigCode) {
+          this.setPrjidWmsLayer(std[0])
+        } else {
+
+          this.setAddWmsLayer(std[0])
+        }
+
       }
     },
+    setPrjidWmsLayer(res) {
+      var layer = [];
+      var sql = [];
+      var dirid = this.$store.state.pigCode
+
+      for (var i in res) {
+        layer.push(res[i].url)
+
+        if (res[i].isProject == 1) {
+          var val = "dirid like '" + dirid + "%'"
+          sql.push(val)
+        } else {
+          sql.push("1 = 1")
+        }
+      }
+      layer = layer.reverse();
+      sql = sql.reverse().join(";")
+      var getFeatureInfoFormat = new Cesium.GetFeatureInfoFormat("html", null, function (html) {
+        that.getFeatureInfo(html)
+      });
+      window.layerWMS = new Cesium.WebMapServiceImageryProvider({
+        url: geoServerURl,
+        layers: layer.toString(),
+        getFeatureInfoParameters: { info_format: 'text/html' },
+        enablePickFeatures: true,
+        getFeatureInfoFormats: [getFeatureInfoFormat],
+        parameters: {
+          transparent: true,
+          format: "image/png",
+          srs: "EPSG:4490",
+          styles: "",
+          cql_filter: sql
+        },
+        tileWidth: 512,
+        tileHeight: 512,
+      });
+      layerWMS.name = "Wms_Layer";
+      window.Viewer.scene.imageryLayers.addImageryProvider(window.layerWMS);
+      var layer2 = new Image({
+        name: "Wms_Layer",
+        source: new ImageWMS({
+          crossOrigin: "anonymous",
+          url: geoServerURl,
+          params: {
+            FORMAT: "image/png",
+            VERSION: "1.1.1",
+            LAYERS: layer.toString(),
+            cql_filter: sql
+          },
+        }),
+      });
+      if (res.opacity) {
+        layer2.setOpacity(parseInt(res.opacity) / 100);
+      }
+      window.map.addLayer(layer2);
+    },
+
+
+
     setClearWmsLayer() {
       for (var i = 0; i < window.Viewer.imageryLayers._layers.length; i++) {
         var val_id = window.Viewer.imageryLayers._layers[i].imageryProvider.name;
@@ -2731,8 +2994,6 @@
 
       if (this.$store.state.showPopBoxFlag == true) {
         this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
-
-
         this.$refs &&
           this.$refs.queryinfo &&
           this.$refs.queryinfo.open("灞炴��", null, {
@@ -2753,6 +3014,60 @@
     setPellucidity() {
       this.$refs && this.$refs.setPellucidity && this.$refs.setPellucidity.open();
     },
+    setDialogInsertVisible(res) {
+      this.ruleForm = res;
+      this.dialogInsertVisible = true;
+    },
+    downloadx() {
+      this.$bus.$emit("setInsertDown", this.codeForm)
+      this.closeDownx();
+    },
+    handleCloseDown1() {
+      this.$confirm("纭鍏抽棴锛�")
+        .then(_ => {
+          this.closeDownx();
+        })
+        .catch(_ => { })
+    },
+    closeDownx() {
+      this.dialogVisible1 = false;
+      this.codeForm = {
+        password: '',
+        repassword: '',
+      }
+    },
+    closeInsertDown() {
+      this.ruleForm = {
+        depname: [],
+        tabs: [],
+        pwd: null,
+        repwd: null,
+        wkt: null,
+        descr: null,
+      }
+      this.dialogInsertVisible = false
+    },
+    handleInsertClose() {
+      this.$confirm("纭鍏抽棴锛�")
+        .then(_ => {
+          this.closeInsertDown()
+        })
+        .catch(_ => { })
+    },
+    getInsertDown() {
+      this.dialogInsertVisible = false;
+      this.dialogVisible1 = true;
+      // 
+    },
+    handleExtentClose() {
+      this.dialogExtentVisible = false
+      this.setExtent = 10;
+    },
+    handleExtentinsert() {
+      this.$bus.$emit("setExtentBUff", this.setExtent)
+      this.handleExtentClose();
+
+    }
   },
   mounted() {
     this.measureData = new Map();
@@ -2776,12 +3091,34 @@
     this.$bus.$on("showPellucidity", res => {
       this.setPellucidity();
     });
-    this.$store.state.showAllLayers = true;
+
+
+    this.$store.state.isProjectLayer = [],
+      this.$store.state.pigCode = null,
+      this.$store.state.showAllLayers = true;
     this.$store.state.layerMnage = false;
     this.$store.state.treeData = null;
     this.$store.state.checkedKeys = [];
     // this.setCoverage("a1");
     this.layersStart();
+
+
+    this.$bus.$on("setDialogInsertVisible", (res) => {
+
+      if (res == true) {
+        this.dialogVisible1 = true;
+      } else {
+        this.setDialogInsertVisible(res);
+      }
+    })
+    this.$bus.$on('showExtentLayer', res => {
+      this.dialogExtentVisible = res;
+    });
+
+
+
+
+
   },
   watch: {
     Obj(newVal, oldVal) {

--
Gitblit v1.9.3