parent
34d84486ea
commit
ebf4e9ffbc
45 changed files with 3197 additions and 2682 deletions
@ -1,53 +1,56 @@ |
||||
<template> |
||||
<div class="wrap"> |
||||
<div class="modal"> |
||||
<el-steps :space="200" :active="4" finish-status="success"> |
||||
<el-step title="大赛信息填写"></el-step> |
||||
<el-step title="赛程与规则设置"></el-step> |
||||
<el-step title="比赛内容设置"></el-step> |
||||
<el-step title="发布"></el-step> |
||||
</el-steps> |
||||
<h1>大赛已发布!</h1> |
||||
<div class="btns"> |
||||
<el-button type="primary" @click="back">确定</el-button> |
||||
</div> |
||||
<div class="wrap"> |
||||
<div class="modal"> |
||||
<el-steps :space="200" |
||||
:active="4" |
||||
finish-status="success"> |
||||
<el-step title="大赛信息填写"></el-step> |
||||
<el-step title="赛程与规则设置"></el-step> |
||||
<el-step title="比赛内容设置"></el-step> |
||||
<el-step title="发布"></el-step> |
||||
</el-steps> |
||||
<h1>大赛已发布!</h1> |
||||
<div class="btns"> |
||||
<el-button type="primary" |
||||
@click="back">确定</el-button> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
data() { |
||||
return { |
||||
|
||||
}; |
||||
}, |
||||
mounted() { |
||||
|
||||
}, |
||||
methods: { |
||||
back() { |
||||
this.$router.push(`/match?page=${this.$store.state.matchPage}`) |
||||
} |
||||
data () { |
||||
return { |
||||
|
||||
}; |
||||
}, |
||||
mounted () { |
||||
|
||||
}, |
||||
methods: { |
||||
back () { |
||||
this.$router.push(this.$store.state.referrer || '/match') |
||||
} |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.wrap { |
||||
height: calc(100vh - 300px); |
||||
background-color: #fefefe; |
||||
height: calc(100vh - 300px); |
||||
background-color: #fefefe; |
||||
} |
||||
.modal { |
||||
width: 500px; |
||||
padding-top: 150px; |
||||
margin: 0 auto ; |
||||
h1 { |
||||
margin: 20px; |
||||
text-align: center; |
||||
} |
||||
.btns { |
||||
text-align: center; |
||||
} |
||||
width: 500px; |
||||
padding-top: 150px; |
||||
margin: 0 auto; |
||||
h1 { |
||||
margin: 20px; |
||||
text-align: center; |
||||
} |
||||
.btns { |
||||
text-align: center; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,339 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<div class="tool"> |
||||
<div class="search-wrap"> |
||||
<el-select v-model="field" |
||||
@change="initData"> |
||||
<el-option v-for="(item, i) in keywords" |
||||
:key="i" |
||||
:label="item.name" |
||||
:value="item.id"> |
||||
</el-option> |
||||
</el-select> |
||||
<el-input class="keyword" |
||||
:placeholder="'请输入' + keywords.find(e => e.id === field).name" |
||||
v-model.trim="keyword" |
||||
clearable></el-input> |
||||
</div> |
||||
<div class="actions"> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:批量删除'" |
||||
@click="batchDel">批量删除</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:新增文章'" |
||||
type="primary" |
||||
@click="add">新增文章</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" |
||||
class="table" |
||||
ref="table" |
||||
header-align="center" |
||||
@selection-change="handleSelectionChange" |
||||
row-key="id" |
||||
@sort-change="sortChange"> |
||||
<el-table-column type="selection" |
||||
width="55" |
||||
align="center" |
||||
:reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" |
||||
width="60" |
||||
label="序号" |
||||
align="center"></el-table-column> |
||||
<el-table-column show-overflow-tooltip |
||||
prop="title" |
||||
label="标题" |
||||
align="center" |
||||
min-width="150"></el-table-column> |
||||
<el-table-column prop="classificationName" |
||||
label="所属分类" |
||||
align="center" |
||||
min-width="120" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="founderName" |
||||
label="录入人" |
||||
align="center" |
||||
min-width="80"></el-table-column> |
||||
<el-table-column prop="editorName" |
||||
label="修改人" |
||||
align="center" |
||||
min-width="80"></el-table-column> |
||||
<el-table-column prop="updateTime" |
||||
label="修改日期" |
||||
align="center" |
||||
min-width="150" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="releaseTime" |
||||
label="发布日期" |
||||
align="center" |
||||
min-width="100" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="learnerNumber" |
||||
label="总浏览" |
||||
align="center" |
||||
min-width="70"></el-table-column> |
||||
<el-table-column prop="workNumber" |
||||
label="状态" |
||||
align="center" |
||||
min-width="80"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="sequence" |
||||
label="置顶" |
||||
align="center" |
||||
min-width="80" |
||||
sortable="custom"> |
||||
<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> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" |
||||
align="center" |
||||
width="210"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:编辑'" |
||||
type="text" |
||||
@click="edit(scope.row)">编辑</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:删除'" |
||||
type="text" |
||||
@click="handleDelete(scope.row)">删除</el-button> |
||||
<el-switch v-auth="'/parnerOperation:合伙人资讯管理:禁用'" |
||||
v-if="scope.row.isRelease" |
||||
class="m-l-10" |
||||
v-model="scope.row.isDisable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
@change="switchOff($event, scope.row, scope.$index)"> |
||||
</el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background |
||||
@current-change="currentChange" |
||||
:current-page="page" |
||||
layout="total, prev, pager, next" |
||||
:total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from '@/libs/util' |
||||
export default { |
||||
data () { |
||||
return { |
||||
field: this.$route.query.field || 'title', |
||||
keywords: [ |
||||
{ |
||||
id: 'title', |
||||
name: '标题' |
||||
}, |
||||
{ |
||||
id: 'founder', |
||||
name: '录入人' |
||||
}, |
||||
{ |
||||
id: 'editor', |
||||
name: '修改人' |
||||
} |
||||
], |
||||
keyword: this.$route.query.keyword || '', |
||||
list: [], |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
topSort: '', |
||||
classificationNameSort: '', |
||||
releaseDateSort: '', |
||||
editTimeSort: '', |
||||
multipleSelection: [], |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function (val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
}, 500) |
||||
} |
||||
}, |
||||
mounted () { |
||||
const { query } = this.$route |
||||
if (query.page) { |
||||
this.$router.push('/parnerOperation?type=info').catch(() => { }) |
||||
} |
||||
|
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
// 文章列表 |
||||
getData () { |
||||
const { keyword } = this |
||||
this.$post(this.api.partnerOperatingList, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 3, //查询来源(3.中台 4.合伙人平台) |
||||
topSort: this.topSort, |
||||
classificationNameSort: this.classificationNameSort, |
||||
editTimeSort: this.editTimeSort, |
||||
releaseDateSort: this.releaseDateSort, |
||||
typeId: 2, // 类型(1.学习2.资讯) |
||||
title: this.field === 'title' ? keyword : '', |
||||
founderName: this.field === 'founder' ? keyword : '', |
||||
editorName: this.field === 'editor' ? keyword : '' |
||||
}).then(({ page, total }) => { |
||||
page.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
this.list = page |
||||
this.total = total |
||||
}).catch(err => { }) |
||||
}, |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
handleSelectionChange (val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
initData () { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 批量删除 |
||||
batchDel () { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
const data = [] |
||||
list.map(e => { |
||||
data.push('ids=' + e.id) |
||||
}) |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg("删除成功") |
||||
this.getData() |
||||
}).catch(res => { }) |
||||
}).catch(() => { }) |
||||
} else { |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
// 删除 |
||||
handleDelete (row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => { }) |
||||
}).catch(() => { }) |
||||
}, |
||||
// 禁用启用 |
||||
switchOff (val, row) { |
||||
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { }) |
||||
}, |
||||
// 排序回调 |
||||
sortChange (column) { |
||||
const { order } = column |
||||
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
||||
if (column.prop === 'classificationName') { |
||||
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'updateTime') { |
||||
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.classificationNameSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'releaseTime') { |
||||
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.classificationNameSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'sequence') { |
||||
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.classificationNameSort = '' |
||||
} |
||||
} |
||||
this.getData() |
||||
}, |
||||
// 排序提交 |
||||
submitSequence (row) { |
||||
if (!row.sequence) return Util.errorMsg('请输入排序') |
||||
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => { }) |
||||
}, |
||||
// 编辑排序 |
||||
editSequence (row) { |
||||
this.list.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
row.editing = true |
||||
}, |
||||
// 置顶 |
||||
sticky (row) { |
||||
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => { }) |
||||
}, |
||||
// 缓存当前页面和参数,详情页返回到列表的时候直接取该url |
||||
setReferrer () { |
||||
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`) |
||||
}, |
||||
// 新增 |
||||
add () { |
||||
this.setReferrer() |
||||
this.$router.push(`/learnMg?type=2`) |
||||
}, |
||||
// 编辑 |
||||
edit (row) { |
||||
this.setReferrer() |
||||
this.$router.push(`/learnMg?id=${row.id}&type=2`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.m-l-10 { |
||||
margin-left: 10px; |
||||
} |
||||
.squ-icon { |
||||
font-size: 16px; |
||||
font-weight: 600; |
||||
cursor: pointer; |
||||
color: #f70000; |
||||
&.el-icon-check { |
||||
color: #05991e; |
||||
} |
||||
} |
||||
/deep/.squ-input { |
||||
width: auto; |
||||
.el-input__inner { |
||||
width: 60px; |
||||
padding: 0 10px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,339 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<div class="tool"> |
||||
<div class="search-wrap"> |
||||
<el-select v-model="field" |
||||
@change="initData"> |
||||
<el-option v-for="(item, i) in keywords" |
||||
:key="i" |
||||
:label="item.name" |
||||
:value="item.id"> |
||||
</el-option> |
||||
</el-select> |
||||
<el-input class="keyword" |
||||
:placeholder="'请输入' + keywords.find(e => e.id === field).name" |
||||
v-model.trim="keyword" |
||||
clearable></el-input> |
||||
</div> |
||||
<div class="actions"> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:批量删除'" |
||||
@click="batchDel">批量删除</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:新增文章'" |
||||
type="primary" |
||||
@click="add">新增文章</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" |
||||
class="table" |
||||
ref="table" |
||||
header-align="center" |
||||
@selection-change="handleSelectionChange" |
||||
row-key="id" |
||||
@sort-change="sortChange"> |
||||
<el-table-column type="selection" |
||||
width="55" |
||||
align="center" |
||||
:reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" |
||||
width="60" |
||||
label="序号" |
||||
align="center"></el-table-column> |
||||
<el-table-column show-overflow-tooltip |
||||
prop="title" |
||||
label="标题" |
||||
align="center" |
||||
min-width="150"></el-table-column> |
||||
<el-table-column prop="classificationName" |
||||
label="所属分类" |
||||
align="center" |
||||
min-width="120" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="founderName" |
||||
label="录入人" |
||||
align="center" |
||||
min-width="80"></el-table-column> |
||||
<el-table-column prop="editorName" |
||||
label="修改人" |
||||
align="center" |
||||
min-width="80"></el-table-column> |
||||
<el-table-column prop="updateTime" |
||||
label="修改日期" |
||||
align="center" |
||||
min-width="150" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="releaseTime" |
||||
label="发布日期" |
||||
align="center" |
||||
min-width="100" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="learnerNumber" |
||||
label="已学习人数" |
||||
align="center" |
||||
min-width="70"></el-table-column> |
||||
<el-table-column prop="workNumber" |
||||
label="状态" |
||||
align="center" |
||||
min-width="80"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="sequence" |
||||
label="置顶" |
||||
align="center" |
||||
min-width="80" |
||||
sortable="custom"> |
||||
<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> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" |
||||
align="center" |
||||
width="210"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:编辑'" |
||||
type="text" |
||||
@click="edit(scope.row)">编辑</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:删除'" |
||||
type="text" |
||||
@click="handleDelete(scope.row)">删除</el-button> |
||||
<el-switch v-auth="'/parnerOperation:合伙人学习管理:禁用'" |
||||
v-if="scope.row.isRelease" |
||||
class="m-l-10" |
||||
v-model="scope.row.isDisable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
@change="switchOff($event, scope.row, scope.$index)"> |
||||
</el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background |
||||
@current-change="currentChange" |
||||
:current-page="page" |
||||
layout="total, prev, pager, next" |
||||
:total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from '@/libs/util' |
||||
export default { |
||||
data () { |
||||
return { |
||||
field: this.$route.query.field || 'title', |
||||
keywords: [ |
||||
{ |
||||
id: 'title', |
||||
name: '标题' |
||||
}, |
||||
{ |
||||
id: 'founder', |
||||
name: '录入人' |
||||
}, |
||||
{ |
||||
id: 'editor', |
||||
name: '修改人' |
||||
} |
||||
], |
||||
keyword: this.$route.query.keyword || '', |
||||
list: [], |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
topSort: '', |
||||
classificationNameSort: '', |
||||
releaseDateSort: '', |
||||
editTimeSort: '', |
||||
multipleSelection: [], |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function (val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
}, 500) |
||||
} |
||||
}, |
||||
mounted () { |
||||
const { query } = this.$route |
||||
if (query.page) { |
||||
this.$router.push('/parnerOperation?type=learn').catch(() => { }) |
||||
} |
||||
|
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
// 文章列表 |
||||
getData () { |
||||
const { keyword } = this |
||||
this.$post(this.api.partnerOperatingList, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 3, //查询来源(3.中台 4.合伙人平台) |
||||
topSort: this.topSort, |
||||
classificationNameSort: this.classificationNameSort, |
||||
editTimeSort: this.editTimeSort, |
||||
releaseDateSort: this.releaseDateSort, |
||||
typeId: 1, // 类型(1.学习2.资讯) |
||||
title: this.field === 'title' ? keyword : '', |
||||
founderName: this.field === 'founder' ? keyword : '', |
||||
editorName: this.field === 'editor' ? keyword : '' |
||||
}).then(({ page, total }) => { |
||||
page.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
this.list = page |
||||
this.total = total |
||||
}).catch(err => { }) |
||||
}, |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
handleSelectionChange (val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
initData () { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 批量删除 |
||||
batchDel () { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
const data = [] |
||||
list.map(e => { |
||||
data.push('ids=' + e.id) |
||||
}) |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg("删除成功") |
||||
this.getData() |
||||
}).catch(res => { }) |
||||
}).catch(() => { }) |
||||
} else { |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
// 删除 |
||||
handleDelete (row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => { }) |
||||
}).catch(() => { }) |
||||
}, |
||||
// 禁用启用 |
||||
switchOff (val, row) { |
||||
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { }) |
||||
}, |
||||
// 排序回调 |
||||
sortChange (column) { |
||||
const { order } = column |
||||
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
||||
if (column.prop === 'classificationName') { |
||||
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'updateTime') { |
||||
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.classificationNameSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'releaseTime') { |
||||
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.classificationNameSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'sequence') { |
||||
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.classificationNameSort = '' |
||||
} |
||||
} |
||||
this.getData() |
||||
}, |
||||
// 排序提交 |
||||
submitSequence (row) { |
||||
if (!row.sequence) return Util.errorMsg('请输入排序') |
||||
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => { }) |
||||
}, |
||||
// 编辑排序 |
||||
editSequence (row) { |
||||
this.list.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
row.editing = true |
||||
}, |
||||
// 置顶 |
||||
sticky (row) { |
||||
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => { }) |
||||
}, |
||||
// 缓存当前页面和参数,详情页返回到列表的时候直接取该url |
||||
setReferrer () { |
||||
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`) |
||||
}, |
||||
// 新增 |
||||
add () { |
||||
this.setReferrer() |
||||
this.$router.push(`/learnMg?type=1`) |
||||
}, |
||||
// 编辑 |
||||
edit (row) { |
||||
this.setReferrer() |
||||
this.$router.push(`/learnMg?id=${row.id}&type=1`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.m-l-10 { |
||||
margin-left: 10px; |
||||
} |
||||
.squ-icon { |
||||
font-size: 16px; |
||||
font-weight: 600; |
||||
cursor: pointer; |
||||
color: #f70000; |
||||
&.el-icon-check { |
||||
color: #05991e; |
||||
} |
||||
} |
||||
/deep/.squ-input { |
||||
width: auto; |
||||
.el-input__inner { |
||||
width: 60px; |
||||
padding: 0 10px; |
||||
} |
||||
} |
||||
</style> |
@ -1,221 +0,0 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<div class="tool"> |
||||
<div class="search-wrap"> |
||||
<el-select v-model="field" @change="initData"> |
||||
<el-option |
||||
v-for="(item, i) in keywords" |
||||
:key="i" |
||||
:label="item.name" |
||||
:value="item.id"> |
||||
</el-option> |
||||
</el-select> |
||||
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input> |
||||
</div> |
||||
<div class="actions"> |
||||
<el-button v-auth="'/parnerOperation:方案管理:批量删除'" @click="batchDel">批量删除</el-button> |
||||
<el-button v-auth="'/parnerOperation:方案管理:新增文章'" type="primary" @click="add" >新增文章</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> |
||||
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column> |
||||
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column> |
||||
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column> |
||||
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column> |
||||
<el-table-column prop="createTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column> |
||||
<el-table-column prop="workNumber" label="状态" align="center" min-width="80"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="170"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'/parnerOperation:方案管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> |
||||
<el-button v-auth="'/parnerOperation:方案管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
<el-switch |
||||
v-auth="'/parnerOperation:方案管理:禁用'" |
||||
v-if="scope.row.isRelease" |
||||
class="m-l-10" |
||||
v-model="scope.row.isDisable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
@change="switchOff($event, scope.row, scope.$index)"> |
||||
</el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from '@/libs/util' |
||||
export default { |
||||
data() { |
||||
return { |
||||
field: 'title', |
||||
keywords: [ |
||||
{ |
||||
id: 'title', |
||||
name: '标题' |
||||
}, |
||||
{ |
||||
id: 'founder', |
||||
name: '录入人' |
||||
}, |
||||
{ |
||||
id: 'editor', |
||||
name: '修改人' |
||||
} |
||||
], |
||||
keyword: '', |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
modifiedTimeSort: '', |
||||
releaseDateSort: 'desc', |
||||
classificationNameSort: '', |
||||
editTimeSort: '', |
||||
multipleSelection: [], |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
}, 500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
// 文章列表 |
||||
getData() { |
||||
const { keyword } = this |
||||
const data = { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 3, //查询来源(3.中台 4.合伙人平台) |
||||
classificationNameSort: this.classificationNameSort, |
||||
editTimeSort: this.editTimeSort, |
||||
createTimeSort: this.releaseDateSort, |
||||
title: this.field === 'title' ? keyword : '', |
||||
founderName: this.field === 'founder' ? keyword : '', |
||||
editorName: this.field === 'editor' ? keyword : '' |
||||
} |
||||
this.$post(this.api.schemeList, data).then(({ data }) => { |
||||
this.list = data.records |
||||
this.total = +data.total |
||||
}).catch(err => {}) |
||||
}, |
||||
currentChange(val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
initData() { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 批量删除 |
||||
batchDel() { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
const data = [] |
||||
list.map(e => { |
||||
data.push('ids=' + e.id) |
||||
}) |
||||
this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg("删除成功") |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
} else { |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
// 删除 |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
}, |
||||
// 禁用启用 |
||||
switchOff(val, row) { |
||||
this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {}) |
||||
}, |
||||
// 新增 |
||||
add() { |
||||
this.$router.push(`/schemeSet`) |
||||
}, |
||||
// 排序回调 |
||||
sortChange(column) { |
||||
const { order } = column |
||||
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
||||
if (column.prop === 'classificationName') { |
||||
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.sequenceSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'updateTime') { |
||||
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.classificationNameSort = '' |
||||
this.releaseDateSort = '' |
||||
this.sequenceSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'createTime') { |
||||
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.classificationNameSort = '' |
||||
this.sequenceSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'sequence') { |
||||
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.classificationNameSort = '' |
||||
} |
||||
} |
||||
this.getData() |
||||
}, |
||||
// 编辑 |
||||
edit(row) { |
||||
this.$router.push(`/schemeSet?id=${row.id}`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.m-l-10 { |
||||
margin-left: 10px; |
||||
} |
||||
</style> |
@ -1,269 +0,0 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<div class="tool"> |
||||
<div class="search-wrap"> |
||||
<el-select v-model="field" @change="initData"> |
||||
<el-option |
||||
v-for="(item, i) in keywords" |
||||
:key="i" |
||||
:label="item.name" |
||||
:value="item.id"> |
||||
</el-option> |
||||
</el-select> |
||||
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input> |
||||
</div> |
||||
<div class="actions"> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:批量删除'" @click="batchDel">批量删除</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:新增文章'" type="primary" @click="add" >新增文章</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> |
||||
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column> |
||||
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column> |
||||
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column> |
||||
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column> |
||||
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column> |
||||
<el-table-column prop="learnerNumber" label="总浏览" align="center" min-width="70"></el-table-column> |
||||
<el-table-column prop="workNumber" label="状态" align="center" min-width="80"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="sequence" label="置顶" align="center" min-width="80" sortable="custom"> |
||||
<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> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="210"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人资讯管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
<el-switch |
||||
v-auth="'/parnerOperation:合伙人资讯管理:禁用'" |
||||
v-if="scope.row.isRelease" |
||||
class="m-l-10" |
||||
v-model="scope.row.isDisable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
@change="switchOff($event, scope.row, scope.$index)"> |
||||
</el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting' |
||||
import util from '@/libs/util' |
||||
import { mapMutations } from 'vuex' |
||||
export default { |
||||
data() { |
||||
return { |
||||
field: 'title', |
||||
keywords: [ |
||||
{ |
||||
id: 'title', |
||||
name: '标题' |
||||
}, |
||||
{ |
||||
id: 'founder', |
||||
name: '录入人' |
||||
}, |
||||
{ |
||||
id: 'editor', |
||||
name: '修改人' |
||||
} |
||||
], |
||||
keyword: '', |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
topSort: '', |
||||
classificationNameSort: '', |
||||
releaseDateSort: '', |
||||
editTimeSort: '', |
||||
multipleSelection: [], |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
}, 500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
// 文章列表 |
||||
getData() { |
||||
const { keyword } = this |
||||
this.$post(this.api.partnerOperatingList, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 3, //查询来源(3.中台 4.合伙人平台) |
||||
topSort: this.topSort, |
||||
classificationNameSort: this.classificationNameSort, |
||||
editTimeSort: this.editTimeSort, |
||||
releaseDateSort: this.releaseDateSort, |
||||
typeId: 2, // 类型(1.学习2.资讯) |
||||
title: this.field === 'title' ? keyword : '', |
||||
founderName: this.field === 'founder' ? keyword : '', |
||||
editorName: this.field === 'editor' ? keyword : '' |
||||
}).then(({ page, total }) => { |
||||
page.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
this.list = page |
||||
this.total = total |
||||
}).catch(err => {}) |
||||
}, |
||||
currentChange(val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
initData() { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 批量删除 |
||||
batchDel() { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
const data = [] |
||||
list.map(e => { |
||||
data.push('ids=' + e.id) |
||||
}) |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg("删除成功") |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
} else { |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
// 删除 |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
}, |
||||
// 禁用启用 |
||||
switchOff(val, row) { |
||||
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {}) |
||||
}, |
||||
// 新增 |
||||
add() { |
||||
this.$router.push(`/learnMg?type=2`) |
||||
}, |
||||
// 排序回调 |
||||
sortChange(column) { |
||||
const { order } = column |
||||
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
||||
if (column.prop === 'classificationName') { |
||||
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'updateTime') { |
||||
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.classificationNameSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'releaseTime') { |
||||
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.classificationNameSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'sequence') { |
||||
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.classificationNameSort = '' |
||||
} |
||||
} |
||||
this.getData() |
||||
}, |
||||
// 排序提交 |
||||
submitSequence(row) { |
||||
if (!row.sequence) return Util.errorMsg('请输入排序') |
||||
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => {}) |
||||
}, |
||||
// 编辑排序 |
||||
editSequence(row) { |
||||
this.list.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
row.editing = true |
||||
}, |
||||
// 置顶 |
||||
sticky(row) { |
||||
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => {}) |
||||
}, |
||||
// 编辑 |
||||
edit(row) { |
||||
this.$router.push(`/learnMg?id=${row.id}&type=2`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.m-l-10 { |
||||
margin-left: 10px; |
||||
} |
||||
.squ-icon { |
||||
font-size: 16px; |
||||
font-weight: 600; |
||||
cursor: pointer; |
||||
color: #f70000; |
||||
&.el-icon-check { |
||||
color: #05991e; |
||||
} |
||||
} |
||||
/deep/.squ-input { |
||||
width: auto; |
||||
.el-input__inner { |
||||
width: 60px; |
||||
padding: 0 10px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,279 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<div class="tool"> |
||||
<div class="search-wrap"> |
||||
<el-select v-model="field" |
||||
@change="initData"> |
||||
<el-option v-for="(item, i) in keywords" |
||||
:key="i" |
||||
:label="item.name" |
||||
:value="item.id"> |
||||
</el-option> |
||||
</el-select> |
||||
<el-input class="keyword" |
||||
:placeholder="'请输入' + keywords.find(e => e.id === field).name" |
||||
v-model.trim="keyword" |
||||
clearable></el-input> |
||||
</div> |
||||
<div class="actions"> |
||||
<el-button v-auth="'/parnerOperation:方案管理:批量删除'" |
||||
@click="batchDel">批量删除</el-button> |
||||
<el-button v-auth="'/parnerOperation:方案管理:新增文章'" |
||||
type="primary" |
||||
@click="add">新增文章</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" |
||||
class="table" |
||||
ref="table" |
||||
header-align="center" |
||||
@selection-change="handleSelectionChange" |
||||
row-key="id" |
||||
@sort-change="sortChange"> |
||||
<el-table-column type="selection" |
||||
width="55" |
||||
align="center" |
||||
:reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" |
||||
width="60" |
||||
label="序号" |
||||
align="center"></el-table-column> |
||||
<el-table-column show-overflow-tooltip |
||||
prop="title" |
||||
label="标题" |
||||
align="center" |
||||
min-width="150"></el-table-column> |
||||
<el-table-column prop="classificationName" |
||||
label="所属分类" |
||||
align="center" |
||||
min-width="120" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="founderName" |
||||
label="录入人" |
||||
align="center" |
||||
min-width="80"></el-table-column> |
||||
<el-table-column prop="editorName" |
||||
label="修改人" |
||||
align="center" |
||||
min-width="80"></el-table-column> |
||||
<el-table-column prop="updateTime" |
||||
label="修改日期" |
||||
align="center" |
||||
min-width="150" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="createTime" |
||||
label="发布日期" |
||||
align="center" |
||||
min-width="100" |
||||
sortable="custom"></el-table-column> |
||||
<el-table-column prop="workNumber" |
||||
label="状态" |
||||
align="center" |
||||
min-width="80"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" |
||||
align="center" |
||||
width="170"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'/parnerOperation:方案管理:编辑'" |
||||
type="text" |
||||
@click="edit(scope.row)">编辑</el-button> |
||||
<el-button v-auth="'/parnerOperation:方案管理:删除'" |
||||
type="text" |
||||
@click="handleDelete(scope.row)">删除</el-button> |
||||
<el-switch v-auth="'/parnerOperation:方案管理:禁用'" |
||||
v-if="scope.row.isRelease" |
||||
class="m-l-10" |
||||
v-model="scope.row.isDisable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
@change="switchOff($event, scope.row, scope.$index)"> |
||||
</el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background |
||||
@current-change="currentChange" |
||||
:current-page="page" |
||||
layout="total, prev, pager, next" |
||||
:total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from '@/libs/util' |
||||
export default { |
||||
data () { |
||||
return { |
||||
field: this.$route.query.field || 'title', |
||||
keywords: [ |
||||
{ |
||||
id: 'title', |
||||
name: '标题' |
||||
}, |
||||
{ |
||||
id: 'founder', |
||||
name: '录入人' |
||||
}, |
||||
{ |
||||
id: 'editor', |
||||
name: '修改人' |
||||
} |
||||
], |
||||
keyword: this.$route.query.keyword || '', |
||||
list: [], |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
modifiedTimeSort: '', |
||||
releaseDateSort: 'desc', |
||||
classificationNameSort: '', |
||||
editTimeSort: '', |
||||
multipleSelection: [], |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function (val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
}, 500) |
||||
} |
||||
}, |
||||
mounted () { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
// 文章列表 |
||||
getData () { |
||||
const { keyword } = this |
||||
const data = { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 3, //查询来源(3.中台 4.合伙人平台) |
||||
classificationNameSort: this.classificationNameSort, |
||||
editTimeSort: this.editTimeSort, |
||||
createTimeSort: this.releaseDateSort, |
||||
title: this.field === 'title' ? keyword : '', |
||||
founderName: this.field === 'founder' ? keyword : '', |
||||
editorName: this.field === 'editor' ? keyword : '' |
||||
} |
||||
this.$post(this.api.schemeList, data).then(({ data }) => { |
||||
this.list = data.records |
||||
this.total = +data.total |
||||
}).catch(err => { }) |
||||
}, |
||||
currentChange (val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
handleSelectionChange (val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
initData () { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 批量删除 |
||||
batchDel () { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
const data = [] |
||||
list.map(e => { |
||||
data.push('ids=' + e.id) |
||||
}) |
||||
this.$post(`${this.api.batchDeletionScheme}?${data.join('&')}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg("删除成功") |
||||
this.getData() |
||||
}).catch(res => { }) |
||||
}).catch(() => { }) |
||||
} else { |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
// 删除 |
||||
handleDelete (row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.batchDeletionScheme}?ids=${row.id}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => { }) |
||||
}).catch(() => { }) |
||||
}, |
||||
// 禁用启用 |
||||
switchOff (val, row) { |
||||
this.$post(`${this.api.enableOrDisableScheme}?id=${row.id}&isDisable=${val}`).then(res => { }).catch((res) => { }) |
||||
}, |
||||
// 排序回调 |
||||
sortChange (column) { |
||||
const { order } = column |
||||
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
||||
if (column.prop === 'classificationName') { |
||||
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.sequenceSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'updateTime') { |
||||
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.classificationNameSort = '' |
||||
this.releaseDateSort = '' |
||||
this.sequenceSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'createTime') { |
||||
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.classificationNameSort = '' |
||||
this.sequenceSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'sequence') { |
||||
this.sequenceSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.classificationNameSort = '' |
||||
} |
||||
} |
||||
this.getData() |
||||
}, |
||||
// 缓存当前页面和参数,详情页返回到列表的时候直接取该url |
||||
setReferrer () { |
||||
this.$store.commit('setReferrer', `${this.$route.fullPath}&keyword=${this.keyword}&field=${this.field}&page=${this.page}`) |
||||
}, |
||||
// 新增 |
||||
add () { |
||||
this.setReferrer() |
||||
this.$router.push(`/schemeSet`) |
||||
}, |
||||
// 编辑 |
||||
edit (row) { |
||||
this.setReferrer() |
||||
this.$router.push(`/schemeSet?id=${row.id}`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.m-l-10 { |
||||
margin-left: 10px; |
||||
} |
||||
</style> |
@ -1,268 +0,0 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<div class="tool"> |
||||
<div class="search-wrap"> |
||||
<el-select v-model="field" @change="initData"> |
||||
<el-option |
||||
v-for="(item, i) in keywords" |
||||
:key="i" |
||||
:label="item.name" |
||||
:value="item.id"> |
||||
</el-option> |
||||
</el-select> |
||||
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input> |
||||
</div> |
||||
<div class="actions"> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:批量删除'" @click="batchDel">批量删除</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:新增文章'" type="primary" @click="add" >新增文章</el-button> |
||||
</div> |
||||
</div> |
||||
<el-table :data="list" class="table" ref="table" header-align="center" @selection-change="handleSelectionChange" row-key="id" @sort-change="sortChange"> |
||||
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="序号" align="center"></el-table-column> |
||||
<el-table-column show-overflow-tooltip prop="title" label="标题" align="center" min-width="150"></el-table-column> |
||||
<el-table-column prop="classificationName" label="所属分类" align="center" min-width="120" sortable="custom"></el-table-column> |
||||
<el-table-column prop="founderName" label="录入人" align="center" min-width="80"></el-table-column> |
||||
<el-table-column prop="editorName" label="修改人" align="center" min-width="80"></el-table-column> |
||||
<el-table-column prop="updateTime" label="修改日期" align="center" min-width="150" sortable="custom"></el-table-column> |
||||
<el-table-column prop="releaseTime" label="发布日期" align="center" min-width="100" sortable="custom"></el-table-column> |
||||
<el-table-column prop="learnerNumber" label="已学习人数" align="center" min-width="70"></el-table-column> |
||||
<el-table-column prop="workNumber" label="状态" align="center" min-width="80"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.isRelease ? '已发布' : '草稿' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="sequence" label="置顶" align="center" min-width="80" sortable="custom"> |
||||
<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> |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" align="center" width="210"> |
||||
<template slot-scope="scope"> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button> |
||||
<el-button v-auth="'/parnerOperation:合伙人学习管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> |
||||
<el-switch |
||||
v-auth="'/parnerOperation:合伙人学习管理:禁用'" |
||||
v-if="scope.row.isRelease" |
||||
class="m-l-10" |
||||
v-model="scope.row.isDisable" |
||||
:active-value="0" |
||||
:inactive-value="1" |
||||
@change="switchOff($event, scope.row, scope.$index)"> |
||||
</el-switch> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import Setting from '@/setting' |
||||
import util from '@/libs/util' |
||||
export default { |
||||
data() { |
||||
return { |
||||
field: 'title', |
||||
keywords: [ |
||||
{ |
||||
id: 'title', |
||||
name: '标题' |
||||
}, |
||||
{ |
||||
id: 'founder', |
||||
name: '录入人' |
||||
}, |
||||
{ |
||||
id: 'editor', |
||||
name: '修改人' |
||||
} |
||||
], |
||||
keyword: '', |
||||
list: [], |
||||
page: 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
topSort: '', |
||||
classificationNameSort: '', |
||||
releaseDateSort: '', |
||||
editTimeSort: '', |
||||
multipleSelection: [], |
||||
}; |
||||
}, |
||||
watch: { |
||||
keyword: function(val) { |
||||
clearTimeout(this.searchTimer) |
||||
this.searchTimer = setTimeout(() => { |
||||
this.initData() |
||||
}, 500) |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
// 文章列表 |
||||
getData() { |
||||
const { keyword } = this |
||||
this.$post(this.api.partnerOperatingList, { |
||||
pageNum: this.page, |
||||
pageSize: this.pageSize, |
||||
querySource: 3, //查询来源(3.中台 4.合伙人平台) |
||||
topSort: this.topSort, |
||||
classificationNameSort: this.classificationNameSort, |
||||
editTimeSort: this.editTimeSort, |
||||
releaseDateSort: this.releaseDateSort, |
||||
typeId: 1, // 类型(1.学习2.资讯) |
||||
title: this.field === 'title' ? keyword : '', |
||||
founderName: this.field === 'founder' ? keyword : '', |
||||
editorName: this.field === 'editor' ? keyword : '' |
||||
}).then(({ page, total }) => { |
||||
page.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
this.list = page |
||||
this.total = total |
||||
}).catch(err => {}) |
||||
}, |
||||
currentChange(val) { |
||||
this.page = val |
||||
this.getData() |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
initData() { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
// 批量删除 |
||||
batchDel() { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
const data = [] |
||||
list.map(e => { |
||||
data.push('ids=' + e.id) |
||||
}) |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?${data.join('&')}`).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg("删除成功") |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
} else { |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
// 删除 |
||||
handleDelete(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$post(`${this.api.batchDeletionParnerArticle}?ids=${row.id}`).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
}, |
||||
// 禁用启用 |
||||
switchOff(val, row) { |
||||
this.$post(`${this.api.articleEnableOrDisable}?id=${row.id}&isDisable=${val}`).then(res => {}).catch((res) => {}) |
||||
}, |
||||
// 新增 |
||||
add() { |
||||
this.$router.push(`/learnMg?type=1`) |
||||
}, |
||||
// 排序回调 |
||||
sortChange(column) { |
||||
const { order } = column |
||||
// 三个排序只能同时传1个,所以点了一个排序的时候要清除掉其余两个 |
||||
if (column.prop === 'classificationName') { |
||||
this.classificationNameSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'updateTime') { |
||||
this.editTimeSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.classificationNameSort = '' |
||||
this.releaseDateSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'releaseTime') { |
||||
this.releaseDateSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.classificationNameSort = '' |
||||
this.topSort = '' |
||||
} |
||||
} |
||||
if (column.prop === 'sequence') { |
||||
this.topSort = order ? order === 'ascending' ? 'asc' : 'desc' : '' |
||||
if (order) { |
||||
this.editTimeSort = '' |
||||
this.releaseDateSort = '' |
||||
this.classificationNameSort = '' |
||||
} |
||||
} |
||||
this.getData() |
||||
}, |
||||
// 排序提交 |
||||
submitSequence(row) { |
||||
if (!row.sequence) return Util.errorMsg('请输入排序') |
||||
this.$post(`${this.api.modifiedSort}?articleId=${row.id}&sequenceNumber=${row.sequence}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => {}) |
||||
}, |
||||
// 编辑排序 |
||||
editSequence(row) { |
||||
this.list.forEach(e => { |
||||
e.editing = false |
||||
}) |
||||
row.editing = true |
||||
}, |
||||
// 置顶 |
||||
sticky(row) { |
||||
this.$post(`${this.api.articleTopOperation}?articleId=${row.id}&isTop=${row.isTop ? 0 : 1}`).then(res => { |
||||
this.initData() |
||||
}).catch(res => {}) |
||||
}, |
||||
// 编辑 |
||||
edit(row) { |
||||
this.$router.push(`/learnMg?id=${row.id}&type=1`) |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.m-l-10 { |
||||
margin-left: 10px; |
||||
} |
||||
.squ-icon { |
||||
font-size: 16px; |
||||
font-weight: 600; |
||||
cursor: pointer; |
||||
color: #f70000; |
||||
&.el-icon-check { |
||||
color: #05991e; |
||||
} |
||||
} |
||||
/deep/.squ-input { |
||||
width: auto; |
||||
.el-input__inner { |
||||
width: 60px; |
||||
padding: 0 10px; |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue