a标签跳转后返回原页面 layui_从A页面带参数跳转到B页面;进行解析,并显示数据,进行编辑...

本文介绍了如何使用layui框架从A页面带参数跳转到B页面,并在B页面加载数据进行编辑。通过`parent.layer.open`方法打开新页面,利用URL参数获取数据ID,然后通过AJAX请求获取详细信息并填充到页面元素中,包括名称、描述、分类等,同时根据数据节点类型展示不同内容,如人工任务、服务任务等。
摘要由CSDN通过智能技术生成

1 A页面跳转时候的地址:2 parent.layer.open({3 type: 2,4 title:'新建草稿',5 shadeClose: true,6 shade: 0.8,7 scrollbar: false,8 maxmin:true,9 area: ['100%', '100%'],10 content:'../../backstage/html/taskManagement/workFlowDefine/newFlowDefine.html?modelId=' +data.id,11 });12 编辑页面:打开页面的时候,显示相关信息,并可以进行保存13 getParam();14 functiongetParam() {15 var url = location.search.substring(1);//location.search得到的是?后面的数据: ?modelId='+data.id,substring() 方法用于提取字符串中介于两个指定下标之间的字符;得到的是去掉?的部分16 if (url != null && url != undefined && url != "") { //表示,如果有参数;且不等于空,则进行分割得到data.id;17 modelId = url.split('&')[0].split('=')[1];    //data.id;18 }19 }20 if (modelId != null && modelId != undefined && modelId != "") {21 $.ajax({22 url: '/service/moddel/' + modelId + '/json',//如果前面不调用getParam(),则此处的modelId就是无定义的23 type: 'get',24 dataType: 'json',25 data: {},26 success: function(response, statusText) {27 if (response.code == '0') {28 $('.copyName').val(response.name);29 $('.flag').val(response.key);32 categoryId =response.category;33 $('.category select option').each(function() {34 if ($(this).val() ==response.category) {35 $(this).attr("selected", true);36 }37 });38 form.render('select');39 if (response.description != null && response.description !=undefined) {40 $('.bigDescribe').text(response.description);41 }42 var dataNodes =response.nodes;43 if (dataNodes != nul

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值