Windchill-Ext上传文件组件
1 function importExcel() { 2 PTC.navigation.loadScript("netmarkets/javascript/ext/ux/fileuploadfield/FileUploadField.js") 3 var win; 4 var uploadFilePanel = new Ext.FormPanel({ 5 id: 'uploadFilePanel', 6 fileUpload: true, 7 width: 500, 8 frame: true, 9 autoHeight: true, 10 bodyStyle: 'padding: 10px 10px 10px 10px;', 11 labelWidth: 50, 12 defaults: { 13 anchor: '95%', 14 allowBlank: false, 15 msgTarget: 'side' 16 }, 17 items: [{ 18 xtype: 'fileuploadfield', 19 id: 'form-file', 20 emptyText: '请选择文件', 21 fieldLabel: '文件', 22 buttonText: '选择文件' 23 24 } 25 ] 26 27 }); 28 29 if (!win) { 30 var processId = Ext.urlDecode(window.location.href).processid; 31 var actionDepart = Ext.urlDecode(window.location.href).actionDepart; 32 var pboId = Ext.urlDecode(window.location.href).pbo; 33 win = new Ext.Window({ 34 title: '上传Excel文件', 35 closable: true, 36 height: 140, 37 width: 500, 38 resizable: false, 39 //border:false, 40 plain: true, 41 layout: 'border', 42 modal: true, 43 items: [{ 44 xtype: 'panel', 45 region: 'center', 46 border: true, 47 bodyStyle: 'border-width:1px;border-style:solid;border-color:#000;', 48 defaults: { 49 autoScroll: false 50 }, 51 width: 500, 52 height: 140, 53 layout: 'fit', 54 rowspan: 2, 55 items: uploadFilePanel 56 } 57 ], 58 buttons: [{ 59 text: '保存', 60 handler: function () { 61 if (uploadFilePanel.getForm().isValid()) { 62 uploadFilePanel.getForm().submit({ 63 url: 'url',64 waitMsg: '文件上传中...', 65 success: function (fp, o) { 66 msg('上传成功', o.result.msg); 67 window.location.reload(); 68 }, 69 failure: function (fp, o) { 70 msg('上传失败', o.result.msg); 71 } 72 }); 73 } 74 } 75 }, { 76 text: '取消', 77 handler: function () { 78 uploadFilePanel.getForm().reset(); 79 win.close(); 80 } 81 } 82 ] 83 }); 84 } 85 win.show(this); 86 }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南