cloumn_define.lview 5.66 KB
Newer Older
18083's avatar
18083 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: luochenglong
    $Date: 2023-02-07 下午2:03:31
    $Revision: 1.0
    $Purpose: 结构化字段定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="cloumn_code_save_link" model="efile.EFILE1010.cloumn_code_query" modelaction="batch_update"/>
        <a:link id="cloumn_code_delete_link" model="efile.EFILE1010.cloumn_code_query" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[


        function cloumn_code_add() {
            var ds = $('cloumn_para_ds');
            var record = ds.create(ds.currentIndex);
            $('cloumn_para_ds_id').showEditorByRecord(record);

        }

        function cloumn_code_delete() {
            debugger;
            var ds = $('cloumn_para_ds');
            var records = ds.getSelected();
            if(records.length<=0){
                Leaf.showMessage('提示','请勾选数据进行删除!');
                return ;
            }
            var paras = [];
            var detail_mask = Ext.getBody();
            for(var n=0;n<records.length;n++){
                    records[n].set('_status', 'delete');
                    paras.push(records[n].data);
            }
            if (records.length != 0) {
                Leaf.showConfirm('${l:HLS.PROMPT}', '${l:HLS030.CONFIRM_DELETE}', function() {
                    Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                    Leaf.request({
                        url: $('cloumn_code_delete_link').getUrl(),
                        para: paras,
                        success: function(res) {
                            Leaf.showMessage('提示','删除成功',function(){
                                ds.query();
                            });
                            Leaf.Masker.unmask(detail_mask);
                        },
                        failure: function() {
                            Leaf.Masker.unmask(detail_mask);
                        },
                        error: function() {
                            Leaf.Masker.unmask(detail_mask);
                        },
                        scope: this
                    });
                });
            }

        }

        function cloumn_code_save() {
            debugger;
            var ds = $('cloumn_para_ds');
            var records=ds.getAll();
            var paras = [];
Luochenglong's avatar
Luochenglong committed
66
            var detail_mask = Ext.getBody();
18083's avatar
18083 committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
            var base_archive_id='${/parameter/@record_id}';
            console.log(base_archive_id);
            for(var n=0;n<records.length;n++){
                if(records[n].isNew){
                    records[n].set('_status', 'insert');
                }else{
                    records[n].set('_status', 'update');
                }
                records[n].set('base_archive_id', base_archive_id);
                paras.push(records[n].data);
            }
            console.log(paras);
            if (ds.validate()) {
                Leaf.Masker.mask(detail_mask, '${l:HLS.EXECUTING}');
                Leaf.request({
                    url: $('cloumn_code_save_link').getUrl(),
                    para: paras,
                    success: function(res) {
                        Leaf.showMessage('提示','保存成功',function(){
                            ds.query();
                        });
                        Leaf.Masker.unmask(detail_mask);
                    },
                    failure: function() {
                        Leaf.Masker.unmask(detail_mask);
                    },
                    error: function() {
                        Leaf.Masker.unmask(detail_mask);
                    },
                    scope: this
                });
            }


        }






          


        function update_checklength(ds, record, name, value, oldvalue) {

        }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="cloumn_para_ds" autoQuery="true" model="efile.EFILE1010.cloumn_code_query" queryUrl="${/request/@context_path}/autocrud/efile.EFILE1010.cloumn_code_query/query?base_archive_id=${/parameter/@record_id}" queryDataSet="for_query_ds" selectable="true">
                <a:fields>
                    <a:field name="cloumn_code" />
                    <a:field name="cloumn_name" />
                    <a:field name="base_archive_id" />
                </a:fields>
                <a:events>
                    <a:event name="update" handler="update_checklength"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="cloumn_code_add" text="新增"/>
                <a:gridButton click="cloumn_code_delete" text="删除"/>-
                <a:gridButton click="cloumn_code_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:grid id="cloumn_para_ds_id" bindTarget="cloumn_para_ds" height="300" width="380" navBar="true">
                <a:columns>
                    <a:column name="cloumn_code" editor="elec_text_ed" prompt="结构化字段code" width="170"/>
                    <a:column name="cloumn_name" editor="elec_text_ed" prompt="结构化字段描述" width="170"/>
                </a:columns>
                <a:editors>
                    <a:textField id="elec_text_ed"/>
                    <a:textField id="elec_text_ed_up" typeCase="upper"/>
                    <a:checkBox id="elec_checkbox_ed"/>
                    <a:lov id="elec_conBasicClauseParaDs_grid_lov"/>
                    <a:comboBox id="cloumn_code_comed"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>