浏览代码

筛选方案代码提交

hy 6 年之前
父节点
当前提交
6cf15566b6

+ 6 - 1
app/Application.scss

@@ -35,7 +35,7 @@ $enable-font-awesome: dynamic(true);
 .x-datepicker-date {
   padding: 0 7px 0 0;
   cursor: pointer;
-  line-height: 23px;
+  line-height: 20px;
 }
 
 .x-datepicker-footer,
@@ -57,6 +57,11 @@ $enable-font-awesome: dynamic(true);
   margin: 0 5px 0 5px;
   line-height: 22px;
 }
+.x-datepicker2{
+  .x-monthpicker-item-inner {
+    line-height: 18px;
+  }
+}
 
 .x-monthpicker-months .x-monthpicker-item {
   width: 52px;

+ 37 - 12
app/view/grid/dataList/DataListPanel.js

@@ -7,7 +7,7 @@
 Ext.define('uas.view.grid.dataList.DataListPanel', {
     extend: 'Ext.grid.Panel',
     xtype: 'dataListPanel',
-    
+    dataUrl:'/api/searchPlanTree',
     plugins: {
         gridHeaderFilter: true
     },
@@ -33,7 +33,11 @@ Ext.define('uas.view.grid.dataList.DataListPanel', {
             })
         });
 
+        //加载筛选方案
+
         me.callParent(arguments);
+
+        me.getSearchPlan();
     },
 
     dockedItems: [{
@@ -51,7 +55,8 @@ Ext.define('uas.view.grid.dataList.DataListPanel', {
                     grid.searchPlanWindow = Ext.create('widget.searchPlanWindow',{
                         height:grid.getHeight()*0.8,
                         width:grid.getWidth()*0.8,
-                        renderTo:grid.getEl()
+                        renderTo:grid.getEl(),
+                        grid:grid
                     }).show();
                 }else{
                     grid.searchPlanWindow.show();
@@ -91,15 +96,6 @@ Ext.define('uas.view.grid.dataList.DataListPanel', {
         items:[{
             xtype:'displayfield',
             value:'查询方案:'
-        },{
-            xtype:'button',
-            text:'缺省方案'
-        },{
-            xtype:'button',
-            text:'新方案A'
-        },{
-            xtype:'button',
-            text:'新方案B'
         }]
     },{
         xtype: 'toolbar',
@@ -180,5 +176,34 @@ Ext.define('uas.view.grid.dataList.DataListPanel', {
         dataIndex: 'auditman',
         text: '审核人',
         width:70
-    }]
+    }],
+
+    getSearchPlan:function(){
+        const me = this;
+        Ext.Ajax.request({
+            url: me.dataUrl,
+            params: '',
+            method: 'GET',
+            async:false,
+            success: function(response, opts) {
+                var _data = Ext.decode(response.responseText);
+                if(_data&&_data.data){
+                    const searchPlan = me.down('[name=searchPlan]');
+                    let items = [];
+                    Ext.Array.each(_data.data,function(p){
+                        if(p.children&&p.children.length>0){
+                            Ext.Array.each(p.children,function(item){
+                                items.push({
+                                    text:item.text,
+                                    xtype:'button'
+                                })
+                            })
+                        }
+                    });
+                    searchPlan.add(items);
+                }
+            },
+            failure: function(response, opts) {}
+        }); 
+    }
 });

+ 7 - 0
app/view/grid/dataList/DataListPanel.scss

@@ -91,4 +91,11 @@
         height: 20px;
         background: unset;
     }
+}
+.x-tab-searchPlanTab{
+    .x-tab-bar-horizontal > .x-tab-bar-body-default {
+        min-height: 33px;
+        height: 33px;
+        padding:0 !important;
+    }
 }

+ 2 - 1
app/view/plugins/gridHeaderFilter/GridHeaderFilter.js

