管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-09-21 c2a6c53657baaf0830cd881e1a23a15af23ac6fa
src/views/datamanage/dataUpdata.vue
@@ -57,7 +57,10 @@
                  :label="$t('shuJuGuanLi.pselect.dFiles')"
                  value="v2"
                />
                <el-option
                  :label="$t('shuJuGuanLi.pselect.dFfilest')"
                  value="v3"
                />
              </el-select>
            </el-form-item>
@@ -204,6 +207,45 @@
            </el-form-item>
            <div class="flex_box">
              <div style="margin-right: auto">
                <!-- 线路类别 -->
                <el-form-item
                  size="small"
                  :label="$t('dataManage.dataUpObj.labe11')"
                  v-show="formInline.uploadType =='v3'"
                >
                  <el-select
                    v-model="formInline.tab"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in lineOptions"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <!-- 线路类别 -->
                <el-form-item
                  :label="$t('dataManage.dataUpObj.labe12')"
                  v-show="formInline.uploadType =='v3'"
                  size="small"
                >
                  <el-select
                    v-model="formInline.medium"
                    size="small"
                    placeholder="请选择"
                  >
                    <el-option
                      v-for="item in mediumOptions"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <!-- 选择数据 -->
                <el-form-item size="small">
                  <el-link
@@ -243,7 +285,8 @@
                </el-form-item>
                <!-- 选择元数据 -->
                <el-form-item
                  v-show="uploadFlag"
                  v-show="uploadFlag "
                  v-if="formInline.uploadType =='v1'"
                  style="padding-left: 16px"
                >
                  <el-link
@@ -273,6 +316,7 @@
                </el-form-item>
                <el-form-item
                  v-show="uploadFlag"
                  v-if="formInline.uploadType =='v1'"
                  size="small"
                >
                  <el-input
@@ -1493,6 +1537,7 @@
  dataUploadSelectVerByDirid,
  dataUpload_selectMetaById,
  selectdirTab,
  dataUpload_insertKml
} from "../../api/api";
export default {
@@ -1609,6 +1654,8 @@
        coordinateId: null,
        path: null,
        verid: null,
        tab: "",
        medium: "",
      },
      cascader: {
        label: "name",
@@ -1632,6 +1679,67 @@
        {
          value: "洞库专业",
          label: "洞库专业",
        },
      ],
      lineOptions: [
        {
          value: 'plpipelinef',
          label: "可研中线",
        },
        {
          value: 'plpipelineb',
          label: "设计中线",
        },
        {
          value: 'plpipelined',
          label: "施工图中线",
        },
        {
          value: 'plpipelinea',
          label: "竣工图中线",
        },
      ],
      mediumOptions: [
        {
          value: 'GS',
          label: "天然气",
        },
        {
          value: 'CO',
          label: "原油",
        },
        {
          value: 'RP',
          label: "成品油",
        },
        {
          value: 'LN',
          label: "液化天然气",
        },
        {
          value: 'SL',
          label: "液化石油气",
        }, {
          value: 'WA',
          label: "矿浆",
        }, {
          value: 'ST',
          label: "蒸汽",
        }, {
          value: 'CD',
          label: "二氧化碳",
        }, {
          value: 'HY',
          label: "氢气",
        }, {
          value: 'QT',
          label: "其他",
        }, {
          value: '-1',
          label: "未知",
        }, {
          value: '0',
          label: "未调查",
        },
      ],
      fileType: [],
