|
|
|
@ -1,136 +1,81 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="page" |
|
|
|
|
v-show="loaded"> |
|
|
|
|
<div class="page" v-show="loaded"> |
|
|
|
|
<p class="page-name mb">栏目</p> |
|
|
|
|
<el-form :model="form" |
|
|
|
|
:rules="rules" |
|
|
|
|
class="input-form model" |
|
|
|
|
label-width="120px"> |
|
|
|
|
<el-form :model="form" :rules="rules" class="input-form model" label-width="120px"> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="columnName" |
|
|
|
|
label="栏目名称"> |
|
|
|
|
<el-input placeholder="请输入栏目名称" |
|
|
|
|
v-model="form.columnName" |
|
|
|
|
clearable |
|
|
|
|
maxlength="40" |
|
|
|
|
<el-form-item prop="columnName" label="栏目名称"> |
|
|
|
|
<el-input placeholder="请输入栏目名称" v-model="form.columnName" clearable maxlength="40" |
|
|
|
|
@input="nameChange"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="fatherId" |
|
|
|
|
label="设置上级"> |
|
|
|
|
<el-cascader ref="fatherId" |
|
|
|
|
v-model="form.fatherId" |
|
|
|
|
:options="columns" |
|
|
|
|
:props="columnProps" |
|
|
|
|
clearable |
|
|
|
|
<el-form-item prop="fatherId" label="设置上级"> |
|
|
|
|
<el-cascader ref="fatherId" v-model="form.fatherId" :options="columns" :props="columnProps" clearable |
|
|
|
|
@change="fatherIdChange"></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="item-line"> |
|
|
|
|
<el-form-item prop="typeId" |
|
|
|
|
label="栏目类型"> |
|
|
|
|
<el-select v-model="form.typeId" |
|
|
|
|
@change="typeChange"> |
|
|
|
|
<el-option v-for="item in types" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id"> |
|
|
|
|
<el-form-item prop="typeId" label="栏目类型"> |
|
|
|
|
<el-select v-model="form.typeId" @change="typeChange"> |
|
|
|
|
<el-option v-for="item in types" :key="item.id" :label="item.name" :value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="pageSize" |
|
|
|
|
label="分页条数"> |
|
|
|
|
<el-input-number v-model="form.pageSize" |
|
|
|
|
:min="0" |
|
|
|
|
class="auto"></el-input-number> |
|
|
|
|
<el-form-item prop="pageSize" label="分页条数"> |
|
|
|
|
<el-input-number v-model="form.pageSize" :min="0" class="auto"></el-input-number> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="menuVisible" |
|
|
|
|
label="导航菜单可见"> |
|
|
|
|
<el-switch v-model="form.menuVisible" |
|
|
|
|
:active-value="0" |
|
|
|
|
:inactive-value="1"> |
|
|
|
|
<el-form-item prop="menuVisible" label="导航菜单可见"> |
|
|
|
|
<el-switch v-model="form.menuVisible" :active-value="0" :inactive-value="1"> |
|
|
|
|
</el-switch> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
<div class="line"></div> |
|
|
|
|
<template v-if="form.typeId === 1 || form.typeId === 4"> |
|
|
|
|
<el-form-item prop="columnBanner" |
|
|
|
|
label="栏目Banner"> |
|
|
|
|
<el-upload class="avatar-uploader avatar-uploader-lg" |
|
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
|
:on-change="changeFile" |
|
|
|
|
:show-file-list="false" |
|
|
|
|
:action="this.api.upload" |
|
|
|
|
:auto-upload="false"> |
|
|
|
|
<img v-if="form.columnBanner" |
|
|
|
|
:src="form.columnBanner" |
|
|
|
|
class="avatar-lg"> |
|
|
|
|
<div class="uploader-default" |
|
|
|
|
v-else> |
|
|
|
|
<img class="plus" |
|
|
|
|
src="@/assets/images/plus.png" |
|
|
|
|
alt=""> |
|
|
|
|
<el-form-item prop="columnBanner" label="栏目Banner"> |
|
|
|
|
<el-upload class="avatar-uploader avatar-uploader-lg" accept=".jpg,.png,.jpeg,.gif" :on-change="changeFile" |
|
|
|
|
:show-file-list="false" :action="this.api.upload" :auto-upload="false"> |
|
|
|
|
<img v-if="form.columnBanner" :src="form.columnBanner" class="avatar-lg"> |
|
|
|
|
<div class="uploader-default" v-else> |
|
|
|
|
<img class="plus" src="@/assets/images/plus.png" alt=""> |
|
|
|
|
<p>点击上传</p> |
|
|
|
|
</div> |
|
|
|
|
<div slot="tip" |
|
|
|
|
class="el-upload__tip"> |
|
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
|
<p>请上传1920x500PX,5M以内的jpg,bmp,png格式</p> |
|
|
|
|
</div> |
|
|
|
|
</el-upload> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="subtitle" |
|
|
|
|
label="栏目副标题"> |
|
|
|
|
<el-input type="textarea" |
|
|
|
|
placeholder="请输入栏目副标题" |
|
|
|
|
v-model="form.subtitle"></el-input> |
|
|
|
|
<el-form-item prop="subtitle" label="栏目副标题"> |
|
|
|
|
<el-input type="textarea" placeholder="请输入栏目副标题" v-model="form.subtitle"></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="templateId" |
|
|
|
|
label="栏目模板"> |
|
|
|
|
<el-select v-model="form.templateId" |
|
|
|
|
@change="getStyle"> |
|
|
|
|
<el-option v-for="item in templates" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.templateType" |
|
|
|
|
:value="item.id"> |
|
|
|
|
<el-form-item prop="templateId" label="栏目模板"> |
|
|
|
|
<el-select v-model="form.templateId" @change="getStyle"> |
|
|
|
|
<el-option v-for="item in templates" :key="item.id" :label="item.templateType" :value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="listStyleId" |
|
|
|
|
label="列表样式"> |
|
|
|
|
<el-form-item prop="listStyleId" label="列表样式"> |
|
|
|
|
<ul class="styles"> |
|
|
|
|
<li v-for="(item, i) in listStyle" |
|
|
|
|
:key="i" |
|
|
|
|
@click="form.listStyleId = item.id"> |
|
|
|
|
<li v-for="(item, i) in listStyle" :key="i" @click="form.listStyleId = item.id"> |
|
|
|
|
<div class="review"> |
|
|
|
|
<img style="width: 90px;max-height: 110px;" |
|
|
|
|
:src="require('@/assets/images/style/' + item.id + '.png')" |
|
|
|
|
<img style="width: 90px;max-height: 110px;" :src="require('@/assets/images/style/' + item.id + '.png')" |
|
|
|
|
alt=""> |
|
|
|
|
</div> |
|
|
|
|
<el-radio v-model="form.listStyleId" |
|
|
|
|
:label="item.id">{{ item.style }}</el-radio> |
|
|
|
|
<el-radio v-model="form.listStyleId" :label="item.id">{{ item.style }}</el-radio> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item v-if="form.listStyleId != 73 && form.listStyleId != 74" |
|
|
|
|
prop="detailStyleId" |
|
|
|
|
label="详情样式"> |
|
|
|
|
<el-form-item v-if="form.listStyleId != 73 && form.listStyleId != 74" prop="detailStyleId" label="详情样式"> |
|
|
|
|
<ul class="styles"> |
|
|
|
|
<li v-for="(item, i) in detailStyleId" |
|
|
|
|
:key="i" |
|
|
|
|
@click="form.detailStyleId = item.id"> |
|
|
|
|
<li v-for="(item, i) in detailStyleId" :key="i" @click="form.detailStyleId = item.id"> |
|
|
|
|
<div class="review"> |
|
|
|
|
<img :style="{ width: item.id == 24 ? '50px' : '90px', 'max-height': '110px' }" |
|
|
|
|
:src="require('@/assets/images/style/' + item.id + '.png')" |
|
|
|
|
alt=""> |
|
|
|
|
:src="require('@/assets/images/style/' + item.id + '.png')" alt=""> |
|
|
|
|
</div> |
|
|
|
|
<el-radio v-model="form.detailStyleId" |
|
|
|
|
:label="item.id">{{ item.style }}</el-radio> |
|
|
|
|
<el-radio v-model="form.detailStyleId" :label="item.id">{{ item.style }}</el-radio> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
<template v-if="form.typeId === 2"> |
|
|
|
|
<el-form-item prop="connectionType" |
|
|
|
|
label="连接类型"> |
|
|
|
|
<el-form-item prop="connectionType" label="连接类型"> |
|
|
|
|
<el-radio-group v-model="form.connectionType"> |
|
|
|
|
<el-radio :label="1">站内链接</el-radio> |
|
|
|
|
<el-radio :label="2">站外链接</el-radio> |
|
|
|
@ -139,89 +84,56 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-if="form.connectionType === 1"> |
|
|
|
|
<el-form-item label="站内链接"> |
|
|
|
|
<el-cascader v-model="links" |
|
|
|
|
:options="columns" |
|
|
|
|
:props="columnProps" |
|
|
|
|
clearable |
|
|
|
|
<el-cascader v-model="links" :options="columns" :props="columnProps" clearable |
|
|
|
|
@change="getArticle"></el-cascader> |
|
|
|
|
</el-form-item> |
|
|
|
|
<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-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 placeholder="请输入站外链接" |
|
|
|
|
v-model.trim="form.linkAddress" |
|
|
|
|
clearable></el-input> |
|
|
|
|
<el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接"> |
|
|
|
|
<el-input placeholder="请输入站外链接" v-model.trim="form.linkAddress" clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
<template v-if="form.connectionType === 3"> |
|
|
|
|
<el-form-item prop="siteSelection" |
|
|
|
|
label="站点选择"> |
|
|
|
|
<el-select v-model="form.siteSelection" |
|
|
|
|
@change="getOtherColumn"> |
|
|
|
|
<el-option v-for="item in sites" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.siteName" |
|
|
|
|
:value="item.id"> |
|
|
|
|
<el-form-item prop="siteSelection" label="站点选择"> |
|
|
|
|
<el-select v-model="form.siteSelection" @change="getOtherColumn"> |
|
|
|
|
<el-option v-for="item in sites" :key="item.id" :label="item.siteName" :value="item.id"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="栏目"> |
|
|
|
|
<el-cascader v-model="otherLink" |
|
|
|
|
:options="otherColumns" |
|
|
|
|
:props="columnProps" |
|
|
|
|
clearable |
|
|
|
|
<el-cascader v-model="otherLink" :options="otherColumns" :props="columnProps" 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-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> |
|
|
|
|
</template> |
|
|
|
|
<el-form-item prop="isOpen" |
|
|
|
|
label="新窗口打开"> |
|
|
|
|
<el-switch v-model="form.isOpen" |
|
|
|
|
:active-value="1" |
|
|
|
|
:inactive-value="0"> |
|
|
|
|
<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 v-if="form.typeId === 3"> |
|
|
|
|
<el-form-item prop="templateId" |
|
|
|
|
label="栏目模板"> |
|
|
|
|
<el-form-item prop="templateId" label="栏目模板"> |
|
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
|
<el-option label="长页模板" |
|
|
|
|
:value="9"> |
|
|
|
|
<el-option label="长页模板" :value="9"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item prop="listStyleId" |
|
|
|
|
label="列表样式"> |
|
|
|
|
<ul class="styles"> |
|
|
|
|
<li v-for="(item, i) in pageStyle" |
|
|
|
|
:key="i" |
|
|
|
|
@click="form.listStyleId = item.id"> |
|
|
|
|
<el-form-item prop="listStyleId" label="列表样式"> |
|
|
|
|
<ul :class="['styles', { disabled: isEdit }]"> |
|
|
|
|
<li v-for="(item, i) in pageStyle" :key="i" @click="pageClick(item)"> |
|
|
|
|
<div class="review"> |
|
|
|
|
<img :src="require('@/assets/images/page/' + item.pic + '.png')" |
|
|
|
|
alt=""> |
|
|
|
|
<img :src="require('@/assets/images/page/' + item.pic + '.png')" alt=""> |
|
|
|
|
</div> |
|
|
|
|
<el-radio v-model="form.listStyleId" |
|
|
|
|
:label="item.id">{{ item.style }}</el-radio> |
|
|
|
|
<el-radio v-model="form.listStyleId" :label="item.id" :disabled="isEdit">{{ item.style }}</el-radio> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</el-form-item> |
|
|
|
@ -235,21 +147,12 @@ |
|
|
|
|
</el-form-item> --> |
|
|
|
|
</el-form> |
|
|
|
|
<div class="btns"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="submit(0)">确定</el-button> |
|
|
|
|
<el-button type="primary" @click="submit(0)">确定</el-button> |
|
|
|
|
<el-button @click="$router.push('/column')">取消</el-button> |
|
|
|
|
</div> |
|
|
|
|
<!-- 剪裁组件弹窗 --> |
|
|
|
|
<el-dialog title="图片裁剪" |
|
|
|
|
append-to-body |
|
|
|
|
:visible.sync="cropperModel" |
|
|
|
|
width="1100px" |
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
<Cropper ref="cropper" |
|
|
|
|
:img-file.sync="file" |
|
|
|
|
:is-upload="isUpload" |
|
|
|
|
:fixed="true" |
|
|
|
|
@upload="customUpload" /> |
|
|
|
|
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false"> |
|
|
|
|
<Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" @upload="customUpload" /> |
|
|
|
|
</el-dialog> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
@ -540,6 +443,10 @@ export default { |
|
|
|
|
} |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, |
|
|
|
|
// 长页模板点击回调 |
|
|
|
|
pageClick (item) { |
|
|
|
|
if (!this.isEdit) this.form.listStyleId = item.id |
|
|
|
|
}, |
|
|
|
|
// 获取站点列表 |
|
|
|
|
getSite () { |
|
|
|
|
this.$post(this.api.site, { |
|
|
|
@ -778,6 +685,7 @@ export default { |
|
|
|
|
$upload-width: 220px; |
|
|
|
|
$upload-height: 102px; |
|
|
|
|
$upload-lg-height: 102px; |
|
|
|
|
|
|
|
|
|
/deep/ .avatar-uploader { |
|
|
|
|
.el-upload { |
|
|
|
|
position: relative; |
|
|
|
@ -787,6 +695,7 @@ $upload-lg-height: 102px; |
|
|
|
|
border-radius: 2px; |
|
|
|
|
cursor: pointer; |
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
|
display: flex; |
|
|
|
|
height: $upload-height; |
|
|
|
@ -795,6 +704,7 @@ $upload-lg-height: 102px; |
|
|
|
|
align-items: center; |
|
|
|
|
text-align: center; |
|
|
|
|
background: #fafafa; |
|
|
|
|
|
|
|
|
|
p { |
|
|
|
|
margin-top: 10px; |
|
|
|
|
font-size: 14px; |
|
|
|
@ -803,6 +713,7 @@ $upload-lg-height: 102px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
&.avatar-uploader-lg { |
|
|
|
|
.el-upload { |
|
|
|
|
width: 100%; |
|
|
|
@ -814,43 +725,57 @@ $upload-lg-height: 102px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.avatar { |
|
|
|
|
display: block; |
|
|
|
|
width: $upload-width; |
|
|
|
|
height: $upload-height; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.avatar-lg { |
|
|
|
|
display: block; |
|
|
|
|
width: 100%; |
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-upload__tip { |
|
|
|
|
margin-top: 0; |
|
|
|
|
|
|
|
|
|
p { |
|
|
|
|
font-size: 12px; |
|
|
|
|
color: #333; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.style-wrap { |
|
|
|
|
display: flex; |
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
|
|
|
|
.label { |
|
|
|
|
margin-right: 30px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.styles { |
|
|
|
|
display: inline-flex; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
|
|
|
|
|
li { |
|
|
|
|
width: 170px; |
|
|
|
|
margin-right: 20px; |
|
|
|
|
text-align: center; |
|
|
|
|
cursor: pointer; |
|
|
|
|
&:hover .review { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
&:not(.disabled) { |
|
|
|
|
li:hover .review { |
|
|
|
|
border-color: #2962ff; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.review { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
@ -860,14 +785,17 @@ $upload-lg-height: 102px; |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
border: 1px solid #dcdee0; |
|
|
|
|
border-radius: 2px; |
|
|
|
|
|
|
|
|
|
img { |
|
|
|
|
width: 50px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-radio { |
|
|
|
|
white-space: normal; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.input-form .auto .el-input { |
|
|
|
|
width: 119px; |
|
|
|
|
} |
|
|
|
|