管道基础大数据平台系统开发-【前端】-新系統界面
liupengpeng
2023-02-15 449e7237c6a575fdfd8393187f2ffcaffb000801
src/views/datamanage/dataUpdata.vue
@@ -25,11 +25,12 @@
            class="demo-form-inline"
          >
            <!-- 入库类型 -->
            <el-form-item :label="$t('dataManage.dataUpObj.UploadType')">
            <el-form-item :label="$t('dataManage.dataUpObj.UploadType')" style="margin-right: 2%">
              <el-select
                :disabled="tableData.length == 0 ? false : true"
                v-model="formInline.uploadType"
                @change="uploadTypeChange"
                :popper-append-to-body="false"
                placeholder="请选择"
              >
                <el-option
@@ -42,24 +43,46 @@
            </el-form-item>
            <!-- 存储目录 -->
            <el-form-item
            style="margin-right: 2%"
              v-show="uploadFlag"
              :label="$t('dataManage.dataUpObj.storageDirectory')"
            >
              <el-cascader
              <el-select
                :popper-append-to-body="false"
                v-model="formInline.dirName"
                :disabled="tableData.length == 0 ? false : true"
              >
                <el-option
                  :value="formInline.dirid"
                  :label="formInline.dirName"
                  style=" height:auto"
                >
                  <el-tree
                    ref="tree"
                    :data="catalogOption"
                    node-key="id"
                    :props="cascader"
                    @node-click="catalogChange"
                  />
                </el-option>
              </el-select>
              <!-- <el-cascader
                :disabled="tableData.length == 0 ? false : true"
                v-model="formInline.dirid"
                :options="catalogOption"
                @change="catalogChange"
                ref="selectcascader"
                :props="cascader"
              ></el-cascader>
              ></el-cascader>  -->
            </el-form-item>
            <!-- 项目名称 -->
            <el-form-item
            style="margin-right: 2%"
              v-show="!uploadFlag"
              :label="$t('dataManage.dataUpObj.entryName')"
            >
              <el-select
                :popper-append-to-body="false"
                :disabled="tableData.length == 0 ? false : true"
                v-model="formInline.entryId"
                @change="entryNameChange"
@@ -74,8 +97,9 @@
              </el-select>
            </el-form-item>
            <!-- 数据版本 -->
            <el-form-item :label="$t('dataManage.dataUpObj.dataVersion')">
            <el-form-item :label="$t('dataManage.dataUpObj.dataVersion')" style="margin-right: 2%">
              <el-select
                :popper-append-to-body="false"
                :disabled="tableData.length == 0 ? false : true"
                v-model="formInline.verid"
                :placeholder="$t('common.choose')"
@@ -90,8 +114,9 @@
              </el-select>
            </el-form-item>
            <!-- 数据专业 -->
            <el-form-item :label="$t('dataManage.dataUpObj.dataSpecialty')">
            <el-form-item :label="$t('dataManage.dataUpObj.dataSpecialty')" style="margin-right: 2%">
              <el-select
                :popper-append-to-body="false"
                :disabled="tableData.length == 0 ? false : true"
                v-model="formInline.specialtyId"
                :placeholder="$t('common.choose')"
@@ -106,8 +131,9 @@
              </el-select>
            </el-form-item>
            <!-- 坐标系 -->
            <el-form-item :label="$t('dataManage.dataUpObj.coordinateSystem')">
            <el-form-item :label="$t('dataManage.dataUpObj.coordinateSystem')" style="margin-right: 3%">
              <el-select
                :popper-append-to-body="false"
                :disabled="tableData.length == 0 ? false : true"
                v-model="formInline.coordinateId"
                :placeholder="$t('common.choose')"
@@ -151,7 +177,7 @@
              <el-input
                placeholder="请输入内容"
                v-model="formInline.specialtyData"
                style="width:350px;"
                style="width:210px;"
                disabled
              >
              </el-input>
@@ -181,11 +207,11 @@
                @change="handleMetaFileChange"
              ></input>
            </el-form-item>
            <el-form-item v-show="uploadFlag">
            <el-form-item v-show="uploadFlag" style="margin-left: 0.7%;">
              <el-input
                placeholder="请输入内容"
                v-model="formInline.metaData"
                style="width:350px;"
                style="width:210px;"
                disabled
              >
              </el-input>