@@ -122,6 +122,7 @@ Ext.define('uas.view.plugins.gridHeaderFilter.GridHeaderFilter', {
      * 为toolbar添加标签
      */
     addTips:function(column,filterToolbar,text){
+        const me = this;
         filterToolbar.add({
             iconCls:'x-btn-field-clear',
             xtype: 'button',
@@ -135,7 +136,7 @@ Ext.define('uas.view.plugins.gridHeaderFilter.GridHeaderFilter', {
                         }else{
                             column.filterContainer.input.setValue(null);
                         }
-                        filterToolbar.remove(btn);
+                        me.getHeaderFilter();
                 }
             }
         });

+ 1 - 1
app/view/plugins/gridHeaderFilter/field/date/DateTypePicker.js

@@ -266,7 +266,7 @@ Ext.define('uas.view.plugins.gridHeaderFilter.field.date.DateTypePicker', {
         //添加选中样式
         btn.addCls(selectCls);
         if(btn.text==='介于'){
-            datePicker2.showAt(XY[0],XY[1]+228)
+            datePicker2.showAt(XY[0],XY[1]+210)
             pickerField.onFocus();
             pickerField.focusEl.focus();
         }else{

+ 107 - 0
app/view/window/searchPlan/ConditionPanel.js

@@ -0,0 +1,107 @@
+Ext.define('uas.view.window.searchPlan.ConditionPanel', {
+    extend: 'Ext.panel.Panel',
+    alias: 'widget.conditionPanel',
+    xtype: 'conditionPanel',
+    cls: 'x-panel-conditionPanel',
+    layout:'column',
+    defaults: {
+        columnWidth:0.333,
+        margin:'0 0 0 15'
+    },
+    items:[{
+        xtype:'checkbox',
+        boxLabel: '基本信息',
+    },
+    {
+        xtype:'checkbox',
+        boxLabel: '高级信息',
+    },
+    {
+        xtype:'checkbox',
+        boxLabel: '财务信息',
+    },
+    {
+        xtype:'checkbox',
+        boxLabel: '辅助信息',
+    },
+    {
+        xtype:'checkbox',
+        boxLabel: '人员信息',
+    },
+    {
+        xtype:'checkbox',
+        boxLabel: '纳税信息',
+    },
+    {
+        xtype:'checkbox',
+        boxLabel: '供应商信息',
+    },{
+        margin:'0',
+        xtype:'tabpanel',
+        columnWidth:1,
+        tabBar: {
+            layout: {
+                pack: 'center'
+            }
+        },
+        style:'border-top:1px solid rgb(197, 197, 197)',
+        items:[{
+            name:'baseConditionGrid',
+            title:'基础设置',
+            xtype:'grid',
+            store:{
+                fields:['type','operate','field','value'],
+                data:[]
+            },
+            columns:[{
+                dataIndex:'field',
+                flex:1,
+                text:'字段'
+            },{
+                dataIndex:'operate',
+                width:100,
+                text:'过滤逻辑'
+            },{
+                dataIndex:'value',
+                width:160,
+                text:'关键词'
+            },{
+                xtype:'actioncolumn',
+                width:100,
+                text:'操作'
+            }],
+            refreshDate:function(grid){
+                const me = this;
+                if(grid.nowFilterCondition&&grid.nowFilterCondition.length>0){
+                    me.store.loadData(grid.nowFilterCondition,true)
+                }else{
+                    me.store.removeAll();
+                }
+            }
+        },{
+            title:'高级设置',
+            xtype:'grid',
+            columns:[{
+                width:60,
+                text:'括号'
+            },{
+                width:100,
+                text:'字段'
+            },{
+                width:80,
+                text:'逻辑'
+            },{
+                width:190,
+                text:'关键字'
+            },{
+                width:60,
+                text:'括号'
+            },{
+                width:60,
+                text:'连接'
+            }]
+        }]
+
+    }]
+    
+});

+ 10 - 12
app/view/grid/dataList/SearchPlanTree.js → app/view/window/searchPlan/TreePanel.js

@@ -1,6 +1,6 @@
-Ext.define('uas.view.grid.dataList.SearchPlanTree', {
+Ext.define('uas.view.window.searchPlan.TreePanel', {
     extend: 'Ext.tree.Panel',
-    xtype: 'searchPlanTree',
+    xtype: 'searchplan-treepanel',
     cls:'x-tree-searchPlanTree',
     requires: [
         'Ext.tree.plugin.TreeViewDragDrop',
@@ -9,16 +9,14 @@ Ext.define('uas.view.grid.dataList.SearchPlanTree', {
     dataUrl:'/api/searchPlanTree',
     rootVisible:false,
     useArrows: true,
-    width:260,
-    height:'100%',
 
-    viewConfig: {
-        plugins: {
-            treeviewdragdrop: {
-                containerScroll: true
-            }
-        }
-    },
+    // viewConfig: {
+    //     plugins: {
+    //         treeviewdragdrop: {
+    //             containerScroll: true
+    //         }
+    //     }
+    // },
 
     tbar: {
         reference: 'tbar',
@@ -59,7 +57,7 @@ Ext.define('uas.view.grid.dataList.SearchPlanTree', {
                 var _data = Ext.decode(response.responseText);
                 if(_data&&_data.data){
                     me.getStore().setRootNode({
-                        text: '角色列表',
+                        text: '筛选方案列表',
                         id: '0',
                         iconCls: 'x-fa fa-list',
                         expanded: true,

+ 18 - 5
app/view/grid/dataList/SearchPlanWindow.js → app/view/window/searchPlan/Window.js

@@ -1,4 +1,4 @@
-Ext.define('uas.view.grid.dataList.SearchPlanWindow', {
+Ext.define('uas.view.window.searchPlan.Window', {
     extend: 'Ext.window.Window',
     alias: 'widget.searchPlanWindow',
     xtype: 'searchPlanWindow',
@@ -6,29 +6,42 @@ Ext.define('uas.view.grid.dataList.SearchPlanWindow', {
     title: '筛选方案',
     scrollable: true,
     bodyPadding: 4,
+    resizable:false,
     constrain: true,
     modal: true,
     closable: true,
     layout: 'border',
     closeAction: 'hide',
     items:[{
+        width:260,
+        frame:true,
         region:'west',
-        xtype:'searchPlanTree'
+        xtype:'searchplan-treepanel'
     },{
-        plain: true,
+        margin:'0 0 0 1',
         xtype:'tabpanel',
+        cls:'x-tab-searchPlanTab',
         region:'center',
+        frame:true,
         tabBar: {
             layout: {
                 pack: 'center'
             }
         },
         items:[{
-            title:'条件设置'
+            title:'条件设置',
+            xtype:'conditionPanel'
         },{
             title:'排序设置'
         },{
             title:'列设置'
         }]
-    }]
+    }],
+    listeners:{
+        show:function(){
+            const me = this;
+            const baseConditionGrid = me.down("[name=baseConditionGrid]");
+            baseConditionGrid.refreshDate(me.grid);
+        }
+    }
 });