Unverified 提交 7beb636f authored 作者: XiaJunjie2020's avatar XiaJunjie2020 提交者: GitHub

Merge pull request #413 from dataease/pr@dev@feat_数据集字段支持公式运算等(UI和CRUD)

feat(数据集): 数据集字段支持公式运算等操作(UI和CRUD)
......@@ -217,12 +217,11 @@ export default {
'param': function() {
this.initFunctions()
},
'field': function() {
if (this.field.id) {
this.fieldForm = JSON.parse(JSON.stringify(this.field))
} else {
this.fieldForm = JSON.parse(JSON.stringify(this.fieldForm))
}
'field': {
handler: function() {
this.initField()
},
deep: true
}
},
mounted() {
......@@ -230,6 +229,7 @@ export default {
this.$refs.myCm.codemirror.showHint()
})
this.initFunctions()
this.initField()
},
methods: {
onCmReady(cm) {
......@@ -256,7 +256,16 @@ export default {
})
},
initField() {
if (this.field.id) {
this.fieldForm = JSON.parse(JSON.stringify(this.field))
} else {
this.fieldForm = JSON.parse(JSON.stringify(this.fieldForm))
}
},
closeCalcField() {
this.resetField()
this.$emit('onEditClose', {})
},
......@@ -268,6 +277,21 @@ export default {
post('/dataset/field/save', this.fieldForm).then(response => {
this.closeCalcField()
})
},
resetField() {
this.fieldForm = {
id: null,
name: '',
groupType: 'd',
deType: 0,
originName: '',
tableId: this.param.id,
checked: 1,
columnIndex: this.tableFields.dimensionList.length + this.tableFields.quotaList.length,
size: 0,
extField: 2
}
}
}
}
......
......@@ -247,7 +247,6 @@
:visible="editCalcField"
:show-close="false"
class="dialog-css"
:destroy-on-close="true"
:title="currEditField.id?$t('dataset.edit_calc_field'):$t('dataset.add_calc_field')"
append-to-body
>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论