{"hidden":false,"children":[{"configs":{"itemId":"module"},"expanded":true,"children":[{"configs":{"layout":"absolute","itemId":"viewport1","width":"552","height":"144"},"expanded":true,"children":[{"configs":{"itemId":"text1","labelAlign":"right","fieldLabel":"打开文件：","width":"408","x":"8","y":"8","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"itemId":"openBtn","width":"88","x":"424","y":"8","text":"选择","height":"22"},"expanded":false,"children":[],"type":"button","events":{"click":"Wb.promptFile(function(file, win) {\n  //var fileScope=this;\n  app.text1.setValue(file);\n}, {\n  file: app.text1.getValue(), //用于设置文件对话框路径\n  forceSelection: true\n});"}},{"configs":{"itemId":"text2","labelAlign":"right","fieldLabel":"保存文件","width":"408","x":"8","y":"40","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"itemId":"saveBtn","width":"88","x":"424","y":"40","text":"选择","height":"22"},"expanded":false,"children":[],"type":"button","events":{"click":"Wb.promptFile(function(file, win) {\n  app.text2.setValue(file);\n}, {\n  extName: '.jpg',\n  file: app.text2.getValue() //用于设置文件对话框路径\n});"}},{"configs":{"itemId":"text3","labelAlign":"right","fieldLabel":"打开多个文件：","width":"408","x":"8","y":"72","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"itemId":"openMultiBtn","width":"88","x":"424","y":"72","text":"选择","height":"22"},"expanded":false,"children":[],"type":"button","events":{"click":"Wb.promptFile(function(files, win) {\n  app.text3.setValue(files.join(';'));\n}, {\n  multiSelect: true,\n  file: app.text3.getValue().split(';')[0] //用于设置文件对话框路径\n});"}},{"configs":{"itemId":"text4","labelAlign":"right","fieldLabel":"多选项","width":"408","x":"8","y":"104","height":"22"},"expanded":false,"children":[],"type":"text"},{"configs":{"itemId":"optionsBtn","width":"88","x":"424","y":"104","text":"选择","height":"22"},"expanded":false,"children":[],"type":"button","events":{"click":"Wb.promptFile(function(file, win) {\n  if (!Ext.String.endsWith(file, '.doc') && !Ext.String.endsWith(file, '.docx')) {\n    Wb.warn('请选择一个doc或docx格式的文件。');\n    return;\n  }\n  app.text4.setValue(file);\n  win.close();\n}, {\n  file: app.text4.getValue(), //用于设置文件对话框路径\n  title: '选择Word文件',\n  autoClose: false,\n  show: function(scope) {\n    scope.win.setIconCls('file_doc_icon');\n  },\n  hide: function(scope) {\n    scope.win.setIconCls('explorer_icon');\n  }\n});"}}],"type":"viewport"}],"type":"module"}],"roles":{"demo":1},"title":"文件对话框","iconCls":"","inframe":false,"pageLink":""}