发布
@@ -337,10 +397,8 @@ export default {
site: this.$store.state.content.site,
userId: this.$store.state.user.userId,
nameRepeat: false,
- types: ColumnConst.types,
- templates: ColumnConst.templates,
sites: ColumnConst.sites,
- detailStyle: ColumnConst.detailStyle,
+ detailStyle: [],
columns: [],
columnProps: {
checkStrictly: true,
@@ -355,17 +413,30 @@ export default {
editorId: this.$store.state.user.userId,
templateStatus: 0,
articleTemplate: '',
+ doi: '',
+ quote: '',
+ publicationTypeId: '',
+ publicationYear: '',
+ activityEndTime: '',
+ activityStartTime: '',
+ time: '',
+ lectureSeries: '',
+ onlineLocation: '',
+ offlineLocation: '',
+ keynoteSpeaker: '',
+ eventProfile: '',
author: '',
edit: '',
audit: '',
bannerImg: '',
- lableId: '',
+ lableId: [],
classificationId: '',
columnId: +this.$route.query.columnId,
file: '',
isRelease: 0,
mainBody: '',
releaseTime: new Date(),
+ // releaseTime: '',
source: '',
summary : '',
title: '',
@@ -381,6 +452,18 @@ export default {
columnId: [
{ required: true, message: '请选择所属栏目', trigger: 'change' }
],
+ time: [
+ { required: true, message: '请选择起始时间', trigger: 'change' }
+ ],
+ classificationId: [
+ { required: false, message: '请选择所属分类', trigger: 'change' }
+ ],
+ keynoteSpeaker: [
+ { required: true, message: '请输入主讲人', trigger: 'blur' }
+ ],
+ eventProfile: [
+ { required: true, message: '请输入活动简介', trigger: 'blur' }
+ ],
releaseTime: [
{ required: true, message: '请选择发布日期', trigger: 'change' }
],
@@ -394,6 +477,7 @@ export default {
{ required: true, message: '请选择连接类型', trigger: 'blur' }
],
},
+ columnInfo: {},
fileList: [],
editorConfig,
submiting: false, // 新增编辑防抖标识
@@ -466,14 +550,17 @@ export default {
name: '文章管理',
route: '/article'
},
+ {
+ name: this.$route.query.columnName
+ },
{
name: this.$route.query.id ? '编辑' : '新增'
}
])
this.getList()
- this.form.id && this.getData()
- this.getClassification()
+ this.form.id ? this.getData() : this.getColumn()
this.getLabel()
+ this.getTemplate()
},
methods: {
// 获取栏目
@@ -516,21 +603,51 @@ export default {
e.children.length ? this.getId(e.children, e.ids) : delete e.children
})
},
- // 获取详情
+ // 获取文章详情
getData() {
this.$post(`${this.api.findArticle}?id=${this.form.id}`).then(({ data }) => {
data.lableId = data.lableId.split(',').map(e => +e)
+ if (data.activityStartTime && data.activityEndTime) data.time = [data.activityStartTime, data.activityEndTime]
this.form = data
- if (data.articleTemplate === 3 && data.connectionType !== 2 && data.linkAddress) this.links = data.linkAddress.split(',').map(e => +e)
+ // if (data.articleTemplate === 3 && data.connectionType !== 2 && data.linkAddress) this.links = data.linkAddress.split(',').map(e => +e)
this.originalName = data.title
+ this.getColumn()
// const { file } = data
// if (file) this.fileList = [{name: file, url: file}] // 文件上传回显
this.getFile()
}).catch(err => {})
},
+ // 获取栏目详情
+ getColumn() {
+ this.$post(`${this.api.findColumn}?id=${this.$route.query.columnId}`).then(({ data }) => {
+ this.columnInfo = data
+ const { form } = this
+ // 如果独立文章模板未启用,并且该栏目的类型为常规/子级优先,则把栏目所选的详情样式赋值到文章模板;如果栏目类型为长页或者链接,则文章模板默认为文章(23)
+ if (!form.templateStatus) {
+ form.articleTemplate = (data.typeId === 1 || data.typeId === 4) ? data.detailStyleId : 23
+ }
+ // 会议活动
+ if (form.articleTemplate === 25) {
+ this.rules.titleImg[0].required = false
+ this.rules.classificationId[0].required = true
+ }
+ this.getClassification()
+ }).catch(err => {})
+ },
+ // 获取所有模板
+ getTemplate() {
+ this.$post(this.api.individualTemplateDetailsStyle).then(({ data }) => {
+ const result = []
+ data.map(e => {
+ result.find(n => n.style === e.style) || result.push(e)
+ })
+ this.detailStyle = result
+ console.log("🚀 ~ file: index.vue ~ line 642 ~ this.$post ~ data", result)
+ }).catch(err => {})
+ },
// 获取所属分类
getClassification() {
- this.$post(`${this.api.queryClassif}?siteId=${this.site.id}`).then(({ data }) => {
+ this.$post(`${this.api.queryClassif}?siteId=${this.site.id}&templateId=${this.columnInfo.templateId}`).then(({ data }) => {
this.classifications = data
}).catch(err => {})
},
@@ -571,6 +688,7 @@ export default {
this.$post(`${this.api.checkClassif}?classificationName=${row.classificationName}&siteId=${this.site.id}&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateClassif' : 'saveClassif'], {
classificationName: row.classificationName,
+ templateId: this.columnInfo.templateId,
id: row.id,
siteId: this.site.id,
editorId: this.userId,
@@ -754,7 +872,6 @@ export default {
},
// 附件删除
handleRemove(e) {
- console.log("🚀 ~ file: index.vue ~ line 740 ~ handleRemove ~ e", e)
this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => {}).catch(res => {})
},
// banner上传成功
@@ -813,16 +930,21 @@ export default {
const form = JSON.parse(JSON.stringify(this.form))
if (!form.title) return util.errorMsg('请填写标题')
if (this.nameRepeat) return util.errorMsg('该标题已重复!')
- if (!form.releaseTime && isRelease) return util.errorMsg('请选择发布日期')
- if (!form.titleImg && isRelease) return util.errorMsg('请上传封面')
+ // if (!form.releaseTime && isRelease) return util.errorMsg('请选择发布日期')
+ // if (!form.titleImg && isRelease) return util.errorMsg('请上传封面')
if (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
- if (form.articleTemplate === 3 && form.connectionType !== 2) {
- const { links } = this
- if (!links.length && form.connectionType === 1 && isRelease) return util.errorMsg('请选择站内链接')
- if (!links.length && form.connectionType === 3 && isRelease) return util.errorMsg('请选择栏目')
- form.linkAddress = links.join()
+ // if (form.articleTemplate === 24 && form.connectionType !== 2) {
+ // const { links } = this
+ // if (!links.length && form.connectionType === 1 && isRelease) return util.errorMsg('请选择站内链接')
+ // if (!links.length && form.connectionType === 3 && isRelease) return util.errorMsg('请选择栏目')
+ // form.linkAddress = links.join()
+ // }
+ // if (((form.templateStatus && form.articleTemplate === 2) || !form.templateStatus) && !form.mainBody && isRelease) return util.errorMsg('请输入正文')
+ if (form.articleTemplate === 25) {
+ if (!form.time.length && isRelease) return util.errorMsg('请选择起止时间')
+ form.activityStartTime = form.time[0]
+ form.activityEndTime = form.time[1]
}
- if (((form.templateStatus && form.articleTemplate === 2) || !form.templateStatus) && !form.mainBody && isRelease) return util.errorMsg('请输入正文')
const { columnId, bannerImg, file, titleImg } = form
const fileId = []
if (typeof columnId === 'object') form.columnId = columnId[columnId.length - 1] // 如果更换了栏目id,值会变成数组,需要手动获取最后一个
@@ -942,9 +1064,13 @@ $upload-lg-height: 102px;
}
.styles {
display: flex;
+ flex-wrap: wrap;
+ width: 955px;
+ height: 320px;
margin-top: 20px;
+ overflow: auto;
li {
- margin-right: 20px;
+ margin: 0 20px 10px 0;
text-align: center;
cursor: pointer;
&:hover .review {
diff --git a/src/pages/article/list/index.vue b/src/pages/article/list/index.vue
index a25a6f2..7439611 100644
--- a/src/pages/article/list/index.vue
+++ b/src/pages/article/list/index.vue
@@ -55,11 +55,18 @@
{{ scope.row.isRelease ? '已发布' : '草稿' }}
-
+
预览
编辑
删除
+
+
@@ -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 }}
-
-
-
+
+
+ {{ scope.row.typeId === 2 ? '--' : scope.row.templateName }}
+
+
+
+
+ {{ scope.row.typeId === 2 ? '--' : scope.row.listStyle }}
+
+
+
+
+ {{ (scope.row.typeId === 1 || scope.row.typeId === 4) ? scope.row.detailStyle : '--' }}
+
+
{})
},
- // 递归处理列表
- handleList(data) {
- data.map(e => {
- // 获取列表/长页样式名称
- // const item = this[(e.typeId === 1 || e.typeId === 4) ? 'listStyle' : 'pageStyle'].find(n => n.id == e.listStyleId)
- // e.listStyleName = item.name || '--'
- this.$set(e, 'templateName', '--')
- if (e.typeId === 1 || e.typeId === 4) {
- const item = this.templates.find(n => n.id === e.templateId)
- if (item) e.templateName = item.templateType
- } else if (e.typeId === 3) {
- e.templateName = '长页模板'
- }
- this.handleList(e.children)
- })
- },
// 重置列表
initData() {
this.$refs.table.clearSelection()
@@ -277,7 +273,7 @@ export default {
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`)
},
del(row) {
- this.$confirm("确定要删除吗?", "提示", {
+ this.$confirm("删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteColumn}?ids=${row.id}`).then(res => {
@@ -298,18 +294,17 @@ export default {
const item = this.pageStyle.find(e => e.id == row.listStyleId)
if (item) path = item.path
}
- window.open((Setting.isDev ? `http://${location.hostname}:8095` : 'http://192.168.31.136') + `/#/${path}?id=${row.id}&siteId=${row.siteId}`)
+ window.open((Setting.isDev ? `http://${location.hostname}:8095` : 'http://192.168.31.136') + `/#/${row.typeId === 3 ? row.path : 'column'}?id=${row.id}&siteId=${row.siteId}`)
},
// 页面管理
page(row) {
- const item = this.pageStyle.find(e => e.id == row.listStyleId)
- this.$router.push(`${item ? item.path : 'home'}?id=${row.id}&listStyleId=${row.listStyleId}&siteId=${row.siteId}`)
+ this.$router.push(`${row.path}?id=${row.id}&listStyleId=${row.listStyleId}&siteId=${row.siteId}`)
},
// 批量删除
batchDel() {
const list = this.multipleSelection
if (list.length) {
- this.$confirm('确定要删除吗?', '提示', {
+ this.$confirm('删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?', '提示', {
type: 'warning'
}).then(() => {
const data = []
diff --git a/src/pages/column/page/about.vue b/src/pages/column/page/about.vue
index 66a519d..09441f5 100644
--- a/src/pages/column/page/about.vue
+++ b/src/pages/column/page/about.vue
@@ -250,6 +250,7 @@ export default {
}
.bg {
margin: -122px 0 0 0;
+ border-top-right-radius: 40px;
}
}
.card {
@@ -281,6 +282,7 @@ export default {
h6 {
margin-bottom: 10px;
font-size: 40px;
+ font-family: toppan;
}
.des {
font-size: 18px;
@@ -416,6 +418,7 @@ export default {
margin-bottom: 10px;
font-size: 60px;
font-weight: 800;
+ font-family: toppan;
color: #035CE1;
line-height: 49px;
}
diff --git a/src/styles/common.scss b/src/styles/common.scss
index 61e7bf5..958c895 100644
--- a/src/styles/common.scss
+++ b/src/styles/common.scss
@@ -8,6 +8,10 @@
font-family: SFProDisplay-Bold;
src: url('font/SF-Pro-Display-Bold.otf');
}
+@font-face {
+ font-family: toppan;
+ src: url('font/toppan.otf');
+}
[v-cloak] {
display: none;
}
diff --git a/src/styles/font/toppan.otf b/src/styles/font/toppan.otf
new file mode 100644
index 0000000..d216723
Binary files /dev/null and b/src/styles/font/toppan.otf differ