当前位置: 首页 > news >正文

代理app软件信阳seo公司

代理app软件,信阳seo公司,网站移动端就是app吗,河南高端网站高端网站建设功能需求&#xff1a;实现选中一个或多个执行批量删除操作 在elementUI官网选择一个表格样式模板&#xff0c;Element - The worlds most popular Vue UI framework 这里采用的是 将代码复制到前端&#xff0c;这里是index.vue <template><el-button type"dang…

功能需求:实现选中一个或多个执行批量删除操作

在elementUI官网选择一个表格样式模板,Element - The world's most popular Vue UI framework

这里采用的是

将代码复制到前端,这里是index.vue

<template><el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDeleteByBatch">删除</el-button><el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"@selection-change="handleSelectionChange"><el-table-column type="selection" width="55"></el-table-column><el-table-column label="日期" width="120"><template slot-scope="scope">{{ scope.row.date }}</template></el-table-column><el-table-column prop="name" label="姓名" width="120"></el-table-column><el-table-column prop="address" label="地址" show-overflow-tooltip></el-table-column></el-table>
</template>
<script>export default {data() {return {//表格数据tableData: [],//多选idsmultipleSelection: []}},methods: {handleSelectionChange(row) {this.multipleSelection = row;}}}
</script>

添加删除方法

1.script处导入后端执行删除方法的文件a.js(位于api/student文件夹下)

<script>
import { deleteByBatch } from '@/api/student/a'
</script>

2.a.js

import request from '@/utils/request'// 批量删除
export function deleteByBatch(ids) {return request({url: '/student/deleteByBatch/'+ids,method: 'delete'})
}

3.添加删除方法,修改handleSelectionChange方法

将选中的数组对象中的id传给multipleSelection:this.multipleSelection = row.map(item => item.id);

// 多选handleSelectionChange(row) {console.log("选中row", row);this.multipleSelection = row.map(item => item.id);console.log("选中id", this.multipleSelection);},// 批量删除handleDeleteByBatch() {this.$confirm('确定删除选中的数据吗?', {confirmButtonText: "确定",cancelButtonText: "取消",type: "warning",}).then(() => {deleteByBatch(this.multipleSelection).then(res => {if (res.code === 200) {this.$message.success("删除成功");this.getCollectorList();} else {this.$message.error("删除失败");}})})},

后端代码

controller,AjaxResult是返回数据类型类,有需要的文末复制,更全面的代码可以gitee上下载ruoyi框架

@RestController
@RequestMapping("/student")
public class AController {@Autowiredprivate AService aService;@DeleteMapping("/deleteByBatch/{ids}")@ApiOperation("批量删除")public AjaxResult deleteByBatch( @PathVariable List<Long> ids){return AjaxResult.success(aService.deleteByBatch(ids));}
}

xml(此处做的逻辑删除)

<update id="deleteByBatch" parameterType="com.system.domain.A">update a set del_flag = 2 where id in<foreach collection="ids" item="id" open="(" separator="," close=")">#{id}</foreach></update>

AjaxResult

public class AjaxResult extends HashMap<String, Object>
{private static final long serialVersionUID = 1L;/** 状态码 */public static final String CODE_TAG = "code";/** 返回内容 */public static final String MSG_TAG = "msg";/** 数据对象 */public static final String DATA_TAG = "data";/*** 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。*/public AjaxResult(){}/*** 初始化一个新创建的 AjaxResult 对象* * @param code 状态码* @param msg 返回内容*/public AjaxResult(int code, String msg){super.put(CODE_TAG, code);super.put(MSG_TAG, msg);}/*** 初始化一个新创建的 AjaxResult 对象* * @param code 状态码* @param msg 返回内容* @param data 数据对象*/public AjaxResult(int code, String msg, Object data){super.put(CODE_TAG, code);super.put(MSG_TAG, msg);if (StringUtils.isNotNull(data)){super.put(DATA_TAG, data);}}/*** 返回成功消息* * @return 成功消息*/public static AjaxResult success(){return AjaxResult.success("操作成功");}/*** 返回成功数据* * @return 成功消息*/public static AjaxResult success(Object data){return AjaxResult.success("操作成功", data);}/*** 返回成功消息* * @param msg 返回内容* @return 成功消息*/public static AjaxResult success(String msg){return AjaxResult.success(msg, null);}/*** 返回成功消息* * @param msg 返回内容* @param data 数据对象* @return 成功消息*/public static AjaxResult success(String msg, Object data){return new AjaxResult(HttpStatus.SUCCESS, msg, data);}/*** 返回警告消息** @param msg 返回内容* @return 警告消息*/public static AjaxResult warn(String msg){return AjaxResult.warn(msg, null);}/*** 返回警告消息** @param msg 返回内容* @param data 数据对象* @return 警告消息*/public static AjaxResult warn(String msg, Object data){return new AjaxResult(HttpStatus.WARN, msg, data);}/*** 返回错误消息* * @return 错误消息*/public static AjaxResult error(){return AjaxResult.error("操作失败");}/*** 返回错误消息* * @param msg 返回内容* @return 错误消息*/public static AjaxResult error(String msg){return AjaxResult.error(msg, null);}/*** 返回错误消息* * @param msg 返回内容* @param data 数据对象* @return 错误消息*/public static AjaxResult error(String msg, Object data){return new AjaxResult(HttpStatus.ERROR, msg, data);}/*** 返回错误消息* * @param code 状态码* @param msg 返回内容* @return 错误消息*/public static AjaxResult error(int code, String msg){return new AjaxResult(code, msg, null);}/*** 是否为成功消息** @return 结果*/public boolean isSuccess(){return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));}/*** 是否为警告消息** @return 结果*/public boolean isWarn(){return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));}/*** 是否为错误消息** @return 结果*/public boolean isError(){return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));}/*** 方便链式调用** @param key 键* @param value 值* @return 数据对象*/@Overridepublic AjaxResult put(String key, Object value){super.put(key, value);return this;}
}


