feat: 支持excel多sheet页

This commit is contained in:
taojinlong 2021-08-13 11:23:27 +08:00
parent 6c85851f88
commit 4632545091
4 changed files with 25 additions and 7 deletions

View File

@ -1007,7 +1007,11 @@ export default {
edit_calc_field: 'Edit calc field',
calc_field: 'Calc Field',
show_sql: 'Show SQL',
ple_select_excel: 'Please select excel file to import'
ple_select_excel: 'Please select excel file to import',
merge: 'Merge',
no_merge: 'Dont Merge',
merge_msg: 'If the fields in the data table are consistent, merge them into one data set?',
merge_title: 'Merge data'
},
datasource: {
datasource: 'Data Source',

View File

@ -1007,7 +1007,11 @@ export default {
edit_calc_field: '編輯計算字段',
calc_field: '計算字段',
show_sql: '顯示SQL',
ple_select_excel: '請選擇要導入的 Excel'
ple_select_excel: '請選擇要導入的 Excel',
merge: '合併',
no_merge: '不合併',
merge_msg: '數據表中存在自斷一直的情況,是否合併到一個數據集中?',
merge_title: '合併數據'
},
datasource: {
datasource: '數據源',

View File

@ -1007,7 +1007,11 @@ export default {
edit_calc_field: '编辑计算字段',
calc_field: '计算字段',
show_sql: '显示SQL',
ple_select_excel: '请选择要导入的 Excel'
ple_select_excel: '请选择要导入的 Excel',
merge: '合并',
no_merge: '不合并',
merge_msg: '数据表中存在字段一致的情况,是否合并到一个数据集中?',
merge_title: '合并数据'
},
datasource: {
datasource: '数据源',

View File

@ -272,6 +272,7 @@ export default {
for(var i=0;i<selectNode.length;i++){
if(selectNode[i].sheet){
if (!selectNode[i].datasetName || selectNode[i].datasetName === '') {
validate = false
this.$message({
showClose: true,
message: this.$t('dataset.pls_input_name'),
@ -280,6 +281,7 @@ export default {
return
}
if (selectNode[i].datasetName.length > 50) {
validate = false
this.$message({
showClose: true,
message: this.$t('dataset.char_can_not_more_50'),
@ -287,7 +289,6 @@ export default {
})
return
}
selectedSheet.push(selectNode[i])
sheetFileMd5.push(selectNode[i].fieldsMd5)
}
@ -324,9 +325,9 @@ export default {
}
}
if(new Set(sheetFileMd5).size !== sheetFileMd5.length){
this.$confirm('The fields in the data table are consistent, whether they are merged into one table?', 'Merge data table ', {
confirmButtonText: 'Merge',
cancelButtonText: 'Do not merge',
this.$confirm(this.$t('dataset.merge_msg'), this.$t('dataset.merge_title'), {
confirmButtonText: this.$t('dataset.merge'),
cancelButtonText: this.$t('dataset.no_merge'),
type: 'info'
}).then(() => {
table.mergeSheet = true
@ -344,6 +345,11 @@ export default {
this.cancel()
})
});
}else {
post('/dataset/table/update', table).then(response => {
this.$emit('saveSuccess', table)
this.cancel()
})
}
},