管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-04-18 a7d306cb0fe6482251f9d4acdc29674ffc13a032
src/views/datamanage/dataUpdata.vue
@@ -3,6 +3,7 @@
    class="subpage_Box"
    v-loading="loading"
    element-loading-background="rgba(0, 0, 0, 0.8)"
    :element-loading-text="loadText"
  >
    <My-bread :list="[
        `${$t('dataManage.dataManage')}`,
@@ -158,7 +159,7 @@
                                </el-option>-->
                <el-option
                  :label="$t('shuJuGuanLi.pselect.SurveyDiscipline')"
                  :label="$t('shuJuGuanLi.pselect.SurveyingAndMapping')"
                  value="测量专业"
                />
                <el-option
@@ -173,7 +174,10 @@
                  :label="$t('shuJuGuanLi.pselect.CavernSpecialty')"
                  value="洞库专业"
                />
                <el-option
                  :label="$t('shuJuGuanLi.pselect.LineDiscipline')"
                  value='线路专业'
                />
              </el-select>
            </el-form-item>
            <!-- 坐标系 -->
@@ -377,6 +381,7 @@
        >
          <el-table
            style="width:100%"
            border
            :data="tableData"
            @selection-change="handleSelectionChange"
            height="calc(100% - 57px)"
@@ -516,6 +521,7 @@
            ref="filterTable"
            :data="waretableData"
            style="width: 100%"
            border
            height="calc(100% - 57px)"
            @selection-change="handleDelteChange"
          >
@@ -627,7 +633,7 @@
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="listData.pageIndex"
              :page-sizes="[10, 20, 50, 100]"
              :page-sizes="[10, 50, 100, 200]"
              :page-size="listData.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="count"
@@ -955,7 +961,7 @@
        </el-form-item>
        <el-form-item
          v-show="formCheckAll.isDiZai"
          label="所属专业"
          label="地灾类型"
        >
          <el-select
@@ -986,7 +992,7 @@
        <el-button
          class="elBotton"
          size="small"
          @click="commonTestQuay"
          @click="commonTestQuay()"
        >确 定</el-button>
      </span>
    </el-dialog>
@@ -1003,7 +1009,10 @@
      width="70%"
    >
      <div class="dialogBox">
        <div class="transFarBox subpage_Div">
        <div
          class="transFarBox subpage_Div"
          style="border: 1px solid #E4E7ED;"
        >
          <ul>
            <li
              @click="singleElection(item)"
@@ -1021,7 +1030,10 @@
          </div>
        </div>
        <div class="transFarBox subpage_Div">
        <div
          class="transFarBox subpage_Div"
          style="border: 1px solid #E4E7ED;"
        >
          <ul>
            <li
              @click="singleElection2(item)"
@@ -1045,7 +1057,10 @@
            </div>
          </div>
        </div>
        <div class="transFarBox subpage_Div">
        <div
          class="transFarBox subpage_Div"
          style="border: 1px solid #E4E7ED;"
        >
          <ul>
            <li
              @click="singleElection3(i)"
@@ -1112,7 +1127,7 @@
            @size-change="handleLoaderSizeChange"
            @current-change="handleLoaderCurrentChange"
            :current-page="listLoader.pageIndex"
            :page-sizes="[10, 20, 50, 100]"
            :page-sizes="[10, 50, 100, 200]"
            :page-size="listLoader.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="count1"
@@ -1124,13 +1139,13 @@
    </el-dialog>
    <el-dialog
      :close-on-click-modal="false"
      title="上传进度"
      :title="sc.label1"
      :visible.sync="jindudialogVisible"
      width="30%"
    >
      <div>
        <div>
          文件传输进度:
          {{sc.label2}}
        </div>
        <div>
          <el-progress
@@ -1274,7 +1289,7 @@
            @size-change="handleMetaSizeChange"
            @current-change="handMetaCurrentChange"
            :current-page="listMetaData.pageIndex"
            :page-sizes="[10, 20, 50, 100]"
            :page-sizes="[10, 50, 100, 200]"
            :page-size="listMetaData.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="listMetaData.count"
