管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-03-06 28bd61701bb409257ea0dd3c78f32bd0b45ebbd5
src/views/datamanage/dataUpdata.vue
@@ -19,7 +19,10 @@
          :label="$t('dataManage.dataUpObj.uploaddata')"
          name="first"
      >
        <div class="inquire subpage_Div" ref="container">
        <div
          class="inquire subpage_Div"
          ref="container"
        >
          <el-form
              :inline="true"
              :model="formInline"
@@ -234,7 +237,10 @@
                  </el-input>
                </el-form-item>
                <!-- 选择元数据 -->
                <el-form-item v-show="uploadFlag" style="padding-left: 16px">
                <el-form-item
                  v-show="uploadFlag"
                  style="padding-left: 16px"
                >
                  <el-link
                      :disabled="tableData.length == 0 ? false : true"
                      v-show="formInline.metaData == '请选择元数据'"
@@ -360,15 +366,18 @@
              </div>
            </div>
          </el-form>
        </div>
        <!-- 上传数据列表 -->
        <div class="dividing-line"></div>
        <div class="table_box" :style="styleVar">
        <div
          class="table_box"
          :style="styleVar"
        >
          <el-table
              style="width:100%"
            border
              :data="tableData"
              @selection-change="handleSelectionChange"
              height="calc(100% - 57px)"
@@ -430,7 +439,10 @@
          :label="$t('dataManage.dataUpObj.receiptdata')"
          name="second"
      >
        <div class="inquire subpage_Div" ref="container1">
        <div
          class="inquire subpage_Div"
          ref="container1"
        >
          <el-form
              :inline="true"
              :model="formWarehousing"
@@ -438,12 +450,20 @@
          >
            <div class="flex_box">
              <div style="margin-right: auto">
                <el-form-item size="small" :label="$t('dataManage.dataUpObj.describe')">
                <el-form-item
                  size="small"
                  :label="$t('dataManage.dataUpObj.describe')"
                >
                  <el-input
                      v-model="formWarehousing.name"
                      :placeholder="$t('shuJuGuanLi.lable1')"
                      style="width: 200px;"
                  ><i slot="suffix" class="el-icon-search"  @click="setWarehouseSearch" style="padding-right: 8px"></i></el-input>
                  ><i
                      slot="suffix"
                      class="el-icon-search"
                      @click="setWarehouseSearch"
                      style="padding-right: 8px"
                    ></i></el-input>
                </el-form-item>
              </div>
              <div>
@@ -485,16 +505,19 @@
              </div>
            </div>
          </el-form>
        </div>
        <!-- 入库 -->
        <div class="dividing-line"></div>
        <div class="table_box" :style="styleVar1">
        <div
          class="table_box"
          :style="styleVar1"
        >
          <el-table
              ref="filterTable"
              :data="waretableData"
              style="width: 100%"
            border
              height="calc(100% - 57px)"
              @selection-change="handleDelteChange"
          >
@@ -511,15 +534,26 @@
            ></el-table-column>
            <el-table-column
                align="center"
                :label="$t('common.name')"
                width="120"
            >
              <template slot-scope="scope">
                                  <span v-if="scope.row.ismeta > 0">
                     <el-link style="color:#409eff" title="元数据查询" @click="setQueryMetaData(scope.row)"
                              target="_blank">{{ scope.row.name }}</el-link>
                  <el-link
                    style="color:#409eff"
                    title="源数据查询"
                    @click="setQueryMetaData(scope.row)"
                    target="_blank"
                  >{{ scope.row.name }}</el-link>
                </span>
                <span v-else-if="scope.row.metaid > 0">
                  <el-link
                    style="color:#409eff"
                    title="元数据查询"
                    @click="setMetaDataQuery(scope.row)"
                    target="_blank"
                  >{{ scope.row.name }}</el-link>
           
            </span>
                <span v-else>{{ scope.row.name }}</span>
@@ -587,7 +621,10 @@
                width="100"
            />
          </el-table>
          <div class="pagination_box" style="margin-top: 15px">
          <div
            class="pagination_box"
            style="margin-top: 15px"
          >
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
@@ -600,7 +637,6 @@
            </el-pagination>
          </div>
        </div>
      </el-tab-pane>
    </el-tabs>
