管道基础大数据平台系统开发-【前端】-新系統界面
src/views/datamanage/dataLoader.vue
@@ -137,6 +137,11 @@
              type="info"
              >{{ $t('common.reset') }}</el-button
            >
              <el-button @click="setWarehouseDel"
              icon="el-icon-folder-delete"
              type="danger"
              >{{ $t('common.delete') }}</el-button
            >
          </el-form-item>
        </el-form>
      </div>
@@ -146,7 +151,12 @@
        style="width:99%"
        height="92%"
         @selection-change="handleDelteChange"
 >
   <el-table-column
      type="selection"
      width="55">
    </el-table-column>
        <el-table-column
          align="center"
          type="index"
@@ -297,10 +307,11 @@
  dataLoader_selectVerByDirid,
  dataLoader_selectFiles,
  dataUploadDeleteFiles,
  dataUploadInsertFiles,
  dataLoader_InsertFiles,
  dataLoader_selectMappers,
  dataLoader_SelectTabs,
  dataLoader_selectByPageForUpload
  dataLoader_selectByPageForUpload,
dataLoader_deleteMetas
} from '../../api/api';
export default {
  name: 'dataUpdata',
@@ -357,6 +368,7 @@
      activeName2: '',
      activeName3: '',
      wareTableFlag: null,
      multipleDelete:[],
    };
  },
@@ -435,6 +447,27 @@
            }
            this.getAllWareTable();
    },
   async setWarehouseDel(){
var std = [];
          for (var i in this.multipleDelete) {
            std.push(this.multipleDelete[i].id);
          }
          const res = await dataLoader_deleteMetas({ids: std.toString() })
          if(res.code != 200){
            this.$message.error('删除失败');
          }else{
               this.$message({
          message: '删除成功',
          type: 'success'
        });
        this.listData.pageIndex=1;
        this.listData.pageSize = 10;
           this.getAllWareTable();
          }
    },
    handleDelteChange(val){
    this.multipleDelete = val;
    },
    setWarehouseReset(){
     this.formWarehousing.name='';
   this.listData={
@@ -486,10 +519,11 @@
   async setInsrtWareTable(){
      var obj = {
                  metaEntity: this.formInline,
                  fileEntities: this.tableWareThree
                      fileEntities: this.tableData,
                  tabEntities: this.tableWareThree
                };
            const res = await dataLoader_InsertFiles(JSON.stringify(obj));
            const res = await dataUploadInsertFiles(JSON.stringify(obj));
             if (res.code != 200) {
        this.$message.error('数据入库失败');
        return;
@@ -558,28 +592,34 @@
      var value1 = this.tableWareThree[res];
      value1.entity = null;
        value1.tabDesc= null;
      this.tableWareOne.push(value1);
        if(this.tableWareOne.indexOf(value1)!=-1 ){
        }else{
            this.tableWareOne.push(value1);
      this.tableWareThree.splice(res, 1)
      this.activeName = '';
      this.activeName2 = '';
      this.activeName3 = '';
        }
    },
    setWareTableChangeRight() {
      this.wareSelectOne.entity = this.wareSelectTwo.entity;
          this.wareSelectOne.tabDesc = this.wareSelectTwo.tabDesc;
  if(this.tableWareThree.indexOf(this.wareSelectOne) != -1){
      this.tableWareThree.push(this.wareSelectOne)
  }else{
 this.tableWareThree.push(this.wareSelectOne)
      this.tableWareOne.forEach((value, index, array) => {
        if (value.tab == this.wareSelectOne.tab) {
          this.tableWareOne.splice(index, 1)
        }
      })
   this.activeName = '';
      this.activeName2 = '';
      this.activeName3 = '';
  }
    },
    singleElection(row) {
      this.wareSelectOne = row;
@@ -650,7 +690,7 @@
      //             fileEntities: this.multipleSelection
      //           };
      //       const res = await dataUploadInsertFiles(JSON.stringify(obj));
      //       const res = await dataLoader_InsertFiles(JSON.stringify(obj));
      //        if (res.code != 200) {
      //       this.$message.error('文件入库失败');
@@ -698,11 +738,14 @@
          this.getFileLength();
          alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
           this.$message({
          message: '数据上传成功',
          type: 'success'
        });
        },
        error: (rs) => {
          alert("上传文件失败!");
          this.$message.error('数据上传失败');
        }
      });