管道基础大数据平台系统开发-【前端】-新系統界面
src/components/mapsdk.vue
@@ -666,9 +666,78 @@
      <!--          v-bind:class="{ active: isActive, menuLayer: isMenuLayer }"-->
      <!--        ></div>-->
      <!--      </div>-->
      <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>
    <model-property ref='modelProperty'></model-property>
    <iframe
      id="downFrame"
      src=""
      style="display: none; border: 0; padding: 0; height: 0; width: 0"
    ></iframe>
  </div>
</template>
@@ -682,7 +751,7 @@
  select_Comprehensive_SelectWktById,
  comprehensive_selectRoute,
  dataLib_selectFiles, dataQuery_selectFields, dataQuery_selectDomains,
  dataQuery_selectByPage,
  dataQuery_selectByPage, sign_getPublicKey, inquiry_downloadTiles,
  comprehensive_selectPubById, comprehensive_selectModelByGuid
} from '../api/api'
import { getToken } from '@/utils/auth'
@@ -796,6 +865,15 @@
      valueX: 0,
      valueY: 0,
      terrainflag: false,
      downTitleFlag: false,
      downTitleData: null,
      ruleForm: {
        pass: '',
        checkPass: '',
        title: ''
      },
      loadingText: '',
      loading: false
    };
  },
  mounted() {
@@ -821,14 +899,71 @@
      }
    });
    //模型捕捉
    this.catchmodel()
    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;
@@ -854,9 +989,7 @@
    },
    async setModelInfoData(result) {
      var modelKey = 'id';
      var modelid;
      debugger
      if (result.tileset) {
        if (result.tileset.pubid && parseInt(result.tileset.pubid) > 0) {
@@ -908,10 +1041,7 @@
        layerName: pickedFeature.primitive.id
      };
      that.$refs && that.$refs.modelProperty && that.$refs.modelProperty.open();
    },
    drawTerrainLevel() {
      this.clearTerrainLevel()
      var deep = parseFloat(this.terrainFrom.height)
@@ -941,8 +1071,6 @@
        licenseServer: window.sceneConfig.licenseServer,
      });
      window.Viewer = window.sgworld._Viewer;
      if (is_production) {
@@ -995,8 +1123,6 @@
        );
      }
      var option = {
        url: window.sceneConfig.SGUrl,
        layerName: window.sceneConfig.mptName,
@@ -1006,8 +1132,6 @@
      window.terrainFlag = 'MPT'
      window.elevationTool = new SmartEarth.ElevationTool(window.sgworld);
      elevationTool.setContourColor("#F1D487");
    },
    //dem切换
    changeTerrainLayer() {
@@ -1040,7 +1164,6 @@
            roll: 0.0
          }
        });
      }
      this.terrainflag = !this.terrainflag
    },
@@ -1720,7 +1843,7 @@
      }
      if (!data.result.length) {
        this.$message.error("未查询到勘探信息数据");
        this.$message("未查询到勘探信息数据");
        return
      }
      this.showAttribute = !this.showAttribute;