@@ -220,12 +246,12 @@
              <el-input
                placeholder="请选择WBS数据"
                v-model="formInline.wbsData"
                style="width:350px;"
                style="width:210px;"
                disabled
              >
              </el-input>
            </el-form-item>
            <el-form-item>
            <el-form-item style="float: right;">
              <!-- 上传 -->
              <el-button
                v-if="menuStatus.upload"
@@ -246,16 +272,6 @@
                @click="setFileDelete"
                type="danger"
              >{{ $t('common.delete') }}</el-button>
              <!-- 质检 -->
              <el-button
                v-if="menuStatus.insert"
                :disabled="multipleSelection.length == 0 ? true : false"
                type="info"
                size="small"
                icon="el-icon-folder-checked"
                @click="handleQuayTestClick()"
              >{{$t('common.quayTest')}}
              </el-button>
              <!-- 入库 -->
              <el-button
                v-if="menuStatus.insert"
@@ -265,6 +281,17 @@
                icon="el-icon-folder-add"
                type="warning"
              >{{ $t('common.Warehousin') }}</el-button>
              <!-- 质检 -->
              <el-button
              style="margin-right:-9px"
                v-if="menuStatus.insert"
                :disabled="multipleSelection.length == 0 ? true : false"
                type="info"
                size="small"
                icon="el-icon-folder-checked"
                @click="handleQuayTestClick()"
              >{{$t('common.quayTest')}}
              </el-button>
            </el-form-item>
          </el-form>
@@ -273,6 +300,7 @@
        <!-- 上传数据列表 -->
        <div class="subpage_Content subpage_Div">
          <el-table
            style="min-height: 450px;"
            :data="tableData"
            @selection-change="handleSelectionChange"
          >
@@ -339,13 +367,14 @@
            :model="formWarehousing"
            class="demo-form-inline"
          >
            <el-form-item :label="$t('dataManage.dataUpObj.describe')">
            <el-form-item :label="$t('dataManage.dataUpObj.describe')" >
              <el-input
                v-model="formWarehousing.name"
                placeholder="请输入内容"
                style="width: 200px;"
              ></el-input>
            </el-form-item>
            <el-form-item>
            <el-form-item style="float: right;">
              <el-button
                @click="setWarehouseSearch"
                icon="el-icon-upload"
@@ -368,21 +397,29 @@
                size="small"
              >{{ $t('common.delete') }}</el-button>
            </el-form-item>
            <el-form-item style="float: right;">
              <el-button
                v-if="menuStatus.upload"
                :disabled="multipleDelete.length == 0 ? true : false"
                @click="setEnclosure"
                icon="el-icon-folder-opened"
                type="success"
                size="small"
              >{{ $t('common.enclosure') }}</el-button>
            </el-form-item>
          </el-form>
        </div>
        <div
          class="subpage_Content subpage_Div"
          style="min-height:330px"
          style="min-height:480px"
        >
          <div class="contentTable">
            <el-table
              ref="multipleTable"
              :data="waretableData"
              tooltip-effect="dark"
              style="width: 100%"
              @selection-change="handleDelteChange"
            >
              <el-table-column
        <div style="height: 450px">
          <el-table
            ref="filterTable"
            :data="waretableData"
            style="width: 100%"
            height="99%">
            <el-table-column
                type="selection"
                width="55"
              >
@@ -432,7 +469,10 @@
                :label="$t('dataManage.dataUpObj.tableName')"
              >
                <template slot-scope="scope">
                  <a @click="detail(scope.row)">{{ scope.row.tab }}</a>
                  <a
                    class="scopeRowColor"
                    @click="detail(scope.row)"
                  >{{ scope.row.tab }}</a>
                </template>
              </el-table-column>
              <el-table-column
@@ -457,20 +497,20 @@
                :formatter="changetimeFile"
                width="100"
              />
            </el-table>
          </div>
          <div>
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="listData.pageIndex"
              :page-sizes="[10, 20, 30, 40]"
              :page-size="listData.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="count"
            >
            </el-pagination>
          </div>
      </el-table>
      <div class="pagination_box">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="count"
        >
        </el-pagination>
      </div>
    </div>
        </div>
      </el-tab-pane>
    </el-tabs>
