1.1.94 • Published 7 months ago

vue-frame-crm v1.1.94

Weekly downloads
99
License
ISC
Repository
github
Last release
7 months ago

vue-frame-crm

vue component for crm system 示例

Install

npm install vue-frame-crm --save || npm install vue-frame-crm@xxx --save

编译和发布

  1. npm run build 进行编译和打包
  2. 切换到当前项目目录
  3. 切换npm源到npm源(https://registry.npmjs.org/): 只针对有自身源的情况
  4. npm login
  5. 修改package.json的版本号
  6. npm publish

Useage

  • frame component install
/**
 * 需要将frame组件注册到Vue中
 */
/* 全局注册 */
import Vue from 'vue'
import { TFrame } from 'vue-frame-crm'
Vue.use(TFame)

/* 局部注册, */
import { TFrame } from 'vue-frame-crm'
export default {
    ...
    components: {
        TFrame
    },
    ...
}

/**
 * 在模版中使用
 */
<t-frame
    :img="img"
    :imgMin="imgMin"
    :logo-router="logoRouter"
    :authorization="authorization"
    :tag="tag"
    :count="count"
    :navs="navs"
    :instance="$cmi">
</t-frame>

export default {
    data () {
        return {
            logoRouter: { name: 'portal'},
            img: img,
            imgMin: imgMin,
            authorization: authorization,
            tag: 'CRM',
            menuList: [],
            navs: [
              {
                type: 'icon',
                icon: 'bell'
              },
              {
                type: 'dropdown',
                icon: 'account-circle',
                children: [
                  {
                    name: 'icon1'
                  },
                  {
                    name: 'icon2'
                  },
                  {
                    name: 'icon3'
                  }
                ]
              },
              {
                type: 'icon',
                icon: 'arrow-right-bold-box-outline',
                handleType: 'logout'
              }
            ],
            count: 6
        }
    }
}
  • frame 组件的提供的参数

    • img string 左上角的logo图标

    • imgMin string 左上角的logo缩小图标

    • logoRouter object 左上角的logo图标的路由

    • authorization object 配置文件设置

    • tag string 当前系统的类型,用于判断是否在本系统中跳转

    • count number 右上角未读消息的个数

    • menuList 渲染menu菜单 { iconType, 一级菜单的右侧icon的type,对应的是aidesign的图标库 menuName, 当前菜单的名称 menuUrl, 路由url systemUrl, 非本系统host路由 (根据rightTag 与 tag),非本项目的链接 systemUrl + menuUrl }

    • activeMenu String, Number 当前展开的menu

    • navs array 渲染头部menu { type, 'icon'| 'dropdown' | 'avatar' icon, 图标icon的type,对应的是aidesign的图标库 children, 如果是dropdown时需要提供dropdownitem }

    navs: [
      {
        type: 'icon',
        icon: 'bell'
      },
      {
        type: 'dropdown',
        icon: 'account-circle',
        children: [
          {
            name: 'icon1'
          },
          {
            name: 'icon2'
          },
          {
            name: 'icon3'
          }
        ]
      },
      {
        type: 'icon',
        icon: 'arrow-right-bold-box-outline',
        handleType: 'logout'
      }
    ]
  • instance 服务调用实例

http 请求注入

以auth2的方式,将存在sessionStorage中token注册入请求头中(传入的是axios的实例)

  • 用法
/**
 * httpHandle 有两个函数
 * requestInterceptor (config, authorization, tokenUri)
 * handleResponseError (error, authorization)
 * http.js 最写入
 */
import { httpHandle } from 'vue-frame-crm'
import authorization from './authorization.js'

function requestInterceptor (config) {
    ...
    let conf = httpHandle.requestInterceptor(config, authorization, authorization.tokenUri)
    return merge(config, conf)
}

route 路由注入

在进入路由之前判断注册

/**
 * beforeEach(to, from, next, authorization, requestInstance, cb)
 * 在router.js 中写入
 */
import { route } from 'vue-frame-crm'
import authorization from './authorization.js'

router.beforeEach((to, from, next) => {
    route.beforeEach(to, from, next, authorization, http.$cmi)
})
1.1.92

7 months ago

1.1.91

7 months ago

1.1.94

7 months ago

1.1.93

7 months ago

1.1.90

9 months ago

1.1.89

9 months ago

1.1.88

1 year ago

1.1.87

1 year ago

1.1.86

1 year ago

1.1.70

2 years ago

1.1.74

1 year ago

1.1.73

1 year ago

1.1.72

1 year ago

1.1.71

1 year ago

1.1.78

1 year ago

1.1.77

1 year ago

1.1.76

1 year ago

1.1.75

1 year ago

1.1.79

1 year ago

1.1.81

1 year ago

1.1.80

1 year ago

1.1.85

1 year ago

1.1.84

1 year ago

1.1.83

1 year ago

1.1.82

1 year ago

1.1.67

2 years ago

1.1.66

2 years ago

1.1.65

2 years ago

1.1.69

2 years ago

1.1.68

2 years ago

1.1.64

4 years ago

1.1.63

4 years ago

1.1.62

4 years ago

1.1.61

4 years ago

1.1.60

4 years ago

1.1.59

4 years ago

1.1.58

4 years ago

1.1.57

4 years ago

1.1.56

4 years ago

1.1.55

4 years ago

1.1.54

4 years ago

1.1.52

4 years ago

1.1.53

4 years ago

1.1.51

4 years ago

1.1.50

4 years ago

1.1.49

4 years ago

1.1.48

4 years ago

1.1.47

5 years ago

1.1.46

6 years ago

1.1.45

6 years ago

1.1.44

6 years ago

1.1.43

6 years ago

1.1.42

6 years ago

1.1.41

6 years ago

1.1.40

6 years ago

1.1.38-test.2

6 years ago

1.1.39

6 years ago

1.1.38-test.1

6 years ago

1.1.38

6 years ago

1.1.37-test.11

6 years ago

1.1.37-test.7

6 years ago

1.1.37-unuse.101

6 years ago

1.1.37-test.100

6 years ago

1.1.37-test.6

6 years ago

1.1.37-test.5

6 years ago

1.1.37-test.4

6 years ago

1.1.37-test.3

6 years ago

1.1.37-test.2

6 years ago

1.1.37-test.1

6 years ago

1.1.37

6 years ago

1.1.3-6.test.1

6 years ago

1.1.36

6 years ago

1.1.3-5.test.24

6 years ago

1.1.3-5.test.23

6 years ago

1.1.3-5.test.22

6 years ago

1.1.3-5.test.21

6 years ago

1.1.3-5.test.20

6 years ago

1.1.3-5.test.19

6 years ago

1.1.3-5.test.18

6 years ago

1.1.3-5.test.17

6 years ago

1.1.3-5.test.16

6 years ago

1.1.3-5.test.15

6 years ago

1.1.3-5.test.14

6 years ago

1.1.3-5.test.13

6 years ago

1.1.3-5.test.12

6 years ago

1.1.3-5.test.11

6 years ago

1.1.3-5.test.10

6 years ago

1.1.3-5.test.9

6 years ago

1.1.3-5.test.8

6 years ago

1.1.3-5.test.7

6 years ago

1.1.3-5.test.6

6 years ago

1.1.3-5.test.5

6 years ago

1.1.3-5.test.4

6 years ago

1.1.3-5.test.3

6 years ago

1.1.3-5.test.2

6 years ago

1.1.3-5.test.1

6 years ago

1.1.35

6 years ago

1.1.34-test.10

6 years ago

1.1.34-test.9

6 years ago

1.1.34-test.8

6 years ago

1.1.34-test.7

6 years ago

1.1.34-test.6

6 years ago

1.1.34-test.5

6 years ago

1.1.34-test.4

6 years ago

1.1.34-test.3

6 years ago

1.1.34-test.2

6 years ago

1.1.34-test.1

6 years ago

1.1.34-test

6 years ago

1.1.34

6 years ago

1.1.33

6 years ago

1.1.32

6 years ago

1.1.31

6 years ago

1.1.30

6 years ago

1.1.29

6 years ago

1.1.28

6 years ago

1.1.27

6 years ago

1.1.26

6 years ago

1.1.25

6 years ago

1.1.24

6 years ago

1.1.23

6 years ago

1.1.22

6 years ago

1.1.21

6 years ago

1.1.20

6 years ago

1.1.19

6 years ago

1.1.18

6 years ago

1.1.17

6 years ago

1.1.16

6 years ago

1.1.15

6 years ago

1.1.14

6 years ago

1.1.13

6 years ago

1.1.12

6 years ago

1.1.11

6 years ago

1.1.10

6 years ago

1.1.9

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.0.99

6 years ago

0.0.98

6 years ago

0.0.97

6 years ago

0.0.96

6 years ago

0.0.95

6 years ago

0.0.94

6 years ago

0.0.93

6 years ago

0.0.92

6 years ago

0.0.91

6 years ago

0.0.90

6 years ago

0.0.89

6 years ago

0.0.88

6 years ago

0.0.87

6 years ago

0.0.86

7 years ago

0.0.85

7 years ago

0.0.84

7 years ago

0.0.83

7 years ago

0.0.82

7 years ago

0.0.81

7 years ago

0.0.80

7 years ago

0.0.79

7 years ago

0.0.78

7 years ago

0.0.77

7 years ago

0.0.76

7 years ago

0.0.75

7 years ago

0.0.74

7 years ago

0.0.73

7 years ago

0.0.72

7 years ago

0.0.69

7 years ago

0.0.68

7 years ago

0.0.67

7 years ago

0.0.66

7 years ago

0.0.65

7 years ago

0.0.64

7 years ago

0.0.63

7 years ago

0.0.61

7 years ago

0.0.60

7 years ago

0.0.59

7 years ago

0.0.58

7 years ago

0.0.57

7 years ago

0.0.56

7 years ago

0.0.55

7 years ago

0.0.54

7 years ago

0.0.53

7 years ago

0.0.52

7 years ago

0.0.51

7 years ago

0.0.50

7 years ago

0.0.49

7 years ago

0.0.48

7 years ago

0.0.47

7 years ago

0.0.46

7 years ago

0.0.45

7 years ago

0.0.44

7 years ago

0.0.43

7 years ago

0.0.42

7 years ago

0.0.41

7 years ago

0.0.40

7 years ago

0.0.39

7 years ago

0.0.38

7 years ago

0.0.37

7 years ago

0.0.36

7 years ago

0.0.35

7 years ago

0.0.34

7 years ago

0.0.33

7 years ago

0.0.32

7 years ago

0.0.31

7 years ago

0.0.30

7 years ago

0.0.29

7 years ago

0.0.28

7 years ago

0.0.27

7 years ago

0.0.26

7 years ago

0.0.25

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.1

7 years ago