jiazx0107@163.com
2023-08-12 a673b25a0bc23b3b8b914088bdb7dca3d2e89d45
igds-manager/src/main/java/com/ld/igds/oa/view/Archives.view.xml
@@ -69,6 +69,11 @@
        <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">
@@ -93,11 +98,36 @@
  <View layout="padding:5;regionPadding:5">
    <ClientEvent name="onReady">&#xD;
view.get(&quot;#dsParam&quot;).insert({});&#xD;
&#xD;
addMain = function(){&#xD;
   view.get(&quot;#dsMain&quot;).insert({&#xD;
   });&#xD;
   view.get(&quot;#dsMain&quot;).insert({});&#xD;
   view.get(&quot;#dialogMain&quot;).show();&#xD;
}&#xD;
//附件下载&#xD;
downLodFile = function(){&#xD;
   var entity = view.get(&quot;#dgFiles&quot;).getCurrentItem();&#xD;
   view.get(&quot;#downloadFile&quot;).set(&quot;parameter&quot;,{&#xD;
      fileId:entity.get(&quot;fileId&quot;),&#xD;
      fileName:entity.get(&quot;fileName&quot;),&#xD;
      createTime:entity.get(&quot;createTime&quot;)&#xD;
   }).execute();&#xD;
}&#xD;
&#xD;
&#xD;
//删除附件&#xD;
delFile = function(){&#xD;
   var entity = view.get(&quot;#dgFiles&quot;).getCurrentItem();&#xD;
   view.get(&quot;#ajaxDelFile&quot;).set(&quot;parameter&quot;,{&#xD;
      fileId:entity.get(&quot;fileId&quot;),&#xD;
      fileName:entity.get(&quot;fileName&quot;),&#xD;
      createTime:entity.get(&quot;createTime&quot;)&#xD;
   }).execute(function(result){&#xD;
      if(result){&#xD;
         $alert(result);&#xD;
      }else{&#xD;
         entity.remove();&#xD;
         $alert(&quot;删除成功!&quot;);&#xD;
      }&#xD;
   });&#xD;
}</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
@@ -247,7 +277,6 @@
      </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>
@@ -275,55 +304,127 @@
        </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(&quot;#dgFiles&quot;).set(&quot;selection&quot;,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 = &quot;&lt;a href='javascript:;' onClick='downLodFile()'>下载&lt;/a>&amp;nbsp;&amp;nbsp;|&amp;nbsp;&amp;nbsp;&lt;a href='javascript:;' onClick='delFile()'>删除&lt;/a>&quot;;&#xD;
</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(&quot;#dsMain.data:#&quot;).get(&quot;fileData&quot;);&#xD;
if(files.entityCount>=1){&#xD;
   $alert(&quot;只能上传一个附件&quot;)&#xD;
   return;&#xD;
}else{&#xD;
   //附件上传完成后添加业务数据&#xD;
var mainData = view.get(&quot;#dsMain.data:#&quot;);&#xD;
var fileId = arg.returnValue;&#xD;
var files = view.get(&quot;#dsMain.data:#&quot;).get(&quot;fileData&quot;);&#xD;
files.insert({fileId:fileId,fileName:arg.file.name,createTime:new Date()});&#xD;
}&#xD;
</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>