0.1.8 • Published 2 years ago

@aqsc/common v0.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

aqsc-common,安生平台npm包组件

1、组件打包命令

先用nrm将npm切换到本地源 nrm use '本地源的名字'

npm adduser --registry http://10.244.130.144:8082/repository/npm-local/

账号 admin 密码 ** 邮箱 aqsc@chng.com.cn

登录成功之后npm publish

2、准备工作

  1. 依赖下载。

    npm i @aqsc/common
  2. 依赖引入

    import AqscCommon from '@aqsc/common'
    import '@aqsc/common/lib/aqsc-common.css'
    
    Vue.use(AqscCommon)

3、组件文档

  1. aqsc-select属性介绍
  // 保留element-ui的基础配置信息,如需要可额外扩展
    placeholder: {
      type: String,
      default: ""
    },
    filterable: {
      type: Boolean,
      default: true
    },
    collapseTags: {
      type: Boolean,
      default: true
    },
    multiple: {
      type: Boolean,
      default: false
    },
    disabled: {
      type: Boolean,
      default: false
    },
    clearable: {
      type: Boolean,
      default: true
    },
    size: {
      type: String,
      default: "small"
    },
    // api信息
    getDatas: {
      type: Object,
      default: () => {
        return  {
          // 接口路径、方法、返回值键名
          url: '/bzgl/base-data/v1/werks',
          method: 'get',
          responseKey: 'dataset.datas',
          // options数据映射关系
          value: 'werksCode',
          label: 'werksName',
          // 其他额外数据处理配置
          isReturnAllInfo: true, // 是否返回所选条目的所有信息
          emitTab: 'werkInfo'// 父组件获取所选条目所有信息的回调标记
        };
      }
    },
    // 获取options信息的参数
    params: {
      type: Object,
      default: () => {
        return {};
      }
    },
    // options数据
    optionsMap: {
      type: Object,
      default: () => {
        return {};
      }
    },
    // 默认值
    value: {
      type: [String, Number, Array],
      default: null
    },
    // 封装的调接口方法
    request: {
      type: Function,
      default: null
    }

2、aqsc-select组件的方法

this.$emit("renewOptionsMap", optionsArr, key);
// 父组件
renewOptionsMap(options, key) {
this.optionsMap[key] = options
this.optionsMap = { ...this.optionsMap }
},

this.$emit(
"receiveSelectedOptions",
selectedOpions,
this.getDatas.emitTab
);
// 父组件
receiveSelectedOptions([selectedOpions = {}], emitTab) {
console.log(emitTab)
switch (emitTab) {
case 'werkInfo':
this.findForm.params.bukrs = selectedOpions.expands ? selectedOpions.expands.bukrsCode : '';
this.findForm.params.bmId = ''
this.findForm.params.bzId = ''
this.findForm.params.zyId = ''
break;
case 'departmentInfo':
this.findForm.params.bzId = ''
break;
case 'majorInfo':
this.findForm.params.bzId = ''
break;
default:
break;
}
},
0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago