Skip to content

Commit 0f38e04

Browse files
committed
样式优化
1 parent ece61e2 commit 0f38e04

File tree

5 files changed

+149
-107
lines changed

5 files changed

+149
-107
lines changed

src/assets/css/widget.styl

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,6 @@ $primary-background-color = #d8e8fa;
7272
z-index: 1009;
7373
}
7474

75-
.widget-view.widget-view-imgshow {
76-
padding: 0;
77-
78-
.img-placeholder {
79-
background: #f1f1f1;
80-
}
81-
}
82-
8375
.widget-view {
8476
margin: 0;
8577
padding: 5px 10px;
@@ -261,5 +253,42 @@ $primary-background-color = #d8e8fa;
261253
backface-visibility: hidden;
262254
}
263255
}
256+
257+
.wg-imgshow {
258+
margin: -5px -10px;
259+
260+
.img-placeholder {
261+
background: #f1f1f1;
262+
}
263+
}
264+
265+
.wg-imgslide {
266+
margin: -5px -10px;
267+
text-align: center;
268+
269+
.el-carousel__container {
270+
height: 100%;
271+
}
272+
273+
.el-carousel__item {
274+
display: flex;
275+
justify-content: center;
276+
align-items: center;
277+
}
278+
279+
.el-carousel__item h3 {
280+
color: #475669;
281+
font-size: 18px;
282+
opacity: 0.75;
283+
}
284+
285+
.el-carousel__item:nth-child(2n) {
286+
background-color: #99a9bf;
287+
}
288+
289+
.el-carousel__item:nth-child(2n+1) {
290+
background-color: #d3dce6;
291+
}
292+
}
264293
}
265294
}

