(component): 优化 date-picker 组件样式

This commit is contained in:
就眠儀式 2022-10-02 22:48:59 +08:00
parent 49fcb42d9e
commit 78b2189974
6 changed files with 42 additions and 39 deletions

View File

@ -512,8 +512,7 @@ html #layuicss-laydate {
line-height: 71px; line-height: 71px;
} }
.laydate-range-hover{ .laydate-range-hover{
background-color: var(--global-checked-color) !important; background-color: var(--global-neutral-color-2) !important;
color: white !important;
} }
.layui-laydate-content .layui-disabled:hover{ .layui-laydate-content .layui-disabled:hover{
background-color: transparent !important; background-color: transparent !important;

View File

@ -57,6 +57,10 @@
font-weight: 700; font-weight: 700;
} }
.layui-select-content .layui-select-option .layui-checkbox{
margin-right: 10px;
}
.layui-select-search { .layui-select-search {
padding: 5px 10px; padding: 5px 10px;
} }

View File

@ -100,7 +100,6 @@ function handleRowClick(node: TreeData) {
// //
const isChildAllSelected = computed(() => { const isChildAllSelected = computed(() => {
function _isChildAllSelected(node: TreeData): boolean { function _isChildAllSelected(node: TreeData): boolean {
if (!props.showCheckbox) { if (!props.showCheckbox) {
return false; return false;
@ -124,7 +123,7 @@ const isChildAllSelected = computed(() => {
} }
return function (node: TreeData): boolean { return function (node: TreeData): boolean {
if(props.checkStrictly) { if (props.checkStrictly) {
return false; return false;
} else { } else {
let res = _isChildAllSelected(node); let res = _isChildAllSelected(node);

View File

@ -23,7 +23,7 @@ export const useTree: UseTree = (props: TreeProps, emit: TreeEmits) => {
showCheckbox: props.showCheckbox ?? false, showCheckbox: props.showCheckbox ?? false,
checkedKeys: props.checkedKeys ?? [], checkedKeys: props.checkedKeys ?? [],
expandKeys: props.expandKeys ?? [], expandKeys: props.expandKeys ?? [],
checkStrictly: props.checkStrictly ?? false checkStrictly: props.checkStrictly ?? false,
}, },
props.data props.data
); );

View File

@ -1,34 +1,34 @@
export function getNode(root: any, id: string) { export function getNode(root: any, id: string) {
let resultNode = null; let resultNode = null;
findNode(root, id); findNode(root, id);
function findNode(root: any, id: string){ function findNode(root: any, id: string) {
if(!!root) { if (!!root) {
let type = Object.prototype.toString.call(root); let type = Object.prototype.toString.call(root);
if(type === '[object Object]') { if (type === "[object Object]") {
if(root.id && root.id === id) { if (root.id && root.id === id) {
resultNode = root resultNode = root;
} else { } else {
let node = root.children || null let node = root.children || null;
findNode(node, id); findNode(node, id);
} }
}else if(type === '[object Array]') { } else if (type === "[object Array]") {
let needNode = root.find((i:any) => !!i === true && i.id === id); let needNode = root.find((i: any) => !!i === true && i.id === id);
if(!!needNode) { if (!!needNode) {
resultNode = needNode; resultNode = needNode;
} else { } else {
if(root.length) { if (root.length) {
root.forEach((item: any)=>{ root.forEach((item: any) => {
if(item && item.children) { if (item && item.children) {
let node = item.children let node = item.children;
if(node && node.length){ if (node && node.length) {
findNode(node, id); findNode(node, id);
} }
} }
}) });
} }
} }
} }
} }
} }
return resultNode; return resultNode;
} }

View File

@ -21,6 +21,7 @@
<li>[修复] tree 组件 node 配置 disabled 启用时, @node-click 事件仍触发的问题。</li> <li>[修复] tree 组件 node 配置 disabled 启用时, @node-click 事件仍触发的问题。</li>
<li>[修复] checkbox 组件 label 属性与 default 插槽不设置, layui-checkbox-label 元素仍存在的问题。</li> <li>[修复] checkbox 组件 label 属性与 default 插槽不设置, layui-checkbox-label 元素仍存在的问题。</li>
<li>[修复] tree 组件 show-checkbox 为 true 时, 复选框与标题间距过宽的问题。</li> <li>[修复] tree 组件 show-checkbox 为 true 时, 复选框与标题间距过宽的问题。</li>
<li>[调整] date-picker 组件 laydate-range-hover 前景色与背景色。</li>
</ul> </ul>
</li> </li>
</ul> </ul>