intelligent-recommend-cs
v1.0.23
Published
服务云-智能推荐
Downloads
30
Readme
intelligent-recommend-cs
智能推荐组件
组件依赖:此组件依赖了系统中的Vue对象以及Vue.prototype上挂载的$request方法
微服务API:VUE_APP_IRSC_API
git 仓库
http://g.lenovo.com.cn/cloudservice/packages/intelligent-recommend
Install
npm install intelligent-recommend-cs --save
Usage
全局注册组件
// 全局注册(注意,要在 $request 之后)
import IntelligentRecommend from 'intelligent-recommend-cs'
Vue.use(IntelligentRecommend)
组件中使用
<IntelligentRecommend
ref="recommend"
project-code="CHC"
project-sn="ZZJ0001"
soid="PJD201028149637889"
cust-phone="15811019382"
:is-lenovo-project="false"
/>
...
// 打开智能推荐弹窗
this.$refs.recommend.openRecommendDialog()
// 手动关闭智能推荐弹窗
this.$refs.recommend.closeRecommendDialog()
props 参数
- project-code: 项目 code
- project-sn: 设备 sn 码
- soid: 工单号
- is-lenovo-project: 当前项目是否为联想项目
- cust-phone: 工单对应客户电话
对外暴露的方法
- 打开智能推荐弹窗: openRecommendDialog
- 手动关闭智能推荐弹窗: closeRecommendDialog
Publish
打包
npm run build
调试
使用npm link进行组件联调
创建/解除 intelligent-recommend-cs 的全局链接
// 进入模块目录 npm link // 创建链接 npm unlink // 解除链接
创建/解除项目和模块的链接
// 进入项目目录 npm link intelligent-recommend-cs // 创建链接 npm unlink intelligent-recommend-cs // 解除引用链接
npm发布
// 登录时若长时间未响应,可将淘宝镜像先停用
npm login // 账号:jiaxiaopeng 密码:8214!xuan@ Email:[email protected] 每天登陆一次就行,不需要每次发版登陆
npm publish // 发布到npm
发布完后一定记得push代码