xy-tool-ui

1.4.12 • Public • Published

xy-tool-ui

一个基于Vue CLI 3.0,Babel7,VUE2.6封装的VUE-UI组件库模版,支持统一加载和按需加载,可以按需分别加载对应组件的js和css。

npm version npm downloads npm build npm license gzip size: JS gzip size: CSS

Installing

npm install xy-tool-ui --save

unpkg 上获取

<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/xy-tool-ui/package/index.css">
<!-- 引入脚本 -->
<script src="https://unpkg.com/xy-tool-ui/package/index.umd.min.js"></script>

Example

// 统一加载
import XiaoYiToolUI from 'xy-tool-ui'
Vue.use(XiaoYiToolUI)

// 只加载component1
import { component1 } from 'xy-tool-ui'
Vue.use(component1)

// 加载component1和component2
import { component1 , component2} from 'xy-tool-ui'
Vue.use(component1)
Vue.use(component2)

使用示例

1.查看报告
<y-iframe-report
        ref="report"
        :autographSrc="report.autographSrc"
        :option="report.option"
        :reject="reject"
        :report-type="report.option.reportType"
        :reportHideList="report.reportHideList"
        :reviewedSignedSrc="report.reviewedSignedSrc"
        :rid="report.rid"

        :showShadow="showShadow"
        :template-data="templateData"
        :uid="report.uid"
        :urlTransformation="report.urlTransformation"
        height="550px"
        width="850px"
        @backHtml="backHtml"
        @error="error"
>
</y-iframe-report>

    -参数:uid 测评报告id [String, Array]
    -参数:printKeyword false/true  默认:true 是否开启快捷键监听打印
    -参数:option Object
    {
        action: 'dev', // 环境 dev/prod  默认:dev
        hostSuffix: '/prod-api', // 自定义请求后缀 默认:/prod-api
        path: '/generate/report/u/', // 自定义请求地址
        auth: 'Authorization', // api请求中的令牌key // 默认:Authorization
        localAuthKey: 'Authorization', // 当前缓存令牌key // 默认:Authorization
        tokenPath: '/api/token', // 后端量表库token请求地址
        reportType: 'doc', // 报告类型 (html、doc) 默认:html
    }
    -参数:reportHideList Array 默认:[]
        · 封面:gauge_cover
        · 标题:headerTitle
        · 标题图片:headerTitleImg
        · 基本信息:user
        · 量表简介:gauge_introduce
        · 筛查维度:gauge_dimension
        · 量表得分:gauge_score
        · 测评结果:gauge_conclusion
        · 图:mainChart
        · 表:gauge_surface
        · 测评分析:gauge_analysis
        · 指导意见:gauge_opinion
        · 预警等级:gauge_warning
        · 尾部:gauge_footer
        · 原始答卷:gauge_answer
        · 测评分析---症状表现:symptomsItemClassName
        · 测评分析---建议:suggestClassName
    -参数:showShadow 显示报告边框 Boolean 默认:false  
    -参数:autographSrc 测评员签字地址 String 默认:''  
    -参数:reviewedSignedSrc 审核员签字地址 String 默认:''  
    -参数:reportShow 显示报告 Boolean 默认:true 可不传,获取源码使用  
    -参数:urlTransformation 源码 [String, Array] 可不传,获取源码使用  
    -参数:rid 模板id [String] doc 模式必填;团测使用  
    -参数:templateData 模板数据 [Json] doc 模式必填;团测使用  
    -参数:reject 异常回调事件 [function] 可处理接口报错、token登录超时操作  

   ·事件监听 
        @backHtml="backHtml" 
        this.$refs['report'].urlTransformationFun()
   ·事件调用打印 
        this.$refs['report'].print()
   ·快捷键监听打印 ~~目前已去除监听~~
        Ctrl+P 
   ·回调例子
      reject (res) {
          if (typeof res == 'object') {
              if (res.code === 401) {
                  this.$confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
                      confirmButtonText: '重新登录',
                      cancelButtonText: '取消',
                      type: 'warning'
                    }
                  ).then(() => {
                       store.dispatch('LogOut').then(() => {
                            location.href = '/index'
                       })
                  }).catch(() => {
                  })
              } else {
                this.$message.error(res.msg)
              }
          }
      }

2.设计量表
    <y-design-answer-form />
 
3.量表配置
    <y-design-form-rules />

按需加载功能只针对有Babel配置的项目,单纯用script和link的方式引入js和样式是全量引入

License

Copyright (c) 2022-present, XiaoYI

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.128latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.128
1.4.112
1.4.101
1.4.90
1.4.60
1.4.50
1.4.20
1.4.10
1.4.02
1.3.111
1.3.100
1.3.90
1.3.80
1.3.70
1.3.60
1.3.50
1.3.40
1.3.30
1.3.10
1.3.00
1.2.90
1.2.80
1.2.70
1.2.60
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.350
1.1.340
1.1.330
1.1.320
1.1.301
1.1.290
1.1.280
1.1.270
1.1.260
1.1.250
1.1.240
1.1.230
1.1.220
1.1.210
1.1.200
1.1.190
1.1.180
1.1.170
1.1.160
1.1.150
1.1.140
1.1.130
1.1.120
1.1.110
1.1.100
1.1.90
1.1.71
1.1.60
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.200
1.0.190
1.0.180
1.0.170
1.0.160
1.0.150
1.0.140
1.0.131
1.0.120
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.0.60
1.0.50
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i xy-tool-ui

Weekly Downloads

17

Version

1.4.12

License

MIT

Unpacked Size

26.9 MB

Total Files

82

Last publish

Collaborators

  • xingxiansheng