Ver Fonte

运营中心界面调整

zhuth há 7 anos atrás
pai
commit
d1494df570

+ 0 - 3
frontend/operation-web/app/view/core/List.js

@@ -1,6 +1,3 @@
-/**
- * 用户访问日志
- */
 Ext.define('saas.view.core.List', {
     extend: 'Ext.grid.Panel',
     xtype: 'corelist',

+ 248 - 0
frontend/operation-web/app/view/core/base/BasePanel.js

@@ -0,0 +1,248 @@
+Ext.define('saas.view.core.base.BasePanel', {
+    extend: 'Ext.form.Panel',
+    xtype: 'core-base-basepanel',
+    
+    controller: 'core-base-basepanel',
+    viewModel: 'core-base-basepanel',
+
+    cls:'core-base-basepanel',
+
+    //基础属性
+    frame:false,
+    autoScroll: true,
+    border: 0,
+    bodyPadding: 0,
+    layout: 'fit',
+    
+    fieldDefaults: {
+        margin: '0 5 5 0',
+        labelAlign: 'right',
+        labelWidth: 90,
+        columnWidth: 0.25,
+        blankText: '该字段不能为空'
+    },
+    
+    searchField:[],
+    gridColumns: [],
+
+    deleteMoreMsg: '确认删除所选单据?',
+    deleteOneMsg: '确认删除该单据?',
+
+    initComponent: function() {
+
+        var me = this,
+        gridConfig = me.gridConfig,
+        gridColumns = Ext.Array.clone(gridConfig.columns);
+
+        var gridcfg = {
+            layout: 'fit',
+            xtype: 'core-base-gridpanel',
+            padding: '8 12',
+            _columns: gridColumns.map(function(c) {
+                return Object.assign({}, c);
+            }),
+        };
+        Ext.apply(gridcfg ,me.gridConfig);
+
+        Ext.apply(me, {
+            dockedItems: [{
+                frame:false,
+                xtype: 'toolbar',
+                dock: 'top',
+                layout: 'column',
+                style: {
+                    margin: '0 0 12px 0',
+                    padding: '10px 0 14px 8px',
+                },
+                items: me.searchField.concat([{
+                    xtype: 'button',
+                    text: '查询',
+                    handler: function() {
+                        me.onQuery()
+                    }
+                }])
+            }],
+            items: [gridcfg]
+        });
+        me.callParent(arguments);
+    },
+    listeners: {
+        beforerender: function(form) {
+            var items = form.dockedItems.items[0].items.items,
+            searchField = form.searchField;
+
+            Ext.Array.each(searchField, function(f) {
+                var name = f.name;
+                var field = form.getForm().findField(name);
+
+                if(field) {
+                    field.enableKeyEvents = true;
+                    field.on && field.on({
+                        keydown: {
+                            fn: function(th, e, eOpts) {
+                                if(e.keyCode == 13) {
+                                    form.onQuery()
+                                }
+                            }
+                        }
+                    });
+                }
+            });
+        }
+    },
+
+    onQuery: function() {
+        var me = this;
+        var grid = me.down('core-base-gridpanel');
+        
+        grid.store.loadPage(1);
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getConditions: function() {
+        var me = this;
+        var items = me.dockedItems.items[0].items.items;
+        var conditions = [];
+
+        for(let i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+            func = item.getCondition,
+            value = item.value,
+            condition;
+
+            if(value&&value!=''){
+                if(typeof func == 'function') {
+                    condition = {
+                        type: 'condition',
+                        value: func(value)
+                    }
+                }else {
+                    var type = item.fieldType || me.getDefaultFieldType(item),
+                    operation = item.operation || me.getDefaultFieldOperation(item),
+                    conditionValue = me.getConditionValue(item, value);
+        
+                    if(!conditionValue) {
+                        continue;
+                    }
+                    condition = {
+                        type: type,
+                        field: field,
+                        operation: operation,
+                        value: conditionValue
+                    }
+                }
+                conditions.push(condition);
+            }
+        }
+
+        return conditions;
+    },
+
+    /**
+     * 只要arr1和arr2中存在相同项即返回真
+     */
+    isContainsAny: function (arr1, arr2) {
+        for (var i = 0; i < arr2.length; i++) {
+            var a2 = arr2[i];
+            if (!!arr1.find(function (a1) {
+                    return a1 == a2
+                })) {
+                return true;
+            }
+        }
+        return false;
+    },
+
+    getDefaultFieldType: function (field) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            type;
+
+        if (me.isContainsAny(xtypes, ['numberfield'])) {
+            type = 'number';
+        } else if (me.isContainsAny(xtypes, ['datefield', 'condatefield', 'conmonthfield'])) {
+            type = 'date';
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            type = 'enum';
+        } else if (me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
+            type = 'enum';
+        } else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function (field) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            operation;
+
+        if (me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
+            operation = '=';
+        } else if (me.isContainsAny(xtypes, ['condatefield', 'conmonthfield'])) {
+            operation = 'between';
+        } else if (me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
+            operation = 'in';
+        } else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function (field, value) {
+        var me = this,
+            xtypes = field.getXTypes().split('/'),
+            conditionValue;
+        if (me.isContainsAny(xtypes, ['datefield'])) {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        } else if (me.isContainsAny(xtypes, ['conmonthfield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = from + ',' + to;
+        } else if (me.isContainsAny(xtypes, ['condatefield'])) {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        } else if (me.isContainsAny(xtypes, ['dbfindtrigger'])) {
+            conditionValue = value;
+        } else if (me.isContainsAny(xtypes, ['combobox', 'combo'])) {
+            conditionValue = '\'' + value + '\'';
+        } else if (me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function (v) {
+                return '\'' + v.value + '\'';
+            }).join(',') : '';
+        } else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    getExtraParams: function(store, op, condition) {
+        return {
+            number: store.exportNumber?store.exportNumber:op._page,
+            size: store.exportPageSize?store.exportPageSize:store.pageSize,
+            condition: JSON.stringify(condition)
+        };
+    },
+
+    refresh: function () {
+        this.items.items[0].store.load()
+    },
+
+    refreshViewConfig: function() {
+        var me = this;
+        var grid = me.items.items[0];
+        grid.refreshColumns();
+    }
+});

+ 97 - 0
frontend/operation-web/app/view/core/base/BasePanel.scss

@@ -0,0 +1,97 @@
+.core-base-basepanel{
+    background: $panel-body-background;
+
+    .x-panel-default-outer-border-trl {
+        border-top-color: #fff !important;
+        border-top-width: 1px !important;
+        border-right-color: #fff !important;
+        border-right-width: 1px !important;
+        border-left-color: #fff !important;
+        border-left-width: 1px !important;
+    }
+    .x-panel-default-outer-border-rbl {
+        border-top-color: #fff !important;
+        border-top-width: 1px !important;
+        border-right-color: #fff !important;
+        border-right-width: 1px !important;
+        border-left-color: #fff !important;
+        border-left-width: 1px !important;
+        border-bottom-color: #fff !important;
+        border-bottom-width: 1px !important;
+    }
+    .x-btn-menu-active{
+        .x-btn-wrap{
+            .x-btn-button{
+                .x-btn-inner{
+                    color:#fff;
+                }
+            }
+        }
+    }
+}
+.core-base-gridpanel{
+    .x-grid-body{
+        border:1px solid #abdaff !important;
+        border-top-width: 0 !important;
+    }
+    .x-grid-header-ct{
+        border:1px solid #abdaff !important;
+    }
+}
+.x-basepanel-pagingtoolbar{
+    padding: 6px 0 5px 8px;
+    border:1px solid #abdaff !important;
+    border-top-width: 0 !important;
+}
+
+.x-btn-import-middle:after{
+    content: ' ';
+    display: block;
+    width: 0;
+    height: 0;
+    border-style: solid;
+    border-width: 15px 0 16px 18px;
+    border-color: transparent transparent transparent #34baf6;
+    position: absolute;
+    left: 0;
+    top: 0;
+}
+
+.x-btn-import-middle-next:after{
+    content: ' ';
+    display: block;
+    width: 0;
+    height: 0;
+    border-style: solid;
+    border-width: 15px 0 16px 18px;
+    border-color: transparent transparent transparent #fff;
+    position: absolute;
+    left: 0;
+    top: 0;
+}
+
+.x-btn-import-first{
+    .x-btn-wrap{
+        .x-btn-button{
+          .x-btn-inner{
+            color:#fff !important
+          }
+        }
+    }
+}
+
+.x-btn-import-last{
+    .x-btn-wrap{
+        .x-btn-button{
+          .x-btn-inner{
+            color:#34baf6 !important
+          }
+        }
+    }
+}
+
+.x-btn-import-last{
+    .x-btn.x-btn-disabled.x-btn-default-toolbar-small .x-btn-inner-default-toolbar-small {
+        color: #34baf6;
+    }
+}

+ 47 - 0
frontend/operation-web/app/view/core/base/BasePanelController.js

@@ -0,0 +1,47 @@
+Ext.define('saas.view.core.base.BasePanelController', {
+    extend: 'Ext.app.ViewController',
+    alias: 'controller.core-base-basepanel',
+
+    add: function(){
+        var form = this.getView();
+        var id = form.xtype + '_add';
+        saas.util.BaseUtil.openTab(form.xtype,'新增' + form._title,id);
+    },
+
+    onColSetting: function() {
+        var me = this,
+        panel = me.getView(),
+        viewName = panel.viewName,
+        columns = panel.defaultColumns,
+        items = [];
+
+        for(let i = 0; i < columns.length; i++) {
+            let col = columns[i];
+            if(!col.initHidden) {
+                items.push(Object.assign({}, col));
+            }
+        }
+
+        me.openSettingWindow(viewName, items, 'columns');
+    },
+
+    openSettingWindow: function(viewName, items, settype) {
+        var panel = saas.util.BaseUtil.getCurrentTab(),
+        box = panel.getBox(),
+        refs = panel.getReferences() || {},
+        win = refs.settingwin;
+
+        title = '列设置';
+
+        if(!win) {
+            win = panel.add({
+                title: title,
+                xtype: 'settingwin',
+                viewName: viewName,
+                fieldItems: Ext.Array.clone(items),
+                settype: settype,
+            });
+        }
+        win.show();
+    }
+});

+ 8 - 0
frontend/operation-web/app/view/core/base/BasePanelModel.js

@@ -0,0 +1,8 @@
+Ext.define('saas.view.core.base.BasePanelModel', {
+    extend: 'Ext.app.ViewModel',
+    alias: 'viewmodel.core-base-basepanel',
+
+    data: {
+        configurable: true
+    }
+});

+ 224 - 0
frontend/operation-web/app/view/core/base/GridPanel.js

@@ -0,0 +1,224 @@
+Ext.define('saas.view.core.base.GridPanel', {
+    extend: 'Ext.grid.Panel',
+    xtype: 'core-base-gridpanel',
+
+    requires: [
+        'Ext.grid.plugin.Exporter'
+    ],
+    plugins: [{
+        ptype: 'gridexporter',
+    }, {
+        ptype: 'menuclipboard'
+    }],
+
+    cls:'core-base-gridpanel',
+    
+    dataUrl: '',
+    dbSearchFields: [],
+    condition:'',
+    rootProperty: 'data.list',
+    totalProperty: 'data.total',
+
+    flexColumn: [{
+        flex: 1,
+        dataIndex:'',
+        initHidden: true,
+        allowBlank: true
+    }],
+
+
+    initComponent: function() {
+        var me = this;
+        me.frame = false;
+        if(me._columns){
+            var fields = me._columns.map(column => column.dataIndex);
+
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 10,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: me.rootProperty,
+                        totalProperty: me.totalProperty,
+                    },
+                    listeners: {
+                        exception: function(proxy, response, operation, eOpts) {
+                            if(operation.success) {
+                                if(response.timedout) {
+                                    saas.util.BaseUtil.showErrorToast('请求超时');
+                                }
+                            }else {
+                                console.error('exception: ', response);
+                                saas.util.BaseUtil.showErrorToast('查询失败:' + (response.responseJson?response.responseJson.message:'请求超时'));
+                            }
+                        }
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var basePanel = me.up('core-base-basepanel');
+                        var condition = basePanel.getConditions();
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+
+                        var obj = basePanel.getExtraParams(store, op, condition);
+                        Ext.apply(store.proxy.extraParams, obj);
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    cls:'x-basepanel-pagingtoolbar',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+        me.refreshColumns();
+    },
+
+    listeners:{
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            gridBodyBox = grid.body.dom.getBoundingClientRect(),
+            gridBodyBoxHeight = gridBodyBox.height;//可能有滚动条
+            var pageSize = Math.floor(gridBodyBoxHeight / 33);
+            store.setPageSize(pageSize);
+        }
+    },
+
+    refreshColumns: function() {
+        var me = this,
+        basePanel = me.up('core-base-basepanel');
+        me.reconfigure(me.store, Ext.Array.merge(Ext.Array.clone(basePanel.gridConfig.columns), me.flexColumn));
+        me.applyScrollable(true)
+    },
+
+    onLoad:function(){
+        this.ownerCt.ownerCt.store.load();
+    },
+
+    onImport:function(){
+        var grid = this.ownerCt.ownerCt;
+        var form = grid.ownerCt,panelEl = form.getEl();
+        var box = panelEl.getBox();
+        var height = box.height;
+        var width = box.width;
+        var win = form.add(Ext.create('saas.view.core.base.ImportWindow', {  
+            cls:'x-window-dbfind', 
+            belong:form,  
+            modal:true,
+            height: height * 0.8,
+            width: width * 0.8,
+            title: form._title + '导入',
+            scrollable: true,
+            bodyPadding: 10,
+            constrain: true,
+            closable: true,
+            layout:'fit',
+            renderTo:form.getEl()
+        }));
+        win.show();
+    },
+
+    onExport:function(me){
+        var grid = me.ownerCt.ownerCt;
+        //导出接口权限设置
+        var url = '/api/commons/'+grid.ownerCt.caller+'/export';
+        saas.util.BaseUtil.request({
+            url: url,
+            params: '',
+            method: 'GET',
+        })
+        .then(function(localJson) {
+            if(localJson.success){
+                grid.store.exportPageSize = 5000;
+                grid.store.exportNumber = 1;
+                grid.store.load(function(records, operation, success) {
+                    grid.saveDocumentAs({
+                        type: 'xlsx',
+                        title: grid.ownerCt._title + '列表',
+                        fileName: grid.ownerCt._title + '列表'+Ext.Date.format(new Date(),'Y-m-d_H-i-s')+'.xlsx'
+                    });
+                    grid.store.exportPageSize = null;
+                    grid.store.exportNumber = null;
+                    grid.store.load(function(records, operation, success) {
+                    });
+                });
+            }
+        })
+        .catch(function(e) {
+            saas.util.BaseUtil.showErrorToast('导出失败: ' + e.message);
+        });
+    },
+
+    onVastDeal:function(url,type){
+        var form = this.ownerCt;
+        var grid = this;
+        var data = grid.getGridSelected(type);
+        if(!data){
+            saas.util.BaseUtil.showErrorToast('请勾选符合条件的行进行操作。');
+            return false;
+        }
+        if(data&&data.length>0){
+            var params = JSON.stringify({baseDTOs:data});
+            saas.util.BaseUtil.request({
+                url: url,
+                params: params,
+                method: 'POST',
+                async:false
+            })
+            .then(function() {
+                saas.util.BaseUtil.showSuccessToast('操作成功');
+                grid.store.load();
+                grid.selModel.deselectAll();
+            })
+            .catch(function(e) {
+                saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
+            });
+        }else{
+            saas.util.BaseUtil.showErrorToast('请勾选至少一条明细');
+        }
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+        items = me.selModel.getSelection(),
+        data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+		return data;
+    },
+});

+ 309 - 0
frontend/operation-web/app/view/core/base/ImportWindow.js

@@ -0,0 +1,309 @@
+Ext.define('saas.view.core.base.ImportWindow', {
+    extend: 'Ext.window.Window',
+    xtype: 'importwindow',
+    layout:'fit',
+
+    requires: [
+        'Ext.form.field.File',
+        'Ext.container.ButtonGroup'
+    ],
+
+    bbar:['->',{
+        hidden:true,
+        name:'prev',
+        text:'上一步',
+        handler:function(b){
+            var p = this.ownerCt.ownerCt.items.items[0];
+            var tbar = p.dockedItems.items[0];
+            //first
+            var first = tbar.down('[name=first]').el.dom;
+            first.classList.add('x-btn-import-first');
+            first.style.background = '#34baf6';
+            first.childNodes[0].childNodes[0].childNodes[1].style.color = '#fff';
+            //middle
+            var middle = tbar.down('[name=middle]').el.dom;
+            middle.classList.add('x-btn-import-middle');
+            middle.classList.remove('x-btn-import-middle-next');
+            middle.style.background = '#fff';
+            //last
+            var last = tbar.down('[name=last]').el.dom;
+            last.classList.add('x-btn-import-last');
+            last.style.background = '#fff';
+            last.childNodes[0].childNodes[0].childNodes[1].style.color = '#34baf6';
+            //按钮逻辑
+            b.hide();
+            b.ownerCt.down('[name=next]').show();
+            b.ownerCt.down('[name=over]').hide();
+            //字段逻辑
+            p.down('[name=download]').show();
+            p.down('[name=upload]').hide();
+            p.down('[name=detail]').show();
+            p.down('[name=message]').hide();
+        }
+    },{
+        name:'next',
+        text:'下一步',
+        handler:function(b){
+            var p = this.ownerCt.ownerCt.items.items[0];
+            var tbar = p.dockedItems.items[0];
+            //first
+            var first = tbar.down('[name=first]').el.dom;
+            first.classList.remove('x-btn-import-first');
+            first.style.background = '#fff';
+            first.childNodes[0].childNodes[0].childNodes[1].style.color = '#34baf6';
+            //middle
+            var middle = tbar.down('[name=middle]').el.dom;
+            middle.classList.remove('x-btn-import-middle');
+            middle.classList.add('x-btn-import-middle-next');
+            middle.style.background = '#34baf6';
+            //last
+            var last = tbar.down('[name=last]').el.dom;
+            last.classList.remove('x-btn-import-last');
+            last.style.background = '#34baf6';
+            last.childNodes[0].childNodes[0].childNodes[1].style.color = '#fff';
+            //按钮逻辑
+            b.hide();
+            b.ownerCt.down('[name=prev]').show();
+            b.ownerCt.down('[name=over]').show();
+            //字段逻辑
+            p.down('[name=download]').hide();
+            p.down('[name=upload]').show();
+            p.down('[name=detail]').hide();
+            p.down('[name=message]').show();
+        }
+    },{
+        hidden:true,
+        name:'over',
+        text:'完成',
+        disabled:true,
+        handler:function(b){
+            var form = b.ownerCt.ownerCt;
+            var id = form.importId;
+            if(id){
+                form.setLoading(true);
+                Ext.Ajax.request({
+                    url: '/api/document/'+form.ownerCt.caller.toLocaleLowerCase()+'/saveToFormal',//这里是填写需要跨域访问的URL
+                    method: 'post',
+                    headers: {
+                        'Access-Control-Allow-Origin': '*',
+                        'Authorization':  saas.util.State.get('session').token,
+                        "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
+                    },
+                    params:{
+                        id:id,
+                        update:false
+                    },
+                    success: function (response, opts) {
+                        form.setLoading(false);
+                        var res = Ext.decode(response.responseText);
+                        if(!res.success){
+                            var upload = form.down('[name=upload]');
+                            upload.reset();
+                            form.dockedItems.items[1].down('[name=over]').setDisabled(true);
+                            form.down('[name=messagedetail]').setHtml(res.message + '</br></br><span style="color:#ff0000">请修改后重新上传</span>');
+                        }else{
+                            //刷新界面
+                            var g = form.ownerCt.down('grid');
+                            g.store.loadPage(g.store.currentPage);
+                            form.close();
+                        }
+                    },
+                    failure: function (response, opts) {
+                        form.setLoading(false);
+                        var upload = form.down('[name=upload]');
+                        upload.reset();
+                        form.dockedItems.items[1].down('[name=over]').setDisabled(true);
+                        var res = Ext.decode(response.responseText);
+                        saas.util.BaseUtil.showErrorToast('导入数据失败: ' + res.message);
+                        
+                    }
+                });
+            }else{
+                form.close();
+            }
+        }
+    },{
+        name:'close',
+        text:'关闭',
+        handler:function(b){
+            b.ownerCt.ownerCt.close()
+        }
+    }],
+
+    initComponent: function() {
+        var me = this;
+        Ext.apply(me, {
+            items:[{
+                cls:'x-panel-import',
+                padding:'10px 100px 10px 100px',
+                xtype:'panel',
+                layout:'vbox',
+                tbar:['->',{
+                    name:'first',
+                    cls:'x-btn-import-first',
+                    style:'background: #34baf6;border-color: #35baf6;    opacity: 1;',
+                    focusable:false,
+                    disabled:true,
+                    width:300,
+                    text:'下载模板并填写',
+                },{
+                    name:'middle',
+                    disabled:true,
+                    focusable:false,
+                    style:'width: 20px;margin: 0px;margin-left: -16px;border-width: 1px 0px;min-width: 0px;border-style: solid;border-color: rgb(53, 186, 246);    opacity: 1;    background-color: #fff;',
+                    width:20,
+                    cls:'x-btn-import-middle'
+                },{
+                    name:'last',
+                    disabled:true,
+                    cls:'x-btn-import-last',
+                    style:'border-left-width: 0px;background: #fff;border-color: #35baf6;opacity:1;background-color: #fff;',
+                    focusable:false,
+                    margin:'0 0 0 -1',
+                    width:300,
+                    text:'上传导入文件',
+                },'->'],
+                items:[{
+                    margin:'15px 0 0 0',
+                    width: 240,
+                    labelWidth:160,
+                    buttonOnly:true,
+                    fieldLabel:'导入模板下载',
+                    name:'download',
+                    xtype: 'filefield',
+                    buttonText: '下载模板',
+                    buttonConfig:{
+                        xtype:'button',
+                        handler:function(b){
+                            var caller = b.ownerCt.ownerCt.ownerCt.ownerCt.caller;
+                            //获取模版
+                            var serverOptions = Ext.manifest.server;
+                            window.location.href = (serverOptions.basePath.https?serverOptions.basePath.https:serverOptions.basePath) + '/api/commons/excel/import/templet?caller='+caller;
+                        }
+                    }
+                },{
+                    margin:'10px 0 0 45px',
+                    xtype: 'fieldset',
+                    title: '导入说明',
+                    name:'detail',
+                    collapsible: false,
+                    items: [{
+                        xtype : 'fieldcontainer',
+                        html: '1.下载模板后打开</br>2.查看模板内说明、并修改模板内容,保存后点击下一步按钮</br>3.上传Excel文件,此时会校验文件的字段格式,有问题则需要修改错误数据后再次上传文件</br>4.校验成功后'+
+                        '点击完成按钮将数据进行数据库校验'
+                    }]
+                },{
+                    hidden:true,
+                    margin:'15px 0 0 0',
+                    labelWidth:100,
+                    allowBlank : true, 
+                    width:180,
+                    buttonOnly:true,
+                    fieldLabel:'上传文件',
+                    xtype: 'filefield',
+                    name:'upload',
+                    buttonText: '选择文件',
+                    createFileInput : function() {
+                            var me = this;
+                            me.fileInputEl = me.button.el.createChild({
+                            name: me.getName(),
+                            cls: Ext.baseCSSPrefix + 'form-file-input',
+                            tag: 'input',
+                            type: 'file',
+                            size: 1
+                        }).on('change', me.onFileChange, me);
+                    },
+                    listeners: {
+                        change: function(field){
+                            var form = field.ownerCt.ownerCt;
+                            var myForm = field.ownerCt;
+                            var fileEl = field.fileInputEl.dom;
+                            var file = fileEl.files[0];
+                            var type = file.name.substring(file.name.lastIndexOf('.'),file.name.length);
+                            if(type.indexOf('xlsx')<0||type.indexOf('xls')<0){
+                                saas.util.BaseUtil.showErrorToast('文件格式不正确,只能选择xlsx或xls格式的文件进行上传');
+                                field.reset();
+                                return;
+                            }
+
+                            //导入权限校验
+                            var hasPower = false;
+                            Ext.Ajax.request({
+                                url: '/api/commons/'+form.ownerCt.caller+'/import',
+                                async:false,
+                                method: 'GET',
+                                success: function(response, opts) {
+                                    var data = Ext.decode(response.responseText);
+                                    if(data.success){
+                                        hasPower = true
+                                    }
+                                },
+                                failure: function(response, opts) {}
+                            }); 
+                            if(!hasPower){
+                                saas.util.BaseUtil.showErrorToast('上传失败:没有 导入 权限');
+                                return false;
+                            }
+                            
+                            var fd = new FormData();
+                            fd.append('file', fileEl.files[0]);
+                            fd.append('caller', myForm.ownerCt.ownerCt.caller);
+                            form.setLoading(true);
+                            Ext.Ajax.request({
+                                url: '/api/commons/excel/import/parse',//这里是填写需要跨域访问的URL
+                                cors: true,
+                                useDefaultXhrHeader: false,
+                                method: 'post',
+                                rawData: fd,
+                                headers: {
+                                    'Access-Control-Allow-Origin': '*',
+                                    'Authorization':  saas.util.State.get('session').token,
+                                    //"Content-Type": 'multipart/form-data'  //文件上传的格式, 
+                                    "Content-Type":null
+                                },
+                                success: function (response, opts) {
+                                    form.setLoading(false);
+                                    var res = Ext.decode(response.responseText);
+                                    if(res.success){
+                                        var id = res.data;
+                                        if(id){
+                                            field.ownerCt.down('[name=messagedetail]').setHtml('文件名: ' + file.name + ' 导入格式校验成功!</br></br>请点击 <span style="color:#35baf6">完成</span> 执行数据库校验');
+                                            form.importId = id;
+                                            field.ownerCt.ownerCt.dockedItems.items[1].down('[name=over]').setDisabled(false)
+                                        }else{
+                                            field.reset();
+                                            saas.util.BaseUtil.showErrorToast('上传失败:后台未返回信息');
+                                        }
+                                    }else{
+                                        field.reset();
+                                        field.ownerCt.down('[name=messagedetail]').setHtml(res.message + '</br><span style="color:#ff0000">请修改后重新上传</span>');
+                                    }
+                                },
+                                failure: function (response, opts) {
+                                    form.setLoading(false);
+                                    field.reset();
+                                    var res = Ext.decode(response.responseText);
+                                    saas.util.BaseUtil.showErrorToast('上传失败: ' + res.message);
+                                }
+                            });
+                        }
+                    }
+                },{
+                    hidden:true,
+                    margin:'10px 0 0 45px',
+                    xtype: 'fieldset',
+                    title: '导入详情',
+                    name:'message',
+                    collapsible: false,
+                    items: [{
+                        name:'messagedetail',
+                        xtype : 'fieldcontainer',
+                        html:'暂无导入信息'
+                    }]
+                }]
+            }]
+        });
+        me.callParent(arguments);
+    }
+
+});

+ 268 - 0
frontend/operation-web/app/view/core/form/field/ConDateField.js

@@ -0,0 +1,268 @@
+/**
+ * Created by UAS30 on 2018/10/11.
+ */
+Ext.define('saas.view.core.form.field.ConDateField', {
+    extend: 'Ext.form.FieldContainer',
+    alias: 'widget.condatefield',
+    layout: 'hbox',
+    valuePrint:"",
+    ombineErrors: true,
+    items: [],
+    showscope: true,
+    defaults: {
+        margin: '0 0 0 0'
+    },
+    columnWidth: 0.5,
+    defaultBindProperty: 'value',
+
+    cls: 'x-condatefield',
+
+    initComponent : function(){
+        this.cls = (this.cls || '') + ' x-form-field-multi';
+        this.callParent(arguments);
+        var me = this, allowBlank = (Ext.isDefined(me.allowBlank) ? me.allowBlank : true);
+        me.combo = Ext.create('Ext.form.field.ComboBox', {
+            width: 100,
+            editable: false,
+            hidden: !me.showscope,
+            fieldStyle: 'background:#eef1f7',
+            store: Ext.create('Ext.data.Store', {
+                fields: ['display', 'value'],
+                data : [
+                    {"display":"本月", "value": 1},
+                    {"display":"上个月", "value": 2},
+                    {"display":"近三月", "value": 3},
+                    {"display":"近半年", "value": 4},
+                    {"display":"本年度", "value": 5},
+                    {"display":"上年度", "value": 6},
+                    {"display":"自定义", "value": 7}
+                ]
+            }),
+            triggerAction: 'all',
+            forceSelection: true,
+            queryMode: 'local',
+            displayField: 'display',
+            valueField: 'value',
+            emptyText: '请选择',
+            listeners: {
+                select: function(combo, records, obj){
+                    me.setDateFieldValue(combo.value);
+                }
+            }
+        });
+        me.insert(0, me.combo);
+        me.from = me.insert(1, {
+            xtype: 'datefield',
+            name: me.name + '_from',
+            format: 'Y-m-d',
+            formatText: '',
+            allowBlank: allowBlank,
+            flex: 1,
+            editable:false,
+            fieldStyle: me.fieldStyle,
+            emptyText: '起始时间',
+            //matchFieldWidth:true,
+            listeners: {
+                change: function(f){
+                    var from =me.from.value,to = me.to.value;
+                    var v = me.items.items[0].value;
+                    if(v != 7) {
+                        me.to.setMinValue(me.from.value);
+                    }
+                    from = from == null || from == '' ? to == null || to == '' ? '' : to : from;
+                    to = to == null || to == '' ? from == null || from == '' ? '' : from : to;
+                    me.firstVal = from;
+                    me.secondVal = to;
+                    if(to!=''&&from!=''){
+                        me.value = "BETWEEN to_date('" + Ext.Date.format(from,'Y-m-d') + " 00:00:00','yyyy-MM-dd HH24:mi:ss') AND to_date('"
+                            + Ext.Date.format(to,'Y-m-d') + " 23:59:59','yyyy-MM-dd HH24:mi:ss')";
+                        if(me.ownerCt){
+                            var tablename = me.ownerCt.tablename;
+                            me.valuePrint="{"+tablename+"."+me.name+"}>=date('"+Ext.Date.format(from,'Y-m-d')+"') and {"+tablename+"."+me.name+"}<=date('"+Ext.Date.format(to,'Y-m-d')+"')";
+                        }
+                    }else {
+                        me.value=null;
+                    }
+                    me.setBindValue(v, from, to);
+                }
+            }
+        });
+        me.to = me.insert(2, {
+            xtype: 'datefield',
+            name: me.name + '_to',
+            allowBlank: allowBlank,
+            format: 'Y-m-d',
+            formatText: '',
+            flex: 1,
+            editable:false,
+            fieldStyle: me.fieldStyle,
+            emptyText: '结束时间',
+            listeners: {
+                change: function(){
+                    var from = me.from.value, to =me.to.value;
+                    var v = me.items.items[0].value;
+                    me.from.setMaxValue(me.to.value);
+                    from = from == null || from == '' ? to == null || to == '' ? '' : to : from;
+                    to = to == null || to == '' ? from == null || from == '' ? '' : from : to;
+                    me.firstVal = from;
+                    me.secondVal = to;
+                    if(to!=''&& from!=''){
+                        me.value = "BETWEEN to_date('" + Ext.Date.format(from,'Y-m-d') + " 00:00:00','yyyy-MM-dd HH24:mi:ss') AND to_date('"
+                            + Ext.Date.format(to,'Y-m-d') + " 23:59:59','yyyy-MM-dd HH24:mi:ss')";
+                        if(me.ownerCt){
+                            var tablename = me.ownerCt.tablename;
+                            me.valuePrint = "{"+tablename+"."+me.name+"}>=date('"+Ext.Date.format(from,'Y-m-d')+"') and {"+tablename+"."+me.name+"}<=date('"+Ext.Date.format(to,'Y-m-d')+"')";
+                        }
+                    }else {
+                        me.value=null;
+                    }
+                    me.setBindValue(v, from, to);
+                }
+            }
+        });
+        var t = this.value;
+        if(!t || !t in [1,2,3,4,5,6,7]) {
+            t = 1;
+        }
+        this.value = null;
+        this.setInitValue(t);
+    },
+    setDateFieldValue: function(v){
+        v = Number(v);
+        var me = this,from =me.from ,to=me.to;
+        var now = new Date();                    //当前日期
+        var nowDay = now.getDate();              //当前日
+        var nowMonth = now.getMonth();           //当前月
+        var nowYear = now.getYear();             //当前年
+        nowYear += (nowYear < 2000) ? 1900 : 0;
+        var maxDate = null;
+        var minDate = null;
+        switch (v) {
+            case 1://本月
+                minDate = Ext.Date.getFirstDateOfMonth(now);
+                maxDate = Ext.Date.getLastDateOfMonth(now);
+                break;
+            case 2://上个月
+                if(nowMonth == 0) {
+                    minDate = Ext.Date.getFirstDateOfMonth(new Date(nowYear - 1, 11, 1));
+                    maxDate = Ext.Date.getLastDateOfMonth(new Date(nowYear - 1, 11, 1));
+                }else {
+                    minDate = Ext.Date.getFirstDateOfMonth(new Date(nowYear, nowMonth - 1, 1));
+                    maxDate = Ext.Date.getLastDateOfMonth(new Date(nowYear, nowMonth - 1, 1));
+                }
+                break;
+            case 3: {//近三个月
+                if(nowMonth < 2) {
+                    minDate = Ext.Date.getFirstDateOfMonth(new Date(nowYear - 1, nowMonth + 12 - 2, 1));
+                }else {
+                    minDate = Ext.Date.getFirstDateOfMonth(new Date(nowYear, nowMonth - 2, 1));
+                }
+                maxDate = now;
+                break;
+            }
+            case 4: {//近半年
+                if(nowMonth < 5) {
+                    minDate = Ext.Date.getFirstDateOfMonth(new Date(nowYear - 1, nowMonth + 12 - 5, 1));
+                }else {
+                    minDate = Ext.Date.getFirstDateOfMonth(new Date(nowYear, nowMonth - 5, 1));
+                }
+                maxDate = now;
+                break;
+            }
+            case 5://本年度
+                minDate = new Date(nowYear, 0, 1);
+                maxDate = new Date(nowYear, 11, 31);
+                break;
+            case 6://上年度
+                minDate = new Date(nowYear - 1, 0, 1);
+                maxDate = new Date(nowYear - 1, 11, 31);
+                break;
+            case 7://自定义
+                minDate = new Date(1970, 0, 1);
+                maxDate = new Date(nowYear + 100, 11, 31);
+                break;
+            default:
+                minDate = new Date(1970, 0, 1);
+                maxDate = new Date(nowYear + 100, 11, 31);
+                break;
+        }
+        from.setMaxValue(maxDate);
+        from.setMinValue(minDate);
+        to.setMaxValue(maxDate);
+        to.setMinValue(minDate);
+        if(v == 7) {
+            from.setValue(null);
+            to.setValue(null);
+            me.firstVal = null;
+            me.secondVal = null;
+            //from.setEditable(true);
+            //to.setEditable(true);
+        } else {
+            from.setValue(minDate);
+            to.setValue(maxDate);
+            me.firstVal = minDate;
+            me.secondVal = maxDate;
+            from.setEditable(false);
+            to.setEditable(false);
+        }
+        me.setBindValue(v, minDate, maxDate);
+    },
+    setInitValue: function(v) {
+        if (v) {
+            this.combo.setValue(v);
+            this.setDateFieldValue(v);
+        }
+    },
+    setBindValue: function(v, from, to){
+        this.value = {
+            type: v,
+            from: from,
+            to: to
+        };
+        this.publishState('value', this.value);
+    },
+    setValue: function(v) {
+        this.value = v;
+    },
+    getValue: function(){
+        return this.value;
+    },
+    listeners: {
+        afterrender: function(){
+            var tablename = this.ownerCt == null ? '' : this.ownerCt.tablename;
+            if(this.firstVal != null && this.secondVal != null) {
+                this.valuePrint = "{"+tablename+"."+this.name+"}>=date('"+Ext.Date.toString(this.firstVal)+"') and {"
+                    +tablename+"."+this.name+"}<=date('"+Ext.Date.toString(this.secondVal)+"')";
+            }
+        }
+    },
+    hideScope: function(bool) {
+        if(bool)
+            this.items.items[0].hide();
+        else
+            this.items.items[0].show();
+    },
+    mregex: /^[1-9]\d{3}[0-1]\d$/,
+    setMonthValue: function(val) {
+        if(this.mregex.test(val)) {
+            var me = this,
+                d = Ext.Date.parse(val + '01', 'Ymd'),
+                f = Ext.Date.getFirstDateOfMonth(d),
+                l = Ext.Date.getLastDateOfMonth(d);
+            var from =me.from,to=me.to;
+            from.setMaxValue(l);
+            from.setMinValue(f);
+            to.setMaxValue(l);
+            to.setMinValue(f);
+            from.setValue(f);
+            to.setValue(l);
+        }
+    },
+    getFilter: function() {
+        var me = this, fromVal = me.from.getValue(), toVal = me.to.getValue();
+        return (fromVal || toVal) ? {
+            "gte": fromVal ? Ext.Date.format(fromVal, 'Y-m-d') : null,
+            "lte": toVal ? Ext.Date.format(toVal, 'Y-m-d') : null
+        } : null;
+    }
+});

+ 26 - 0
frontend/operation-web/app/view/core/form/field/ConDateField.scss

@@ -0,0 +1,26 @@
+.x-condatefield {
+    .x-field {
+        background: #fff;
+    }
+
+    .x-field:first-child {
+        .x-form-trigger-wrap-default {
+            border-top-right-radius: 0;
+            border-bottom-right-radius: 0;
+        }
+    }
+    .x-field:nth-child(2) {
+        .x-form-trigger-wrap-default {
+            border-radius: 0;
+            border-left: 0;
+            border-right: 0;
+        }
+    }
+    .x-field:last-child {
+        .x-form-trigger-wrap-default {
+            border-top-left-radius: 0;
+            border-bottom-left-radius: 0;
+        }
+    }
+
+}

+ 70 - 59
frontend/operation-web/app/view/cuservice/Feedback.js

@@ -2,68 +2,79 @@
  * 在线反馈
  */
 Ext.define('saas.view.cuservice.Feedback', {
-    extend: 'saas.view.core.List',
+    extend: 'saas.view.core.base.BasePanel',
     xtype: 'cuservice-feedback',
 
-    viewModel: 'cuservice',
+    initComponent: function () {
+        Ext.apply(this, {
+            searchField: [{
+                xtype: "textfield",
+                name: "cf_name",
+                width: 300,
+                emptyText: '反馈人/反馈内容',
+                getCondition: function (v) {
+                    return "(upper(CONCAT(cf_name, '#', cf_content) like '%" + v.toUpperCase() + "%' ))";
+                },
+            }, {
+                xtype: 'condatefield',
+                name: 'cf_creatime',
+                columnWidth: 0.4
+            }],
 
-    cls: 'x-infocardlist',
-
-    id: 'feedback',
-
-    border: 1,
-
-    columns: [{
-        text: 'id',
-        dataIndex: 'cf_id',
-        hidden: true
-    }, {
-        text: '反馈人',
-        dataIndex: 'cf_name',
-        width: 120
-    }, {
-        text: '反馈时间',
-        dataIndex: 'cf_creatime',
-        width: 180,
-        renderer: function(v, m, r) {
-            return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
-        }
-    }, {
-        text: '反馈内容',
-        width: 250,
-        dataIndex: 'cf_content'
-    }, {
-        text: '状态',
-        dataIndex: 'cf_status',
-        width: 80
-    }, {
-        text: '企业id',
-        dataIndex: 'cf_companyid',
-        hidden: true
-    }, {
-        text: '企业名',
-        dataIndex: 'cf_company',
-        width: 120
-    }, {
-        text: '联系电话',
-        dataIndex: 'cf_mobile',
-        width: 120
-    }, {
-        text: 'QQ',
-        dataIndex: 'cf_qq',
-        width: 120
-    }, {
-        text: '微信',
-        dataIndex: 'cf_wechat',
-        width: 120
-    }, {
-        text: '备注',
-        dataIndex: 'cf_remark',
-        width: 250
-    }],
-
-    bind: {
-        store: '{feedback}'
+            gridConfig: {
+                // dataUrl: '/api/operation/customerFeedBack/list',
+                dataUrl: 'http://10.1.80.35:9040/customerFeedBack/list',
+                columns: [{
+                    text: 'id',
+                    dataIndex: 'cf_id',
+                    hidden: true
+                }, {
+                    text: '反馈人',
+                    dataIndex: 'cf_name',
+                    width: 120
+                }, {
+                    text: '反馈时间',
+                    dataIndex: 'cf_creatime',
+                    width: 180,
+                    renderer: function(v, m, r) {
+                        return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
+                    }
+                }, {
+                    text: '反馈内容',
+                    width: 250,
+                    dataIndex: 'cf_content'
+                }, {
+                    text: '状态',
+                    dataIndex: 'cf_status',
+                    width: 80
+                }, {
+                    text: '企业id',
+                    dataIndex: 'cf_companyid',
+                    hidden: true
+                }, {
+                    text: '企业名',
+                    dataIndex: 'cf_company',
+                    width: 120
+                }, {
+                    text: '联系电话',
+                    dataIndex: 'cf_mobile',
+                    width: 120
+                }, {
+                    text: 'QQ',
+                    dataIndex: 'cf_qq',
+                    width: 120
+                }, {
+                    text: '微信',
+                    dataIndex: 'cf_wechat',
+                    width: 120
+                }, {
+                    text: '备注',
+                    dataIndex: 'cf_remark',
+                    width: 250
+                }]
+            },
+        });
+        this.callParent(arguments);
     }
 
 });

+ 0 - 25
frontend/operation-web/app/view/cuservice/Models.js

@@ -1,25 +0,0 @@
-Ext.define('saas.view.cuservice.Models', {
-    extend: 'Ext.app.ViewModel',
-    alias: 'viewmodel.cuservice',
-
-    stores: {
-        feedback: {
-            model: 'saas.model.cuservice.Feedback',
-            autoLoad: true,
-            proxy: {
-                type: 'ajax',
-                // url: 'http://10.1.80.33:9040/customerFeedBack/list',
-                url: '/api/operation/customerFeedBack/list',
-                timeout: 8000,
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data.list',
-                    totalProperty: 'data.total',
-                }
-            }
-        }
-    }
-});

+ 57 - 27
frontend/operation-web/app/view/statistical/CompanyAnalysis.js

@@ -2,35 +2,65 @@
  * 企业分析
  */
 Ext.define('saas.view.statistical.CompanyAnalysis', {
-    extend: 'saas.view.core.List',
+    extend: 'saas.view.core.base.BasePanel',
     xtype: 'statistical-companyanalysis',
 
-    columns: [{
-        text: '企业名称',
-        dataIndex: 'name'
-    }, {
-        text: '企业地址',
-        dataIndex: 'address'
-    }, {
-        text: '管理员',
-        dataIndex: 'administrator'
-    }, {
-        text: '注册时间',
-        dataIndex: 'registeTime'
-    }, {
-        text: '最近操作时间',
-        dataIndex: 'lastTime'
-    }, {
-        text: '目前阶段',
-        dataIndex: 'step'
-    }, {
-        text: '使用状态',
-        dataIndex: 'status'
-    }],
+    initComponent: function () {
+        Ext.apply(this, {
+            searchField: [{
+                xtype: "textfield",
+                name: "ca_company",
+                emptyText: '企业名称'
+            }, {
+                xtype: 'textfield',
+                name: 'ca_admin',
+                emptyText: '管理员'
+            }],
 
-    store: Ext.create('Ext.data.Store', {
-        fields: ['name', 'address', 'administrator', 'registeTime', 'lastTime', 'step', 'status'],
-        data: [],
-    })
+            gridConfig: {
+                // dataUrl: '/api/operation/data/getCompany',
+                dataUrl: 'http://10.1.80.35:9040/data/getConpanyAnalyze',
+                columns: [{
+                    text: 'ID',
+                    dataIndex: 'ca_id',
+                    hidden: true
+                }, {
+                    text: '企业ID',
+                    dataIndex: 'ca_companyid',
+                    hidden: true
+                }, {
+                    text: '企业名称',
+                    dataIndex: 'ca_company',
+                    width: 200
+                }, {
+                    text: '企业地址',
+                    dataIndex: 'ca_address',
+                    width: 200
+                }, {
+                    text: '管理员',
+                    dataIndex: 'ca_admin'
+                }, {
+                    text: '注册时间',
+                    dataIndex: 'ca_createtime',
+                    xtype: 'datecolumn',
+                    format: 'Y-m-d H:i:s',
+                    width: 150
+                }, {
+                    text: '最近操作时间',
+                    dataIndex: 'ca_newestlogtime',
+                    xtype: 'datecolumn',
+                    format: 'Y-m-d H:i:s',
+                    width: 150
+                }, {
+                    text: '目前阶段',
+                    dataIndex: 'ca_phase'
+                }, {
+                    text: '使用状态',
+                    dataIndex: 'ca_status'
+                }]
+            },
+        });
+        this.callParent(arguments);
+    }
 
 });

+ 0 - 57
frontend/operation-web/app/view/statistical/CompanyInfo.js

@@ -1,57 +0,0 @@
-/**
- * 企业注册数据
- */
-Ext.define('saas.view.statistical.CompanyInfo', {
-    extend: 'saas.view.core.List',
-    xtype: 'statistical-companyinfo',
-
-    viewModel: 'statistical',
-
-    id: 'companyinfo',
-    columns: [{
-        text: '注册时间',
-        dataIndex: 'create_time',
-        width: 180,
-        xtype: 'datecolumn',
-        renderer: function(v, m, r) {
-            return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
-        }
-    }, {
-        text: '企业编号',
-        width: 200,
-        dataIndex: 'business_code'
-    }, {
-        text: '企业名称',
-        width: 200,
-        dataIndex: 'name'
-    }, {
-        text: 'UU号',
-        width: 120,
-        dataIndex: 'uu'
-    }, {
-        text: '企业地址',
-        width: 250,
-        dataIndex: 'address'
-    }, {
-        text: '电话',
-        width: 120,
-        dataIndex: 'tel'
-    }, {
-        text: '传真',
-        width: 150,
-        dataIndex: 'fax'
-    }, {
-        text: '管理员',
-        width: 100,
-        dataIndex: 'realname'
-    }, {
-        text: '联系方式',
-        width: 150,
-        dataIndex: 'mobile'
-    }],
-
-    bind: {
-        store: '{companyinfo}'
-    }
-
-});

+ 69 - 0
frontend/operation-web/app/view/statistical/CompanyRegInfo.js

@@ -0,0 +1,69 @@
+/**
+ * 企业注册数据
+ */
+Ext.define('saas.view.statistical.CompanyRegInfo', {
+    extend: 'saas.view.core.base.BasePanel',
+    xtype: 'statistical-companyreginfo',
+
+    initComponent: function () {
+        Ext.apply(this, {
+            searchField: [{
+                xtype: "textfield",
+                name: "name",
+                emptyText: '企业名称'
+            }, {
+                xtype: 'textfield',
+                name: 'realname',
+                emptyText: '管理员'
+            }],
+
+            gridConfig: {
+                // dataUrl: '/api/operation/data/getCompany',
+                dataUrl: 'http://10.1.80.35:9040/data/getCompany',
+                columns: [{
+                    text: '注册时间',
+                    dataIndex: 'create_time',
+                    width: 180,
+                    xtype: 'datecolumn',
+                    renderer: function(v, m, r) {
+                        return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
+                    }
+                }, {
+                    text: '企业编号',
+                    width: 200,
+                    dataIndex: 'business_code'
+                }, {
+                    text: '企业名称',
+                    width: 200,
+                    dataIndex: 'name'
+                }, {
+                    text: 'UU号',
+                    width: 120,
+                    dataIndex: 'uu'
+                }, {
+                    text: '企业地址',
+                    width: 250,
+                    dataIndex: 'address'
+                }, {
+                    text: '电话',
+                    width: 120,
+                    dataIndex: 'tel'
+                }, {
+                    text: '传真',
+                    width: 150,
+                    dataIndex: 'fax'
+                }, {
+                    text: '管理员',
+                    width: 100,
+                    dataIndex: 'realname'
+                }, {
+                    text: '联系方式',
+                    width: 150,
+                    dataIndex: 'mobile'
+                }]
+            },
+        });
+        this.callParent(arguments);
+    }
+
+});

+ 42 - 31
frontend/operation-web/app/view/statistical/LoginLog.js

@@ -2,40 +2,51 @@
  * 登录日志
  */
 Ext.define('saas.view.statistical.LoginLog', {
-    extend: 'saas.view.core.List',
+    extend: 'saas.view.core.base.BasePanel',
     xtype: 'statistical-loginlog',
 
-    viewModel: 'statistical',
+    initComponent: function () {
+        Ext.apply(this, {
+            searchField: [{
+                xtype: "textfield",
+                name: "username",
+                emptyText: '用户名/手机号',
+                getCondition: function (v) {
+                    return "(upper(CONCAT(username, '#', mobile) like '%" + v.toUpperCase() + "%' )";
+                },
+            }],
 
-    id: 'loginlog',
-
-    columns: [{
-        text: 'id',
-        dataIndex: 'account_id',
-        hidden: true
-    }, {
-        text: '用户名',
-        dataIndex: 'username',
-        width: 120
-    }, {
-        text: '手机号',
-        dataIndex: 'mobile',
-        width: 120
-    }, {
-        text: '近三月登录次数',
-        dataIndex: 'login_num'
-    }, {
-        text: '最后登录时间',
-        dataIndex: 'lastesttime',
-        width: 180,
-        xtype: 'datecolumn',
-        renderer: function(v, m, r) {
-            return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
-        }
-    }],
-
-    bind: {
-        store: '{loginlog}'
+            gridConfig: {
+                // dataUrl: '/api/operation/data/getLogin',
+                dataUrl: 'http://10.1.80.35:9040/data/getLogin',
+                columns: [{
+                    text: 'id',
+                    dataIndex: 'account_id',
+                    hidden: true
+                }, {
+                    text: '用户名',
+                    dataIndex: 'username',
+                    width: 120
+                }, {
+                    text: '手机号',
+                    dataIndex: 'mobile',
+                    width: 120
+                }, {
+                    text: '近三月登录次数',
+                    dataIndex: 'login_num',
+                    width: 120
+                }, {
+                    text: '最后登录时间',
+                    dataIndex: 'lastesttime',
+                    width: 180,
+                    xtype: 'datecolumn',
+                    renderer: function(v, m, r) {
+                        return Ext.Date.format(new Date(v), 'Y-m-d H:i:s');
+                    }
+                }]
+            },
+        });
+        this.callParent(arguments);
     }
 
 });

+ 0 - 63
frontend/operation-web/app/view/statistical/Models.js

@@ -1,63 +0,0 @@
-Ext.define('saas.view.statistical.Models', {
-    extend: 'Ext.app.ViewModel',
-    alias: 'viewmodel.statistical',
-
-    stores: {
-        personinfo: {
-            model: 'saas.model.statistical.PersonInfo',
-            autoLoad: true,
-            proxy: {
-                type: 'ajax',
-                // url: 'http://10.1.80.33:9040/data/getAccount',
-                url: '/api/operation/data/getAccount',
-                timeout: 8000,
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data.list',
-                    totalProperty: 'data.total',
-                }
-            }
-        },
-
-        companyinfo: {
-            model: 'saas.model.statistical.CompanyInfo',
-            autoLoad: true,
-            proxy: {
-                type: 'ajax',
-                // url: 'http://10.1.80.33:9040/data/getCompany',
-                url: '/api/operation/data/getCompany',
-                timeout: 8000,
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data.list',
-                    totalProperty: 'data.total',
-                }
-            }
-        },
-
-        loginlog: {
-            model: 'saas.model.statistical.LoginLog',
-            autoLoad: true,
-            proxy: {
-                type: 'ajax',
-                // url: 'http://10.1.80.33:9040/data/getLogin',
-                url: '/api/operation/data/getLogin',
-                timeout: 8000,
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data.list',
-                    totalProperty: 'data.total',
-                },
-            }
-        },
-    }
-});

+ 0 - 64
frontend/operation-web/app/view/statistical/PersonInfo.js

@@ -1,64 +0,0 @@
-/**
- * 个人注册数据
- */
-Ext.define('saas.view.statistical.PersonInfo', {
-    extend: 'saas.view.core.List',
-    xtype: 'statistical-personinfo',
-
-    viewModel: 'statistical',
-
-    id: 'personinfo',
-
-    columns: [{
-        text: 'id',
-        dataIndex: 'id',
-        hidden: true
-    }, {
-        text: '账号',
-        dataIndex: 'username',
-        width: 120
-    }, {
-        text: '姓名',
-        dataIndex: 'realname',
-        width: 120
-    }, {
-        text: '邮箱',
-        dataIndex: 'email',
-        width: 180
-    }, {
-        text: '手机号',
-        dataIndex: 'mobile',
-        width: 120
-    }, {
-        text: '类型',
-        dataIndex: 'type',
-        width: 140,
-        renderer: function(v, m, r) {
-            return v == 1 ? '<span style="font-weight: bold;">管理员</span>' : '普通用户';
-        }
-    }, {
-        text: '状态',
-        dataIndex: 'enabled',
-        width: 80,
-        renderer: function(v, m, r) {
-            return v == true ? '<span style="color: #81CB31;">正常</span>' : '<span style="color: #DD6550;">禁用</span>';
-        }
-    }, {
-        text: '注册时间',
-        xtype: 'datecolumn',
-        dataIndex: 'createTime',
-        width: 180,
-        renderer: function(v, m, r) {
-            return Ext.Date.format(new Date(v), 'Y-m-d H:i:s'); 
-        }
-    }, {
-        text: 'UU号',
-        dataIndex: 'uu',
-        width: 120
-    }],
-
-    bind: {
-        store: '{personinfo}'
-    }
-
-});

+ 74 - 0
frontend/operation-web/app/view/statistical/PersonRegInfo.js

@@ -0,0 +1,74 @@
+/**
+ * 个人注册数据
+ */
+Ext.define('saas.view.statistical.PersonRegInfo', {
+    extend: 'saas.view.core.base.BasePanel',
+    xtype: 'statistical-personreginfo',
+
+    initComponent: function () {
+        Ext.apply(this, {
+            searchField: [{
+                xtype: "textfield",
+                name: "username",
+                emptyText: '用户名/手机号',
+                getCondition: function (v) {
+                    return "(upper(CONCAT(username, '#', mobile) like '%" + v.toUpperCase() + "%'))";
+                },
+            }],
+
+            gridConfig: {
+                // dataUrl: '/api/operation/data/getAccount',
+                dataUrl: 'http://10.1.80.35:9040/data/getAccount',
+                columns: [{
+                    text: 'id',
+                    dataIndex: 'id',
+                    hidden: true
+                }, {
+                    text: '账号',
+                    dataIndex: 'username',
+                    width: 120
+                }, {
+                    text: '姓名',
+                    dataIndex: 'realname',
+                    width: 120
+                }, {
+                    text: '邮箱',
+                    dataIndex: 'email',
+                    width: 180
+                }, {
+                    text: '手机号',
+                    dataIndex: 'mobile',
+                    width: 120
+                }, {
+                    text: '类型',
+                    dataIndex: 'type',
+                    width: 140,
+                    renderer: function(v, m, r) {
+                        return v == 1 ? '<span style="font-weight: bold;">管理员</span>' : '普通用户';
+                    }
+                }, {
+                    text: '状态',
+                    dataIndex: 'enabled',
+                    width: 80,
+                    renderer: function(v, m, r) {
+                        return v == true ? '<span style="color: #81CB31;">正常</span>' : '<span style="color: #DD6550;">禁用</span>';
+                    }
+                }, {
+                    text: '注册时间',
+                    xtype: 'datecolumn',
+                    dataIndex: 'createTime',
+                    width: 180,
+                    renderer: function(v, m, r) {
+                        return Ext.Date.format(new Date(v), 'Y-m-d H:i:s'); 
+                    }
+                }, {
+                    text: 'UU号',
+                    dataIndex: 'uu',
+                    width: 120
+                }]
+            },
+        });
+        this.callParent(arguments);
+    }
+
+});

+ 6 - 2
frontend/operation-web/resources/json/navigation.json

@@ -6,11 +6,11 @@
         "items": [{
             "id": "1",
             "text": "企业注册数据",
-            "viewType": "statistical-companyinfo"
+            "viewType": "statistical-companyreginfo"
         }, {
             "id": "2",
             "text": "个人注册数据",
-            "viewType": "statistical-personinfo"
+            "viewType": "statistical-personreginfo"
         }]
     }, {
         "text": "行为统计",
@@ -18,6 +18,10 @@
             "id": "4",
             "text": "用户访问日志",
             "viewType": "statistical-loginlog"
+        }, {
+            "id": "5",
+            "text": "企业分析",
+            "viewType": "statistical-companyanalysis"
         }]
     }]
 }, {