|
|
@ -1,16 +1,9 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<!-- 设置链接 --> |
|
|
|
<!-- 设置链接 --> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-dialog title="设置链接地址" |
|
|
|
<el-dialog title="设置链接地址" :visible.sync="visible" width="500px" :close-on-click-modal="false" :before-close="close"> |
|
|
|
:visible.sync="visible" |
|
|
|
<el-form :model="data" class="model" label-width="120px"> |
|
|
|
width="500px" |
|
|
|
<el-form-item prop="connectionType" label="连接类型"> |
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
:before-close="close"> |
|
|
|
|
|
|
|
<el-form :model="data" |
|
|
|
|
|
|
|
class="model" |
|
|
|
|
|
|
|
label-width="120px"> |
|
|
|
|
|
|
|
<el-form-item prop="connectionType" |
|
|
|
|
|
|
|
label="连接类型"> |
|
|
|
|
|
|
|
<el-radio-group v-model="data.connectionType"> |
|
|
|
<el-radio-group v-model="data.connectionType"> |
|
|
|
<!-- <el-radio :label="0">无</el-radio> --> |
|
|
|
<!-- <el-radio :label="0">无</el-radio> --> |
|
|
|
<el-radio :label="1">站内链接</el-radio> |
|
|
|
<el-radio :label="1">站内链接</el-radio> |
|
|
@ -20,71 +13,45 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<template v-if="data.connectionType === 1"> |
|
|
|
<template v-if="data.connectionType === 1"> |
|
|
|
<el-form-item label="栏目"> |
|
|
|
<el-form-item label="栏目"> |
|
|
|
<el-cascader ref="column" |
|
|
|
<el-cascader ref="column" v-model="data.columnId" :options="columns" :props="columnProps" |
|
|
|
v-model="data.columnId" |
|
|
|
|
|
|
|
:options="columns" |
|
|
|
|
|
|
|
:props="columnProps" |
|
|
|
|
|
|
|
@change="columnChange"></el-cascader> |
|
|
|
@change="columnChange"></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="文章"> |
|
|
|
<el-form-item label="文章"> |
|
|
|
<el-select v-model="data.articleId"> |
|
|
|
<el-select v-model="data.articleId"> |
|
|
|
<el-option v-for="item in articles" |
|
|
|
<el-option v-for="item in articles" :key="item.id" :label="item.title" :value="item.id"> |
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.title" |
|
|
|
|
|
|
|
:value="item.id"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<el-form-item v-show="data.connectionType === 2" |
|
|
|
<el-form-item v-show="data.connectionType === 2" prop="linkAddress" label="站外链接"> |
|
|
|
prop="linkAddress" |
|
|
|
<el-input placeholder="请输入站外链接" v-model.trim="data.linkAddress" clearable></el-input> |
|
|
|
label="站外链接"> |
|
|
|
|
|
|
|
<el-input placeholder="请输入站外链接" |
|
|
|
|
|
|
|
v-model.trim="data.linkAddress" |
|
|
|
|
|
|
|
clearable></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<template v-if="data.connectionType === 3"> |
|
|
|
<template v-if="data.connectionType === 3"> |
|
|
|
<el-form-item prop="site" |
|
|
|
<el-form-item prop="site" label="站点选择"> |
|
|
|
label="站点选择"> |
|
|
|
<el-select v-model="data.site" @change="getOtherColumn"> |
|
|
|
<el-select v-model="data.site" |
|
|
|
<el-option v-for="item in sites" :key="item.id" :label="item.siteName" :value="item.id"> |
|
|
|
@change="getOtherColumn"> |
|
|
|
|
|
|
|
<el-option v-for="item in sites" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.siteName" |
|
|
|
|
|
|
|
:value="item.id"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="栏目"> |
|
|
|
<el-form-item label="栏目"> |
|
|
|
<el-cascader ref="otherColumn" |
|
|
|
<el-cascader ref="otherColumn" v-model="data.otherColumnId" :options="otherColumns" :props="columnProps" |
|
|
|
v-model="data.otherColumnId" |
|
|
|
|
|
|
|
:options="otherColumns" |
|
|
|
|
|
|
|
:props="columnProps" |
|
|
|
|
|
|
|
@change="columnChange"></el-cascader> |
|
|
|
@change="columnChange"></el-cascader> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="文章"> |
|
|
|
<el-form-item label="文章"> |
|
|
|
<el-select v-model="data.otherArticleId"> |
|
|
|
<el-select v-model="data.otherArticleId"> |
|
|
|
<el-option v-for="item in articles" |
|
|
|
<el-option v-for="item in articles" :key="item.id" :label="item.title" :value="item.id"> |
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.title" |
|
|
|
|
|
|
|
:value="item.id"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<el-form-item prop="isOpen" |
|
|
|
<el-form-item prop="isOpen" label="新窗口打开"> |
|
|
|
label="新窗口打开"> |
|
|
|
<el-switch v-model="data.isOpen" :active-value="1" :inactive-value="0"> |
|
|
|
<el-switch v-model="data.isOpen" |
|
|
|
|
|
|
|
:active-value="1" |
|
|
|
|
|
|
|
:inactive-value="0"> |
|
|
|
|
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
class="dialog-footer"> |
|
|
|
|
|
|
|
<el-button @click="$emit('update:visible', false)">取消</el-button> |
|
|
|
<el-button @click="$emit('update:visible', false)">取消</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" @click="linkSubmit">确定</el-button> |
|
|
|
@click="linkSubmit">确定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -133,8 +100,6 @@ export default { |
|
|
|
// 栏目列表 |
|
|
|
// 栏目列表 |
|
|
|
getList () { |
|
|
|
getList () { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
siteId: this.site.id, |
|
|
|
siteId: this.site.id, |
|
|
|
columnName: '', |
|
|
|
columnName: '', |
|
|
|
templateId: '', |
|
|
|
templateId: '', |
|
|
@ -154,13 +119,16 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 栏目选择回调 |
|
|
|
// 栏目选择回调 |
|
|
|
columnChange () { |
|
|
|
columnChange () { |
|
|
|
this.data.articleId = '' |
|
|
|
this.data[this.data.connectionType === 1 ? 'articleId' : 'otherArticleId'] = '' |
|
|
|
this.getArticle() |
|
|
|
this.getArticle() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 文章列表 |
|
|
|
// 文章列表 |
|
|
|
getArticle () { |
|
|
|
getArticle () { |
|
|
|
// 站内链接/其他站点链接 |
|
|
|
// 站内链接/其他站点链接 |
|
|
|
const id = this.data.connectionType === 1 ? this.data.columnId[this.data.columnId.length - 1] : this.data.otherColumnId[this.data.otherColumnId.length - 1] |
|
|
|
const isIn = this.data.connectionType === 1 // 站内 |
|
|
|
|
|
|
|
const id = isIn ? this.data.columnId[this.data.columnId.length - 1] : this.data.otherColumnId[this.data.otherColumnId.length - 1] |
|
|
|
|
|
|
|
const e = this[isIn ? 'columns' : 'otherColumns'].find(e => e.id === id) |
|
|
|
|
|
|
|
e && this.$set(this.data, 'isProduct', e.templateId === 12 || e.listStyleId === 73 ? 1 : 0) |
|
|
|
id && this.$post(this.api.queryArticle, { |
|
|
|
id && this.$post(this.api.queryArticle, { |
|
|
|
siteId: this.data.connectionType === 1 ? this.site.id : this.data.site, |
|
|
|
siteId: this.data.connectionType === 1 ? this.site.id : this.data.site, |
|
|
|
columnIds: [id], |
|
|
|
columnIds: [id], |
|
|
@ -185,8 +153,6 @@ export default { |
|
|
|
// 获取指定站点的栏目列表 |
|
|
|
// 获取指定站点的栏目列表 |
|
|
|
getOtherColumn () { |
|
|
|
getOtherColumn () { |
|
|
|
this.data.site && this.$post(this.api.listWithTree, { |
|
|
|
this.data.site && this.$post(this.api.listWithTree, { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
siteId: this.data.site, |
|
|
|
siteId: this.data.site, |
|
|
|
columnName: '', |
|
|
|
columnName: '', |
|
|
|
templateId: '', |
|
|
|
templateId: '', |
|
|
@ -206,5 +172,4 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped></style> |
|
|
|
</style> |
|
|
|
|