提交 6b5d27aa authored 作者: taojinlong's avatar taojinlong

fix: 限制標題長度

上级 1fb3f2ee
...@@ -668,7 +668,8 @@ export default { ...@@ -668,7 +668,8 @@ export default {
only_one_quota: 'Only support 1 quota', only_one_quota: 'Only support 1 quota',
only_one_result: 'Only show first result', only_one_result: 'Only show first result',
dimension_show: 'Dimension Show', dimension_show: 'Dimension Show',
quota_show: 'Quota Show' quota_show: 'Quota Show',
title_limit: 'Title cannot be greater than 50 characters'
}, },
dataset: { dataset: {
datalist: 'Data Set', datalist: 'Data Set',
......
...@@ -668,7 +668,8 @@ export default { ...@@ -668,7 +668,8 @@ export default {
only_one_quota: '僅支持1個指標', only_one_quota: '僅支持1個指標',
only_one_result: '僅顯示第1個計算結果', only_one_result: '僅顯示第1個計算結果',
dimension_show: '維度顯示', dimension_show: '維度顯示',
quota_show: '指標顯示' quota_show: '指標顯示',
title_limit: '標題不能大於50個字符'
}, },
dataset: { dataset: {
datalist: '數據集', datalist: '數據集',
......
...@@ -670,7 +670,8 @@ export default { ...@@ -670,7 +670,8 @@ export default {
only_one_quota: '仅支持1个指标', only_one_quota: '仅支持1个指标',
only_one_result: '仅显示第1个计算结果', only_one_result: '仅显示第1个计算结果',
dimension_show: '维度显示', dimension_show: '维度显示',
quota_show: '指标显示' quota_show: '指标显示',
title_limit: '标题不能大于50个字符'
}, },
dataset: { dataset: {
datalist: '数据集', datalist: '数据集',
......
...@@ -407,6 +407,10 @@ export default { ...@@ -407,6 +407,10 @@ export default {
view.id = this.view.id view.id = this.view.id
view.sceneId = this.view.sceneId view.sceneId = this.view.sceneId
view.name = this.view.name ? this.view.name : this.table.name view.name = this.view.name ? this.view.name : this.table.name
if (view.title.length > 50) {
this.$warning(this.$t('chart.title_limit'))
return
}
view.tableId = this.view.tableId view.tableId = this.view.tableId
view.xaxis.forEach(function(ele) { view.xaxis.forEach(function(ele) {
// if (!ele.summary || ele.summary === '') { // if (!ele.summary || ele.summary === '') {
...@@ -459,6 +463,10 @@ export default { ...@@ -459,6 +463,10 @@ export default {
}) })
}, },
closeEdit() { closeEdit() {
if (this.view.title.length > 50) {
this.$warning(this.$t('chart.title_limit'))
return
}
html2canvas(this.$refs.imageWrapper).then(canvas => { html2canvas(this.$refs.imageWrapper).then(canvas => {
const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量 const snapshot = canvas.toDataURL('image/jpeg', 0.1) // 0.1是图片质量
if (snapshot !== '') { if (snapshot !== '') {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论