diff --git a/epmet-oper-web/public/index.html b/epmet-oper-web/public/index.html index 6be3c61..6ca5268 100644 --- a/epmet-oper-web/public/index.html +++ b/epmet-oper-web/public/index.html @@ -28,10 +28,8 @@ - - <% if (process.env.VUE_APP_NODE_ENV === 'dev') { %> - + <% } %> <% if (process.env.VUE_APP_NODE_ENV === 'prod:sit') { %> diff --git a/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/avatar-mini.png b/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/avatar-mini.png new file mode 100644 index 0000000..74e2694 Binary files /dev/null and b/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/avatar-mini.png differ diff --git a/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/qi2.png b/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/qi2.png new file mode 100644 index 0000000..be70ba2 Binary files /dev/null and b/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/qi2.png differ diff --git a/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/wx-top.png b/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/wx-top.png new file mode 100644 index 0000000..1716041 Binary files /dev/null and b/epmet-oper-web/src/assets/img/modules/wx-mini/index-set/page/wx-top.png differ diff --git a/epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss b/epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss index 752e54f..206106d 100644 --- a/epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss +++ b/epmet-oper-web/src/assets/scss/modules/wx-mini/index-set.scss @@ -128,6 +128,11 @@ background-color: #f7f6f9; box-shadow: 0 5px 15px 1px rgba(0, 0, 0, 0.2); + .mw-phone-topbar{ + display: block; + width: 100%; + } + .mw-phone-hint { position: absolute; top: 0; @@ -177,11 +182,11 @@ cursor: pointer; &.z-focused { - box-shadow: 0 0 12px 3px rgba(#177, 0.5); + box-shadow: 0 0 12px 3px rgba(#67C23A, 0.5); } .d-cpt-operate { - @include bs1; + @include bs3; position: absolute; top: -1000px; bottom: -1000px; @@ -209,8 +214,8 @@ } img { - height: 12px; - line-height: 12px; + height: 10px; + line-height: 10px; } p { line-height: 10px; @@ -223,15 +228,23 @@ position: relative; .d-cpt-wrap { - line-height: 50px; + height: 40px; + line-height: 40px; padding-left: 10px; background-color: #fff; - img { + .d-cpt-ico { position: relative; top: -4px; margin-right: 4px; height: 20px; } + .d-cpt-avatar { + position: relative; + float: right; + margin-right: 10px; + top: 5px; + width: 30px; + } span { font-size: 17px; font-family: PingFang SC; @@ -245,7 +258,7 @@ position: relative; .d-cpt-wrap { - padding: 1px 10px 15px 10px; + padding: 10px 10px 15px 10px; background-color: #fff; .d-cpt-subwrap { position: relative; @@ -347,11 +360,12 @@ } .d-news-title { height: 40px; - font-size: 17px; + font-size: 16px; font-family: PingFang SC; font-weight: 500; color: rgba(51, 51, 51, 1); line-height: 20px; + overflow: hidden; } .d-news-info { margin-top: 17px; @@ -451,7 +465,7 @@ span { position: relative; z-index: 20; - font-size: 15px; + font-size: 14px; font-family: PingFang SC; font-weight: bold; font-style: italic; @@ -511,7 +525,7 @@ background: rgba(255, 76, 82, 1); border-radius: 25px; text-align: center; - font-size: 16px; + font-size: 14px; font-family: PingFang SC; font-weight: 500; color: rgba(255, 255, 255, 1); @@ -535,7 +549,7 @@ } .mw-phone-top { position: relative; - height: 50px; + height: 40px; } .mw-phone-ban { position: relative; @@ -581,7 +595,7 @@ } textarea { - background-color: rgba(247,247,247,1); + background-color: rgba(247, 247, 247, 1); min-height: 100px !important; font-size: 13px; &:focus { @@ -590,15 +604,15 @@ } .d-config-hint { - margin-top: -10px; + margin-top: -10px; font-size: 10px; font-family: PingFang SC; font-weight: 500; color: rgba(51, 51, 51, 1); line-height: 18px; img { - height: 14px; - margin-right: 4px; + height: 14px; + margin-right: 4px; } } diff --git a/epmet-oper-web/src/utils/request.js b/epmet-oper-web/src/utils/request.js index 19eab38..dbf3465 100644 --- a/epmet-oper-web/src/utils/request.js +++ b/epmet-oper-web/src/utils/request.js @@ -17,6 +17,7 @@ const http = axios.create({ http.interceptors.request.use(config => { config.headers['Accept-Language'] = Cookies.get('language') || 'zh-CN' config.headers['token'] = Cookies.get('token') || '' + config.headers['Authorization'] = Cookies.get('token') || '' // 默认参数 var defaults = {} // 防止缓存,GET请求默认带_t参数 diff --git a/epmet-oper-web/src/views/modules/wx-mini/index-set.vue b/epmet-oper-web/src/views/modules/wx-mini/index-set.vue index 2c9b738..19a38ed 100644 --- a/epmet-oper-web/src/views/modules/wx-mini/index-set.vue +++ b/epmet-oper-web/src/views/modules/wx-mini/index-set.vue @@ -37,11 +37,11 @@
- - - - + + + + {{ item.functionName }} @@ -68,6 +68,8 @@ @click="isInPreview = false" icon="el-icon-close" circle>
+ +
({{ getCptRegionName('top') }})
- - + + {{ item.demoData.title }} + + +
- + + {{ subitem.no }}
@@ -289,7 +295,7 @@ import getRandomString from 'dai-js/tools/getRandomString' import cloneDeep from 'lodash/cloneDeep' const getMockFilterUrl = (url) => { - const usedMockTest = true + const usedMockTest = false const mockBaseUrl = 'https://nei.netease.com/api/apimock/30f0251f1b7dc90a8c38e3c634ef2a8b/api' if (usedMockTest) { return mockBaseUrl + url @@ -348,6 +354,7 @@ export default { }, demoData: { ico: '', + avatar: '', title: '青岛市市北区大港路第二网格' }, configurationDescription: '请配置具体内容' @@ -436,7 +443,7 @@ export default { }, { ico: '', - no: '1', + no: '2', avatar: '', title: '群名称', info1: '山东路45号-张三', @@ -445,7 +452,7 @@ export default { }, { ico: '', - no: '1', + no: '3', avatar: '', title: '群名称', info1: '山东路45号-张三', @@ -467,7 +474,7 @@ export default { list: [ { pic: '', - title: '我是新闻标题', + title: '我是新闻标题,我是新闻标题,我是新闻标题,我是新闻标题,我是新闻标题', author: '大港路党支部', date: '2020-01-02' }, @@ -507,6 +514,7 @@ export default { // region: 1 // 区域 1top 2ban 3fixed 4cnt // } ], + lastSavedCptList: [], focusedCpt: { tempOnlyId: '' } @@ -621,6 +629,7 @@ export default { ...res.data.floatingList ] // this.cptList = list.map(this.processBackendCptData) + this.lastSavedCptList = cloneDeep(this.cptList) console.log('用户储存组件列表', list) } }).catch(() => { @@ -650,6 +659,7 @@ export default { return this.$message.error(res.msg) } else { console.log(res) + this.lastSavedCptList = cloneDeep(this.cptList) return this.$message.success('保存成功') } }).catch(() => { @@ -686,6 +696,7 @@ export default { return this.$message.error(res.msg) } else { console.log(res) + this.lastSavedCptList = cloneDeep(this.cptList) return this.$message.success('发布成功') } }).catch(() => { @@ -784,6 +795,9 @@ export default { // 删除组件 delCpt (item) { this.cptList = this.cptList.filter(cptItem => item.tempOnlyId !== cptItem.tempOnlyId) + if (this.focusedCpt.tempOnlyId === item.tempOnlyId) { + this.focusedCpt = { tempOnlyId: '' } + } }, // 检测实例中是否存在某种类型组件 checkExistCpt (item) { @@ -816,15 +830,26 @@ export default { } }) }, - // 重置聚焦组件数据 + // 重置聚焦组件数据,重置为上次整体保存时的数据 resetFocusedCptData () { const { focusedCpt } = this - this.cptList.forEach(item => { + const fun = item => { if (item.tempOnlyId === focusedCpt.tempOnlyId) { focusedCpt.demoData = JSON.stringify(item.demoData) focusedCpt.configuration = JSON.stringify(item.configuration) + return true + } else { + return false } - }) + } + if (!this.lastSavedCptList.some(fun)) { + this.cptTypeListTiled.forEach(item => { + if (item.componentFrontId === focusedCpt.componentFrontId) { + focusedCpt.demoData = JSON.stringify(item.demoData) + focusedCpt.configuration = JSON.stringify(item.configuration) + } + }) + } }, // 改变可用列表组件展开与收起