Skip to content

Commit f6e912a

Browse files
committed
同步代码
1 parent f3a49fe commit f6e912a

File tree

5 files changed

+91
-2
lines changed

5 files changed

+91
-2
lines changed

src/components/mars-ui/mars-color-picker/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ const MarsColorPicker = defineComponent({
1717
value: {
1818
type: String,
1919
default: "rgba(255,255,255,1)"
20+
},
21+
hiddenAlpha: {
22+
type: Boolean,
23+
default: false
2024
}
2125
},
2226
emits: ["update:value", "change"],
@@ -25,6 +29,9 @@ const MarsColorPicker = defineComponent({
2529
const visible = ref(false)
2630
let colorObject: any = null
2731

32+
console.log("传递过来的", props.hiddenAlpha)
33+
34+
2835
const changeColor = (color: any) => {
2936
pointColor = `rgba(${color.rgba.r},${color.rgba.g},${color.rgba.b},${color.rgba.a})`// color.hex
3037
colorObject = color
@@ -67,6 +74,8 @@ const MarsColorPicker = defineComponent({
6774
{
6875
trigger: "click",
6976
placement: "right",
77+
overlayClassName: props.hiddenAlpha ? "overlayClassName" : "", // 打开的面板样式,隐藏透明度面板
78+
// overlayClassName: "overlayClassName", // 打开的面板样式,隐藏透明度面板
7079
visible: visible.value,
7180
"onUpdate:visible": (v: boolean) => {
7281
visible.value = v

src/components/mars-ui/mars-color-picker/mars-color-picker.less

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,52 @@
1212
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.16);
1313
z-index: 1;
1414
}
15+
1516
.hu-color-picker {
1617
width: 220px !important;
1718
background-color: var(--mars-bg-base) !important;
1819
box-shadow: none;
1920
}
21+
2022
.hu-color-picker.light {
2123
background: #f7f8f9;
2224
}
25+
2326
.hu-color-picker.light .color-show .sucker {
2427
background: #eceef0;
2528
}
29+
2630
.hu-color-picker.light .color-type .name {
2731
background: #e7e8e9;
2832
}
33+
2934
.hu-color-picker.light .color-type .value {
3035
color: #666;
3136
background: #eceef0;
3237
}
38+
3339
.hu-color-picker.light .colors.history {
3440
border-top: 1px solid #eee;
3541
}
42+
3643
.hu-color-picker canvas {
3744
vertical-align: top;
3845
}
46+
3947
.hu-color-picker .color-set {
4048
display: flex;
4149
}
50+
4251
.hu-color-picker .color-show {
4352
margin-top: 8px;
4453
display: flex;
4554
}
55+
4656
.saturation {
4757
position: relative;
4858
cursor: pointer;
4959
}
60+
5061
.saturation .slide {
5162
position: absolute;
5263
left: 100px;
@@ -58,11 +69,13 @@
5869
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.3);
5970
pointer-events: none;
6071
}
72+
6173
.color-alpha {
6274
position: relative;
6375
margin-left: 8px;
6476
cursor: pointer;
6577
}
78+
6679
.color-alpha .slide {
6780
position: absolute;
6881
left: 0;
@@ -73,22 +86,26 @@
7386
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.3);
7487
pointer-events: none;
7588
}
89+
7690
.sucker {
7791
width: 30px;
7892
fill: #9099a4;
7993
background: #2e333a;
8094
cursor: pointer;
8195
transition: all 0.3s;
8296
}
97+
8398
.sucker.active,
8499
.sucker:hover {
85100
fill: #1593ff;
86101
}
102+
87103
.hue {
88104
position: relative;
89105
margin-left: 8px;
90106
cursor: pointer;
91107
}
108+
92109
.hue .slide {
93110
position: absolute;
94111
left: 0;
@@ -99,14 +116,17 @@
99116
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.3);
100117
pointer-events: none;
101118
}
119+
102120
.colors {
103121
padding: 0;
104122
margin: 0;
105123
}
124+
106125
.colors.history {
107126
margin-top: 10px;
108127
border-top: 1px solid #2e333a;
109128
}
129+
110130
.colors .item {
111131
position: relative;
112132
width: 16px;
@@ -119,16 +139,20 @@
119139
transition: all 0.1s;
120140
cursor: pointer;
121141
}
142+
122143
.colors .item:nth-child(8n + 1) {
123144
margin-left: 0;
124145
}
146+
125147
.colors .item:hover {
126148
transform: scale(1.4);
127149
}
150+
128151
.colors .item .alpha {
129152
height: 100%;
130153
border-radius: 4px;
131154
}
155+
132156
.colors .item .color {
133157
position: absolute;
134158
left: 0;
@@ -137,11 +161,13 @@
137161
height: 100%;
138162
border-radius: 3px;
139163
}
164+
140165
.color-type {
141166
display: flex;
142167
margin-top: 8px;
143168
font-size: 12px;
144169
}
170+
145171
.color-type .name {
146172
width: 60px;
147173
height: 30px;
@@ -152,6 +178,7 @@
152178
color: #999;
153179
background: #252930;
154180
}
181+
155182
.color-type .value {
156183
flex: 1;
157184
height: 30px;
@@ -173,3 +200,25 @@
173200
.ml5 {
174201
margin-left: 5px;
175202
}
203+
204+
.overlayClassName {
205+
.color-alpha {
206+
display: none;
207+
}
208+
209+
.hue {
210+
margin-left: 18px;
211+
}
212+
213+
.hu-color-picker {
214+
.color-type {
215+
&:nth-last-child(2) {
216+
display: none;
217+
}
218+
}
219+
220+
// .color-show {
221+
// display: none;
222+
// }
223+
}
224+
}

src/components/mars-ui/mars-date-picker/index.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,18 @@ export default defineComponent({
6868
}
6969
}
7070
}
71+
72+
.ant-picker-time-panel-cell {
73+
.ant-picker-time-panel-cell-inner {
74+
color: var(--mars-base-color) !important;
75+
}
76+
&:hover,
77+
&.ant-picker-time-panel-cell-selected {
78+
background-color: var(--mars-primary-color) !important;
79+
.ant-picker-time-panel-cell-inner {
80+
background-color: var(--mars-primary-color) !important;
81+
}
82+
}
83+
}
7184
}
7285
</style>

src/components/mars-ui/themes/light/index.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
--mars-list-active: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 98%, rgb(0, 138, 255) 100%);
2323

2424
--mars-title-active: rgba(255, 255, 255, 0.8);
25-
--mars-title-text-active: #008aff;
25+
--mars-title-text-active: #ffffff;
2626

2727
--mars-menu-emb: url(../assets/images/sub-menu-emb-light.png);
2828

src/widgets/basic/manage-layers/index.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ function initTree() {
192192
for (let i = layers.length - 1; i >= 0; i--) {
193193
const layer = layers[i] // 创建图层
194194
195+
if (layer == null || !layer.options || layer.isPrivate) {
196+
continue
197+
}
198+
const item = layer.options
199+
if (!item.name || item.name === "未命名") {
200+
console.log("未命名图层不加入图层管理", layer)
201+
continue
202+
}
203+
195204
if (!layer._hasMapInit && layer.pid === -1 && layer.id !== 99) {
196205
layer.pid = 99 // 示例中创建的图层都放到99分组下面
197206
}
@@ -241,7 +250,16 @@ function initTree() {
241250
}
242251
function findChild(parent: any, list: any[]) {
243252
return list
244-
.filter((item: any) => item.pid === parent.id)
253+
.filter((layer: any) => {
254+
if (layer == null || !layer.options || layer.isPrivate) {
255+
return false
256+
}
257+
const item = layer.options
258+
if (!item.name || item.name === "未命名") {
259+
return false
260+
}
261+
return layer.pid === parent.id
262+
})
245263
.reverse()
246264
.map((item: any, i: number) => {
247265
const node: any = {

0 commit comments

Comments
 (0)