增加分享图 优先级类型

This commit is contained in:
yulixing 2019-09-19 13:40:30 +08:00
parent 5397eb8c56
commit 57cd878847

View File

@ -71,6 +71,10 @@
label="关闭"
:value="4"
/>
<el-option
label="自定义"
:value="5"
/>
</el-select>
</el-form-item>
<el-form-item>
@ -251,9 +255,9 @@
</template>
<script>
import { getShareList, getShareTypes, delShares, saveShare } from '@/api/share'
import { getGame } from '@/api/games'
import { mapGetters } from 'vuex'
import {getShareList, getShareTypes, delShares, saveShare} from '@/api/share'
import {getGame} from '@/api/games'
import {mapGetters} from 'vuex'
import getPageTitle from '@/utils/get-page-title'
export default {
@ -273,12 +277,12 @@ export default {
filterForm: {
platform_id: '',
shareType: '',
type: ''
type: '',
},
// toolbar
batch: {
show: false,
txt: '批量操作'
txt: '批量操作',
},
switchText: '获取正式数据',
// table
@ -288,11 +292,11 @@ export default {
// pagination
currentPage: 1,
pageSize: 10,
total: 0
total: 0,
}
},
computed: {
...mapGetters(['userInfo'])
...mapGetters(['userInfo']),
},
mounted() {
this.uid = this.$route.params.uid
@ -318,9 +322,9 @@ export default {
methods: {
// common
getGameInfo(cb) {
getGame({ uid: this.uid })
getGame({uid: this.uid})
.then(res => {
const { data } = res
const {data} = res
if (data.errcode === 0) {
this.gameInfo = data.gameInfo
this.platformsArr = data.gameInfo.platforms
@ -368,7 +372,7 @@ export default {
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
}
)
.then(() => {
@ -379,9 +383,9 @@ export default {
delShares({
ids: ids,
isDev: this.isDev,
uid: this.gameInfo._id
uid: this.gameInfo._id,
}).then(res => {
const { data } = res
const {data} = res
if (data.errcode === 0) {
this.$message.success('删除成功!')
}
@ -391,7 +395,7 @@ export default {
.catch(() => {
this.$notify.info({
title: '消息',
message: '已取消删除'
message: '已取消删除',
})
})
},
@ -402,7 +406,7 @@ export default {
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
}
)
.then(() => {
@ -433,7 +437,7 @@ export default {
.catch(() => {
this.$notify.info({
title: '消息',
message: '已取消发布'
message: '已取消发布',
})
})
},
@ -461,7 +465,7 @@ export default {
currentPage: this.currentPage,
pageSize: this.pageSize,
gameId: this.gameInfo.game_id,
isDev: this.isDev
isDev: this.isDev,
})
.then(res => {
const data = res.data
@ -489,6 +493,8 @@ export default {
return '只广告'
} else if (cellValue === 4) {
return '关闭'
} else if (cellValue === 5) {
return '自定义'
}
},
formatSex(row, column, cellValue, index) {
@ -520,13 +526,13 @@ export default {
this.$confirm('是否删除该分享图?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
delShares({
ids: [row._id],
uid: this.uid,
isDev: this.isDev
isDev: this.isDev,
})
.then(res => {
const data = res.data
@ -542,7 +548,7 @@ export default {
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
message: '已取消删除',
})
})
},
@ -589,13 +595,17 @@ export default {
editShare(row) {
const dataType = this.isDev ? 'dev' : 'pro'
this.$router.push(
`/games/details/${this.uid}/share/edit?id=${row._id}&data_type=${dataType}`
`/games/details/${this.uid}/share/edit?id=${
row._id
}&data_type=${dataType}`
)
},
rowClick(row, column, event) {
const dataType = this.isDev ? 'dev' : 'pro'
this.$router.push(
`/games/details/${this.uid}/share/edit?id=${row._id}&data_type=${dataType}`
`/games/details/${this.uid}/share/edit?id=${
row._id
}&data_type=${dataType}`
)
},
// pagination
@ -606,7 +616,7 @@ export default {
pageChange(val) {
this.currentPage = val
this.getData()
}
}
},
},
}
</script>