1.1.90 • Published 1 month ago

vue-frame-crm v1.1.90

Weekly downloads
99
License
ISC
Repository
github
Last release
1 month 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.90

1 month ago

1.1.89

1 month ago

1.1.88

5 months ago

1.1.87

5 months ago

1.1.86

5 months ago

1.1.70

11 months ago

1.1.74

10 months ago

1.1.73

10 months ago

1.1.72

11 months ago

1.1.71

11 months ago

1.1.78

10 months ago

1.1.77

10 months ago

1.1.76

10 months ago

1.1.75

10 months ago

1.1.79

10 months ago

1.1.81

10 months ago

1.1.80

10 months ago

1.1.85

10 months ago

1.1.84

10 months ago

1.1.83

10 months ago

1.1.82

10 months ago

1.1.67

11 months ago

1.1.66

11 months ago

1.1.65

11 months ago

1.1.69

11 months ago

1.1.68

11 months ago

1.1.64

3 years ago

1.1.63

3 years ago

1.1.62

3 years ago

1.1.61

3 years ago

1.1.60

3 years ago

1.1.59

3 years ago

1.1.58

3 years ago

1.1.57

3 years ago

1.1.56

3 years ago

1.1.55

3 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

5 years ago

1.1.45

5 years ago

1.1.44

5 years ago

1.1.43

5 years ago

1.1.42

5 years ago

1.1.41

5 years ago

1.1.40

5 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

6 years ago

0.0.85

6 years ago

0.0.84

6 years ago

0.0.83

6 years ago

0.0.82

6 years ago

0.0.81

6 years ago

0.0.80

6 years ago

0.0.79

6 years ago

0.0.78

6 years ago

0.0.77

6 years ago

0.0.76

6 years ago

0.0.75

6 years ago

0.0.74

6 years ago

0.0.73

6 years ago

0.0.72

6 years ago

0.0.69

6 years ago

0.0.68

6 years ago

0.0.67

6 years ago

0.0.66

6 years ago

0.0.65

6 years ago

0.0.64

6 years ago

0.0.63

6 years ago

0.0.61

6 years ago

0.0.60

6 years ago

0.0.59

6 years ago

0.0.58

6 years ago

0.0.57

6 years ago

0.0.56

6 years ago

0.0.55

6 years ago

0.0.54

6 years ago

0.0.53

6 years ago

0.0.52

6 years ago

0.0.51

6 years ago

0.0.50

6 years ago

0.0.49

6 years ago

0.0.48

6 years ago

0.0.47

6 years ago

0.0.46

6 years ago

0.0.45

6 years ago

0.0.44

6 years ago

0.0.43

6 years ago

0.0.42

6 years ago

0.0.41

6 years ago

0.0.40

6 years ago

0.0.39

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.36

6 years ago

0.0.35

6 years ago

0.0.34

6 years ago

0.0.33

6 years ago

0.0.32

6 years ago

0.0.31

6 years ago

0.0.30

6 years ago

0.0.29

6 years ago

0.0.28

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.21

6 years ago

0.0.20

6 years ago

0.0.19

6 years ago

0.0.18

6 years ago

0.0.17

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago