管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2023-04-03 e0a68e0426c7d883f720831ebfeb843c70df697c
1
已修改6个文件
563 ■■■■■ 文件已修改
src/components/MapView/mapMenuPop.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuTop.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/store/index.js 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Synthesis/LeftMenu.vue 351 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Tools/LayerTree.vue 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/styleManage.vue 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuPop.vue
@@ -1,10 +1,8 @@
<template>
  <div class="menuPop">
    <div class="leftBox">
      <div
        class="leftDown"
        v-if="$store.state.download"
      >
      <!-- v-if="$store.state.download" -->
      <div class="leftDown">
        <div @click="getDownloadDep">
          <el-link icon="el-icon-download"> </el-link>
        </div>
@@ -331,6 +329,7 @@
            if (res.code != 200) {
              return
            }
            this.selectDownloadFile(res.result, obj.pwd)
          },
        })
@@ -368,10 +367,12 @@
        pwd: encodeURIComponent(rspwd),
      }
      const data = await dataLib_selectDownloadFile(downObj)
      if (data.code != 200) {
        this.$message.error("下载请求失败")
        return
      }
      this.closeDown()
      var token = getToken()
      var url =
src/components/MapView/mapMenuTop.vue
@@ -170,6 +170,7 @@
        >确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
@@ -179,6 +180,7 @@
import {
  inquiry_SelectTabs,
  inquiry_uploadShp,
  decr,
  encr,
  dataLib_selectTabs,
  pipelines_selectSegNames,
@@ -260,6 +262,9 @@
      analyGid: null,
      dialogFormVisible: false,
      bufferLinePosition: [],
      dialogExtentVisible: false,
      setExtent: 10,
      wktExtent: null,
    }
  },