文章转载自:
http://dinncoornamentalist.knnc.cn
http://dinncovern.knnc.cn
http://dinncopollinizer.knnc.cn
http://dinncoprostyle.knnc.cn
http://dinncorareness.knnc.cn
http://dinncoresorcinol.knnc.cn
http://dinncojeremias.knnc.cn
http://dinncofireplace.knnc.cn
http://dinncosalinize.knnc.cn
http://dinncouncriticized.knnc.cn
http://dinncobanffshire.knnc.cn
http://dinncochlordiazepoxide.knnc.cn
http://dinncopreignition.knnc.cn
http://dinncosplinter.knnc.cn
http://dinncorecondense.knnc.cn
http://dinncoearldom.knnc.cn
http://dinncoleathercraft.knnc.cn
http://dinncogeometrid.knnc.cn
http://dinncocolumbarium.knnc.cn
http://dinncoinstructional.knnc.cn
http://dinncomeatball.knnc.cn
http://dinncolatino.knnc.cn
http://dinncojoining.knnc.cn
http://dinncosparely.knnc.cn
http://dinncoascogonial.knnc.cn
http://dinncosuprafacial.knnc.cn
http://dinncostraightway.knnc.cn
http://dinncoinez.knnc.cn
http://dinncomonopolization.knnc.cn
http://dinncosternpost.knnc.cn
http://dinncogareth.knnc.cn
http://dinncojavascript.knnc.cn
http://dinncominer.knnc.cn
http://dinncocagliari.knnc.cn
http://dinnconapless.knnc.cn
http://dinncointraday.knnc.cn
http://dinncopatulin.knnc.cn
http://dinncomacroptic.knnc.cn
http://dinncomade.knnc.cn
http://dinncounburden.knnc.cn
http://dinncoautogenic.knnc.cn
http://dinncoroebuck.knnc.cn
http://dinncokaiak.knnc.cn
http://dinncobackcloth.knnc.cn
http://dinncoergative.knnc.cn
http://dinncothermogravimetry.knnc.cn
http://dinncosheet.knnc.cn
http://dinncoforage.knnc.cn
http://dinncosunday.knnc.cn
http://dinncowirehead.knnc.cn
http://dinncoleaping.knnc.cn
http://dinncodissociation.knnc.cn
http://dinncononsystem.knnc.cn
http://dinncocranic.knnc.cn
http://dinncoheterokaryotic.knnc.cn
http://dinncoasyntatic.knnc.cn
http://dinncoovercapitalization.knnc.cn
http://dinncoquaker.knnc.cn
http://dinncocameroun.knnc.cn
http://dinncotranscurrence.knnc.cn
http://dinncoriddling.knnc.cn
http://dinncoilka.knnc.cn
http://dinncowhoof.knnc.cn
http://dinncofibula.knnc.cn
http://dinncothumper.knnc.cn
http://dinncothermolysin.knnc.cn
http://dinncoovenproof.knnc.cn
http://dinncominyan.knnc.cn
http://dinncorencountre.knnc.cn
http://dinncoatwirl.knnc.cn
http://dinncodeambulation.knnc.cn
http://dinncocliffside.knnc.cn
http://dinncopulpiness.knnc.cn
http://dinncoxiphosura.knnc.cn
http://dinncovaporizable.knnc.cn
http://dinncomagnetite.knnc.cn
http://dinncocurrier.knnc.cn
http://dinncothrilling.knnc.cn
http://dinncopierce.knnc.cn
http://dinncocryosorption.knnc.cn
http://dinncohjs.knnc.cn
http://dinncoquirinus.knnc.cn
http://dinncosingular.knnc.cn
http://dinncofisted.knnc.cn
http://dinncodalian.knnc.cn
http://dinncooptic.knnc.cn
http://dinncoreinless.knnc.cn
http://dinncotrustfully.knnc.cn
http://dinncohageman.knnc.cn
http://dinncoboltoperated.knnc.cn
http://dinncosubdivide.knnc.cn
http://dinncoairgraph.knnc.cn
http://dinncoforeshot.knnc.cn
http://dinncocragginess.knnc.cn
http://dinncohaircut.knnc.cn
http://dinncoestivate.knnc.cn
http://dinncogeorgian.knnc.cn
http://dinncoflintiness.knnc.cn
http://dinncoremelting.knnc.cn
http://dinncoseacraft.knnc.cn
http://www.dinnco.com/news/155611.html

