Skip to content

Commit

Permalink
同步代码
Browse files Browse the repository at this point in the history
  • Loading branch information
muyao1987 committed Mar 9, 2023
1 parent f3a49fe commit f6e912a
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/components/mars-ui/mars-color-picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const MarsColorPicker = defineComponent({
value: {
type: String,
default: "rgba(255,255,255,1)"
},
hiddenAlpha: {
type: Boolean,
default: false
}
},
emits: ["update:value", "change"],
Expand All @@ -25,6 +29,9 @@ const MarsColorPicker = defineComponent({
const visible = ref(false)
let colorObject: any = null

console.log("传递过来的", props.hiddenAlpha)


const changeColor = (color: any) => {
pointColor = `rgba(${color.rgba.r},${color.rgba.g},${color.rgba.b},${color.rgba.a})`// color.hex
colorObject = color
Expand Down Expand Up @@ -67,6 +74,8 @@ const MarsColorPicker = defineComponent({
{
trigger: "click",
placement: "right",
overlayClassName: props.hiddenAlpha ? "overlayClassName" : "", // 打开的面板样式,隐藏透明度面板
// overlayClassName: "overlayClassName", // 打开的面板样式,隐藏透明度面板
visible: visible.value,
"onUpdate:visible": (v: boolean) => {
visible.value = v
Expand Down
49 changes: 49 additions & 0 deletions src/components/mars-ui/mars-color-picker/mars-color-picker.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,41 +12,52 @@
box-shadow: 0 0 16px 0 rgba(0, 0, 0, 0.16);
z-index: 1;
}

.hu-color-picker {
width: 220px !important;
background-color: var(--mars-bg-base) !important;
box-shadow: none;
}

.hu-color-picker.light {
background: #f7f8f9;
}

.hu-color-picker.light .color-show .sucker {
background: #eceef0;
}

.hu-color-picker.light .color-type .name {
background: #e7e8e9;
}

.hu-color-picker.light .color-type .value {
color: #666;
background: #eceef0;
}

.hu-color-picker.light .colors.history {
border-top: 1px solid #eee;
}

.hu-color-picker canvas {
vertical-align: top;
}

.hu-color-picker .color-set {
display: flex;
}

.hu-color-picker .color-show {
margin-top: 8px;
display: flex;
}

.saturation {
position: relative;
cursor: pointer;
}

.saturation .slide {
position: absolute;
left: 100px;
Expand All @@ -58,11 +69,13 @@
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.3);
pointer-events: none;
}

.color-alpha {
position: relative;
margin-left: 8px;
cursor: pointer;
}

.color-alpha .slide {
position: absolute;
left: 0;
Expand All @@ -73,22 +86,26 @@
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.3);
pointer-events: none;
}

.sucker {
width: 30px;
fill: #9099a4;
background: #2e333a;
cursor: pointer;
transition: all 0.3s;
}

.sucker.active,
.sucker:hover {
fill: #1593ff;
}

.hue {
position: relative;
margin-left: 8px;
cursor: pointer;
}

.hue .slide {
position: absolute;
left: 0;
Expand All @@ -99,14 +116,17 @@
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.3);
pointer-events: none;
}

.colors {
padding: 0;
margin: 0;
}

.colors.history {
margin-top: 10px;
border-top: 1px solid #2e333a;
}

.colors .item {
position: relative;
width: 16px;
Expand All @@ -119,16 +139,20 @@
transition: all 0.1s;
cursor: pointer;
}

.colors .item:nth-child(8n + 1) {
margin-left: 0;
}

.colors .item:hover {
transform: scale(1.4);
}

.colors .item .alpha {
height: 100%;
border-radius: 4px;
}

.colors .item .color {
position: absolute;
left: 0;
Expand All @@ -137,11 +161,13 @@
height: 100%;
border-radius: 3px;
}

.color-type {
display: flex;
margin-top: 8px;
font-size: 12px;
}

.color-type .name {
width: 60px;
height: 30px;
Expand All @@ -152,6 +178,7 @@
color: #999;
background: #252930;
}

.color-type .value {
flex: 1;
height: 30px;
Expand All @@ -173,3 +200,25 @@
.ml5 {
margin-left: 5px;
}

.overlayClassName {
.color-alpha {
display: none;
}

.hue {
margin-left: 18px;
}

.hu-color-picker {
.color-type {
&:nth-last-child(2) {
display: none;
}
}

// .color-show {
// display: none;
// }
}
}
13 changes: 13 additions & 0 deletions src/components/mars-ui/mars-date-picker/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,18 @@ export default defineComponent({
}
}
}
.ant-picker-time-panel-cell {
.ant-picker-time-panel-cell-inner {
color: var(--mars-base-color) !important;
}
&:hover,
&.ant-picker-time-panel-cell-selected {
background-color: var(--mars-primary-color) !important;
.ant-picker-time-panel-cell-inner {
background-color: var(--mars-primary-color) !important;
}
}
}
}
</style>
2 changes: 1 addition & 1 deletion src/components/mars-ui/themes/light/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
--mars-list-active: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 98%, rgb(0, 138, 255) 100%);

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

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

Expand Down
20 changes: 19 additions & 1 deletion src/widgets/basic/manage-layers/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@ function initTree() {
for (let i = layers.length - 1; i >= 0; i--) {
const layer = layers[i] // 创建图层
if (layer == null || !layer.options || layer.isPrivate) {
continue
}
const item = layer.options
if (!item.name || item.name === "未命名") {
console.log("未命名图层不加入图层管理", layer)
continue
}
if (!layer._hasMapInit && layer.pid === -1 && layer.id !== 99) {
layer.pid = 99 // 示例中创建的图层都放到99分组下面
}
Expand Down Expand Up @@ -241,7 +250,16 @@ function initTree() {
}
function findChild(parent: any, list: any[]) {
return list
.filter((item: any) => item.pid === parent.id)
.filter((layer: any) => {
if (layer == null || !layer.options || layer.isPrivate) {
return false
}
const item = layer.options
if (!item.name || item.name === "未命名") {
return false
}
return layer.pid === parent.id
})
.reverse()
.map((item: any, i: number) => {
const node: any = {
Expand Down

0 comments on commit f6e912a

Please sign in to comment.