| | |
| | | <Property></Property> |
| | | <Property name="label">备注</Property> |
| | | </PropertyDef> |
| | | <Reference name="fileData"> |
| | | <Property name="dataProvider">sys.fileManager#listFile</Property> |
| | | <Property name="dataType">[dtFileData]</Property> |
| | | <Property name="parameter">$${this.id}</Property> |
| | | </Reference> |
| | | </DataType> |
| | | <DataType name="dtParam"> |
| | | <PropertyDef name="name"> |
| | |
| | | <View layout="padding:5;regionPadding:5"> |
| | | <ClientEvent name="onReady">
 |
| | | view.get("#dsParam").insert({});
 |
| | | 
 |
| | | addMain = function(){
 |
| | | view.get("#dsMain").insert({
 |
| | | });
 |
| | | view.get("#dsMain").insert({});
 |
| | | view.get("#dialogMain").show();
 |
| | | }
 |
| | | //附件下载
 |
| | | downLodFile = function(){
 |
| | | var entity = view.get("#dgFiles").getCurrentItem();
 |
| | | view.get("#downloadFile").set("parameter",{
 |
| | | fileId:entity.get("fileId"),
 |
| | | fileName:entity.get("fileName"),
 |
| | | createTime:entity.get("createTime")
 |
| | | }).execute();
 |
| | | }
 |
| | | 
 |
| | | 
 |
| | | //删除附件
 |
| | | delFile = function(){
 |
| | | var entity = view.get("#dgFiles").getCurrentItem();
 |
| | | view.get("#ajaxDelFile").set("parameter",{
 |
| | | fileId:entity.get("fileId"),
 |
| | | fileName:entity.get("fileName"),
 |
| | | createTime:entity.get("createTime")
 |
| | | }).execute(function(result){
 |
| | | if(result){
 |
| | | $alert(result);
 |
| | | }else{
 |
| | | entity.remove();
 |
| | | $alert("删除成功!");
 |
| | | }
 |
| | | });
 |
| | | }</ClientEvent> |
| | | <Property name="packages">font-awesome,css-common</Property> |
| | | <DataSet id="dsMain"> |
| | |
| | | </DataPilot> |
| | | </Container> |
| | | <Dialog id="dialogMain" layout="padding:5;regionPadding:10"> |
| | | <Property name="height">500</Property> |
| | | <Property name="width">85%</Property> |
| | | <Property name="caption">档案信息</Property> |
| | | <Property name="iconClass">fa fa-flag-o</Property> |
| | |
| | | </Button> |
| | | </Buttons> |
| | | <Children> |
| | | <AutoForm> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="cols">*,*,*</Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <Property name="labelAlign">right</Property> |
| | | <Property name="labelSeparator">:</Property> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">name</Property> |
| | | <Property name="property">name</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">code</Property> |
| | | <Property name="property">code</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">category</Property> |
| | | <Property name="property">category</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">year</Property> |
| | | <Property name="property">year</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">secLevel</Property> |
| | | <Property name="property">secLevel</Property> |
| | | <Property name="trigger">listSecLevel</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">location</Property> |
| | | <Property name="property">location</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">fileName</Property> |
| | | <Property name="property">fileName</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:3"> |
| | | <Property name="name">remark</Property> |
| | | <Property name="property">remark</Property> |
| | | <Property name="editorType">TextArea</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | </AutoForm> |
| | | <FieldSet layout="regionPadding:10"> |
| | | <Property name="caption">基础信息</Property> |
| | | <Buttons/> |
| | | <Children> |
| | | <AutoForm> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="cols">*,*,*</Property> |
| | | <Property name="labelWidth">100</Property> |
| | | <Property name="labelAlign">right</Property> |
| | | <Property name="labelSeparator">:</Property> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">name</Property> |
| | | <Property name="property">name</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">code</Property> |
| | | <Property name="property">code</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">category</Property> |
| | | <Property name="property">category</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">year</Property> |
| | | <Property name="property">year</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">secLevel</Property> |
| | | <Property name="property">secLevel</Property> |
| | | <Property name="trigger">listSecLevel</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:2"> |
| | | <Property name="name">location</Property> |
| | | <Property name="property">location</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">fileName</Property> |
| | | <Property name="property">fileName</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement layoutConstraint="colSpan:3"> |
| | | <Property name="name">remark</Property> |
| | | <Property name="property">remark</Property> |
| | | <Property name="editorType">TextArea</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | </AutoForm> |
| | | </Children> |
| | | </FieldSet> |
| | | <FieldSet layout="regionPadding:10"> |
| | | <Property name="caption">上传附件</Property> |
| | | <Property name="height">200</Property> |
| | | <Buttons> |
| | | <Button id="addFile"> |
| | | <Property name="caption">添加附件</Property> |
| | | <Property name="exClassName">btn-default</Property> |
| | | <Property name="iconClass">fa fa-cloud-upload</Property> |
| | | <Property name="action">uploadFile</Property> |
| | | </Button> |
| | | </Buttons> |
| | | <Children> |
| | | <DataGrid id="dgFiles"> |
| | | <ClientEvent name="onDataRowClick">view.get("#dgFiles").set("selection",arg.data);</ClientEvent> |
| | | <Property name="dataPath">#.fileData</Property> |
| | | <Property name="dataSet">dsMain</Property> |
| | | <Property name="readOnly">true</Property> |
| | | <Property name="selectionMode">singleRow</Property> |
| | | <RowNumColumn/> |
| | | <RowSelectorColumn/> |
| | | <DataColumn name="fileName"> |
| | | <Property name="property">fileName</Property> |
| | | </DataColumn> |
| | | <DataColumn name="createTime"> |
| | | <Property name="property">createTime</Property> |
| | | <Property name="align">center</Property> |
| | | </DataColumn> |
| | | <DataColumn name="fileId"> |
| | | <ClientEvent name="onRenderCell">arg.dom.innerHTML = "<a href='javascript:;' onClick='downLodFile()'>下载</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:;' onClick='delFile()'>删除</a>";
 |
