@aleen42/wps-plugin

1.0.1 • Public • Published

Coremail WPS Plugin

该插件用于辅助 Email 通过 WPS 本地打开邮件内的附件

1. 调试

  1. 安装依赖

    npm i --no-save
  2. 启动本地服务(具体根据需求调试)

    npm run test:et # 调试 et 加载项 (Excel)
    npm run test:wpp # 调试 wpp 加载项 (PPT)
    npm run test:wps # 调试 wps 加载项 (Word)
  3. 访问 http://127.0.0.1:3728 即可进行本地文件调试

2. 部署

plugins 目录部署在某可访问路径下,如 /home/coremail/web/webapp/cmcu_addon/wps_plugin 即可

3. 使用

  1. 安装依赖:

    npm i @coremail/wps-plugin --save
  2. 调用插件:

    const openFile = require('wps-plugin');
    const pluginUrl = 'http://xxx/coremail/cmcu_addon/wps_plugin/';
    
    // 网络文件
    openFile('http://xxx.xls', pluginUrl, 'et').catch(() => { /* when failed */ });
    openFile('http://xxx.ppt', pluginUrl, 'wpp').catch(() => { /* when failed */ });
    openFile('http://xxx.doc', pluginUrl, 'wps').catch(() => { /* when failed */ });
    
    // 本地文件
    openFile('C:/temp/xxx.xls', '', 'et').catch(() => { /* when failed */ });
    openFile('C:/temp/xxx.ppt', '', 'wpp').catch(() => { /* when failed */ });
    openFile('C:/temp/xxx.doc', '', 'wps').catch(() => { /* when failed */ });

4. TODO

  • [x] 插件采用 publish.html 模式 提供安装
  • [x] 把 lib/sdk.js 改造成 CommonJS style
  • [ ] 网络文件无法通过设置 Cookie Header 请求
  • [ ] 目前个人版没办法识别加载项是否已安装过,因此每次切换模式打开的时候会提示安装且点击取消仍能调起 WPS

5. 文档

Readme

Keywords

none

Package Sidebar

Install

npm i @aleen42/wps-plugin

Weekly Downloads

2

Version

1.0.1

License

none

Unpacked Size

68.7 kB

Total Files

8

Last publish

Collaborators

  • aleen42