feat: 数据集字段输入配置,添加插槽,供使用扩展

main
wu.jian2 2 years ago
parent a163bb1163
commit 7dedd8f508

@ -461,6 +461,8 @@
prop="sourceTable" prop="sourceTable"
label="字段来源" label="字段来源"
/> />
<!-- 添加一个插槽供其他人可扩展表格列并把表格列的数据返回出去 -->
<slot name="output-field-table-column" />
</el-table> </el-table>
</div> </div>
<span <span
@ -655,11 +657,11 @@ export default {
getData () { getData () {
const executeParams = { const executeParams = {
dataSourceId: this.dataForm.sourceId, dataSourceId: this.dataForm.sourceId,
script:JSON.stringify({ script: JSON.stringify({
fieldInfo: this.dataForm.fieldInfo,// fieldInfo: this.dataForm.fieldInfo, //
tableName: this.dataForm.tableName, tableName: this.dataForm.tableName,
repeatStatus: this.dataForm.repeatStatus repeatStatus: this.dataForm.repeatStatus
}) , }),
// //
params: [], params: [],
dataSetType: 'original', dataSetType: 'original',
@ -735,12 +737,12 @@ export default {
this.saveText = '正在保存...' this.saveText = '正在保存...'
const saveOriginal = this.dataForm.id ? datasetUpdate : datasetAdd const saveOriginal = this.dataForm.id ? datasetUpdate : datasetAdd
saveOriginal(datasetParams).then(res => { saveOriginal(datasetParams).then(res => {
this.goBack()
this.$message.success('保存成功') this.$message.success('保存成功')
this.$parent.init(false) this.$parent.init(false)
this.$parent.setType = null this.$parent.setType = null
this.saveLoading = false this.saveLoading = false
this.saveText = '' this.saveText = ''
this.goBack()
}).catch(() => { }).catch(() => {
this.$message.error('保存失败') this.$message.error('保存失败')
this.saveLoading = false this.saveLoading = false
@ -863,11 +865,11 @@ export default {
if (!this.dataForm.sourceId || !this.dataForm.tableName) return if (!this.dataForm.sourceId || !this.dataForm.tableName) return
const executeParams = { const executeParams = {
dataSourceId: this.dataForm.sourceId, dataSourceId: this.dataForm.sourceId,
script:JSON.stringify({ script: JSON.stringify({
fieldInfo: this.dataForm.fieldInfo,// fieldInfo: this.dataForm.fieldInfo, //
tableName: this.dataForm.tableName, tableName: this.dataForm.tableName,
repeatStatus: this.dataForm.repeatStatus repeatStatus: this.dataForm.repeatStatus
}) , }),
// //
params: [], params: [],
dataSetType: 'original', dataSetType: 'original',

@ -108,7 +108,7 @@
</el-form-item> </el-form-item>
<el-form-item class="filter-item"> <el-form-item class="filter-item">
<el-button <el-button
v-if="ToAdd" v-if="toAdd"
class="bs-el-button-default" class="bs-el-button-default"
@click="addDataset" @click="addDataset"
> >
@ -310,7 +310,7 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
ToAdd: { toAdd: {
type: Boolean, type: Boolean,
default: true default: true
}, },
@ -365,7 +365,7 @@ export default {
}, },
computed: { computed: {
allType () { allType () {
return this.datasetTypeList.map(item => item.datasetType).filter(item => item != '') return this.datasetTypeList.map(item => item.datasetType).filter(item => item !== '')
} }
}, },
watch: { watch: {

Loading…
Cancel
Save