diff --git a/src/views/admin/jump.vue b/src/views/admin/jump.vue index ffce3ea..44525f7 100644 --- a/src/views/admin/jump.vue +++ b/src/views/admin/jump.vue @@ -149,10 +149,15 @@ /> + 提示一:若批量添加,目标游戏、目标AppID、特征码、推广链接需要按顺序一一对应,用“,”分隔。 + 提示二:修改单条信息时不可批量操作(只可选择一个目标游戏)。 - + + + { + item.t_game_name = [item.t_game_name] + return item + }) this.total = data.total this.isLoaded = false } catch (err) { @@ -492,14 +516,40 @@ export default { this.$message.error('请按要求填写表单') return } + + // 整理数据 + const info = JSON.parse(JSON.stringify(this.modalForm)) + const games = info.t_game_name + const appids = info.t_appid.split(',') + const ad_uids = info.ad_uid.split(',') + const links = info.link.split(',') + if (this.isNew) { // 新增 - const result = await this.addJump(this.modalForm) + const submitArr = [] + + games.map((item, index) => { + submitArr.push( + this.addJump({ + platform_id: info.platform_id, + game_id: info.game_id, + t_game_name: games[index], + t_appid: appids[index], + ad_uid: ad_uids[index], + link: links[index], + }) + ) + }) + const result = await Promise.all(submitArr) } else { // 修改 - const result = await this.updateJump(this.modalForm) + info.t_game_name = games[0] || '' + info.t_appid = appids[0] || '' + info.ad_uid = ad_uids[0] || '' + info.link = links[0] || '' + const result = await this.updateJump(info) } - this.$message.success('更新成功!') + this.$message.success('操作成功!') this.closeModal() this.getData() } catch (err) {