feat(数据集):编辑excel前端
This commit is contained in:
parent
198208fc8c
commit
0195edea45
@ -830,7 +830,11 @@ export default {
|
||||
preview_100_data: 'Show 100 lines data',
|
||||
invalid_table_check: 'Please sync data first.',
|
||||
parse_error: 'Parse Error',
|
||||
origin_field_type: 'Origin Type'
|
||||
origin_field_type: 'Origin Type',
|
||||
edit_excel_table: 'Edit Excel Dataset',
|
||||
edit_excel: 'Edit Excel',
|
||||
excel_replace: 'Replace',
|
||||
excel_add: 'Add'
|
||||
},
|
||||
datasource: {
|
||||
datasource: 'Data Source',
|
||||
|
||||
@ -797,7 +797,7 @@ export default {
|
||||
param: '參數',
|
||||
edit_sql: '編輯 SQL',
|
||||
showRow: '顯示行',
|
||||
add_excel_table: ' 添加 Excel 數據集',
|
||||
add_excel_table: ' 添加Excel數據集',
|
||||
add_custom_table: '添加自助數據集',
|
||||
upload_file: '上傳文件',
|
||||
detail: '詳情',
|
||||
@ -830,7 +830,11 @@ export default {
|
||||
preview_100_data: '顯示前100行數據',
|
||||
invalid_table_check: '非直連數據集請先完成數據同步',
|
||||
parse_error: '解析錯誤',
|
||||
origin_field_type: '原始類型'
|
||||
origin_field_type: '原始類型',
|
||||
edit_excel_table: '編輯Excel數據集',
|
||||
edit_excel: '編輯Excel',
|
||||
excel_replace: '替換',
|
||||
excel_add: '追加'
|
||||
},
|
||||
datasource: {
|
||||
datasource: '數據源',
|
||||
|
||||
@ -830,7 +830,11 @@ export default {
|
||||
preview_100_data: '显示前100行数据',
|
||||
invalid_table_check: '非直连数据集请先完成数据同步',
|
||||
parse_error: '解析错误',
|
||||
origin_field_type: '原始类型'
|
||||
origin_field_type: '原始类型',
|
||||
edit_excel_table: '编辑Excel数据集',
|
||||
edit_excel: '编辑Excel',
|
||||
excel_replace: '替换',
|
||||
excel_add: '追加'
|
||||
},
|
||||
datasource: {
|
||||
datasource: '数据源',
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<el-row>
|
||||
<el-row style="height: 26px;">
|
||||
<span style="line-height: 26px;">
|
||||
{{ $t('dataset.add_excel_table') }}
|
||||
{{ param.tableId?$t('dataset.edit_excel_table'):$t('dataset.add_excel_table') }}
|
||||
</span>
|
||||
<el-row style="float: right">
|
||||
<el-button size="mini" @click="cancel">
|
||||
@ -20,7 +20,7 @@
|
||||
<el-col style="width: 500px;">
|
||||
<el-form :inline="true" size="mini" class="row-style">
|
||||
<el-form-item class="form-item">
|
||||
<el-input v-model="name" :placeholder="$t('commons.name')" />
|
||||
<el-input v-model="name" :disabled="!!param.tableId" :placeholder="$t('commons.name')" />
|
||||
</el-form-item>
|
||||
<el-form-item class="form-item">
|
||||
<el-upload
|
||||
@ -183,7 +183,8 @@ export default {
|
||||
dataSourceId: null,
|
||||
type: 'excel',
|
||||
mode: parseInt(this.mode),
|
||||
info: '{"data":"' + this.path + '"}'
|
||||
info: '{"data":"' + this.path + '"}',
|
||||
editType: this.param.editType ? this.param.editType : 0
|
||||
}
|
||||
post('/dataset/table/update', table).then(response => {
|
||||
this.$store.dispatch('dataset/setSceneData', new Date().getTime())
|
||||
|
||||
@ -14,6 +14,19 @@
|
||||
</span>
|
||||
</el-popover>
|
||||
<el-row style="float: right">
|
||||
<el-dropdown style="margin-right: 10px;" size="small" trigger="click" @command="clickEditExcel">
|
||||
<el-button type="primary" size="mini" plain>
|
||||
{{ $t('dataset.edit_excel') }}
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="beforeEditExcel('0')">
|
||||
{{ $t('dataset.excel_replace') }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="beforeEditExcel('1')">
|
||||
{{ $t('dataset.excel_add') }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-button v-if="table.type ==='custom'" size="mini" @click="editCustom">
|
||||
{{ $t('dataset.edit_custom_table') }}
|
||||
</el-button>
|
||||
@ -108,10 +121,10 @@ export default {
|
||||
this.fields = response.data.fields
|
||||
this.data = response.data.data
|
||||
this.page = response.data.page
|
||||
if(response.data.status === 'warnning'){
|
||||
if (response.data.status === 'warnning') {
|
||||
this.$warning(response.data.msg, 3000)
|
||||
}
|
||||
if(response.data.status === 'error') {
|
||||
if (response.data.status === 'error') {
|
||||
this.$error(response.data.msg, 3000)
|
||||
}
|
||||
}).catch(response => {
|
||||
@ -147,6 +160,24 @@ export default {
|
||||
},
|
||||
hideTab() {
|
||||
this.tabStatus = false
|
||||
},
|
||||
|
||||
clickEditExcel(param) {
|
||||
// console.log(param);
|
||||
switch (param.type) {
|
||||
case '0':
|
||||
this.$emit('switchComponent', { name: 'AddExcel', param: { id: this.table.sceneId, tableId: this.table.id, editType: 0 }})
|
||||
break
|
||||
case '1':
|
||||
this.$emit('switchComponent', { name: 'AddExcel', param: { id: this.table.sceneId, tableId: this.table.id, editType: 1 }})
|
||||
break
|
||||
}
|
||||
},
|
||||
|
||||
beforeEditExcel(type) {
|
||||
return {
|
||||
'type': type
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user