@@ -896,9 +932,11 @@
        :visible.sync="testQuayVisible"
        :modal="false"
        :before-close="handleTestQuayCloseDown"
    >
      <el-form :model="formCheckAll" label-position="top">
      <el-form
        :model="formCheckAll"
        label-position="top"
      >
        <el-form-item label="项目名称">
          <el-input
@@ -910,7 +948,6 @@
        </el-form-item>
        <el-form-item label="所属专业">
          <el-input
              disabled
              v-model="formCheckAll.sjzy"
@@ -920,7 +957,7 @@
        </el-form-item>
        <el-form-item
            v-show="formCheckAll.isDiZai"
            label="所属专业"
          label="地灾类型"
        >
          <el-select
@@ -936,7 +973,6 @@
            >
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
@@ -1090,13 +1126,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
@@ -1133,15 +1169,31 @@
        width="70%"
    >
      <div style="height: 500px; overflow: auto;width:100%; ">
        <el-form :inline="true" :model="fromQueryMeta" class="demo-form-inline">
        <el-form
          :inline="true"
          :model="fromQueryMeta"
          class="demo-form-inline"
        >
          <el-form-item>
            <el-input size="small" v-model="fromQueryMeta.name" :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueone')"
                      suffix-icon="el-icon-edit"></el-input>
            <el-input
              size="small"
              v-model="fromQueryMeta.name"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valueone')"
              suffix-icon="el-icon-edit"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" size="small" @click="setSearchMetaData()">查询</el-button>
            <el-button type="info" size="small" @click="setRestMetaData()">重置</el-button>
            <el-button
              type="primary"
              size="small"
              @click="setSearchMetaData()"
            >查询</el-button>
            <el-button
              type="info"
              size="small"
              @click="setRestMetaData()"
            >重置</el-button>
          </el-form-item>
        </el-form>
        <el-table
@@ -1149,7 +1201,6 @@
            :data="metaDataTable"
            style="width: 100%"
            height="calc(100% - 130px)"
        >
          <el-table-column
@@ -1162,10 +1213,8 @@
              align="center"
              prop="name"
              :label="$t('common.name')"
              width="120"
          >
          </el-table-column>
          <el-table-column
@@ -1218,7 +1267,6 @@
              :label="$t('dataManage.dataUpObj.describe')"
          />
        </el-table>
        <div
            style="margin-top: 15px"
@@ -1237,6 +1285,87 @@
        </div>
      </div>
    </el-dialog>
    <el-dialog
      :title="fromQueryMeta.title"
      :visible.sync="queryMetaFlag1"
      width="70%"
    >
      <div style="height: 65vh; width: 100%">
        <el-table
          ref="filterTable"
          :data="metaDataTable1"
          style="width: 100%"
          height="100%"
        >
          <el-table-column
            align="center"
            type="index"
            :label="$t('common.index')"
            width="70px"
          ></el-table-column>
          <el-table-column
            align="center"
            prop="name"
            :label="$t('common.name')"
            width="120"
          >
          </el-table-column>
          <el-table-column
            align="center"
            prop="dirName"
            :label="$t('dataManage.dataUpObj.catalogue')"
            width="300"
          />
          <el-table-column
            align="center"
            prop="depName"
            :label="$t('dataManage.dataUpObj.company')"
            width="200"
          />
          <el-table-column
            align="center"
            prop="verName"
            :label="$t('dataManage.dataUpObj.versionNo')"
          />
          <el-table-column
            align="center"
            prop="type"
            :label="$t('common.type')"
          />
          <el-table-column
            align="center"
            prop="sizes"
            :label="$t('common.size')"
            :formatter="changeSizeFile"
          />
          <el-table-column
            align="center"
            :label="$t('dataManage.dataUpObj.tableName')"
          >
            <template slot-scope="scope">
              <a
                class="scopeRowColor"
                @click="detail(scope.row)"
              >{{
                  scope.row.tab
                }}</a>
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            prop="rows"
            :label="$t('common.lineNuber')"
          />
          <el-table-column
            align="center"
            prop="desc"
            :label="$t('dataManage.dataUpObj.describe')"
          />
        </el-table>
      </div>
    </el-dialog>
    <input
        name="file1"
