<!--
 * @Author: your name
 * @Date: 2021-08-05 10:58:42
 * @LastEditTime: 2022-06-28 16:41:21
 * @LastEditors: pangkangrong-123 973534209@qq.com
 * @Description: In User Settings Edit
 * @FilePath: \fe-component-lib\my-tables.md
-->
# my-table
### **my-table 调用方式**
``` Vue
<template>
  <div class="">
    <myTables
      :page="selfTableConfig.page"
      :data="selfTableConfig.data"
      :config="selfTableConfig.table"
      :load="selfTableConfig.load"
    >
      <!-- slot-scope="scope" -->
      <template slot="selectHandler" slot-scope="scope">
        <!-- {{ scope.scope.row }} -->
        <MyInput
          v-model="scope.scope.row['id']"
          :propData="formDataB.form['moneyInput']"
          :config="{
            xType: 'input',
            show: true,
            label: '金额输入框',
            // type: &quot;number&quot;,
            model: 'moneyInput',
            valueType: 'money',
            // valueType: &quot;number&quot;,
            placeholder: '请输入金额'
            // suffixIcon: &quot;el-icon-search&quot;,
            // slotsuffix: &quot;%&quot; //自定义末尾标识名称
          }"
        >
          {{ scope.scope }}
        </MyInput>
      </template>
      <template slot="selectHandler2">
        <i>自定义插槽</i>
        <!-- <h1>自定义插槽</h1>
        <h1>自定义插槽</h1>
        <h1>自定义插槽</h1> -->
      </template>
      <template slot="selectHandler3"> <h1>selectHandler2-2</h1> </template>
      <template slot="selectHandler4"> <h1>selectHandler2-3</h1> </template>
    </myTables>
  </div>
</template>


```
### **Attributes**
> my-tables
### **my-tables Attributes**
参数|说明|类型|可选值|默认值
-|:-|:-|:-|:-
config|表格配置|object|require|-
page|Pagination 分页|object|-|-
data|显示的数据|array|-|-
load|自定义方法，分页自动调用|function|-|-
selectedData|array|需要默认勾选的数据|-|-
currentPageName|可自定义分页器当前页 currentPage的字段名字|string|-|currentPageNum
pageSizeName|可自定义分页器当前页 pageSize的字段名字|string|-|pageSize
totalName|可自定义分页器当前页 total的字段名字|string|-|total
lazyLoading|滚动加载数据，当数据很多的情况下，可开启此功能，将自动懒加载加载data里面的数据，每次加载数量为currentPage*pageSize|boolean/function|-|null
lazyFun|开启lazyLoading，鼠标滚轮滚到数据底部，触发次方法，用来自定义滚动加载数据|boolean/function|-|null
autoPage|自动分页|boolean/function|-|null




> my-tables_config
### **config Attributes**
参数|说明|类型|可选值|默认值
-|:-|:-|:-|:-
selection|单选配置|string|redio|-
autoWidth|全局自动计算宽度，前提没有formatter和没有开启组件情况下（即slot:false）|Boolean|-|-
maxWidth|全局对应列的最大宽度|number/string|-|-
minWidth|全局对应列的最小宽度|number/string|-|-
column|表格配置|array|-|-
operate|操作栏配置|object|-|-
select|当用户手动勾选数据行的 Checkbox 时触发的事件|selection, row, selected|selection：array 所有选中数据；row：object当前操作数据；selected：Boolean 当前操作是否选中
rowClick|当某一行被点击时会触发该事件|row, column, selection, selected|row：object当前操作数据；column:表格配置项信息；selection：array 所有选中数据；selected：Boolean 当前操作是否选中；
其他height，headerCellClassName,cellDblclick,doLayout...等等|其他配置和elementUItable配置一致，添加上去即可，记得驼峰命名

> my-tables-config-column
### **config Attributes**
参数|说明|类型|可选值|默认值
-|:-|:-|:-|:-
type|对应列的类型。如果设置了 selection 则显示多选框；如果设置了 index 则显示该行的索引（从 1 开始计算）；如果设置了 expand 则显示为一个可展开的按钮|string|selection/index/expand|注意：selection的时候 config.selection='redio',开启单选模式，参考config Attributes
slot|开启插槽或者其他组件配置模式|Boolean|-|-
autoWidth|自动计算宽度，前提没有formatter和没有开启组件情况下（即slot:false）|Boolean|-|-
maxWidth|对应列的最大宽度|number/string|-|-
minWidth|对应列的最小宽度|number/string|-|-
name|slot=true时此配置才生效，加载此配置，配置字符串（插槽名称）或者对象（组件配置参考my-forms组件配置即可），string:插槽名称；object:组件配置|string/object|-|注意：多级表头的children里面不建议配置超过一种插槽，有bug，建议使用组件配置
valueType|表格数据格式化成金额类型，保留两位小数;格式化文件大小|string|money/fileSize|-
rowClickEnable|配置slot:true且name有配置的情况下,默认开启插槽或者加载组件配置的单元格都移除rowClick事件，此配置是开启此单元格可以点击rowClick事件|Boolean|-|-
其他配置|参考elementUI Table-column Attributes的配置即可|
toFixedNum|xType=input,保留几位小数|Number|-|-
toFixed|xType=input,是否四舍五入|boolean|-|-

> my-tables-config-operate
### **operate Attributes**
参数|说明|类型|可选值|默认值
-|:-|:-|:-|:-
columnConfig|操作栏的column配置 默认label=操作 居中显示
operateArr|操作按钮配置|object|-|注意配置icon 使用的是iconfont图标，配置eicon 使用的是element图表，item里面的配置 show/disable 配置成functio时 参数 index,row
show|显示隐藏操作栏|Boolean|-|true

> my-tables-config-page
### **page Attributes**
参数|说明|类型|可选值|默认值
-|:-|:-|:-|:-
layout|组件布局，子组件名用逗号分隔|string|-|默认‘total, prev, pager, next, jumper’
pageNum|当前页数|number|-|-
pageSize|每页显示条目个数|number|-|-
pageSizes|每页显示个数选择器的选项设置|number[]|-|-
total|总条目数|number|-|-
handleSizeChange|pageSize 改变时会触发|function|-|注意：不建议配置，使用load方法即可 分页会自动调用此方法
handleCurrentChange|currentPage 改变时会触发|function|-|注意：不建议配置，使用load方法即可 分页会自动调用此方法


> my-tables-config-load
### **load Attributes**
参数|说明|类型|可选值|默认值
-|:-|:-|:-|:-
load|当table分页时  自动触发此方法，分页时双向数据绑定的|function

