element-assits 0.0.25 → 0.0.26

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/README.md CHANGED
@@ -34,8 +34,6 @@ Vue 原型上挂载了 `$asyncLoad` 方法
34
34
 
35
35
  ## 用法
36
36
 
37
- > 详细文档有时间再补全
38
-
39
37
  ### 表格组件 EaTable
40
38
  此组件扩展了 el-table 组件。不同的是:
41
39
  - 它完全使用对象数组来控制表格列
@@ -52,19 +50,17 @@ Vue 原型上挂载了 `$asyncLoad` 方法
52
50
  | loading | 表格加载状态 | Boolean | undefined |
53
51
  | initRequest | 是否初始化发送请求 | Boolean | true |
54
52
  | innerForm | 内部 - 表单(搜索栏) | Boolean \| Object | undefined |
55
- | innerIndex | 内部 - 索引 | Boolean \| Object | true
56
- | innerSelection | 内部 - 选中列 | Boolean \| Object | undefined
57
- | innerPagination | 内部 - 分页 | Boolean \| Object | undefined
58
- | innerOperation | 内部 - 操作栏(尾列)| Boolean \| Object | undefined
59
-
60
- > `innerForm` 额外属性(其余将绑定至EaForm):
61
- $~~~~$`limit` 限制默认显示的搜索条件数量
62
- $~~~~$`referenceItemWidth` 单项参考宽度
63
- $~~~~$`maxItemWidth` 单项最大宽度
64
- $~~~~$`loading` 控制更多按钮的加载状态
65
- $~~~~$`column[].exclusiveDoubleCells` 允许某一项独占两格
66
- > `innerSelection` 可以绑定 `{ data: selectedRows }` 接收选中的行。
67
- > `innerOperation` 可以绑定 `{ maxNumOfBtn: 3 }` 设置操作栏最大显示的按钮数,超出将被折叠。
53
+ | innerForm.limit|限制默认显示的搜索条件数量|Number \| auto \| all|auto|
54
+ | innerForm.referenceItemWidth|单项参考宽度|Number|180|
55
+ | innerForm.maxItemWidth|单项最大宽度|Number|240|
56
+ | innerForm.loading|控制更多按钮加载状态|Boolean|false|
57
+ | innerForm.column[].exclusiveDoubleCells|允许某一项独占两格|Boolean|false|
58
+ | innerIndex | 内部 - 索引 | Boolean \| Object | true|
59
+ | innerSelection | 内部 - 选中列 | Boolean \| Object | undefined|
60
+ | innerSelection.data|选中的行|Array| [] |
61
+ | innerPagination | 内部 - 分页 | Boolean \| Object | undefined|
62
+ | innerOperation | 内部 - 操作栏(尾列)| Boolean \| Object | undefined|
63
+ | innerOperation.maxNumOfBtn|最大显示的按钮数,溢出折叠|Number|3|
68
64
 
69
65
  ## methods
70
66
 
@@ -86,11 +82,9 @@ $~~~~$`column[].exclusiveDoubleCells` 允许某一项独占两格
86
82
  | footer | bottom-menu&分页 | 表格底部
87
83
 
88
84
  ## events
89
- `search-reset` 搜索重置事件,默认重置搜索表单并搜索。
90
- 一旦监听该事件,则阻止默认行为,参数为三项回调:
91
- $~~~~$ `callback` 执行默认行为
92
- $~~~~$ `reset` 仅执行重置
93
- $~~~~$ `search` 仅执行搜索
85
+ | 事件名 | 说明 | 参数 |
86
+ |:---|:---|:---|
87
+ |search-reset| 搜索重置事件|callback 重置表单并搜索(不监听时默认行为) <br> reset 仅重置表单<br> search 仅搜索 |
94
88
 
95
89
  ## column-attributes
96
90
  | 属性名 | 类型 | 默认值 | 说明 |
@@ -103,39 +97,32 @@ $~~~~$ `search` 仅执行搜索
103
97
  ---
104
98
 
105
99
  ### 表单组件 EaForm
