yujialong 11 months ago
parent 5abfd1dc32
commit 71dd3009e2
  1. 4
      public/styles/css/editor.css
  2. 143
      src/components/modules/link.vue
  3. 5
      src/components/modules/module.vue

@ -100,7 +100,9 @@
} }
.tiny-wrap .people .pic { .tiny-wrap .people .pic {
max-width: 400px; max-width: 400px;
margin-right: 50px; }
.tiny-wrap .people .texts {
margin-left: 50px;
} }
.tiny-wrap .people h6 { .tiny-wrap .people h6 {
font-size: 24px; font-size: 24px;

@ -1,9 +1,16 @@
<template> <template>
<!-- 设置链接 --> <!-- 设置链接 -->
<div> <div>
<el-dialog title="设置链接地址" :visible.sync="visible" width="500px" :close-on-click-modal="false" :before-close="close"> <el-dialog title="设置链接地址"
<el-form :model="data" class="model" label-width="120px"> :visible.sync="visible"
<el-form-item prop="connectionType" label="连接类型"> width="500px"
: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>
@ -12,73 +19,72 @@
</el-radio-group> </el-radio-group>
</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 <el-cascader ref="column"
ref="column" v-model="data.columnId"
v-model="data.columnId" :options="columns"
:options="columns" :props="columnProps"
: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 <el-option v-for="item in articles"
v-for="item in articles" :key="item.id"
:key="item.id" :label="item.title"
:label="item.title" :value="item.id">
: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" prop="linkAddress" label="站外链接"> <el-form-item v-show="data.connectionType === 2"
<el-input prop="linkAddress"
placeholder="请输入站外链接" label="站外链接">
v-model.trim="data.linkAddress" <el-input placeholder="请输入站外链接"
clearable v-model.trim="data.linkAddress"
></el-input> 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" label="站点选择"> <el-form-item prop="site"
<el-select v-model="data.site" @change="getOtherColumn"> label="站点选择">
<el-option <el-select v-model="data.site"
v-for="item in sites" @change="getOtherColumn">
:key="item.id" <el-option v-for="item in sites"
:label="item.siteName" :key="item.id"
:value="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 <el-cascader ref="otherColumn"
ref="otherColumn" v-model="data.otherColumnId"
v-model="data.otherColumnId" :options="otherColumns"
:options="otherColumns" :props="columnProps"
: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 <el-option v-for="item in articles"
v-for="item in articles" :key="item.id"
:key="item.id" :label="item.title"
:label="item.title" :value="item.id">
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</template> </template>
<el-form-item prop="isOpen" label="新窗口打开"> <el-form-item prop="isOpen"
<el-switch label="新窗口打开">
v-model="data.isOpen" <el-switch v-model="data.isOpen"
:active-value="1" :active-value="1"
:inactive-value="0"> :inactive-value="0">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="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" @click="linkSubmit">确定</el-button> <el-button type="primary"
@click="linkSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -95,7 +101,7 @@ export default {
required: true required: true
} }
}, },
data() { data () {
return { return {
site: this.$store.state.content.site, site: this.$store.state.content.site,
sites: [], sites: [],
@ -110,7 +116,7 @@ export default {
}; };
}, },
watch: { watch: {
visible(open) { visible (open) {
// //
if (open) { if (open) {
this.data.connectionType !== 2 && this.getArticle() this.data.connectionType !== 2 && this.getArticle()
@ -118,40 +124,40 @@ export default {
} }
} }
}, },
mounted() { mounted () {
this.getList() this.getList()
this.getSite() this.getSite()
}, },
methods: { methods: {
// //
getList() { getList () {
this.$post(this.api.listWithTree, { this.$post(this.api.listWithTree, {
siteId: this.site.id, siteId: this.site.id,
columnName: '', columnName: '',
templateId: '', templateId: '',
typeId : '', typeId: '',
isSort: 1 isSort: 1
}).then(({ data }) => { }).then(({ data }) => {
this.columns = data this.columns = data
this.data.connectionType !== 2 && this.getArticle() this.data.connectionType !== 2 && this.getArticle()
}).catch(err => {}) }).catch(err => { })
}, },
// disabled // disabled
handleId(list) { handleId (list) {
list.forEach(e => { list.forEach(e => {
if (e.id == this.id) e.disabled = true if (e.id == this.id) e.disabled = true
e.children.length ? this.handleId(e.children) : delete e.children e.children.length ? this.handleId(e.children) : delete e.children
}) })
}, },
// //
columnChange() { columnChange () {
this.data.articleId = '' this.data.articleId = ''
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 id = this.data.connectionType === 1 ? this.data.columnId[this.data.columnId.length - 1] : this.data.otherColumnId[this.data.otherColumnId.length - 1]
id && this.$post(this.api.queryArticle, { id && this.$post(this.api.queryArticle, {
@ -163,42 +169,41 @@ export default {
isDisable: 0 isDisable: 0
}).then(({ data }) => { }).then(({ data }) => {
this.articles = data.records.filter(e => e.isRelease) // this.articles = data.records.filter(e => e.isRelease) //
}).catch(err => {}) }).catch(err => { })
}, },
// //
getSite() { getSite () {
this.$post(this.api.site, { this.$post(this.api.site, {
page: 1, page: 1,
limit: 1000, limit: 1000,
siteName: '' siteName: ''
}).then(({ data }) => { }).then(({ data }) => {
this.sites = data.records this.sites = data.records
}).catch(e => {}) }).catch(e => { })
}, },
// //
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: '',
typeId : '', typeId: '',
isSort: 1 isSort: 1
}).then(({ data }) => { }).then(({ data }) => {
this.otherColumns = data this.otherColumns = data
}).catch(err => {}) }).catch(err => { })
}, },
close() { close () {
this.$emit('update:visible', false) this.$emit('update:visible', false)
}, },
// //
linkSubmit() { linkSubmit () {
this.$emit('linkSubmit') this.$emit('linkSubmit')
} }
} }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>

@ -122,7 +122,12 @@
:file-list="fileList" :file-list="fileList"
:headers="headers" :headers="headers"
:action="api.upload"> :action="api.upload">
<el-button>上传视频</el-button> <el-button>上传视频</el-button>
<div slot="tip"
class="el-upload__tip">
<p>请上传大小1G以内的视频</p>
</div>
</el-upload> </el-upload>
<!-- 图片视频都可上传 --> <!-- 图片视频都可上传 -->
<el-upload v-if="item.type === 'media'" <el-upload v-if="item.type === 'media'"

Loading…
Cancel
Save