@@ -2213,72 +2321,120 @@
      this.getDataLoaderSelectTabs();
      this.dialogWarehousing = true;
    },
    //数据入库
    async setFileWare() {
      if (this.pathBak != null) {
        //是否有质检方案
        if (this.formInline.uploadType == "v1") {
          //单文件上传
          var std = [];
          for (var i in this.tableData) {
            if (this.tableData[i].name.indexOf(".zip") != -1) {
              if (this.tableData[i].code != null) {
                std.push(this.tableData[i].name);
              }
            }
          }
          if (std.length != 0) {
            return this.$message.error(
              std.toString() + ",未质检或质检失败,不能入库"
            );
          }
        } else if (this.formInline.uploadType == "v2") {
          //整体项目上传
          if (this.tableData.length != 2) {
            return this.$message.error("请保留一个zip数据,一个WBS数据进行入库");
          }
          var std = [];
          for (var i in this.tableData) {
            if (this.tableData[i].code != null) {
              std.push(this.tableData[i].name);
            }
          }
          if (std.length != 0) {
            return this.$message.error(
              std.toString() + ",未质检或质检失败,不能入库"
            );
          }
        }
      }
    //kml文件入库
    async setKMlWare() {
      this.loading = true;
      var obj = {
        dirid: this.formInline.dirid,
        epsgCode: this.formInline.coordinateId,
        path: this.formInline.path,
        verid: this.formInline.verid,
        entity: this.formInline.tab,
        medium: this.formInline.medium,
      };
      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;
      for (var i in result) {
        if (result[i].type == "shp" || result[i].type == "gdb") {
          std.push(result[i]);
        }
      var std = data.result.filter((res) => {
        res.entity = obj.entity
        res.medium = obj.medium
        return res;
      })
      this.loadText = "数据入库中,请等待..."
      const res = await dataUpload_insertKml(
        JSON.stringify(std)
      );
      if (res.code != 200) {
        this.$message.error("数据入库失败");
        return;
      }
      if (std.length != 0) {
        this.tableWareOne = std;
        this.showWareHousing();
      this.$message({
        message: "数据入库成功",
        type: "success",
      });
      this.loading = false;
      this.loadText = ""
      if (res.result.length > 0) {
        this.warehouseDialog = true;
        this.wareData = res.result;
      }
      this.setInsrtWareTableClose();
    },
    //数据入库
    async setFileWare() {
      if (this.formInline.uploadType == "v3") {
        this.setKMlWare()
      } else {
        this.setInsrtWareTable();
        if (this.pathBak != null) {
          //是否有质检方案
          if (this.formInline.uploadType == "v1") {
            //单文件上传
            var std = [];
            for (var i in this.tableData) {
              if (this.tableData[i].name.indexOf(".zip") != -1) {
                if (this.tableData[i].code != null) {
                  std.push(this.tableData[i].name);
                }
              }
            }
            if (std.length != 0) {
              return this.$message.error(
                std.toString() + ",未质检或质检失败,不能入库"
              );
            }
          } else if (this.formInline.uploadType == "v2") {
            //整体项目上传
            if (this.tableData.length != 2) {
              return this.$message.error("请保留一个zip数据,一个WBS数据进行入库");
            }
            var std = [];
            for (var i in this.tableData) {
              if (this.tableData[i].code != null) {
                std.push(this.tableData[i].name);
              }
            }
            if (std.length != 0) {
              return this.$message.error(
                std.toString() + ",未质检或质检失败,不能入库"
              );
            }
          }
        }
        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;
        for (var i in result) {
          if (result[i].type == "shp" || result[i].type == "gdb") {
            std.push(result[i]);
          }
        }
        if (std.length != 0) {
          this.tableWareOne = std;
          this.showWareHousing();
        } else {
          this.setInsrtWareTable();
        }
      }
    },
    //下载日志
@@ -2576,11 +2732,18 @@
    //清除所有input File;
    clearFileSelect() {
      this.formInline.specialtyData = "请选择数据";
      document.getElementById("selectDataFile").value = "";
      if (document.getElementById("selectDataFile")) {
        document.getElementById("selectDataFile").value = "";
      }
      this.formInline.metaData = "请选择元数据";
      document.getElementById("metaDataFile").value = "";
      if (document.getElementById("metaDataFile")) {
        document.getElementById("metaDataFile").value = ""
      }
      this.formInline.wbsData = "请选择WBS数据";
      document.getElementById("wbsDataFile").value = "";
      if (document.getElementById("wbsDataFile")) {
        document.getElementById("wbsDataFile").value = "";
      }
    },
    //获取上传文件数量
    async getFileLength() {
@@ -2622,6 +2785,8 @@
        if (fs2.files.length == 0) {
          return this.$message.error("请选择需要上传的WBS数据文件");
        }
      } else if (this.formInline.uploadType == "v3") {
      }
      for (var i = 0, c = fs1.files.length; i < c; i++) {
        formData.append(fs1.files[i].name, fs1.files[i]);
@@ -3007,6 +3172,8 @@
      this.formInline.entryId = null;
      this.formInline.selectFileType = "*.*";
      this.formInline.coordinateId = this.coordinateOption[0].epsgcode;
      this.formInline.medium = "";
      this.formInline.tab = "";
    },
    //选择数据
    setSelectFile() {
@@ -3027,8 +3194,16 @@
        this.formInline.dirid = this.entryOption[0].id;
        this.getselectVerByDirid();
        this.pathBak = this.entryOption[0].checks;
      } else if (res == "v3") {
        this.formInline.selectFileType = ".kml";
        this.getSelectdirTab();
        this.getselectVerByDirid();
        this.formInline.specialtyId = "线路专业";
        this.uploadFlag = true;
        this.formInline.tab = this.lineOptions[0].value;
        this.formInline.medium = this.mediumOptions[0].value
      } else {
        this.getStartDirChecked(this.catalogOption);
        this.getSelectdirTab();
        this.getselectVerByDirid();
        this.uploadFlag = true;
      }