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为什么一直输,newpoker怎么安装脚本,教材教程(总是有挂)-哔哩哔哩1...
透视免费!wepoker数据分... 透视免费!wepoker数据分析,潮友会辅助器,其实有挂(解谜透明挂教程)-哔哩哔哩1、打开软件启动...
透视胜率!hhpoker有没有... 透视胜率!hhpoker有没有辅助(透视)开挂辅助器(好像有挂)-哔哩哔哩hhpoker有没有辅助辅...
目前!兴动互娱辅助工具靠谱吗,... 目前!兴动互娱辅助工具靠谱吗,杭州都莱辅助软件,黑科技教程(原来是有挂)-哔哩哔哩1、进入到兴动互娱...
透视教程!aapoker怎么控... 透视教程!aapoker怎么控制牌,菠萝辅助器免费版的功能介绍,教材教程(原来真的有挂)-哔哩哔哩一...
刚刚!wepoker一直输的号... 刚刚!wepoker一直输的号能继续打吗,兴动互娱辅助脚本ios下载,好像真的是有挂(推荐AI教程)...
透视辅助!aapoker辅助器... 透视辅助!aapoker辅助器怎么用(透视)开挂辅助工具(确实真的是有挂)-哔哩哔哩1、每一步都需要...
透视模拟器!wepoker高级... 透视模拟器!wepoker高级辅助,hhpoker脚本,办法教程(切实真的有挂)-哔哩哔哩小薇(透视...
针对!广东闲来辅助免费,wep... 针对!广东闲来辅助免费,wepoker辅助工具,技巧教程(好像是真的挂)-哔哩哔哩1、广东闲来辅助免...
透视新版!德州局透视脚本免费版... 透视新版!德州局透视脚本免费版下载手机版,aapoker能控制牌吗,教材教程(切实有挂)-哔哩哔哩1...