@@ -1363,6 +1378,44 @@
          />
        </el-table>
      </div>
    </el-dialog>
    <el-dialog
      :title="fromQueryMeta.title"
      :visible.sync="warehouseDialog"
      width="70%"
      :close-on-click-modal="false"
      :before-close="handleWarehouseClose"
    >
      <div style="height:65vh">
        <el-table
          ref="wareTable"
          :data="wareData"
          style="width: 100%"
          height="calc(100% - 1px)"
        >
          <el-table-column
            align="center"
            prop="name"
            :label="$t('common.name')"
          />
          <el-table-column
            align="center"
            prop="sizes"
            :label="$t('common.size')"
            :formatter="changeSizeFile"
          />
          <el-table-column
            align="center"
            prop="type"
            :label="$t('common.type')"
          />
          <el-table-column
            align="center"
            prop="msg"
            :label="$t('common.warehousResults')"
          />
        </el-table>
      </div>
    </el-dialog>
    <input
@@ -1515,6 +1568,7 @@
        selectFileType: "*.*",
        coordinateId: null,
        path: null,
        verid: null,
      },
      cascader: {
        label: "name",
@@ -1557,6 +1611,7 @@
      wareTableFlag: null,
      insertWareList: null,
      loading: false,
      loadText: '',
      dbTableData: [],
      dialogVisible: false,
      listLoader: {
@@ -1603,6 +1658,13 @@
      metaDataTable: [],
      queryMetaFlag1: false,
      metaDataTable1: [],
      getCheckedKeys: null,
      sc: {
        label1: '上传',
        label2: '文件上传进度:'
      },
      warehouseDialog: false,
      wareData: [],
    };
  },
@@ -1728,9 +1790,14 @@
        formData.append("ids", this.enclosureData[i]);
      }
      const that = this;
      this.sc = {
        label1: '上传',
        label2: '文件上传进度:'
      }
      that.jindudialogVisible = true;
      that.$set(this, "jindutiaoname", "附件上传");
      that.$set(this, "jindutiao", 0);
      this.loading = true;
      $.ajax(
        BASE_URL +
@@ -1794,7 +1861,7 @@
        "bs.m_equipment_nameplate",
        "bs.m_hydraulic_protection",
        "bs.m_marker",
        "bs.s_borehole",
        "bs.s_explorationpoint",
      ];
      var std = [];
      this.enclosureData = [];
@@ -1893,6 +1960,7 @@
        this.$message.error("字段列表调用失败");
        return;
      }
      var val = data1.result;
      for (var i in val) {
        val[i].createuser = val[i].createName;
@@ -1910,6 +1978,29 @@
      this.dbTableData = data1.result;
      this.count1 = data1.count;
    },
    changetimeLayer(res) {
      var time = new Date(res);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      return (
        y +
        '-' +
        this.add0(m) +
        '-' +
        this.add0(d) +
        ' ' +
        h +
        ':' +
        mm +
        ':' +
        s
      );
    },
    //自动匹配取消
    setInsrtWareTableClose() {
      this.dialogWarehousing = false;
@@ -1924,6 +2015,8 @@
    },
    //自动匹配确认
    async setInsrtWareTable() {
      this.loading = true;
      this.loadText = "数据入库中,请等待..."
      if (this.tableWareThree.length != 0) {
        for (var i in this.tableWareThree) {
          var tabs = this.tableWareThree[i].tabs;
@@ -1942,20 +2035,32 @@
        });
      }
      this.loading = true;
      const res = await dataUpload_insertFiles(
        JSON.stringify(this.insertWareList)
      );
      this.loading = false;
      if (res.code != 200) {
        this.$message.error("数据入库失败");
        return;
      }
      this.$message({
        message: "数据入库成功",
        type: "success",
      });
      this.loading = false;
      this.loadText = ""
      if (res.result.length > 0) {
        this.warehouseDialog = true;
        this.wareData = res.result;
      }
      this.setInsrtWareTableClose();
    },
    handleWarehouseClose() {
      this.warehouseDialog = false;
      this.wareData = [];
    },
    //自动匹配
    autoMatchWare() {
@@ -2093,18 +2198,21 @@
          }
        }
      }
      this.loading = true;
      var obj = {
        dirid: this.formInline.dirid,
        epsgCode: this.formInline.coordinateId,
        path: this.formInline.path,
        verid: this.formInline.verid,
      };
      this.loadText = "数据映射查询中,请等待..."
      //查询映射
      const data = await dataUpload_selectMappers(obj);
      if (data.code != 200) {
        return this.$message.error("数据映射失败");
      }
      this.loading = false;
      this.loadText = " "
      var std = [];
      var result = data.result;
      this.insertWareList = data.result;