@@ -267,6 +272,9 @@
    this.menuTopFrom.queryType = "rectangle"
    this.getAllTable()
    this.getPipelineData()
    this.$bus.$on("setExtentBUff", res => {
      this.setExtentBuffer(res);
    })
  },
  watch: {
    analyGid(newVal, oldVal) {
@@ -276,6 +284,55 @@
    },
  },
  methods: {
    setExtentBuffer(res) {
      // var wkt = this.$wkt.parse(this.wktExtent)
      // var wkt = encr(this.wktExtent)
      var wkt1 = decr(this.wktExtent)
      var wkt = this.$wkt.parse(wkt1)
      var restVal = turf.buffer(wkt, res, { units: "meters", steps: 64 })
      var options = { precision: 6, coordinates: 2 };
      var truncated = turf.truncate(restVal, options);
      var options1 = { tolerance: 0.01, highQuality: false };
      var simplified = turf.simplify(truncated, options1);
      var wkt2 = this.$wkt.convert(simplified.geometry)
      var wkt3 = encr(wkt2)
      this.$store.state.mapMenuShpFile = wkt3
      var points = simplified.geometry.coordinates[0]
      var degreesArray = this.pointsToDegreesArray(points)
      let array = Cesium.Cartesian3.fromDegreesArray(degreesArray)
      const hierarchy = new Cesium.PolygonHierarchy(array)
      const bufferPolygon = sgworld.Viewer.entities.add({
        polygon: {
          hierarchy: hierarchy,
          material: Cesium.Color.RED.withAlpha(0.5),
          classificationType: Cesium.ClassificationType.BOTH,
        },
      })
      this.bufferEntities.push(bufferPolygon)
      sgworld.Navigate.flyToObj(bufferPolygon)
      this.showMapMenuPop()
    },
    getDownLoadExtent(res) {
      this.wktExtent = res.result.wkt
      this.$bus.$emit('showExtentLayer', true);
      // this.dialogExtentVisible = true
      //           this.$store.state.mapMenuShpFile = rs.result.wkt
      //
    },
    changeValue(value) {
      var obj = {}
      obj = this.queryOption.find(function (item) {
@@ -346,7 +403,8 @@
    },
    //清空树选中的节点
    resetCheckedNodes() {
      this.layerData = []
      this.getAllTable()
      this.$refs.tree.setCheckedKeys([]);
      this.treeChange = []
      this.menuTopFrom.queryLayer = null
@@ -375,6 +433,7 @@
        })
        return
      }
      var that = this;
      $.ajax(BASE_URL + "/inquiry/uploadShp?token=" + getToken(), {
        type: "post",
        data: formData,
@@ -384,11 +443,11 @@
        contentType: false,
        success: rs => {
          if (rs.code !== 200) {
            return this.$message.error("用户角色请求错误")
            return this.$message.error("数据解析失败")
          }
          this.$store.state.mapMenuShpFile = rs.result.wkt
          this.showMapMenuPop()
          that.getDownLoadExtent(rs);
        },
        error: e => {
          console.log(e)
@@ -548,6 +607,8 @@
    },
    clearQuery() {
      // 清楚buffer
      this.layerData = [];
      this.getAllTable();
      this.clearBufferEntities()
      this.$refs.pathClear.value = ""
      this.treeChange = []
src/store/index.js
@@ -74,6 +74,8 @@
    histLenged: false,
    setAlphaDity: null,
    setAlphaList: [],
    isProjectLayer: [],
    pigCode: null,
  },
  mutations: {
    //获取权限合集
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) {
src/views/Tools/LayerTree.vue
@@ -1,11 +1,35 @@
<template>
  <div class="lalala tree-container">
    <el-input
      placeholder="输入关键字进行过滤"
      v-model="filterText"
      class="search"
    >
    </el-input>
    <el-form ref="form">
      <el-form-item>
        <el-select
          v-model="$store.state.pigCode"
          clearable
          filterable
          style="width :100%"
          @change="setproChange"
        >
          <el-option
            v-for="item in optionts"
            :key="item.code"
            :label="item.name"
            :value="item.code"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-input
          placeholder="输入关键字进行过滤"
          v-model="filterText"
          class="search"
        >
        </el-input>
      </el-form-item>
    </el-form>
    <el-tree
      ref="tree"
      :data="treeData"
@@ -192,7 +216,10 @@
import View from "ol/View.js";
import { Fill, Stroke, Style } from "ol/style.js";
import { perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById } from "../../api/api.js";
import {
  perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById,
  project_selectDirAll, project_selectByDirid
} from "../../api/api.js";
export default {
  name: "tree",
  components: { queryinfo },
@@ -241,6 +268,8 @@
      ],
      childOption: [],
      mptLayer: [],
      optionts: [],
      proValue: null,
    };
  },
  methods: {
@@ -878,25 +907,25 @@
          // Cesium.Matrix4.equals(a,b)判断两个四维矩阵是否相等
          // 整个根节点模型矩阵,该tileSet=>世界坐标系
          // 单位矩阵,对角线值为1.0的4*4矩阵
          if (!Cesium.Matrix4.equals(tileset.root.transform,Cesium.Matrix4.IDENTITY)) {
          if (!Cesium.Matrix4.equals(tileset.root.transform, Cesium.Matrix4.IDENTITY)) {
            // 获取模型的世界坐标(笛卡尔)
            // Cesium.Matrix4.getTranslation 通过仿射变换矩阵获取该tileSet的世界坐标
            const transformCenter = Cesium.Matrix4.getTranslation(
                tileset.root.transform,
                new Cesium.Cartesian3()
              tileset.root.transform,
              new Cesium.Cartesian3()
            );
            // 将笛卡尔坐标转换为WGS84经纬度坐标(模型的)
            const transformCartographic = Cesium.Cartographic.fromCartesian(
                transformCenter
              transformCenter
            );
            // 将笛卡尔坐标转换为WGS84经纬度坐标(截面的)
            const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(
                tileset.boundingSphere.center
              tileset.boundingSphere.center
            );
            const height = boundingSphereCartographic.height - transformCartographic.height;
            // 从一个Cartesian3对象生成Matrix4变换矩阵(裁切面的)
            window.modelHeight = height;
          }else window.modelHeight = 0;
          } else window.modelHeight = 0;
          this.getTilesetArgs(tileset, res);
        });
        this.$store.state.setAlphaList.push({
@@ -1122,6 +1151,56 @@
      if (!value) return true;
      return data.cnName.indexOf(value) !== -1;
    },
    async setproChange(res) {
      this.$store.state.pigCode = res;
      if (res) {
        var obj = {
          dirid: res,
          pageIndex: 1,
          pageSize: 10,
        }
        const data = await project_selectByDirid(obj);
        if (data.code != 200) {
          this.$message.error("列表获取失败");
          return;
        }
        if (data.result[0]) {
          var geom = data.result[0].geom
          var wkt = this.$wkt.parse(geom)
          Viewer.camera.flyTo({
            destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[0].toFixed(6), wkt.coordinates[1].toFixed(6), 5000),
          });
        }
        this.setChangeProLayer();
      } else {
        this.$store.state.isProjectLayer = [];
      }
    },
    setChangeProLayer() {
      if (value.length != 0) {
        var value = this.$store.state.isProjectLayer;
        var std = [];
        for (var i in value) {
          std.push(value[i].id)
        }
        this.$refs.tree.setCheckedKeys(std);
        this.$bus.$emit("showMenuLayer", value);
      }
    },
    async getMenuProject() {
      const data = await project_selectDirAll();
      if (data.code != 200) {
        return
      }
      this.optionts = data.result;
    },
  },
  watch: {
    filterText(val) {
@@ -1129,7 +1208,7 @@
    },
  },
  mounted() {
    this.getMenuProject()
    this.$bus.$on("treeDataCopy", (res) => {
      this.$store.state.treeData = this.treeData;
      this.$store.state.checkedKeys = this.$refs.tree.getCheckedKeys();
@@ -1310,7 +1389,12 @@
    }
  }
}
/deep/ .el-form .el-form-item {
  padding-right: 0px !important;
}
/deep/ .el-form-item {
  margin-bottom: 10px !important;
}
/*.lalala {*/
/*position: relative;*/
/*}*/
src/views/datamanage/styleManage.vue
@@ -437,16 +437,16 @@
            :label-width="formLabelWidth"
          >
            <el-select
              v-model="upform.status"
              v-model="status"
              style="width:85%"
              :placeholder="$t('common.choose')"
            >
              <el-option
                value="0"
                value='0'
                :label="$t('dataManage.styleObj.deactivate')"
              ></el-option>
              <el-option
                value="1"
                value='1'
                :label="$t('dataManage.styleObj.enable')"
              ></el-option>
            </el-select>
