文章栏目模板联调

master
yujialong 2 years ago
parent e574a488b2
commit 9fef54b793
  1. 3
      src/api/index.js
  2. 10
      src/components/modules/module.vue
  3. 41
      src/const/column.js
  4. 2
      src/const/modules.js
  5. 1
      src/mixins/page/index.js
  6. 250
      src/pages/article/add/index.vue
  7. 17
      src/pages/article/list/index.vue
  8. 17
      src/pages/column/add/index.vue
  9. 45
      src/pages/column/list/index.vue
  10. 3
      src/pages/column/page/about.vue
  11. 4
      src/styles/common.scss
  12. BIN
      src/styles/font/toppan.otf

@ -45,6 +45,7 @@ export default {
deleteArticle: `iasf/sysContent/batchDeletion`, deleteArticle: `iasf/sysContent/batchDeletion`,
findArticle: `iasf/sysContent/findById`, findArticle: `iasf/sysContent/findById`,
queryArticle: `iasf/sysContent/pagingQuery`, queryArticle: `iasf/sysContent/pagingQuery`,
articleEnableOrDisable: `iasf/sysContent/articleEnableOrDisable`,
saveArticle: `iasf/sysContent/save`, saveArticle: `iasf/sysContent/save`,
updateArticle: `iasf/sysContent/update`, updateArticle: `iasf/sysContent/update`,
longPageColumnList: `iasf/pageManagement/longPageColumnList`, longPageColumnList: `iasf/pageManagement/longPageColumnList`,
@ -72,4 +73,6 @@ export default {
delContentFile: `iasf/content/file/delete`, delContentFile: `iasf/content/file/delete`,
saveContentFile: `iasf/content/file/save`, saveContentFile: `iasf/content/file/save`,
theAttachmentUnderTheQueryColumn: `iasf/content/file/theAttachmentUnderTheQueryColumn`, theAttachmentUnderTheQueryColumn: `iasf/content/file/theAttachmentUnderTheQueryColumn`,
individualTemplateDetailsStyle: `iasf/template/individualTemplateDetailsStyle`,
longPageListStyle: `iasf/template/longPageListStyle`,
} }

@ -231,11 +231,19 @@ export default {
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId : '',
isSort: 0 isSort: 1
}).then(({ data }) => { }).then(({ data }) => {
this.data.type === 'columns' || this.handleColumn(data)
this.columns = data this.columns = data
}).catch(err => {}) }).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) { columnChange(val) {
this.data.form.columnName = this.$refs.links.getCheckedNodes()[0].label this.data.form.columnName = this.$refs.links.getCheckedNodes()[0].label

@ -22,47 +22,6 @@ export default {
name: '子级优先栏目' 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: [ pageStyle: [
{ {

@ -1877,7 +1877,7 @@ export default {
otherArticleId: '', otherArticleId: '',
isOpen: 1 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.…'
} }
}, },
{ {

@ -45,6 +45,7 @@ export default {
if (form && form.link && !form.link.site) form.link.site = siteId if (form && form.link && !form.link.site) form.link.site = siteId
if (form && type === 'column' && !form.site) form.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 }) => { this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => {
if (data.length) { if (data.length) {

@ -20,9 +20,9 @@
<template v-for="(item, i) in detailStyle"> <template v-for="(item, i) in detailStyle">
<li v-if="item.id !== column.detailStyle" :key="i" @click="form.articleTemplate = item.id"> <li v-if="item.id !== column.detailStyle" :key="i" @click="form.articleTemplate = item.id">
<div class="review"> <div class="review">
<img :src="require('@/assets/images/article' + item.id + '.png')" alt=""> <!-- <img :src="require('@/assets/images/article' + item.id + '.png')" alt=""> -->
</div> </div>
<el-radio v-model="form.articleTemplate" :label="item.id">{{ item.name }}</el-radio> <el-radio v-model="form.articleTemplate" :label="item.id">{{ item.style }}</el-radio>
</li> </li>
</template> </template>
</ul> </ul>
@ -47,7 +47,20 @@
:props="columnProps" :props="columnProps"
clearable></el-cascader> clearable></el-cascader>
</el-form-item> </el-form-item>
<el-form-item prop="releaseTime" label="发布日期"> <el-form-item v-if="form.articleTemplate === 25" prop="classificationId" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId">
<template v-for="item in classifications">
<el-option
v-if="item.classificationName"
:key="item.id"
:label="item.classificationName"
:value="item.id">
</el-option>
</template>
</el-select>
<el-button class="set-btn" type="primary" @click="setClass">设置</el-button>
</el-form-item>
<el-form-item v-else prop="releaseTime" label="发布日期">
<el-date-picker <el-date-picker
v-model="form.releaseTime" v-model="form.releaseTime"
type="date" type="date"
@ -63,31 +76,58 @@
placeholder="请输入来源" placeholder="请输入来源"
v-model.trim="form.source" v-model.trim="form.source"
clearable clearable
maxlength="15" maxlength="50"
class="inline-input" class="inline-input"
@change="nameChange"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="author" label="作者"> <el-form-item v-if="form.articleTemplate === 25" prop="time" label="起止时间">
<el-date-picker
style="width: 300px"
v-model="form.time"
type="datetimerange"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item v-else prop="author" label="作者">
<el-input <el-input
placeholder="请输入作者" placeholder="请输入作者"
v-model.trim="form.author" v-model.trim="form.author"
clearable clearable
maxlength="200" maxlength="200"
class="inline-input" class="inline-input"
@change="nameChange"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="item-line"> <div v-if="form.articleTemplate === 25" class="item-line">
<el-form-item prop="lectureSeries" label="演讲系列">
<el-input
placeholder="请输入演讲系列"
v-model.trim="form.lectureSeries"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
<el-form-item prop="onlineLocation" label="线上地点">
<el-input
placeholder="请输入线上地点"
v-model.trim="form.onlineLocation"
clearable
maxlength="50"
class="inline-input"
></el-input>
</el-form-item>
</div>
<div v-if="form.articleTemplate === 22" class="item-line">
<el-form-item prop="edit" label="编辑"> <el-form-item prop="edit" label="编辑">
<el-input <el-input
placeholder="请输入编辑" placeholder="请输入编辑"
v-model.trim="form.edit" v-model.trim="form.edit"
clearable clearable
maxlength="15" maxlength="50"
class="inline-input" class="inline-input"
@change="nameChange"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="audit" label="审核"> <el-form-item prop="audit" label="审核">
@ -95,13 +135,42 @@
placeholder="请输入审核" placeholder="请输入审核"
v-model.trim="form.audit" v-model.trim="form.audit"
clearable clearable
maxlength="15" maxlength="50"
class="inline-input" class="inline-input"
@change="nameChange"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</div> </div>
<div class="item-line"> <template v-if="form.articleTemplate === 25">
<el-form-item prop="offlineLocation" label="线下地点">
<el-input
style="width: 940px"
placeholder="请输入线下地点"
v-model="form.offlineLocation"
clearable
maxlength="100"
></el-input>
</el-form-item>
<el-form-item prop="keynoteSpeaker" label="主讲人">
<el-input
style="width: 940px"
placeholder="请输入主讲人"
v-model="form.keynoteSpeaker"
clearable
maxlength="100"
></el-input>
</el-form-item>
<el-form-item prop="eventProfile" label="活动简介">
<el-input
style="width: 940px"
placeholder="请输入活动简介"
v-model="form.eventProfile"
type="textarea"
clearable
></el-input>
</el-form-item>
</template>
<div v-if="form.articleTemplate === 22" class="item-line">
<el-form-item prop="source" label="所属分类"> <el-form-item prop="source" label="所属分类">
<el-select style="width: 234px;" v-model="form.classificationId"> <el-select style="width: 234px;" v-model="form.classificationId">
<template v-for="item in classifications"> <template v-for="item in classifications">
@ -129,7 +198,7 @@
<el-button class="set-btn" type="primary" @click="setLabel">设置</el-button> <el-button class="set-btn" type="primary" @click="setLabel">设置</el-button>
</el-form-item> </el-form-item>
</div> </div>
<el-form-item prop="summary" label="摘要"> <el-form-item v-if="form.articleTemplate === 22" prop="summary" label="摘要">
<el-input <el-input
style="width: 940px" style="width: 940px"
type="textarea" type="textarea"
@ -138,7 +207,7 @@
clearable clearable
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="titleImg" label="封面图"> <el-form-item prop="titleImg" :label="form.articleTemplate === 25 ? '标题图' : '封面图'">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
accept=".jpg,.png,.jpeg,.gif" accept=".jpg,.png,.jpeg,.gif"
@ -170,27 +239,25 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<template v-if="!form.templateStatus || (form.templateStatus && form.articleTemplate === 2)"> <el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 25" prop="mainBody" label="正文">
<el-form-item prop="mainBody" label="正文"> <Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" />
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="form.mainBody" :init="editorConfig" /> </el-form-item>
</el-form-item> <el-form-item v-if="form.articleTemplate === 22 || form.articleTemplate === 25" prop="file" label="文件上传">
<el-form-item prop="file" label="文件上传"> <el-upload
<el-upload :on-remove="handleRemove"
:on-remove="handleRemove" :on-success="uploadSuccessFile"
:on-success="uploadSuccessFile" :action="this.api.upload"
:action="this.api.upload" :file-list="fileList"
:file-list="fileList" :data="{
:data="{ quote: form.title,
quote: form.title, site: site.siteName,
site: site.siteName, uploader: userName
uploader: userName }"
}" >
> <el-button>上传</el-button>
<el-button>上传</el-button> </el-upload>
</el-upload> </el-form-item>
</el-form-item> <template v-if="form.articleTemplate === 24">
</template>
<template v-if="form.articleTemplate === 3">
<el-form-item prop="connectionType" label="连接类型"> <el-form-item prop="connectionType" label="连接类型">
<el-radio-group v-model="form.connectionType"> <el-radio-group v-model="form.connectionType">
<el-radio :label="1">站内链接</el-radio> <el-radio :label="1">站内链接</el-radio>
@ -232,13 +299,6 @@
</el-form-item> </el-form-item>
</template> </template>
</template> </template>
<el-form-item v-show="form.typeId === 4" prop="showWithDetails" label="栏目">
<el-switch
v-model="form.showWithDetails"
:active-value="1"
:inactive-value="0">
</el-switch>
</el-form-item>
</el-form> </el-form>
<div class="btns"> <div class="btns">
<el-button type="primary" @click="submit(1)">发布</el-button> <el-button type="primary" @click="submit(1)">发布</el-button>
@ -337,10 +397,8 @@ export default {
site: this.$store.state.content.site, site: this.$store.state.content.site,
userId: this.$store.state.user.userId, userId: this.$store.state.user.userId,
nameRepeat: false, nameRepeat: false,
types: ColumnConst.types,
templates: ColumnConst.templates,
sites: ColumnConst.sites, sites: ColumnConst.sites,
detailStyle: ColumnConst.detailStyle, detailStyle: [],
columns: [], columns: [],
columnProps: { columnProps: {
checkStrictly: true, checkStrictly: true,
@ -355,17 +413,30 @@ export default {
editorId: this.$store.state.user.userId, editorId: this.$store.state.user.userId,
templateStatus: 0, templateStatus: 0,
articleTemplate: '', articleTemplate: '',
doi: '',
quote: '',
publicationTypeId: '',
publicationYear: '',
activityEndTime: '',
activityStartTime: '',
time: '',
lectureSeries: '',
onlineLocation: '',
offlineLocation: '',
keynoteSpeaker: '',
eventProfile: '',
author: '', author: '',
edit: '', edit: '',
audit: '', audit: '',
bannerImg: '', bannerImg: '',
lableId: '', lableId: [],
classificationId: '', classificationId: '',
columnId: +this.$route.query.columnId, columnId: +this.$route.query.columnId,
file: '', file: '',
isRelease: 0, isRelease: 0,
mainBody: '', mainBody: '',
releaseTime: new Date(), releaseTime: new Date(),
// releaseTime: '',
source: '', source: '',
summary : '', summary : '',
title: '', title: '',
@ -381,6 +452,18 @@ export default {
columnId: [ columnId: [
{ required: true, message: '请选择所属栏目', trigger: 'change' } { 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: [ releaseTime: [
{ required: true, message: '请选择发布日期', trigger: 'change' } { required: true, message: '请选择发布日期', trigger: 'change' }
], ],
@ -394,6 +477,7 @@ export default {
{ required: true, message: '请选择连接类型', trigger: 'blur' } { required: true, message: '请选择连接类型', trigger: 'blur' }
], ],
}, },
columnInfo: {},
fileList: [], fileList: [],
editorConfig, editorConfig,
submiting: false, // submiting: false, //
@ -466,14 +550,17 @@ export default {
name: '文章管理', name: '文章管理',
route: '/article' route: '/article'
}, },
{
name: this.$route.query.columnName
},
{ {
name: this.$route.query.id ? '编辑' : '新增' name: this.$route.query.id ? '编辑' : '新增'
} }
]) ])
this.getList() this.getList()
this.form.id && this.getData() this.form.id ? this.getData() : this.getColumn()
this.getClassification()
this.getLabel() this.getLabel()
this.getTemplate()
}, },
methods: { methods: {
// //
@ -516,21 +603,51 @@ export default {
e.children.length ? this.getId(e.children, e.ids) : delete e.children e.children.length ? this.getId(e.children, e.ids) : delete e.children
}) })
}, },
// //
getData() { getData() {
this.$post(`${this.api.findArticle}?id=${this.form.id}`).then(({ data }) => { this.$post(`${this.api.findArticle}?id=${this.form.id}`).then(({ data }) => {
data.lableId = data.lableId.split(',').map(e => +e) data.lableId = data.lableId.split(',').map(e => +e)
if (data.activityStartTime && data.activityEndTime) data.time = [data.activityStartTime, data.activityEndTime]
this.form = data 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.originalName = data.title
this.getColumn()
// const { file } = data // const { file } = data
// if (file) this.fileList = [{name: file, url: file}] // // if (file) this.fileList = [{name: file, url: file}] //
this.getFile() this.getFile()
}).catch(err => {}) }).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() { 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 this.classifications = data
}).catch(err => {}) }).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.checkClassif}?classificationName=${row.classificationName}&siteId=${this.site.id}&classificationId=${row.id}`).then(res => {
this.$post(this.api[row.id ? 'updateClassif' : 'saveClassif'], { this.$post(this.api[row.id ? 'updateClassif' : 'saveClassif'], {
classificationName: row.classificationName, classificationName: row.classificationName,
templateId: this.columnInfo.templateId,
id: row.id, id: row.id,
siteId: this.site.id, siteId: this.site.id,
editorId: this.userId, editorId: this.userId,
@ -754,7 +872,6 @@ export default {
}, },
// //
handleRemove(e) { handleRemove(e) {
console.log("🚀 ~ file: index.vue ~ line 740 ~ handleRemove ~ e", e)
this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => {}).catch(res => {}) this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => {}).catch(res => {})
}, },
// banner // banner
@ -813,16 +930,21 @@ export default {
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
if (!form.title) return util.errorMsg('请填写标题') if (!form.title) return util.errorMsg('请填写标题')
if (this.nameRepeat) return util.errorMsg('该标题已重复!') if (this.nameRepeat) return util.errorMsg('该标题已重复!')
if (!form.releaseTime && isRelease) return util.errorMsg('请选择发布日期') // if (!form.releaseTime && isRelease) return util.errorMsg('')
if (!form.titleImg && 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 (typeof form.fatherId === 'object') form.fatherId = form.fatherId[form.fatherId.length - 1]
if (form.articleTemplate === 3 && form.connectionType !== 2) { // if (form.articleTemplate === 24 && form.connectionType !== 2) {
const { links } = this // const { links } = this
if (!links.length && form.connectionType === 1 && isRelease) return util.errorMsg('请选择站内链接') // if (!links.length && form.connectionType === 1 && isRelease) return util.errorMsg('')
if (!links.length && form.connectionType === 3 && isRelease) return util.errorMsg('请选择栏目') // if (!links.length && form.connectionType === 3 && isRelease) return util.errorMsg('')
form.linkAddress = links.join() // 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 { columnId, bannerImg, file, titleImg } = form
const fileId = [] const fileId = []
if (typeof columnId === 'object') form.columnId = columnId[columnId.length - 1] // id if (typeof columnId === 'object') form.columnId = columnId[columnId.length - 1] // id
@ -942,9 +1064,13 @@ $upload-lg-height: 102px;
} }
.styles { .styles {
display: flex; display: flex;
flex-wrap: wrap;
width: 955px;
height: 320px;
margin-top: 20px; margin-top: 20px;
overflow: auto;
li { li {
margin-right: 20px; margin: 0 20px 10px 0;
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
&:hover .review { &:hover .review {

@ -55,11 +55,18 @@
{{ scope.row.isRelease ? '已发布' : '草稿' }} {{ scope.row.isRelease ? '已发布' : '草稿' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[10].show" label="操作" align="center" width="140"> <el-table-column v-if="settings[10].show" label="操作" align="center" width="170">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" type="text" @click="preview(scope.row)">预览</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" type="text" @click="preview(scope.row)">预览</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
<el-switch
class="m-l-10"
v-model="scope.row.isDisable"
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row, scope.$index)">
</el-switch>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -270,11 +277,15 @@ export default {
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
}, },
//
switchOff(val, row) {
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {})
},
// //
add() { add() {
if (!this.columns.length) return util.errorMsg('请添加栏目') if (!this.columns.length) return util.errorMsg('请添加栏目')
this.setColumn(this.$refs.column.getCurrentNode()) 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) { preview(row) {
@ -282,7 +293,7 @@ export default {
}, },
// //
edit(row) { 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}`)
}, },
} }
}; };

