{"hidden":false,"children":[{"configs":{"serverScript":"var filename = app.get('filename'),\n  exportName = app.get('exportFilename') || filename,\n  sheetIndex = app.has('sheetIndex') ? app.getInt('sheetIndex') : -1,\n  excelFolder = new File(Base.path, 'wb/system/excel'),\n  file = new File(excelFolder, filename);\n\n//仅允许访问system/excel目录下的文件作为模板\nif (!FileUtil.isAncestor(excelFolder, file))\n  SysUtil.accessDenied();\nexportName = FileUtil.getFilename(exportName);\nif (!exportName.toLowerCase().endsWith('.xlsx'))\n  exportName += '.xlsx';\nresponse.setHeader('content-type', 'application/force-download');\nresponse.setHeader('content-disposition', 'attachment;' + WebUtil.encodeFilename(request, exportName));\nWb.getExcel(new JSONObject(app.get('params')), file, response.getOutputStream(), sheetIndex);\nresponse.flushBuffer();","itemId":"module"},"expanded":false,"children":[],"type":"module"}],"roles":{"default":1,"basic":1,"demo":1},"title":"使用模板生成Excel","iconCls":"","inframe":false,"pageLink":""}