@@ -1002,7 +1002,7 @@
      dialogFormVisible: false,
      InsertFormdialog: false,
      showCata: false,
      upform: {},
      upform: { status: '0' },
      formLabelWidth: "130px",
      showinfoBox: false,
      itemdetail: {},
@@ -1060,6 +1060,7 @@
      styleVar: {
        height: "calc(100% - 109px)",
      },
      status: 0,
    };
  },
  created() {
@@ -1403,6 +1404,7 @@
      if (date === undefined || date === null) {
        return;
      }
      switch (date) {
        case 1:
          return "启用";
@@ -1544,6 +1546,8 @@
        this.upform.vname = this.upform.viewGuid;
        this.upform.viewGuid = this.viewFile;
      }
      this.upform.status = this.status
      const data = await updateStyle(this.upform);
      if (data.code == 200) {
        this.dialogFormVisible = false;
@@ -1657,6 +1661,7 @@
    // },
    handleEdit(index, row) {
      this.upflag = true;
      this.dialogFormVisible = true;
      this.upform = row;
@@ -1664,7 +1669,10 @@
      this.upform.dirValue = row.dirName;
      this.upform.fileGuid = row.fname;
      this.upform.viewGuid = row.vname;
      this.upform.status = this.forMontStatus(row.status);
      // this.upform.status = this.forMontStatus(row.status);
      // this.upform.status = row.status;
      this.status = this.forMontStatus(row.status);
    },
    handleDelete(index, row) {
      this.$confirm("确定是否删除?", "提示", {