| | | </ClientEvent> |
| | | <Property name="property">fileId</Property> |
| | | <Property name="align">center</Property> |
| | | <Property name="caption">操作</Property> |
| | | <Property name="readOnly">true</Property> |
| | | <Property name="width">90</Property> |
| | | </DataColumn> |
| | | </DataGrid> |
| | | <UploadAction id="uploadFile"> |
| | | <ClientEvent name="onFileUploaded">var files = view.get("#dsMain.data:#").get("fileData");
 |
| | | if(files.entityCount>=1){
 |
| | | $alert("只能上传一个附件")
 |
| | | return;
 |
| | | }else{
 |
| | | //附件上传完成后添加业务数据
 |
| | | var mainData = view.get("#dsMain.data:#");
 |
| | | var fileId = arg.returnValue;
 |
| | | var files = view.get("#dsMain.data:#").get("fileData");
 |
| | | files.insert({fileId:fileId,fileName:arg.file.name,createTime:new Date()});
 |
| | | }
 |
| | | </ClientEvent> |
| | | <Property name="fileResolver">applyOrderUploadProcessor#uploadApplyOrderFile</Property> |
| | | <Property name="maxFileSize">50MB</Property> |
| | | <Property name="successMessage">附件上传成功!!</Property> |
| | | <Filters/> |
| | | </UploadAction> |
| | | <DownloadAction id="downloadFile"> |
| | | <Property name="caption">下载附件</Property> |
| | | <Property name="fileProvider">applyOrderUploadProcessor#downloadApplyOrderFile</Property> |
| | | <Property name="successMessage">附件下载成功!</Property> |
| | | </DownloadAction> |
| | | <AjaxAction id="ajaxDelFile"> |
| | | <Property name="confirmMessage">确定要删除么?</Property> |
| | | <Property name="service">applyOrderUploadProcessor#delFile</Property> |
| | | </AjaxAction> |
| | | </Children> |
| | | </FieldSet> |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |