forked from github/dataease
refactor: 优化视图标题校验
This commit is contained in:
parent
4ea6c83fa2
commit
c164999209
@ -44,6 +44,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { COLOR_PANEL, DEFAULT_TITLE_STYLE } from '../../chart/chart'
|
import { COLOR_PANEL, DEFAULT_TITLE_STYLE } from '../../chart/chart'
|
||||||
import { checkTitle } from '@/api/chart/chart'
|
import { checkTitle } from '@/api/chart/chart'
|
||||||
|
import { checkViewTitle } from '@/components/canvas/utils/utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TitleSelectorAntV',
|
name: 'TitleSelectorAntV',
|
||||||
@ -108,18 +109,12 @@ export default {
|
|||||||
this.titleForm.title = this.chart.title
|
this.titleForm.title = this.chart.title
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
checkTitle({ id: this.chart.id, title: this.titleForm.title, sceneId: this.chart.sceneId }).then((rsp) => {
|
if (checkViewTitle('update', this.chart.id, this.titleForm.title)) {
|
||||||
if (rsp.data === 'success') {
|
|
||||||
if (!this.titleForm.show) {
|
|
||||||
this.isSetting = false
|
|
||||||
}
|
|
||||||
this.$emit('onTextChange', this.titleForm)
|
|
||||||
} else {
|
|
||||||
this.$error(this.$t('chart.title_repeat'))
|
this.$error(this.$t('chart.title_repeat'))
|
||||||
this.titleForm.title = this.chart.title
|
this.titleForm.title = this.chart.title
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
this.$emit('onTextChange', this.titleForm)
|
||||||
},
|
},
|
||||||
inputOnInput: function(e) {
|
inputOnInput: function(e) {
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
|
Loading…
Reference in New Issue
Block a user