106
- ```
107
- // form
108
- props: {
109
- model: { type: Object, default: () => ({}) },
110
- rules: { type: Object, default: () => ({}) },
111
- column: { type: Array, default: () => ([]) },
112
- labelWidth: { type: String, default: undefined },
113
- inline: { type: Boolean, default: false },
114
- dense: { type: Boolean, default: false }
115
- },
116
- methods: {
117
- setData (row) {
118
- // 设置表单值
119
- }
120
- }
121
- // form-item
122
- {
123
- label: '名称', // 必须,标签名 String | Function
124
- prop: 'name', // 必须,属性名 String
125
- labelTooltip: '名称的tips', // 可选,名称描述tips String | Object
126
- required: true, // 可选(默认false),是否必填 Boolean
127
- component: 'el-input', // 可选(默认el-input),所用组件 String | Component
128
- rules: [], // 可选,校验规则 Array | Function
129
- bind: {}, // 可选,组件v-bind Object
130
- on: {}, // 可选,组件v-on Object
131
- show: false, // 可选(默认true),控制表单项是否显示 Boolean | Function
132
- enable: false, // 可选(默认true),控制表单项是否启用 Boolean | Function
133
- span: 12, // 可选(默认12),所占栅格
134
- pull: 12, // 可选,栅格偏移
135
- push: 12, // 可选,栅格偏移
136
- offset: 12, // 可选,栅格偏移
137
- }
138
- ```
100
+
101
+ ## props
102
+ | 属性名 | 说明 | 类型 | 默认值 |
103
+ |:---|:---|:---|:---|
104
+ |model|表单数据对象|Object|
105
+ |rules|表单验证规则对象|Object|
106
+ |dense|是否紧凑模式|Boolean|false|
107
+ |column|表单项信息组|Array|必填|
108
+ |column[].label|标签名|String \| Function|必填|
109
+ |column[].prop|属性名|String|必填|
110
+ |column[].labelTooltip|名称描述tips|String \| Object|
111
+ |column[].required|是否必填|Boolean|false|
112
+ |column[].component|所用组件|String \| Component|el-input|
113
+ |column[].rules|校验规则|Array \| Function|
114
+ |column[].bind|组件v-bind|Object|
115
+ |column[].on|组件v-on|Object|
116
+ |column[].show|控制表单项是否显示|Boolean \| Function|true|
117
+ |column[].enable|控制表单项是否启用|Boolean \| Function|true|
118
+ |column[].span|所占栅格|Number|12|
119
+ |column[].pull|栅格偏移|Number|
120
+ |column[].push|栅格偏移|Number|
121
+ |column[].offset|栅格偏移|Number|
122
+ ## methods
123
+ | 方法 | 说明 | 参数 |
124
+ |:---|:---|:---|
125
+ |setData|设置表单数据对象的值|要设置的数据对象|
139
126
 
140
127
  ### 按钮 EaButton
141
128
  ```
@@ -273,27 +260,29 @@ props: {
273
260
  ```
274
261
 
275
262
  ### 描述列表 EaDesc
276
- ```
277
- props: {
278
- title: { type: String, default: undefined },
279
- data: { type: Object, required: true },
280
- column: { type: Array, required: true },
281
- labelWidth: { type: [Number, String], default: 100 },
282
- split: { type: Number, default: 2 },
283
- diff: { type: Array, default: undefined },
284
- gutter: { type: Number, default: 0 }
285
- },
286
- ```
263
+
264
+ ## props
265
+ | 属性名 | 含义 | 类型 | 默认值 |
266
+ |:---|:---|:---|:---|
267
+ |title|标题|String|undefined|
268
+ |data|数据|Object|必填|
269
+ |column|列信息|Array|必填|
270
+ |column[].bind.class|单独设置类|Object|undefined|
271
+ |column[].bind.style|单独设置样式|Object|undefined|
272
+ |labelWidth|标签宽度|Number \| String|100|
273
+ |split|分割数量|Number|2|
274
+ |diff|有差异的列信息|Array|undefined|
275
+ |gutter|间隔|Number|0|
287
276
 
288
277
  ### 弹窗文件上传 EaFileUpload
