优化提示 增加批量发布
This commit is contained in:
parent
88bf44704b
commit
11c13e5e2d
@ -189,13 +189,13 @@
|
||||
type="success"
|
||||
@click="addAC"
|
||||
v-if="permEdit"
|
||||
>新增成就</el-button>
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
class="mgt-20"
|
||||
type="primary"
|
||||
@click="saveAllAC"
|
||||
v-if="permEdit"
|
||||
>保存全部</el-button>
|
||||
>保存</el-button>
|
||||
<el-button
|
||||
class="mgt-20"
|
||||
type="warning"
|
||||
|
@ -156,13 +156,13 @@
|
||||
type="success"
|
||||
@click="addIV"
|
||||
v-if="permEdit"
|
||||
>新增配置</el-button>
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
class="mgt-20"
|
||||
type="primary"
|
||||
@click="saveAllIV"
|
||||
v-if="permEdit"
|
||||
>保存全部</el-button>
|
||||
>保存</el-button>
|
||||
<el-button
|
||||
class="mgt-20"
|
||||
type="warning"
|
||||
|
@ -7,11 +7,13 @@
|
||||
description="进行【平台切换】、【删除推荐】、【调整排序】等操作时,请注意保存!"
|
||||
class="mgb-20"
|
||||
show-icon
|
||||
effect="dark"
|
||||
/>
|
||||
<el-alert
|
||||
:title="alertText"
|
||||
class="mgt-20 mgb-20"
|
||||
title="当前数据为【正式】数据!"
|
||||
type="warning"
|
||||
class="mgt-20 mgb-20"
|
||||
effect="dark"
|
||||
/>
|
||||
<el-select
|
||||
v-model="platform_id"
|
||||
@ -147,19 +149,19 @@
|
||||
type="success"
|
||||
@click="addRC"
|
||||
v-if="permEdit"
|
||||
>新增推荐</el-button>
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
class="mgt-20"
|
||||
type="primary"
|
||||
v-if="permEdit"
|
||||
@click="saveRCList"
|
||||
>保存全部</el-button>
|
||||
>保存</el-button>
|
||||
<el-button
|
||||
class="mgt-20"
|
||||
type="warning"
|
||||
v-if="permEdit"
|
||||
@click="publishRCList"
|
||||
>发布推荐</el-button>
|
||||
>发布</el-button>
|
||||
<el-button
|
||||
class="mgt-20"
|
||||
v-if="permEdit"
|
||||
@ -192,7 +194,7 @@ export default {
|
||||
permPublish: false,
|
||||
isDev: true,
|
||||
alertText: '',
|
||||
switchText:'获取正式数据',
|
||||
switchText: '获取正式数据',
|
||||
// form
|
||||
RCForm: {},
|
||||
RCFormRules: {
|
||||
@ -216,7 +218,9 @@ export default {
|
||||
watch: {
|
||||
isDev: {
|
||||
handler: function(nVal) {
|
||||
this.alertText = nVal ? '当前数据为【测试】数据!' : '当前数据为【正式】数据!'
|
||||
this.alertText = nVal
|
||||
? '当前数据为【测试】数据!'
|
||||
: '当前数据为【正式】数据!'
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
@ -490,7 +494,6 @@ export default {
|
||||
},
|
||||
|
||||
getProData() {
|
||||
|
||||
this.isDev = !this.isDev
|
||||
this.switchText = this.isDev ? '获取正式数据' : '获取测试数据'
|
||||
this.getGameInfo()
|
||||
|
@ -12,8 +12,13 @@
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
@click="switchData"
|
||||
type="warning"
|
||||
type="success"
|
||||
>{{ switchText }}</el-button>
|
||||
<el-button
|
||||
v-if="batch.show && ((isDev && permEdit) || (!isDev && permPublish))"
|
||||
type="warning"
|
||||
@click="batchPublish"
|
||||
>批量发布</el-button>
|
||||
<el-button
|
||||
v-if="batch.show && ((isDev && permEdit) || (!isDev && permPublish))"
|
||||
type="success"
|
||||
@ -30,7 +35,6 @@
|
||||
@click="batchDel"
|
||||
>批量删除</el-button>
|
||||
<el-button @click="batchOpt"> {{ batch.txt }} </el-button>
|
||||
|
||||
</div>
|
||||
<div class="r fr">
|
||||
<el-button
|
||||
@ -41,9 +45,11 @@
|
||||
</div>
|
||||
<!-- table -->
|
||||
<el-alert
|
||||
:title="alertText"
|
||||
title="当前数据为【正式】数据!"
|
||||
type="warning"
|
||||
class="mgt-20 mgb-20"
|
||||
effect="dark"
|
||||
v-if="!isDev"
|
||||
/>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
@ -299,7 +305,6 @@ export default {
|
||||
isNew: false,
|
||||
isNewItem: false,
|
||||
isDev: true,
|
||||
alertText: '当前显示【测试】数据!',
|
||||
// toolbar
|
||||
batch: {
|
||||
show: false,
|
||||
@ -446,9 +451,6 @@ export default {
|
||||
this.isDev
|
||||
? (this.switchText = '获取正式数据')
|
||||
: (this.switchText = '获取测试数据')
|
||||
this.isDev
|
||||
? (this.alertText = '当前展示数据为【测试】数据!')
|
||||
: (this.alertText = '当前展示数据为【正式】数据!')
|
||||
this.currentPage = 1
|
||||
this.getRewards()
|
||||
},
|
||||
@ -472,7 +474,8 @@ export default {
|
||||
this.saveReward(this.modalForm)
|
||||
.then(data => {
|
||||
this.$message.success('保存成功!')
|
||||
this.switchData()
|
||||
this.isDev = true
|
||||
this.getRewards()
|
||||
this.closeModal()
|
||||
})
|
||||
.catch(err => {
|
||||
@ -698,6 +701,46 @@ export default {
|
||||
this.$message.info('已取消删除!')
|
||||
})
|
||||
},
|
||||
batchPublish() {
|
||||
this.$confirm(
|
||||
`是否发布所选${this.multipleSelection.length}条奖励?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
const submitArr = []
|
||||
this.multipleSelection.map(row => {
|
||||
const devData = JSON.parse(JSON.stringify(row))
|
||||
const proData = JSON.parse(JSON.stringify(row))
|
||||
devData.isDev = true
|
||||
devData.published = true
|
||||
|
||||
proData.isDev = false
|
||||
proData.published = true
|
||||
|
||||
submitArr.push(this.saveReward(devData))
|
||||
submitArr.push(this.saveReward(proData))
|
||||
})
|
||||
Promise.all(submitArr)
|
||||
.then(() => {
|
||||
this.$message.success('发布成功!')
|
||||
this.getRewards()
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$notify.info({
|
||||
title: '消息',
|
||||
message: '已取消发布'
|
||||
})
|
||||
})
|
||||
},
|
||||
formKeys(row, column, cellValue, index) {
|
||||
return cellValue.join(',')
|
||||
},
|
||||
|
@ -79,17 +79,17 @@
|
||||
<el-form-item>
|
||||
<el-button
|
||||
v-if="permEdit && this.platform_id"
|
||||
type="warning"
|
||||
type="primary"
|
||||
@click="save"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="permPublish && this.platform_id"
|
||||
type="primary"
|
||||
type="warning"
|
||||
@click="publish"
|
||||
>发布</el-button
|
||||
>
|
||||
<el-button v-if="permEdit && this.platform_id" @click="reset"
|
||||
<el-button v-if="permEdit && this.platform_id" @click="reset" type="success"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
|
@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<div class="main-content p-game-share-add">
|
||||
<el-alert
|
||||
:title="alertText"
|
||||
title="当前数据为【正式】数据!"
|
||||
type="warning"
|
||||
style="width: 60%"
|
||||
class="mgb-20"
|
||||
>
|
||||
</el-alert>
|
||||
effect="dark"
|
||||
style="width: 60%"
|
||||
v-if="!isDev"
|
||||
/>
|
||||
<el-form
|
||||
ref="shareForm"
|
||||
:model="shareForm"
|
||||
@ -208,11 +209,11 @@
|
||||
v-if="permEdit"
|
||||
type="success"
|
||||
@click="restore"
|
||||
>还原</el-button>
|
||||
>重置</el-button>
|
||||
<el-button
|
||||
v-if="permEdit"
|
||||
@click="resetForm('shareForm')"
|
||||
>重置</el-button>
|
||||
>清空</el-button>
|
||||
<el-button @click="goBack">返回</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -502,7 +503,6 @@ export default {
|
||||
onlyAd: false,
|
||||
curShareType: '',
|
||||
selectedShareType: [],
|
||||
alertText: '先保存后发布!',
|
||||
// main
|
||||
shareForm: {
|
||||
default_share: false,
|
||||
@ -615,7 +615,6 @@ export default {
|
||||
this.getAreas()
|
||||
this.token = getToken()
|
||||
}
|
||||
this.alertText = this.isDev ? '当前数据为【测试】数据!' : '当前数据为【正式】数据!'
|
||||
this.permEdit =
|
||||
this.userInfo.permissions.includes(`${this.uid}-edit`) ||
|
||||
this.userInfo.permissions.includes(`${this.uid}-publish`) ||
|
||||
|
@ -67,8 +67,13 @@
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
@click="switchData"
|
||||
type="warning"
|
||||
type="success"
|
||||
>{{ switchText }}</el-button>
|
||||
<el-button
|
||||
v-if="batch.show && permPublish"
|
||||
type="warning"
|
||||
@click="batchPublish"
|
||||
>批量发布</el-button>
|
||||
<el-button
|
||||
v-if="batch.show && permEdit"
|
||||
type="danger"
|
||||
@ -88,6 +93,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- table -->
|
||||
<el-alert
|
||||
title="当前数据为【正式】数据!"
|
||||
v-if="!isDev"
|
||||
type="warning"
|
||||
class="mgt-20 mgb-20 w100"
|
||||
effect="dark"
|
||||
/>
|
||||
<el-table
|
||||
v-loading="isLoaded"
|
||||
:data="tableData"
|
||||
@ -358,6 +370,46 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
batchPublish() {
|
||||
this.$confirm(
|
||||
`是否发布所选${this.multipleSelection.length}条分享图?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
const submitArr = []
|
||||
this.multipleSelection.map(row => {
|
||||
const devData = JSON.parse(JSON.stringify(row))
|
||||
const proData = JSON.parse(JSON.stringify(row))
|
||||
devData.isDev = true
|
||||
devData.published = true
|
||||
|
||||
proData.isDev = false
|
||||
proData.published = true
|
||||
|
||||
submitArr.push(this.saveShare(devData))
|
||||
submitArr.push(this.saveShare(proData))
|
||||
})
|
||||
Promise.all(submitArr)
|
||||
.then(() => {
|
||||
this.$message.success('分享图发布成功!')
|
||||
this.getData()
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$notify.info({
|
||||
title: '消息',
|
||||
message: '已取消发布'
|
||||
})
|
||||
})
|
||||
},
|
||||
batchOpt() {
|
||||
this.batch.show = !this.batch.show
|
||||
this.batch.txt = this.batch.show ? '关闭' : '批量操作'
|
||||
@ -482,6 +534,7 @@ export default {
|
||||
Promise.all(submitArr)
|
||||
.then(() => {
|
||||
this.$message.success('分享图发布成功!')
|
||||
this.getData()
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user