管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-09 64479e2ce8b7c30e36f08c41eed226a1def1be82
瓦片下载功能添加;综合展示图层管理修改;数据管理字段管理编辑修改
已修改6个文件
287 ■■■■■ 文件已修改
src/api/api.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/mapsdk.vue 189 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Synthesis/LeftMenu.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Tools/LayerTree.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Tools/maplayer.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/dictionaryManage.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/api.js
@@ -547,6 +547,16 @@
export function inquiry_SelectTabs(params) {
  return request.get('/inquiry/selectTabs', { params: params });
}
//综合展示=>查询=>下载瓦片
export function inquiry_downloadTiles(params) {
  return service.post('/inquiry/downloadTiles', params);
}
//运维管理=>用户管理=>获取列表
export function userSelectByPageAndCount(params) {
  return request.get('/user/selectByPageAndCount', { params: params });
@@ -618,8 +628,6 @@
export function dataUpload_selectPageAndCountByPid(params) {
  return request.get('/dataUpload/selectPageAndCountByPid', { params: params });
}
//数据上传=删除数据
src/components/mapsdk.vue
@@ -1,5 +1,10 @@
<template>
  <div class="mapBox">
  <div
    class="mapBox"
    v-loading="loading"
    :element-loading-text="loadingText"
    element-loading-background="rgba(0, 0, 0, 0.8)"
  >
    <div id="mapdiv">
      <div
        class="menu_Top box_divm"
@@ -646,6 +651,72 @@
        </div>
      </el-dialog>
      <el-dialog
        title="瓦片下载"
        :append-to-body="false"
        :visible.sync="downTitleFlag"
        :close-on-click-modal="false"
        :show-close="false"
        width="30%"
      >
        <el-form
          :model="ruleForm"
          status-icon
          :rules="rules"
          ref="ruleForm"
          label-width="100px"
          class="demo-ruleForm"
        >
          <el-form-item
            label="名称"
            prop="title"
          >
            <el-input
              v-model="ruleForm.title"
              size="small"
              placeholder="请输入数据名称..."
            ></el-input>
          </el-form-item>
          <el-form-item
            label="密码"
            prop="pass"
          >
            <el-input
              show-password
              type="password"
              v-model="ruleForm.pass"
              autocomplete="off"
              size="small"
              placeholder="请输入密码..."
            ></el-input>
          </el-form-item>
          <el-form-item
            label="确认密码"
            prop="checkPass"
          >
            <el-input
              show-password
              type="password"
              v-model="ruleForm.checkPass"
              autocomplete="off"
              size="small"
              placeholder="确认密码..."
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              size="small"
              @click='submitTitleDown("ruleForm")'
            >提交</el-button>
            <el-button
              size="small"
              @click='cannelTitleDown("ruleForm")'
            >取消</el-button>
          </el-form-item>
        </el-form>
      </el-dialog>
      <!--      <div-->
      <!--        @click="changeMenulayer"-->
      <!--        class="center CenDiv"-->
@@ -659,6 +730,11 @@
    </div>
    <model-property ref='modelProperty'></model-property>
    <iframe
      id="downFrame"
      src=""
      style="display: none; border: 0; padding: 0; height: 0; width: 0"
    ></iframe>
  </div>
</template>
@@ -673,7 +749,8 @@
  comprehensive_selectRoute,
  dataLib_selectFiles, dataQuery_selectFields, dataQuery_selectDomains,
  dataQuery_selectByPage,
  comprehensive_selectPubById, comprehensive_selectModelByGuid
  comprehensive_selectPubById, comprehensive_selectModelByGuid, decr,
  encr, inquiry_downloadTiles, sign_getPublicKey
} from '../api/api'
import { getToken } from '@/utils/auth'
@@ -701,6 +778,35 @@
            }
          }
        }
        callback();
      }
    };
    var checkAge = (rule, value, callback) => {
      if (!value) {
        return callback(new Error('数据名称不能为空'));
      }
      callback();
    };
    var validatePass = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请输入密码'));
      } else {
        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位"))
        }
        callback();
      }
    };
    var validatePass2 = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请再次输入密码'));
      } else if (value !== this.ruleForm.pass) {
        callback(new Error('两次输入密码不一致!'));
      } else {
        callback();
      }
    };
