|
|
@ -2,80 +2,174 @@ |
|
|
|
<div class="flex page"> |
|
|
|
<div class="flex page"> |
|
|
|
<div style="width: 218px;border-right: 1px solid #EBEDF0"> |
|
|
|
<div style="width: 218px;border-right: 1px solid #EBEDF0"> |
|
|
|
<p class="page-name mb">全部栏目</p> |
|
|
|
<p class="page-name mb">全部栏目</p> |
|
|
|
<div style="height: calc(100% - 50px);overflow: auto"> |
|
|
|
<div style="height: calc(100vh - 190px);overflow: auto"> |
|
|
|
<el-tree ref="column" :data="columns" highlight-current :expand-on-click-node="false" default-expand-all :props="defaultProps" node-key="id" @node-click="initData"> |
|
|
|
<el-tree ref="column" |
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
:data="columns" |
|
|
|
<span class="org-name" :title="node.label">{{ node.label }}</span> |
|
|
|
highlight-current |
|
|
|
|
|
|
|
:expand-on-click-node="false" |
|
|
|
|
|
|
|
default-expand-all |
|
|
|
|
|
|
|
:props="defaultProps" |
|
|
|
|
|
|
|
node-key="id" |
|
|
|
|
|
|
|
@node-click="initData"> |
|
|
|
|
|
|
|
<span class="custom-tree-node" |
|
|
|
|
|
|
|
slot-scope="{ node, data }"> |
|
|
|
|
|
|
|
<span class="org-name" |
|
|
|
|
|
|
|
:title="node.label">{{ node.label }}</span> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-tree> |
|
|
|
</el-tree> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="p-l-20" style="width: calc(100% - 219px);"> |
|
|
|
<div class="p-l-20" |
|
|
|
|
|
|
|
style="width: calc(100% - 219px);"> |
|
|
|
<div class="tool"> |
|
|
|
<div class="tool"> |
|
|
|
<div class="search-wrap"> |
|
|
|
<div class="search-wrap"> |
|
|
|
<el-select v-model="field" @change="initData"> |
|
|
|
<el-select v-model="field" |
|
|
|
<el-option |
|
|
|
@change="initData"> |
|
|
|
v-for="(item, i) in keywords" |
|
|
|
<el-option v-for="(item, i) in keywords" |
|
|
|
:key="i" |
|
|
|
:key="i" |
|
|
|
:label="item.name" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input> |
|
|
|
<el-input class="keyword" |
|
|
|
|
|
|
|
:placeholder="'请输入' + keywords.find(e => e.id === field).name" |
|
|
|
|
|
|
|
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" |
|
|
|
|
|
|
|
@click="add">新增</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" |
|
|
|
|
|
|
|
@click="batchDel">删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
|
|
|
<el-table :data="list" |
|
|
|
<el-table-column v-if="settings[0].show" type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
class="table" |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
ref="table" |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
|
|
|
row-key="id" |
|
|
|
|
|
|
|
@sort-change="sortChange"> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[0].show" |
|
|
|
|
|
|
|
type="selection" |
|
|
|
|
|
|
|
width="55" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
:reserve-selection="true"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
width="60" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
<template scope="scope"> |
|
|
|
<template scope="scope"> |
|
|
|
<span>{{(page - 1) * pageSize + scope.$index + 1}}</span> |
|
|
|
<span>{{(page - 1) * pageSize + scope.$index + 1}}</span> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[1].show" show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> |
|
|
|
<el-table-column v-if="settings[1].show" |
|
|
|
<el-table-column v-if="settings[2].show" prop="columnName" label="栏目" align="center" min-width="120"></el-table-column> |
|
|
|
show-overflow-tooltip |
|
|
|
<el-table-column v-if="settings[3].show" prop="classificationName" label="所属分类" align="center" min-width="120"></el-table-column> |
|
|
|
prop="title" |
|
|
|
<el-table-column v-if="settings[4].show" prop="typeId" label="栏目类型" align="center" min-width="100"> |
|
|
|
label="标题" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="150"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[2].show" |
|
|
|
|
|
|
|
prop="columnName" |
|
|
|
|
|
|
|
label="栏目" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="120"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[3].show" |
|
|
|
|
|
|
|
prop="classificationName" |
|
|
|
|
|
|
|
label="所属分类" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="120"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[4].show" |
|
|
|
|
|
|
|
prop="typeId" |
|
|
|
|
|
|
|
label="栏目类型" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ types.find(e => e.id === scope.row.typeId).name }} |
|
|
|
{{ types.find(e => e.id === scope.row.typeId).name }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[5].show" prop="founderName" label="录入人" align="center" min-width="80"></el-table-column> |
|
|
|
<el-table-column v-if="settings[5].show" |
|
|
|
<el-table-column v-if="settings[6].show" prop="editorName" label="修改人" align="center" min-width="80"></el-table-column> |
|
|
|
prop="founderName" |
|
|
|
<el-table-column v-if="settings[7].show" prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column> |
|
|
|
label="录入人" |
|
|
|
<el-table-column v-if="settings[8].show" prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column> |
|
|
|
align="center" |
|
|
|
<el-table-column v-if="settings[9].show" prop="totalBrowsing" label="总浏览" align="center" min-width="70"></el-table-column> |
|
|
|
min-width="80"></el-table-column> |
|
|
|
<el-table-column v-if="settings[10].show" prop="workNumber" label="状态" align="center" min-width="80"> |
|
|
|
<el-table-column v-if="settings[6].show" |
|
|
|
|
|
|
|
prop="editorName" |
|
|
|
|
|
|
|
label="修改人" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="80"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[7].show" |
|
|
|
|
|
|
|
prop="updateTime" |
|
|
|
|
|
|
|
label="修改日期" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="150" |
|
|
|
|
|
|
|
sortable="custom"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[8].show" |
|
|
|
|
|
|
|
prop="releaseTime" |
|
|
|
|
|
|
|
label="发布日期" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="100" |
|
|
|
|
|
|
|
sortable="custom"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[9].show" |
|
|
|
|
|
|
|
prop="totalBrowsing" |
|
|
|
|
|
|
|
label="总浏览" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="70"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="settings[10].show" |
|
|
|
|
|
|
|
prop="workNumber" |
|
|
|
|
|
|
|
label="状态" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="80"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
|
|
|
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" prop="sequence" label="置顶" align="center" min-width="80" sortable="custom"> |
|
|
|
<el-table-column v-auth="'/site/list:' + siteName + ':内容管理:文章管理:置顶'" |
|
|
|
|
|
|
|
prop="sequence" |
|
|
|
|
|
|
|
label="置顶" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
min-width="80" |
|
|
|
|
|
|
|
sortable="custom"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<i v-if="scope.row.isRelease" :class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" @click="sticky(scope.row)"></i> |
|
|
|
<i v-if="scope.row.isRelease" |
|
|
|
|
|
|
|
:class="['squ-icon', scope.row.isTop ? 'el-icon-check' : 'el-icon-close']" |
|
|
|
|
|
|
|
@click="sticky(scope.row)"></i> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column v-if="settings[11].show" label="操作" align="center" width="190"> |
|
|
|
<el-table-column v-if="settings[11].show" |
|
|
|
|
|
|
|
label="操作" |
|
|
|
|
|
|
|
align="center" |
|
|
|
|
|
|
|
width="190"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" type="text" @click="preview(scope.row)">预览</el-button> |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:预览'" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
type="text" |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
@click="preview(scope.row)">预览</el-button> |
|
|
|
<el-switch |
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:编辑'" |
|
|
|
v-if="scope.row.isRelease" |
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="edit(scope.row)">编辑</el-button> |
|
|
|
|
|
|
|
<el-button v-auth="'/site/list:' + siteName + ':内容管理:文章管理:删除'" |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
@click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
|
|
|
<el-switch v-if="scope.row.isRelease" |
|
|
|
v-auth="'/site/list:' + siteName + ':内容管理:文章管理:禁用'" |
|
|
|
v-auth="'/site/list:' + siteName + ':内容管理:文章管理:禁用'" |
|
|
|
class="m-l-10" |
|
|
|
class="m-l-10" |
|
|
|
v-model="scope.row.isDisable" |
|
|
|
v-model="scope.row.isDisable" |
|
|
@ -87,7 +181,11 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
|
|
|
<el-pagination background |
|
|
|
|
|
|
|
@current-change="currentChange" |
|
|
|
|
|
|
|
:current-page="page" |
|
|
|
|
|
|
|
layout="total, prev, pager, next" |
|
|
|
|
|
|
|
:total="total"></el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -99,7 +197,7 @@ import util from '@/libs/util' |
|
|
|
import { mapMutations } from 'vuex' |
|
|
|
import { mapMutations } from 'vuex' |
|
|
|
import ColumnConst from '@/const/column' |
|
|
|
import ColumnConst from '@/const/column' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
return { |
|
|
|
last: this.$route.query.last, // 是否直接跳到最后一页的文章(编辑文章的时候改了所属栏目,返回到列表后则需要跳到最后一页文章) |
|
|
|
last: this.$route.query.last, // 是否直接跳到最后一页的文章(编辑文章的时候改了所属栏目,返回到列表后则需要跳到最后一页文章) |
|
|
|
types: ColumnConst.types, |
|
|
|
types: ColumnConst.types, |
|
|
@ -192,14 +290,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: '站点管理', |
|
|
@ -220,12 +318,12 @@ export default { |
|
|
|
'setColumn' |
|
|
|
'setColumn' |
|
|
|
]), |
|
|
|
]), |
|
|
|
// 栏目树形 |
|
|
|
// 栏目树形 |
|
|
|
getColumn() { |
|
|
|
getColumn () { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
this.$post(this.api.listWithTree, { |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
columnName: '', |
|
|
|
columnName: '', |
|
|
|
templateId: '', |
|
|
|
templateId: '', |
|
|
|
typeId : '', |
|
|
|
typeId: '', |
|
|
|
isSort: 1 |
|
|
|
isSort: 1 |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.columns = data |
|
|
|
this.columns = data |
|
|
@ -233,12 +331,12 @@ export default { |
|
|
|
this.$refs.column.setCurrentKey(this.$route.query.columnId || data[0].id) |
|
|
|
this.$refs.column.setCurrentKey(this.$route.query.columnId || data[0].id) |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(e => {}) |
|
|
|
}).catch(e => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 文章列表 |
|
|
|
// 文章列表 |
|
|
|
getData() { |
|
|
|
getData () { |
|
|
|
const id = this.$refs.column.getCurrentKey() |
|
|
|
const id = this.$refs.column.getCurrentKey() |
|
|
|
this.$router.push(`/article?columnId=${id}`).catch(e => {}) |
|
|
|
this.$router.push(`/article?columnId=${id}`).catch(e => { }) |
|
|
|
const { keyword } = this |
|
|
|
const { keyword } = this |
|
|
|
const data = { |
|
|
|
const data = { |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
|
siteId: this.$store.state.content.site.id, |
|
|
@ -269,42 +367,42 @@ export default { |
|
|
|
this.last = '' |
|
|
|
this.last = '' |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 重置栏位筛选 |
|
|
|
// 重置栏位筛选 |
|
|
|
resetColumns() { |
|
|
|
resetColumns () { |
|
|
|
this.settings = JSON.parse(JSON.stringify(this.originSettings)) |
|
|
|
this.settings = JSON.parse(JSON.stringify(this.originSettings)) |
|
|
|
}, |
|
|
|
}, |
|
|
|
currentChange(val) { |
|
|
|
currentChange (val) { |
|
|
|
this.page = val |
|
|
|
this.page = val |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelectionChange(val) { |
|
|
|
handleSelectionChange (val) { |
|
|
|
this.multipleSelection = val |
|
|
|
this.multipleSelection = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
initData() { |
|
|
|
initData () { |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.$refs.table.clearSelection() |
|
|
|
this.page = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 排序提交 |
|
|
|
// 排序提交 |
|
|
|
submitSequence(row) { |
|
|
|
submitSequence (row) { |
|
|
|
const { sequence } = row |
|
|
|
const { sequence } = row |
|
|
|
if (!sequence) return util.errorMsg('请输入排序') |
|
|
|
if (!sequence) return util.errorMsg('请输入排序') |
|
|
|
if (isNaN(sequence)) return util.errorMsg('请输入数字') |
|
|
|
if (isNaN(sequence)) return util.errorMsg('请输入数字') |
|
|
|
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${sequence > this.total ? this.total : sequence}`).then(res => { |
|
|
|
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${sequence > this.total ? this.total : sequence}`).then(res => { |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑排序 |
|
|
|
// 编辑排序 |
|
|
|
editSequence(row) { |
|
|
|
editSequence (row) { |
|
|
|
this.list.forEach(e => { |
|
|
|
this.list.forEach(e => { |
|
|
|
e.editing = false |
|
|
|
e.editing = false |
|
|
|
}) |
|
|
|
}) |
|
|
|
row.editing = true |
|
|
|
row.editing = true |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 批量删除 |
|
|
|
// 批量删除 |
|
|
|
batchDel() { |
|
|
|
batchDel () { |
|
|
|
const list = this.multipleSelection |
|
|
|
const list = this.multipleSelection |
|
|
|
if (list.length) { |
|
|
|
if (list.length) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
@ -318,35 +416,35 @@ 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('请先选择数据 !') |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 删除 |
|
|
|
// 删除 |
|
|
|
handleDelete(row) { |
|
|
|
handleDelete (row) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
}).then(() => { |
|
|
|
this.$post(`${this.api.deleteArticle}?ids=${row.id}`).then(res => { |
|
|
|
this.$post(`${this.api.deleteArticle}?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.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {}) |
|
|
|
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增 |
|
|
|
// 新增 |
|
|
|
add() { |
|
|
|
add () { |
|
|
|
if (!this.columns.length) return util.errorMsg('请添加栏目') |
|
|
|
if (!this.columns.length) return util.errorMsg('请添加栏目') |
|
|
|
this.setColumn(this.$refs.column.getCurrentNode()) |
|
|
|
this.setColumn(this.$refs.column.getCurrentNode()) |
|
|
|
this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) |
|
|
|
this.$router.push(`add?columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 排序回调 |
|
|
|
// 排序回调 |
|
|
|
sortChange(column) { |
|
|
|
sortChange (column) { |
|
|
|
const { order } = column |
|
|
|
const { order } = column |
|
|
|
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
|
|
|
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
|
|
|
// 两个时间0默认倒序 1升序 |
|
|
|
// 两个时间0默认倒序 1升序 |
|
|
@ -375,17 +473,17 @@ export default { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 置顶 |
|
|
|
// 置顶 |
|
|
|
sticky(row) { |
|
|
|
sticky (row) { |
|
|
|
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => { |
|
|
|
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => { |
|
|
|
this.initData() |
|
|
|
this.initData() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 预览 |
|
|
|
// 预览 |
|
|
|
preview(row) { |
|
|
|
preview (row) { |
|
|
|
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`) |
|
|
|
window.open((Setting.isDev ? `http://${location.hostname}:8095` : this.$store.state.content.site.domainName) + `#/article?articleId=${row.id}&siteId=${this.$refs.column.getCurrentNode().siteId}&id=${row.columnId}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 编辑 |
|
|
|
// 编辑 |
|
|
|
edit(row) { |
|
|
|
edit (row) { |
|
|
|
this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) |
|
|
|
this.$router.push(`add?id=${row.id}&columnId=${this.$refs.column.getCurrentKey()}&columnName=${this.$refs.column.getCurrentNode().columnName}`) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|