样式微调

main
wangyunfei 2 weeks ago
parent da37f16483
commit ccb5815368

@ -0,0 +1,3 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.8125 5.28562L4.071 1.66687C3.93757 1.56504 3.77832 1.50255 3.61125 1.48647C3.44417 1.47038 3.27593 1.50134 3.12552 1.57584C2.97512 1.65034 2.84854 1.76542 2.76009 1.90807C2.67165 2.05072 2.62485 2.21527 2.625 2.38312L2.625 9.61949C2.62499 9.78727 2.67189 9.95172 2.76039 10.0943C2.84889 10.2368 2.97548 10.3518 3.12586 10.4262C3.27624 10.5006 3.44443 10.5315 3.61143 10.5154C3.77844 10.4993 3.93762 10.4368 4.071 10.335L8.8125 6.71624C8.92251 6.63224 9.01166 6.52401 9.07302 6.39994C9.13438 6.27588 9.16631 6.13934 9.16631 6.00093C9.16631 5.86252 9.13438 5.72598 9.07302 5.60191C9.01166 5.47785 8.92251 5.36961 8.8125 5.28562Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 760 B

@ -0,0 +1,3 @@
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.71438 8.8125L10.3331 4.071C10.435 3.93757 10.4974 3.77832 10.5135 3.61125C10.5296 3.44417 10.4987 3.27593 10.4242 3.12552C10.3497 2.97512 10.2346 2.84854 10.0919 2.76009C9.94927 2.67165 9.78473 2.62485 9.61688 2.625H2.38051C2.21273 2.62499 2.04828 2.67189 1.90574 2.76039C1.76319 2.84889 1.64823 2.97548 1.57382 3.12586C1.49941 3.27624 1.46852 3.44443 1.48463 3.61143C1.50074 3.77844 1.56322 3.93762 1.66501 4.071L5.28376 8.8125C5.36776 8.92251 5.47599 9.01166 5.60006 9.07302C5.72412 9.13438 5.86066 9.16631 5.99907 9.16631C6.13748 9.16631 6.27402 9.13438 6.39809 9.07302C6.52215 9.01166 6.63039 8.92251 6.71438 8.8125Z" fill="#333333"/>
</svg>

After

Width:  |  Height:  |  Size: 754 B

