增加分享图 优先级类型

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