bootstrap table 超链接的添加 标签

您所在的位置:网站首页 id里怎么添加页面链接 bootstrap table 超链接的添加 标签

bootstrap table 超链接的添加 标签

2024-07-10 09:58:49| 来源: 网络整理| 查看: 265

后台管理页面采用 bootstrap table

页面样式:

 

 

现在需要在操作中添加一个标签,跳转到不同的页面

{ title: '操作', align: 'center', formatter: function(value, row, index) { var actions = []; actions.push('修改 '); actions.push('删除 '); actions.push('拓片管理 '); return actions.join(''); }

跳转的页面修改:

添加 修改 删除 var editFlag = [[${@permission.hasPermi('module:informations:edit')}]]; var removeFlag = [[${@permission.hasPermi('module:informations:remove')}]]; var prefix = ctx + "module/informations"; var resourceId = $('#resourceId').val(); var type = $('#type').val(); $(function () { var options = { url: prefix + "/list?resourceId=" + resourceId + "&type=" + type, createUrl: prefix + "/add?resourceId=" + resourceId + "&type=" + type, updateUrl: prefix + "/edit/{id}", removeUrl: prefix + "/remove", modalName: "拓片/石刻", uniqueId: "id", columns: [ { checkbox: true }, { title: '序号', align: "center", width: 40, formatter: function (value, row, index) { var table = $('#bootstrap-table'); var pageSize = table.bootstrapTable('getOptions').pageSize; //获取当前是第几页 var pageNumber = table.bootstrapTable('getOptions').pageNumber; //返回序号,注意index是从0开始的,所以要加上1 return pageSize * (pageNumber - 1) + index + 1; } }, /* { field: 'id', title: '主键' }, { field: 'resourceId', title: '资源id' }, { field: 'type', title: '资源类型' },*/ { field: 'name', title: '名称' }, { field: 'description', title: '描述' }, { field: 'path', title: '附件' }, /*{ field: 'pro1', title: '备用字段' }, { field: 'pro2', title: '备用字段' },*/ { title: '操作', align: 'center', formatter: function (value, row, index) { var actions = []; actions.push('修改 '); actions.push('删除'); return actions.join(''); } }] }; $.table.init(options); });

 

后台代码 controller 修改:

package cn.cmodes.project.module.informations.controller; import cn.cmodes.framework.aspectj.lang.annotation.Log; import cn.cmodes.framework.aspectj.lang.enums.BusinessType; import cn.cmodes.framework.web.controller.BaseController; import cn.cmodes.framework.web.domain.AjaxResult; import cn.cmodes.framework.web.page.Page; import cn.cmodes.project.module.informations.domain.Informations; import cn.cmodes.project.module.informations.service.IInformationsService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import java.util.List; /** * 拓片/石刻 信息操作处理 * * @author dqj * @date 2019-03-19 */ @Controller @RequestMapping("/module/informations") public class InformationsController extends BaseController { @Autowired private IInformationsService informationsService; @RequiresPermissions("module:informations:view") @GetMapping() public String informations(String resourceId,String type,ModelMap map) { map.addAttribute("resourceId",resourceId); map.addAttribute("type",type); return "module/informations/informations"; } /** * 查询拓片/石刻列表 */ @RequiresPermissions("module:informations:list") @PostMapping("/list") @ResponseBody public Page list(Informations informations) { startPage(); List list = informationsService.selectInformationsList(informations); return getDataTable(list); } /** * 新增拓片/石刻 */ @GetMapping("/add") public String add(String resourceId,String type,ModelMap map) { map.addAttribute("resourceId",resourceId); map.addAttribute("type",type); return "module/informations/add"; } /** * 新增保存拓片/石刻 */ @RequiresPermissions("module:informations:add") @Log(title = "拓片/石刻", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody public AjaxResult addSave(Informations informations) { return toAjax(informationsService.insertInformations(informations)); } /** * 修改拓片/石刻 */ @GetMapping("/edit/{id}") public String edit(@PathVariable("id") String id, ModelMap mmap) { Informations informations = informationsService.selectInformationsById(id); mmap.put("informations", informations); return "module/informations/edit"; } /** * 修改保存拓片/石刻 */ @RequiresPermissions("module:informations:edit") @Log(title = "拓片/石刻", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody public AjaxResult editSave(Informations informations) { return toAjax(informationsService.updateInformations(informations)); } /** * 删除拓片/石刻 */ @RequiresPermissions("module:informations:remove") @Log(title = "拓片/石刻", businessType = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(String ids) { return toAjax(informationsService.deleteInformationsByIds(ids)); } }

 

添加页面修改:

//隐藏域 //隐藏域 名称: 描述: 附件: var prefix = ctx + "module/informations"; $("#form-informations-add").validate({ rules:{ xxxx:{ required:true } } }); //富文本初始化 richTextInit('description'); //上传文本框初始化 fileUploadInit("path"); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-informations-add').serialize()); }else { //滑到错误位置 $('html,body').animate({scrollTop: $("label.error").offset().top-20}, 100); } }

 

修改页面:

名称: 描述: 附件: var prefix = ctx + "module/informations"; $("#form-informations-edit").validate({ rules:{ xxxx:{ required:true } } }); //富文本初始化 richTextInit('description'); //上传文本框初始化 fileUploadInit("path"); function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/edit", $('#form-informations-edit').serialize()); }else { //滑到错误位置 $('html,body').animate({scrollTop: $("label.error").offset().top-20}, 100); } }

 

前台页面的样子:

 



【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