Skip to content

Commit 08a6f05

Browse files
committed
新增页面背景图配置
1 parent f80f21a commit 08a6f05

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

src/assets/css/widget.styl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ $primary-background-color = #d8e8fa;
1212
min-height: calc(100% - 40px);
1313
box-shadow: 0 2px 5px 1px rgba(124, 124, 124, 0.2);
1414
margin: 20px;
15-
background: #fff;
15+
background-color: #fff;
16+
background-repeat: no-repeat;
17+
background-position: 0 0;
18+
background-size: 100% 100%;
1619

1720
img {
1821
vertical-align: top;
@@ -285,7 +288,7 @@ $primary-background-color = #d8e8fa;
285288
}
286289
}
287290

288-
.wg-splitLine .splitLine-hr{
291+
.wg-splitLine .splitLine-hr {
289292
border: 0 none;
290293
border-top: 1px solid #d3d3d3;
291294
}

src/assets/json/page-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"pageConfig": {
33
"title": "云忆网络",
44
"backgroundColor": "#fff",
5+
"backgroundImage": null,
56
"theme": null,
67
"countId": null
78
},

src/components/page-config.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<el-form-item label="页面背景色">
1010
<el-color-picker v-model="pageData.config.backgroundColor" />
1111
</el-form-item>
12+
<el-form-item label="页面背景图片">
13+
<ImgUpload :value.sync="pageData.config.backgroundImage" />
14+
</el-form-item>
1215
<el-form-item label="页面统计ID">
1316
<el-input type="number" v-model="pageData.config.countId"></el-input>
1417
</el-form-item>

src/components/widget-form.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
<template>
22
<div class="widget-form-wrapper">
3-
<div class="widget-form-container" :style="{backgroundColor:pageData.config.backgroundColor}">
4-
<img v-if="theme" :src="themeBanner" alt="banner" width="100%" @click="setConfigTab()">
5-
<widget-form-list list="formList" v-if="theme" :class="theme.value" :style="{width:theme.contentWidth,margin:theme.margin,borderRadius:theme.borderRadius?'10px':'0'}"/>
6-
<widget-form-list list="list"/>
3+
<div
4+
class="widget-form-container"
5+
:style="{backgroundColor:pageData.config.backgroundColor,backgroundImage:`url(${pageData.config.backgroundImage})`}"
6+
>
7+
<img v-if="theme" :src="themeBanner" alt="banner" width="100%" @click="setConfigTab()" />
8+
<widget-form-list
9+
list="formList"
10+
v-if="theme"
11+
:class="theme.value"
12+
:style="{width:theme.contentWidth,margin:theme.margin,borderRadius:theme.borderRadius?'10px':'0'}"
13+
/>
14+
<widget-form-list list="list" />
715
</div>
816
</div>
917
</template>
@@ -22,7 +30,7 @@ export default {
2230
},
2331
computed: {
2432
themeBanner() {
25-
if (this.theme.banner.includes("http://")||this.theme.banner.includes("https://")) {
33+
if (this.theme.banner.includes("http://") || this.theme.banner.includes("https://")) {
2634
return this.theme.banner;
2735
}
2836
return this.BASE_URL + this.theme.banner;

0 commit comments

Comments
 (0)