0.6.0 • Published 10 days ago

yw-common-list v0.6.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 days ago

yw-common-list

基于vxe-table封装的自定义可配置表格

vxetable文档

👉 查看文档

运行项目

安装依赖

npm install

启动本地调试

npm run serve

编译打包,生成编译后的目录:lib

npm run lib

说明

表格不设置宽高时可以进行自适应,需要表格外层容器的高度为100%能够占满剩余区域

<template>
  <div class="page1">
    <ya-wei-list table-key="yw_student"/>
  </div>
</template>
<style lang="scss" scoped>
.page1 {
  height: 100%;
}
</style>

API

属性说明类型默认值
tableKey必填,表格配置keyString
showTop是否显示表格上方按钮区域Booleantrue
showTablePage是否显示分页Booleantrue
defaultReload初始化默认加载数据Booleanfalse(如果为false通过reload的方法手动触发加载数据)
customPage自定义分页参数Object{ pageNo: options.pageNo,// 当前页 pageSize: options.pageSize,// 每页数据量 totalResult: 0// 列表总量 }
superParams列表高级查询查询条件Array[]
query查询条件,会被高级查询覆盖Object{}
superQueryAlone高级查询选中与 query 独立Booleantrue
superQueryAloneParams高级查询选中与 query 独立的参数名Array'id'
defaultReload初始化默认加载数据Booleanfalse

slot自定义插槽

名称说明
buttons表格上方按钮区域
列字段+Header列表头
自定义列数据列

参数说明

{row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, _columnIndex}

示例代码

列名:address,列表头部插槽名:addressName,列表数据插槽:address

<ya-wei-list>
  <template #addressHeader>
    地址头部
  </template>
  <template #address="{ row }">
    <span>{{ row.name }}</span>
  </template>
</ya-wei-list>

方法

方法名说明返回值
header-cell-click表头单元格点击{ $rowIndex, column, columnIndex, $columnIndex, triggerResizable, triggerSort, triggerFilter, $event }
header-cell-dblclick表头单元格双击{ $rowIndex, column, columnIndex, $columnIndex, $event }
header-cell-menu右键列{ type, column, columnIndex, $event }
cell-click单元格点击{ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, triggerRadio, triggerCheckbox, triggerTreeNode, triggerExpandNode, $event }
cell-dblclick单元格双击{ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }
cell-mouseenter鼠标进入单元格{ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }
cell-mouseleave鼠标离开单元格{ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }
cell-menu右键行{ type, row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }
scroll滚动{ type, scrollTop, scrollLeft, scrollHeight, scrollWidth, bodyWidth, bodyHeight, isX, isY, $event }
checkbox-allcheckbox 全选/全取消{ checked, $event }
checkbox-changecheckbox 选中/取消{ checked, row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }
this.$refs.列表key.reload()主动触发刷新列表
this.$refs.列表key.getCheckboxRecords()获取checkbox选中值选中的数据对象

接口代理:/yw-common-list

module.exports = {
  devServer: {
    proxy: {
      // 代理通用列表后台地址
      '/yw-common-list': {
        target: 'http://localhost:8983/',
        ws: false,
        changeOrigin: true,
        pathRewrite: {
          '^/yw-common-list': ''
        }
      }
    }
  },
  ...
}

高级查询参数

rule参数说明

"gt": "大于", "ge": "大于等于", "lt": "小于", "le": "小于等于", "eq": "等于", "ne": "不等于", "in": "包含", "like": "全模糊", "left_like": "左模糊", "right_like": "右模糊",

[
  {
    "rule": "判断条件",
    "val": "参数值",
    "field": "参数名"
  },
  {
    "rule": "eq",
    "val": 123,
    "field": "id"
  }
]
0.6.0

10 days ago

0.5.9

23 days ago

0.5.6

3 months ago

0.5.8

3 months ago

0.5.7

3 months ago

0.4.9

1 year ago

0.4.8

1 year ago

0.3.9

1 year ago

0.5.4

1 year ago

0.4.5

1 year ago

0.3.6

1 year ago

0.5.3

1 year ago

0.4.4

1 year ago

0.4.7

1 year ago

0.3.8

1 year ago

0.5.5

1 year ago

0.4.6

1 year ago

0.3.7

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.5.2

1 year ago

0.4.3

1 year ago

0.5.1

1 year ago

0.4.2

1 year ago

0.3.0

1 year ago

0.2.1

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.2.7

1 year ago

0.1.8

2 years ago

0.3.5

1 year ago

0.2.6

1 year ago

0.1.7

2 years ago

0.2.9

1 year ago

0.2.8

1 year ago

0.1.9

2 years ago

0.3.2

1 year ago

0.2.3

2 years ago

0.1.4

2 years ago

0.3.1

1 year ago

0.2.2

2 years ago

0.1.3

2 years ago

0.3.4

1 year ago

0.2.5

1 year ago

0.1.6

2 years ago

0.3.3

1 year ago

0.2.4

1 year ago

0.1.5

2 years ago

0.1.0

2 years ago