Skip to content

Commit b921f90

Browse files
committed
样式结构优化
1 parent 16d1ce6 commit b921f90

7 files changed

Lines changed: 41 additions & 23 deletions

File tree

‎src/assets/css/widget.scss‎

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
$primary-color: #409EFF;
22
$primary-background-color: #ecf5ff;
33

4-
.widget-form-container {
4+
.widget-form-wrapper {
55
position: absolute;
66
top: 0;
77
left: 0;
88
right: 0;
99
bottom: 0;
1010

11-
.widget-form-list {
12-
min-height: 100%;
11+
.widget-form-container {
12+
min-height: calc(100% - 40px);
1313
box-shadow: 0 2px 5px 1px rgba(124, 124, 124, .2);
14+
margin: 20px;
15+
}
16+
17+
.widget-form-list {
18+
min-height: 360px;
1419
padding-bottom: 200px;
15-
margin: 20px;
1620

1721
.ghost {
1822
background: #fff;
@@ -66,8 +70,9 @@ $primary-background-color: #ecf5ff;
6670
.widget-view {
6771
margin: 0;
6872
padding: 10px;
69-
background: #fff;
70-
position: relative;
73+
// background: #fff;
74+
position: relative;
75+
border: 1px solid transparent;
7176

7277
&:after {
7378
content: "";
@@ -87,11 +92,12 @@ $primary-background-color: #ecf5ff;
8792

8893

8994
&:hover {
90-
background: $primary-background-color;
95+
border: 1px dashed #8cb8e4;
9196
}
9297

9398
&.active {
94-
background: $primary-background-color;
99+
background: $primary-background-color;
100+
border: 1px dashed #8cb8e4;
95101
// box-shadow: 0px 1px 10px 1px #90c7ff;
96102
z-index: 1111;
97103
}
@@ -117,7 +123,7 @@ $primary-background-color: #ecf5ff;
117123
}
118124
}
119125
.wg-staticText {
120-
line-height: 1.6;
126+
line-height: 1.6;
121127
}
122128

123129
.wg-input, .wg-select {
@@ -130,7 +136,7 @@ $primary-background-color: #ecf5ff;
130136
border: 1px solid #ddd;
131137
outline: none;
132138
text-indent: 10px;
133-
background: #fff;
139+
// background: #fff;
134140
transition: .3s;
135141
}
136142
.wg-title {
@@ -146,7 +152,7 @@ $primary-background-color: #ecf5ff;
146152
position: relative;
147153
margin-right: 10px;
148154
}
149-
.label>span {
155+
.label > span {
150156
background: #fff;
151157
padding: 8px 15px;
152158
border-radius: 10px;
@@ -201,7 +207,7 @@ $primary-background-color: #ecf5ff;
201207
.wg-button {
202208
width: 90%;
203209
margin: 15px 5%;
204-
background: $primary-color;
210+
// background: $primary-color;
205211
color: #fff;
206212
height: 46px;
207213
line-height: 46px;
@@ -211,7 +217,7 @@ $primary-background-color: #ecf5ff;
211217
letter-spacing: 2px;
212218
border-radius: 20px;
213219
text-align: center;
214-
box-shadow: 0 3px 10px 1px #90c7ff;
220+
// box-shadow: 0 3px 10px 1px #90c7ff;
215221
}
216222
}
217223
}

‎src/assets/json/page-config.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"title": "骏伯网络",
3+
"background":"#fff",
34
"themes":[{
45
"type": "theme1",
56
"name": "主题1",

‎src/assets/json/widget.json‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@
9292
"label": "提交"
9393
}],
9494
"style": {
95-
"margin": "0px 0px 0px 0px"
95+
"margin": "0px 0px 0px 0px",
96+
"btnStyle": {
97+
"background": "#409EFF"
98+
}
9699
}
97100
}
98101
],
@@ -108,8 +111,8 @@
108111
"value": "文本描述",
109112
"style": {
110113
"textAlign": "left",
111-
"fontsize": "14",
112-
"fontSize": "14px",
114+
"fontsize": "14",
115+
"fontSize": "14px",
113116
"color": "#333333",
114117
"margin": "0px 0px 0px 0px"
115118
}

‎src/components/page-config.vue‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<template>
22
<div class="form-config-container">
33
<el-form label-position="top">
4-
<el-form-item label="页面标题" v-if="typeof(pageData.config.title)!=='undefined'">
4+
<el-form-item label="页面标题" v-if="pageData.config.hasOwnProperty('title')">
55
<el-input v-model="pageData.config.title"></el-input>
66
</el-form-item>
7+
<el-form-item label="页面背景色" v-if="pageData.config.hasOwnProperty('background')">
8+
<el-color-picker v-model="pageData.config.background"/>
9+
</el-form-item>
710
</el-form>
811
</div>
912
</template>

‎src/components/widget-config.vue‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
<p class="c999">边距(上 右 下 左 、空格隔开)</p>
5050
<el-input v-model="selectWg.style.margin"></el-input>
5151
</div>
52+
<div v-if="selectWg.style.hasOwnProperty('btnStyle')">
53+
<p class="c999">按钮背景色</p>
54+
<el-color-picker v-model="selectWg.style.btnStyle.background"/>
55+
</div>
5256
</el-form-item>
5357

5458
<el-form-item label="是否单选" v-if="selectWg.hasOwnProperty('isRadio')">

‎src/components/widget-form-item.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
</div>
6767

6868
<div class="flex flex-center" v-if="item.type === 'button'" :style="item.style">
69-
<button class="wg-button">{{item.btnText}}</button>
69+
<button class="wg-button" :style="item.style.btnStyle">{{item.btnText}}</button>
7070
</div>
7171

7272
<div v-if="item.type === 'staticText'" class="wg-staticText" :style="item.style">

‎src/components/widget-form.vue‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
<template>
2-
<div class="widget-form-container">
3-
<el-form style="height:100%">
2+
<div class="widget-form-wrapper">
3+
<div class="widget-form-container" :style="{background:pageData.config.background}">
4+
<!-- <img src="@/assets/img/404.jpg" alt width="100%"> -->
45
<draggable
5-
class="widget-form-list"
6-
:class="{'widget-empty': pageData.list.length == 0}"
76
v-model="pageData.list"
87
:options="{group:'widget', ghostClass: 'ghost'}"
98
@end="handleMoveEnd"
109
@add="handleWidgetAdd"
10+
class="widget-form-list"
11+
:class="{'widget-empty': pageData.list.length === 0}"
1112
>
1213
<template v-for="(item, index) in pageData.list">
1314
<widget-form-item v-if="item && item.key" :key="item.key" :item="item" :index="index"/>
1415
</template>
1516
</draggable>
16-
</el-form>
17+
</div>
1718
</div>
1819
</template>
1920

0 commit comments

Comments
 (0)