|
|
@ -18,7 +18,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<ul v-if="form.templateStatus" class="styles"> |
|
|
|
<ul v-if="form.templateStatus" class="styles"> |
|
|
|
<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="styleChange(item.id)"> |
|
|
|
<div class="review"> |
|
|
|
<div class="review"> |
|
|
|
<img :class="{'is-link': item.id == 24}" :src="require('@/assets/images/style/' + item.id + '.png')" alt=""> |
|
|
|
<img :class="{'is-link': item.id == 24}" :src="require('@/assets/images/style/' + item.id + '.png')" alt=""> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -321,14 +321,27 @@ |
|
|
|
<el-radio :label="3">其他站点链接</el-radio> |
|
|
|
<el-radio :label="3">其他站点链接</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-show="form.connectionType === 1" prop="connectionType" label="站内链接"> |
|
|
|
<template v-if="form.connectionType === 1"> |
|
|
|
|
|
|
|
<el-form-item label="站内链接"> |
|
|
|
<el-cascader |
|
|
|
<el-cascader |
|
|
|
v-model="links" |
|
|
|
v-model="links" |
|
|
|
:options="columns" |
|
|
|
:options="columns" |
|
|
|
:props="columnProps" |
|
|
|
:props="columnProps" |
|
|
|
clearable></el-cascader> |
|
|
|
clearable |
|
|
|
|
|
|
|
@change="getArticle"></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-show="form.connectionType === 2" prop="connectionType" label="站内链接"> |
|
|
|
<el-form-item label="文章"> |
|
|
|
|
|
|
|
<el-select v-model="article" clearable> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="item in articles" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.title" |
|
|
|
|
|
|
|
:value="item.id"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
placeholder="请输入站外链接" |
|
|
|
placeholder="请输入站外链接" |
|
|
|
v-model.trim="form.linkAddress" |
|
|
|
v-model.trim="form.linkAddress" |
|
|
@ -351,9 +364,27 @@ |
|
|
|
v-model="otherLink" |
|
|
|
v-model="otherLink" |
|
|
|
:options="otherColumns" |
|
|
|
:options="otherColumns" |
|
|
|
:props="columnProps" |
|
|
|
:props="columnProps" |
|
|
|
clearable></el-cascader> |
|
|
|
clearable |
|
|
|
|
|
|
|
@change="getArticle"></el-cascader> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="文章"> |
|
|
|
|
|
|
|
<el-select v-model="otherArticle" clearable> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="item in otherArticles" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.title" |
|
|
|
|
|
|
|
:value="item.id"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<el-form-item prop="isOpen" label="新窗口打开"> |
|
|
|
|
|
|
|
<el-switch |
|
|
|
|
|
|
|
v-model="form.isOpen" |
|
|
|
|
|
|
|
:active-value="1" |
|
|
|
|
|
|
|
:inactive-value="0"> |
|
|
|
|
|
|
|
</el-switch> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<div class="btns"> |
|
|
|
<div class="btns"> |
|
|
@ -458,16 +489,20 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
nameRepeat: false, |
|
|
|
nameRepeat: false, |
|
|
|
sites: [], |
|
|
|
sites: [], |
|
|
|
otherColumns: [], |
|
|
|
|
|
|
|
otherLink: [], |
|
|
|
|
|
|
|
detailStyle: [], |
|
|
|
detailStyle: [], |
|
|
|
columns: [], |
|
|
|
columns: [], |
|
|
|
|
|
|
|
articles: [], |
|
|
|
|
|
|
|
otherArticles: [], |
|
|
|
columnProps: { |
|
|
|
columnProps: { |
|
|
|
checkStrictly: true, |
|
|
|
checkStrictly: true, |
|
|
|
value: 'id', |
|
|
|
value: 'id', |
|
|
|
label: 'columnName' |
|
|
|
label: 'columnName' |
|
|
|
}, |
|
|
|
}, |
|
|
|
links: [], |
|
|
|
links: [], |
|
|
|
|
|
|
|
article: '', |
|
|
|
|
|
|
|
otherColumns: [], |
|
|
|
|
|
|
|
otherLink: [], |
|
|
|
|
|
|
|
otherArticle: '', |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
id: this.$route.query.id || '', |
|
|
|
id: this.$route.query.id || '', |
|
|
@ -505,7 +540,8 @@ export default { |
|
|
|
connectionType : 1, |
|
|
|
connectionType : 1, |
|
|
|
linkAddress: '', |
|
|
|
linkAddress: '', |
|
|
|
siteSelection: 1, |
|
|
|
siteSelection: 1, |
|
|
|
fileList: [] |
|
|
|
fileList: [], |
|
|
|
|
|
|
|
isOpen: 1 |
|
|
|
}, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
rules: { |
|
|
|
title: [ |
|
|
|
title: [ |
|
|
@ -668,6 +704,22 @@ 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 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 文章列表 |
|
|
|
|
|
|
|
getArticle() { |
|
|
|
|
|
|
|
// 站内链接/其他站点链接 |
|
|
|
|
|
|
|
const inner = this.form.connectionType === 1 |
|
|
|
|
|
|
|
const id = inner ? this.links[this.links.length - 1] : this.otherLink[this.otherLink.length - 1] |
|
|
|
|
|
|
|
this[inner ? 'article' : 'otherArticle'] = '' |
|
|
|
|
|
|
|
this.$post(this.api.queryArticle, { |
|
|
|
|
|
|
|
siteId: inner ? this.site.id : this.form.siteSelection, |
|
|
|
|
|
|
|
columnIds: [id], |
|
|
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
|
|
pageSize: 1000, |
|
|
|
|
|
|
|
title: '' |
|
|
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
|
|
this[inner ? 'articles' : 'otherArticles'] = data.records.filter(e => e.isRelease) // 只显示已发布的文章 |
|
|
|
|
|
|
|
}).catch(err => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 获取文章详情 |
|
|
|
// 获取文章详情 |
|
|
|
getData() { |
|
|
|
getData() { |
|
|
|
this.$post(`${this.api.findArticle}?id=${this.form.id}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.findArticle}?id=${this.form.id}`).then(({ data }) => { |
|
|
@ -681,14 +733,36 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
// 链接回显 |
|
|
|
// 链接回显 |
|
|
|
if (data.articleTemplate === 24 && data.connectionType !== 2 && data.linkAddress) { |
|
|
|
if (data.articleTemplate === 24 && data.connectionType !== 2 && data.linkAddress) { |
|
|
|
const links = data.linkAddress.split(',').map(e => +e) |
|
|
|
const columnArticle = data.linkAddress.split('-') |
|
|
|
if (data.connectionType === 1) this.links = links |
|
|
|
const column = columnArticle[0].split(',').map(e => +e) |
|
|
|
if (data.connectionType === 3) this.otherLink = links |
|
|
|
console.log("🚀 ~ file: index.vue:737 ~ this.$post ~ columnArticle", column) |
|
|
|
data.linkAddress = '' |
|
|
|
|
|
|
|
|
|
|
|
const article = columnArticle[1] || '' // 获取文章id(文章id是附在linkAddress最后面的-后面的数字) |
|
|
|
|
|
|
|
const { connectionType } = data |
|
|
|
|
|
|
|
// 获取文章 |
|
|
|
|
|
|
|
this.$post(this.api.queryArticle, { |
|
|
|
|
|
|
|
siteId: connectionType === 1 ? this.site.id : data.siteSelection, |
|
|
|
|
|
|
|
columnIds: [column[column.length - 1]], // 截取走最后面的文章id,最后一个id就是栏目id |
|
|
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
|
|
pageSize: 1000, |
|
|
|
|
|
|
|
title: '' |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
this[connectionType === 1 ? 'articles' : 'otherArticles'] = res.data.records |
|
|
|
|
|
|
|
// 站内链接/其他站点链接 |
|
|
|
|
|
|
|
if (connectionType === 1) { |
|
|
|
|
|
|
|
this.links = column |
|
|
|
|
|
|
|
this.form.linkAddress = '' |
|
|
|
|
|
|
|
if (article) this.article = +article |
|
|
|
|
|
|
|
} else if (connectionType === 3) { |
|
|
|
|
|
|
|
this.otherLink = column |
|
|
|
|
|
|
|
this.form.linkAddress = '' |
|
|
|
|
|
|
|
if (article) this.otherArticle = +article |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
data.siteSelection && this.getOtherColumn() |
|
|
|
|
|
|
|
this.originalName = data.title |
|
|
|
this.originalName = data.title |
|
|
|
this.form = data |
|
|
|
this.form = data |
|
|
|
|
|
|
|
data.siteSelection && this.getOtherColumn() |
|
|
|
this.getColumn() |
|
|
|
this.getColumn() |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -701,17 +775,28 @@ export default { |
|
|
|
if (!form.templateStatus) { |
|
|
|
if (!form.templateStatus) { |
|
|
|
form.articleTemplate = (data.typeId === 1 || data.typeId === 4) ? data.detailStyleId : 23 |
|
|
|
form.articleTemplate = (data.typeId === 1 || data.typeId === 4) ? data.detailStyleId : 23 |
|
|
|
} |
|
|
|
} |
|
|
|
// 会议活动 |
|
|
|
this.handleRules() |
|
|
|
if (form.articleTemplate === 25) { |
|
|
|
|
|
|
|
this.rules.titleImg[0].required = false |
|
|
|
|
|
|
|
this.rules.classificationId[0].required = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.getClassification() |
|
|
|
this.getClassification() |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.updateTime = 0 |
|
|
|
this.updateTime = 0 |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 处理表单验证 |
|
|
|
|
|
|
|
handleRules() { |
|
|
|
|
|
|
|
const { articleTemplate } = this.form |
|
|
|
|
|
|
|
// 会议活动 |
|
|
|
|
|
|
|
if (articleTemplate === 25) { |
|
|
|
|
|
|
|
this.rules.titleImg[0].required = false |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.rules.titleImg[0].required = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 独立文章模板选择回调 |
|
|
|
|
|
|
|
styleChange(id) { |
|
|
|
|
|
|
|
this.form.articleTemplate = id |
|
|
|
|
|
|
|
this.handleRules() |
|
|
|
|
|
|
|
}, |
|
|
|
// 获取站点列表 |
|
|
|
// 获取站点列表 |
|
|
|
getSite() { |
|
|
|
getSite() { |
|
|
|
this.$post(this.api.site, { |
|
|
|
this.$post(this.api.site, { |
|
|
@ -723,7 +808,7 @@ export default { |
|
|
|
}).catch(e => {}) |
|
|
|
}).catch(e => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取指定站点的栏目列表 |
|
|
|
// 获取指定站点的栏目列表 |
|
|
|
getOtherColumn() { |
|
|
|
getOtherColumn(val) { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
siteId: this.form.siteSelection, |
|
|
|
siteId: this.form.siteSelection, |
|
|
|
columnName: '', |
|
|
|
columnName: '', |
|
|
@ -731,6 +816,11 @@ export default { |
|
|
|
typeId : '', |
|
|
|
typeId : '', |
|
|
|
isSort: 1 |
|
|
|
isSort: 1 |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
this.otherArticles = [] |
|
|
|
|
|
|
|
this.otherArticle = '' |
|
|
|
|
|
|
|
this.otherLink = '' |
|
|
|
|
|
|
|
} |
|
|
|
this.otherColumns = data |
|
|
|
this.otherColumns = data |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -998,9 +1088,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 附件删除 |
|
|
|
// 附件删除 |
|
|
|
handleRemove(e, fileList) { |
|
|
|
handleRemove(e, fileList) { |
|
|
|
e.id && this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => { |
|
|
|
e.id ? this.$post(`${this.api.delContentFile}?id=${e.id}`).then(res => { |
|
|
|
this.form.fileList = fileList |
|
|
|
this.form.fileList = fileList |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) : (this.form.fileList = fileList) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// banner上传成功 |
|
|
|
// banner上传成功 |
|
|
|
uploadSuccessBanner(res) { |
|
|
|
uploadSuccessBanner(res) { |
|
|
@ -1080,7 +1170,7 @@ export default { |
|
|
|
if (tId !== 25) { |
|
|
|
if (tId !== 25) { |
|
|
|
if (!form.releaseTime) return Util.errorMsg('请选择发布日期') |
|
|
|
if (!form.releaseTime) return Util.errorMsg('请选择发布日期') |
|
|
|
} |
|
|
|
} |
|
|
|
if (tId === 22 || tId === 23) { |
|
|
|
if (tId === 22 || tId === 23 || tId === 24) { |
|
|
|
if (!form.titleImg ) return Util.errorMsg('请上传封面') |
|
|
|
if (!form.titleImg ) return Util.errorMsg('请上传封面') |
|
|
|
} |
|
|
|
} |
|
|
|
if (tId === 25) { |
|
|
|
if (tId === 25) { |
|
|
@ -1101,8 +1191,10 @@ export default { |
|
|
|
if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布') |
|
|
|
if (this.uploading) return Util.errorMsg('文件正在上传,请上传完成后再发布') |
|
|
|
if (form.connectionType === 1) { |
|
|
|
if (form.connectionType === 1) { |
|
|
|
form.linkAddress = this.links.join() |
|
|
|
form.linkAddress = this.links.join() |
|
|
|
|
|
|
|
if (this.article) form.linkAddress += '-' + this.article |
|
|
|
} else if (form.connectionType === 3) { |
|
|
|
} else if (form.connectionType === 3) { |
|
|
|
form.linkAddress = this.otherLink.join() |
|
|
|
form.linkAddress = this.otherLink.join() |
|
|
|
|
|
|
|
if (this.otherArticle) form.linkAddress += '-' + this.otherArticle |
|
|
|
} |
|
|
|
} |
|
|
|
const { columnId, bannerImg, fileList, titleImg } = form |
|
|
|
const { columnId, bannerImg, fileList, titleImg } = form |
|
|
|
const fileId = [] |
|
|
|
const fileId = [] |
|
|
|