|
|
@ -2,204 +2,132 @@ |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<div class="tool"> |
|
|
|
<div class="tool"> |
|
|
|
<div class="search-wrap"> |
|
|
|
<div class="search-wrap"> |
|
|
|
<el-input placeholder="请输入悬浮栏名称" |
|
|
|
<el-input placeholder="请输入悬浮栏名称" v-model.trim="keyword" clearable></el-input> |
|
|
|
v-model.trim="keyword" |
|
|
|
|
|
|
|
clearable></el-input> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="actions"> |
|
|
|
<div class="actions"> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增'" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增'" type="primary" @click="add">新增</el-button> |
|
|
|
type="primary" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" @click="batchDel">删除</el-button> |
|
|
|
@click="add">新增</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" |
|
|
|
|
|
|
|
@click="batchDel">删除</el-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="listLoading" |
|
|
|
<el-table v-loading="listLoading" ref="table" :data="list" default-expand-all class="table" header-align="center" |
|
|
|
ref="table" |
|
|
|
@selection-change="handleSelectionChange" row-key="id"> |
|
|
|
:data="list" |
|
|
|
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
default-expand-all |
|
|
|
<el-table-column prop="schemeName" show-overflow-tooltip label="悬浮栏名称" min-width="140"></el-table-column> |
|
|
|
class="table" |
|
|
|
<el-table-column prop="scopeOfApplication" label="应用范围" min-width="100"></el-table-column> |
|
|
|
header-align="center" |
|
|
|
<el-table-column prop="numberOfContentModules" label="内容模块" min-width="100"></el-table-column> |
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
<el-table-column prop="createTime" label="创建时间" min-width="100"></el-table-column> |
|
|
|
row-key="id"> |
|
|
|
<el-table-column prop="updateTime" label="最近编辑" min-width="100"></el-table-column> |
|
|
|
<el-table-column type="selection" |
|
|
|
<el-table-column prop="editorSName" label="编辑人" min-width="100"></el-table-column> |
|
|
|
width="50" |
|
|
|
<el-table-column label="状态" min-width="100"> |
|
|
|
align="center" |
|
|
|
<template slot-scope="scope">{{ scope.row.isDisable ? '禁用' : '启用' }}</template> |
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="columnName" |
|
|
|
<el-table-column label="操作" width="180"> |
|
|
|
show-overflow-tooltip |
|
|
|
|
|
|
|
label="悬浮栏名称" |
|
|
|
|
|
|
|
min-width="140"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="typeId" |
|
|
|
|
|
|
|
label="应用范围" |
|
|
|
|
|
|
|
min-width="100"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="typeId" |
|
|
|
|
|
|
|
label="内容模块" |
|
|
|
|
|
|
|
min-width="100"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="typeId" |
|
|
|
|
|
|
|
label="创建时间" |
|
|
|
|
|
|
|
min-width="100"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="typeId" |
|
|
|
|
|
|
|
label="最近编辑" |
|
|
|
|
|
|
|
min-width="100"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="typeId" |
|
|
|
|
|
|
|
label="编辑人" |
|
|
|
|
|
|
|
min-width="100"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
width="180"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" type="text" |
|
|
|
type="text" |
|
|
|
@click="edit(scope.row)">编辑</el-button> |
|
|
|
@click="edit(scope.row, 'edit')">编辑</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" type="text" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" |
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
type="text" |
|
|
|
<el-switch class="m-l-10" v-model="scope.row.isDisable" :active-value="0" :inactive-value="1" |
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
@change="switchOff($event, scope.row, scope.$index)"> |
|
|
|
<el-switch class="m-l-10" |
|
|
|
|
|
|
|
v-model="scope.row.menuVisible" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
|
|
|
|
:inactive-value="1" |
|
|
|
|
|
|
|
@change="switchOff($event, scope.row, scope.$index)"> |
|
|
|
|
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagination"> |
|
|
|
|
|
|
|
<el-pagination background @current-change="handleCurrentChange" :current-page="page" |
|
|
|
|
|
|
|
layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="模块管理" |
|
|
|
<el-dialog title="模块管理" :visible.sync="moduleVisible" width="1000px" :close-on-click-modal="false"> |
|
|
|
:visible.sync="moduleVisible" |
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-suffix=":"> |
|
|
|
width="1000px" |
|
|
|
<div class="flex"> |
|
|
|
:close-on-click-modal="false"> |
|
|
|
<el-form-item prop="schemeName" label="悬浮栏目名称" label-width="130px"> |
|
|
|
|
|
|
|
<el-input style="width: 200px" placeholder="请输入悬浮栏目名称" v-model="form.schemeName" clearable |
|
|
|
<el-form ref="form" |
|
|
|
maxlength="10"></el-input> |
|
|
|
:model="moduleForm" |
|
|
|
</el-form-item> |
|
|
|
:rules="moduleRules"> |
|
|
|
<!-- <el-form-item prop="style" label="悬浮栏样式" label-width="110px"> |
|
|
|
<el-form-item prop="columnName" |
|
|
|
<el-select v-model="form.floatingBarStyle" clearable> |
|
|
|
label="悬浮栏目名称" |
|
|
|
<el-option v-for="item in styles" :key="item.id" :label="item.name" :value="item.id"> |
|
|
|
label-width="110px"> |
|
|
|
</el-option> |
|
|
|
<el-input style="width: 200px" |
|
|
|
</el-select> |
|
|
|
placeholder="请输入栏目名称" |
|
|
|
</el-form-item> --> |
|
|
|
v-model="moduleForm.columnName" |
|
|
|
</div> |
|
|
|
clearable |
|
|
|
<el-table class="module-table" :data="form.floatingColumnSchemeModules" header-align="center" row-key="id"> |
|
|
|
maxlength="10"></el-input> |
|
|
|
<el-table-column prop="pictureAddress" label="图片" min-width="140"> |
|
|
|
</el-form-item> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-table class="module-table" |
|
|
|
<img class="pic" :src="scope.row.pictureAddress" alt=""> |
|
|
|
:data="modules" |
|
|
|
</template> |
|
|
|
header-align="center" |
|
|
|
</el-table-column> |
|
|
|
row-key="id"> |
|
|
|
<el-table-column prop="schemeTitle" label="标题" min-width="240"></el-table-column> |
|
|
|
<el-table-column prop="columnName" |
|
|
|
<el-table-column prop="schemeContentJson" label="内容" min-width="240"> |
|
|
|
label="图片" |
|
|
|
<template slot-scope="scope"> |
|
|
|
min-width="140"></el-table-column> |
|
|
|
<div v-html="scope.row.schemeContentJson"></div> |
|
|
|
<el-table-column prop="columnName" |
|
|
|
</template> |
|
|
|
label="标题" |
|
|
|
</el-table-column> |
|
|
|
min-width="140"></el-table-column> |
|
|
|
<el-table-column label="操作" :width="110" align="center"> |
|
|
|
<el-table-column prop="columnName" |
|
|
|
|
|
|
|
label="内容" |
|
|
|
|
|
|
|
min-width="140"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
|
|
|
|
:width="150" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="flex a-center"> |
|
|
|
<div class="flex a-center"> |
|
|
|
<el-switch v-model="scope.row.isEnable" |
|
|
|
<el-switch v-model="scope.row.isDisable" :active-value="0" :inactive-value="1"> |
|
|
|
:active-value="1" |
|
|
|
|
|
|
|
:inactive-value="0"> |
|
|
|
|
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
<i class="el-icon-edit-outline del" |
|
|
|
<i class="el-icon-edit-outline del" @click="editRow(scope.row, scope.$index)"></i> |
|
|
|
@click="editRow(scope.row, scope.$index)"></i> |
|
|
|
<i class="el-icon-delete del" @click="delRow(scope.$index)"></i> |
|
|
|
<i class="el-icon-delete del" |
|
|
|
|
|
|
|
@click="delRow(scope.$index)"></i> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="plus"> |
|
|
|
<div class="plus m-b-30"> |
|
|
|
<i class="el-icon-circle-plus-outline" |
|
|
|
<i class="el-icon-circle-plus-outline" @click="addRow"></i> |
|
|
|
@click="addRow"></i> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-form-item label="应用范围"> |
|
|
|
<el-form-item label="应用范围"> |
|
|
|
<el-select v-model="moduleForm.range" |
|
|
|
<div class="flex"> |
|
|
|
clearable> |
|
|
|
<el-radio-group class="m-t-10" v-model="range"> |
|
|
|
<el-option v-for="item in ranges" |
|
|
|
<el-radio :label="0">网站全局</el-radio> |
|
|
|
:key="item.id" |
|
|
|
<el-radio :label="1">选择栏目</el-radio> |
|
|
|
:label="item.title" |
|
|
|
</el-radio-group> |
|
|
|
:value="item.id"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
<el-cascader v-if="range" class="m-l-30" v-model="selectColumn" :options="columns" :props="columnProps" |
|
|
|
</el-select> |
|
|
|
clearable></el-cascader> |
|
|
|
|
|
|
|
</div> |
|
|
|
</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="moduleVisible = false">取消</el-button> |
|
|
|
<el-button @click="moduleVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" @click="moduleSubmit">确定</el-button> |
|
|
|
@click="moduleSubmit">确定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="新增内容" |
|
|
|
|
|
|
|
:visible.sync="contentVisible" |
|
|
|
<el-dialog title="新增内容" :visible.sync="contentVisible" width="900px" :close-on-click-modal="false"> |
|
|
|
width="700px" |
|
|
|
<el-form ref="contentForm" :model="curRow" :rules="contentRules" label-width="100px" label-suffix=":"> |
|
|
|
:close-on-click-modal="false"> |
|
|
|
<el-form-item prop="pictureAddress" label="图片"> |
|
|
|
<el-form ref="form" |
|
|
|
<el-upload class="avatar-uploader" accept=".jpg,.png,.jpeg,.gif" :on-change="file => changeFile(file)" |
|
|
|
:model="contentForm" |
|
|
|
:show-file-list="false" :action="this.api.upload" :auto-upload="false"> |
|
|
|
:rules="contentRules"> |
|
|
|
<img v-if="curRow.pictureAddress" :src="curRow.pictureAddress" class="avatar"> |
|
|
|
<el-form-item prop="titleImg" |
|
|
|
<div class="uploader-default" v-else> |
|
|
|
label="图片"> |
|
|
|
<img class="plus" src="@/assets/images/plus.png" alt=""> |
|
|
|
<el-upload class="avatar-uploader" |
|
|
|
|
|
|
|
accept=".jpg,.png,.jpeg,.gif" |
|
|
|
|
|
|
|
:on-change="file => changeFile(file, 0)" |
|
|
|
|
|
|
|
:show-file-list="false" |
|
|
|
|
|
|
|
:action="this.api.upload" |
|
|
|
|
|
|
|
:auto-upload="false"> |
|
|
|
|
|
|
|
<img v-if="contentForm.titleImg" |
|
|
|
|
|
|
|
:src="contentForm.titleImg" |
|
|
|
|
|
|
|
class="avatar"> |
|
|
|
|
|
|
|
<div class="uploader-default" |
|
|
|
|
|
|
|
v-else> |
|
|
|
|
|
|
|
<img class="plus" |
|
|
|
|
|
|
|
src="@/assets/images/plus.png" |
|
|
|
|
|
|
|
alt=""> |
|
|
|
|
|
|
|
<p>点击上传</p> |
|
|
|
<p>点击上传</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="columnName" |
|
|
|
<el-form-item prop="schemeTitle" label="标题"> |
|
|
|
label="标题"> |
|
|
|
<el-input style="width: 200px" placeholder="请输入标题" v-model="curRow.schemeTitle" clearable |
|
|
|
<el-input style="width: 200px" |
|
|
|
maxlength="20"></el-input> |
|
|
|
placeholder="请输入栏目名称" |
|
|
|
|
|
|
|
v-model="contentForm.columnName" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
maxlength="20"></el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="columnName" |
|
|
|
<el-form-item prop="schemeContentJson" label="内容设置"> |
|
|
|
label="内容设置"> |
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="curRow.schemeContentJson" |
|
|
|
<el-radio-group v-model="contentForm.connectionType"> |
|
|
|
:init="editorConfig" /> |
|
|
|
<el-radio :label="1">富文本</el-radio> |
|
|
|
|
|
|
|
<el-radio :label="2">链接</el-radio> |
|
|
|
|
|
|
|
</el-radio-group> |
|
|
|
|
|
|
|
<Editor api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' |
|
|
|
|
|
|
|
v-model="contentForm.connectionType" |
|
|
|
|
|
|
|
:init="editorConfig" /> |
|
|
|
|
|
|
|
</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="contentVisible = false">取消</el-button> |
|
|
|
<el-button @click="contentVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
<el-button type="primary" @click="contentSubmit">确定</el-button> |
|
|
|
@click="contentSubmit">确定</el-button> |
|
|
|
|
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 剪裁组件弹窗 --> |
|
|
|
<!-- 剪裁组件弹窗 --> |
|
|
|
<el-dialog title="图片裁剪" |
|
|
|
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false"> |
|
|
|
append-to-body |
|
|
|
<Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" :fixedNumber.sync="fixedNumber" |
|
|
|
:visible.sync="cropperModel" |
|
|
|
@upload="customUpload" /> |
|
|
|
width="1100px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
|
|
<Cropper ref="cropper" |
|
|
|
|
|
|
|
:img-file.sync="file" |
|
|
|
|
|
|
|
:is-upload="isUpload" |
|
|
|
|
|
|
|
:fixed="true" |
|
|
|
|
|
|
|
:fixedNumber.sync="fixedNumber" |
|
|
|
|
|
|
|
@upload="customUpload" /> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -208,47 +136,67 @@ |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Axios from 'axios' |
|
|
|
import Axios from 'axios' |
|
|
|
|
|
|
|
import Cropper from '@/components/img-upload/Cropper' |
|
|
|
import Editor from '@tinymce/tinymce-vue' |
|
|
|
import Editor from '@tinymce/tinymce-vue' |
|
|
|
import editorConfig from '@/components/editor' |
|
|
|
import editorConfig from '@/components/editor' |
|
|
|
|
|
|
|
import _ from 'lodash' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
editorConfig, |
|
|
|
editorConfig, |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
siteName: this.$store.state.content.site.siteName, |
|
|
|
siteName: this.$store.state.content.site.siteName, |
|
|
|
templates: [], |
|
|
|
|
|
|
|
listStyle: [], |
|
|
|
|
|
|
|
pageStyle: [], |
|
|
|
|
|
|
|
detailStyle: [], |
|
|
|
|
|
|
|
keyword: '', |
|
|
|
keyword: '', |
|
|
|
searchTimer: null, |
|
|
|
searchTimer: null, |
|
|
|
list: [], |
|
|
|
list: [], |
|
|
|
|
|
|
|
page: 1, |
|
|
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
|
|
total: 0, |
|
|
|
multipleSelection: [], |
|
|
|
multipleSelection: [], |
|
|
|
listLoading: false, |
|
|
|
listLoading: false, |
|
|
|
styleVisible: false, |
|
|
|
range: 0, |
|
|
|
ranges: [], |
|
|
|
selectColumn: [], |
|
|
|
moduleForm: { |
|
|
|
columns: [], |
|
|
|
id: '', |
|
|
|
columnProps: { |
|
|
|
columnName: '', |
|
|
|
multiple: true, |
|
|
|
navigationStyle: 1, |
|
|
|
value: 'id', |
|
|
|
styleTemplate: 1, |
|
|
|
label: 'columnName' |
|
|
|
siteId: this.$store.state.content.site.id |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
moduleRules: { |
|
|
|
originForm: {}, |
|
|
|
columnName: [ |
|
|
|
form: { |
|
|
|
|
|
|
|
editorId: this.$store.state.user.userId, |
|
|
|
|
|
|
|
schemeName: '', |
|
|
|
|
|
|
|
floatingBarStyle: '1', |
|
|
|
|
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
|
|
|
|
floatingColumnSchemeModules: [], |
|
|
|
|
|
|
|
floatingColumnSchemeScopeOfApplications: [], |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
originModules: { |
|
|
|
|
|
|
|
pictureAddress: '', |
|
|
|
|
|
|
|
schemeContentJson: '', |
|
|
|
|
|
|
|
schemeTitle: '', |
|
|
|
|
|
|
|
isDisable: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
rules: { |
|
|
|
|
|
|
|
schemeName: [ |
|
|
|
{ required: true, message: '请输入悬浮栏目名称', trigger: 'blur' } |
|
|
|
{ required: true, message: '请输入悬浮栏目名称', trigger: 'blur' } |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
moduleVisible: false, |
|
|
|
moduleVisible: false, |
|
|
|
modules: [{}], |
|
|
|
modules: [], |
|
|
|
|
|
|
|
|
|
|
|
curRow: {}, |
|
|
|
curRow: {}, |
|
|
|
curModule: 0, |
|
|
|
curModule: 0, |
|
|
|
contentVisible: false, |
|
|
|
contentVisible: false, |
|
|
|
contentForm: {}, |
|
|
|
|
|
|
|
contentRules: { |
|
|
|
contentRules: { |
|
|
|
columnName: [ |
|
|
|
pictureAddress: [ |
|
|
|
{ required: true, message: '请输入悬浮栏目名称', trigger: 'blur' } |
|
|
|
{ required: true, message: '请上传图片', trigger: 'change' } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
schemeTitle: [ |
|
|
|
|
|
|
|
{ required: true, message: '请输入标题', trigger: 'blur' } |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
schemeContentJson: [ |
|
|
|
|
|
|
|
{ required: true, message: '请输入内容', trigger: 'blur' } |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -259,7 +207,8 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
Editor |
|
|
|
Editor, |
|
|
|
|
|
|
|
Cropper, |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
keyword: function (val) { |
|
|
|
keyword: function (val) { |
|
|
@ -282,18 +231,20 @@ export default { |
|
|
|
name: '悬浮栏设置' |
|
|
|
name: '悬浮栏设置' |
|
|
|
} |
|
|
|
} |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
this.originForm = _.cloneDeep(this.form) |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
|
|
|
|
this.getColumn() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData () { |
|
|
|
getData () { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
this.$post(this.api.listFloating, { |
|
|
|
siteId: this.siteId, |
|
|
|
siteId: this.siteId, |
|
|
|
columnName: this.keyword, |
|
|
|
search: this.keyword, |
|
|
|
templateId: '', |
|
|
|
pageNum: this.page, |
|
|
|
typeId: '', |
|
|
|
pageSize: this.pageSize, |
|
|
|
isSort: 1 |
|
|
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.list = data |
|
|
|
this.list = data.records |
|
|
|
|
|
|
|
this.total = +data.total |
|
|
|
this.listLoading = false |
|
|
|
this.listLoading = false |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
this.listLoading = false |
|
|
|
this.listLoading = false |
|
|
@ -305,16 +256,32 @@ export default { |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 栏目树形 |
|
|
|
|
|
|
|
async getColumn () { |
|
|
|
|
|
|
|
const { data } = await this.$post(this.api.listWithTree, { |
|
|
|
|
|
|
|
siteId: this.siteId, |
|
|
|
|
|
|
|
columnName: '', |
|
|
|
|
|
|
|
templateId: '', |
|
|
|
|
|
|
|
typeId: '', |
|
|
|
|
|
|
|
isSort: 1 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.columns = data |
|
|
|
|
|
|
|
}, |
|
|
|
add () { |
|
|
|
add () { |
|
|
|
|
|
|
|
this.range = 0 |
|
|
|
|
|
|
|
this.selectColumn = [] |
|
|
|
|
|
|
|
this.form = _.cloneDeep(this.originForm) |
|
|
|
this.moduleVisible = true |
|
|
|
this.moduleVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 添加行 |
|
|
|
// 添加行 |
|
|
|
addRow () { |
|
|
|
addRow () { |
|
|
|
// this.data.list.push(JSON.parse(JSON.stringify(this.data.historyForm))) |
|
|
|
this.curRow = _.cloneDeep(this.originModules) |
|
|
|
|
|
|
|
this.curModule = -1 |
|
|
|
|
|
|
|
this.contentVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑内容 |
|
|
|
// 编辑内容 |
|
|
|
editRow (row, i = 0) { |
|
|
|
editRow (row, i = 0) { |
|
|
|
this.curRow = JSON.parse(JSON.stringify(row)) |
|
|
|
this.curRow = _.cloneDeep(row) |
|
|
|
this.curModule = i |
|
|
|
this.curModule = i |
|
|
|
this.contentVisible = true |
|
|
|
this.contentVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
@ -323,19 +290,84 @@ export default { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
// list.splice(i, 1) |
|
|
|
this.form.floatingColumnSchemeModules.splice(i, 1) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
edit (row, type) { |
|
|
|
async edit (row) { |
|
|
|
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`) |
|
|
|
this.moduleVisible = true |
|
|
|
|
|
|
|
const { data } = await this.$post(`${this.api.findFloating}?id=${row.floatingBarSchemeId}`) |
|
|
|
|
|
|
|
const range = data.floatingColumnSchemeScopeOfApplications |
|
|
|
|
|
|
|
// 应用范围数组里有一个对象的applicationScopeId为0,则是网站全局 |
|
|
|
|
|
|
|
this.range = row.isGlobal ? 0 : 1 |
|
|
|
|
|
|
|
if (!row.isGlobal) { |
|
|
|
|
|
|
|
const column = [] |
|
|
|
|
|
|
|
// 选择栏目 |
|
|
|
|
|
|
|
range.map(e => { |
|
|
|
|
|
|
|
column.push(e.applicationScopeId.split(',').map(n => +n)) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.selectColumn = column |
|
|
|
|
|
|
|
console.log("🚀 ~ edit ~ this.selectColumn:", this.selectColumn) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.form = data |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 模块设置提交 |
|
|
|
// 模块设置提交 |
|
|
|
moduleSubmit () { |
|
|
|
moduleSubmit () { |
|
|
|
|
|
|
|
this.$refs.form.validate(async (valid) => { |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
|
|
|
|
if (this.submiting) return false |
|
|
|
|
|
|
|
const form = JSON.parse(JSON.stringify(this.form)) |
|
|
|
|
|
|
|
if (!form.floatingColumnSchemeModules.length) return Util.warningMsg('请添加内容模块') |
|
|
|
|
|
|
|
const column = this.selectColumn |
|
|
|
|
|
|
|
if (this.range && !column.length) return Util.warningMsg('请选择栏目') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.submiting = true |
|
|
|
|
|
|
|
if (this.range) { |
|
|
|
|
|
|
|
const scope = [] |
|
|
|
|
|
|
|
// debugger |
|
|
|
|
|
|
|
column.map(e => { |
|
|
|
|
|
|
|
scope.push({ |
|
|
|
|
|
|
|
applicationScopeId: typeof e === 'number' ? e : e.join(',') |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
form.floatingColumnSchemeScopeOfApplications = scope |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
form.floatingColumnSchemeScopeOfApplications = [{ |
|
|
|
|
|
|
|
applicationScopeId: 0 |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!form.floatingBarSchemeId) form.founderId = form.editorId |
|
|
|
|
|
|
|
// debugger |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$post(this.api.saveFloating, form) |
|
|
|
|
|
|
|
Util.successMsg('新增成功!') |
|
|
|
|
|
|
|
this.moduleVisible = false |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
|
|
this.submiting = false |
|
|
|
|
|
|
|
}, 2000) |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
this.submiting = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 内容设置提交 |
|
|
|
// 内容设置提交 |
|
|
|
contentSubmit () { |
|
|
|
contentSubmit () { |
|
|
|
|
|
|
|
this.$refs.contentForm.validate(async (valid) => { |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
|
|
|
|
this.contentVisible = false |
|
|
|
|
|
|
|
const row = this.curRow |
|
|
|
|
|
|
|
if (this.curModule === -1) { |
|
|
|
|
|
|
|
this.form.floatingColumnSchemeModules.push(_.cloneDeep(row)) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
const list = this.form.floatingColumnSchemeModules[this.curModule] |
|
|
|
|
|
|
|
for (const i in row) { |
|
|
|
|
|
|
|
this.$set(list, i, row[i]) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 图片裁剪上传事件 |
|
|
|
// 图片裁剪上传事件 |
|
|
|
customUpload (data) { |
|
|
|
customUpload (data) { |
|
|
@ -362,14 +394,14 @@ export default { |
|
|
|
}, 1000); |
|
|
|
}, 1000); |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
this.$set(this.curForm, 'pic', data.url) |
|
|
|
this.$set(this.curRow, 'pictureAddress', data.url) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
this.$refs.cropper.isDisabled = false |
|
|
|
this.$refs.cropper.isDisabled = false |
|
|
|
this.isUpload = false |
|
|
|
this.isUpload = false |
|
|
|
this.cropperModel = false |
|
|
|
this.cropperModel = false |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 图片改变钩子 |
|
|
|
// 图片改变钩子 |
|
|
|
changeFile (file, form) { |
|
|
|
changeFile (file) { |
|
|
|
const { size, name } = file |
|
|
|
const { size, name } = file |
|
|
|
const ext = name.substring(name.lastIndexOf('.') + 1) |
|
|
|
const ext = name.substring(name.lastIndexOf('.') + 1) |
|
|
|
if (!Util.isImg(ext)) { |
|
|
|
if (!Util.isImg(ext)) { |
|
|
@ -381,7 +413,6 @@ export default { |
|
|
|
return false |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
this.file = file |
|
|
|
this.file = file |
|
|
|
this.curForm = form |
|
|
|
|
|
|
|
this.cropperModel = true |
|
|
|
this.cropperModel = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.cropper.updateImg({ |
|
|
|
this.$refs.cropper.updateImg({ |
|
|
@ -392,38 +423,37 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
del (row) { |
|
|
|
del (row) { |
|
|
|
this.$confirm("删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?", "提示", { |
|
|
|
this.$confirm('确定要删除吗?', "提示", { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$post(`${this.api.deleteColumn}?ids=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.batchDeletionFloating}?id=${row.floatingBarSchemeId}`).then(res => { |
|
|
|
util.successMsg("删除成功") |
|
|
|
Util.successMsg("删除成功") |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 禁用启用 |
|
|
|
// 禁用启用 |
|
|
|
switchOff (val, row) { |
|
|
|
async switchOff (val, row) { |
|
|
|
this.$post(this.api.updateColumn, row).then(res => { }).catch((res) => { }) |
|
|
|
await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量删除 |
|
|
|
// 批量删除 |
|
|
|
batchDel () { |
|
|
|
batchDel () { |
|
|
|
const list = this.multipleSelection |
|
|
|
const list = this.multipleSelection |
|
|
|
if (list.length) { |
|
|
|
if (list.length) { |
|
|
|
this.$confirm('删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
const data = [] |
|
|
|
const ids = list.map(e => { |
|
|
|
list.map(e => { |
|
|
|
return 'id=' + e.floatingBarSchemeId |
|
|
|
data.push('ids=' + e.id) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$post(`${this.api.deleteColumn}?${data.join('&')}`).then(res => { |
|
|
|
this.$post(`${this.api.batchDeletionFloating}?${ids.join('&')}`).then(res => { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
util.successMsg("删除成功") |
|
|
|
Util.successMsg("删除成功") |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
util.errorMsg('请先选择数据 !') |
|
|
|
Util.errorMsg('请先选择数据 !') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionChange (val) { |
|
|
|
handleSelectionChange (val) { |
|
|
@ -440,80 +470,88 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.plus { |
|
|
|
.plus { |
|
|
|
margin-top: 10px; |
|
|
|
margin-top: 10px; |
|
|
|
font-size: 20px; |
|
|
|
font-size: 20px; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
color: $main-color; |
|
|
|
color: $main-color; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.del { |
|
|
|
.del { |
|
|
|
margin-left: 5px; |
|
|
|
margin-left: 8px; |
|
|
|
font-size: 18px; |
|
|
|
font-size: 18px; |
|
|
|
color: #333; |
|
|
|
color: #333; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$upload-width: 220px; |
|
|
|
$upload-width: 220px; |
|
|
|
$upload-height: 102px; |
|
|
|
$upload-height: 102px; |
|
|
|
$upload-lg-height: 102px; |
|
|
|
$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 solid #dcdee0; |
|
|
|
border: 1px solid #dcdee0; |
|
|
|
border-radius: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
overflow: hidden; |
|
|
|
overflow: hidden; |
|
|
|
.uploader-default { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
height: $upload-height; |
|
|
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
background: #fafafa; |
|
|
|
|
|
|
|
p { |
|
|
|
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
line-height: 20px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
&.avatar-uploader-lg { |
|
|
|
|
|
|
|
.el-upload { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
max-width: 820px; |
|
|
|
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
.uploader-default { |
|
|
|
height: $upload-lg-height; |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
height: $upload-height; |
|
|
|
} |
|
|
|
flex-direction: column; |
|
|
|
} |
|
|
|
justify-content: center; |
|
|
|
.avatar { |
|
|
|
align-items: center; |
|
|
|
display: block; |
|
|
|
text-align: center; |
|
|
|
width: $upload-width; |
|
|
|
background: #fafafa; |
|
|
|
height: $upload-height; |
|
|
|
|
|
|
|
|
|
|
|
p { |
|
|
|
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
line-height: 20px; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.avatar-lg { |
|
|
|
} |
|
|
|
display: block; |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
&.avatar-uploader-lg { |
|
|
|
|
|
|
|
.el-upload { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
max-width: 820px; |
|
|
|
|
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.uploader-default { |
|
|
|
height: $upload-lg-height; |
|
|
|
height: $upload-lg-height; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.el-upload__tip { |
|
|
|
} |
|
|
|
margin-top: 0; |
|
|
|
|
|
|
|
p { |
|
|
|
.avatar { |
|
|
|
font-size: 12px; |
|
|
|
display: block; |
|
|
|
color: #333; |
|
|
|
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; |
|
|
|
.pic { |
|
|
|
margin-top: 10px; |
|
|
|
max-width: 100px; |
|
|
|
.label { |
|
|
|
margin: 10px 0; |
|
|
|
margin-right: 30px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |