-
+
{{ $t('chart.margin_model_auto') }}
{{ $t('chart.margin_model_absolute') }}
{{ $t('chart.margin_model_relative') }}
@@ -11,25 +11,25 @@
-
+
{{ unitSuffix }}
-
+
{{ unitSuffix }}
-
+
{{ unitSuffix }}
-
+
{{ unitSuffix }}
@@ -84,6 +84,15 @@ export default {
computed: {
unitSuffix() {
return getMarginUnit(this.marginForm)
+ },
+ placeholder() {
+ if (this.marginForm.marginModel === 'absolute') {
+ return this.$t('chart.margin_placeholder')
+ } else if (this.marginForm.marginModel === 'relative') {
+ return this.$t('chart.margin_absolute_placeholder')
+ } else {
+ return null
+ }
}
},
watch: {
@@ -113,6 +122,20 @@ export default {
},
changeMarginStyle(value, modifyName) {
+ if (modifyName === 'marginModel') {
+ if (value === 'absolute') {
+ this.marginForm.marginTop = JSON.parse(JSON.stringify(DEFAULT_MARGIN_STYLE)).marginTop
+ this.marginForm.marginBottom = JSON.parse(JSON.stringify(DEFAULT_MARGIN_STYLE)).marginBottom
+ this.marginForm.marginLeft = JSON.parse(JSON.stringify(DEFAULT_MARGIN_STYLE)).marginLeft
+ this.marginForm.marginRight = JSON.parse(JSON.stringify(DEFAULT_MARGIN_STYLE)).marginRight
+ }
+ if (value === 'relative') {
+ this.marginForm.marginTop = 15
+ this.marginForm.marginBottom = 15
+ this.marginForm.marginLeft = 5
+ this.marginForm.marginRight = 5
+ }
+ }
this.marginForm['modifyName'] = modifyName
this.$emit('onMarginChange', this.marginForm)
},
@@ -124,9 +147,14 @@ export default {
callBack()
return
}
- if (value < 0 || value > 100) {
+ if (this.marginForm.marginModel === 'absolute' && (value < 0 || value > 100)) {
callBack(new Error(this.$t('chart.margin_placeholder')))
this.marginForm[rule.field] = 0
+ } else if (this.marginForm.marginModel === 'relative' && (value < 0 || value > 40)) {
+ callBack(new Error(this.$t('chart.margin_absolute_placeholder')))
+ this.marginForm[rule.field] = 0
+ } else {
+ callBack()
}
}
}
diff --git a/frontend/src/views/panel/template/index.vue b/frontend/src/views/panel/template/index.vue
index a9874ec1aa..15c99a174c 100644
--- a/frontend/src/views/panel/template/index.vue
+++ b/frontend/src/views/panel/template/index.vue
@@ -24,7 +24,7 @@
ref="templateList"
:template-type="currentTemplateType"
:template-list="templateList"
- @templateDelete="templateDelete"
+ @templateDelete="templateFolderDelete"
@templateEdit="templateEdit"
@showCurrentTemplate="showCurrentTemplate"
@templateImport="templateImport"
@@ -253,6 +253,14 @@ export default {
});
}
},
+ templateFolderDelete(id) {
+ if (id) {
+ templateDelete(id).then((response) => {
+ this.openMessageSuccess("commons.delete_success");
+ this.getTree()
+ });
+ }
+ },
templateDelete(id) {
if (id) {
templateDelete(id).then((response) => {
diff --git a/frontend/src/views/system/SysParam/BasicSetting.vue b/frontend/src/views/system/SysParam/BasicSetting.vue
index 82897bb59d..369608b71b 100644
--- a/frontend/src/views/system/SysParam/BasicSetting.vue
+++ b/frontend/src/views/system/SysParam/BasicSetting.vue
@@ -152,18 +152,11 @@ export default {
}
],
limitTimes: [
- {
- pattern: '^([1-9]|[1-9]\\d|100)$',
- message: this.$t('system_parameter_setting.limit_times_error'),
- trigger: 'blur'
- }
+
+ { validator: this.validateNumber, trigger: 'blur' }
],
relieveTimes: [
- {
- pattern: '^([1-9]|[1-9]\\d|100)$',
- message: this.$t('system_parameter_setting.relieve_times_error'),
- trigger: 'blur'
- }
+ { validator: this.validateNumber, trigger: 'blur' }
]
},
originLoginType: null
@@ -193,6 +186,17 @@ export default {
this.query()
},
methods: {
+ validateNumber(rule, value, callback) {
+ if (value != null && value !== '') {
+ const reg = new RegExp('^([1-9]|[1-9]\\d|100)$')
+ if (!reg.test(value)) {
+ const msg = this.$t('system_parameter_setting.relieve_times_error')
+ callback(new Error(msg))
+ return
+ }
+ }
+ callback()
+ },
query() {
basicInfo().then((response) => {
this.formInline = response.data