289
- ```
290
- props: {
291
- title: { type: String, default: '文件上传' },
292
- multiple: { type: Boolean, default: false },
293
- limit: { type: Number, default: 1 },
294
- suffix: { type: String, default: 'xlsx,xls' },
295
- httpRequest: { type: Function, required: true },
296
- httpTemplate: { type: Function, default: undefined },
297
- httpFinally: { type: Function, default: undefined }
298
- },
299
- ```
278
+
279
+ ## props
280
+ | 属性名 | 含义 | 类型 | 默认值 |
281
+ |:---|:---|:---|:---|
282
+ |title|标题|String|文件上传|
283
+ |multiple|是否多选|Boolean|false|
284
+ |limit|最大数量限制|Number|1|
285
+ |suffix|允许的文件后缀|String|xlsx,xls|
286
+ |httpRequest|文件上传|Function|必填|
287
+ |httpTemplate|模板下载|Function|undefined|
288
+ |httpFinally|请求完成|Function|undefined|
package/lib/index.js CHANGED
@@ -2758,7 +2758,7 @@ var _u = function() {
2758
2758
  return n("div", { staticClass: "ea-desc" }, [e._t("title", function() {
2759
2759
  return [e.title ? n("div", { staticClass: "ea-desc__title" }, [e._v(e._s(e.title))]) : e._e()];
2760
2760
  }), n("div", { staticClass: "ea-desc__list" }, e._l(e.initColumn, function(r) {
2761
- return n("div", { key: r.prop, class: { item: 1, "has-diff": r.__hasDiff }, style: r.__style }, [n("div", { staticClass: "item-label", style: { width: e.rawLabelWidth } }, [e._v(e._s(r.label))]), n("div", { staticClass: "item-value", style: { marginLeft: e.rawLabelWidth } }, [e._t(r.prop, function() {
2761
+ return n("div", { key: r.prop, class: { item: 1, "has-diff": r.__hasDiff, ...r.bind && r.bind.class }, style: { ...r.__style, ...r.bind && r.bind.style } }, [n("div", { staticClass: "item-label", style: { width: e.rawLabelWidth } }, [e._v(e._s(r.label))]), n("div", { staticClass: "item-value", style: { marginLeft: e.rawLabelWidth } }, [e._t(r.prop, function() {
2762
2762
  return [r.render ? n("div", [n(e.getComponent(r, e.data), { tag: "component" })], 1) : n("div", { class: { "value-no-wrap": r.__isTooLength } }, [e._v(" " + e._s(e.data[r.prop]) + " "), r.__isTooLength ? n("span", { staticClass: "click-see-more", on: { click: function(i) {
2763
2763
  r.__isTooLength = !1;
2764
2764
  } } }, [e._v("\u67E5\u770B\u66F4\u591A")]) : e._e()])];
package/lib/style.scss CHANGED
@@ -11,36 +11,6 @@ $--color-border-base: #DCDFE6 !default;
11
11
  $--color-border-light: #E4E7ED !default;
12
12
  $--color-border-lighter: #EBEEF5 !default;
13
13
  $--color-border-extralight: #F2F6FC !default;
14
- .ea-select {
15
- display: inline-block;
16
- position: relative;
17
- .el-select {
18
- width: 100%;
19
- }
20
- .async-loading.el-icon-loading {
21
- position: absolute;
22
- top: 10px;
23
- right: 28px;
24
- color: #999;
25
- }
26
- }
27
- .ea-select-popover {
28
- .el-select-dropdown__item {
29
- display: flex;
30
- justify-content: space-between;
31
- .select-item-value {
32
- overflow: hidden;
33
- text-overflow: ellipsis;
34
- }
35
- .select-item-desc {
36
- overflow: hidden;
37
- text-overflow: ellipsis;
38
- color: #8492a6;
39
- margin-left: 8px;
40
- }
41
- }
42
- }
43
-
44
14
  // table
45
15
  .ea-table {
46
16
  // 表格头部样式美化
@@ -158,6 +128,36 @@ $--color-border-extralight: #F2F6FC !default;
158
128
  transform: scaleY(0);
159
129
  }
160
130
 
131
+ .ea-select {
132
+ display: inline-block;
133
+ position: relative;
134
+ .el-select {
135
+ width: 100%;
136
+ }
137
+ .async-loading.el-icon-loading {
138
+ position: absolute;
139
+ top: 10px;
140
+ right: 28px;
141
+ color: #999;
142
+ }
143
+ }
144
+ .ea-select-popover {
145
+ .el-select-dropdown__item {
146
+ display: flex;
147
+ justify-content: space-between;
148
+ .select-item-value {
149
+ overflow: hidden;
150
+ text-overflow: ellipsis;
151
+ }
152
+ .select-item-desc {
153
+ overflow: hidden;
154
+ text-overflow: ellipsis;
155
+ color: #8492a6;
156
+ margin-left: 8px;
157
+ }
158
+ }
159
+ }
160
+
161
161
  .el-dialog.ea-modal {
162
162
  &.is-closing {
163
163
  margin: 0 0 50px !important;
@@ -241,6 +241,62 @@ td {
241
241
  }
242
242
  }
243
243
 
244
+ .ea-desc {
245
+ font-size: 14px;
246
+ &__title {
247
+ font-size: 16px;
248
+ margin-bottom: 12px;
249
+ }
250
+ &__list {
251
+ display: flex;
252
+ flex-wrap: wrap;
253
+ }
254
+ }
255
+ .ea-desc .item {
256
+ line-height: 24px;
257
+ margin-bottom: 10px;
258
+ flex: 0 0 auto;
259
+ .item-label {
260
+ float: left;
261
+ text-align: right;
262
+ padding-right: 8px;
263
+ color: #909399;
264
+ }
265
+ .item-value {
266
+ word-break: break-all;
267
+ overflow: hidden;
268
+ .value-no-wrap {
269
+ height: 48px;
270
+ overflow: hidden;
271
+ position: relative;
272
+ .click-see-more {
273
+ position: absolute;
274
+ right: 0;
275
+ bottom: 0;
276
+ height: 24px;
277
+ padding-left: 30px;
278
+ padding-right: 4px;
279
+ background-image: linear-gradient(to right, transparent 0%, #fff 20%, #fff 100%);
280
+ cursor: pointer;
281
+ color: $--color-primary;
282
+ user-select: none;
283
+ }
284
+ }
285
+ }
286
+ }
287
+
288
+ .ea-tree {
289
+ .ea-tree-real {
290
+ .el-tree-node > .el-tree-node__content{
291
+ border-radius: 4px;
292
+ }
293
+ .el-tree-node.is-current > .el-tree-node__content {
294
+ color: $--color-primary;
295
+ background-color: rgba($--color-primary, 0.1);
296
+ }
297
+ }
298
+ }
299
+
244
300
  .ea-split-container {
245
301
  display: flex;
246
302
  &.is-down {
@@ -278,18 +334,6 @@ td {
278
334
  }
279
335
  }
280
336
 
281
- .ea-tree {
282
- .ea-tree-real {
283
- .el-tree-node > .el-tree-node__content{
284
- border-radius: 4px;
285
- }
286
- .el-tree-node.is-current > .el-tree-node__content {
287
- color: $--color-primary;
288
- background-color: rgba($--color-primary, 0.1);
289
- }
290
- }
291
- }
292
-
293
337
  .ea-list {
294
338
  .loading-text {
295
339
  color: $--color-secondary-text;
@@ -298,50 +342,6 @@ td {
298
342
  }
299
343
  }
300
344
 
301
- .ea-desc {
302
- font-size: 14px;
303
- &__title {
304
- font-size: 16px;
305
- margin-bottom: 12px;
306
- }
307
- &__list {
308
- display: flex;
309
- flex-wrap: wrap;
310
- }
311
- }
312
- .ea-desc .item {
313
- line-height: 24px;
314
- margin-bottom: 10px;
315
- flex: 0 0 auto;
316
- .item-label {
317
- float: left;
318
- text-align: right;
319
- padding-right: 8px;
320
- color: #909399;
321
- }
322
- .item-value {
323
- word-break: break-all;
324
- overflow: hidden;
325
- .value-no-wrap {
326
- height: 48px;
327
- overflow: hidden;
328
- position: relative;
329
- .click-see-more {
330
- position: absolute;
331
- right: 0;
332
- bottom: 0;
333
- height: 24px;
334
- padding-left: 30px;
335
- padding-right: 4px;
336
- background-image: linear-gradient(to right, transparent 0%, #fff 20%, #fff 100%);
337
- cursor: pointer;
338
- color: $--color-primary;
339
- user-select: none;
340
- }
341
- }
342
- }
343
- }
344
-
345
345
  .ea-number .el-input__inner {
346
346
  text-align: left;
347
347
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "element-assits",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "element-ui 的扩展组件库",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",