From fa53792e0693f5d4ab711338e6040288639fdbe1 Mon Sep 17 00:00:00 2001 From: HubuHito Date: Fri, 22 Mar 2024 18:20:53 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E6=8F=92=E4=BB=B6=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=8F=98=E9=87=8F=E6=B8=B2=E6=9F=93=E9=97=AE=E9=A2=98?= =?UTF-8?q?(closed=20#2134)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/RussianDolls/DollForm.css | 1 + frontend/src/components/RussianDolls/create.ts | 2 +- .../src/components/RussianDolls/item/DollArray.vue | 3 ++- .../src/components/RussianDolls/item/DollBase.vue | 8 +++++--- .../src/components/RussianDolls/item/DollIndex.vue | 13 +++++++++---- .../plugin-rule-create/params-config.vue | 2 +- frontend/tsconfig.json | 5 +++-- 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/RussianDolls/DollForm.css b/frontend/src/components/RussianDolls/DollForm.css index c96193cf1..8a8915597 100644 --- a/frontend/src/components/RussianDolls/DollForm.css +++ b/frontend/src/components/RussianDolls/DollForm.css @@ -35,6 +35,7 @@ } .array-child { display: flex; + align-items: center; flex: 1; padding-right: 16px; background: #f5f7fa; diff --git a/frontend/src/components/RussianDolls/create.ts b/frontend/src/components/RussianDolls/create.ts index 160d43dcb..4281918d9 100644 --- a/frontend/src/components/RussianDolls/create.ts +++ b/frontend/src/components/RussianDolls/create.ts @@ -86,7 +86,7 @@ function getDefaultComponent(params: IItem) { realComponent = 'bfArray'; } } else { - realComponent = type === 'boolean' ? 'bk-radio' : 'bk-input'; + realComponent = type === 'boolean' ? 'bk-checkbox' : 'bk-input'; } return realComponent; }; diff --git a/frontend/src/components/RussianDolls/item/DollArray.vue b/frontend/src/components/RussianDolls/item/DollArray.vue index 20035df68..79a12122c 100644 --- a/frontend/src/components/RussianDolls/item/DollArray.vue +++ b/frontend/src/components/RussianDolls/item/DollArray.vue @@ -13,7 +13,8 @@ :item="child" :item-index="value[idx]" :value="option" - :value-prop="getRealProp(valueProp, index)" /> + :value-prop="getRealProp(valueProp, index)" + :label-width="110" />
diff --git a/frontend/src/components/RussianDolls/item/DollBase.vue b/frontend/src/components/RussianDolls/item/DollBase.vue index 7b9fc085d..78b824b1c 100644 --- a/frontend/src/components/RussianDolls/item/DollBase.vue +++ b/frontend/src/components/RussianDolls/item/DollBase.vue @@ -4,7 +4,8 @@ :required="item.required" :property="valueProp" :desc="item.description" - :rules="item.rules"> + :rules="item.rules" + :label-width="labelWidth"> { - const value = val.trim(); + const value = props.schema.type === 'string' ? val.trim() : val; const isNumber = props.schema.type === 'number'; let formatValue = isNumber ? parseFloat(value) || 0 : value; // 调过bia 以单引号开头、结尾的值直接用作字符串 - if (!isNumber || !/^'.*'$/.test(value)) { + if ((!isNumber || !/^'.*'$/.test(value)) && !['true', 'false'].includes(value) && isNaN(value)) { try { formatValue = JSON.parse(value); } catch (err) {} diff --git a/frontend/src/components/RussianDolls/item/DollIndex.vue b/frontend/src/components/RussianDolls/item/DollIndex.vue index b66c2a0d4..9543462a0 100644 --- a/frontend/src/components/RussianDolls/item/DollIndex.vue +++ b/frontend/src/components/RussianDolls/item/DollIndex.vue @@ -5,28 +5,32 @@ :schema="item.schema" :item-index="itemIndex" :value="value" - :value-prop="valueProp" /> + :value-prop="valueProp" + :label-width="labelWidth" /> + :value-prop="valueProp" + :label-width="labelWidth" /> + :value-prop="valueProp" + :label-width="labelWidth" /> + :value-prop="valueProp" + :label-width="labelWidth" />