@ -1,6 +1,8 @@
import React, { useMemo, useState } from 'react';
import { Select, Tree } from 'antd';
import styles from './BasicAttribute.less';
import { ReactComponent as Icon1 } from '@/assets/business_basic/icon1.svg';
import { ReactComponent as Icon2 } from '@/assets/business_basic/icon2.svg';
const buildingOptions = [
{ label: '工厂建筑', value: 'plant' },
@ -17,7 +19,7 @@ const rawTreeData = [
{
title: '上海油库',
key: 'shanghai',
tag: { label: '油库', type: 'depot' },
tag: { label: '工厂', type: 'depot' },
children: [
{
title: '汽油罐区',
@ -207,6 +209,17 @@ const BasicAttribute = () => {
onSelect={keys => setSelectedKeys(keys)}
className={styles.tree}
virtual={false}
// switcherIcon={<img src={icon1} alt="icon1" />}
switcherIcon={nodeProps =>{
// if (!nodeProps.children || nodeProps.children.length ===0){
// return null;
// }
return nodeProps.expanded ? (
<Icon2 width={14} height={14} />
) : (
<Icon1 width={14} height={14} />
);
}}
/>
</div>
</section>

@ -2,14 +2,13 @@
display: flex;
gap: 16px;
padding: 16px;
background-color: #f6f8fb;
border-radius: 12px;
background-color: #fff;
min-height: 520px;
.leftPanel {
flex: 0 0 320px;
background: #fff;
border-radius: 12px;
background: #e9f3ef;
border-radius: 2px;
padding: 20px;
display: flex;
flex-direction: column;
@ -36,7 +35,7 @@
width: 3px;
height: 16px;
border-radius: 2px;
background: linear-gradient(180deg, #21c6b7 0%, #0c8dff 100%);
background: rgba(0, 102, 101, 1);
display: inline-block;
}
@ -54,80 +53,55 @@
.filterSelect {
width: 100%;
:global(.ant-select-selector) {
border: 1px solid rgba(45, 158, 157, 1);
border-radius: 2px;
}
:global(.ant-select-focused .ant-select-selector) {
border-color: rgba(45, 158, 157, 1) !important;
box-shadow: 0 0 0 2px rgba(45, 158, 157, 0.2) !important;
}
:global(.ant-select:hover .ant-select-selector) {
border-color: rgba(45, 158, 157, 1) !important;
}
}
}
.treeWrapper {
flex: 1;
overflow: auto;
background: #f8fafc;
border-radius: 12px;
padding: 12px;
border: 1px solid #e4e9f2;
.tree {
height: 100%;
:global(.ant-tree) {
color: #1f2f3d;
}
:global(.ant-tree-treenode) {
display: flex;
align-items: center;
gap: 8px;
position: relative;
padding-right: 86px;
}
background-color: transparent;
:global(.ant-tree-switcher) {
width: 18px;
color: #41c1c7;
position: absolute;
right: 60px;
top: 50%;
transform: translateY(-50%);
margin-left: 0;
}
:global(.ant-tree-switcher-line-icon) {
stroke: #a6c6d3;
display: flex;
align-items: center !important;
}
:global(.ant-tree-node-content-wrapper) {
flex: 1;
width: 100%;
font-size: 13px;
padding: 4px 8px;
border-radius: 8px;
transition: background 0.2s ease;
:global(.ant-tree) {
background-color: transparent;
}
:global(.ant-tree-node-content-wrapper:hover),
:global(.ant-tree-node-content-wrapper.ant-tree-node-selected) {
background: rgba(12, 141, 255, 0.12);
:global(.ant-tree-treenode) {
padding: 2px 0;
}
:global(.ant-tree-checkbox-inner) {
width: 14px;
height: 14px;
:global(.ant-tree-node-content-wrapper) {
padding: 2px 4px;
border-radius: 4px;
border-color: #6db8ff;
}
:global(.ant-tree-checkbox-checked .ant-tree-checkbox-inner),
:global(.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner) {
background: #0c8dff;
border-color: #0c8dff;
box-shadow: 0 2px 6px rgba(12, 141, 255, 0.35);
}
transition: background 0.2s ease;
:global(.ant-tree-checkbox-checked .ant-tree-checkbox-inner::after) {
border-color: #fff;
&:hover {
background: rgba(196, 225, 214, 0.3);
}
}
:global(.ant-tree-line .ant-tree-switcher) {
background-color: transparent;
:global(.ant-tree-node-selected) {
background: rgba(196, 225, 214, 0.5) !important;
}
}
}
@ -148,7 +122,7 @@
.cardTitle {
font-size: 15px;
font-weight: 600;
color: #1f2f3d;
color: rgba(0, 0, 0, 1);
margin-bottom: 12px;
}
@ -171,7 +145,7 @@
.itemValue {
flex: 1;
color: #1f2f3d;
color: rgba(0, 0, 0, 1);
font-weight: 500;
.tagList {
@ -208,51 +182,46 @@
.nodeText {
flex: 1;
color: #1f2f3d;
color: rgba(0, 0, 0, 1);
font-weight: 500;
}
.nodeTag {
min-width: 48px;
// min-width: 48px;
text-align: center;
padding: 2px 8px;
border-radius: 999px;
padding: 0px 6px;
border-radius: 2px;
font-size: 12px;
font-weight: 600;
background: rgba(12, 141, 255, 0.08);
color: #0c8dff;
font-weight: 500;
position: absolute;
right: 0;
margin-right: 0;
// 工厂、罐区、测点、储罐使用指定背景色
&.tag-depot {
background: rgba(30, 199, 188, 0.14);
color: #13a79c;
background: rgba(196, 225, 214, 1);
color: rgba(0, 0, 0, 1);
}
&.tag-area {
background: rgba(126, 196, 255, 0.22);
color: #0c8dff;
background: rgba(196, 225, 214, 1);
color: rgba(0, 0, 0, 1);
}
&.tag-group {
background: rgba(255, 193, 111, 0.2);
color: #d97a00;
&.tag-sensor {
background: rgba(196, 225, 214, 1);
color: rgba(0, 0, 0, 1);
}
&.tag-tank {
background: rgba(55, 172, 255, 0.2);
color: #0970c3;
background: rgba(196, 225, 214, 1);
color: rgba(0, 0, 0, 1);
}
&.tag-device {
background: rgba(161, 134, 255, 0.22);
color: #6b4de6;
}
&.tag-sensor {
background: rgba(75, 226, 183, 0.18);
color: #0d9b7d;
// 其他类型保持原有样式
&.tag-group {
background: rgba(196, 225, 214, 1);
color: rgba(0, 0, 0, 1);
}
}
@ -269,4 +238,4 @@
// grid-template-columns: 1fr;
// }
// }
// }
// }
Loading…
Cancel
Save