general_upload.lview 2.81 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="general_upload_excel_control_link" url="${/request/@context_path}/modules/sys/SYS999/general_excel_execute.lview"/>
6
        <script><![CDATA[
Spencer Chang's avatar
Spencer Chang committed
7 8 9 10 11 12 13
            function saveClick() {
                if (document.getElementById('general_importFile').value) {
                    var fileName = document.getElementById('general_importFile').value;
                    var fileType = fileName.substr(fileName.lastIndexOf("."));
                    if (fileType != '.xls' && fileType != '.xlsx') {
                        alert('请选择正确的导入文件!');
                    } else {
14 15
                        var detail_mask = $('upload_window').wrap;
                        Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
Spencer Chang's avatar
Spencer Chang committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
                        document.getElementById('general_importForm').submit();
                    }
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="csh713_label_ds" autoCreate="true">
                <a:fields>
                    <a:field name="label2" defaultValue="1、请严格按照导入模板整理数据,检查必输项是否缺失。"/>
                    <a:field name="label3" defaultValue="2、目前仅支持 MS Excel。"/>
                    <a:field name="label4" defaultValue="3、执行导入前,请先关闭Excel文件。"/>
                    <a:field name="label6" defaultValue="4、导入完毕后,请在系统中核对数据。"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:fieldSet style="margin-left:10px;margin-top:10px;" title="注意事项" width="400">
            <!--<a:label name="label1" bindTarget="label_ds" width="380"/>-->
            <a:label name="label2" bindTarget="csh713_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label3" bindTarget="csh713_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label4" bindTarget="csh713_label_ds" style="margin-left:10px;" width="380"/>
            <a:label name="label6" bindTarget="csh713_label_ds" style="margin-left:10px;" width="380"/>
        </a:fieldSet>
        <a:fieldSet style="margin-left:10px;margin-top:10px;" title="导入文件" width="400">
39
            <form name="upload" id="general_importForm" action="general_excel_execute.lview?_csrf=${/session/@_csrf.token}" enctype="multipart/form-data" method="post">
Spencer Chang's avatar
Spencer Chang committed
40 41 42 43 44 45
                <input name="CONTENT" id="general_importFile" style="margin-bottom:4px;width:250px;height:22px;" type="file"/>
                <input onclick="saveClick()" style="margin-left:10px;margin-top:10px;width:60px;" type="button" value="导入"/>
            </form>
        </a:fieldSet>
    </a:view>
</a:screen>