NEZ-1035 fix: group chart 编辑页面无法打开

This commit is contained in:
@changcode
2021-09-29 17:26:15 +08:00
parent 061311a037
commit 16be95d79f
4 changed files with 16 additions and 13 deletions

View File

@@ -569,6 +569,7 @@ export default {
return [x, y] return [x, y]
} }
}) })
if (self.pieData[0]) {
if (self.pieData[0].data.length > 0) { if (self.pieData[0].data.length > 0) {
getChart(self.chartIndex).clear() getChart(self.chartIndex).clear()
getChart(self.chartIndex).setOption(self.option)// 创建图表 getChart(self.chartIndex).setOption(self.option)// 创建图表
@@ -579,7 +580,7 @@ export default {
getChart(self.chartIndex).clear() getChart(self.chartIndex).clear()
getChart(self.chartIndex).setOption(self.option)// 创建图表 getChart(self.chartIndex).setOption(self.option)// 创建图表
} }
}
self.$refs['localLoading' + self.chartIndex].endLoading() self.$refs['localLoading' + self.chartIndex].endLoading()
self.firstShow = true // 展示操作按键 self.firstShow = true // 展示操作按键
}, 100) }, 100)

View File

@@ -76,7 +76,7 @@ export function nzNumber (rule, value, callback) {
} }
export function noSpecialChar (rule, value, callback) { export function noSpecialChar (rule, value, callback) {
const charReg = /\w+/ const charReg = /^[a-z0-9A-Z-]+$/
setTimeout(() => { setTimeout(() => {
if (charReg.test(value)) { if (charReg.test(value)) {
callback() callback()

View File

@@ -579,6 +579,7 @@ const en = {
usize: 'Must be number(1 - 47)', usize: 'Must be number(1 - 47)',
fileSize: 'File exceed max size', // File exceed max size. fileSize: 'File exceed max size', // File exceed max size.
port: 'Invalid port', port: 'Invalid port',
special: 'Cannot contain special characters',
url: 'Invalid URL', url: 'Invalid URL',
uSize: 'Must be number(1 - 47)', uSize: 'Must be number(1 - 47)',
requiredIdc: 'dc is required', requiredIdc: 'dc is required',

View File

@@ -653,8 +653,9 @@ export default {
showAllBasicOption: false, showAllBasicOption: false,
rules: { rules: {
name: [ name: [
{ validator: this.optionType === 'batch' ? '' : noSpecialChar, trigger: 'change' }, { required: true, message: this.$t('validate.required'), trigger: 'change' },
{ required: true, message: this.$t('validate.required'), trigger: 'change' } { validator: this.optionType === 'batch' ? '' : noSpecialChar, trigger: 'change' }
], ],
assetId: [ assetId: [
{ required: !(this.optionType === 'batch'), message: this.$t('validate.required'), trigger: 'change' } { required: !(this.optionType === 'batch'), message: this.$t('validate.required'), trigger: 'change' }