From f58aa746ac2fa3fc2e1b6294239ba24a65aa6b04 Mon Sep 17 00:00:00 2001 From: jiangyy Date: Wed, 28 Jul 2021 13:54:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BB=84=E4=BB=B6vue?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=B8=BA=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/wx-index/score.vue | 2 +- .../customer/customize/CustomerList.vue | 13 +- .../modules/customer/customize/MiniHome.vue | 28 +- .../homeCustom/cptTypeListTestdata.vue | 233 +++++ .../productConfig/homeCustom/homepage.vue | 680 +++++++++++++ .../productConfig/homeCustom/index copy 2.vue | 924 ++++++++++++++++++ .../productConfig/homeCustom/index.vue | 899 +---------------- 7 files changed, 1893 insertions(+), 886 deletions(-) create mode 100644 epmet-oper-web/src/views/modules/productConfig/homeCustom/cptTypeListTestdata.vue create mode 100644 epmet-oper-web/src/views/modules/productConfig/homeCustom/homepage.vue create mode 100644 epmet-oper-web/src/views/modules/productConfig/homeCustom/index copy 2.vue diff --git a/epmet-oper-web/src/components/wx-index/score.vue b/epmet-oper-web/src/components/wx-index/score.vue index 451b27f..c201d56 100644 --- a/epmet-oper-web/src/components/wx-index/score.vue +++ b/epmet-oper-web/src/components/wx-index/score.vue @@ -335,7 +335,7 @@ export default { item: Object }, mounted () { - console.log(this.item) + }, methods: { diff --git a/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue b/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue index 1282f75..4b7d6bf 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/CustomerList.vue @@ -81,8 +81,8 @@ @current-change="pageCurrentChangeHandle">
- +
import ConfigItem from './ConfigItem' import FootbarList from '../../productConfig/footbar/FootbarList' -import MiniHome from './MiniHome' +// import MiniHome from './MiniHome' +import homepage from '../../productConfig/homeCustom/homepage' import MostList from './MostList' // import RoleList from './roleList' import categoryList from './CategoryList' @@ -160,7 +161,8 @@ export default { }, components: { ConfigItem, - MiniHome, + homepage, + // MiniHome, // RoleList, FootbarList, MostList, @@ -224,7 +226,8 @@ export default { this.$refs['ref_mini_home'].startSetWxIndex( customerId, customerName, - type + type, + 'customize' ) }, diff --git a/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue b/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue index 863c078..085c136 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue @@ -163,7 +163,7 @@
- 高级选项 + 高级选项--{{focusedCpt.componentName}} @@ -585,7 +585,7 @@ export default { this.wxIndex.customerId = id this.wxIndex.customerName = name this.wxIndex.clientType = type - console.log(this.wxIndex) + this.startLoading() // let loadingInstance = Loading.service() await this.getCptTypeList() @@ -596,6 +596,7 @@ export default { // loadingInstance.close() }, processBackendCptData (item) { + let demoData = {} let configuration = {} const tempOnlyId = getRandomString(20) @@ -603,6 +604,7 @@ export default { demoData = JSON.parse(item.demoData) configuration = JSON.parse(item.configuration) } catch (err) { + console.log("错误项", item) console.log(err) } return { tempOnlyId, ...item, demoData, configuration } @@ -634,7 +636,7 @@ export default { } })] this.cptTypeList = list - //console.log('可用组件列表', list) + } }).catch((err) => { console.log(err) @@ -660,7 +662,7 @@ export default { ] this.cptList = list.map(this.processBackendCptData) this.lastSavedCptList = cloneDeep(this.cptList) - //console.log('用户储存组件列表', list) + } }).catch((err) => { console.log(err) @@ -670,7 +672,7 @@ export default { // 保存配置 save () { - console.log('保存配置') + const url = getMockFilterUrl('/oper/customize/home/savehomedesign') const { wxIndex: { clientType, customerId }, cptList } = this const componentList = cptList.map(item => { @@ -689,7 +691,7 @@ export default { if (res.code !== 0) { return this.$message.error(res.msg) } else { - console.log(res) + this.lastSavedCptList = cloneDeep(this.cptList) return this.$message.success('保存成功') } @@ -700,7 +702,7 @@ export default { }, // 发布配置 publish () { - console.log('发布配置') + const url = getMockFilterUrl('/oper/customize/home/distributehomedesign') const { wxIndex: { clientType, customerId }, cptList } = this const componentList = cptList.map(item => { @@ -727,7 +729,7 @@ export default { if (res.code !== 0) { return this.$message.error(res.msg) } else { - console.log(res) + this.lastSavedCptList = cloneDeep(this.cptList) return this.$message.success('发布成功') } @@ -773,7 +775,7 @@ export default { }, // 添加组件到实例-前验证 beforeAddCpt (item) { - console.log('添加组件到实例-前验证') + const regionType = this.checkCptRegion(item) const tempOnlyId = getRandomString(20) if (regionType === 'top') { @@ -803,14 +805,14 @@ export default { }, // 实例内容组件重置displayOrder属性 cntCptListResort () { - console.log('实例内容组件重置displayOrder属性') + this.cntCptList.forEach((item, index) => { item.displayOrder = (index + 1) * 10 }) }, // 添加组件到实例 addCpt (item, tempOnlyId, displayOrder = 0) { - console.log('添加组件到实例') + let trueItem = cloneDeep(item) trueItem.tempOnlyId = tempOnlyId @@ -819,7 +821,7 @@ export default { }, // 改变实例组件显示顺序 async changeCptDisplayOrder (item, type) { - console.log('改变实例组件显示顺序') + if (type === 'up') { item.displayOrder -= 11 } else if (type === 'down') { @@ -846,7 +848,7 @@ export default { }, // 聚焦实例组件 focusCpt (item, index) { - console.log('聚焦实例组件', item) + this.globalIndex = index if (this.isInPreview) return if (this.focusedCpt.tempOnlyId === item.tempOnlyId) { diff --git a/epmet-oper-web/src/views/modules/productConfig/homeCustom/cptTypeListTestdata.vue b/epmet-oper-web/src/views/modules/productConfig/homeCustom/cptTypeListTestdata.vue new file mode 100644 index 0000000..01b0ad3 --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/homeCustom/cptTypeListTestdata.vue @@ -0,0 +1,233 @@ + const cptTypeListTestdata = [ + // 通用组件 + { + functionId: '0', + functionName: '通用组件', + functionType: 1, // 1通用 2功能 + isUnfold: true, + componentList: [ + { + componentId: '7', + componentName: '最新议题', + componentFrontId: 'resi-functionList-hall-latestIssueList', + region: 'functionList', + configuration: { + num: 3 + }, + demoData: { + list: [ + { + avatar: '', + title: '最新议题的标题。最新议题的标题。最新议题的标题。最新议题的标题。', + content: '最新议题的内容,最新议题的内容,最新议题的内容。', + author: '山东路45号-刘女士', + date: '2020-01-02' + }, + { + avatar: '', + title: '最新议题的标题。', + content: '最新议题的内容,最新议题的内容,最新议题的内容。', + author: '山东路45号-刘女士', + date: '2020-01-02' + }, + { + avatar: '', + title: '最新议题的标题。', + content: '最新议题的内容,最新议题的内容,最新议题的内容。', + author: '山东路45号-刘女士', + date: '2020-01-02' + } + ] + }, + configurationDescription: '' + }, + { + componentId: '8', + componentName: '最新发布', + componentFrontId: 'resi-functionList-voice-newsList', + region: 'functionList', + configuration: { + num: 3 + }, + demoData: { + list: [ + { + pic: '', + title: '新型冠状病毒检测重大突破!新型冠状病毒检测重大突破!!!', + author: '大港路党支部', + date: '2020-01-02' + }, + { + pic: '', + title: '新型冠状病毒检测重大突破!', + author: '大港路党支部', + date: '2020-01-02' + }, + { + pic: '', + title: '新型冠状病毒检测重大突破!', + author: '大港路党支部', + date: '2020-01-02' + } + ] + }, + configurationDescription: '' + }, + { + componentId: '9', + componentName: '结案项目', + componentFrontId: 'resi-functionList-hall-closedProjectList', + region: 'functionList', + configuration: { + num: 3 + }, + demoData: { + list: [ + { + title: '结案项目的标题。', + content: '结案项目的内容,结案项目的内容,结案项目的内容。', + author: '党支部-卫生部门', + date: '2020-01-02' + }, + { + title: '结案项目的标题。', + content: '结案项目的内容,结案项目的内容,结案项目的内容。', + author: '党支部-卫生部门', + date: '2020-01-02' + }, + { + title: '结案项目的标题。', + content: '结案项目的内容,结案项目的内容,结案项目的内容。', + author: '党支部-卫生部门', + date: '2020-01-02' + } + ] + }, + configurationDescription: '' + } + ] + }, + // 功能组件 + { + functionId: '1', + functionName: '议事厅', + functionType: 2, // 1通用 2功能 + isUnfold: false, + componentList: [ + { + componentId: '1', + componentName: '顶部标题', + componentFrontId: 'resi-titleList-home-gridNameTitle', + configuration: { + // content: '' + }, + demoData: { + ico: '', + avatar: '', + title: '青岛市市北区大港路第二网格' + }, + region: 'titleList', + configurationDescription: '请配置具体内容' + }, + { + componentId: '2', + componentName: '轮播图', + componentFrontId: 'resi-topList-voice-hotNewsSwiper', + configuration: { + // content: '' + }, + demoData: { + pic: '', + title: '轮播图新闻标题' + }, + region: 'topList', + configurationDescription: '请配置具体内容' + }, + { + componentId: '3', + componentName: '消息通知', + componentFrontId: 'resi-floatingList-mine-newMessageButton', + configuration: { + // content: '' + }, + demoData: { + ico: '', + text: '有新消息!' + }, + region: 'floatingList', + configurationDescription: '' + }, + { + componentId: '5', + componentName: '功能菜单', + componentFrontId: 'resi-functionList-extend-moreFunctionIcons', + region: 'functionList', + configuration: { + // bgc: '#eee' + }, + demoData: { + list: [ + { + ico: '', + text: '议事厅' + }, + { + ico: '', + text: '社群' + }, + { + ico: '', + text: '党建声音' + }, + { + ico: '', + text: '更多功能' + } + ] + }, + configurationDescription: '' + }, + { + componentId: '6', + componentName: '热门群', + componentFrontId: 'resi-functionList-group-recommendGroupSlider', + region: 'functionList', + configuration: { + // bgc: '#fff' + }, + demoData: { + list: [ + { + ico: '', + no: '1', + avatar: '', + title: '群名称', + info1: '山东路45号-张三', + info2: '共240人', + info3: '党员11人' + }, + { + ico: '', + no: '2', + avatar: '', + title: '群名称', + info1: '山东路45号-张三', + info2: '共240人', + info3: '党员11人' + }, + { + ico: '', + no: '3', + avatar: '', + title: '群名称', + info1: '山东路45号-张三', + info2: '共240人', + info3: '党员11人' + } + ] + }, + configurationDescription: '' + } + ] + } + ] \ No newline at end of file diff --git a/epmet-oper-web/src/views/modules/productConfig/homeCustom/homepage.vue b/epmet-oper-web/src/views/modules/productConfig/homeCustom/homepage.vue new file mode 100644 index 0000000..001f5bc --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/homeCustom/homepage.vue @@ -0,0 +1,680 @@ + + + + + diff --git a/epmet-oper-web/src/views/modules/productConfig/homeCustom/index copy 2.vue b/epmet-oper-web/src/views/modules/productConfig/homeCustom/index copy 2.vue new file mode 100644 index 0000000..3ebdf3a --- /dev/null +++ b/epmet-oper-web/src/views/modules/productConfig/homeCustom/index copy 2.vue @@ -0,0 +1,924 @@ + + + + + diff --git a/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue b/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue index f4f6c3d..ab96925 100644 --- a/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue +++ b/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue @@ -1,222 +1,18 @@ @@ -224,322 +20,28 @@