管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-09-21 c2a6c53657baaf0830cd881e1a23a15af23ac6fa
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')}`,
@@ -56,7 +57,10 @@
                  :label="$t('shuJuGuanLi.pselect.dFiles')"
                  value="v2"
                />
                <el-option
                  :label="$t('shuJuGuanLi.pselect.dFfilest')"
                  value="v3"
                />
              </el-select>
            </el-form-item>
@@ -68,6 +72,7 @@
              size="small"
            >
              <el-select
                ref="multiSelect"
                :popper-append-to-body="false"
                v-model="formInline.dirName"
                :disabled="tableData.length == 0 ? false : true"
@@ -202,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
@@ -241,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
@@ -271,6 +316,7 @@
                </el-form-item>
                <el-form-item
                  v-show="uploadFlag"
                  v-if="formInline.uploadType =='v1'"
                  size="small"
                >
                  <el-input
@@ -608,6 +654,14 @@
            />
            <el-table-column
              align="center"
              :label="$t('common.dataStatus')"
              :formatter="stateFormat"
            >
            </el-table-column>
            <el-table-column
              align="
                  center"
              prop="desc"
              :label="$t('dataManage.dataUpObj.describe')"
            />
@@ -632,7 +686,7 @@
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="listData.pageIndex"
              :page-sizes="[10, 20, 50, 100]"
              :page-sizes="[10, 50, 100, 200,500]"
              :page-size="listData.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="count"
@@ -1008,7 +1062,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)"
@@ -1026,7 +1083,10 @@
          </div>
        </div>
        <div class="transFarBox subpage_Div">
        <div
          class="transFarBox subpage_Div"
          style="border: 1px solid #E4E7ED;"
        >
          <ul>
            <li
              @click="singleElection2(item)"
@@ -1050,7 +1110,10 @@
            </div>
          </div>
        </div>
        <div class="transFarBox subpage_Div">
        <div
          class="transFarBox subpage_Div"
          style="border: 1px solid #E4E7ED;"
        >
          <ul>
            <li
              @click="singleElection3(i)"
@@ -1117,7 +1180,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"
@@ -1279,7 +1342,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"
@@ -1370,6 +1433,44 @@
      </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
      name="file1"
      :accept="'.zip'"
@@ -1379,6 +1480,37 @@
      style="display: none"
      @change="uploadAnFilesChange"
    />
    <el-dialog :visible.sync="noteVisible">
      <div class="nodeBox">
        <div style="text-align: center;">
          <h1>
            数据上传注意事项
          </h1>
        </div>
        <h3>
          1、项目整体上传
        </h3>
        <h5>&nbsp; &nbsp; &nbsp; &nbsp;按照项目标准结构组织数据并打zip包,按要求编辑好WBS文件。选择需要上传对应的项目名称,选择zip数据包和WBS文件,完成整体项目数据上传,上传入库完成后,系统自动解压zip包,以zip包内原始文件格式存储在预先组织的目录结构下。</h5>
        <h3>
          2、单文件上传
        </h3>
        <h5>&nbsp; &nbsp; &nbsp; &nbsp;上传单个文件,选择需要上传的存储目录位置、数据版本、数据专业、数据(.xls、.xlsx、pdf、las等格式)、元数据等,完成单个文件数据上传;</h5>
        <h5>&nbsp; &nbsp; &nbsp; &nbsp;批量上传一个最小目录文件夹下的各类数据,选择需要上传数据的存储目录位置、数据版本、数据专业、数据(zip格式)、元数据等,完成一个文件夹下各类数据上传,上传入库完成后,系统自动解压zip包,以zip包内原始文件存储数据。</h5>
        <h5>&nbsp; &nbsp; &nbsp; &nbsp;单文件上传不支持多级目录文件夹以zip压缩包方式上传。</h5>
        <h3>
          3、特定格式单文件上传要求
        </h3>
        <h5>√&nbsp; &nbsp;<span>DOM数据上传:</span>至少需包含.tif、.tif.ovr文件,以zip包压缩统一上传。</h5>
        <h5>√&nbsp; &nbsp;<span>DEM数据上传:</span>至少需包含.tif、.tif.ovr文件,以zip包压缩统一上传。</h5>
        <h5>√&nbsp; &nbsp;<span>OSGB倾斜模型数据上传:</span>需包含Data文件夹、metadata.xml文件,以zip包压缩统一上传。</h5>
        <h5>√&nbsp; &nbsp;<span>Las、Laz点云数据上传:</span>可单独上传文件,也可以zip包压缩统一上传。</h5>
        <h5>√&nbsp; &nbsp;<span>CPT点云数据上传:</span>可单独上传文件,也可以zip包压缩统一上传。</h5>
        <h5>√&nbsp; &nbsp;<span>MPT场景数据上传:</span>需包含.mIdx、.Strmi、.mpt文件,以zip包压缩统一上传。</h5>
        <h5>√&nbsp; &nbsp;<span>GDB格式矢量文件上传:</span>需包含gdb各类子文件,以zip包压缩统一上传。</h5>
        <h5>√&nbsp; &nbsp;<span>SHP矢量文件上传:</span>需包含.shp、.shx、.dbf、prj子文件,以zip包压缩统一上传。</h5>
      </div>
    </el-dialog>
  </div>
