首先是js中带参弹出窗口
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags"%><!DOCTYPE html><html><head><title>${bussi.bussinessName}</title><s:include value="/temp/head.jsp"></s:include><script type="text/javascript"> var tableOptions = { //数据url url : ‘<s:url action="ecModelListJson" namespace="/ecplatform/system"></s:url>‘, sortName : ‘order_num‘,// sortOrder : ‘desc‘, //列表选择器 selector : ‘#grid‘, title : ‘${bussi.bussinessName}‘, //新建窗口 newURL:‘<s:url action="ecModelDetail"></s:url>‘, //查看窗口 viewURL:‘<s:url action="ecModelDetail"></s:url>‘, //导出url exportURL:‘<s:url action="ecModelListExcel"></s:url>‘, //keyId字段 keyIdField:‘model_id‘, workflowSideBar:false //showFooter:true }; var dg = new DefDataGrid(tableOptions); $(function(){ $(‘#setBtn‘).click(function(){ var url = ‘<s:url action="ecModelParamDetail"></s:url>‘; var row = $(‘#grid‘).datagrid(‘getSelected‘); url = concatURL(url,{key:row.model_id}); if (!row) return; popDialog(‘paramSet‘, { title : "设置参数" , width : 800, height : 400 },url, function() { $("#grid").datagrid("reload"); }); }); $(‘#editBtn‘).hide(); });</script> </head> <body class="easyui-layout" style="visibility: hidden"> <div data-options="region:‘center‘,border:false" style="overflow:hidden;"> <table id="grid"> <thead> <tr> <th width="100" data-options="halign:‘center‘,field : ‘model_name‘,sortable : true"> 车型名称 </th> <th width="100" data-options="halign:‘center‘,field : ‘is_use‘,sortable : true,formatter:formatterY"> 是否使用 </th> <th width="100" data-options="halign:‘center‘,field : ‘order_num‘,sortable : true"> 排序 </th> <th width="100" data-options="halign:‘center‘,field : ‘remark‘,sortable : true"> 备注 </th> </tr> </thead> </table> </div> <!-- 工具栏 --> <div id="tb"> <div> <s:if test="#opt.SET"> <a href="#" class="easyui-linkbutton" iconCls="eicon-edit" plain="true" id="setBtn">设置</a> </s:if> </div> </div></body></html> 单张图片 js
function initForm() { loadFormData(‘#ff‘, en, ‘en.‘);//放到最后 if (en && en.modelImg) { imgUrl = ‘/upload/‘ + en.modelImg; $(‘#modelImg‘).attr(‘src‘, imgUrl); } ui
<div class="formInput"> <div class="formInputLabel">车型图片:</div> <div class="formInputContent"> <img style="width: 199px;height: 141px;" id="modelImg"> <div style="width:250px;"> <span id="size">建议尺寸332*332(宽*高),大小30K内</span> <a href="#" class="easyui-linkbutton" iconCls="eicon-upload" title="选择" id="uploadBtn">上传</a> </div> <script type="text/javascript"> toFileBtn(‘#uploadBtn‘, function (data) { data.modelImg = data.pathName + data.fileName; en.modelImg = data.modelImg; loadFormData(‘#ff‘, data, ‘en.‘); $(‘#modelImg‘).attr(‘src‘, ‘<s:url value="/upload/"></s:url>‘ + data.modelImg); }, [‘png‘, ‘jpeg‘, ‘jpg‘]); </script> </div></div> 多张图片
时间: 2024-10-25 00:19:54