@@ -936,7 +976,7 @@
            @size-change="handleLoaderSizeChange"
            @current-change="handleLoaderCurrentChange"
            :current-page="listLoader.pageIndex"
            :page-sizes="[10, 20, 30, 40]"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="listLoader.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="count1"
@@ -946,6 +986,54 @@
      </div>
    </el-dialog>
    <el-dialog
      :close-on-click-modal="false"
      title="上传进度"
      :visible.sync="jindudialogVisible"
      width="30%"
    >
      <div>
        <div>
          文件传输进度:
        </div>
        <div>
          <el-progress
            :percentage="jindutiao"
            :format="format"
          ></el-progress>
        </div>
      </div>
    </el-dialog>
    <el-dialog
      :title="$t('common.details')"
      :visible.sync="enclosureVisible"
      :show-close="false"
    >
      <span
        style="font-size:20px"
        class="scopeRowColor"
      >{{enclosureTitle}}不能上传附件是否继续</span>
      <span
        slot="footer"
        class="dialog-footer"
      >
        <el-button @click="enclosureVisible = false">取 消</el-button>
        <el-button
          type="primary"
          @click="uploadAnFiles"
        >继续</el-button>
      </span>
    </el-dialog>
    <input
      name="file1"
      :accept="'.zip'"
      type="file"
      id="editimageFile"
      multiple="multiple"
      style="display: none"
      @change="uploadAnFilesChange"
    />
  </div>