</template>
@@ -1405,6 +1537,7 @@
  dataUploadSelectVerByDirid,
  dataUpload_selectMetaById,
  selectdirTab,
  dataUpload_insertKml
} from "../../api/api";
export default {
@@ -1521,6 +1654,8 @@
        coordinateId: null,
        path: null,
        verid: null,
        tab: "",
        medium: "",
      },
      cascader: {
        label: "name",
@@ -1546,6 +1681,67 @@
          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: [],
      pathBak: null,
      progress: 0,
@@ -1563,6 +1759,7 @@
      wareTableFlag: null,
      insertWareList: null,
      loading: false,
      loadText: '',
      dbTableData: [],
      dialogVisible: false,
      listLoader: {
@@ -1613,12 +1810,15 @@
      sc: {
        label1: '上传',
        label2: '文件上传进度:'
      }
      },
      warehouseDialog: false,
      wareData: [],
      noteVisible: false,
    };
  },
  mounted() {
    this.noteVisible = true;
    //获取坐标系
    this.setCoordinateSystem();
    //获取项目名称
@@ -1638,6 +1838,16 @@
  },
  watch: {},
  methods: {
    stateFormat(row, column) {
      var val = ['shp', 'gdb', 'xls', 'xlsx']
      if (val.indexOf(row.type) > -1 && row.rows > 0) {
        return '已上传,已入库'
      } else if (val.indexOf(row.type) > -1 && row.rows == 0) {
        return '已上传,未入库'
      } else {
        return '已上传'
      }
    },
    setRestMetaData() {
      this.fromQueryMeta.name = "";
      this.listMetaData.name = this.fromQueryMeta.name;
@@ -1964,6 +2174,9 @@
    },
    //自动匹配确认
    async setInsrtWareTable() {
      this.loading = true;
      this.dialogWarehousing = false;
      this.loadText = "数据入库中,请等待..."
      if (this.tableWareThree.length != 0) {
        for (var i in this.tableWareThree) {
          var tabs = this.tableWareThree[i].tabs;
@@ -1982,20 +2195,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() {
@@ -2005,7 +2230,8 @@
      for (var i = 0; i < val1.length; i++) {
        const stdTab = this.setSplitWare(val1[i].tab);
        for (var j = 0; j < val2.length; j++) {
          if (val2[j].tab == stdTab) {
          var tabs = stdTab.toLowerCase();
          if (val2[j].tab.indexOf(tabs) > -1) {
            std.push(val1[i].tab);
            val1[i].entity = val2[j].entity;
            val1[i].tabDesc = val2[j].tabDesc;
@@ -2095,69 +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("数据映射失败");
      }
      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();
        }
      }
    },
    //下载日志
@@ -2455,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() {
@@ -2501,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]);
@@ -2810,11 +3096,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();
    },
    //获取数据上传列表清单
@@ -2884,6 +3172,8 @@
      this.formInline.entryId = null;
      this.formInline.selectFileType = "*.*";
      this.formInline.coordinateId = this.coordinateOption[0].epsgcode;
      this.formInline.medium = "";
      this.formInline.tab = "";
    },
    //选择数据
    setSelectFile() {
@@ -2904,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;
      }
@@ -3004,11 +3302,16 @@
      this.formInline.dirid = node.data.id;
      this.formInline.dirName = node.data.name;
      this.getselectVerByDirid();
      setTimeout(() => {
        this.$refs.multiSelect.blur()
      }, 100)
    },
    //Tabsq切换
    handleTabClick(tab, event) {
      if (tab.name == "second") {
        this.setStartWareTable();
      } else {
        this.noteVisible = true
      }
      this.calHeight();
    },
@@ -3053,7 +3356,23 @@
    z-index: 9999;
  }
}
.nodeBox {
  h5 {
    line-height: 26px;
    font-size: 14px;
    span {
      font-weight: bolder;
    }
  }
  h3 {
    line-height: 40px;
    font-size: 16px;
    font-weight: bold;
  }
  h1 {
    font-weight: bold;
  }
}
.inquire {
  padding: 8px;
  //margin-top: 20px;