@@ -2135,10 +2243,16 @@
    //整体文件质检提交
    commonTestQuay() {
      this.testQuayVisible = false;
      if (this.formCheckAll.diZaiType != "NO") {
        this.formCheckAll.isDiZai = "YES";
      // if (this.formCheckAll.diZaiType != "NO") {
      //   this.formCheckAll.isDiZai = "YES";
      // }
      this.sc = {
        label1: '质检',
        label2: '文件质检进度:'
      }
      this.loading = true;
      this.jindudialogVisible = true;
      this.loading = false;
      this.$set(this, "jindutiao", 0);
      this.getStartTestQuayTaskStatus();
    },
    //整体文件多条数据质检
@@ -2147,6 +2261,7 @@
        this.multipleSelection == 0 ||
        this.taskStatus == this.multipleSelection.length
      ) {
        this.jindudialogVisible = false;
        this.loading = false;
        return;
      }
@@ -2161,6 +2276,7 @@
          this.formCheckAll.wbsPath = path;
        }
      }
      this.formCheckAll.sjfl = '数字化成果'
      const data = await dataUpload_uploadChecks(this.formCheckAll);
      if (data.code != 200) {
        this.$message.error("数据质检提交失败");
@@ -2177,32 +2293,44 @@
    //单文件数据质检提交
    async commonQuayTest() {
      this.loading = true;
      // this.loading = true;
      this.quayTestVisible = false;
      this.taskStatus = 0;
      this.getStartTaskStatus();
      this.sc = {
        label1: '质检',
        label2: '文件质检进度:'
      }
      this.jindudialogVisible = true;
      this.$set(this, "jindutiao", 0);
    },
    //单文件多条数据质检
    async getStartTaskStatus() {
      const that = this;
      if (
        this.multipleSelection == 0 ||
        this.taskStatus == this.multipleSelection.length
      ) {
        this.loading = false;
        that.jindudialogVisible = false;
        return;
      }
      this.quayTestForms.zipPath = this.multipleSelection[this.taskStatus].path;
      if (this.quayTestForms.zipPath.indexOf(".zip") == -1) {
        this.taskStatus++;
        this.getStartTaskStatus();
      } else {
        this.quayTestForms.names = this.pathBak;
        var value = this.$refs["selectcascader"].getCheckedNodes();
        var bak = value[0].data.fullName.split("\\");
        var value = this.getCheckedKeys
        var bak = value.data.fullName.split("\\");
        this.quayTestForms.xmmc = bak[this.taskStatus];
        this.quayTestForms.sjzy = this.formInline.specialtyId;
        this.quayTestForms.zipPath =
          this.multipleSelection[this.taskStatus].path;
        this.quayTestForms.sjfl = '数字化成果'
        const data = await dataUpload_uploadChecks(this.quayTestForms);
        if (data.code != 200) {
          this.$message.error("数据质检提交失败");
@@ -2234,14 +2362,15 @@
                this.multipleSelection[this.taskStatus].path
              ) {
                this.tableData[i].status = "质检成功";
              }
            }
            if (this.progress == 1) {
              clearInterval(this.setIntel);
              this.setIntel = null;
              this.taskStatus++;
              this.getStartTaskStatus();
            }
            // if (this.progress == 1) {
            clearInterval(this.setIntel);
            this.setIntel = null;
            this.taskStatus++;
            this.getStartTaskStatus();
            // }
          } else {
            //任务失败
            for (var i in this.tableData) {
@@ -2271,6 +2400,7 @@
        if (
          this.tableData[i].path == this.multipleSelection[this.taskStatus].path
        ) {
          this.$set(this, "jindutiao", parseInt(this.progress * 100));
          this.tableData[i].status = parseInt(this.progress * 100) + "%";
        }
      }
@@ -2292,11 +2422,11 @@
                }
              }
            }
            if (this.progress == 1) {
              clearInterval(this.setIntel);
              this.setIntel = null;
              this.loading = false;
            }
            // if (this.progress == 1) {
            clearInterval(this.setIntel);
            this.setIntel = null;
            this.loading = false;
            // }
          } else {
            //任务失败
            for (var i in this.tableData) {
@@ -2323,11 +2453,14 @@
        }
      }
      this.progress = std / (res.length * 100);
      // for (var i in this.tableData) {
      //   if (this.tableData[i].path == this.multipleSelection[this.taskStatus].path) {
      //     this.tableData[i].status = parseInt(this.progress * 100) + "%";
      //   }
      // }
      this.$set(this, "jindutiao", parseInt(this.progress * 100));
      for (var i in this.tableData) {
        for (var j in this.multipleSelection) {
          if (this.tableData[i].path == this.multipleSelection[j].path) {
@@ -2461,7 +2594,7 @@
      });
      that.$set(this, "jindutiaoname", listval);
      that.$set(this, "jindutiao", 0);
      this.loading = true;
      // this.loading = true;
      $.ajax(
        BASE_URL +
        "/dataUpload/uploadFiles?token=" +
@@ -2516,7 +2649,15 @@
      this.$set(this, "jindutiao", loaded);
    },
    format(percentage) {
      return percentage === 100 ? "上传完毕" : `${percentage}%`;
      // return percentage === 100 ? "上传完毕" : `${percentage}%`;
      var label;
      if (this.sc.label1 == "上传") {
        label = "上传完毕"
      } else {
        label = `${percentage}%`
      }
      return percentage === 100 ? label : `${percentage}%`;
    },
    //获取文件上传路径
    async getFilePath() {
@@ -2534,7 +2675,7 @@
          return rs;
        }
      });
      this.pathBak = val[0].bak;
      this.pathBak = val[0].checks;
      this.formInline.dirid = val[0].id;
      this.getselectVerByDirid();
    },
