管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-09 731d894cf232d98b547df2bd006795de74fb16a7
src/components/MapView/mapMenuPop.vue
@@ -1,6 +1,17 @@
<template>
  <div class="menuPop">
    <div class="leftBox">
      <div
        class="leftDown"
        v-if="$store.state.download"
      >
        <div @click="getDownloadDep">
          <el-link
            style="color:white"
            icon="el-icon-download"
          > </el-link>
        </div>
      </div>
      <ul>
        <li
          v-for="(item, index) in option"
@@ -25,11 +36,15 @@
            label="序号"
            width="50"
          />
          <el-table-column label="定位" width="100" align="center">
          <el-table-column
            label="定位"
            width="100"
            align="center"
          >
            <template slot-scope="scope">
              <el-button
                icon="el-icon-map-location"
                size="mini"
                size="small"
                @click="spaceLocation(scope.$index, scope.row)"
              ></el-button>
            </template>
@@ -72,14 +87,20 @@
        label-width="100px"
        class="codeForm"
      >
        <el-form-item :label="$t('common.passworld')" prop="password">
        <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-form-item
          :label="$t('common.SPassword')"
          prop="repassword"
        >
          <el-input
            type="password"
            v-model="codeForm.repassword"
@@ -91,13 +112,82 @@
            class="primary"
            size="small"
            @click="download('codeForm')"
            >{{ $t("common.confirm") }}</el-button
          >
          <el-button type="info" size="small" @click="closeDown('codeForm')">{{
          >{{ $t("common.confirm") }}</el-button>
          <el-button
            type="info"
            size="small"
            @click="closeDown('codeForm')"
          >{{
            $t("common.cancel")
          }}</el-button>
        </el-form-item>
      </el-form>
    </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>
    <iframe
      id="Iframe1"
@@ -106,7 +196,7 @@
    ></iframe>
  </div>
</template>
<script>
import {
  dataQuery_selectByPage,
@@ -115,7 +205,10 @@
  dataQuerySelectWktById,
  sign_getPublicKey,
  dataLib_selectDownloadFile,
  decr,
  dataQuery_selectDbOverflowDep,
  apply_insertApply,
  decr, encr,
  dataLib_selectDepsByIds,
} from "../../api/api.js";
import { getToken } from "@/utils/auth";
import $ from "jquery";
@@ -141,7 +234,17 @@
      }
    };
    return {
      ruleForm: {
        depname: [],
        tabs: [],
        pwd: null,
        repwd: null,
        wkt: null,
        descr: null,
      },
      dialogVisible: false,
      dialogInsertVisible: false,
      insertFlag: null,
      codeForm: {
        password: "",
        repassword: "",
@@ -155,6 +258,15 @@
          { required: true, message: "请输入确认密码", trigger: "blur" },
          { validator: repasswordValidator, trigger: "blur" },
        ],
      },
      insertOption: {
        ids: [],
        pwd: null,
        tabs: [],
        entity: [],
        wkt: null,
        descr: null,
      },
      listPage: {
        pageSize: 10,
@@ -182,6 +294,74 @@
    };
  },
  methods: {
    getInsertDown() {
      this.dialogInsertVisible = false;
      this.dialogVisible = true;
    },
    handleInsertClose() {
      this.$confirm('确认关闭?')
        .then(_ => {
          this.closeInsertDown();
        })
        .catch(_ => { });
    },
    closeInsertDown() {
      this.ruleForm = {
        depname: [],
        tabs: [],
        pwd: null,
        repwd: null,
        wkt: null,
        descr: null,
      }
      this.dialogInsertVisible = false
    },
    async getDownloadDep() {
      var std = [];
      for (var i in this.option) {
        std.push(this.option[i].entity
        )
      }
      var obj = {
        entities: std,
        wkt: this.listdata.wkt
      }
      const data = await dataQuery_selectDbOverflowDep(JSON.stringify(obj))
      if (data.code != 200) {
        this.$message.error("数据请求失败");
        return;
      }
      if (data.result.length == 0 || data.result == null) {
        this.insertFlag = 1;
        this.dialogVisible = true;
      } else {
        this.insertFlag = 2;
        var std = [];
        this.insertOption.ids = data.result;
        var val = "";
        for (var i in data.result) {
          if (val == "") {
            val += "ids=" + data.result[i]
          } else {
            val += "&ids=" + data.result[i]
          }
          std.push({
            name: data.result[i]
          })
        }
        const data1 = await dataLib_selectDepsByIds(val);
        this.ruleForm.depid = data1.result;
        this.ruleForm.depname = std;
        this.ruleForm.wkt = decr(this.listdata.wkt)
        this.ruleForm.tabs = this.option;
        this.dialogInsertVisible = true;
      }
    },
    async signGetPublicKey() {
      const res = await sign_getPublicKey();
      if (res && res.code == 200) {
@@ -189,32 +369,62 @@
        encrypt.setPublicKey(res.result);
      }
    },
    download() {
    async download() {
      if (this.codeForm.password == "") return;
      var obj = {
        pwd: encrypt.encrypt(this.codeForm.password),
        entities: [],
        wkt: this.listdata.wkt,
      };
      for (var i in this.option) {
        obj.entities.push(this.option[i].entity);
      if (this.insertFlag == 1) {
        var obj = {
          pwd: encrypt.encrypt(this.codeForm.password),
          entities: [],
          wkt: this.listdata.wkt,
        };
        for (var i in this.option) {
          obj.entities.push(this.option[i].entity);
        }
        var token = getToken();
        var that = this;
        $.ajax(BASE_URL + "/dataLib/downloadDbReq?token=" + token, {
          type: "post",
          data: JSON.stringify(obj),
          async: true,
          cache: false,
          processData: false,
          contentType: false,
          success: (res) => {
            if (res.code != 200) {
              return;
            }
            this.selectDownloadFile(res.result, obj.pwd);
          },
        });
      } else if (this.insertFlag == 2) {
        var std = [];
        var std1 = [];
        for (var i in this.option) {
          std.push(this.option[i].tabDesc)
          std1.push(this.option[i].entity)
        }
        var obj = {
          ids: this.insertOption.ids,
          pwd: encr(this.codeForm.password),
          tabs: std,
          entities: std1,
          wkt: this.listdata.wkt,
          descr: this.ruleForm.descr,
        }
        const data1 = await apply_insertApply(JSON.stringify(obj))
        if (data1.code != 200) {
          this.$message.error("数据申请失败");
          return
        }
        this.$message({
          message: '数据申请成功',
          type: 'success'
        });
        this.closeDown();
      }
      var token = getToken();
      var that = this;
      $.ajax(BASE_URL + "/dataLib/downloadDbReq?token=" + token, {
        type: "post",
        data: JSON.stringify(obj),
        async: true,
        cache: false,
        processData: false,
        contentType: false,
        success: (res) => {
          if (res.code != 200) {
            return;
          }
          this.selectDownloadFile(res.result, obj.pwd);
        },
      });
    },
    async selectDownloadFile(rsid, rspwd) {
      var downObj = {
@@ -243,12 +453,13 @@
        .then((_) => {
          this.closeDown();
        })
        .catch((_) => {});
        .catch((_) => { });
    },
    closeDown() {
      this.dialogVisible = false;
      this.codeForm.password = "";
      this.codeForm.repassword = "";
      this.closeInsertDown();
    },
    startTableMssage() {
      this.listdata.pageIndex = 1;
@@ -270,7 +481,7 @@
      }, []);
      this.option = arr;
      this.listdata.name = this.option[0].entity;
      this.getTableDateHidder();
    },
    async getTableDateHidder() {
@@ -286,7 +497,7 @@
      this.attributeData = [];
      var valadata = data.result;
      var laydomain = data1.result;
      for (var i in valadata) {
        if (valadata[i].showtype == 1) {
          if (
@@ -314,7 +525,7 @@
      if (data.code != 200) {
        this.$message.error("列表调用失败");
      }
      var val1 = decr(data.result);
      if (val1) {
        if (this.imagePoint != null) {
@@ -343,7 +554,7 @@
      } else if (res.type == "MultiPolygon") {
        var val = res.coordinates[0][0];
        var std = [];
        for (var i in val) {
          std.push({ x: val[i][0], y: val[i][1], z: 1000 });
        }
@@ -362,7 +573,7 @@
      } else if (res.type == "MultiLineString") {
        var line = res.coordinates[0];
        var std = [];
        for (var i in line) {
          std.push({ x: line[i][0], y: line[i][1], z: 1000 });
        }
@@ -393,12 +604,12 @@
    },
    async getTableData() {
      this.tableData = [];
      const data = await dataQuery_selectByPage(this.listdata);
      if (data.code != 200) {
        this.$message.error("列表调用失败");
      }
      var val_Data = data.result;
      for (var i in val_Data) {
        var valste = val_Data[i];
@@ -456,7 +667,7 @@
          var val = Cesium.Cartesian3.fromDegrees(
            res.coordinates[0],
            res.coordinates[1],
            1000
            200
          );
          this.$store.state.primitLayer.add({
            position: val,
@@ -514,7 +725,7 @@
          break;
      }
    },
    closeMenuBox() {
      if (this.imagePoint != null) {
        sgworld.Creator.DeleteObject(this.imagePoint);
@@ -537,7 +748,7 @@
  },
};
</script>
<style scoped lang="less">
.menuPop {
  width: 100%;
@@ -564,8 +775,14 @@
      color: #409eff;
      background: rgba(128, 128, 128, 0.2);
    }
    .leftDown {
      width: 94%;
      padding: 3%;
      display: flex;
      justify-content: flex-end;
    }
  }
  .rightBox {
    width: calc(80% - 1px);
    height: 100%;
@@ -627,7 +844,7 @@
  }
  /deep/ .el-table {
    background-color: transparent;
    th,
    td {
      background-color: transparent;
@@ -635,7 +852,7 @@
    .el-table__expanded-cell {
      background-color: transparent !important;
    }
    // 表头背景色
    th.el-table__cell {
      background-color: #303030;
@@ -645,23 +862,23 @@
      background-color: #303030;
      color: #fff;
    }
    // hover效果
    tr:hover > td {
      background-color: rgba(255, 255, 255, 0.3) !important;
    }
    tbody tr:hover {
      background-color: rgba(255, 255, 255, 0.3) !important;
      // text-align: center;
    }
    // 滚动条宽高
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      /*滚动条宽度*/
@@ -674,7 +891,7 @@
      /*滚动条的背景区域的内阴影*/
      border-radius: 10px;
    }
    /*定义滑块 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      box-shadow: 0px 1px 3px #216fe6 inset;
@@ -683,6 +900,10 @@
    }
  }
}
li {
  line-height: 20px;
  border-bottom: 1px solid gray;
  padding: 5px;
}
</style>
<style lang="less"></style>
<style scoped lang="less"></style>