@weitutech/by-components 1.0.28 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -44
- package/README.md +469 -469
- package/docs/extension.md +15 -0
- package/docs/form.md +52 -0
- package/docs/table.md +26 -0
- package/lib/by-components.common.js +28976 -28904
- package/lib/by-components.umd.js +27646 -27574
- package/lib/by-components.umd.min.js +142 -142
- package/package.json +31 -30
- package/src/components/custom-column/index.vue +369 -0
- package/src/components/fold-search/index.vue +29 -0
- package/src/components/form/comps/custom-date-picker.vue +135 -0
- package/src/components/form/comps/date-picker-range.vue +78 -0
- package/src/components/form/comps/pair-number-input.vue +67 -0
- package/src/components/form/comps/select.vue +127 -0
- package/src/components/form/form.vue +369 -0
- package/src/components/page-search/page-search.vue +114 -0
- package/src/components/pager/index.vue +81 -0
- package/src/components/table/index.vue +240 -0
- package/src/index.js +31 -0
- package/src/plugin/vxeTable.js +300 -0
- package/src/plugin/vxeTable.scss +14 -0
- package/src/style/custom-column.scss +194 -0
- package/src/style/fold-search.scss +21 -0
- package/src/style/form.scss +342 -0
- package/src/style/index.scss +6 -0
- package/src/style/page-search.scss +26 -0
- package/src/style/pager.scss +40 -0
- package/src/style/table.scss +39 -0
- package/src/utils/index.js +32 -0
- package/.browserslistrc +0 -3
- package/babel.config.js +0 -9
- package/jsconfig.json +0 -19
- package/postcss.config.js +0 -7
- package/vue.config.js +0 -7
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
### 如需要扩展
|
|
2
|
+
|
|
3
|
+
1. 应从 vex-table 第三方组件库查看是否有相应的功能
|
|
4
|
+
|
|
5
|
+
2. 如需要加入通用实用的表单元素、应该先考虑在组件form中加入、其次是以custom插槽的形式插入
|
|
6
|
+
|
|
7
|
+
### 第三方插件
|
|
8
|
+
|
|
9
|
+
[element-ui](https://element.eleme.cn/#/zh-CN)
|
|
10
|
+
|
|
11
|
+
[vuedraggable](https://www.npmjs.com/package/vuedraggable)
|
|
12
|
+
|
|
13
|
+
[vxe-table](https://vxetable.cn/pluginDocs/table3/#/demo/list)
|
|
14
|
+
|
|
15
|
+
[moment](https://momentjs.cn/)
|
package/docs/form.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
### 类型(没有注册看 Element 的组件使用方法)
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
| 'input'
|
|
5
|
+
| 'inputNumber'
|
|
6
|
+
| 'select'
|
|
7
|
+
| 'treeSelect'
|
|
8
|
+
| 'datepicker'
|
|
9
|
+
| 'cascader'
|
|
10
|
+
| 'switch'
|
|
11
|
+
| 'checkbox'
|
|
12
|
+
| 'radio'
|
|
13
|
+
| 'upload'
|
|
14
|
+
| 'customDatePicker' // 自定义的时间选择器
|
|
15
|
+
| 'search' // 搜索按钮区域
|
|
16
|
+
| 'custom' // 自定义
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
#### Event
|
|
20
|
+
|
|
21
|
+
| 事件 | 参数 |
|
|
22
|
+
| ------------- | ------------------- |
|
|
23
|
+
| change | context: IFormItems |
|
|
24
|
+
| queryBtnClick | 无 |
|
|
25
|
+
|
|
26
|
+
完整案列见 [表单 by-form](../README.md)
|
|
27
|
+
|
|
28
|
+
### 特殊说明
|
|
29
|
+
|
|
30
|
+
#### 'customDatePicker'特别说明
|
|
31
|
+
|
|
32
|
+
自定义时间选中器同时支持时间段方式绑定值 和 单独时间方式绑定值
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
// 时间段方式绑定值
|
|
36
|
+
{
|
|
37
|
+
type: 'customDatePicker',
|
|
38
|
+
field: 'report_time',
|
|
39
|
+
label: '报表时间'
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
// 单独时间方式绑定值
|
|
45
|
+
{
|
|
46
|
+
type: 'customDatePicker',
|
|
47
|
+
field: 'report_time', // 仍然保留原来的字段,保证兼容性
|
|
48
|
+
startTimeField: 'start_time', // 新增开始时间字段
|
|
49
|
+
endTimeField: 'end_time', // 新增结束时间字段
|
|
50
|
+
label: '报表时间'
|
|
51
|
+
}
|
|
52
|
+
```
|
package/docs/table.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
### table
|
|
2
|
+
#### 自定义列宽
|
|
3
|
+
注意📢: 一个项目中的name属性千万不能重名、一个项目中的name属性千万不能重名、一个项目中的name属性千万不能重名
|
|
4
|
+
给table组件设置name值属性、类型为String格式、表格会自动缓存用户拖拽之后的结果
|
|
5
|
+
#### 自定义列
|
|
6
|
+
给table组件设置以下对象
|
|
7
|
+
customColumnConfig: { // 自定义列
|
|
8
|
+
showCustomColumn: true, // 是否显示自定义列
|
|
9
|
+
infoMethod: getCustomTableList, // 回显用的接口
|
|
10
|
+
infoMethodParams: {}, // 回显用的接口参数
|
|
11
|
+
submitMethod: setCustomTableList, // 保存用的接口
|
|
12
|
+
submitMethodParams: {}, // 保存用的接口参数
|
|
13
|
+
slots: ["source_material_count"] // 需要使用插槽的字段集合
|
|
14
|
+
}
|
|
15
|
+
并通过事件Event @setColumn="handleSetColumn" 实现对列的设置
|
|
16
|
+
const handleSetColumn = (columns) => {
|
|
17
|
+
this.gridOptions.columns = [
|
|
18
|
+
{ type: "checkbox", width: 50, fixed: "left" },
|
|
19
|
+
{ type: "seq", width: 50, fixed: "left", title: "序号" },
|
|
20
|
+
...columns,
|
|
21
|
+
{ title: "操作", width: 80, fixed: "right", slots: { default: "operate" }}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
#### Event
|
|
25
|
+
见[第三方插件vxe-table](./extension.md)
|
|
26
|
+
完整案列见 [表格 by-table](../README.md)
|