diff --git a/src/assets/images/address.png b/src/assets/images/address.png new file mode 100644 index 0000000..fbe3eb0 Binary files /dev/null and b/src/assets/images/address.png differ 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' } } ] }