vue elementui 在table里使用el-switch
创始人
2024-11-17 19:06:15
0

                                  //理论上底部的js并不重要 只是我记录用法     // 处理广告状态变化     handleAdStatusChange(row, idx) {       this.handleStatusChange(row, idx, adupdatestatus, 'adId', 'adIds');     },      handleStatusChange(row, idx, updateFunction, idKey, statusKey) {       let newStatus = row.operationStatus;       let oldStatus = row.operationStatus === 'ENABLE' ? 'DISABLE' : 'ENABLE';       let otxt = idKey == 'adId' ? '广告' : '广告组'              // 复制菜单列表,避免直接修改原始数据       let oarr = JSON.parse(JSON.stringify(this.menuList));              // 收集要更新的ID       let oids = [row[idKey]]; // 使用传入的idKey来获取正确的ID              // 构造参数对象       let params = {         advertiserId: row.advertiserId,         [statusKey]: oids, // 使用传入的statusKey来确定使用adgroupIds还是adIds         operationStatus: newStatus,       };              // 调用更新函数并处理结果       updateFunction(params).then((response) => {         if (response.data.code == 0) {           this.$message({             message: '更新'+ otxt +'状态成功',             type: 'success'           });           oarr.records[idx].operationStatus = newStatus;           this.menuList = oarr;         }       }).catch((error) => {         oarr.records[idx].operationStatus = oldStatus;         this.menuList = oarr;         this.$message({           message: '更新状态失败,请重试',           type: 'error'         });       });     },

相关内容

热门资讯

透视能赢!hhpoker免费辅... 透视能赢!hhpoker免费辅助器,hhpoker作弊码怎么用,系统教程(有挂详情);1、下载好hh...
透视辅助(WPK)果然真的有挂... 透视辅助(WPK)果然真的有挂(透视)wpk模拟器(辅助教程)1)wpk模拟器辅助挂:进一步探索wp...
透视规律!aapoker透视插... 透视规律!aapoker透视插件(透视)插件下载(总是真的是有挂)aapoker透视插件辅助器中分为...
透视真的!wepoker一直输... 透视真的!wepoker一直输的号能继续打吗,黑侠破解wepoker(确实真的是有挂)1、wepok...
透视ai!hhpkoer辅助器... 透视ai!hhpkoer辅助器视频,hhpoker真的假的,细节方法(有挂插件);1、hhpkoer...
透视有挂(WPK)竟然有挂(透... 透视有挂(WPK)竟然有挂(透视)wpk模拟器(玩家教程);1、起透看视 wpk模拟器透明视辅助2、...
透视辅助!aapoker透视插... 透视辅助!aapoker透视插件(透视)万能辅助器(其实是有挂)1、玩家可以在aapoker透视插件...
透视安装!wepoker有机器... 透视安装!wepoker有机器人吗,wepoker透视有没有(总是是真的有挂)1、wepoker有机...
透视脚本!德州hhpoker是... 透视脚本!德州hhpoker是真的吗,HH平台挂,切实教程(有挂细节)1、游戏颠覆性的策略玩法,独创...
透视插件(WPK)一贯是有挂(... 透视插件(WPK)一贯是有挂(透视)wpk插件辅助(技巧教程)1、wpk插件辅助系统规律教程、wpk...