</template>
@@ -978,6 +1066,7 @@
  },
  data() {
    return {
      coordinateOption: [],
      disOptions: [{
        name: '崩塌治理',
@@ -1129,6 +1218,12 @@
        download: false,
      },
      jindutiao: 0,
      jindudialogVisible: false,
      jindutiaoname: [],
      enclosureData: [],
      enclosureVisible: false,
      enclosureTitle: '',
    }
  },
@@ -1148,6 +1243,109 @@
  },
  methods: {
    //附件变化
    uploadAnFilesChange() {
      var formData = new FormData();
      var fs = document.getElementById("editimageFile");
      if (fs.files.length == 0) {
        this.$message.error('请选择要上传的文件');
        return;
      }
      for (var i = 0, c = fs.files.length; i < c; i++) {
        formData.append("file", fs.files[i]); // fs.files[i].name,file
      }
      for (var i in this.enclosureData) {
        formData.append('ids', this.enclosureData[i])
      }
    const that = this
      that.jindudialogVisible = true
      that.$set(this, 'jindutiaoname', "附件上传")
      that.$set(this, 'jindutiao', 0)
      this.loading = true;
      $.ajax(BASE_URL + "/dataUpload/uploadXlsAnnex?token=" + getToken() + "&path=" + this.formInline.path, {
        type: "post",
        data: formData,
        async: true,
        cache: false,
        processData: false,
        contentType: false,
        success: (rs) => {
          this.loading = false;
          if (rs.code != 200) {
            return this.$message.error('附件上传失败');
          }
          this.$set(this, 'jindutiao', 100)
          this.$message({
            message: '附件上传成功',
            type: 'success'
          });
        },
        error: (rs) => {
          this.loading = false;
          this.$message.error('附件上传失败');
        },
        xhr: function () {
          var myXhr = $.ajaxSettings.xhr();
          if (myXhr.upload) { //检查upload属性是否存在
            myXhr.upload.addEventListener('progress', that.progressHandlingFunction, false); //绑定progress事件的回调函数
          }
          return myXhr; //xhr对象返回给jQuery使用
        }
      });
    },
    //选择上传附件的文件
    uploadAnFiles() {
      $('#editimageFile').click();
    },
    //上传附件
    uploadAnnex() {
    },
    //附件上传
    setEnclosure() {
      var enclosureData = [
        'bd.b_pac_hydrogeology',
        'bd.b_pac_frozensoil',
        'bd.b_pac_geologic_hazard',
        'bd.b_pac_marine_meteorological',
        'bd.b_pac_meteorological',
        'bs.m_equipment_nameplate',
        'bs.m_hydraulic_protection',
        'bs.m_marker',
        'bs.s_borehole'
      ];
      var std = [];
      this.enclosureData = [];
      this.enclosureTitle = "";
      for (var i in this.multipleDelete) {
        var row = this.multipleDelete[i];
        if (row.tab && row.rows && enclosureData.indexOf(row.tab) > -1) {
          this.enclosureData.push(row.id)
        } else {
          std.push(row.name)
        }
      }
      if (std.length != 0) {
        this.enclosureTitle = std.toString()
        this.enclosureVisible = true;
      } else {
        this.uploadAnFiles();
      }
    },
    //权限配置
    showPermsMenu(res) {
      switch (res.tag) {
@@ -1753,6 +1951,16 @@
          }
        }
      }
      const that = this
      that.jindudialogVisible = true
      let listval = []
      formData.forEach((key, val) => {
        listval.push({
          name: val
        })
      })
      that.$set(this, 'jindutiaoname', listval)
      that.$set(this, 'jindutiao', 0)
      this.loading = true;
      $.ajax(BASE_URL + "/dataUpload/uploadFiles?token=" + token + "&path=" + this.formInline.path, {
        type: "post",
@@ -1767,6 +1975,7 @@
            return this.$message.error('数据上传失败');
          }
          this.getFileLength();
          this.$set(this, 'jindutiao', 100)
          this.$message({
            message: '上传成功',
            type: 'success'
@@ -1776,8 +1985,26 @@
        error: (rs) => {
          this.loading = false;
          this.$message.error('数据上传失败');
        },
        xhr: function () {
          var myXhr = $.ajaxSettings.xhr();
          if (myXhr.upload) { //检查upload属性是否存在
            myXhr.upload.addEventListener('progress', that.progressHandlingFunction, false); //绑定progress事件的回调函数
          }
          return myXhr; //xhr对象返回给jQuery使用
        }
      });
    },
    progressHandlingFunction(event) {
      var loaded = event.loaded;//已上传
      var loaded = Math.floor(100 * (event.loaded / event.total) - 1); //计算已经上传的百分比
      $("#prog").html(loaded + "%"); //应用到显示UI,可根据自己需要修改
      this.jindutiao = loaded
      this.$set(this, 'jindutiao', loaded)
    },
    format(percentage) {
      return percentage === 100 ? '上传完毕' : `${percentage}%`;
    },
    //获取文件上传路径
    async getFilePath() {
@@ -1809,6 +2036,7 @@
      this.entryOption = data.result;
      this.formInline.entryId = this.entryOption[0].name;
      this.formInline.dirid = this.entryOption[0].id;
      this.getselectVerByDirid();
    },
    //获取所有坐标系
@@ -2117,6 +2345,7 @@
        return;
      }
      this.catalogOption = this.treeData(res.result);
      this.formInline.dirName = this.catalogOption[0].name
      this.getStartDirChecked(this.catalogOption);
      this.getselectVerByDirid()
    },
@@ -2161,12 +2390,12 @@
        }
    },
    //目录切换
    catalogChange(res) {
    catalogChange(data, node, nodeData) {
      this.startQuayTestForms();
      this.$refs['selectcascader'].dropDownVisible = false
      var value = this.$refs['selectcascader'].getCheckedNodes();
      // this.$refs['selectcascader'].dropDownVisible = false
      // var value = this.$refs['selectcascader'].getCheckedNodes();
      var bak = value[0].data.bak;
      var bak = node.data.bak;
      this.pathBak = bak;
      if (bak != null) {
        for (var key in this.quayTestShow) {
@@ -2175,12 +2404,13 @@
          }
        }
      }
      var fileType = value[0].data.code;
      var fileType = node.data.code;
      if (fileType == null) {
        fileType = "*.*"
      }
      this.formInline.selectFileType = fileType;
      this.formInline.dirid = res;
      this.formInline.dirid = node.data.id;
      this.formInline.dirName = node.data.name
      this.getselectVerByDirid();
    },
    //Tabsq切换
@@ -2201,4 +2431,4 @@
    },
  }
};
</script>
</script>