feat(数据集): 添加表搜索fix;上传excel增加进度条

This commit is contained in:
junjie 2021-04-30 16:18:18 +08:00
parent 54d775de0b
commit 9c09d8f8fc
3 changed files with 18 additions and 4 deletions

View File

@ -797,7 +797,8 @@ export default {
preview_total: '共',
pls_input_less_9: '请输入9位以内的正整数',
field_edit: '编辑字段',
table_already_add_to: '该表已添加至'
table_already_add_to: '该表已添加至',
uploading: '上传中...'
},
datasource: {
datasource: '数据源',

View File

@ -90,7 +90,7 @@ export default {
},
searchTable(val) {
if (val && val !== '') {
this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.includes(val) })))
this.tableData = JSON.parse(JSON.stringify(this.tables.filter(ele => { return ele.name.includes(val) })))
} else {
this.tableData = JSON.parse(JSON.stringify(this.tables))
}

View File

@ -29,11 +29,16 @@
:show-file-list="false"
:file-list="fileList"
accept=".xls,.xlsx,.csv"
:before-upload="beforeUpload"
:on-success="uploadSuccess"
:on-error="uploadFail"
name="file"
:headers="headers"
>
<el-button size="mini" type="primary">{{ $t('dataset.upload_file') }}</el-button>
<el-button size="mini" type="primary" :disabled="uploading">
<span v-if="!uploading" style="font-size: 12px;">{{ $t('dataset.upload_file') }}</span>
<span v-if="uploading" style="font-size: 12px;"><i class="el-icon-loading" /> {{ $t('dataset.uploading') }}</span>
</el-button>
</el-upload>
</el-form-item>
</el-form>
@ -96,7 +101,8 @@ export default {
fileList: [],
headers: { Authorization: token },
baseUrl: process.env.VUE_APP_BASE_API,
path: ''
path: '',
uploading: false
}
},
watch: {
@ -121,6 +127,12 @@ export default {
that.height = currentHeight - 56 - 30 - 26 - 25 - 35 - 10 - 37 - 20 - 10
}, 10)
},
beforeUpload(file) {
this.uploading = true
},
uploadFail(response, file, fileList) {
this.uploading = false
},
uploadSuccess(response, file, fileList) {
// console.log(response)
// console.log(file)
@ -135,6 +147,7 @@ export default {
this.name = file.name.substring(0, file.name.lastIndexOf('.'))
}
this.fileList = fileList
this.uploading = false
},
save() {