diff --git a/src/components/modules/module.vue b/src/components/modules/module.vue index 878dc34..03f59a5 100644 --- a/src/components/modules/module.vue +++ b/src/components/modules/module.vue @@ -3,214 +3,345 @@ - + - - - - -
- - -
- -

上传图片

-
-
-

只支持.jpg,.png,.mp4格式

-
+ + + + +
+ + +
+ +

上传图片

+
+
+

只支持.jpg,.png,.mp4格式

+
- - 上传视频 + + 上传视频 - - 上传资源 + + 上传资源 - +
-
- +
+ 设置链接
- + - - - - + + + + - - + + - + - 默认读取关联栏目 + 默认读取关联栏目
- - + +
- + 取消 - 确定 + 确定 - - - + + +
@@ -222,6 +353,7 @@ import Editor from '@tinymce/tinymce-vue' import Setting from '@/setting' import Util from '@/libs/util' import editorConfig from '@/components/editor' +import { mapActions } from 'vuex' export default { name: 'module', props: ['data', 'visible'], @@ -231,12 +363,13 @@ export default { Editor, History }, - data() { + data () { return { site: this.$store.state.content.site, headers: { token: Util.local.get(Setting.tokenKey) }, + isVideo: Util.isVideo, rules: {}, linkVisible: false, linkForm: {}, @@ -286,20 +419,31 @@ export default { }; }, watch: { - visible(open) { + visible (open) { // 每次打开的时候处理参数 open && this.handleForm() } }, - mounted() { + mounted () { this.handleForm() }, methods: { + ...mapActions("user", [ + 'logout' + ]), // 处理form表单参数 - handleForm() { + handleForm () { const { type, forms, form } = this.data if (type === 'form') { forms.map(e => { + if (e.type === 'video' || e.type === 'media') { + this.fileList = [ + { + name: form.fileName, + url: form.video || e.pic + } + ] + } // 加必填 if (e.required) { this.rules[e.prop] = [ @@ -330,37 +474,37 @@ export default { form && form.site && this.siteChange(form.site) }, // 站点切换回调 - siteChange(siteId) { + siteChange (siteId) { this.$post(this.api.listWithTree, { siteId, columnName: '', templateId: '', - typeId : '', + typeId: '', isSort: 1 }).then(({ data }) => { this.data.type === 'columns' || this.handleColumn(data) this.columns = data - }).catch(err => {}) + }).catch(err => { }) }, // 递归处理栏目 - handleColumn(data) { + handleColumn (data) { data.map(e => { if (e.typeId === 2 || e.typeId === 3) e.disabled = true e.children.length ? this.handleColumn(e.children) : (delete e.children) }) }, // 栏目切换回调 - columnChange(val) { + columnChange (val) { this.data.form.columnName = this.$refs.links.getCheckedNodes()[0].label }, // 栏目标题切换回调 - columnTitleChange(val) { + columnTitleChange (val) { const { form } = this.data const checked = this.$refs.links.getCheckedNodes() form.columnName = val === 2 ? form.columnTitleCustom : (checked.length ? checked[0].label : '') }, // 添加行 - addRow() { + addRow () { const { type } = this.data if (type === 'banner' || type === 'label' || type === 'customList') { this.data.list.push(JSON.parse(JSON.stringify(this.data.originForm))) @@ -370,31 +514,46 @@ export default { this.editIntro(this.data.originForm, -1) } }, - close() { + close () { this.$emit('update:visible', false) }, // 上传成功 - uploadSuccess(res, row, item = {}) { - this.$set(row, item.type === 'video' ? 'video' : 'pic', res.url) - item.type === 'media' && this.$set(row, 'mediaType', res.title.substr(res.title.lastIndexOf('.') + 1)) + uploadSuccess (res, row, item = {}) { + if (res.code === 401) { + Util.errorMsg("登录过期,请重新登录"); + setTimeout(() => { + this.logout() + }, 1000) + } else { + this.$set(row, item.type === 'video' ? 'video' : 'pic', res.url) + this.$set(row, 'mediaType', res.original.substr(res.original.lastIndexOf('.') + 1)) + this.$set(row, 'fileName', res.original) + } + }, + beforeRemove (file, fileList) { + return this.$confirm(`确定移除 ${file.name}?`); + }, + handleRemove (file, fileList, form, prop) { + form[prop] = '' + form.fileName = '' }, // 删除行(通用) - delRow(list, i) { + delRow (list, i) { this.$confirm('确定要删除吗?', '提示', { type: 'warning' }).then(() => { list.splice(i, 1) - }).catch(() => {}) + }).catch(() => { }) }, // 展示链接设置 - toLink(row, i = 0) { + toLink (row, i = 0) { if (!row.link.linkName) { row.link = { linkName: '无', connectionType: 1, columnId: [], articleId: '', - linkAddress : '', + linkAddress: '', site: this.site.id, otherColumnId: [], otherArticleId: '', @@ -406,13 +565,13 @@ export default { this.linkVisible = true }, // 编辑内容 - editIntro(row, i = 0) { + editIntro (row, i = 0) { this.data.form = JSON.parse(JSON.stringify(row)) this.curModule = i this.contentVisible = true }, // content设置提交 - contentSubmit() { + contentSubmit () { this.contentVisible = false const { form } = this.data if (this.curModule === -1) { @@ -426,7 +585,7 @@ export default { this.data.form = JSON.parse(JSON.stringify(this.data.originForm)) }, // 链接设置提交 - linkSubmit() { + linkSubmit () { const el = this.$refs.link const data = this.data.form ? this.data.form.link : this.data.list[this.curIndex].link let name @@ -457,17 +616,17 @@ export default { this.linkVisible = false }, // 编辑history - editHistory(row, i = 0) { + editHistory (row, i = 0) { this.historyData = row.list this.curModule = i this.historyVisible = true }, // history设置提交 - historySubmit() { + historySubmit () { this.historyVisible = false }, // 模块设置提交 - moduleSubmit() { + moduleSubmit () { this.$emit('moduleSubmit') }, } @@ -475,11 +634,11 @@ export default { \ No newline at end of file diff --git a/src/const/modules.js b/src/const/modules.js index 36509e0..6405a64 100644 --- a/src/const/modules.js +++ b/src/const/modules.js @@ -7946,4 +7946,294 @@ export default { ] }, ], + speech: [ + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'link', + prop: 'link', + label: '链接' + }, + ], + form: { + pic: 'http://10.10.11.7/images/speech/1.png', + title: '关于IASF/院长致辞', + link: { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: '', + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + } + } + }, + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'textarea', + prop: 'subTitle', + label: '小标题' + }, + { + type: 'editor', + prop: 'des', + label: '描述' + } + ], + form: { + pic: 'http://10.10.11.7/images/speech/3.png', + title: '院长致辞 ', + subTitle: 'President Speech ', + des: `各位朋友: + 加快实现高水平科技自立自强,是推动高质量发展的必由之路。当前,粤港澳大湾区正朝着建成具有全球影响力的科技和产业创新高地这一宏伟蓝图奋力前进。而在大科学时代,我们实现科学技术的前沿突破,在产业发展上取得颠覆式创新和持续性创新,从根本上解决气候变暖、重大疾病挑等人类可持续发展问题上,越来越离不开大科学装置的支持。 + 建设综合粒子设施,是深圳推进粤港澳大湾区、深圳先行示范区建设重大战略落地实施,以主阵地作为推进大湾区综合性国家科学中心建设的重要决策部署。项目的建成,不仅将成为支撑大湾区集成电路、生物医药、先进制造、新材料、新能源等众多产业领域创新发展的先进工具和强大平台,也将是面向国家重大需求和国际科学前沿,突破产业技术瓶颈、解决其相关根源性科学问题的大国重器。 + 综合粒子设施一期项目包括深圳产业光源和深圳自由电子激光,自2021年初深圳综合粒子设施研究院筹备建立以来,我们的首要任务便是全力推进两个项目的设计、立项、关键技术突破、核心设备研制等前期准备工作,为接下来工程建设及建成运行打下坚实基础。 + 面对重重挑战,我们坚信没有一座高山不可逾越。我们将牢记深圳市委市政府设立研究院的初心和期望,传承改革开放杀出一条血路的魄力,万众一心,迎难而上,不负众望建设好综合粒子设施,为全体深圳人民及合作伙伴交上一份优质答卷;我们将秉持开放合作的建设理念,面向国内外创新资源敞开共建、共享、共赢的合作大门,携手大湾区创新资源共同建设世界一流大科学装置;我们将坚持需求牵引的宗旨,探索在地方政府主导下,研究机构、高校、企业、金融机构共建重大科技基础设施的新途径,为粤港澳大湾区建设国际科技创新中心提供坚实支撑;我们还将进一步加强与港澳的创新融合,让科学进步之光,照亮大湾区高质量发展之路,点亮东方之珠璀璨的明天。` + } + }, + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + ], + form: { + pic: '', + } + }, + ], + talentCentre: [ + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'link', + prop: 'link', + label: '链接' + }, + ], + form: { + pic: 'http://10.10.11.7/images/talentCentre/1.png', + title: '人才中心', + link: { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: '', + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + } + } + }, + { + type: 'form', + forms: [ + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'editor', + prop: 'des', + label: '描述' + } + ], + form: { + title: '有兴趣将科学转化为创新吗?在IASF建立你的职业生涯。', + des: `在IASF,我们从不同的角度看待世界。我们的科学家和工程师在清洁能源、环境、技术、国家安全等方面进行世界一流的研究。我们正在寻找创造性的方法来让世界为更美好的未来做好准备。 + + 通过选择您感兴趣的机会类型开始。` + } + }, + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'link', + prop: 'link', + label: '链接' + }, + { + type: 'editor', + prop: 'des', + label: '描述' + }, + ], + form: { + pic: 'http://10.10.11.7/images/talentCentre/2.png', + title: '科学研究/工程技术类', + des: `描述`, + link: { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: '', + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + } + } + }, + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'link', + prop: 'link', + label: '链接' + }, + { + type: 'editor', + prop: 'des', + label: '描述' + }, + ], + form: { + pic: 'http://10.10.11.7/images/talentCentre/3.png', + title: '管理服务类', + des: `描述`, + link: { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: '', + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + } + } + }, + ], + contactUs: [ + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + { + type: 'input', + prop: 'title', + label: '标题', + required: true + }, + { + type: 'link', + prop: 'link', + label: '链接' + }, + ], + form: { + pic: 'http://10.10.11.7/images/contactUs/1.png', + title: '联系我们', + link: { + linkName: '无', + connectionType: 1, + columnId: [], + articleId: '', + linkAddress : '', + site: '', + otherColumnId: [], + otherArticleId: '', + isOpen: 1 + } + } + }, + { + type: 'form', + forms: [ + { + type: 'upload', + prop: 'pic', + label: '图片', + required: true + }, + ], + form: { + pic: 'http://10.10.11.7/images/contactUs/2.png', + } + }, + ], } \ No newline at end of file diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index a260856..c9feb7f 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -78,7 +78,7 @@ export default { e.originForm = modules[i].originForm } }) - this.modules = list + // this.modules = list console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", list) } }).catch(err => {}) diff --git a/src/pages/column/page/contactUs.vue b/src/pages/column/page/contactUs.vue new file mode 100644 index 0000000..9ffe97c --- /dev/null +++ b/src/pages/column/page/contactUs.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/src/pages/column/page/speech.vue b/src/pages/column/page/speech.vue new file mode 100644 index 0000000..6ff0499 --- /dev/null +++ b/src/pages/column/page/speech.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/src/pages/column/page/talentCentre.vue b/src/pages/column/page/talentCentre.vue new file mode 100644 index 0000000..b9c834a --- /dev/null +++ b/src/pages/column/page/talentCentre.vue @@ -0,0 +1,195 @@ + + + + + \ No newline at end of file diff --git a/src/router/modules/column.js b/src/router/modules/column.js index 02b118b..d2ec0a1 100644 --- a/src/router/modules/column.js +++ b/src/router/modules/column.js @@ -213,5 +213,13 @@ export default { path: `researchTeam`, component: () => import('@/pages/column/page/researchTeam'), }, + { + path: `speech`, + component: () => import('@/pages/column/page/speech'), + }, + { + path: `talentCentre`, + component: () => import('@/pages/column/page/talentCentre'), + }, ] }