From 4074ac3e2077e3e1a03611029ece0fc749132445 Mon Sep 17 00:00:00 2001 From: luofann Date: Wed, 13 Sep 2023 12:57:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=90=88=E5=B9=B6=E5=AF=BC=E8=87=B4=E7=9A=84=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=8F=98=E9=87=8F=E5=80=BC=E6=97=A0=E6=B3=95=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/RenderForm/FormItem.vue | 121 ------------------ .../common/RenderForm/tags/TagPassword.vue | 1 + frontend/desktop/src/utils/checkDataType.js | 11 +- 3 files changed, 11 insertions(+), 122 deletions(-) diff --git a/frontend/desktop/src/components/common/RenderForm/FormItem.vue b/frontend/desktop/src/components/common/RenderForm/FormItem.vue index 6fdf0213b0..f4cef9e221 100644 --- a/frontend/desktop/src/components/common/RenderForm/FormItem.vue +++ b/frontend/desktop/src/components/common/RenderForm/FormItem.vue @@ -413,127 +413,6 @@ return formValue }, - getDefaultValueFormat () { - let valueFormat - switch (this.scheme.type) { - case 'input': - case 'textarea': - case 'radio': - case 'text': - case 'datetime': - case 'memberSelector': - case 'logDisplay': - case 'code_editor': - case 'section': - valueFormat = { - type: ['String', 'Number', 'Boolean'], - value: '' - } - break - case 'checkbox': - case 'datatable': - case 'tree': - case 'upload': - case 'cascader': - valueFormat = { - type: 'Array', - value: [] - } - break - case 'select': - if (this.scheme.attrs.multiple) { - valueFormat = { - type: 'Array', - value: [] - } - } else { - valueFormat = { - type: ['String', 'Number', 'Boolean'], - value: '' - } - } - break - case 'time': - if (this.scheme.attrs.isRange) { - valueFormat = { - type: 'Array', - value: ['00:00:00', '23:59:59'] - } - } else { - valueFormat = { - type: 'String', - value: '' - } - } - break - case 'int': - valueFormat = { - type: 'Number', - value: 0 - } - break - case 'ip_selector': - valueFormat = { - type: 'Object', - value: { - static_ip_table_config: [], - selectors: [], - ip: [], - topo: [], - group: [], - filters: [], - excludes: [] - } - } - break - case 'set_allocation': - valueFormat = { - type: 'Object', - value: { - config: { - set_count: 1, - set_template_id: '', - host_resources: [], - module_detail: [] - }, - data: [], - separator: ',' - } - } - break - case 'host_allocation': - valueFormat = { - type: 'Object', - value: { - config: { - host_count: 0, - host_screen_value: '', - host_resources: [], - host_filter_detail: [] - }, - data: [], - separator: ',' - } - } - break - case 'password': - valueFormat = { - type: ['String', 'Object'], - value: { - type: 'password_value', - tag: 'value', - value: '' - } - } - break - default: - valueFormat = { - type: 'String', - value: '' - } - } - return valueFormat - }, isRequired () { let required = false if (this.option.showRequired === true && 'validation' in this.scheme.attrs) { diff --git a/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue b/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue index 936b10307d..ae96d9b154 100644 --- a/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue +++ b/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue @@ -130,6 +130,7 @@ this.localVal = { ...val } } else { this.localVal = { + type: 'password_value', tag: 'value', value: val } diff --git a/frontend/desktop/src/utils/checkDataType.js b/frontend/desktop/src/utils/checkDataType.js index 364bc8676c..7479ad369f 100644 --- a/frontend/desktop/src/utils/checkDataType.js +++ b/frontend/desktop/src/utils/checkDataType.js @@ -22,7 +22,6 @@ export const getDefaultValueFormat = (scheme) => { case 'radio': case 'text': case 'datetime': - case 'password': case 'memberSelector': case 'logDisplay': case 'code_editor': @@ -118,6 +117,16 @@ export const getDefaultValueFormat = (scheme) => { } } break + case 'password': + valueFormat = { + type: ['String', 'Object'], + value: { + type: 'password_value', + tag: 'value', + value: '' + } + } + break default: valueFormat = { type: 'String', From 65f91c980b29d5ca0f918e16d1b044f487a0a0a5 Mon Sep 17 00:00:00 2001 From: luofann Date: Wed, 13 Sep 2023 15:05:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?minor:=20password=20tag=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=8D=A2=E8=A1=8C=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/RenderForm/tags/TagPassword.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue b/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue index ae96d9b154..8f6ec7cd1a 100644 --- a/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue +++ b/frontend/desktop/src/components/common/RenderForm/tags/TagPassword.vue @@ -52,9 +52,9 @@ - {{validateInfo.message}} {{(value.password === 'undefined' || value.password === '') ? '--' : '******'}} +
{{validateInfo.message}}