|
|
@ -1,42 +1,27 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div class="page"> |
|
|
|
<el-form> |
|
|
|
<p class="page-name mb">新增栏目</p> |
|
|
|
<el-card shadow="hover" class="m-b-20"> |
|
|
|
<el-form class="input-form model" label-width="100px"> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="item-line"> |
|
|
|
<el-page-header @back="goBack" :content="(isEdit ? '更新' : '创建') + '栏目'"></el-page-header> |
|
|
|
<el-form-item prop="columnName" label="栏目名称"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<el-button type="primary" @click="submit">{{ form.id ? "更新" : "创建" }}</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">栏目名称</p> |
|
|
|
|
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
placeholder="请输入栏目名称" |
|
|
|
placeholder="请输入栏目名称" |
|
|
|
v-model.trim="form.columnName" |
|
|
|
v-model.trim="form.columnName" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
maxlength="15" |
|
|
|
maxlength="15" |
|
|
|
class="inline-input" |
|
|
|
|
|
|
|
@change="nameChange" |
|
|
|
@change="nameChange" |
|
|
|
></el-input> |
|
|
|
></el-input> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
<el-form-item prop="fatherId" label="设置上级"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">设置上级</p> |
|
|
|
|
|
|
|
<el-cascader |
|
|
|
<el-cascader |
|
|
|
v-model="form.fatherId" |
|
|
|
v-model="form.fatherId" |
|
|
|
:options="columns" |
|
|
|
:options="columns" |
|
|
|
:props="columnProps" |
|
|
|
:props="columnProps" |
|
|
|
clearable></el-cascader> |
|
|
|
clearable></el-cascader> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
<div class="item-line"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-form-item prop="typeId" label="栏目类型"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">栏目类型</p> |
|
|
|
|
|
|
|
<div class="inline-input"> |
|
|
|
|
|
|
|
<el-select v-model="form.typeId" @change="typeChange"> |
|
|
|
<el-select v-model="form.typeId" @change="typeChange"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in types" |
|
|
|
v-for="item in types" |
|
|
@ -45,62 +30,49 @@ |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<el-form-item prop="pageSize" label="分页条数"> |
|
|
|
</el-card> |
|
|
|
<el-input-number v-model="form.pageSize" :min="0" class="auto"></el-input-number> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
</el-form-item> |
|
|
|
<div> |
|
|
|
<el-form-item prop="menuVisible" label="导航菜单可见"> |
|
|
|
<p class="m-b-20">分页条数</p> |
|
|
|
|
|
|
|
<el-input |
|
|
|
|
|
|
|
placeholder="请输入分页条数" |
|
|
|
|
|
|
|
v-model.trim="form.pageSize" |
|
|
|
|
|
|
|
maxlength="15" |
|
|
|
|
|
|
|
type="number" |
|
|
|
|
|
|
|
style="width: 150px" |
|
|
|
|
|
|
|
></el-input> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">导航菜单可见</p> |
|
|
|
|
|
|
|
<el-switch |
|
|
|
<el-switch |
|
|
|
v-model="form.menuVisible" |
|
|
|
v-model="form.menuVisible" |
|
|
|
:active-value="0" |
|
|
|
:active-value="0" |
|
|
|
:inactive-value="1"> |
|
|
|
:inactive-value="1"> |
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
<div class="line"></div> |
|
|
|
<template v-if="form.typeId === 1 || form.typeId === 4"> |
|
|
|
<template v-if="form.typeId === 1 || form.typeId === 4"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-form-item prop="columnBanner" label="栏目banner"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">栏目banner</p> |
|
|
|
|
|
|
|
<el-upload |
|
|
|
<el-upload |
|
|
|
class="avatar-uploader avatar-uploader-lg" |
|
|
|
class="avatar-uploader avatar-uploader-lg" |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
|
|
|
|
:before-upload="beforeUpload" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-error="uploadError" |
|
|
|
:on-success="uploadSuccess" |
|
|
|
:on-success="uploadSuccess" |
|
|
|
:before-remove="beforeRemove" |
|
|
|
|
|
|
|
:limit="1" |
|
|
|
:limit="1" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:action="this.api.fileupload" |
|
|
|
:show-file-list="false" |
|
|
|
:headers="headers" |
|
|
|
:action="this.api.upload" |
|
|
|
name="file" |
|
|
|
:data="{ |
|
|
|
|
|
|
|
quote: form.columnName, |
|
|
|
|
|
|
|
site: '粒子研究院中文站点', |
|
|
|
|
|
|
|
uploader: userName |
|
|
|
|
|
|
|
}" |
|
|
|
> |
|
|
|
> |
|
|
|
<img v-if="form.columnBanner" :src="form.columnBanner" class="avatar"> |
|
|
|
<img v-if="form.columnBanner" :src="form.columnBanner" class="avatar"> |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
<img class="plus" src="@/assets/img/plus.png" alt=""> |
|
|
|
<p>上传banner</p> |
|
|
|
<p>点击上传</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
<p>展示宽度为220,高度140,JPG/PNG/GIF,3MB以内</p> |
|
|
|
<p>请上传1920x500PX,1M以内的jpg,bmp,png格式</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
<el-form-item prop="templateId" label="栏目模板"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">栏目模板</p> |
|
|
|
|
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in templates" |
|
|
|
v-for="item in templates" |
|
|
@ -109,72 +81,76 @@ |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
<div class="style-wrap"> |
|
|
|
</el-form-item> |
|
|
|
<p class="label">列表样式</p> |
|
|
|
<el-form-item prop="listStyleId" label="列表样式"> |
|
|
|
<ul class="styles"> |
|
|
|
<ul class="styles"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/list1.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
<div class="style-wrap"> |
|
|
|
<el-form-item prop="detailStyle" label="详情样式"> |
|
|
|
<p class="label">详情样式</p> |
|
|
|
|
|
|
|
<ul class="styles"> |
|
|
|
<ul class="styles"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/article1.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio> |
|
|
|
<el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/article2.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.detailStyle" :label="2">富文本</el-radio> |
|
|
|
<el-radio v-model="form.detailStyle" :label="2">富文本</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/article3.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.detailStyle" :label="3">链接</el-radio> |
|
|
|
<el-radio v-model="form.detailStyle" :label="3">链接</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template v-if="form.typeId === 2"> |
|
|
|
<template v-if="form.typeId === 2"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-form-item prop="connectionType" label="连接类型"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">连接类型</p> |
|
|
|
|
|
|
|
<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> |
|
|
|
<el-radio :label="2">站外链接</el-radio> |
|
|
|
<el-radio :label="2">站外链接</el-radio> |
|
|
|
<el-radio :label="3">其他站点链接</el-radio> |
|
|
|
<el-radio :label="3">其他站点链接</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
<el-form-item v-show="form.connectionType === 1" label="站内链接"> |
|
|
|
<el-card v-show="form.connectionType === 1" shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">站内链接</p> |
|
|
|
|
|
|
|
<el-cascader |
|
|
|
<el-cascader |
|
|
|
v-model="links" |
|
|
|
v-model="links" |
|
|
|
:options="columns" |
|
|
|
:options="columns" |
|
|
|
:props="columnProps" |
|
|
|
:props="columnProps" |
|
|
|
clearable></el-cascader> |
|
|
|
clearable></el-cascader> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
<el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接"> |
|
|
|
<el-card v-show="form.connectionType === 2" shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">站外链接</p> |
|
|
|
|
|
|
|
<el-input |
|
|
|
<el-input |
|
|
|
placeholder="请输入站外链接" |
|
|
|
placeholder="请输入站外链接" |
|
|
|
v-model.trim="form.linkAddress" |
|
|
|
v-model.trim="form.linkAddress" |
|
|
|
clearable |
|
|
|
clearable |
|
|
|
></el-input> |
|
|
|
></el-input> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<template v-if="form.connectionType === 3"> |
|
|
|
<template v-if="form.connectionType === 3"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-form-item prop="siteSelection" label="站点选择"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">站点选择</p> |
|
|
|
|
|
|
|
<el-select v-model="form.siteSelection"> |
|
|
|
<el-select v-model="form.siteSelection"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in sites" |
|
|
|
v-for="item in sites" |
|
|
@ -183,23 +159,24 @@ |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
<el-form-item label="栏目"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">栏目</p> |
|
|
|
|
|
|
|
<el-cascader |
|
|
|
<el-cascader |
|
|
|
:options="links" |
|
|
|
:options="links" |
|
|
|
:props="{ checkStrictly: true }" |
|
|
|
:props="{ checkStrictly: true }" |
|
|
|
clearable></el-cascader> |
|
|
|
clearable></el-cascader> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
</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> |
|
|
|
<template v-if="form.typeId === 3"> |
|
|
|
<template v-if="form.typeId === 3"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-form-item prop="templateId" label="栏目模板"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">栏目模板</p> |
|
|
|
|
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in templates" |
|
|
|
v-for="item in templates" |
|
|
@ -208,45 +185,55 @@ |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
<div class="style-wrap"> |
|
|
|
</el-form-item> |
|
|
|
<p class="label">列表样式</p> |
|
|
|
<el-form-item prop="listStyleId" label="列表样式"> |
|
|
|
<ul class="styles"> |
|
|
|
<ul class="styles"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/list1.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
|
|
|
|
<div class="review"> |
|
|
|
|
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<el-card v-show="form.typeId === 4" shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-form-item v-show="form.typeId === 4" prop="showWithDetails" label="只有一篇文章时,以详情方式展示"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">只有一篇文章时,以详情方式展示</p> |
|
|
|
|
|
|
|
<el-switch |
|
|
|
<el-switch |
|
|
|
v-model="form.showWithDetails" |
|
|
|
v-model="form.showWithDetails" |
|
|
|
:active-value="1" |
|
|
|
:active-value="1" |
|
|
|
:inactive-value="0"> |
|
|
|
:inactive-value="0"> |
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div class="btns"> |
|
|
|
|
|
|
|
<el-button type="primary" @click="submit(1)">发布</el-button> |
|
|
|
|
|
|
|
<el-button @click="preview">预览</el-button> |
|
|
|
|
|
|
|
<el-button v-if="!isEdit" @click="submit(0)">保存草稿</el-button> |
|
|
|
|
|
|
|
<el-button @click="$router.back()">取消</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import util from "@/libs/util"; |
|
|
|
import util from "@/libs/util"; |
|
|
|
import ColumnConst from '@/const/column' |
|
|
|
import ColumnConst from '@/const/column' |
|
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
import { mapState } from 'vuex' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
siteId: this.$store.state.content.siteId, |
|
|
|
isEdit: this.$route.query.type === 'edit', |
|
|
|
isEdit: this.$route.query.type === 'edit', |
|
|
|
headers: {}, |
|
|
|
|
|
|
|
nameRepeat: false, |
|
|
|
nameRepeat: false, |
|
|
|
types: ColumnConst.types, |
|
|
|
types: ColumnConst.types, |
|
|
|
templates: ColumnConst.templates, |
|
|
|
templates: ColumnConst.templates, |
|
|
@ -259,6 +246,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
links: [], |
|
|
|
links: [], |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
|
|
|
|
siteId: this.$store.state.content.siteId, |
|
|
|
id: this.$route.query.id || '', |
|
|
|
id: this.$route.query.id || '', |
|
|
|
founderId: +this.$store.state.user.userId, |
|
|
|
founderId: +this.$store.state.user.userId, |
|
|
|
editorId: +this.$store.state.user.userId, |
|
|
|
editorId: +this.$store.state.user.userId, |
|
|
@ -278,11 +266,17 @@ export default { |
|
|
|
siteSelection: 1, |
|
|
|
siteSelection: 1, |
|
|
|
status: 1, |
|
|
|
status: 1, |
|
|
|
sort: 1, |
|
|
|
sort: 1, |
|
|
|
|
|
|
|
isOpen: 1 |
|
|
|
}, |
|
|
|
}, |
|
|
|
submiting: false, // 新增编辑防抖标识 |
|
|
|
submiting: false, // 新增编辑防抖标识 |
|
|
|
updateTime: 0 |
|
|
|
updateTime: 0 |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
|
|
...mapState('user', [ |
|
|
|
|
|
|
|
'userName' |
|
|
|
|
|
|
|
]) |
|
|
|
|
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted() { |
|
|
|
this.getList() |
|
|
|
this.getList() |
|
|
|
this.isEdit && this.getData() |
|
|
|
this.isEdit && this.getData() |
|
|
@ -300,6 +294,7 @@ export default { |
|
|
|
// 获取栏目列表 |
|
|
|
// 获取栏目列表 |
|
|
|
getList() { |
|
|
|
getList() { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
|
|
|
|
siteId: this.siteId, |
|
|
|
columnName: '', |
|
|
|
columnName: '', |
|
|
|
templateId: '', |
|
|
|
templateId: '', |
|
|
|
typeId : '', |
|
|
|
typeId : '', |
|
|
@ -322,6 +317,7 @@ export default { |
|
|
|
const { columnName, level, id } = this.form |
|
|
|
const { columnName, level, id } = this.form |
|
|
|
if (columnName && columnName !== this.originalName) { |
|
|
|
if (columnName && columnName !== this.originalName) { |
|
|
|
this.$post(this.api.sameLevelJudgment, { |
|
|
|
this.$post(this.api.sameLevelJudgment, { |
|
|
|
|
|
|
|
siteId: this.siteId, |
|
|
|
columnName, |
|
|
|
columnName, |
|
|
|
level: +level, |
|
|
|
level: +level, |
|
|
|
id: +id || '' |
|
|
|
id: +id || '' |
|
|
@ -337,6 +333,19 @@ export default { |
|
|
|
// 栏目类型回调 |
|
|
|
// 栏目类型回调 |
|
|
|
typeChange(val) { |
|
|
|
typeChange(val) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 导入前的钩子 |
|
|
|
|
|
|
|
beforeUpload(file) { |
|
|
|
|
|
|
|
const { size, name } = file |
|
|
|
|
|
|
|
const ext = name.substring(name.lastIndexOf('.') + 1) |
|
|
|
|
|
|
|
if (!util.isImg(ext)) { |
|
|
|
|
|
|
|
this.$message.error('请上传图片!') |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (size / 1024 / 1024 > 1) { |
|
|
|
|
|
|
|
this.$message.error('请上传1M以内的图片!') |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
uploadError(err, file, fileList) { |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
@ -345,9 +354,6 @@ export default { |
|
|
|
center: true |
|
|
|
center: true |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeRemove(file, fileList) { |
|
|
|
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleExceed(files, fileList) { |
|
|
|
handleExceed(files, fileList) { |
|
|
|
util.errorMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); |
|
|
|
util.errorMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -355,10 +361,14 @@ export default { |
|
|
|
this.form.columnBanner = '' |
|
|
|
this.form.columnBanner = '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
uploadSuccess(res) { |
|
|
|
uploadSuccess(res) { |
|
|
|
this.form.columnBanner = res.data.filesResult.fileUrl |
|
|
|
this.form.columnBanner = res.data.url |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 预览 |
|
|
|
|
|
|
|
preview() { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 提交 |
|
|
|
// 提交 |
|
|
|
submit() { |
|
|
|
submit(status) { |
|
|
|
if (this.submiting) return false |
|
|
|
if (this.submiting) return false |
|
|
|
const { form } = this |
|
|
|
const { form } = this |
|
|
|
if (!form.columnName) return util.errorMsg('请填写栏目名称') |
|
|
|
if (!form.columnName) return util.errorMsg('请填写栏目名称') |
|
|
@ -371,7 +381,7 @@ export default { |
|
|
|
if (!links.length && form.connectionType === 3) return util.errorMsg('请选择栏目') |
|
|
|
if (!links.length && form.connectionType === 3) return util.errorMsg('请选择栏目') |
|
|
|
form.linkAddress = links.join() |
|
|
|
form.linkAddress = links.join() |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(44, this.links) |
|
|
|
form.status = status |
|
|
|
this.submiting = true |
|
|
|
this.submiting = true |
|
|
|
if (this.isEdit) { |
|
|
|
if (this.isEdit) { |
|
|
|
delete form.children |
|
|
|
delete form.children |
|
|
@ -390,79 +400,44 @@ export default { |
|
|
|
this.submiting = false |
|
|
|
this.submiting = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 返回上一页 |
|
|
|
|
|
|
|
backPage() { |
|
|
|
|
|
|
|
this.$router.back() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
goBack() { |
|
|
|
|
|
|
|
const { id } = this.form |
|
|
|
|
|
|
|
const { updateTime } = this |
|
|
|
|
|
|
|
// 更改了信息才需要提示 |
|
|
|
|
|
|
|
if ((!this.isEdit && updateTime > 1) || (id && updateTime > 2)) { |
|
|
|
|
|
|
|
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', { |
|
|
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
this.submit() |
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
this.backPage() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.backPage() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.inline-input { |
|
|
|
|
|
|
|
width: 500px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$upload-width: 220px; |
|
|
|
$upload-width: 220px; |
|
|
|
$upload-height: 140px; |
|
|
|
$upload-height: 102px; |
|
|
|
$upload-lg-height: 150px; |
|
|
|
$upload-lg-height: 102px; |
|
|
|
/deep/ .avatar-uploader { |
|
|
|
/deep/ .avatar-uploader { |
|
|
|
.el-upload { |
|
|
|
.el-upload { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
width: $upload-width; |
|
|
|
width: $upload-width; |
|
|
|
height: $upload-height; |
|
|
|
height: $upload-height; |
|
|
|
border: 1px dashed #d9d9d9; |
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
border-radius: 6px; |
|
|
|
border-radius: 2px; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
overflow: hidden; |
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
|
|
|
|
border-color: #cb221c; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
.uploader-default { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
height: $upload-height; |
|
|
|
height: $upload-height; |
|
|
|
flex-direction: column; |
|
|
|
flex-direction: column; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
background: rgba(0, 0, 0, 0.04); |
|
|
|
background: #FAFAFA; |
|
|
|
|
|
|
|
|
|
|
|
i { |
|
|
|
|
|
|
|
font-size: 20px; |
|
|
|
|
|
|
|
font-weight: bold; |
|
|
|
|
|
|
|
color: #8c939d; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p { |
|
|
|
p { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
color: #333; |
|
|
|
line-height: 1; |
|
|
|
line-height: 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
&.avatar-uploader-lg { |
|
|
|
&.avatar-uploader-lg { |
|
|
|
.el-upload { |
|
|
|
.el-upload { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
max-width: 960px; |
|
|
|
max-width: 820px; |
|
|
|
height: $upload-lg-height; |
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
.uploader-default { |
|
|
@ -470,30 +445,21 @@ $upload-lg-height: 150px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.avatar { |
|
|
|
.avatar { |
|
|
|
display: block; |
|
|
|
display: block; |
|
|
|
width: $upload-width; |
|
|
|
width: $upload-width; |
|
|
|
height: $upload-height; |
|
|
|
height: $upload-height; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.avatar-lg { |
|
|
|
.avatar-lg { |
|
|
|
display: block; |
|
|
|
display: block; |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: $upload-lg-height; |
|
|
|
height: $upload-lg-height; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-upload__tip { |
|
|
|
.el-upload__tip { |
|
|
|
margin-top: 0; |
|
|
|
margin-top: 0; |
|
|
|
|
|
|
|
|
|
|
|
p { |
|
|
|
p { |
|
|
|
font-size: 14px; |
|
|
|
font-size: 12px; |
|
|
|
color: rgba(0, 0, 0, 0.45); |
|
|
|
color: #333; |
|
|
|
line-height: 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:first-child { |
|
|
|
|
|
|
|
margin-bottom: 5px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -508,6 +474,16 @@ $upload-lg-height: 150px; |
|
|
|
display: inline-flex; |
|
|
|
display: inline-flex; |
|
|
|
li { |
|
|
|
li { |
|
|
|
margin-right: 20px; |
|
|
|
margin-right: 20px; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
&:hover .review { |
|
|
|
|
|
|
|
border-color: #2962FF; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.review { |
|
|
|
|
|
|
|
padding: 18px; |
|
|
|
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
|
|
|
|
border-radius: 2px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |