value
2024-05-23 4e3b0ffb433f6e331cd2eae93bcd874d41b8de84
src/components/tool/value-table.vue
@@ -95,6 +95,12 @@
    align-items: center;
    justify-content: center;
  }
  .el-table__empty-text{
    text-align: left;
    width: 100%;
    display: inline-block;
    margin-left: 200px;
  }
</style>
<template>
@@ -303,7 +309,7 @@
    <el-dialog title="数据导入" :visible.sync="uploadDia" width="500px">
      <div style="margin: 0 auto;">
        <el-upload ref="upload" drag :action="javaApi + inputUrl" :headers="token" :file-list="fileList" name="file"
          :auto-upload="false" accept=".csv" :limit="1" :on-change="beforeUpload" :on-success="onSuccess"
          :auto-upload="false" :accept="data.accept===undefined?'.csv':data.accept" :limit="1" :on-change="beforeUpload" :on-success="onSuccess"
          :on-error="onError" :data="{param: data.uploadStr}">
          <i class="el-icon-upload"></i>
          <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
@@ -558,14 +564,17 @@
      },
      sizeChange(val) {
        this.page.size = val
        this.selectList()
        this.selectList('page')
      },
      currentChange(val) {
        this.page.current = val
        this.selectList()
        this.selectList('page')
      },
      selectList() {
      selectList(val) {
        this.loading = true
        if(val===undefined){
          this.page.current = 1;
        }
        if (this.data.isPage != undefined && this.data.isPage != true) {
          this.page = {
            current: -1,
@@ -587,6 +596,7 @@
          this.total = res.data.body.total
          this.tableHead = res.data.head
          this.tableData = res.data.body.records
          // console.log(JSON.stringify(this.tableHead)+"---------"+JSON.stringify(this.tableData))
          for (var a in this.data.selectField) {
            if (this.data.selectField[a].choose == true) {
              this.tableData.map(b => {
@@ -954,7 +964,8 @@
        this.uploadDia = true
      },
      beforeUpload(file, fileList) {
        if (file.raw.type != 'text/csv') {
        console.log(file.raw.type);
        if (file.raw.type != (this.data.inputType===undefined?'text/csv':this.data.inputType)) {
          this.$message.error('上传文件格式不正确');
          this.$refs.upload.clearFiles()
          return false;