@ -67,7 +67,7 @@
<el-input <el-input
type="textarea" type="textarea"
placeholder="请输入栏目副标题" placeholder="请输入栏目副标题"
v-model.trim="form.subtitle" v-model="form.subtitle"
@change="nameChange" @change="nameChange"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -180,7 +180,7 @@
<el-select v-model="form.templateId"> <el-select v-model="form.templateId">
<el-option <el-option
label="长页模板" label="长页模板"
:value="1"> :value="9">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -190,7 +190,7 @@
<div class="review"> <div class="review">
<img :src="require('@/assets/images/page/' + item.path + '.png')" alt=""> <img :src="require('@/assets/images/page/' + item.path + '.png')" alt="">
</div> </div>
<el-radio v-model="form.listStyleId" :label="item.id">{{ item.name }}</el-radio> <el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio>
</li> </li>
</ul> </ul>
</el-form-item> </el-form-item>
@ -237,7 +237,7 @@ export default {
detailStyleId: [], detailStyleId: [],
types: ColumnConst.types, types: ColumnConst.types,
templates: [], templates: [],
pageStyle: ColumnConst.pageStyle, pageStyle: [],
sites: [], sites: [],
columns: [], columns: [],
articles: [], articles: [],
@ -455,8 +455,9 @@ export default {
typeChange(val) { typeChange(val) {
if (val === 1 || val === 4) { if (val === 1 || val === 4) {
this.form.templateId = 1 this.form.templateId = 1
this.getStyle() this.getStyle()
} else if (val == 3) {
this.form.templateId = 9
} }
}, },
// //
@ -465,6 +466,10 @@ export default {
this.templates = data this.templates = data
this.isEdit || this.getStyle() this.isEdit || this.getStyle()
}).catch(err => {}) }).catch(err => {})
this.$post(this.api.longPageListStyle).then(({ data }) => {
this.pageStyle = data
}).catch(err => {})
}, },
// id // id
getStyle(set = 1) { getStyle(set = 1) {
@ -653,7 +658,7 @@ export default {
} else { } else {
this.$post(this.api.saveColumn, form).then(({ data }) => { this.$post(this.api.saveColumn, form).then(({ data }) => {
// //
// form.typeId === 3 && this.savePage(data) form.typeId === 3 && this.savePage(data)
util.successMsg("创建成功") util.successMsg("创建成功")
next ? next() : this.$router.back() next ? next() : this.$router.back()
}).catch(err => { }).catch(err => {

@ -31,9 +31,21 @@
{{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }} {{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="settings[2].show" prop="templateName" label="栏目模板" min-width="100"></el-table-column> <el-table-column v-if="settings[2].show" prop="templateName" label="栏目模板" min-width="100">
<el-table-column v-if="settings[3].show" prop="listStyle" label="列表/长页样式" min-width="100"></el-table-column> <template slot-scope="scope">
<el-table-column v-if="settings[4].show" prop="detailStyle" label="详情样式" min-width="100"></el-table-column> {{ scope.row.typeId === 2 ? '--' : scope.row.templateName }}
</template>
</el-table-column>
<el-table-column v-if="settings[3].show" prop="listStyle" label="列表/长页样式" min-width="100">
<template slot-scope="scope">
{{ scope.row.typeId === 2 ? '--' : scope.row.listStyle }}
</template>
</el-table-column>
<el-table-column v-if="settings[4].show" prop="detailStyle" label="详情样式" min-width="100">
<template slot-scope="scope">
{{ (scope.row.typeId === 1 || scope.row.typeId === 4) ? scope.row.detailStyle : '--' }}
</template>
</el-table-column>
<el-table-column v-if="settings[5].show" prop="menuVisible" label="导航菜单" min-width="100"> <el-table-column v-if="settings[5].show" prop="menuVisible" label="导航菜单" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@ -138,7 +150,7 @@ export default {
types: ColumnConst.types, types: ColumnConst.types,
templates: [], templates: [],
listStyle: [], listStyle: [],
pageStyle: ColumnConst.pageStyle, pageStyle: [],
detailStyle: [], detailStyle: [],
keyword: '', keyword: '',
searchTimer: null, searchTimer: null,
@ -244,22 +256,6 @@ export default {
this.detailStyle = data.detailsTypeOfTheTemplate this.detailStyle = data.detailsTypeOfTheTemplate
}).catch(err => {}) }).catch(err => {})
}, },
//
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() { initData() {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
@ -277,7 +273,7 @@ export default {
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`) this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`)
}, },
del(row) { del(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteColumn}?ids=${row.id}`).then(res => { 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) const item = this.pageStyle.find(e => e.id == row.listStyleId)
if (item) path = item.path 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) { page(row) {
const item = this.pageStyle.find(e => e.id == row.listStyleId) this.$router.push(`${row.path}?id=${row.id}&listStyleId=${row.listStyleId}&siteId=${row.siteId}`)
this.$router.push(`${item ? item.path : 'home'}?id=${row.id}&listStyleId=${row.listStyleId}&siteId=${row.siteId}`)
}, },
// //
batchDel() { batchDel() {
const list = this.multipleSelection const list = this.multipleSelection
if (list.length) { if (list.length) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const data = [] const data = []

@ -250,6 +250,7 @@ export default {
} }
.bg { .bg {
margin: -122px 0 0 0; margin: -122px 0 0 0;
border-top-right-radius: 40px;
} }
} }
.card { .card {
@ -281,6 +282,7 @@ export default {
h6 { h6 {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 40px; font-size: 40px;
font-family: toppan;
} }
.des { .des {
font-size: 18px; font-size: 18px;
@ -416,6 +418,7 @@ export default {
margin-bottom: 10px; margin-bottom: 10px;
font-size: 60px; font-size: 60px;
font-weight: 800; font-weight: 800;
font-family: toppan;
color: #035CE1; color: #035CE1;
line-height: 49px; line-height: 49px;
} }

@ -8,6 +8,10 @@
font-family: SFProDisplay-Bold; font-family: SFProDisplay-Bold;
src: url('font/SF-Pro-Display-Bold.otf'); src: url('font/SF-Pro-Display-Bold.otf');
} }
@font-face {
font-family: toppan;
src: url('font/toppan.otf');
}
[v-cloak] { [v-cloak] {
display: none; display: none;
} }

Binary file not shown.
Loading…
Cancel
Save