@@ -2613,8 +2754,9 @@
        return this.$message("请选择需要质检的文件");
      }
      if (this.formInline.uploadType == "v1") {
        var value = this.$refs["selectcascader"].getCheckedNodes();
        var fileType = value[0].data.fullName;
        var value = this.getCheckedKeys
        var fileType = value.data.fullName;
        this.quayTestForms.names = fileType;
        this.quayTestForms.sjzy = this.formInline.specialtyId;
        this.quayTestVisible = true;
@@ -2647,10 +2789,10 @@
        this.formCheckAll.xmmc = val[0].name;
        this.formCheckAll.sjzy = this.formInline.specialtyId;
        if (this.formCheckAll.sjzy.indexOf("地灾") != -1) {
          this.formCheckAll.isDiZai = true;
          this.formCheckAll.isDiZai = "YES";
          this.formCheckAll.diZaiType = this.disOptions[0].value;
        } else {
          this.formCheckAll.isDiZai = false;
          this.formCheckAll.isDiZai = "NO";
          this.formCheckAll.diZaiType = "NO";
        }
        this.testQuayVisible = true;
@@ -2736,11 +2878,13 @@
    },
    //上传数据列表清单初始化
    setStartWareTable() {
      this.listData = {
        pageIndex: 1,
        pageSize: 10,
        name: null,
      };
      // this.listData = {
      //   pageIndex: 1,
      //   pageSize: 10,
      //   name: null,
      // };
      this.listData.pageIndex = 1;
      this.listData.name = null;
      this.getAllWareTable();
    },
    //获取数据上传列表清单
@@ -2829,7 +2973,7 @@
        this.formInline.entryId = this.entryOption[0].name;
        this.formInline.dirid = this.entryOption[0].id;
        this.getselectVerByDirid();
        this.pathBak = this.entryOption[0].bak;
        this.pathBak = this.entryOption[0].checks;
      } else {
        this.getStartDirChecked(this.catalogOption);
        this.getselectVerByDirid();
@@ -2840,7 +2984,7 @@
    //版本号获取
    async getselectVerByDirid() {
      this.verOption = [];
      this.formInline.verid = "";
      const res = await dataUploadSelectVerByDirid({
        dirid: this.formInline.dirid,
      });
@@ -2912,7 +3056,8 @@
      // this.$refs['selectcascader'].dropDownVisible = false
      // var value = this.$refs['selectcascader'].getCheckedNodes();
      var bak = node.data.bak;
      var bak = node.data.checks;
      this.getCheckedKeys = node
      this.pathBak = bak;
      if (bak != null) {
        for (var key in this.quayTestShow) {
@@ -2921,7 +3066,7 @@
          }
        }
      }
      var fileType = node.data.code;
      var fileType = node.data.exts;
      if (fileType == null) {
        fileType = "*.*";
      }
@@ -3006,4 +3151,4 @@
.text-center {
  text-align: center;
}
</style>
</style>