From d0bbcda86c5fc97c1c32c4400b620030834996f2 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Fri, 4 Nov 2022 14:42:21 +0800 Subject: [PATCH] news --- src/assets/images/address.png | Bin 0 -> 397 bytes src/components/modules/module.vue | 6 +- src/mixins/page/index.js | 25 +- src/pages/column/list/index.vue | 9 +- src/pages/column/page/edu.vue | 296 ++++++++++++++++ src/pages/column/page/news.vue | 556 ++++++++++++++++++++++++++++++ src/router/modules/column.js | 14 +- 7 files changed, 893 insertions(+), 13 deletions(-) create mode 100644 src/assets/images/address.png create mode 100644 src/pages/column/page/edu.vue create mode 100644 src/pages/column/page/news.vue diff --git a/src/assets/images/address.png b/src/assets/images/address.png new file mode 100644 index 0000000000000000000000000000000000000000..fbe3eb09ebe471df754f985c5390d5971c667b3f GIT binary patch literal 397 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+3?vf;>QaFeV{wqX6T`Z5GB1IgmH?j+S0K$0 z`k$fUKSLS}<^E^L0HZ80nf{*v!hi?@xtaeNAS7G_!oWoW)dLYw7N`rG8nxHEdx6f- zE(!7rW?*Jv;dFuMjd+$Dd`uzRR-+vjm za&H2)HF&x>hDbAL9EATF~3b-7N;y6G*`Fn?UB8*DKDU6QuqPiFs7LB z)7%qIeA1qCYPxZ5MP}Nowb4CgYt0kcV^{DCy8IG4{_8F00Tn@oz|zhLP*8fh`njxg HN@xNA=AxwS literal 0 HcmV?d00001 diff --git a/src/components/modules/module.vue b/src/components/modules/module.vue index a93554b..9ab2c49 100644 --- a/src/components/modules/module.vue +++ b/src/components/modules/module.vue @@ -85,7 +85,7 @@ - + { if (e.required) { this.rules[e.prop] = [ diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index f8c0f40..ec155ca 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -12,6 +12,7 @@ export default { id: '', diaVisible: false, curModule: 0, + curListIndex: 0, curData: {}, } }, @@ -25,7 +26,7 @@ export default { // 获取详情 getInfo() { this.modules.map(e => { - const { type } = e + const { type, list } = e // 克隆一个原始row,方便添加 if (type === 'banner' || type === 'introduce') { const data = JSON.parse(JSON.stringify(e.form || e.list[0])) @@ -33,8 +34,14 @@ export default { if (typeof data[i] === 'string') data[i] = '' } e.originForm = data + } else if (type === 'columns') { + if (!list.length) { + // 克隆6个栏目 + for (let i = 0; i < 6; i++) { + e.list.push(JSON.parse(JSON.stringify(e.form))) + } + } } - // 克隆一个空值的form // if (e.form) { // const form = JSON.parse(JSON.stringify(e.form)) @@ -44,8 +51,6 @@ export default { // e.originForm = form // } }) - console.log("🚀 ~ file: index.js ~ line 36 ~ getInfo ~ originForm", this.modules) - // 查询页面详情 this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => { if (data.length) { @@ -56,15 +61,23 @@ export default { }).catch(err => {}) }, // 展开模块设置 - toSet(i) { + toSet(i, listIndex) { this.curModule = i this.curData = JSON.parse(JSON.stringify(this.modules[i])) + if (this.curData.type === 'columns') { + this.curListIndex = listIndex + this.curData.form = JSON.parse(JSON.stringify(this.curData.list[listIndex])) + } this.diaVisible = true }, // 模块设置提交 moduleSubmit() { this.diaVisible = false - this.modules[this.curModule] = this.curData + if (this.curData.type === 'columns') { + this.modules[this.curModule].list[this.curListIndex] = JSON.parse(JSON.stringify(this.curData.form)) + } else { + this.modules[this.curModule] = this.curData + } }, // 处理预览和保存的json handleJson() { diff --git a/src/pages/column/list/index.vue b/src/pages/column/list/index.vue index f692e12..4c6630a 100644 --- a/src/pages/column/list/index.vue +++ b/src/pages/column/list/index.vue @@ -53,13 +53,13 @@ - + @@ -276,7 +276,7 @@ export default { // 预览 preview(row) { const item = ColumnConst.pageStyle.find(e => e.id == row.listStyleId) - window.open(`http://192.168.31.${Setting.isDev ? 126 : 136}:8095/#/${item ? item.path : 'home'}?id=${row.id}`) + window.open((Setting.isDev ? `http://${location.hostname}:8095` : 'http://192.168.31.136') + `/#/${item ? item.path : 'home'}?id=${row.id}`) }, // 页面管理 page(row) { @@ -446,4 +446,7 @@ export default { border-radius: 2px; } } +.page-set { + padding: 6px; +} \ No newline at end of file diff --git a/src/pages/column/page/edu.vue b/src/pages/column/page/edu.vue new file mode 100644 index 0000000..c8509a3 --- /dev/null +++ b/src/pages/column/page/edu.vue @@ -0,0 +1,296 @@ + + + + + \ No newline at end of file diff --git a/src/pages/column/page/news.vue b/src/pages/column/page/news.vue new file mode 100644 index 0000000..1032446 --- /dev/null +++ b/src/pages/column/page/news.vue @@ -0,0 +1,556 @@ + + + + + \ No newline at end of file diff --git a/src/router/modules/column.js b/src/router/modules/column.js index 8164620..83ba592 100644 --- a/src/router/modules/column.js +++ b/src/router/modules/column.js @@ -42,12 +42,24 @@ export default { path: `careers`, component: () => import('@/pages/column/page/careers'), meta: { title: 'CAREERS' } + },, + { + name: `${pre}edu`, + path: `edu`, + component: () => import('@/pages/column/page/edu'), + meta: { title: 'EDUCATION & COLLABORATION' } + }, + { + name: `${pre}news`, + path: `news`, + component: () => import('@/pages/column/page/news'), + meta: { title: 'NEWS&Events' } }, { name: `${pre}newsPress`, path: `newsPress`, component: () => import('@/pages/column/page/newsPress'), - meta: { title: 'NEWS' } + meta: { title: 'NEWS&Events-press room' } } ] }