@@ -1271,6 +1400,7 @@
  dataUploadSelectFiles,
  dataUploadSelectPath,
  dataUploadSelectVerByDirid,
  dataUpload_selectMetaById,
  selectdirTab,
} from "../../api/api";
@@ -1387,6 +1517,7 @@
        selectFileType: "*.*",
        coordinateId: null,
        path: null,
        verid: null,
      },
      cascader: {
        label: "name",
@@ -1473,12 +1604,18 @@
        name: "",
      },
      metaDataTable: [],
      queryMetaFlag1: false,
      metaDataTable1: [],
      getCheckedKeys: null,
      sc: {
        label1: '上传',
        label2: '文件上传进度:'
      }
    };
  },
  mounted() {
    //获取目录
    this.getSelectdirTab();
    //获取坐标系
    this.setCoordinateSystem();
    //获取项目名称
@@ -1489,6 +1626,8 @@
    this.getPerms();
    window.addEventListener("resize", this.onResize);
    this.calHeight();
    //获取目录
    this.getSelectdirTab();
  },
  beforeDestroy() {
    this.timer && clearTimeout(this.timer);
@@ -1522,6 +1661,22 @@
      this.listMetaData.pageIndex = val;
      this.startQueryMetaData();
    },
    //元数据查询
    async setMetaDataQuery(row) {
      this.fromQueryMeta.title = row.name;
      this.listMetaData = {
        id: row.metaid,
      };
      const data = await dataUpload_selectMetaById(this.listMetaData);
      if (data.code != 200) {
        return;
      }
      this.queryMetaFlag1 = true;
      this.metaDataTable1 = [data.result];
    },
    //元数据查询
    setQueryMetaData(row) {
      this.fromQueryMeta.title = row.name;
@@ -1581,9 +1736,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 +
@@ -1746,6 +1906,7 @@
        this.$message.error("字段列表调用失败");
        return;
      }
      var val = data1.result;
      for (var i in val) {
        val[i].createuser = val[i].createName;
@@ -1762,6 +1923,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() {
@@ -1988,10 +2172,17 @@
    //整体文件质检提交
    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();
    },
    //整体文件多条数据质检
@@ -2000,6 +2191,7 @@
          this.multipleSelection == 0 ||
          this.taskStatus == this.multipleSelection.length
      ) {
        this.jindudialogVisible = false;
        this.loading = false;
        return;
      }
@@ -2030,28 +2222,39 @@
    //单文件数据质检提交
    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 =
@@ -2124,6 +2327,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) + "%";
        }
      }
@@ -2176,11 +2380,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) {
@@ -2314,7 +2521,7 @@
      });
      that.$set(this, "jindutiaoname", listval);
      that.$set(this, "jindutiao", 0);
      this.loading = true;
      // this.loading = true;
      $.ajax(
          BASE_URL +
          "/dataUpload/uploadFiles?token=" +
@@ -2369,7 +2576,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() {
@@ -2387,7 +2602,7 @@
          return rs;
        }
      });
      this.pathBak = val[0].bak;
      this.pathBak = val[0].checks;
      this.formInline.dirid = val[0].id;
      this.getselectVerByDirid();
    },
@@ -2466,8 +2681,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;
@@ -2500,10 +2716,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;
@@ -2682,7 +2898,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();
@@ -2693,10 +2909,11 @@
    //版本号获取
    async getselectVerByDirid() {
      this.verOption = [];
      this.formInline.verid = "";
      const res = await dataUploadSelectVerByDirid({
        dirid: this.formInline.dirid,
      });
      if (res.code != 200) {
        this.$message.error("版本列表获取失败");
        return;
@@ -2711,9 +2928,11 @@
        this.$message.error("目录列表获取失败");
        return;
      }
      this.catalogOption = this.treeData(res.result);
      this.formInline.dirName = this.catalogOption[0].name;
      this.getStartDirChecked(this.catalogOption);
      this.formInline.dirid = this.catalogOption[0].id;
      // this.getStartDirChecked(this.catalogOption);
      this.getselectVerByDirid();
    },
@@ -2762,7 +2981,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) {
@@ -2771,7 +2991,7 @@
          }
        }
      }
      var fileType = node.data.code;
      var fileType = node.data.exts;
      if (fileType == null) {
        fileType = "*.*";
      }