From 4f25a12574aafc45229725d24363a5aff263cb86 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 18 Jan 2023 10:43:39 +0800 Subject: [PATCH] fix --- src/components/modules/link.vue | 3 +- src/components/modules/module.vue | 15 +- src/const/modules.js | 195 ++++++- src/mixins/page/index.js | 9 +- src/pages/article/add/index.vue | 5 +- src/pages/column/add/index.vue | 7 +- src/pages/column/page/sfel.vue | 870 ++++++++++++++++++++++++++++++ src/pages/column/page/survey.vue | 2 +- src/setting.js | 4 +- 9 files changed, 1091 insertions(+), 19 deletions(-) create mode 100644 src/pages/column/page/sfel.vue diff --git a/src/components/modules/link.vue b/src/components/modules/link.vue index d9381e4..96849b4 100644 --- a/src/components/modules/link.vue +++ b/src/components/modules/link.vue @@ -174,8 +174,7 @@ export default { }, // 获取指定站点的栏目列表 getOtherColumn() { - console.log(55, this.data) - this.$post(this.api.listWithTree, { + this.data.site && this.$post(this.api.listWithTree, { siteId: this.data.site, columnName: '', templateId: '', diff --git a/src/components/modules/module.vue b/src/components/modules/module.vue index 5c72cf1..d34f3f0 100644 --- a/src/components/modules/module.vue +++ b/src/components/modules/module.vue @@ -161,6 +161,7 @@ export default { }, data() { return { + site: this.$store.state.content.site, headers: { token: Util.local.get(Setting.tokenKey) }, @@ -297,7 +298,6 @@ export default { // 上传成功 uploadSuccess(res, row, item = {}) { this.$set(row, item.type === 'video' ? 'video' : 'pic', res.url) - console.log("🚀 ~ file: module.vue:299 ~ uploadSuccess ~ res, row", res, row, item) }, // 删除行(通用) delRow(list, i) { @@ -309,6 +309,19 @@ export default { }, // 展示链接设置 toLink(row, i = 0) { + if (!row.link.linkName) { + row.link = { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: this.site.id, + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + } + } this.curIndex = i this.linkForm = row.link this.linkVisible = true diff --git a/src/const/modules.js b/src/const/modules.js index 0c3902c..d87a2f3 100644 --- a/src/const/modules.js +++ b/src/const/modules.js @@ -3531,7 +3531,7 @@ export default { list: [ { pic: 'http://10.10.11.7/images/edu/1.png', - title: 'EDUCATION & COLLABORATION', + title: '科普之窗', link: { linkName: '无', connectionType: 1, @@ -3698,7 +3698,7 @@ export default { list: [ { pic: 'http://10.10.11.7/images/talent/1.png', - title: 'EDUCATION & COLLABORATION', + title: '人才队伍', link: { linkName: '无', connectionType: 1, @@ -4046,7 +4046,7 @@ export default { list: [ { pic: 'http://10.10.11.7/images/talent/1.png', - title: 'EDUCATION & COLLABORATION', + title: '用户共享', link: { linkName: '无', connectionType: 1, @@ -4226,8 +4226,8 @@ export default { }, list: [ { - pic: 'http://10.10.11.7/images/talent/1.png', - title: 'EDUCATION & COLLABORATION', + pic: 'http://10.10.11.7/images/exp/1.png', + title: '装置介绍', link: { linkName: '无', connectionType: 1, @@ -4391,8 +4391,8 @@ export default { }, list: [ { - pic: 'http://10.10.11.7/images/talent/1.png', - title: 'EDUCATION & COLLABORATION', + pic: 'http://10.10.11.7/images/survey/1.png', + title: 'S³FEL概况', link: { linkName: '无', connectionType: 1, @@ -4487,4 +4487,185 @@ export default { } }, ], + sfel: [ + { + type: 'introduce', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true, + crop: false + }, + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'link', + prop: 'link', + label: '链接' + } + ], + form: { + pic: '', + title: '', + link: { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: '', + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + }, + isEnable: 1 + }, + list: [ + { + pic: 'http://10.10.11.7/images/news/1.png', + title: '', + link: { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: '', + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + }, + isEnable: 1 + } + ] + }, + { + type: 'columns', + form: { + columnName: '', + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + }, + list: [ + { + columnName: 'General news', + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + }, + { + columnName: 'Research news', + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + }, + { + columnName: 'General news', + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + }, + { + columnName: 'General news', + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + }, + { + columnName: 'Research news', + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + }, + { + columnName: 'Journal covers', + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + }, + ] + }, + { + type: 'form', + forms: [ + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'textarea', + prop: 'des', + label: '概述' + } + ], + form: { + title: 'Seminars & Workshops', + des: 'What makes a ligh chinese bay chaser' + } + }, + { + type: 'column', + form: { + site: '', + column: '', + articleNum: '', + columnTitle: 1, + columnTitleCustom: '' + } + }, + { + type: 'form', + forms: [ + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'textarea', + prop: 'des', + label: '概述' + } + ], + form: { + title: 'Conference', + des: 'What makes a ligh chinese bay chaser' + } + }, + { + type: 'column', + form: { + site: '', + column: '', + articleNum: '', + articleNumOpt: 8, + columnTitle: 1, + columnTitleCustom: '' + } + }, + ], } \ No newline at end of file diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index a1a677b..6ea546d 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -61,14 +61,21 @@ export default { if (form && form.link && !form.link.site) form.link.site = siteId if (form && type === 'column' && !form.site) form.site = siteId }) + const { modules } = this // 查询页面详情 this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => { if (data.length) { const json = data[0] this.id = json.id const str = json[json.state ? 'theEditedJson' : 'jsonBeforeEditing'] + const list = JSON.parse(str) this.originModules = str // 原始json,用以页面离开的时候判断是否需要提示保存 - this.modules = JSON.parse(str) + list.map((e, i) => { + if ((e.type === 'banner' || e.type === 'introduce') && !e.originForm) { + e.originForm = modules[i].originForm + } + }) + this.modules = list console.log("🚀 ~ file: index.js ~ line 53 ~ this.$post ~ this.modules", this.modules) } }).catch(err => {}) diff --git a/src/pages/article/add/index.vue b/src/pages/article/add/index.vue index d5c5895..cbbce16 100644 --- a/src/pages/article/add/index.vue +++ b/src/pages/article/add/index.vue @@ -539,7 +539,7 @@ export default { titleImg: '', connectionType : 1, linkAddress: '', - siteSelection: 1, + siteSelection: '', fileList: [], isOpen: 1 }, @@ -804,6 +804,7 @@ export default { limit: 1000, siteName: '' }).then(({ data }) => { + data.records.splice(data.records.findIndex(e => e.id == this.site.id), 1) // 不显示当前站点 this.sites = data.records }).catch(e => {}) }, @@ -1313,7 +1314,7 @@ $upload-lg-height: 102px; display: flex; flex-wrap: wrap; width: 955px; - height: 320px; + // height: 320px; margin-top: 20px; overflow: auto; li { diff --git a/src/pages/column/add/index.vue b/src/pages/column/add/index.vue index 4d346c3..acbd387 100644 --- a/src/pages/column/add/index.vue +++ b/src/pages/column/add/index.vue @@ -186,7 +186,7 @@