@binlun/sensitive
v0.0.9
Published
* 包含词库管理(lexiconManagement)、命中管理(hitManagement)、词库标签(lexiconTag)、稽查管理(inspectManagement)、策略配置(configuration)五个功能模块
Readme
sensitive 敏感词业务组件
概述
- 包含词库管理(lexiconManagement)、命中管理(hitManagement)、词库标签(lexiconTag)、稽查管理(inspectManagement)、策略配置(configuration)五个功能模块
组件安装
npm install @binlun/sensitive --save使用示例
import { lexiconManagement, hitManagement, lexiconTag, inspectManagement, configUration } from '@binlun/sensitive'
import '@binlun/sensitive/lib/style.css'
...
// 业务组件
<lexicon-management></lexicon-management>
<hit-management :source-options="sourceOptions"></hit-management>
<lexicon-tag></lexicon-tag>
<inspect-management :source-options="sourceOptions"></inspect-management>
<config-uration :source-options="sourceOptions" :is-finished="isFinished"></config-uration>
// 通用参数传值(敏感词模块需要单独部署时引入该方法传入token及代理地址)
import { config } from '@binlun/sensitive'
config().setConfig(token, proxyUrl)属性
命中管理\稽查管理
| 属性 | 类型 | 必填 | 默认值 | 功能/备注 | | ------------- | :------: | :------: | :----------------------: | :------------------------------------: | | sourceOptions | array | required | [{value: '', label: ''}] | 业务来源数据字段 |
策略配置
| 属性 | 类型 | 必填 | 默认值 | 功能/备注 | | ------------- | :------: | :------: | :----------------------: | :------------------------------------: | | sourceOptions | array | required | [{value: '', label: ''}] | 业务来源数据字段 | | isFinished | boolean | required | false | 是否已获取业务来源数据 |
通用参数传值
| 属性 | 类型 | 必填 | 默认值 | 功能/备注 | | -------- | :-------: | :------: | :---: | :---------------:| | token | string | option | '' | 系统登录token | | proxyUrl | string | option | '' | 敏感字系统代理地址 |
方法
事件
开发与调试
- 运行
npm install安装依赖 - 运行
npm start
目录结构
.
├── index.js ---------------------- npm入口文件,新增组件时需要在这里添加
├── lib --------------------------- 打包代码
├── examples ---------------------- 示例代码
├── assets -------------------- 静态资源目录
├── main.ts ------------------- 示例入口
├── App.vue ------------------- 示例实现
├── public ------------------------ html上引用的公共资源
└── src --------------------------- 源码目录
├── components ---------------- 组件目录
|—— api ------------------- 接口层
|—— config.ts -------- 敏感词接口
|—— request.ts -------- axios封装
|—— components ------------ 具体组件
├── commonTable ------- 表单组件
├── configUration ----- 策略管理
├── hitManagement ----- 命中管理
├── inspectManagement - 稽查管理
├── lexiconManagement - 词库管理
├── lexiconTag -------- 词库标签
|—— enums ----------------- 枚举文件夹
|—— hooks ----------------- 自定义封装hooks函数方法(分页)
|—— index.ts -------------- 组件导出
|—— utils.ts -------------- 获取token、代理的方法
├── index.hml --------------------- 页面入口打包
- 运行
npm run build来打包 - bundle的入口在vite.build.config.ts的entry字段中配置
- 打包以后生成lib/bundle.es.js和lib/bundle.umd.js
发布
- 通过npm来发布
npm login登录npm系统npm publish发布到npm上- 在浏览器中输入 查看发布的包
- 参考资料: https://hu379y.yuque.com/docs/share/ad90b7ff-e70d-4b46-bd5a-34db014884e0
