npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

meixiappmain

v0.4.0

Published

## Project setup ``` npm install ```

Downloads

160

Readme

meixiappmain

项目结构

 |-- lib  ---------------------------------------------打包目录
    |   |-- MeixiOaWebSocket.d.ts
    |   |-- MeixiOaWebSocket.d.ts.map
    |   |-- MessageDispatch.d.ts
    |   |-- MessageDispatch.d.ts.map
    |   |-- MsgModule.d.ts
    |   |-- MsgModule.d.ts.map
    |   |-- RemoveMessageDispatch.d.ts
    |   |-- RemoveMessageDispatch.d.ts.map
    |   |-- appMain.d.ts
    |   |-- appMain.d.ts.map
    |   |-- config.d.ts
    |   |-- config.d.ts.map
    |   |-- demo.html
    |   |-- index.d.ts
    |   |-- index.d.ts.map
    |   |-- meixiappmain.common.js
    |   |-- meixiappmain.umd.js
    |   |-- meixiappmain.umd.min.js
    |   |-- registerWsMs.d.ts
    |   |-- registerWsMs.d.ts.map
    |-- packages   -------------------------包主要目录
    |   |-- MeixiOaWebSocket.js  -----------websock类
    |   |-- MeixiOaWebSocket.ts
    |   |-- MessageDispatch.js  ------------全局消息分发类
    |   |-- MessageDispatch.ts
    |   |-- MsgModule.js -------------------模块消息类
    |   |-- MsgModule.ts
    |   |-- RemoveMessageDispatch.js
    |   |-- RemoveMessageDispatch.ts
    |   |-- appMain.js
    |   |-- appMain.ts
    |   |-- config.js
    |   |-- config.ts
    |   |-- index.js
    |   |-- index.ts
    |   |-- registerWsMs.js
    |   |-- registerWsMs.ts
    |   |-- type.d.ts
    |   |-- component----------------------组件文件夹
    |   |   |-- complaintForm.vue
    |   |   |-- applicationList
    |   |       |-- applicationItem.vue
    |   |       |-- applicationListLeft.vue
    |   |       |-- applicationListWrap.vue
    |   |-- typings
    |       |-- .d.ts
    |-- public
    |   |-- favicon.ico
    |   |-- index.html
    |-- src

Project setup

npm install

在子系统中注册插件


///在通过接口获取动态路由后需初始化 该插件
// 判断是否是开发还是生产环境
if (process.env.NODE_ENV === 'development') {
    appMain.initDev(process.env.VUE_APP_PRODUCTNAME, process.env.VUE_APP_SYSTEMID, null);
} else {
    appMain.initProduction(process.env.VUE_APP_PRODUCTNAME, process.env.VUE_APP_SYSTEMID, null);
}
//   //通过appMain 注册 meixilayout navBarPlugin 列表
appMain.registerLayout([]).then(res => {
    //如果需要向公告组件注册子组件则调用注册组件
    appMain.registerBulletinComponent([]);
});
///向meixilayout 的navBarPlugin 中注册按钮及点击事件
///具体效果见下面图片
///参数为数组对象 对象属性{
// element组件的icon名字
// icon:'', 
//点击方法
// click:()=>{}}
appMain.registerLayout([])

appMain API

    //注册公告组件
    registerBulletinComponent(bulletinComponent: BulletinComponent[]): void;
    //返回websock实例
    getWebSocket(): MeixiOaWebSocketInterface;
    //设置文档标题
    setDocumentTitle(systemName: string): void;
    //打开选择引用窗口
    openApplicationList(): void;
    //跳转其它引用,参数为url
    jumpApplication(url: any): void;
    // 返回首页
    backHome(): void;
    // 设置系统主题
    setSystemTheme(): void;

如需见下图加载子系统自定义的公告组件

//   //通过appMain 注册 meixilayout navBarPlugin 列表
appMain.registerLayout([]).then(res => {
    //  通过promise 确保消息组件实例化后再注册自定义组件
    //  如果需要向公告组件注册子组件则调用注册组件
    //  参数   [{
    // id:''//对应后段websock 返回的消息类型
    // component:xxxx  //通过import 引入的vue工程文件
    //  }]
    appMain.registerBulletinComponent([]);
});

如需扩展websocket通知类型,参考以下代码


import {MsgModule, messageDispatcher} from 'meiximessage';

class SystemNotifyModule extends MsgModule {
    constructor(params) {
        super(params);
        this.eventList = [
            {
                //后段定义的消息类型
                eventName: 'CHANGE_PERMISSION',
                //  注册回调方法,当收到'CHANGE_PERMISSION'时,执行该方法
                callBack: () => {
                    store.dispatch('user/getInfo');
                },
            },
        ];
    }

    readyNotifyMessage(data) {
        switch (data.exSignalEventEnum) {
            //这里可以对数据做处理
            case 'CHANGE_PERMISSION':
                break;
        }
        //通过事件监听的方法,调用回调方法
        MessageDispatcher.notify(data.exSignalEventEnum, data);
    }

    // 子类构造方法
    registerEventList() {
        this.eventList.forEach((item) => {
            MessageDispatcher.on(`${item.eventName}`, item.callBack);
        });
    }
}

const systemNotifyModule = new SystemNotifyModule({
    //后段定义的消息字段
    eventType: 'PERMISSION',
});

export default systemNotifyModule;