![]()
diff --git a/src/views/form/index.vue b/src/views/form/index.vue
index 66069a0..8b9b9e2 100644
--- a/src/views/form/index.vue
+++ b/src/views/form/index.vue
@@ -24,17 +24,20 @@
+
+
+
diff --git a/src/views/form/theme.vue b/src/views/form/theme.vue
index 928919f..e27db05 100644
--- a/src/views/form/theme.vue
+++ b/src/views/form/theme.vue
@@ -21,7 +21,7 @@
全部
背景类型
-
+ {
+ this.userProjectTheme.backgroundImg=''
+ this.userProjectTheme.backgroundColor=''
+
+ }"
+ v-model="showSettings.backgroundType" size="mini">
颜色
图片
@@ -131,7 +137,10 @@
选择颜色
-
+
@@ -146,6 +155,7 @@
ref="upload"
accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP"
:headers="getUploadHeader"
+ :on-success="uploadBackgroundHandle"
action="/user/file/upload"
:show-file-list="false">
上传背景
@@ -169,7 +179,10 @@
按钮提示文字
-
+
@@ -237,7 +250,8 @@ export default {
showTitle: true,
showDescribe: true,
showNumber: false,
- background: '',
+ backgroundColor: '',
+ backgroundImg: '',
logoImg: '',
logoPosition: 'left',
submitBtnText: '提交'
@@ -276,6 +290,7 @@ export default {
this.projectKey = this.$route.query.key
this.queryProjectTheme()
this.projectFormKey = +new Date()
+ this.queryUserProjectTheme()
},
computed: {
getUploadHeader() {
@@ -285,6 +300,11 @@ export default {
}
},
methods: {
+ uploadBackgroundHandle(response, file, fileList) {
+ this.userProjectTheme.backgroundImg = response.data
+ this.userProjectTheme.backgroundColor = ''
+ this.saveUserTheme()
+ },
uploadLogoHandle(response, file, fileList) {
this.userProjectTheme.logoImg = response.data
this.saveUserTheme()
@@ -295,11 +315,30 @@ export default {
},
saveUserTheme() {
this.userProjectTheme.projectKey = this.projectKey
- this.userProjectTheme.themeId = this.activeTheme ? this.this.activeTheme.id : ''
+ this.userProjectTheme.themeId = this.activeTheme ? this.activeTheme.id : ''
this.$api.post('/user/project/theme/save', this.userProjectTheme).then(res => {
this.projectFormKey = +new Date()
})
},
+ queryUserProjectTheme() {
+ this.$api.post(`/user/project/theme/query/${this.projectKey}`).then(res => {
+ if(!res.data){
+ return
+ }
+ this.userProjectTheme = res.data
+ let {themeId, logoImg, backgroundImg, backgroundColor, submitBtnText} = res.data
+ this.activeTheme = {
+ 'id': themeId
+ }
+ this.showSettings.logoSetting = logoImg ? true : false
+ this.showSettings.btnSetting = submitBtnText ? true : false
+ if (backgroundImg || backgroundColor) {
+ this.showSettings.backgroundSetting = true
+ this.showSettings.backgroundType = backgroundImg ? 'img' : 'color'
+ }
+
+ })
+ },
activeThemeHandle(item) {
if (item) {
this.$confirm('切换主题,系统将不会保存您在上一主题所做的修改,请知悉。', '切换主题提醒', {
@@ -315,6 +354,7 @@ export default {
}
},
activeColorHandle(item) {
+ console.log(item)
this.activeColor = item
this.queryProjectTheme()
},