diff --git a/src/api/index.js b/src/api/index.js index 2804b4d..1c0eec9 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -45,6 +45,7 @@ export default { deleteArticle: `iasf/sysContent/batchDeletion`, findArticle: `iasf/sysContent/findById`, queryArticle: `iasf/sysContent/pagingQuery`, + articleEnableOrDisable: `iasf/sysContent/articleEnableOrDisable`, saveArticle: `iasf/sysContent/save`, updateArticle: `iasf/sysContent/update`, longPageColumnList: `iasf/pageManagement/longPageColumnList`, @@ -72,4 +73,6 @@ export default { delContentFile: `iasf/content/file/delete`, saveContentFile: `iasf/content/file/save`, theAttachmentUnderTheQueryColumn: `iasf/content/file/theAttachmentUnderTheQueryColumn`, + individualTemplateDetailsStyle: `iasf/template/individualTemplateDetailsStyle`, + longPageListStyle: `iasf/template/longPageListStyle`, } \ No newline at end of file diff --git a/src/components/modules/module.vue b/src/components/modules/module.vue index 9521e1a..5c0b989 100644 --- a/src/components/modules/module.vue +++ b/src/components/modules/module.vue @@ -231,11 +231,19 @@ export default { columnName: '', templateId: '', typeId : '', - isSort: 0 + isSort: 1 }).then(({ data }) => { + this.data.type === 'columns' || this.handleColumn(data) this.columns = data }).catch(err => {}) }, + // 递归处理栏目 + 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) { this.data.form.columnName = this.$refs.links.getCheckedNodes()[0].label diff --git a/src/const/column.js b/src/const/column.js index 5251fed..25a7535 100644 --- a/src/const/column.js +++ b/src/const/column.js @@ -22,47 +22,6 @@ export default { name: '子级优先栏目' } ], - // 栏目模板 - templates: [ - { - id: 1, - name: '文章' - }, - { - id: 2, - name: '文库' - }, - ], - // 列表样式 - listStyle: [ - { - id: 1, - name: '图片列表' - }, - { - id: 2, - name: '新闻列表' - }, - { - id: 3, - name: '出版物列表' - } - ], - // 详情样式 - detailStyle: [ - { - id: 1, - name: '视频详情' - }, - { - id: 2, - name: '富文本' - }, - { - id: 3, - name: '链接' - } - ], // 长页样式 pageStyle: [ { diff --git a/src/const/modules.js b/src/const/modules.js index ea065ec..9e2a2df 100644 --- a/src/const/modules.js +++ b/src/const/modules.js @@ -1877,7 +1877,7 @@ export default { otherArticleId: '', isOpen: 1 }, - des: '' + des: 'The Institute of Advanced Science Facilities in Shenzhen, China is home to world-class science, world-class facilities, and world-class people. Located 25 miles east of Shenzhen city center, on a 1.2 acre campus, IASF has over three hundred researchers and support staff.…' } }, { diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index 3a060d6..683651c 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -45,6 +45,7 @@ export default { if (form && form.link && !form.link.site) form.link.site = siteId if (form && type === 'column' && !form.site) form.site = siteId }) + console.log(555, this.modules) // 查询页面详情 this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => { if (data.length) { diff --git a/src/pages/article/add/index.vue b/src/pages/article/add/index.vue index 824eeb3..80d583b 100644 --- a/src/pages/article/add/index.vue +++ b/src/pages/article/add/index.vue @@ -20,9 +20,9 @@ @@ -47,7 +47,20 @@ :props="columnProps" clearable> - + + + + + 设置 + + - + + + + + -
+
+ + + + + + +
+
@@ -95,13 +135,42 @@ placeholder="请输入审核" v-model.trim="form.audit" clearable - maxlength="15" + maxlength="50" class="inline-input" - @change="nameChange" >
-
+ + +
- + @@ -270,11 +277,15 @@ export default { }).catch(res => {}) }).catch(() => {}) }, + // 禁用启用 + switchOff(val, row) { + this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {}) + }, // 新增 add() { if (!this.columns.length) return util.errorMsg('请添加栏目') this.setColumn(this.$refs.column.getCurrentNode()) - this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}`) + this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) }, // 预览 preview(row) { @@ -282,7 +293,7 @@ export default { }, // 编辑 edit(row) { - this.$router.push(`add?id=${row.id}`) + this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) }, } }; diff --git a/src/pages/column/add/index.vue b/src/pages/column/add/index.vue index 9627f37..5e8c295 100644 --- a/src/pages/column/add/index.vue +++ b/src/pages/column/add/index.vue @@ -67,7 +67,7 @@ @@ -180,7 +180,7 @@ + :value="9"> @@ -190,7 +190,7 @@
- {{ item.name }} + {{ item.style }} @@ -237,7 +237,7 @@ export default { detailStyleId: [], types: ColumnConst.types, templates: [], - pageStyle: ColumnConst.pageStyle, + pageStyle: [], sites: [], columns: [], articles: [], @@ -455,8 +455,9 @@ export default { typeChange(val) { if (val === 1 || val === 4) { this.form.templateId = 1 - this.getStyle() + } else if (val == 3) { + this.form.templateId = 9 } }, // 获取栏目模板 @@ -465,6 +466,10 @@ export default { this.templates = data this.isEdit || this.getStyle() }).catch(err => {}) + + this.$post(this.api.longPageListStyle).then(({ data }) => { + this.pageStyle = data + }).catch(err => {}) }, // 根据模板id获取样式 getStyle(set = 1) { @@ -653,7 +658,7 @@ export default { } else { this.$post(this.api.saveColumn, form).then(({ data }) => { // 栏目类型选择了长页栏目,才需要保存长页 - // form.typeId === 3 && this.savePage(data) + form.typeId === 3 && this.savePage(data) util.successMsg("创建成功") next ? next() : this.$router.back() }).catch(err => { diff --git a/src/pages/column/list/index.vue b/src/pages/column/list/index.vue index 2e3b0fb..3d8bbe9 100644 --- a/src/pages/column/list/index.vue +++ b/src/pages/column/list/index.vue @@ -31,9 +31,21 @@ {{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }} - - - + + + + + + + + +