|
|
@ -1,252 +1,239 @@ |
|
|
|
<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-input |
|
|
|
<el-button type="primary" @click="submit">{{ form.id ? "更新" : "创建" }}</el-button> |
|
|
|
placeholder="请输入栏目名称" |
|
|
|
</div> |
|
|
|
v-model.trim="form.columnName" |
|
|
|
</div> |
|
|
|
clearable |
|
|
|
</el-card> |
|
|
|
maxlength="15" |
|
|
|
|
|
|
|
@change="nameChange" |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
></el-input> |
|
|
|
<div> |
|
|
|
</el-form-item> |
|
|
|
<p class="m-b-20">栏目名称</p> |
|
|
|
<el-form-item prop="fatherId" label="设置上级"> |
|
|
|
<el-input |
|
|
|
<el-cascader |
|
|
|
placeholder="请输入栏目名称" |
|
|
|
v-model="form.fatherId" |
|
|
|
v-model.trim="form.columnName" |
|
|
|
:options="columns" |
|
|
|
clearable |
|
|
|
:props="columnProps" |
|
|
|
maxlength="15" |
|
|
|
clearable></el-cascader> |
|
|
|
class="inline-input" |
|
|
|
</el-form-item> |
|
|
|
@change="nameChange" |
|
|
|
</div> |
|
|
|
></el-input> |
|
|
|
<div class="item-line"> |
|
|
|
</div> |
|
|
|
<el-form-item prop="typeId" label="栏目类型"> |
|
|
|
</el-card> |
|
|
|
<el-select v-model="form.typeId" @change="typeChange"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-option |
|
|
|
<div> |
|
|
|
v-for="item in types" |
|
|
|
<p class="m-b-20">设置上级</p> |
|
|
|
:key="item.id" |
|
|
|
<el-cascader |
|
|
|
:label="item.name" |
|
|
|
v-model="form.fatherId" |
|
|
|
:value="item.id"> |
|
|
|
:options="columns" |
|
|
|
</el-option> |
|
|
|
:props="columnProps" |
|
|
|
</el-select> |
|
|
|
clearable></el-cascader> |
|
|
|
</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-switch |
|
|
|
<div class="inline-input"> |
|
|
|
v-model="form.menuVisible" |
|
|
|
<el-select v-model="form.typeId" @change="typeChange"> |
|
|
|
:active-value="0" |
|
|
|
<el-option |
|
|
|
:inactive-value="1"> |
|
|
|
v-for="item in types" |
|
|
|
</el-switch> |
|
|
|
:key="item.id" |
|
|
|
</el-form-item> |
|
|
|
:label="item.name" |
|
|
|
</div> |
|
|
|
:value="item.id"> |
|
|
|
<div class="line"></div> |
|
|
|
</el-option> |
|
|
|
<template v-if="form.typeId === 1 || form.typeId === 4"> |
|
|
|
</el-select> |
|
|
|
<el-form-item prop="columnBanner" label="栏目banner"> |
|
|
|
</div> |
|
|
|
<el-upload |
|
|
|
</div> |
|
|
|
class="avatar-uploader avatar-uploader-lg" |
|
|
|
</el-card> |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
:before-upload="beforeUpload" |
|
|
|
<div> |
|
|
|
:on-remove="handleRemove" |
|
|
|
<p class="m-b-20">分页条数</p> |
|
|
|
:on-error="uploadError" |
|
|
|
<el-input |
|
|
|
:on-success="uploadSuccess" |
|
|
|
placeholder="请输入分页条数" |
|
|
|
:limit="1" |
|
|
|
v-model.trim="form.pageSize" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
maxlength="15" |
|
|
|
:show-file-list="false" |
|
|
|
type="number" |
|
|
|
:action="this.api.upload" |
|
|
|
style="width: 150px" |
|
|
|
:data="{ |
|
|
|
></el-input> |
|
|
|
quote: form.columnName, |
|
|
|
</div> |
|
|
|
site: '粒子研究院中文站点', |
|
|
|
</el-card> |
|
|
|
uploader: userName |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
}" |
|
|
|
<div> |
|
|
|
> |
|
|
|
<p class="m-b-20">导航菜单可见</p> |
|
|
|
<img v-if="form.columnBanner" :src="form.columnBanner" class="avatar"> |
|
|
|
<el-switch |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
v-model="form.menuVisible" |
|
|
|
<img class="plus" src="@/assets/img/plus.png" alt=""> |
|
|
|
:active-value="0" |
|
|
|
<p>点击上传</p> |
|
|
|
:inactive-value="1"> |
|
|
|
</div> |
|
|
|
</el-switch> |
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
</div> |
|
|
|
<p>请上传1920x500PX,1M以内的jpg,bmp,png格式</p> |
|
|
|
</el-card> |
|
|
|
</div> |
|
|
|
<template v-if="form.typeId === 1 || form.typeId === 4"> |
|
|
|
</el-upload> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
</el-form-item> |
|
|
|
<div> |
|
|
|
<el-form-item prop="templateId" label="栏目模板"> |
|
|
|
<p class="m-b-20">栏目banner</p> |
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
<el-upload |
|
|
|
<el-option |
|
|
|
class="avatar-uploader avatar-uploader-lg" |
|
|
|
v-for="item in templates" |
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
:key="item.id" |
|
|
|
:on-remove="handleRemove" |
|
|
|
:label="item.name" |
|
|
|
:on-error="uploadError" |
|
|
|
:value="item.id"> |
|
|
|
:on-success="uploadSuccess" |
|
|
|
</el-option> |
|
|
|
:before-remove="beforeRemove" |
|
|
|
</el-select> |
|
|
|
:limit="1" |
|
|
|
</el-form-item> |
|
|
|
:on-exceed="handleExceed" |
|
|
|
<el-form-item prop="listStyleId" label="列表样式"> |
|
|
|
:action="this.api.fileupload" |
|
|
|
<ul class="styles"> |
|
|
|
:headers="headers" |
|
|
|
<li> |
|
|
|
name="file" |
|
|
|
<div class="review"> |
|
|
|
> |
|
|
|
<img src="@/assets/img/list1.png" alt=""> |
|
|
|
<img v-if="form.columnBanner" :src="form.columnBanner" class="avatar"> |
|
|
|
</div> |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
</li> |
|
|
|
<p>上传banner</p> |
|
|
|
<li> |
|
|
|
</div> |
|
|
|
<div class="review"> |
|
|
|
<div slot="tip" class="el-upload__tip"> |
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
<p>展示宽度为220,高度140,JPG/PNG/GIF,3MB以内</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
</el-upload> |
|
|
|
</li> |
|
|
|
</div> |
|
|
|
<li> |
|
|
|
</el-card> |
|
|
|
<div class="review"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
<div> |
|
|
|
</div> |
|
|
|
<p class="m-b-20">栏目模板</p> |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
</li> |
|
|
|
<el-option |
|
|
|
</ul> |
|
|
|
v-for="item in templates" |
|
|
|
</el-form-item> |
|
|
|
:key="item.id" |
|
|
|
<el-form-item prop="detailStyle" label="详情样式"> |
|
|
|
:label="item.name" |
|
|
|
<ul class="styles"> |
|
|
|
:value="item.id"> |
|
|
|
<li> |
|
|
|
</el-option> |
|
|
|
<div class="review"> |
|
|
|
</el-select> |
|
|
|
<img src="@/assets/img/article1.png" alt=""> |
|
|
|
<div class="style-wrap"> |
|
|
|
</div> |
|
|
|
<p class="label">列表样式</p> |
|
|
|
<el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio> |
|
|
|
<ul class="styles"> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
<div class="review"> |
|
|
|
</li> |
|
|
|
<img src="@/assets/img/article2.png" alt=""> |
|
|
|
<li> |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
<el-radio v-model="form.detailStyle" :label="2">富文本</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
<div class="review"> |
|
|
|
</li> |
|
|
|
<img src="@/assets/img/article3.png" alt=""> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.detailStyle" :label="3">链接</el-radio> |
|
|
|
<div class="style-wrap"> |
|
|
|
</li> |
|
|
|
<p class="label">详情样式</p> |
|
|
|
</ul> |
|
|
|
<ul class="styles"> |
|
|
|
</el-form-item> |
|
|
|
<li> |
|
|
|
</template> |
|
|
|
<el-radio v-model="form.detailStyle" :label="1">视频详情</el-radio> |
|
|
|
<template v-if="form.typeId === 2"> |
|
|
|
</li> |
|
|
|
<el-form-item prop="connectionType" label="连接类型"> |
|
|
|
<li> |
|
|
|
<el-radio-group v-model="form.connectionType"> |
|
|
|
<el-radio v-model="form.detailStyle" :label="2">富文本</el-radio> |
|
|
|
<el-radio :label="1">站内链接</el-radio> |
|
|
|
</li> |
|
|
|
<el-radio :label="2">站外链接</el-radio> |
|
|
|
<li> |
|
|
|
<el-radio :label="3">其他站点链接</el-radio> |
|
|
|
<el-radio v-model="form.detailStyle" :label="3">链接</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</li> |
|
|
|
</el-form-item> |
|
|
|
</ul> |
|
|
|
<el-form-item v-show="form.connectionType === 1" label="站内链接"> |
|
|
|
</div> |
|
|
|
<el-cascader |
|
|
|
</div> |
|
|
|
v-model="links" |
|
|
|
</el-card> |
|
|
|
:options="columns" |
|
|
|
</template> |
|
|
|
:props="columnProps" |
|
|
|
<template v-if="form.typeId === 2"> |
|
|
|
clearable></el-cascader> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
</el-form-item> |
|
|
|
<div> |
|
|
|
<el-form-item v-show="form.connectionType === 2" prop="linkAddress" label="站外链接"> |
|
|
|
<p class="m-b-20">连接类型</p> |
|
|
|
<el-input |
|
|
|
<el-radio-group v-model="form.connectionType"> |
|
|
|
placeholder="请输入站外链接" |
|
|
|
<el-radio :label="1">站内链接</el-radio> |
|
|
|
v-model.trim="form.linkAddress" |
|
|
|
<el-radio :label="2">站外链接</el-radio> |
|
|
|
clearable |
|
|
|
<el-radio :label="3">其他站点链接</el-radio> |
|
|
|
></el-input> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
<template v-if="form.connectionType === 3"> |
|
|
|
</el-card> |
|
|
|
<el-form-item prop="siteSelection" label="站点选择"> |
|
|
|
<el-card v-show="form.connectionType === 1" shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-select v-model="form.siteSelection"> |
|
|
|
<div> |
|
|
|
<el-option |
|
|
|
<p class="m-b-20">站内链接</p> |
|
|
|
v-for="item in sites" |
|
|
|
<el-cascader |
|
|
|
:key="item.id" |
|
|
|
v-model="links" |
|
|
|
:label="item.name" |
|
|
|
:options="columns" |
|
|
|
:value="item.id"> |
|
|
|
:props="columnProps" |
|
|
|
</el-option> |
|
|
|
clearable></el-cascader> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-card> |
|
|
|
<el-form-item label="栏目"> |
|
|
|
<el-card v-show="form.connectionType === 2" shadow="hover" class="mgr20 m-b-20"> |
|
|
|
<el-cascader |
|
|
|
<div> |
|
|
|
:options="links" |
|
|
|
<p class="m-b-20">站外链接</p> |
|
|
|
:props="{ checkStrictly: true }" |
|
|
|
<el-input |
|
|
|
clearable></el-cascader> |
|
|
|
placeholder="请输入站外链接" |
|
|
|
</el-form-item> |
|
|
|
v-model.trim="form.linkAddress" |
|
|
|
</template> |
|
|
|
clearable |
|
|
|
<el-form-item prop="isOpen" label="新窗口打开"> |
|
|
|
></el-input> |
|
|
|
<el-switch |
|
|
|
</div> |
|
|
|
v-model="form.isOpen" |
|
|
|
</el-card> |
|
|
|
:active-value="1" |
|
|
|
<template v-if="form.connectionType === 3"> |
|
|
|
:inactive-value="0"> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
</el-switch> |
|
|
|
<div> |
|
|
|
</el-form-item> |
|
|
|
<p class="m-b-20">站点选择</p> |
|
|
|
</template> |
|
|
|
<el-select v-model="form.siteSelection"> |
|
|
|
<template v-if="form.typeId === 3"> |
|
|
|
<el-option |
|
|
|
<el-form-item prop="templateId" label="栏目模板"> |
|
|
|
v-for="item in sites" |
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
:key="item.id" |
|
|
|
<el-option |
|
|
|
:label="item.name" |
|
|
|
v-for="item in templates" |
|
|
|
:value="item.id"> |
|
|
|
:key="item.id" |
|
|
|
</el-option> |
|
|
|
:label="item.name" |
|
|
|
</el-select> |
|
|
|
:value="item.id"> |
|
|
|
</div> |
|
|
|
</el-option> |
|
|
|
</el-card> |
|
|
|
</el-select> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
</el-form-item> |
|
|
|
<div> |
|
|
|
<el-form-item prop="listStyleId" label="列表样式"> |
|
|
|
<p class="m-b-20">栏目</p> |
|
|
|
<ul class="styles"> |
|
|
|
<el-cascader |
|
|
|
<li> |
|
|
|
:options="links" |
|
|
|
<div class="review"> |
|
|
|
:props="{ checkStrictly: true }" |
|
|
|
<img src="@/assets/img/list1.png" alt=""> |
|
|
|
clearable></el-cascader> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
</el-card> |
|
|
|
</li> |
|
|
|
</template> |
|
|
|
<li> |
|
|
|
</template> |
|
|
|
<div class="review"> |
|
|
|
<template v-if="form.typeId === 3"> |
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
<el-card shadow="hover" class="mgr20 m-b-20"> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
<p class="m-b-20">栏目模板</p> |
|
|
|
</li> |
|
|
|
<el-select v-model="form.templateId"> |
|
|
|
<li> |
|
|
|
<el-option |
|
|
|
<div class="review"> |
|
|
|
v-for="item in templates" |
|
|
|
<img src="@/assets/img/list2.png" alt=""> |
|
|
|
:key="item.id" |
|
|
|
</div> |
|
|
|
:label="item.name" |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
:value="item.id"> |
|
|
|
</li> |
|
|
|
</el-option> |
|
|
|
</ul> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<div class="style-wrap"> |
|
|
|
</template> |
|
|
|
<p class="label">列表样式</p> |
|
|
|
<el-form-item v-show="form.typeId === 4" prop="showWithDetails" label="只有一篇文章时,以详情方式展示"> |
|
|
|
<ul class="styles"> |
|
|
|
<el-switch |
|
|
|
<li> |
|
|
|
v-model="form.showWithDetails" |
|
|
|
<el-radio v-model="form.listStyleId" :label="1">图片列表</el-radio> |
|
|
|
:active-value="1" |
|
|
|
</li> |
|
|
|
:inactive-value="0"> |
|
|
|
<li> |
|
|
|
</el-switch> |
|
|
|
<el-radio v-model="form.listStyleId" :label="2">新闻列表</el-radio> |
|
|
|
</el-form-item> |
|
|
|
</li> |
|
|
|
</el-form> |
|
|
|
<li> |
|
|
|
<div class="btns"> |
|
|
|
<el-radio v-model="form.listStyleId" :label="3">出版物列表</el-radio> |
|
|
|
<el-button type="primary" @click="submit(1)">发布</el-button> |
|
|
|
</li> |
|
|
|
<el-button @click="preview">预览</el-button> |
|
|
|
</ul> |
|
|
|
<el-button v-if="!isEdit" @click="submit(0)">保存草稿</el-button> |
|
|
|
</div> |
|
|
|
<el-button @click="$router.back()">取消</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<el-card v-show="form.typeId === 4" shadow="hover" class="mgr20 m-b-20"> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<p class="m-b-20">只有一篇文章时,以详情方式展示</p> |
|
|
|
|
|
|
|
<el-switch |
|
|
|
|
|
|
|
v-model="form.showWithDetails" |
|
|
|
|
|
|
|
:active-value="1" |
|
|
|
|
|
|
|
:inactive-value="0"> |
|
|
|
|
|
|
|
</el-switch> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-card> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
</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 : '', |
|
|
@ -320,8 +315,9 @@ export default { |
|
|
|
// 栏目名称判重 |
|
|
|
// 栏目名称判重 |
|
|
|
nameChange(){ |
|
|
|
nameChange(){ |
|
|
|
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,112 +400,68 @@ 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; |
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
&:hover { |
|
|
|
display: flex; |
|
|
|
border-color: #cb221c; |
|
|
|
height: $upload-height; |
|
|
|
} |
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
justify-content: center; |
|
|
|
.uploader-default { |
|
|
|
align-items: center; |
|
|
|
display: flex; |
|
|
|
text-align: center; |
|
|
|
height: $upload-height; |
|
|
|
background: #FAFAFA; |
|
|
|
flex-direction: column; |
|
|
|
p { |
|
|
|
justify-content: center; |
|
|
|
margin-top: 10px; |
|
|
|
text-align: center; |
|
|
|
font-size: 14px; |
|
|
|
background: rgba(0, 0, 0, 0.04); |
|
|
|
color: #333; |
|
|
|
|
|
|
|
line-height: 20px; |
|
|
|
i { |
|
|
|
} |
|
|
|
font-size: 20px; |
|
|
|
|
|
|
|
font-weight: bold; |
|
|
|
|
|
|
|
color: #8c939d; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p { |
|
|
|
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
|
|
color: rgba(0, 0, 0, 0.65); |
|
|
|
|
|
|
|
line-height: 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&.avatar-uploader-lg { |
|
|
|
|
|
|
|
.el-upload { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
max-width: 960px; |
|
|
|
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.avatar { |
|
|
|
|
|
|
|
display: block; |
|
|
|
|
|
|
|
width: $upload-width; |
|
|
|
|
|
|
|
height: $upload-height; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
&.avatar-uploader-lg { |
|
|
|
|
|
|
|
.el-upload { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
max-width: 820px; |
|
|
|
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
|
|
|
|
.avatar-lg { |
|
|
|
.uploader-default { |
|
|
|
display: block; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
height: $upload-lg-height; |
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
.el-upload__tip { |
|
|
|
.avatar { |
|
|
|
margin-top: 0; |
|
|
|
display: block; |
|
|
|
|
|
|
|
width: $upload-width; |
|
|
|
p { |
|
|
|
height: $upload-height; |
|
|
|
font-size: 14px; |
|
|
|
} |
|
|
|
color: rgba(0, 0, 0, 0.45); |
|
|
|
.avatar-lg { |
|
|
|
line-height: 1; |
|
|
|
display: block; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
&:first-child { |
|
|
|
height: $upload-lg-height; |
|
|
|
margin-bottom: 5px; |
|
|
|
} |
|
|
|
} |
|
|
|
.el-upload__tip { |
|
|
|
} |
|
|
|
margin-top: 0; |
|
|
|
|
|
|
|
p { |
|
|
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
|
|
color: #333; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.style-wrap { |
|
|
|
.style-wrap { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
@ -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> |