From 0e640c13b88c24d234c452f267af1d240292bce2 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 10 Sep 2021 11:29:35 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-90860=20refactor:=20=E6=A0=91=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8E=A7=E4=BB=B6=E7=9A=84=E5=A4=8D=E9=80=89=E5=8D=8A?= =?UTF-8?q?=E9=80=89=E4=B8=8D=E4=BD=BF=E7=94=A8=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/button/icon/iconhalf/icon.half.js | 14 ------- src/case/ztree/jquery.ztree.excheck-3.5.js | 18 ++++++++- src/less/base/single/button/button.half.less | 9 +++++ src/less/base/single/input/checkbox.less | 18 ++++----- src/less/base/single/input/radio.less | 18 ++++----- src/less/base/tree/ztree.less | 19 +++++++++- src/less/resource/background.less | 40 -------------------- 7 files changed, 61 insertions(+), 75 deletions(-) diff --git a/src/case/button/icon/iconhalf/icon.half.js b/src/case/button/icon/iconhalf/icon.half.js index 83cdedcec..6a46b165e 100644 --- a/src/case/button/icon/iconhalf/icon.half.js +++ b/src/case/button/icon/iconhalf/icon.half.js @@ -14,20 +14,6 @@ BI.HalfButton = BI.inherit(BI.BasicButton, { }); }, - _init: function () { - BI.HalfButton.superclass._init.apply(this, arguments); - BI.createWidget({ - type: "bi.center_adapt", - element: this.element, - items: [{ - type: "bi.layout", - cls: "bi-high-light-background", - width: 8, - height: 8 - }] - }); - }, - doClick: function () { BI.HalfButton.superclass.doClick.apply(this, arguments); if(this.isValid()) { diff --git a/src/case/ztree/jquery.ztree.excheck-3.5.js b/src/case/ztree/jquery.ztree.excheck-3.5.js index 38f118ffa..ea1e9d277 100644 --- a/src/case/ztree/jquery.ztree.excheck-3.5.js +++ b/src/case/ztree/jquery.ztree.excheck-3.5.js @@ -439,7 +439,23 @@ } var chkName = setting.check.chkStyle + "_" + (node[checkedKey] ? c.TRUE : c.FALSE) + "_" + fullStyle; chkName = (node.check_Focus && node.chkDisabled !== true) ? chkName + "_" + c.FOCUS : chkName; - return consts.className.BUTTON + " " + c.DEFAULT + " " + chkName; + var chClass = consts.className.BUTTON + " " + c.DEFAULT + " " + chkName; + switch (chkName) { + case 'checkbox_true_part': + case 'checkbox_true_part_focus': + chClass += ' bi-half-button bi-high-light-border'; + break; + case 'checkbox_true_full': + case 'checkbox_true_full_focus': + chClass += ' bi-checkbox checkbox-content bi-high-light-background active'; + break; + case 'checkbox_false_full': + case 'checkbox_false_full_focus': + default: + chClass += ' bi-checkbox checkbox-content'; + break; + } + return chClass; }, repairAllChk: function(setting, checked) { if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) { diff --git a/src/less/base/single/button/button.half.less b/src/less/base/single/button/button.half.less index ae5fa1171..d20250a14 100644 --- a/src/less/base/single/button/button.half.less +++ b/src/less/base/single/button/button.half.less @@ -2,4 +2,13 @@ .bi-half-button { .border-radius(2px); + &:after { + position: absolute; + left: 3px; + top: 3px; + width: 8px; + height: 8px; + background-color: @color-bi-background-highlight; + content: ''; + } } \ No newline at end of file diff --git a/src/less/base/single/input/checkbox.less b/src/less/base/single/input/checkbox.less index 42fa02d8b..6d4e6731e 100644 --- a/src/less/base/single/input/checkbox.less +++ b/src/less/base/single/input/checkbox.less @@ -1,7 +1,7 @@ @import "../../../index"; .bi-checkbox { - & .checkbox-content { + & .checkbox-content, &.checkbox-content { .border-radius(2px); border: 1px solid @color-bi-border-dark-line; &:after { @@ -22,7 +22,7 @@ } } &.active, &:active { - & .checkbox-content{ + & .checkbox-content, &.checkbox-content{ border-color: @color-bi-border-highlight; &:after { border-color: @color-bi-border-default; @@ -31,15 +31,15 @@ } } &.disabled { - & .checkbox-content { + & .checkbox-content, &.checkbox-content { background-color: @color-bi-background-disabled; border-color: @color-bi-border-disabled; } - & .checkbox-content:after { + & .checkbox-content:after, &.checkbox-content:after { opacity: 0; } &.active { - & .checkbox-content { + & .checkbox-content, &.checkbox-content { background-color: @color-bi-background-dark-gray; &:after { opacity: 1; @@ -51,23 +51,23 @@ .bi-theme-dark { .bi-checkbox { - & .checkbox-content { + & .checkbox-content, &.checkbox-content { border-color: @color-bi-border-dark-line-theme-dark; &.hover, &:hover { border-color: @color-bi-border-highlight; } } &.active, &:active { - & .checkbox-content { + & .checkbox-content, &.checkbox-content { border-color: @color-bi-border-highlight; } } &.disabled { - & .checkbox-content { + & .checkbox-content, &.checkbox-content { background-color: @color-bi-background-disabled-theme-dark; } &.active { - & .checkbox-content { + & .checkbox-content, &.checkbox-content { background-color: @color-bi-background-dark-gray-theme-dark; border-color: @color-bi-border-disabled-theme-dark; } diff --git a/src/less/base/single/input/radio.less b/src/less/base/single/input/radio.less index cf93efe64..334ea42ca 100644 --- a/src/less/base/single/input/radio.less +++ b/src/less/base/single/input/radio.less @@ -1,7 +1,7 @@ @import "../../../index"; .bi-radio { - & .radio-content { + & .radio-content, &.radio-content { .border-radius(8px); border: 1px solid @color-bi-border-dark-line; &:after { @@ -12,7 +12,7 @@ } } &:active, &.active { - & .radio-content { + & .radio-content, &.radio-content { border-color: @color-bi-border-highlight; &:after { width: 6px; @@ -28,15 +28,15 @@ } } &.disabled { - & .radio-content { + & .radio-content, &.radio-content { background-color: @color-bi-background-disabled; border-color: @color-bi-border-disabled; } - & .radio-content:after { + & .radio-content:after, &.radio-content:after { background-color: transparent; } &.active { - & .radio-content { + & .radio-content, &.radio-content { background-color: @color-bi-background-dark-gray; &:after { background-color: @color-bi-background-default; @@ -48,26 +48,26 @@ .bi-theme-dark { .bi-radio { - & .radio-content { + & .radio-content, &.radio-content { border-color: @color-bi-border-dark-line-theme-dark; &.hover, &:hover { border-color: @color-bi-border-highlight; } } &.active, &:active { - & .radio-content { + & .radio-content, &.radio-content { border-color: @color-bi-border-highlight; } } &.disabled { - & .radio-content { + & .radio-content, &.radio-content { background-color: @color-bi-background-disabled-theme-dark; &.hover, &:hover { border-color: @color-bi-border-dark-line-theme-dark; } } &.active { - & .radio-content { + & .radio-content, &.radio-content { background-color: @color-bi-background-dark-gray-theme-dark; border-color: @color-bi-border-disabled-theme-dark; } diff --git a/src/less/base/tree/ztree.less b/src/less/base/tree/ztree.less index c45be8d5a..2b8fd5730 100644 --- a/src/less/base/tree/ztree.less +++ b/src/less/base/tree/ztree.less @@ -106,8 +106,23 @@ } .ztree li span.button.chk { - width: 16px; - height: 16px; + &.bi-checkbox { + border: 1px solid @color-bi-border-dark-line; + &.active { + background-color: @color-bi-background-highlight; + border-color: @color-bi-border-highlight;; + } + } + &.bi-half-button { + border: 1px solid @color-bi-border-highlight; + } +} + + +.ztree li span.button.chk { + position: relative; + width: 14px; + height: 14px; margin: 0 3px 0 0; cursor: auto } diff --git a/src/less/resource/background.less b/src/less/resource/background.less index 9bd3351f9..446b250c6 100644 --- a/src/less/resource/background.less +++ b/src/less/resource/background.less @@ -70,46 +70,6 @@ } } -.ztree li span.button.chk.checkbox_false_full { - .image2xPath(@icon-checkbox-normal); -} - -.ztree li span.button.chk.checkbox_false_full_focus { - .image2xPath(@icon-checkbox-normal); -} - -.ztree li span.button.chk.checkbox_false_part { - .image2xPath(@icon-half-select); -} - -.ztree li span.button.chk.checkbox_false_part_focus { - .image2xPath(@icon-half-select); -} - -.ztree li span.button.chk.checkbox_true_full { - .image2xPath(@icon-checkbox-active); -} - -.ztree li span.button.chk.checkbox_true_full_focus { - .image2xPath(@icon-checkbox-active); -} - -.ztree li span.button.chk.checkbox_true_part { - .image2xPath(@icon-half-select); -} - -.ztree li span.button.chk.checkbox_true_part_focus { - .image2xPath(@icon-half-select); -} - -.ztree.hack li span.button.chk.checkbox_false_full { - .imagePath(@icon-checkbox-normal); -} - -.ztree.hack li span.button.chk.checkbox_false_full_focus { - .imagePath(@icon-checkbox-normal); -} - .ztree.hack li span.button.chk.checkbox_false_part { .imagePath(@icon-half-select); } From d712c26dd0bdc6b1b33587fa2b3f9f9f1cf68514 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 10 Sep 2021 15:15:52 +0800 Subject: [PATCH 2/2] update --- src/less/resource/background.less | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/less/resource/background.less b/src/less/resource/background.less index 446b250c6..21c157665 100644 --- a/src/less/resource/background.less +++ b/src/less/resource/background.less @@ -70,30 +70,6 @@ } } -.ztree.hack li span.button.chk.checkbox_false_part { - .imagePath(@icon-half-select); -} - -.ztree.hack li span.button.chk.checkbox_false_part_focus { - .imagePath(@icon-half-select); -} - -.ztree.hack li span.button.chk.checkbox_true_full { - .imagePath(@icon-checkbox-active); -} - -.ztree.hack li span.button.chk.checkbox_true_full_focus { - .imagePath(@icon-checkbox-active); -} - -.ztree.hack li span.button.chk.checkbox_true_part { - .imagePath(@icon-half-select); -} - -.ztree.hack li span.button.chk.checkbox_true_part_focus { - .imagePath(@icon-half-select); -} - .ztree li span.button.root_open { .image2xPath(@icon-tree-expand-type1); }