<script lang='tsx'>
import { Vue, Component } from 'vue-property-decorator';
import { CreateElement } from 'vue';
import { Subject, Subscription } from 'rxjs';
import { UIActionTool,Util } from '@/utils';

/**
 * 应用菜单基类
 */
export default class CentralBase extends Vue {

    /**
     * 菜单点击
     *
     * @private
     * @param {*} item 菜单数据
     * @memberof Central
     */
    private click(item: any) {
        if (item) {
            switch (item.appfunctag) {
                case 'Auto8': 
                    this.clickAuto8(item);
                    return;
                case 'Auto13': 
                    this.clickAuto13(item);
                    return;
                case 'Auto9': 
                    this.clickAuto9(item);
                    return;
                case 'Auto12': 
                    this.clickAuto12(item);
                    return;
                case 'Auto2': 
                    this.clickAuto2(item);
                    return;
                case 'Auto3': 
                    this.clickAuto3(item);
                    return;
                case 'Auto6': 
                    this.clickAuto6(item);
                    return;
                case '_2': 
                    this.click_2(item);
                    return;
                case 'Auto11': 
                    this.clickAuto11(item);
                    return;
                case 'Auto14': 
                    this.clickAuto14(item);
                    return;
                case 'Auto10': 
                    this.clickAuto10(item);
                    return;
                case '_3': 
                    this.click_3(item);
                    return;
                case 'Auto1': 
                    this.clickAuto1(item);
                    return;
                case 'Auto7': 
                    this.clickAuto7(item);
                    return;
                case 'Auto4': 
                    this.clickAuto4(item);
                    return;
                case 'Auto5': 
                    this.clickAuto5(item);
                    return;
                default:
                    console.warn('未指定应用功能');
            }
        }
    }
    
    /**
     * 服务案例管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto8(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'incidents', parameterName: 'incident' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 目标管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto13(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'goals', parameterName: 'goal' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 活动管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto9(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'activitypointers', parameterName: 'activitypointer' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 竞争对手管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto12(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'competitors', parameterName: 'competitor' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 销售资料管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto2(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'salesliteratures', parameterName: 'salesliterature' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 订单管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto3(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'salesorders', parameterName: 'salesorder' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 发票管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto6(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'invoices', parameterName: 'invoice' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 市场活动
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public click_2(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'campaigns', parameterName: 'campaign' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 产品管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto11(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'products', parameterName: 'product' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 潜在客户管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto14(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'leads', parameterName: 'lead' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 商机管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto10(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'opportunities', parameterName: 'opportunity' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 首页仪表盘
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public click_3(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'centeralportal', parameterName: 'centeralportal' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 市场营销列表管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto1(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'ibizlists', parameterName: 'ibizlist' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 联系人管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto7(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'contacts', parameterName: 'contact' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 客户层级管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto4(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'accounts', parameterName: 'account' },
            { pathName: 'gradation', parameterName: 'gradation' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }
    
    /**
     * 报价单管理
     *
     * @param {*} [item={}]
     * @memberof Central
     */
    public clickAuto5(item: any = {}) {
        const viewparam: any = {};
        Object.assign(viewparam, {});
        const deResParameters: any[] = [];
        const parameters: any[] = [
            { pathName: 'quotes', parameterName: 'quote' },
            { pathName: 'gridview', parameterName: 'gridview' },
        ];
        const path: string = this.$viewTool.buildUpRoutePath(this.$route, {}, deResParameters, parameters, [], viewparam);
        this.$router.push(path);
    }

    /**
     * 绘制内容
     *
     * @private
     * @memberof Central
     */
    public render(): any {
        return <span style="display: none;"/>
    }

}
</script>