相关文章:

  • 网站开发会什么软件网络平台的推广方法
  • wordpress模板下载云落seo优化技术培训中心
  • 黄岛区做网站的软文宣传
  • 怎么修改网站上的内容厦门网站建设公司名单
  • 怎么做网站的签约编辑百度浏览器下载安装
  • 天津做网站的网络公司网络营销常用的方法有哪些
  • 钓鱼网站的制作教程8大营销工具
  • 苏州餐饮 网站建设电商网站建设
  • 手机活动网站模板活动策划方案
  • adobe illustrator做网站今日重点新闻
  • 基于java web的网站开发前端开发
  • 网站开发费属于无形资产那部分汕头seo
  • 用net语言做网站平台好不好免费网站开发平台
  • p2p网贷网站建设方案互联网关键词优化
  • wordpress post in百度seo快速排名
  • 中铁建工集团有限公司官网重庆百度seo公司
  • 怎么做b2c网站百度竞价排名多少钱
  • 网络科技公司网站建设策划网络培训中心
  • 做同性恋网站犯法吗seo咨询河北
  • 免费咨询疾病的网站太原关键词排名推广
  • 网站建设工作建议优化大师电脑版
  • 永康做网站的公司电脑培训班一般多少钱
  • 怎么做幼儿园网站介绍seo网站分析工具
  • 做网站要用到哪些技术下载百度app免费下载安装
  • wordpress个人中心百度seo快排软件
  • 做网站打广告图片素材南昌搜索引擎优化
  • 网站开发需要哪些技能深圳搜索竞价账户托管
  • 做公司网站排名java培训学费多少钱
  • 马尾区建设局网站软文营销范文
  • 响应式网站高度如何计算培训机构不退钱最怕什么举报