|
|
@ -2,91 +2,157 @@ |
|
|
|
<div class="page"> |
|
|
|
<div class="page"> |
|
|
|
<div class="tool"> |
|
|
|
<div class="tool"> |
|
|
|
<div class="search-wrap"> |
|
|
|
<div class="search-wrap"> |
|
|
|
<el-input placeholder="请输入栏目名称" v-model.trim="keyword" clearable></el-input> |
|
|
|
<el-input placeholder="请输入栏目名称" |
|
|
|
|
|
|
|
v-model.trim="keyword" |
|
|
|
|
|
|
|
clearable></el-input> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="actions"> |
|
|
|
<div class="actions"> |
|
|
|
<el-dropdown class="setting" trigger="click" :hide-on-click="false"> |
|
|
|
<el-dropdown class="setting" |
|
|
|
<img class="icon" src="@/assets/images/setting.png" alt=""> |
|
|
|
trigger="click" |
|
|
|
|
|
|
|
:hide-on-click="false"> |
|
|
|
|
|
|
|
<img class="icon" |
|
|
|
|
|
|
|
src="@/assets/images/setting.png" |
|
|
|
|
|
|
|
alt=""> |
|
|
|
<el-dropdown-menu> |
|
|
|
<el-dropdown-menu> |
|
|
|
<el-dropdown-item> |
|
|
|
<el-dropdown-item> |
|
|
|
<el-button @click="resetColumns" type="text">列重置</el-button> |
|
|
|
<el-button @click="resetColumns" |
|
|
|
|
|
|
|
type="text">列重置</el-button> |
|
|
|
</el-dropdown-item> |
|
|
|
</el-dropdown-item> |
|
|
|
<el-dropdown-item v-for="(column, i) in settings" :key="i" :divided="i === 0"> |
|
|
|
<el-dropdown-item v-for="(column, i) in settings" |
|
|
|
|
|
|
|
:key="i" |
|
|
|
|
|
|
|
:divided="i === 0"> |
|
|
|
<el-checkbox v-model="column.show">{{ column.name }}</el-checkbox> |
|
|
|
<el-checkbox v-model="column.show">{{ column.name }}</el-checkbox> |
|
|
|
</el-dropdown-item> |
|
|
|
</el-dropdown-item> |
|
|
|
</el-dropdown-menu> |
|
|
|
</el-dropdown-menu> |
|
|
|
</el-dropdown> |
|
|
|
</el-dropdown> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增'" type="primary" @click="add" >新增</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增'" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" @click="batchDel">删除</el-button> |
|
|
|
type="primary" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:更改排序'" class="lg" @click="sort">更改排序</el-button> |
|
|
|
@click="add">新增</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:导航样式设置'" class="lg" @click="styleSet">导航样式设置</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" |
|
|
|
|
|
|
|
@click="batchDel">删除</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:更改排序'" |
|
|
|
|
|
|
|
class="lg" |
|
|
|
|
|
|
|
@click="sort">更改排序</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:导航样式设置'" |
|
|
|
|
|
|
|
class="lg" |
|
|
|
|
|
|
|
@click="styleSet">导航样式设置</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="listLoading" ref="table" :data="list" default-expand-all class="table" header-align="center" @selection-change="handleSelectionChange" @select-all="selectAll" row-key="id"> |
|
|
|
<el-table v-loading="listLoading" |
|
|
|
<el-table-column v-if="settings[0].show" type="selection" width="50" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
ref="table" |
|
|
|
<el-table-column prop="columnName" show-overflow-tooltip label="名称" min-width="140"></el-table-column> |
|
|
|
:data="list" |
|
|
|
<el-table-column v-if="settings[1].show" prop="typeId" label="栏目类型" min-width="100"> |
|
|
|
default-expand-all |
|
|
|
|
|
|
|
class="table" |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
|
|
|
@select-all="selectAll" |
|
|
|
|
|
|
|
row-key="id"> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[0].show" |
|
|
|
|
|
|
|
type="selection" |
|
|
|
|
|
|
|
width="50" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="columnName" |
|
|
|
|
|
|
|
show-overflow-tooltip |
|
|
|
|
|
|
|
label="名称" |
|
|
|
|
|
|
|
min-width="140"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[1].show" |
|
|
|
|
|
|
|
prop="typeId" |
|
|
|
|
|
|
|
label="栏目类型" |
|
|
|
|
|
|
|
min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }} |
|
|
|
{{ types.find(e => e.id == scope.row.typeId) && types.find(e => e.id == scope.row.typeId).name }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[2].show" prop="templateName" label="栏目模板" min-width="100"> |
|
|
|
<el-table-column v-if="settings[2].show" |
|
|
|
|
|
|
|
prop="templateName" |
|
|
|
|
|
|
|
label="栏目模板" |
|
|
|
|
|
|
|
min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.typeId === 2 ? '--' : scope.row.templateName }} |
|
|
|
{{ scope.row.typeId === 2 ? '--' : scope.row.templateName }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[3].show" prop="listStyle" label="列表/长页样式" min-width="100"> |
|
|
|
<el-table-column v-if="settings[3].show" |
|
|
|
|
|
|
|
prop="listStyle" |
|
|
|
|
|
|
|
label="列表/长页样式" |
|
|
|
|
|
|
|
min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.typeId === 2 ? '--' : scope.row.listStyle }} |
|
|
|
{{ scope.row.typeId === 2 ? '--' : scope.row.listStyle }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[4].show" prop="detailStyle" label="详情样式" min-width="100"> |
|
|
|
<el-table-column v-if="settings[4].show" |
|
|
|
|
|
|
|
prop="detailStyle" |
|
|
|
|
|
|
|
label="详情样式" |
|
|
|
|
|
|
|
min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ (scope.row.typeId === 1 || scope.row.typeId === 4) ? scope.row.detailStyle : '--' }} |
|
|
|
{{ (scope.row.typeId === 1 || scope.row.typeId === 4) ? scope.row.detailStyle : '--' }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[5].show" prop="menuVisible" label="导航菜单" min-width="100"> |
|
|
|
<el-table-column v-if="settings[5].show" |
|
|
|
|
|
|
|
prop="menuVisible" |
|
|
|
|
|
|
|
label="导航菜单" |
|
|
|
|
|
|
|
min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-switch |
|
|
|
<el-switch v-model="scope.row.menuVisible" |
|
|
|
v-model="scope.row.menuVisible" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
:active-value="0" |
|
|
|
:inactive-value="1" |
|
|
|
:inactive-value="1" |
|
|
|
@change="switchOff($event, scope.row, scope.$index)"> |
|
|
|
@change="switchOff($event, scope.row, scope.$index)"> |
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[6].show" prop="id" label="ID" min-width="80"></el-table-column> |
|
|
|
<el-table-column v-if="settings[6].show" |
|
|
|
<el-table-column v-if="settings[7].show" label="操作" width="270"> |
|
|
|
prop="id" |
|
|
|
|
|
|
|
label="ID" |
|
|
|
|
|
|
|
min-width="80"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[7].show" |
|
|
|
|
|
|
|
label="操作" |
|
|
|
|
|
|
|
width="270"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增下级'" type="text" @click="edit(scope.row, 'add')">新增下级</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增下级'" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" type="text" @click="edit(scope.row, 'edit')">编辑</el-button> |
|
|
|
type="text" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" type="text" @click="del(scope.row)">删除</el-button> |
|
|
|
@click="edit(scope.row, 'add')">新增下级</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:预览'" v-if="scope.row.typeId != 2" type="text" @click="preview(scope.row)">预览</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:页面管理'" v-if="scope.row.typeId == 3" class="page-set" type="primary" size="mini" @click="page(scope.row)">页面设置</el-button> |
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="edit(scope.row, 'edit')">编辑</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="del(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:预览'" |
|
|
|
|
|
|
|
v-if="scope.row.typeId != 2" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="preview(scope.row)">预览</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:页面管理'" |
|
|
|
|
|
|
|
v-if="scope.row.typeId == 3" |
|
|
|
|
|
|
|
class="page-set" |
|
|
|
|
|
|
|
type="primary" |
|
|
|
|
|
|
|
size="mini" |
|
|
|
|
|
|
|
@click="page(scope.row)">页面设置</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="编辑栏目排序" :visible.sync="sortVisible" width="750px" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="编辑栏目排序" |
|
|
|
|
|
|
|
:visible.sync="sortVisible" |
|
|
|
|
|
|
|
width="750px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
<div class="sort-wrap"> |
|
|
|
<div class="sort-wrap"> |
|
|
|
<ul class="thead"> |
|
|
|
<ul class="thead"> |
|
|
|
<li style="width: 395px;padding-left: 30px">栏目</li> |
|
|
|
<li style="width: 395px;padding-left: 30px">栏目</li> |
|
|
|
<li style="width: 205px">栏目类型</li> |
|
|
|
<li style="width: 205px">栏目类型</li> |
|
|
|
<li>前台可见</li> |
|
|
|
<li>前台可见</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<el-tree |
|
|
|
<el-tree class="sort" |
|
|
|
class="sort" |
|
|
|
|
|
|
|
:data="sortColumns" |
|
|
|
:data="sortColumns" |
|
|
|
node-key="id" |
|
|
|
node-key="id" |
|
|
|
default-expand-all |
|
|
|
default-expand-all |
|
|
|
draggable> |
|
|
|
draggable> |
|
|
|
<ul class="sort-line" slot-scope="{ node, data }"> |
|
|
|
<ul class="sort-line" |
|
|
|
|
|
|
|
slot-scope="{ node, data }"> |
|
|
|
<li>{{ data.columnName }}</li> |
|
|
|
<li>{{ data.columnName }}</li> |
|
|
|
<li>{{ types.find(e => e.id == data.typeId) && types.find(e => e.id == data.typeId).name }}</li> |
|
|
|
<li>{{ types.find(e => e.id == data.typeId) && types.find(e => e.id == data.typeId).name }}</li> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<el-switch |
|
|
|
<el-switch v-model="data.menuVisible" |
|
|
|
v-model="data.menuVisible" |
|
|
|
|
|
|
|
:active-value="0" |
|
|
|
:active-value="0" |
|
|
|
:inactive-value="1" |
|
|
|
:inactive-value="1" |
|
|
|
@change="switchOff($event, data)"> |
|
|
|
@change="switchOff($event, data)"> |
|
|
@ -95,18 +161,23 @@ |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</el-tree> |
|
|
|
</el-tree> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="sortVisible = false">取 消</el-button> |
|
|
|
<el-button @click="sortVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="sortSubmit">确 定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="sortSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="导航样式设置" :visible.sync="styleVisible" width="850px" :close-on-click-modal="false"> |
|
|
|
<el-dialog title="导航样式设置" |
|
|
|
<el-form class="input-form" label-width="100px"> |
|
|
|
:visible.sync="styleVisible" |
|
|
|
|
|
|
|
width="850px" |
|
|
|
|
|
|
|
:close-on-click-modal="false"> |
|
|
|
|
|
|
|
<el-form class="input-form" |
|
|
|
|
|
|
|
label-width="100px"> |
|
|
|
<el-form-item label="导航样式"> |
|
|
|
<el-form-item label="导航样式"> |
|
|
|
<el-select v-model="form.navigationStyle"> |
|
|
|
<el-select v-model="form.navigationStyle"> |
|
|
|
<el-option |
|
|
|
<el-option v-for="item in styleTypes" |
|
|
|
v-for="item in styleTypes" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
@ -117,9 +188,11 @@ |
|
|
|
<ul class="styles"> |
|
|
|
<ul class="styles"> |
|
|
|
<li> |
|
|
|
<li> |
|
|
|
<div class="review"> |
|
|
|
<div class="review"> |
|
|
|
<img src="@/assets/images/style1.png" alt=""> |
|
|
|
<img src="@/assets/images/style1.png" |
|
|
|
|
|
|
|
alt=""> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-radio v-model="form.styleTemplate" :label="1">竖行导航</el-radio> |
|
|
|
<el-radio v-model="form.styleTemplate" |
|
|
|
|
|
|
|
:label="1">竖行导航</el-radio> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
<!-- <li> |
|
|
|
<!-- <li> |
|
|
|
<div class="review"> |
|
|
|
<div class="review"> |
|
|
@ -130,9 +203,11 @@ |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<span slot="footer" |
|
|
|
|
|
|
|
class="dialog-footer"> |
|
|
|
<el-button @click="styleVisible = false">取 消</el-button> |
|
|
|
<el-button @click="styleVisible = false">取 消</el-button> |
|
|
|
<el-button type="primary" @click="styleSubmit">确 定</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
|
|
|
|
@click="styleSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -143,7 +218,7 @@ import Setting from '@/setting' |
|
|
|
import ColumnConst from '@/const/column' |
|
|
|
import ColumnConst from '@/const/column' |
|
|
|
import util from '@/libs/util' |
|
|
|
import util from '@/libs/util' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
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, |
|
|
@ -211,14 +286,14 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
keyword: function(val) { |
|
|
|
keyword: function (val) { |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
}, 500) |
|
|
|
}, 500) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
mounted () { |
|
|
|
this.$store.commit('user/setCrumbs', [ |
|
|
|
this.$store.commit('user/setCrumbs', [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
name: '站点管理', |
|
|
|
name: '站点管理', |
|
|
@ -235,12 +310,12 @@ export default { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
getData() { |
|
|
|
getData () { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
siteId: this.siteId, |
|
|
|
siteId: this.siteId, |
|
|
|
columnName: this.keyword, |
|
|
|
columnName: this.keyword, |
|
|
|
templateId: '', |
|
|
|
templateId: '', |
|
|
|
typeId : '', |
|
|
|
typeId: '', |
|
|
|
isSort: 1 |
|
|
|
isSort: 1 |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.list = data |
|
|
|
this.list = data |
|
|
@ -250,53 +325,53 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 根据模板id获取样式 |
|
|
|
// 根据模板id获取样式 |
|
|
|
getStyle() { |
|
|
|
getStyle () { |
|
|
|
this.$post(`${this.api.theTemplateIdGetsTheStyle}?templateId=${this.form.templateId}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.theTemplateIdGetsTheStyle}?templateId=${this.form.templateId}`).then(({ data }) => { |
|
|
|
this.listStyle = data.listingTemplateTypes |
|
|
|
this.listStyle = data.listingTemplateTypes |
|
|
|
this.detailStyle = data.detailsTypeOfTheTemplate |
|
|
|
this.detailStyle = data.detailsTypeOfTheTemplate |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 重置列表 |
|
|
|
// 重置列表 |
|
|
|
initData() { |
|
|
|
initData () { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 重置栏位筛选 |
|
|
|
// 重置栏位筛选 |
|
|
|
resetColumns() { |
|
|
|
resetColumns () { |
|
|
|
this.settings = JSON.parse(JSON.stringify(this.originSettings)) |
|
|
|
this.settings = JSON.parse(JSON.stringify(this.originSettings)) |
|
|
|
}, |
|
|
|
}, |
|
|
|
add() { |
|
|
|
add () { |
|
|
|
this.$router.push('add') |
|
|
|
this.$router.push('add') |
|
|
|
}, |
|
|
|
}, |
|
|
|
edit(row, type) { |
|
|
|
edit (row, type) { |
|
|
|
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`) |
|
|
|
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
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.deleteColumn}?ids=${row.id}`).then(res => { |
|
|
|
util.successMsg("删除成功") |
|
|
|
util.successMsg("删除成功") |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 禁用启用 |
|
|
|
// 禁用启用 |
|
|
|
switchOff(val, row) { |
|
|
|
switchOff (val, row) { |
|
|
|
this.$post(this.api.updateColumn, row).then(res => {}).catch((res) => {}) |
|
|
|
this.$post(this.api.updateColumn, row).then(res => { }).catch((res) => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 预览 |
|
|
|
// 预览 |
|
|
|
preview(row) { |
|
|
|
preview (row) { |
|
|
|
// 常规/子级优先栏目,则跳转到column;长页则跳转到对应的长页模板 |
|
|
|
// 常规/子级优先栏目,则跳转到column;长页则跳转到对应的长页模板 |
|
|
|
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/${row.typeId === 3 ? row.path : 'column'}?id=${row.id}&siteId=${row.siteId}`) |
|
|
|
window.open((Setting.isDev ? `http://${location.hostname}:8097` : this.$store.state.content.site.domainName) + `#/${row.typeId === 3 ? row.path : 'column'}?id=${row.id}&siteId=${row.siteId}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 页面管理 |
|
|
|
// 页面管理 |
|
|
|
page(row) { |
|
|
|
page (row) { |
|
|
|
this.$router.push(`${row.path}?id=${row.id}&path=${row.path}&siteId=${row.siteId}`) |
|
|
|
this.$router.push(`${row.path}?id=${row.id}&path=${row.path}&siteId=${row.siteId}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量删除 |
|
|
|
// 批量删除 |
|
|
|
batchDel() { |
|
|
|
batchDel () { |
|
|
|
const list = this.multipleSelection |
|
|
|
const list = this.multipleSelection |
|
|
|
if (list.length) { |
|
|
|
if (list.length) { |
|
|
|
this.$confirm('删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?', '提示', { |
|
|
|
this.$confirm('删除栏目将会同时把栏目下的文章一并删除,是否确认删除栏目?', '提示', { |
|
|
@ -310,48 +385,48 @@ export default { |
|
|
|
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) { |
|
|
|
this.multipleSelection = val |
|
|
|
this.multipleSelection = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 全选回调 |
|
|
|
// 全选回调 |
|
|
|
selectAll() { |
|
|
|
selectAll () { |
|
|
|
this.checkedKeys = !this.checkedKeys |
|
|
|
this.checkedKeys = !this.checkedKeys |
|
|
|
this.select(this.list, this.checkedKeys) |
|
|
|
this.select(this.list, this.checkedKeys) |
|
|
|
}, |
|
|
|
}, |
|
|
|
select(data, flag) { |
|
|
|
select (data, flag) { |
|
|
|
data.map(row => { |
|
|
|
data.map(row => { |
|
|
|
this.$refs.table.toggleRowSelection(row, flag) |
|
|
|
this.$refs.table.toggleRowSelection(row, flag) |
|
|
|
if (row.children != undefined) this.select(row.children, this.checkedKeys) |
|
|
|
if (row.children != undefined) this.select(row.children, this.checkedKeys) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleCurrentChange(val) { |
|
|
|
handleCurrentChange (val) { |
|
|
|
this.page = val |
|
|
|
this.page = val |
|
|
|
this.$router.push(`list?page=${val}`) |
|
|
|
this.$router.push(`list?page=${val}`) |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 更改排序 |
|
|
|
// 更改排序 |
|
|
|
sort() { |
|
|
|
sort () { |
|
|
|
this.$post(this.api.deleteUselessData).then(res => {}).catch(err => {}) |
|
|
|
this.$post(this.api.deleteUselessData).then(res => { }).catch(err => { }) |
|
|
|
|
|
|
|
|
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
siteId: this.siteId, |
|
|
|
siteId: this.siteId, |
|
|
|
columnName: '', |
|
|
|
columnName: '', |
|
|
|
templateId: '', |
|
|
|
templateId: '', |
|
|
|
typeId : '', |
|
|
|
typeId: '', |
|
|
|
isSort: 1 |
|
|
|
isSort: 1 |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.sortColumns = data |
|
|
|
this.sortColumns = data |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
this.sortVisible = true |
|
|
|
this.sortVisible = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 递归处理排序参数 |
|
|
|
// 递归处理排序参数 |
|
|
|
sortList(list, result, parent = {}) { |
|
|
|
sortList (list, result, parent = {}) { |
|
|
|
list.map((e, i) => { |
|
|
|
list.map((e, i) => { |
|
|
|
if (!parent.id) this.sortLevel = 1 |
|
|
|
if (!parent.id) this.sortLevel = 1 |
|
|
|
result.push({ |
|
|
|
result.push({ |
|
|
@ -367,17 +442,17 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 排序提交 |
|
|
|
// 排序提交 |
|
|
|
sortSubmit() { |
|
|
|
sortSubmit () { |
|
|
|
const result = [] |
|
|
|
const result = [] |
|
|
|
this.sortList(this.sortColumns, result) |
|
|
|
this.sortList(this.sortColumns, result) |
|
|
|
this.$post(this.api.sortByColumn, result).then(({ data }) => { |
|
|
|
this.$post(this.api.sortByColumn, result).then(({ data }) => { |
|
|
|
util.successMsg('修改成功') |
|
|
|
util.successMsg('修改成功') |
|
|
|
this.sortVisible = false |
|
|
|
this.sortVisible = false |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 导航样式设置 |
|
|
|
// 导航样式设置 |
|
|
|
styleSet() { |
|
|
|
styleSet () { |
|
|
|
this.styleVisible = true |
|
|
|
this.styleVisible = true |
|
|
|
this.$post(`${this.api.searchAllBySite}?siteId=${this.siteId}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.searchAllBySite}?siteId=${this.siteId}`).then(({ data }) => { |
|
|
|
// 如果添加了该站点的导航设置,则直接赋值,否则调新增接口去添加一条该站点的配置,再调列表接口获取id |
|
|
|
// 如果添加了该站点的导航设置,则直接赋值,否则调新增接口去添加一条该站点的配置,再调列表接口获取id |
|
|
@ -387,17 +462,17 @@ export default { |
|
|
|
this.$post(this.api.saveStyle, this.form).then(res => { |
|
|
|
this.$post(this.api.saveStyle, this.form).then(res => { |
|
|
|
this.$post(`${this.api.searchAllBySite}?siteId=${this.siteId}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.searchAllBySite}?siteId=${this.siteId}`).then(({ data }) => { |
|
|
|
this.form = data[0] |
|
|
|
this.form = data[0] |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 导航样式提交 |
|
|
|
// 导航样式提交 |
|
|
|
styleSubmit() { |
|
|
|
styleSubmit () { |
|
|
|
this.$post(this.api.updateStyle, this.form).then(res => { |
|
|
|
this.$post(this.api.updateStyle, this.form).then(res => { |
|
|
|
util.successMsg('修改成功') |
|
|
|
util.successMsg('修改成功') |
|
|
|
this.styleVisible = false |
|
|
|
this.styleVisible = false |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -411,7 +486,7 @@ export default { |
|
|
|
.thead { |
|
|
|
.thead { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
line-height: 44px; |
|
|
|
line-height: 44px; |
|
|
|
background-color: #F7F7F7; |
|
|
|
background-color: #f7f7f7; |
|
|
|
li { |
|
|
|
li { |
|
|
|
padding: 0 10px; |
|
|
|
padding: 0 10px; |
|
|
|
font-size: 12px; |
|
|
|
font-size: 12px; |
|
|
@ -423,7 +498,7 @@ export default { |
|
|
|
/deep/.sort { |
|
|
|
/deep/.sort { |
|
|
|
.el-tree-node__content { |
|
|
|
.el-tree-node__content { |
|
|
|
height: auto; |
|
|
|
height: auto; |
|
|
|
border-bottom: 1px solid #EBEDF0; |
|
|
|
border-bottom: 1px solid #ebedf0; |
|
|
|
} |
|
|
|
} |
|
|
|
// .el-tree-node__expand-icon { |
|
|
|
// .el-tree-node__expand-icon { |
|
|
|
// display: none; |
|
|
|
// display: none; |
|
|
@ -453,13 +528,13 @@ export default { |
|
|
|
margin-right: 20px; |
|
|
|
margin-right: 20px; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
&:hover .review { |
|
|
|
&:hover .review { |
|
|
|
border-color: #2962FF; |
|
|
|
border-color: #2962ff; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.review { |
|
|
|
.review { |
|
|
|
padding: 18px; |
|
|
|
padding: 18px; |
|
|
|
margin-bottom: 10px; |
|
|
|
margin-bottom: 10px; |
|
|
|
border: 1px solid #DCDEE0; |
|
|
|
border: 1px solid #dcdee0; |
|
|
|
border-radius: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|