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