@@ -733,6 +839,15 @@
            message: "坐标点经纬度错误,坐标应在[116.xxx, 39.yyy]范围",
          },
        ],
        pass: [
          { validator: validatePass, trigger: 'blur' }
        ],
        checkPass: [
          { validator: validatePass2, trigger: 'blur' }
        ],
        title: [
          { validator: checkAge, trigger: 'blur' }
        ]
      },
      bufFrom: {
        val: 50,
@@ -786,6 +901,15 @@
      valueX: 0,
      valueY: 0,
      terrainflag: false,
      downTitleFlag: false,
      downTitleData: null,
      ruleForm: {
        pass: '',
        checkPass: '',
        title: ''
      },
      loadingText: '',
      loading: false,
    };
  },
  mounted() {
@@ -812,13 +936,72 @@
    });
    //模型捕捉
    this.catchmodel()
    this.$bus.$on("titleDown", res => {
      this.setDownLoadTitle(res);
    })
    window.localStorage.setItem('slider_x', this.valueX);
    window.localStorage.setItem('slider_y', this.valueY);
    window.localStorage.setItem('slider_z', this.valueZ);
  },
  methods: {
    setDownLoadTitle(res) {
      this.signGetPublicKey()
      this.downTitleFlag = true;
      this.downTitleData = res;
    },
    async signGetPublicKey() {
      const res = await sign_getPublicKey()
      if (res && res.code == 200) {
        window.encrypt = new JSEncrypt()
        encrypt.setPublicKey(res.result)
      }
    },
    submitTitleDown(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.downTitleData.title = this.ruleForm.title
          // this.downTitleData.pwd = encr(this.ruleForm.pass)
          this.downTitleData.pwd = encrypt.encrypt(this.ruleForm.pass)
          this.getDownLoadTile(this.downTitleData);
          this.cannelTitleDown();
        } else {
          console.log('error submit!!');
          return false;
        }
      });
    },
    async getDownLoadTile(res) {
      this.loading = true;
      this.loadingText = "数据下载中,请稍等..."
      $.ajax({
        url: BASE_URL + "/inquiry/downloadTiles?token=" + getToken(),
        type: "POST",
        data: JSON.stringify(res),
        dataType: 'json', // html、json、jsonp、script、text
        contentType: "application/json", // "application/x-www-form-urlencoded"
        success: (data) => {
          var token = getToken()
          var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + data.result + "&pwd=" + res.pwd;
          $("#downFrame").attr("src", url).click();
          this.loading = false;
          this.loadingText = ""
        },
        error: function (e) {
        }
      });
    },
    cannelTitleDown(formName) {
      this.downTitleFlag = false;
      // this.$refs[formName].resetFields();
      this.ruleForm = {
        pass: '',
        checkPass: '',
        title: ''
      }
    },
    catchmodel() {
      var that = this;
      window.pickedFeature;
src/views/Synthesis/LeftMenu.vue
@@ -441,6 +441,12 @@
            name: "地下模式",
            css: "twoMenu_imge29",
          },
          {
            id: "b10",
            label: "synthesis.undergroundMode",
            name: "瓦片下载",
            css: "twoMenu_imge29",
          },
        ],
        [
          {
src/views/Tools/LayerTree.vue
@@ -126,6 +126,14 @@
      >
        <i class="el-icon-tickets"></i>&nbsp;&nbsp;钻孔柱状图
      </div>
      <div
        class="edit"
        v-show="shwoTitle"
        @click="tileDownload()"
      >
        <i class="el-icon-download"></i>&nbsp;&nbsp;瓦片下载
      </div>
      <!-- <div
        class="edit"
        v-show="showModelAttach"
@@ -220,6 +228,7 @@
  perms_selectLayers, inquiry_selectDomains, comprehensive_selectPubById,
  project_selectDirAll, project_selectByDirid, dataQuerySelectWktById
} from "../../api/api.js";
import { conditions } from '../Archive/Archive.js';
export default {
  name: "tree",
  components: { queryinfo },
@@ -271,11 +280,47 @@
      mptLayer: [],
      optionts: [],
      proValue: null,
      setCheeckedLayer: []
      setCheeckedLayer: [],
      shwoTitle: false,
    };
  },
  methods: {
    //瓦片下载
    tileDownload() {
      var that = this;
      this.menuVisible = false
      sgworld.Creator.createSimpleGraphic(
        "rectangle",
        {},
        function (entity) {
          that.getTileRectangle(entity);
          sgworld.Creator.SimpleGraphic.clear()
        }
      );
    },
    getTileRectangle(res) {
      var value = res.rectangle.coordinates.getValue();
      var val = {
        pubid: this.currentData.pubid,
        pwd: "",
        title: "",
        xmax: Cesium.Math.toDegrees(
          value.east
        ),
        xmin: Cesium.Math.toDegrees(
          value.west
        ),
        ymax: Cesium.Math.toDegrees(
          value.north
        ),
        ymin: Cesium.Math.toDegrees(
          value.south
        )
      }
      this.$bus.$emit("titleDown", val)
    },
    //转孔柱状图
    async histogram() {
      this.menuVisible = false
@@ -325,10 +370,14 @@
      this.currentNode = Node;
      this.$store.state.propertiesName = this.currentData;
      if (this.currentData.serveType == "Tileset") {
      this.showModelAttach = false;
      this.shwoTitle = false;
      if (this.currentData.serveType == 'TMS') {
        this.shwoTitle = true
      } else if (this.currentData.serveType == "Tileset") {
        this.showModelAttach = true;
      } else {
        this.showModelAttach = false;
      }
      if (this.currentData.enName == "s_explorationpoint") {
        this.shwoHistogram = true;
@@ -1081,7 +1130,15 @@
      let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
        let branchArr = cloneData.filter((child) => father.id == child.pid);
        if (branchArr.length > 0) {
          branchArr.sort(function (a, b) {
            return a.orderNum - b.orderNum
          })
        }
        branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值
        // 属于同一对象问题,例如:令 a=b、c=1 ,然后再令 b.c=c , 那么 a.c=b.c=c=1 ;同理,后续令 c.d=2 ,那么 a.c.d 也是=2;
        // 由此循环多次后,就能形成相应的树形数据结构
@@ -1391,7 +1448,9 @@
    if (this.$store.state.showAllLayers == true) {
      this.layersStart();
      this.$store.state.showAllLayers = false;
    } else {
      this.treeData = this.$store.state.treeData;
      this.$refs.tree.setCheckedKeys(this.$store.state.checkedKeys);
    }
src/views/Tools/maplayer.vue
@@ -5,14 +5,13 @@
      v-for="(data, index) in PopupData"
      :key="data.id"
      title="图层管理"
      :maxHeight="data.maxHeight || '400px'"
      :maxHeight="data.maxHeight || '700px'"
      @close="close(data.id)"
      :left="data.left || left"
      :top="data.top || top + index * 42 + 'px'"
      :top="data.top || top + index * 30 + 'px'"
    >
      <div>
      <div id="eagleMapContainer">
        <div
          id="eagleMapContainer"
          style="width:300px;height:400px;"
          v-drag
          @mousedown="dragEagle"
src/views/datamanage/dictionaryManage.vue
@@ -471,6 +471,7 @@
              v-model="insertform.tab"
              autocomplete="off"
              style="width:85%"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item
@@ -711,7 +712,8 @@
    //修改详情弹框
    handleEdit(index, row) {
      this.dialogFormVisible = true;
      this.upform = row;
      var val = JSON.parse(JSON.stringify(row))
      this.upform = val;
    },
    //删除列表
    DelFormData() {