08335 / hivui-platform-template
hivui平台项目模板
Newer
Older
hivui-platform-template / project / setting / desktop / development.js
// var root = "http://e5.hieap.cn"
var root = "http://192.168.4.106:7778";
var server = "/e5";
var oauth = "/e5";
var projectName = "eap5csxm/admin"
var pName = projectName.split("/")[0];
var user = projectName.split("/")[1];
var deployDir = "";
//登录页url
var loginUrl = root + server + "/index.html?pn=" + pName + "/" + user;
//首页url
var mainPageUrl = root + server + "/main.html?pn=" + pName + "/" + user;
deployDir = "/e5/render";
serverName = server;
if (window._global && window._global.env == 'dev') {
    deployDir = ""
    serverName = ""
    //登录页url
    var loginUrl = location.origin + deployDir + "/" + pName + "/hivuiLogin/index.html#/";
    //首页url
    var mainPageUrl = location.origin + deployDir + "/" + pName + "/hivuiMain/index.html#/";
}

var _formatLang = function(str){
    return Vue.prototype.$t(str)
}
var HIVUI_SETTING = {
    //项目名
    projectName: projectName,
    //接口返回消息弹窗模式,默认为消息提示(自动消失),msgBox为消息弹窗(需手动确定关闭)
    //messageType:"msgBox",
    //请求对象
    request: eap.request,
    deployDir: deployDir,
    //服务器域名
    url: root,
    //编辑器脚本路径
    editorResDir: deployDir,
    serverName: serverName,
    //默认服务url
    serverUrl: root + server,
    //授权服务url
    oauth: root + oauth,
    //用户信息
    userInfo: root + server + "/sys/user/detail",
    //登录页url
    loginUrl: loginUrl,
    //首页url
    mainPageUrl: mainPageUrl,
    //系统管理url
    sysManageUrl: "http://192.168.4.193:5188",
    //数据保存url
    saveUrl: root + server + "/data/save", //'/data/save',
    //数据查询url
    queryUrl: root + server + "/data/query", //'/data/query',
    //excel导出心跳
    exportExcelHeartbeatUrl:root + server + "/export/dataexcel/status",
    //导入URL
    excelImportUrl: root + server + "/import/exceldata",
    //导出URL
    exportUrl: root + server + "/export/dataexcel",
    exportPathUrl:root + server + "/export/dataexcel/path",
    exportNewUrl:root + server + "/export/dataexcelnew",
    //页面初始化接口
    pageInitUrl: root + server + "/data/page/permit",
    //数据策略url
    policyUrl: root + server + "/data/policy",
    //附件上传url
    upload: root + server + "/file/upload",
    //附件下载url
    download: root + server + "/file/download",
    //附件查看url
    review: root + server + "/file/static/preview",
    //附件上传url
    publicupload: root + server +"/file/public/upload",
    //附件下载url
    publicdownload: root + server +"/file/public/download",
    //附件查看url
    publicreview: root + server +"/file/public/preview",
    //流程信息url
    getFlowInfo: root + server + "/flow/open",
    getApprovalInfo: root + server + "/flow/getApprovalInfo",
    processFlow: root + server + "/flow/processFlow",
    umpireOrder: root + server + "/flow/umpireOrder",
    queryTask: root + server + "/flow/queryTask",
    withdrawtask: root + server + "/flow/withdrawtask",
    taskDiagram: root + server + "/flow/taskDiagram",
    openOrdernumber: root + server + "/flow/openOrdernumber",
    //默认查询操作符
    queryOperate: 'like',
    //默认组件配置
    defaultCmp: {
        "DtTable": {
            "allColSort": true,
            "colWidthCount": false
        },
        "DtPushData": {
            //自动暂存
            // "wakeupTempData": true
        },
        "DtDataSet": {
            "autoTrim": true,
            //自动暂存
            // "autoTemporary": true,
            // "saveNewTemporary": false,
            // "temporaryTime": 10000

        },
        "DtToolbar": {
            "buttons": [
                {
                    "kind": "add",
                    // "text": "添加"
                },
                {
                    "kind": "del",
                    // "text": "删除"
                },
                {
                    "kind": "reset",
                    // "text": "取消"
                },
                {
                    "kind": "save",
                    // "text": "保存"
                }
            ]
        }
    },
    //数据返回超时时间
    requestTimeout: 140 * 1000,

    //是否单点登录
    isSingleLogin: false,
    //单点登录页
    singleLoginUrl: "http://192.168.10.241:31020/authcenter/login?service=",
    //单点登出页
    singleLogoutUrl: "http://192.168.10.241:31020/authcenter/logout?service=http://192.168.10.241:31020/authcenter/login?service=" + mainPageUrl,
    // 网格自定义高亮行背景色
    // curRowBg: '#2bdbe2',
}
window.__guid = new Date().valueOf();
//切换布局
function changeLayout(name) {
    window.localStorage.setItem('layout', name);
    window.location.reload();
}
//模板自定义配置
window.customSysCofig = {
    //默认门户   对应自定义门户功能
    sysSetTabs: [
        {
            title: _formatLang("taskcenter"),
            id: __guid++,
            close: false,
            url: '#taskCenter',
        },
        {
            title: _formatLang("mainpage"),
            id: __guid++,
            close: false,
            type: 'home',
            actived: true //默认选中
        }
        // ,{
        //     title:'工作台',
        //     id: __guid++,
        //     close:false,
        //     type:'work'
        // }
    ],
    //默认 打开功能
    sysDefTabs: [
        // {
        //   id: __guid++,
        //   title:"设计",
        //   url:'http://192.168.7.109:9090/#/design',
        //   close:true,
        // },
    ],
    //头部菜单
    sysFuncMenus: [
        /*
        {
            id: __guid++,
            name: '系统管理',
            url: window.HIVUI_SETTING.sysManageUrl + "/?pn=" + window.HIVUI_SETTING.projectName,
            iconClass: 'icon-set-fill',
            target: '_blank',
            type: 'widthToken',
        },
        {
            id: __guid++,
            name: '<font color=red>邮件系统</font>',
            url: 'http://hcmail.histron.cn:8001/webmail/index.do?osName=windows',
            iconClass: 'icon-mail',
            target: '_blank',
        },*/
        { type: 'split' },
        {
            id: __guid++,
            name: _formatLang("layout"),
            type: 'layout',
            iconClass: 'icon-user',
            children: [
                {
                    id: 'vertical',
                    name: _formatLang("updownlayout"),
                    handler: function () {
                        changeLayout(this.id)
                    }
                },
                {
                    id: 'level',
                    name: _formatLang("leftrightlayout"),
                    handler: function () {
                        changeLayout(this.id)
                    }
                }
            ]
        },
        { type: 'split' },
        {
            id: __guid++,
            name:  _formatLang("messagecenter"),
            type: 'withNumTips',
            iconClass: 'icon-bell',
            target: 'tab',
            url: '/platf/msg/func/query.func',//消息中心地址
            numIntervalTime: 1000 * 30,//循环时间,默认30秒
            //消息提示文字
            messageText: function (res) {
                return  _formatLang("unreadmessage").replace("{}",res.num);
            },
            //获取未读消息数量
            numFunc: function () {
                return new Promise((resolve, reject) => {
                    let param = new eap.dataHelper.Param();
                    let where = new eap.dataHelper.Where();
                    let orders = new eap.dataHelper.Orders();
                    if (window.Scp.User.fuserid) {
                        where.eq("freceiver", window.Scp.User.fuserid);
                    }
                    where.setPage(1, -1);
                    param.where = where;
                    eap.dataHelper.query(
                        param,
                        "/platf/msg/entity/MsgUnReadBizEntity.xml",
                    ).then(res => {
                        let __data = res.dataPack.rows;
                        resolve({
                            num: (__data && __data.length > 0) ? __data.length : 0
                        });
                    }).catch(err => {
                        reject(err);
                    });
                });
            },
        },
        { type: 'split' },
    ],
    //浏览器标签logo
    //favicon: '/' + pName + "/setting/desktop/sysAssets/login_logo/png/1.0.0/login_logo.png",
    //首页加载logo
    sysLoadLogo: {
        src: '/' + pName + '/setting/desktop/sysAssets/sy_loading/png/1.0.0/sy_loading.png',
        title:  _formatLang("companyname")
    },
    //首页头部logo
    sysLogo: {
        src: '/' + pName + '/setting/desktop/sysAssets/sy_logo/png/1.0.0/sy_logo.png',
        title: _formatLang("companyname"),
    },
    //首页左右结构头部logo
    /*sysLogoHorizon: {
        src: '/' + pName + '/setting/desktop/sysAssets/sy_logo/png/1.0.0/sy_logo.png',
        title: '闽纺联盟',
        width:null,
        height:null,
    },*/
    //首页mini图标
    MsysLogo: {
        src: '/' + pName + '/setting/desktop/sysAssets/sy_minLogo/png/1.0.0/sy_minLogo.png',
        title: _formatLang("companyname")
    },
    //左右布局菜单项文字是否单行显示
    isMenuWordwrap: true,
    //登录页配置
    //登录页logo
    loginLogo: '/' + pName + "/setting/desktop/sysAssets/login_logo/png/1.0.0/login_logo.png",
    //logo高
    loginLogo_h: null,
    //logo宽
    loginLogo_w: null,
    //登录页背景
    loginBgImg: '/' + pName + "/setting/desktop/sysAssets/login_bg/png/1.0.0/login_bg.png",
    //标题
    //loginTitle:"",
    //版权
    copyright: _formatLang("copyright"),
    //是否显示全部功能按钮
    isShowAllFunc:true,
    showChangeLangBtn:true,
    leftMenuWidth:200,
    //是否开启扫码登录
    //isScan:false,
    //默认布局(左右:left、上下:top)
    //layout:"top",
    //app二维码
    //appQRcode:'/' + pName + "/setting/desktop/sysAssets/login_logo/png/1.0.0/login_logo.png",
};