src/assets/json/widget.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,18 @@
153153
"imgComponents": [{
154154
"type": "imgSlide",
155155
"name": "图片轮播",
156-
"value": "",
157-
"margin": "0px 0px 0px 0px"
156+
"value": [],
157+
"style": {
158+
"margin": "0px 0px 0px 0px",
159+
"height": 250
160+
}
158161
}, {
159162
"type": "imgShow",
160163
"name": "图片展示",
161164
"value": "",
162-
"margin": "0px 0px 0px 0px"
165+
"style": {
166+
"margin": "0px 0px 0px 0px"
167+
}
163168
}],
164169
"assistComponents": [{
165170
"type": "staticText",

src/components/widget-form-list.vue

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
:class="{'widget-empty': pageData[list].length === 0}"
88
>
99
<template v-for="(item, index) in pageData[list]">
10-
<div
11-
class="widget-view"
12-
:key="item.key"
13-
:class="{active: selectWg.key === item.key,'widget-view-imgshow':item.type === 'imgShow'}"
14-
@click="handleSelectWidget(index)"
15-
>
10+
<div class="widget-view" :key="item.key" :class="{active: selectWg.key === item.key}" @click="handleSelectWidget(index)">
1611
<!-- 手机 -->
1712
<div v-if="item.type === 'phone'" class="wg-phone" :style="item.style">
1813
<div class="wg-item" :class="[item.label.labelPosition==='top'?'flex-column':'align-middle']">
@@ -103,9 +98,22 @@
10398
</div>
10499

105100
<!-- 图片展示 -->
106-
<div class="flex flex-center" v-if="item.type === 'imgShow'" :class="{'img-placeholder':!item.value}" :style="item.style">
107-
<img v-if="item.value" :src="item.value" alt="图片展示" width="100%">
108-
<img v-else src="@/assets/img/img-placeholder.png" alt="图片展示">
101+
<div class="wg-imgshow" v-if="item.type === 'imgShow'">
102+
<div class="flex flex-center" :class="{'img-placeholder':!item.value}" :style="item.style">
103+
<img v-if="item.value" :src="item.value" alt="图片展示" width="100%">
104+
<img v-else src="@/assets/img/img-placeholder.png" alt="图片展示">
105+
</div>
106+
</div>
107+
108+
<!-- 图片轮播 -->
109+
<div class="wg-imgslide" v-if="item.type === 'imgSlide'">
110+
<div class="flex flex-center" :style="{margin:item.style.margin}">
111+
<el-carousel :interval="5000" arrow="never" :style="{width:'100%',height:item.style.height+'px'}">
112+
<el-carousel-item v-for="item in 4" :key="item">
113+
<span>{{ item }}</span>
114+
</el-carousel-item>
115+
</el-carousel>
116+
</div>
109117
</div>
110118

111119
<!-- 按钮 -->

src/components/widget-form.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
},
2323
computed: {
2424
themeBanner() {
25-
if (this.theme.banner.includes("http")) {
25+
if (this.theme.banner.includes("http://")||this.theme.banner.includes("https://")) {
2626
return this.theme.banner;
2727
}
2828
return this.BASE_URL + this.theme.banner;

src/plugins/element.js

Lines changed: 86 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import Vue from "vue";
22
import {
3-
Pagination,
4-
Dialog,
5-
Autocomplete,
3+
// Pagination,
4+
// Dialog,
5+
// Autocomplete,
66
Dropdown,
77
DropdownMenu,
88
DropdownItem,
9-
Menu,
10-
Submenu,
11-
MenuItem,
12-
MenuItemGroup,
9+
// Menu,
10+
// Submenu,
11+
// MenuItem,
12+
// MenuItemGroup,
1313
Input,
1414
InputNumber,
1515
Radio,
@@ -24,40 +24,40 @@ import {
2424
OptionGroup,
2525
Button,
2626
ButtonGroup,
27-
Table,
28-
TableColumn,
29-
DatePicker,
30-
TimeSelect,
31-
TimePicker,
32-
Popover,
33-
Tooltip,
34-
Breadcrumb,
35-
BreadcrumbItem,
27+
// Table,
28+
// TableColumn,
29+
// DatePicker,
30+
// TimeSelect,
31+
// TimePicker,
32+
// Popover,
33+
// Tooltip,
34+
// Breadcrumb,
35+
// BreadcrumbItem,
3636
Form,
3737
FormItem,
38-
Tabs,
39-
TabPane,
40-
Tag,
41-
Tree,
42-
Alert,
43-
Slider,
44-
Icon,
45-
Row,
46-
Col,
38+
// Tabs,
39+
// TabPane,
40+
// Tag,
41+
// Tree,
42+
// Alert,
43+
// Slider,
44+
// Icon,
45+
// Row,
46+
// Col,
4747
Upload,
48-
Progress,
49-
Badge,
50-
Card,
51-
Rate,
52-
Steps,
53-
Step,
48+
// Progress,
49+
// Badge,
50+
// Card,
51+
// Rate,
52+
// Steps,
53+
// Step,
5454
Carousel,
5555
CarouselItem,
5656
Collapse,
5757
CollapseItem,
58-
Cascader,
58+
// Cascader,
5959
ColorPicker,
60-
Transfer,
60+
// Transfer,
6161
Container,
6262
Header,
6363
Aside,
@@ -66,67 +66,67 @@ import {
6666
Loading,
6767
MessageBox,
6868
Message,
69-
Notification
69+
// Notification
7070
} from "element-ui";
7171

72-
Vue.use(Pagination);
73-
Vue.use(Dialog);
74-
Vue.use(Autocomplete);
72+
// Vue.use(Pagination);
73+
// Vue.use(Dialog);
74+
// Vue.use(Autocomplete);
7575
Vue.use(Dropdown);
7676
Vue.use(DropdownMenu);
7777
Vue.use(DropdownItem);
78-
Vue.use(Menu);
79-
Vue.use(Submenu);
80-
Vue.use(MenuItem);
81-
Vue.use(MenuItemGroup);
78+
// Vue.use(Menu);
79+
// Vue.use(Submenu);
80+
// Vue.use(MenuItem);
81+
// Vue.use(MenuItemGroup);
8282
Vue.use(Input);
83-
Vue.use(InputNumber);
84-
Vue.use(Radio);
85-
Vue.use(RadioGroup);
86-
Vue.use(RadioButton);
87-
Vue.use(Checkbox);
88-
Vue.use(CheckboxButton);
89-
Vue.use(CheckboxGroup);
90-
Vue.use(Switch);
91-
Vue.use(Select);
92-
Vue.use(Option);
93-
Vue.use(OptionGroup);
83+
Vue.use(InputNumber);
84+
Vue.use(Radio);
85+
Vue.use(RadioGroup);
86+
Vue.use(RadioButton);
87+
Vue.use(Checkbox);
88+
Vue.use(CheckboxButton);
89+
Vue.use(CheckboxGroup);
90+
Vue.use(Switch);
91+
Vue.use(Select);
92+
Vue.use(Option);
93+
Vue.use(OptionGroup);
9494
Vue.use(Button);
95-
Vue.use(ButtonGroup);
96-
Vue.use(Table);
97-
Vue.use(TableColumn);
98-
Vue.use(DatePicker);
99-
Vue.use(TimeSelect);
100-
Vue.use(TimePicker);
101-
Vue.use(Popover);
102-
Vue.use(Tooltip);
103-
Vue.use(Breadcrumb);
104-
Vue.use(BreadcrumbItem);
95+
Vue.use(ButtonGroup);
96+
// Vue.use(Table);
97+
// Vue.use(TableColumn);
98+
// Vue.use(DatePicker);
99+
// Vue.use(TimeSelect);
100+
// Vue.use(TimePicker);
101+
// Vue.use(Popover);
102+
// Vue.use(Tooltip);
103+
// Vue.use(Breadcrumb);
104+
// Vue.use(BreadcrumbItem);
105105
Vue.use(Form);
106106
Vue.use(FormItem);
107-
Vue.use(Tabs);
108-
Vue.use(TabPane);
109-
Vue.use(Tag);
110-
Vue.use(Tree);
111-
Vue.use(Alert);
112-
Vue.use(Slider);
113-
Vue.use(Icon);
114-
Vue.use(Row);
115-
Vue.use(Col);
116-
Vue.use(Upload);
117-
Vue.use(Progress);
118-
Vue.use(Badge);
119-
Vue.use(Card);
120-
Vue.use(Rate);
121-
Vue.use(Steps);
122-
Vue.use(Step);
123-
Vue.use(Carousel);
124-
Vue.use(CarouselItem);
125-
Vue.use(Collapse);
126-
Vue.use(CollapseItem);
127-
Vue.use(Cascader);
128-
Vue.use(ColorPicker);
129-
Vue.use(Transfer);
107+
// Vue.use(Tabs);
108+
// Vue.use(TabPane);
109+
// Vue.use(Tag);
110+
// Vue.use(Tree);
111+
// Vue.use(Alert);
112+
// Vue.use(Slider);
113+
// Vue.use(Icon);
114+
// Vue.use(Row);
115+
// Vue.use(Col);
116+
Vue.use(Upload);
117+
// Vue.use(Progress);
118+
// Vue.use(Badge);
119+
// Vue.use(Card);
120+
// Vue.use(Rate);
121+
// Vue.use(Steps);
122+
// Vue.use(Step);
123+
Vue.use(Carousel);
124+
Vue.use(CarouselItem);
125+
Vue.use(Collapse);
126+
Vue.use(CollapseItem);
127+
// Vue.use(Cascader);
128+
Vue.use(ColorPicker);
129+
// Vue.use(Transfer);
130130
Vue.use(Container);
131131
Vue.use(Header);
132132
Vue.use(Aside);
@@ -140,5 +140,5 @@ Vue.prototype.$msgbox = MessageBox;
140140
Vue.prototype.$alert = MessageBox.alert;
141141
Vue.prototype.$confirm = MessageBox.confirm;
142142
Vue.prototype.$prompt = MessageBox.prompt;
143-
Vue.prototype.$notify = Notification;
143+
// Vue.prototype.$notify = Notification;
144144
Vue.prototype.$message = Message;

0 commit comments

Comments
 (0)