From 292dd9ad59d761b9d8746526c7e342186d1b75a6 Mon Sep 17 00:00:00 2001 From: Svamei <41992090+Svamei@users.noreply.github.com> Date: Fri, 14 Apr 2023 10:02:52 +0800 Subject: [PATCH] Fix required item prompt error (#1158) --- .../src/views/hippo4j/instance/index.vue | 34 +++++++------- hippo4j-ui/src/views/hippo4j/item/index.vue | 18 +++++--- hippo4j-ui/src/views/hippo4j/notify/index.vue | 28 +++++++----- .../hippo4j/other/alibaba-dubbo/index.vue | 12 +++-- .../src/views/hippo4j/other/dubbo/index.vue | 12 +++-- .../src/views/hippo4j/other/hystrix/index.vue | 12 +++-- .../hippo4j/other/rabbitmq-stream/index.vue | 12 +++-- .../views/hippo4j/other/rabbitmq/index.vue | 12 +++-- .../hippo4j/other/rocketmq-stream/index.vue | 12 +++-- .../views/hippo4j/other/rocketmq/index.vue | 12 +++-- .../src/views/hippo4j/server/jetty/index.vue | 12 +++-- .../src/views/hippo4j/server/tomcat/index.vue | 12 +++-- .../views/hippo4j/server/undertow/index.vue | 12 +++-- hippo4j-ui/src/views/hippo4j/tenant/index.vue | 24 +++++----- .../src/views/hippo4j/threadpool/index.vue | 44 ++++++++----------- hippo4j-ui/src/views/hippo4j/user/index.vue | 16 ++++--- 16 files changed, 168 insertions(+), 116 deletions(-) diff --git a/hippo4j-ui/src/views/hippo4j/instance/index.vue b/hippo4j-ui/src/views/hippo4j/instance/index.vue index f88ad0c3..3d95ddaa 100755 --- a/hippo4j-ui/src/views/hippo4j/instance/index.vue +++ b/hippo4j-ui/src/views/hippo4j/instance/index.vue @@ -548,21 +548,6 @@ export default { { key: 1, display_name: '超时' }, { key: 0, display_name: '不超时' }, ], - rules: { - tenantId: [{ required: true, message: 'this is required', trigger: 'blur' }], - itemId: [{ required: true, message: 'this is required', trigger: 'blur' }], - tpId: [{ required: true, message: 'this is required', trigger: 'blur' }], - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maxSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - queueType: [{ required: true, message: 'this is required', trigger: 'blur' }], - executeTimeOut: [{ required: true, message: 'this is required', trigger: 'blur' }], - keepAliveTime: [{ required: true, message: 'this is required', trigger: 'blur' }], - isAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }], - capacity: [{ required: true, message: 'this is required', trigger: 'blur' }], - capacityAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }], - livenessAlarm: [{ required: true, message: 'this is required', trigger: 'blur' }], - rejectedType: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, dialogStatus: '', textMap: { update: this.$t('common.edit'), @@ -582,6 +567,25 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + tpId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maxSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + queueType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + executeTimeOut: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + keepAliveTime: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + isAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + capacity: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + capacityAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + livenessAlarm: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + rejectedType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // this.fetchData() // 初始化项目 diff --git a/hippo4j-ui/src/views/hippo4j/item/index.vue b/hippo4j-ui/src/views/hippo4j/item/index.vue index 6ddefab7..bc00768f 100755 --- a/hippo4j-ui/src/views/hippo4j/item/index.vue +++ b/hippo4j-ui/src/views/hippo4j/item/index.vue @@ -207,13 +207,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - itemName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - itemDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -224,6 +217,17 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + itemName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + itemDesc: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { this.fetchData(); // 初始化租户 diff --git a/hippo4j-ui/src/views/hippo4j/notify/index.vue b/hippo4j-ui/src/views/hippo4j/notify/index.vue index 5a37d31d..ec01e8f7 100755 --- a/hippo4j-ui/src/views/hippo4j/notify/index.vue +++ b/hippo4j-ui/src/views/hippo4j/notify/index.vue @@ -380,18 +380,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - tpId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - receives: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - secretKey: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - platform: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - configType: [ - { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, - ], - enable: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -403,6 +391,22 @@ export default { size: 500, }; }, + computed:{ + rules(){ + return{ + tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + tpId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + receives: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + secretKey: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + platform: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + configType: [ + { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, + ], + enable: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { this.fetchData(); // 初始化租户、项目 diff --git a/hippo4j-ui/src/views/hippo4j/other/alibaba-dubbo/index.vue b/hippo4j-ui/src/views/hippo4j/other/alibaba-dubbo/index.vue index 6d5a2f6f..ec981add 100755 --- a/hippo4j-ui/src/views/hippo4j/other/alibaba-dubbo/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/alibaba-dubbo/index.vue @@ -264,10 +264,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -279,6 +275,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue b/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue index 33932072..59dcd96b 100755 --- a/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/dubbo/index.vue @@ -264,10 +264,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -279,6 +275,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue b/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue index 8442e325..02ef4f9c 100755 --- a/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/hystrix/index.vue @@ -264,10 +264,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -279,6 +275,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue b/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue index 265e77d8..f057d873 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rabbitmq-stream/index.vue @@ -263,10 +263,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -278,6 +274,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue b/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue index 50613f72..c5ff61e1 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rabbitmq/index.vue @@ -264,10 +264,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -279,6 +275,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue b/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue index d08f9a2e..46449cc8 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rocketmq-stream/index.vue @@ -263,10 +263,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -278,6 +274,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue b/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue index 381d5a0e..4730841e 100755 --- a/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue +++ b/hippo4j-ui/src/views/hippo4j/other/rocketmq/index.vue @@ -264,10 +264,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -279,6 +275,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/server/jetty/index.vue b/hippo4j-ui/src/views/hippo4j/server/jetty/index.vue index c5cb6094..f410833e 100755 --- a/hippo4j-ui/src/views/hippo4j/server/jetty/index.vue +++ b/hippo4j-ui/src/views/hippo4j/server/jetty/index.vue @@ -352,10 +352,6 @@ export default { create: 'Create', info: 'Info', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -367,6 +363,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/server/tomcat/index.vue b/hippo4j-ui/src/views/hippo4j/server/tomcat/index.vue index b6ab0cf6..6fbec3bd 100755 --- a/hippo4j-ui/src/views/hippo4j/server/tomcat/index.vue +++ b/hippo4j-ui/src/views/hippo4j/server/tomcat/index.vue @@ -362,10 +362,6 @@ export default { create: 'Create', info: 'Info', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -377,6 +373,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/server/undertow/index.vue b/hippo4j-ui/src/views/hippo4j/server/undertow/index.vue index f0c8f8aa..49cda174 100755 --- a/hippo4j-ui/src/views/hippo4j/server/undertow/index.vue +++ b/hippo4j-ui/src/views/hippo4j/server/undertow/index.vue @@ -362,10 +362,6 @@ export default { create: 'Create', info: 'Info', }, - rules: { - coreSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - maximumSize: [{ required: true, message: 'this is required', trigger: 'blur' }], - }, temp: { id: undefined, tenantId: '', @@ -377,6 +373,14 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + maximumSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { // 初始化租户、项目 this.initSelect(); diff --git a/hippo4j-ui/src/views/hippo4j/tenant/index.vue b/hippo4j-ui/src/views/hippo4j/tenant/index.vue index d47f4824..4f646623 100755 --- a/hippo4j-ui/src/views/hippo4j/tenant/index.vue +++ b/hippo4j-ui/src/views/hippo4j/tenant/index.vue @@ -177,16 +177,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - tenantName: [ - { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, - ], - owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - tenantDesc: [ - { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, - ], - }, temp: { id: undefined, tenantId: '', @@ -197,6 +187,20 @@ export default { visible: true, }; }, + computed:{ + rules(){ + return{ + tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + tenantName: [ + { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, + ], + owner: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + tenantDesc: [ + { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, + ], + } + }, + }, created() { this.fetchData(); }, diff --git a/hippo4j-ui/src/views/hippo4j/threadpool/index.vue b/hippo4j-ui/src/views/hippo4j/threadpool/index.vue index 087ffd2c..12cd1215 100755 --- a/hippo4j-ui/src/views/hippo4j/threadpool/index.vue +++ b/hippo4j-ui/src/views/hippo4j/threadpool/index.vue @@ -483,24 +483,26 @@ export default { update: 'Edit', create: 'Create', }, - rules: { + temp: { + id: undefined, + tenantId: '', + itemId: '', + rejectedType: null, + customRejectedType: null, + coreSize: 4, + maxSize: 8, + }, + visible: true, + }; + }, + computed:{ + rules(){ + return{ tenantId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], itemId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], tpId: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], coreSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - maxSize: [ - { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, - // { - // validator: (rule, value, callback) => { - // if (parseInt(value) < parseInt(this.temp.coreSize)) { - // console.log(value); - // console.log(this.temp.coreSize); - // callback('最大线程必须大于等于核心线程'); - // } - // callback(); - // }, - // }, - ], + maxSize: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' },], queueType: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], allowCoreThreadTimeOut: [ { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, @@ -522,18 +524,8 @@ export default { executeTimeOut: [ { required: true, message: this.$t('message.requiredError'), trigger: 'blur' }, ], - }, - temp: { - id: undefined, - tenantId: '', - itemId: '', - rejectedType: null, - customRejectedType: null, - coreSize: 4, - maxSize: 8, - }, - visible: true, - }; + } + }, }, created() { this.fetchData(); diff --git a/hippo4j-ui/src/views/hippo4j/user/index.vue b/hippo4j-ui/src/views/hippo4j/user/index.vue index 10171a41..d815eb62 100755 --- a/hippo4j-ui/src/views/hippo4j/user/index.vue +++ b/hippo4j-ui/src/views/hippo4j/user/index.vue @@ -167,12 +167,6 @@ export default { update: 'Edit', create: 'Create', }, - rules: { - role: [{ required: true, message: this.$t('message.requiredError'), trigger: 'change' }], - userName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], - tenants: [{ required: false, message: this.$t('message.requiredError'), trigger: 'blur' }], - password: [{ required: false, message: this.$t('message.requiredError'), trigger: 'blur' }], - }, temp: { id: undefined, role: '', @@ -193,6 +187,16 @@ export default { }, }; }, + computed:{ + rules(){ + return{ + role: [{ required: true, message: this.$t('message.requiredError'), trigger: 'change' }], + userName: [{ required: true, message: this.$t('message.requiredError'), trigger: 'blur' }], + tenants: [{ required: false, message: this.$t('message.requiredError'), trigger: 'blur' }], + password: [{ required: false, message: this.$t('message.requiredError'), trigger: 'blur' }], + } + }, + }, created() { this.fetchData(); this.initData();