管道基础大数据平台系统开发-【前端】-新系統界面
liupengpeng
2023-02-14 f25f3604f80ecb2fae3e2ef1fb95394cac4660f9
src/views/datamanage/dataUpdata.vue
@@ -25,7 +25,7 @@
            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"
@@ -43,6 +43,7 @@
            </el-form-item>
            <!-- 存储目录 -->
            <el-form-item
            style="margin-right: 2%"
              v-show="uploadFlag"
              :label="$t('dataManage.dataUpObj.storageDirectory')"
            >
@@ -76,6 +77,7 @@
            </el-form-item>
            <!-- 项目名称 -->
            <el-form-item
            style="margin-right: 2%"
              v-show="!uploadFlag"
              :label="$t('dataManage.dataUpObj.entryName')"
            >
@@ -95,7 +97,7 @@
              </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"
@@ -112,10 +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')"
@@ -130,7 +131,7 @@
              </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"
@@ -176,7 +177,7 @@
              <el-input
                placeholder="请输入内容"
                v-model="formInline.specialtyData"
                style="width:350px;"
                style="width:210px;"
                disabled
              >
              </el-input>
@@ -206,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>
@@ -245,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"
@@ -271,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"
@@ -290,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>
@@ -298,6 +300,7 @@
        <!-- 上传数据列表 -->
        <div class="subpage_Content subpage_Div">
          <el-table
            style="min-height: 450px;"
            :data="tableData"
            @selection-change="handleSelectionChange"
          >
@@ -393,6 +396,16 @@
                size="small"
              >{{ $t('common.delete') }}</el-button>
            </el-form-item>
            <el-form-item>
              <el-button
                v-if="menuStatus.upload"
                :disabled="multipleDelete.length == 0 ? true : false"
                @click="setEnclosure"
                icon="el-icon-folder-opened"
                type="warning"
                size="small"
              >{{ $t('common.enclosure') }}</el-button>
            </el-form-item>
          </el-form>
        </div>
        <div
@@ -457,7 +470,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
@@ -489,7 +505,7 @@
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="listData.pageIndex"
              :page-sizes="[10, 20, 30, 40]"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="listData.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="count"
@@ -961,7 +977,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"
@@ -990,6 +1006,35 @@
      </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>
@@ -1022,6 +1067,7 @@
  },
  data() {
    return {
      coordinateOption: [],
      disOptions: [{
        name: '崩塌治理',
@@ -1175,7 +1221,10 @@
      },
      jindutiao: 0,
      jindudialogVisible: false,
      jindutiaoname: []
      jindutiaoname: [],
      enclosureData: [],
      enclosureVisible: false,
      enclosureTitle: '',
    }
  },
@@ -1195,6 +1244,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) {
@@ -1837,6 +1989,7 @@
        },
        xhr: function () {
          var myXhr = $.ajaxSettings.xhr();
          if (myXhr.upload) { //检查upload属性是否存在
            myXhr.upload.addEventListener('progress', that.progressHandlingFunction, false); //绑定progress事件的回调函数
          }
@@ -1884,6 +2037,7 @@
      this.entryOption = data.result;
      this.formInline.entryId = this.entryOption[0].name;
      this.formInline.dirid = this.entryOption[0].id;
      this.getselectVerByDirid();
    },
    //获取所有坐标系
@@ -2192,6 +2346,7 @@
        return;
      }
      this.catalogOption = this.treeData(res.result);
      this.formInline.dirName = this.catalogOption[0].name
      this.getStartDirChecked(this.catalogOption);
      this.getselectVerByDirid()
    },
@@ -2277,5 +2432,4 @@
    },
  }
};
</script>
</script>