forked from github/dataease
feat(数据集):数据集字段管理页面,增加同步字段功能
This commit is contained in:
parent
c6aa9af3e7
commit
0bb4c9da53
@ -1080,7 +1080,7 @@ public class DataSetTableService {
|
||||
}
|
||||
// delete 数据库中多余的字段
|
||||
DatasetTableFieldExample datasetTableFieldExample = new DatasetTableFieldExample();
|
||||
datasetTableFieldExample.createCriteria().andTableIdEqualTo(datasetTable.getId()).andOriginNameNotIn(originNameList);
|
||||
datasetTableFieldExample.createCriteria().andTableIdEqualTo(datasetTable.getId()).andExtFieldEqualTo(0).andOriginNameNotIn(originNameList);
|
||||
datasetTableFieldMapper.deleteByExample(datasetTableFieldExample);
|
||||
}
|
||||
}
|
||||
|
@ -1144,7 +1144,10 @@ export default {
|
||||
field_name_less_50: 'Field name can not more 50 chars.',
|
||||
excel_info_1: '1、Merged cells cannot exist in the file;',
|
||||
excel_info_2: '2、The first line of the file is the title line, which cannot be empty or date;',
|
||||
excel_info_3: '3、The file size shall not exceed 500m。'
|
||||
excel_info_3: '3、The file size shall not exceed 500m。',
|
||||
sync_field: 'Sync Field',
|
||||
confirm_sync_field: 'Confirm Sync',
|
||||
confirm_sync_field_tips: 'Sync field maybe change edit field,please confirm'
|
||||
},
|
||||
datasource: {
|
||||
datasource: 'Data Source',
|
||||
|
@ -1145,7 +1145,10 @@ export default {
|
||||
field_name_less_50: '字段名不能超過50個字符',
|
||||
excel_info_1: '1、文件終不能存在合併單元格;',
|
||||
excel_info_2: '2、文件的第一行為標題行,不能為空,不能為日期;',
|
||||
excel_info_3: '3、文件不超過500M。'
|
||||
excel_info_3: '3、文件不超過500M。',
|
||||
sync_field: '同步字段',
|
||||
confirm_sync_field: '確認同步',
|
||||
confirm_sync_field_tips: '同步字段可能會導致已編輯字段發生變更,請確認'
|
||||
},
|
||||
datasource: {
|
||||
datasource: '數據源',
|
||||
|
@ -1148,7 +1148,10 @@ export default {
|
||||
field_name_less_50: '字段名不能超过50个字符',
|
||||
excel_info_1: '1、文件中不能存在合并单元格;',
|
||||
excel_info_2: '2、文件的第一行为标题行,不能为空,不能为日期型;',
|
||||
excel_info_3: '3、Excel文件大小请确保在500M以内。'
|
||||
excel_info_3: '3、Excel文件大小请确保在500M以内。',
|
||||
sync_field: '同步字段',
|
||||
confirm_sync_field: '确认同步',
|
||||
confirm_sync_field_tips: '同步字段可能会导致已编辑字段发生变更,请确认'
|
||||
},
|
||||
datasource: {
|
||||
datasource: '数据源',
|
||||
|
@ -15,6 +15,7 @@
|
||||
<el-form :inline="true">
|
||||
<el-form-item class="form-item">
|
||||
<el-button v-if="hasDataPermission('manage',param.privileges)" size="mini" @click="addCalcField">{{ $t('dataset.add_calc_field') }}</el-button>
|
||||
<el-button v-if="hasDataPermission('manage',param.privileges) && table.type !== 'excel' && table.type !== 'custom'" size="mini" :loading="isSyncField" @click="syncField">{{ $t('dataset.sync_field') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item class="form-item" style="float: right;margin-right: 0;">
|
||||
<el-input
|
||||
@ -266,6 +267,10 @@ export default {
|
||||
param: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
table: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -287,7 +292,8 @@ export default {
|
||||
fieldActiveNames: ['d', 'q'],
|
||||
searchField: '',
|
||||
editCalcField: false,
|
||||
currEditField: {}
|
||||
currEditField: {},
|
||||
isSyncField: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -388,6 +394,23 @@ export default {
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
syncField() {
|
||||
this.$confirm(this.$t('dataset.confirm_sync_field_tips'), this.$t('dataset.confirm_sync_field'), {
|
||||
confirmButtonText: this.$t('chart.confirm'),
|
||||
cancelButtonText: this.$t('chart.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.isSyncField = true
|
||||
post('/dataset/table/syncField/' + this.param.id, null).then(response => {
|
||||
setTimeout(() => {
|
||||
this.isSyncField = false
|
||||
this.initField()
|
||||
}, 500)
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@
|
||||
<tab-data-preview :param="param" :table="table" :fields="fields" :data="data" :page="page" :form="tableViewRowForm" @reSearch="reSearch" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('dataset.field_manage')" name="fieldEdit">
|
||||
<field-edit :param="param" />
|
||||
<field-edit :param="param" :table="table" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="table.type !== 'custom' && !(table.type === 'sql' && table.mode === 0)" :label="$t('dataset.join_view')" name="joinView">
|
||||
<union-view :param="param" :table="table" />
|
||||
|
Loading…
Reference in New Issue
Block a user