general-basic-form 1.0.47 → 1.0.48
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 +244 -108
- package/dist/index.js +72 -53
- package/dist/index.umd.cjs +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
# GeneralBasicForm
|
|
1
|
+
# GeneralBasicForm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## 一个兼容 Vue2 、Vue3 和 React(未来实现) 的表单组件,支持typescript,vue2请使用@1版本,Vue3请使用@2版本
|
|
4
|
+
|
|
5
|
+
| 组件\兼容性 | vue2 | vue3 | Ant Design Vue(next) | Element Plus | Element(ui) |
|
|
4
6
|
| ------------------- | ---- | ---- | ---- | ---- | ---- |
|
|
5
7
|
| VGeneralBasicForm | √ | √ | | √ | √ |
|
|
6
8
|
| VSearchBox | √ | | | | √ |
|
|
7
9
|
| VInfiniteScrollList | | √ | | √ | |
|
|
8
|
-
| VDescriptions |
|
|
10
|
+
| VDescriptions | √ | √ | √ | √ | √ |
|
|
9
11
|
| VInputMobilecVerification | | √ | √ | √ | |
|
|
10
12
|
| VInputGraphicVerification | | √ | √ | √ | |
|
|
11
13
|
| VTreeTransfer | √ | | | | √ |
|
|
@@ -21,7 +23,8 @@ app.use(ElementPlus)
|
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
```
|
|
24
|
-
import { VGeneralBasicForm } from
|
|
26
|
+
import { VGeneralBasicForm } from 'general-basic-form'
|
|
27
|
+
import 'general-basic-form/style'
|
|
25
28
|
```
|
|
26
29
|
|
|
27
30
|
<VGeneralBasicForm
|
|
@@ -31,9 +34,10 @@ import { VGeneralBasicForm } from "general-basic-form";
|
|
|
31
34
|
:size="size"
|
|
32
35
|
ref="VGeneralBasicFormRef"
|
|
33
36
|
labelWidth="90px"
|
|
37
|
+
:noInputBlank="true"
|
|
34
38
|
>
|
|
35
39
|
<template v-slot:default>
|
|
36
|
-
|
|
40
|
+
...一些传入插槽的内容
|
|
37
41
|
</template>
|
|
38
42
|
<template v-slot:behind-the-button>
|
|
39
43
|
<el-form-item>
|
|
@@ -52,19 +56,20 @@ import { VGeneralBasicForm } from "general-basic-form";
|
|
|
52
56
|
size="small"
|
|
53
57
|
ref="VGeneralBasicFormRef"
|
|
54
58
|
:labelWidth="formLabelWidth"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// 外部传入的表单数据(可以是响应式数据),用于回填
|
|
59
|
+
:formData: {
|
|
60
|
+
// 外部传入的表单数据,用于回填
|
|
58
61
|
}
|
|
59
62
|
noUrlParameters
|
|
60
63
|
:afterReset="afterReset"
|
|
64
|
+
v-model:loading="loading"
|
|
61
65
|
/>
|
|
62
66
|
|
|
63
67
|
<style lang="scss" scoped>
|
|
64
|
-
:deep {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
:deep(.el-form-item) {
|
|
69
|
+
margin-bottom: 16px;
|
|
70
|
+
}
|
|
71
|
+
:deep(.el-divider--horizontal) {
|
|
72
|
+
margin: 8px 0px;
|
|
68
73
|
}
|
|
69
74
|
</style>
|
|
70
75
|
|
|
@@ -79,44 +84,44 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
79
84
|
|
|
80
85
|
表单数据校验需要拿到内部表单的ref
|
|
81
86
|
|
|
82
|
-
|
|
83
|
-
VGeneralBasicFormRef.$refs[
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
http
|
|
98
|
-
.getMobileByAccNum({ accNum })
|
|
99
|
-
.then((res) => {
|
|
100
|
-
if (res) {
|
|
101
|
-
if (res.data) {
|
|
102
|
-
}
|
|
103
|
-
resolve(true);
|
|
104
|
-
}else {
|
|
105
|
-
resolve(false);
|
|
106
|
-
}
|
|
107
|
-
})
|
|
108
|
-
.catch((error) => {
|
|
109
|
-
resolve(false);
|
|
110
|
-
});
|
|
87
|
+
async getSmscode() {
|
|
88
|
+
const VGeneralBasicFormRef = this.$refs['VGeneralBasicFormRef'] as any
|
|
89
|
+
const state = await new Promise<boolean>((resolve, reject) => {
|
|
90
|
+
VGeneralBasicFormRef.$refs['queryFormRef']?.validateField(
|
|
91
|
+
'user_phone',
|
|
92
|
+
async (valid: boolean, props?: FormItemProp[] | undefined) => {
|
|
93
|
+
if (valid) {
|
|
94
|
+
const { user_phone } = VGeneralBasicFormRef['queryParams']
|
|
95
|
+
const res: any = await SmscodeList({ user_phone })
|
|
96
|
+
if (res) {
|
|
97
|
+
console.log(res)
|
|
98
|
+
resolve(true)
|
|
99
|
+
} else {
|
|
100
|
+
resolve(false)
|
|
101
|
+
}
|
|
111
102
|
} else {
|
|
112
|
-
resolve(false)
|
|
103
|
+
resolve(false)
|
|
113
104
|
}
|
|
114
105
|
}
|
|
115
|
-
)
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
106
|
+
)
|
|
107
|
+
})
|
|
108
|
+
return state
|
|
109
|
+
},
|
|
110
|
+
|
|
111
|
+
setup写法:
|
|
112
|
+
const VGeneralBasicFormRef = ref()
|
|
113
|
+
const params = await new Promise<any>((resolve, reject) => {
|
|
114
|
+
VGeneralBasicFormRef.value.$refs['queryFormRef']?.validate(
|
|
115
|
+
async (valid: boolean, props?: FormItemProp[] | undefined) => {
|
|
116
|
+
if (valid) {
|
|
117
|
+
const params = VGeneralBasicFormRef.value['queryParams']
|
|
118
|
+
resolve(params)
|
|
119
|
+
} else {
|
|
120
|
+
resolve(false)
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
})
|
|
120
125
|
|
|
121
126
|
|
|
122
127
|

|
|
@@ -133,11 +138,11 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
133
138
|
noInputBlank: true //校验input框不能仅输入空格
|
|
134
139
|
//例子:formData.value.x=y ✘ | formData.value={...formData.value,x:y} ✔
|
|
135
140
|
formItem: [
|
|
136
|
-
{
|
|
141
|
+
{
|
|
137
142
|
label: '',
|
|
138
143
|
prop: 'bsName35',
|
|
139
144
|
type: 'divider',
|
|
140
|
-
|
|
145
|
+
setting: {
|
|
141
146
|
},
|
|
142
147
|
template: {
|
|
143
148
|
default: () => {
|
|
@@ -148,12 +153,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
148
153
|
{ label: "款式名称",
|
|
149
154
|
prop: "bsName",
|
|
150
155
|
type: "input",
|
|
151
|
-
|
|
156
|
+
setting: {
|
|
152
157
|
placeholder: '请输入手机验证码',
|
|
153
|
-
style: 'width: 100%'
|
|
154
|
-
"prefix-icon": "el-icon-search"
|
|
158
|
+
style: 'width: 100%'
|
|
155
159
|
},
|
|
156
|
-
class: "flex-item",
|
|
157
160
|
rules: [
|
|
158
161
|
{
|
|
159
162
|
message: "请输入信息"
|
|
@@ -163,29 +166,30 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
163
166
|
message: "请输入正确的Invoice单号"
|
|
164
167
|
}
|
|
165
168
|
],
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
template: {
|
|
170
|
+
suffix: () => {
|
|
171
|
+
return <svg-icon icon-class="baifenbi" />;
|
|
172
|
+
},
|
|
173
|
+
},
|
|
169
174
|
},
|
|
170
175
|
{
|
|
171
176
|
label: "二次工艺",
|
|
172
177
|
prop: "spName",
|
|
173
178
|
type: "select",
|
|
174
|
-
|
|
179
|
+
setting:{ multiple:true, //多选},
|
|
175
180
|
option: [
|
|
176
|
-
{ value: "3", label: "满印" },
|
|
181
|
+
{ value: "3", label: "满印" },
|
|
177
182
|
{ value: "1", label: "区域印花" },
|
|
178
183
|
{ value: "2", label: "绣花" },
|
|
179
184
|
],
|
|
180
|
-
change:
|
|
181
|
-
|
|
182
|
-
}
|
|
185
|
+
change:(e) => {
|
|
186
|
+
}
|
|
183
187
|
},
|
|
184
188
|
{
|
|
185
189
|
label: "创建时间",
|
|
186
190
|
prop: "create_time",
|
|
187
191
|
type: "date-picker",
|
|
188
|
-
|
|
192
|
+
setting: {
|
|
189
193
|
"range-separator": "至",
|
|
190
194
|
}
|
|
191
195
|
},
|
|
@@ -193,12 +197,8 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
193
197
|
label: "二次工艺成本价格(人民币分)",
|
|
194
198
|
prop: "spCost",
|
|
195
199
|
type: "input-number",
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
placeholder: '请输入配比',
|
|
199
|
-
precision:2,
|
|
200
|
-
min: 0,
|
|
201
|
-
},
|
|
200
|
+
"controls-position": "right",
|
|
201
|
+
min: 0,
|
|
202
202
|
rules: [
|
|
203
203
|
{
|
|
204
204
|
required: true,
|
|
@@ -208,11 +208,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
208
208
|
],
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
|
-
// vue2未实现
|
|
212
211
|
label: '',
|
|
213
212
|
prop: 'bsName2',
|
|
214
213
|
type: 'input-graphic-verification',
|
|
215
|
-
|
|
214
|
+
setting: {
|
|
216
215
|
placeholder: '请输入图形验证码',
|
|
217
216
|
style: 'width: 100%'
|
|
218
217
|
},
|
|
@@ -234,24 +233,23 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
234
233
|
placeholder: '请输入手机验证码',
|
|
235
234
|
style: 'width: 100%'
|
|
236
235
|
},
|
|
236
|
+
buttonSetting: {
|
|
237
|
+
type: "text",
|
|
238
|
+
style: 'text-align: end',
|
|
239
|
+
},
|
|
237
240
|
rules: [
|
|
238
241
|
{
|
|
239
242
|
message: '请输入手机验证码',
|
|
240
243
|
trigger: 'blur'
|
|
241
244
|
}
|
|
242
245
|
],
|
|
243
|
-
verificationSetting: {
|
|
244
|
-
defaultText: "查询",
|
|
245
|
-
restTime: 5,
|
|
246
|
-
},
|
|
247
246
|
getSmscode,// 获取验证码的回调函数,获取失败必须返回false,否则计时器不会重新计算
|
|
248
247
|
},
|
|
249
248
|
{
|
|
250
|
-
// vue2未实现
|
|
251
249
|
label: '是否必填',
|
|
252
250
|
prop: 'is_optional',
|
|
253
251
|
type: 'radio',
|
|
254
|
-
|
|
252
|
+
setting: {
|
|
255
253
|
disabled: true
|
|
256
254
|
},
|
|
257
255
|
option: [
|
|
@@ -267,12 +265,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
267
265
|
]
|
|
268
266
|
},
|
|
269
267
|
{
|
|
270
|
-
// 使用时需要在formData中定义好prop的默认值
|
|
271
|
-
// 例 formData:{ is_multi:[]}
|
|
272
268
|
label: '多选',
|
|
273
269
|
prop: 'is_multi',
|
|
274
270
|
type: 'checkbox',
|
|
275
|
-
|
|
271
|
+
setting: {
|
|
276
272
|
},
|
|
277
273
|
option: [
|
|
278
274
|
{ value: '是', label: 'true' },
|
|
@@ -281,7 +277,6 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
281
277
|
rules: []
|
|
282
278
|
},
|
|
283
279
|
{
|
|
284
|
-
// vue2未实现
|
|
285
280
|
label: '受访人',
|
|
286
281
|
prop: 'contactors',
|
|
287
282
|
type: 'form-item-slot',
|
|
@@ -300,7 +295,7 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
300
295
|
label: "分类",
|
|
301
296
|
prop: "分类",
|
|
302
297
|
type: "cascader",
|
|
303
|
-
|
|
298
|
+
setting:{},
|
|
304
299
|
options: [
|
|
305
300
|
{
|
|
306
301
|
value: "zhinan",
|
|
@@ -376,31 +371,154 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
|
|
|
376
371
|
|
|
377
372
|
//divider支持template:
|
|
378
373
|
//default
|
|
374
|
+
支持组件type:
|
|
379
375
|
|
|
380
|
-
|
|
381
|
-
install: npm i general-basic-form
|
|
376
|
+
/**
|
|
382
377
|
|
|
383
|
-
|
|
378
|
+
\* @description: 输入框
|
|
384
379
|
|
|
385
|
-
|
|
386
|
-
import { VSearchBox } from "general-basic-form";
|
|
387
|
-
```
|
|
380
|
+
*/
|
|
388
381
|
|
|
389
|
-
|
|
382
|
+
'input' = 'input',
|
|
390
383
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
384
|
+
/**
|
|
385
|
+
|
|
386
|
+
\* @description: 输入框/图像验证码
|
|
387
|
+
|
|
388
|
+
*/
|
|
389
|
+
|
|
390
|
+
'input-graphic-verification' = 'input-graphic-verification',
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
|
|
394
|
+
\* @description: 输入框/手机验证码
|
|
395
|
+
|
|
396
|
+
*/
|
|
397
|
+
|
|
398
|
+
'input-mobile-verification' = 'input-mobile-verification',
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
|
|
402
|
+
\* @description: 分割线
|
|
403
|
+
|
|
404
|
+
*/
|
|
405
|
+
|
|
406
|
+
'divider' = 'divider',
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
|
|
410
|
+
\* @description: 选择器
|
|
411
|
+
|
|
412
|
+
*/
|
|
413
|
+
|
|
414
|
+
'select' = 'select',
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
|
|
418
|
+
\* @description: 级联选择器
|
|
395
419
|
|
|
420
|
+
*/
|
|
396
421
|
|
|
422
|
+
'cascader' = 'cascader',
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
|
|
426
|
+
\* @description: 日期选择器
|
|
427
|
+
|
|
428
|
+
*/
|
|
429
|
+
|
|
430
|
+
'date-picker' = 'date-picker',
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
|
|
434
|
+
\* @description: 数字输入框
|
|
435
|
+
|
|
436
|
+
*/
|
|
437
|
+
|
|
438
|
+
'input-number' = 'input-number',
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
|
|
442
|
+
\* @description: 单选框
|
|
443
|
+
|
|
444
|
+
*/
|
|
445
|
+
|
|
446
|
+
'radio' = 'radio',
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
|
|
450
|
+
\* @description: 自定义元素,插槽组件
|
|
451
|
+
|
|
452
|
+
*/
|
|
453
|
+
|
|
454
|
+
'form-item-slot'='form-item-slot',
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
|
|
458
|
+
\* @description: 多选框
|
|
459
|
+
|
|
460
|
+
*/
|
|
461
|
+
|
|
462
|
+
'checkbox'='checkbox',
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
# VInfiniteScrollList对虚拟滚动列表+接口的封装
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+

|
|
471
|
+
|
|
472
|
+
```
|
|
473
|
+
import { VInfiniteScrollList } from 'general-basic-form'
|
|
474
|
+
import 'general-basic-form/style'
|
|
475
|
+
<VInfiniteScrollList
|
|
476
|
+
:search="search"
|
|
477
|
+
id="user_id"
|
|
478
|
+
name="name"
|
|
479
|
+
ref="InfiniteScrollListRef"
|
|
480
|
+
checkbox
|
|
481
|
+
:extra="extraRender"
|
|
482
|
+
:max="1"
|
|
483
|
+
/>
|
|
484
|
+
```
|
|
485
|
+
```
|
|
486
|
+
移动端配合下拉刷新使用
|
|
487
|
+
import { getOrderItem } from "../orderItem/functional"
|
|
488
|
+
// getOrderItem为JSX函数,返回一个VUE组件
|
|
489
|
+
|
|
490
|
+
<t-pull-down-refresh v-model="refreshing" @refresh="onRefresh" class="refresh-content">
|
|
491
|
+
<VInfiniteScrollList :search="loadData" :checkbox="false" id="cancelId" ref="InfiniteScrollListRef" checkbox
|
|
492
|
+
:extra="getOrderItem" height="100%" infinite-scroll-distance="50"/>
|
|
493
|
+
</t-pull-down-refresh>
|
|
494
|
+
```
|
|
495
|
+
```
|
|
496
|
+
search:数据接口 (page: Number) => Promise<[]>
|
|
497
|
+
id:数据key值(唯一和选择值)
|
|
498
|
+
name:显示名字
|
|
499
|
+
checkbox:是否有多选功能,不传的话就是单纯的虚拟滚动列表
|
|
500
|
+
extra:同行额外显示的内容,(item: any) => VNode | String;
|
|
501
|
+
//el-checkbox有固定高度,如果需要配置高度比较高,例如有换行的自定义extra,最好处理一下样式,例子:
|
|
502
|
+
//:deep(.el-checkbox) {
|
|
503
|
+
// padding: 6px 16px !important;
|
|
504
|
+
// display: flex;
|
|
505
|
+
// align-items: baseline;
|
|
506
|
+
// height: auto;
|
|
507
|
+
//}
|
|
508
|
+
defaultSelection:包含数据key值的对象数组或者直接传入key值数组
|
|
509
|
+
height:默认272px String
|
|
510
|
+
```
|
|
397
511
|
|
|
398
512
|
```
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
513
|
+
defineExpose({ reset, loadList, selectInfo, list, ifbottom });
|
|
514
|
+
InfiniteScrollListRef?.value?.reset():重置列表内容
|
|
515
|
+
InfiniteScrollListRef?.value?.lowReset():重置列表内容,但保留已选择的选项
|
|
516
|
+
InfiniteScrollListRef?.value?.loadList():向下滚动列表内容,受到loading和ifbottom的影响
|
|
517
|
+
InfiniteScrollListRef?.value?.refreshList():刷新列表,滚动列表会对整个内容重新请求数据,已选择的内容会自动选择
|
|
518
|
+
InfiniteScrollListRef?.value?.selectInfo:选择的内容
|
|
519
|
+
InfiniteScrollListRef?.value?.list:列表的内容
|
|
520
|
+
InfiniteScrollListRef?.value?.ifbottom:是否到底部
|
|
521
|
+
InfiniteScrollListRef?.value?.loading:加载中
|
|
404
522
|
```
|
|
405
523
|
|
|
406
524
|
# VDescriptions对展示描述列表的封装
|
|
@@ -412,8 +530,8 @@ import { VDescriptions } from 'general-basic-form'
|
|
|
412
530
|
<VDescriptions
|
|
413
531
|
:formData="props.formData"
|
|
414
532
|
:formItem="formItem"
|
|
533
|
+
componentType="Ant Design Vue"
|
|
415
534
|
...其他el-descriptions的配置
|
|
416
|
-
如:size="mini" :column="1"
|
|
417
535
|
/>
|
|
418
536
|
```
|
|
419
537
|
|
|
@@ -436,22 +554,40 @@ formItem:[ {
|
|
|
436
554
|
'label-class-name': 'label-class-name'
|
|
437
555
|
}
|
|
438
556
|
}]
|
|
439
|
-
|
|
557
|
+
componentType:"Ant Design Vue"|"Element Plus"(默认)
|
|
558
|
+
strict:Boolean //使用strict参数后,如果formData内的某个字段没有值,对应的描述元素将不会展示(包括标签文字),但有render的字段仍然会展示
|
|
559
|
+
descriptionsItemProps:a-descriptions-item|el-descriptions-item的配置
|
|
440
560
|
```
|
|
441
561
|
|
|
442
|
-
#
|
|
562
|
+
# VInputMobilecVerification,VInputGraphicVerification表单里的图形验证码、手机验证码组件,可以单独引入
|
|
443
563
|
|
|
444
|
-
|
|
564
|
+
```
|
|
565
|
+
<VInputGraphicVerification :item="{同表单,可忽略label和rules字段}" :loading="loading"></VInputGraphicVerification>
|
|
445
566
|
|
|
446
|
-
|
|
447
|
-
import { VTreeTransfer } from 'general-basic-form'
|
|
448
|
-
<VTreeTransfer ref="TreeTransferRef" :data-source.sync="treeFromData" filterable :checkedKeys="checkedKeys">
|
|
449
|
-
</VTreeTransfer>
|
|
567
|
+
<VInputMobilecVerification :item="{同表单,可忽略label和rules字段}" componentType="Ant Design Vue" ref="VInputMobilecVerificationRef"></VInputMobilecVerification>
|
|
450
568
|
```
|
|
451
569
|
|
|
452
570
|
```
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
571
|
+
componentType:"Ant Design Vue"|"Element Plus"(默认)
|
|
572
|
+
```
|
|
573
|
+
|
|
456
574
|
```
|
|
575
|
+
此用法下必须提供:
|
|
576
|
+
provide(/* 注入名 */ "queryParams", /* 表单值对象 */ queryParams);
|
|
577
|
+
|
|
578
|
+
componentType为Ant Design Vue需要提供:
|
|
579
|
+
import { Form } from 'ant-design-vue';
|
|
580
|
+
provide(/* 注入名 */ "Form", /* Ant Design Vue Form实例,用于表单数据更新等 */ Form);
|
|
581
|
+
|
|
582
|
+
可选:
|
|
583
|
+
provide("size", size); // 同组件size
|
|
584
|
+
provide("getList", getList); // 输入框回车触发
|
|
585
|
+
|
|
586
|
+
调用发送短信验证码和重置的方法
|
|
587
|
+
VInputMobilecVerificationRef.value.VerificationButtonRef.buttonClick()
|
|
588
|
+
VInputMobilecVerificationRef.value.VerificationButtonRef.reset()
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
安装:npm i general-basic-form<br/>
|
|
592
|
+
install: npm i general-basic-form
|
|
457
593
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { nextTick as
|
|
2
|
-
function u(t, e, n, r, s, o, c,
|
|
1
|
+
import { nextTick as g } from "vue";
|
|
2
|
+
function u(t, e, n, r, s, o, c, h) {
|
|
3
3
|
var a = typeof t == "function" ? t.options : t;
|
|
4
4
|
e && (a.render = e, a.staticRenderFns = n, a._compiled = !0), r && (a.functional = !0), o && (a._scopeId = "data-v-" + o);
|
|
5
5
|
var i;
|
|
@@ -7,7 +7,7 @@ function u(t, e, n, r, s, o, c, f) {
|
|
|
7
7
|
l = l || // cached call
|
|
8
8
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
9
9
|
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !l && typeof __VUE_SSR_CONTEXT__ < "u" && (l = __VUE_SSR_CONTEXT__), s && s.call(this, l), l && l._registeredComponents && l._registeredComponents.add(c);
|
|
10
|
-
}, a._ssrRegister = i) : s && (i =
|
|
10
|
+
}, a._ssrRegister = i) : s && (i = h ? function() {
|
|
11
11
|
s.call(
|
|
12
12
|
this,
|
|
13
13
|
(a.functional ? this.parent : this).$root.$options.shadowRoot
|
|
@@ -15,9 +15,9 @@ function u(t, e, n, r, s, o, c, f) {
|
|
|
15
15
|
} : s), i)
|
|
16
16
|
if (a.functional) {
|
|
17
17
|
a._injectStyles = i;
|
|
18
|
-
var
|
|
19
|
-
a.render = function(
|
|
20
|
-
return i.call(d),
|
|
18
|
+
var _ = a.render;
|
|
19
|
+
a.render = function(y, d) {
|
|
20
|
+
return i.call(d), _(y, d);
|
|
21
21
|
};
|
|
22
22
|
} else {
|
|
23
23
|
var p = a.beforeCreate;
|
|
@@ -28,7 +28,7 @@ function u(t, e, n, r, s, o, c, f) {
|
|
|
28
28
|
options: a
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const m = {
|
|
32
32
|
props: {
|
|
33
33
|
verificationSetting: {
|
|
34
34
|
type: Object,
|
|
@@ -76,28 +76,45 @@ const g = {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
|
-
var
|
|
79
|
+
var b = function() {
|
|
80
80
|
var e = this, n = e._self._c;
|
|
81
81
|
return n("el-button", { on: { click: e.buttonClick } }, [e._v(e._s(e.buttonType ? e.defaultText : e.buttonText + "s"))]);
|
|
82
|
-
},
|
|
83
|
-
g,
|
|
82
|
+
}, v = [], k = /* @__PURE__ */ u(
|
|
84
83
|
m,
|
|
85
84
|
b,
|
|
85
|
+
v,
|
|
86
86
|
!1,
|
|
87
87
|
null,
|
|
88
88
|
null,
|
|
89
89
|
null,
|
|
90
90
|
null
|
|
91
91
|
);
|
|
92
|
-
const
|
|
93
|
-
const
|
|
92
|
+
const x = k.exports, S = (t = {}) => {
|
|
93
|
+
for (const e in t)
|
|
94
|
+
if (Object.prototype.hasOwnProperty.call(t, e)) {
|
|
95
|
+
const n = t[e];
|
|
96
|
+
Object.prototype.toString.call(n) === "[object Object]" && (t[e] = JSON.stringify(n));
|
|
97
|
+
}
|
|
98
|
+
return t;
|
|
99
|
+
}, T = (t = {}) => {
|
|
100
|
+
for (const e in t)
|
|
101
|
+
if (Object.prototype.hasOwnProperty.call(t, e)) {
|
|
102
|
+
const n = t[e];
|
|
103
|
+
try {
|
|
104
|
+
t[e] = JSON.parse(n);
|
|
105
|
+
} catch {
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return t;
|
|
109
|
+
}, P = { paramsToQuery: S, queryToData: T }, f = P;
|
|
110
|
+
const F = {
|
|
94
111
|
name: "GeneralBasicForm",
|
|
95
112
|
components: {
|
|
96
113
|
InputArchive: (t) => {
|
|
97
114
|
const { templateEle: e } = t;
|
|
98
115
|
return e();
|
|
99
116
|
},
|
|
100
|
-
VerificationButton:
|
|
117
|
+
VerificationButton: x
|
|
101
118
|
},
|
|
102
119
|
props: {
|
|
103
120
|
showSearch: {
|
|
@@ -163,7 +180,7 @@ const x = {
|
|
|
163
180
|
var t;
|
|
164
181
|
return {
|
|
165
182
|
queryParams: {
|
|
166
|
-
...this.noUrlParameters ? {} : (t = this.$route) == null ? void 0 : t.query
|
|
183
|
+
...this.noUrlParameters ? {} : f.queryToData((t = this.$route) == null ? void 0 : t.query)
|
|
167
184
|
},
|
|
168
185
|
// form表单数据
|
|
169
186
|
formLoading: this.loading || !1,
|
|
@@ -244,11 +261,13 @@ const x = {
|
|
|
244
261
|
/** 搜索按钮操作 */
|
|
245
262
|
handleQuery() {
|
|
246
263
|
var n;
|
|
247
|
-
const t = { page: 1, limit: 10 }, e =
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
264
|
+
const t = { page: 1, limit: 10 }, e = f.paramsToQuery(
|
|
265
|
+
{
|
|
266
|
+
...(n = this.$route) == null ? void 0 : n.query,
|
|
267
|
+
...this.queryParams,
|
|
268
|
+
...t
|
|
269
|
+
}
|
|
270
|
+
);
|
|
252
271
|
this.noUrlParameters || this.$router.push({
|
|
253
272
|
query: { ...e }
|
|
254
273
|
}), this.getList({
|
|
@@ -344,7 +363,7 @@ const x = {
|
|
|
344
363
|
}
|
|
345
364
|
}
|
|
346
365
|
};
|
|
347
|
-
var
|
|
366
|
+
var C = function() {
|
|
348
367
|
var e = this, n = e._self._c;
|
|
349
368
|
return n("el-form", e._b({ directives: [{ name: "show", rawName: "v-show", value: e.showSearch, expression: "showSearch" }], ref: "queryFormRef", attrs: { model: e.queryParams, "label-width": e.labelWidth } }, "el-form", e.attrs, !1), [e._l(e.formItem, function(r) {
|
|
350
369
|
return n("el-form-item", e._b({ key: r.prop, attrs: { rules: e.getItemRules(r) } }, "el-form-item", r, !1), [r.type === "input" ? n("el-input", e._g(e._b({ attrs: { size: e.size }, nativeOn: { keydown: function(s) {
|
|
@@ -379,18 +398,18 @@ var S = function() {
|
|
|
379
398
|
return n("el-checkbox", e._b({ key: s.key || s.value || s.label }, "el-checkbox", s, !1));
|
|
380
399
|
}), 1) : e._e()], 1);
|
|
381
400
|
}), e._t("default"), e.formOnly ? e._e() : n("el-form-item", [n("el-button", { attrs: { type: "primary", icon: "el-icon-search", size: e.size, loading: e.formLoading }, on: { click: e.handleQuery } }, [e._v("查询")]), n("el-button", { attrs: { icon: "el-icon-refresh", size: e.size }, on: { click: e.resetQuery } }, [e._v("重置")])], 1), e._t("behind-the-button")], 2);
|
|
382
|
-
},
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
401
|
+
}, $ = [], q = /* @__PURE__ */ u(
|
|
402
|
+
F,
|
|
403
|
+
C,
|
|
404
|
+
$,
|
|
386
405
|
!1,
|
|
387
406
|
null,
|
|
388
|
-
"
|
|
407
|
+
"171c263c",
|
|
389
408
|
null,
|
|
390
409
|
null
|
|
391
410
|
);
|
|
392
|
-
const
|
|
393
|
-
const
|
|
411
|
+
const w = q.exports;
|
|
412
|
+
const O = {
|
|
394
413
|
components: {},
|
|
395
414
|
props: {
|
|
396
415
|
query: {
|
|
@@ -450,24 +469,24 @@ const P = {
|
|
|
450
469
|
}
|
|
451
470
|
}
|
|
452
471
|
};
|
|
453
|
-
var
|
|
472
|
+
var D = function() {
|
|
454
473
|
var e = this, n = e._self._c;
|
|
455
474
|
return n("div", { staticClass: "search-box" }, [n("el-input", e._b({ style: { ...e.inputstyle }, attrs: { size: e.size }, nativeOn: { keydown: function(r) {
|
|
456
475
|
return !r.type.indexOf("key") && e._k(r.keyCode, "enter", 13, r.key, "Enter") ? null : e.search.apply(null, arguments);
|
|
457
476
|
} }, model: { value: e.keyWord, callback: function(r) {
|
|
458
477
|
e.keyWord = r;
|
|
459
478
|
}, expression: "keyWord" } }, "el-input", e.attrs, !1), [n("svg", { staticClass: "el-input__icon", attrs: { slot: "prefix", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" }, slot: "prefix" }, [n("path", { attrs: { d: "M9.51033 10.2186C8.69189 10.8814 7.64943 11.2784 6.51424 11.2784C3.88302 11.2784 1.75 9.14541 1.75 6.51421C1.75 3.88301 3.88302 1.75 6.51424 1.75C9.14545 1.75 11.2785 3.88301 11.2785 6.51421C11.2785 7.64942 10.8814 8.69189 10.2186 9.51034L13.75 13.0417L13.0417 13.75L9.51033 10.2186ZM10.2768 6.51421C10.2768 4.43623 8.59224 2.75168 6.51424 2.75168C4.43623 2.75168 2.75168 4.43623 2.75168 6.51421C2.75168 8.59219 4.43623 10.2767 6.51424 10.2767C8.59224 10.2767 10.2768 8.59219 10.2768 6.51421Z", fill: "#959A9F" } })])])], 1);
|
|
460
|
-
},
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
479
|
+
}, I = [], z = /* @__PURE__ */ u(
|
|
480
|
+
O,
|
|
481
|
+
D,
|
|
482
|
+
I,
|
|
464
483
|
!1,
|
|
465
484
|
null,
|
|
466
485
|
"ef706e31",
|
|
467
486
|
null,
|
|
468
487
|
null
|
|
469
488
|
);
|
|
470
|
-
const
|
|
489
|
+
const B = z.exports, E = {
|
|
471
490
|
functional: !0,
|
|
472
491
|
props: {
|
|
473
492
|
column: {
|
|
@@ -484,10 +503,10 @@ const D = w.exports, I = {
|
|
|
484
503
|
const { props: n } = e, { column: r, formData: s } = n;
|
|
485
504
|
return r.render(s);
|
|
486
505
|
}
|
|
487
|
-
},
|
|
506
|
+
}, R = {
|
|
488
507
|
name: "Descriptions",
|
|
489
508
|
components: {
|
|
490
|
-
DescriptionsColumn:
|
|
509
|
+
DescriptionsColumn: E
|
|
491
510
|
},
|
|
492
511
|
data() {
|
|
493
512
|
return {
|
|
@@ -523,23 +542,23 @@ const D = w.exports, I = {
|
|
|
523
542
|
}
|
|
524
543
|
}
|
|
525
544
|
};
|
|
526
|
-
var
|
|
545
|
+
var L = function() {
|
|
527
546
|
var e = this, n = e._self._c;
|
|
528
547
|
return n("el-descriptions", e._b({}, "el-descriptions", e.attrs, !1), e._l(e.formItem, function(r, s) {
|
|
529
548
|
return n("el-descriptions-item", e._b({ key: r.prop, attrs: { label: r.label } }, "el-descriptions-item", r.descriptionsItemProps, !1), [r.render ? n("DescriptionsColumn", { attrs: { column: r, formData: e.formData } }) : n("span", [e._v(e._s(e.formData[r.prop]))])], 1);
|
|
530
549
|
}), 1);
|
|
531
|
-
},
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
550
|
+
}, N = [], K = /* @__PURE__ */ u(
|
|
551
|
+
R,
|
|
552
|
+
L,
|
|
553
|
+
N,
|
|
535
554
|
!1,
|
|
536
555
|
null,
|
|
537
556
|
null,
|
|
538
557
|
null,
|
|
539
558
|
null
|
|
540
559
|
);
|
|
541
|
-
const
|
|
542
|
-
const
|
|
560
|
+
const j = K.exports;
|
|
561
|
+
const W = {
|
|
543
562
|
props: {
|
|
544
563
|
nodeKey: {
|
|
545
564
|
type: String,
|
|
@@ -566,7 +585,7 @@ const L = {
|
|
|
566
585
|
this.$refs.selectTree.filter(t);
|
|
567
586
|
},
|
|
568
587
|
checkedKeys(t) {
|
|
569
|
-
this.$refs.sourceTree.setCheckedKeys(t),
|
|
588
|
+
this.$refs.sourceTree.setCheckedKeys(t), g(() => {
|
|
570
589
|
this.getSelectedData(), this.$refs.selectTree.setCheckedKeys(t);
|
|
571
590
|
});
|
|
572
591
|
}
|
|
@@ -600,27 +619,27 @@ const L = {
|
|
|
600
619
|
}
|
|
601
620
|
}
|
|
602
621
|
};
|
|
603
|
-
var
|
|
622
|
+
var A = function() {
|
|
604
623
|
var e = this, n = e._self._c;
|
|
605
624
|
return n("div", { staticClass: "tree-box" }, [n("div", { staticClass: "left-box" }, [e.filterable ? n("el-input", { attrs: { placeholder: "输入关键字进行过滤" }, model: { value: e.sourceFilterText, callback: function(r) {
|
|
606
625
|
e.sourceFilterText = r;
|
|
607
626
|
}, expression: "sourceFilterText" } }) : e._e(), n("el-tree", e._b({ ref: "sourceTree", attrs: { data: e.dataSource, "filter-node-method": e.sourceFilterNode, nodeKey: e.nodeKey } }, "el-tree", { ...e.defaultTreeAttributes }, !1))], 1), n("div", { staticClass: "mid-box" }, [n("el-button", { attrs: { icon: "el-icon-arrow-right", circle: "" }, on: { click: e.getSelectedData } }), n("el-button", { attrs: { icon: "el-icon-arrow-left", circle: "" }, on: { click: e.removeSelectedData } })], 1), n("div", { staticClass: "right-box" }, [e.filterable ? n("el-input", { attrs: { placeholder: "输入关键字进行过滤" }, model: { value: e.selectedFilterText, callback: function(r) {
|
|
608
627
|
e.selectedFilterText = r;
|
|
609
628
|
}, expression: "selectedFilterText" } }) : e._e(), n("el-tree", e._b({ ref: "selectTree", attrs: { data: e.selectedList, "filter-node-method": e.sourceFilterNode, nodeKey: e.nodeKey } }, "el-tree", { ...e.defaultTreeAttributes }, !1))], 1)]);
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
629
|
+
}, G = [], U = /* @__PURE__ */ u(
|
|
630
|
+
W,
|
|
631
|
+
A,
|
|
632
|
+
G,
|
|
614
633
|
!1,
|
|
615
634
|
null,
|
|
616
635
|
"49dbad2a",
|
|
617
636
|
null,
|
|
618
637
|
null
|
|
619
638
|
);
|
|
620
|
-
const
|
|
639
|
+
const Q = U.exports, H = w, J = B, M = j, X = Q;
|
|
621
640
|
export {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
641
|
+
M as VDescriptions,
|
|
642
|
+
H as VGeneralBasicForm,
|
|
643
|
+
J as VSearchBox,
|
|
644
|
+
X as VTreeTransfer
|
|
626
645
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(o,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(o=typeof globalThis<"u"?globalThis:o||self,c(o.Index={},o.Vue))})(this,function(o,c){"use strict";const Q="";function d(t,e,n,r,s,l,f,A){var a=typeof t=="function"?t.options:t;e&&(a.render=e,a.staticRenderFns=n,a._compiled=!0),r&&(a.functional=!0),l&&(a._scopeId="data-v-"+l);var u;if(f?(u=function(i){i=i||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!i&&typeof __VUE_SSR_CONTEXT__<"u"&&(i=__VUE_SSR_CONTEXT__),s&&s.call(this,i),i&&i._registeredComponents&&i._registeredComponents.add(f)},a._ssrRegister=u):s&&(u=A?function(){s.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:s),u)if(a.functional){a._injectStyles=u;var U=a.render;a.render=function(j,h){return u.call(h),U(j,h)}}else{var p=a.beforeCreate;a.beforeCreate=p?[].concat(p,u):[u]}return{exports:t,options:a}}const _={props:{verificationSetting:{type:Object,default:()=>{}},getSmscode:{type:Function,default:()=>{}}},data(){return{defaultText:this.verificationSetting.defaultText||"获取验证码",buttonText:this.verificationSetting.defaultText||"获取验证码",restTime:this.verificationSetting.restTime||60,timer:null}},computed:{buttonType(){return this.buttonText===this.defaultText}},destroyed(){this.reset()},methods:{reset(){this.timer&&(clearInterval(this.timer),this.timer=null,this.buttonText=this.defaultText)},async buttonClick(){if(this.buttonText===this.defaultText)if(this.buttonText=this.restTime,this.timer=setInterval(()=>{if(Number(this.buttonText)<=0||!this.buttonText){this.reset();return}else this.buttonText=Number(this.buttonText)-1},1e3),this.getSmscode)await this.getSmscode()===!1&&this.reset();else return}}};var y=function(){var e=this,n=e._self._c;return n("el-button",{on:{click:e.buttonClick}},[e._v(e._s(e.buttonType?e.defaultText:e.buttonText+"s"))])},g=[],m=d(_,y,g,!1,null,null,null,null);const b=m.exports,H="",v={name:"GeneralBasicForm",components:{InputArchive:t=>{const{templateEle:e}=t;return e()},VerificationButton:b},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:()=>[]},size:{type:String,default:""},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}},noInputBlank:{type:Boolean,default:()=>!1}},data(){var t;return{queryParams:{...this.noUrlParameters?{}:(t=this.$route)==null?void 0:t.query},formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},inputSetting:{placeholder:"请输入",style:"width: 200px",clearable:!0},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},attrs:{inline:!0,"label-position":"left"}}},watch:{formData:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&(this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t})},immediate:!0},queryParams:{handler(t){this.$emit("update:formData",t)},deep:!0},$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},methods:{handleQuery(){var n;const t={page:1,limit:10},e={...(n=this.$route)==null?void 0:n.query,...this.queryParams,...t};this.noUrlParameters||this.$router.push({query:{...e}}),this.getList({...e})},async resetQuery(){var e;this.$refs.queryFormRef.resetFields();const t={page:1};this.noUrlParameters||await this.$router.push({query:{...t}}),this.queryParams={...this.noUrlParameters?{}:(e=this.$route)==null?void 0:e.query},this.afterReset(),this.handleQuery()},currentInputComponent(){return"input-archive"},getItemRules(t){const{type:e,rules:n=[]}=t,r=[...n];return this.noInputBlank&&e==="input"&&r.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),r},getInputSetting(t){const{inputSetting:e,setting:n}=t;return{...this.inputSetting,...e,...n}},defaultFunction(){},getInputEvents(t){return{blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction,change:t.change||this.defaultFunction,input:t.input||this.defaultFunction,clear:t.clear||this.defaultFunction}},getSelectSetting(t){const{selectSetting:e,setting:n}=t;return{...this.selectSetting,...e,...n}},getSelectEvents(t){return{change:t.change||this.defaultFunction,"visible-change":t["visible-change"]||this.defaultFunction,"remove-tag":t["remove-tag"]||this.defaultFunction,"expand-change":t["expand-change"]||this.defaultFunction,clear:t.clear||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getDatePackerSetting(t){const{datePackerSetting:e,setting:n}=t;return{...this.datePackerSetting,...e,...n}},getDatePackerEvents(t){return{change:t.change||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getCheckboxGroupSetting(t){const{checkboxGroupSetting:e,setting:n}=t;return{...e,...n}},getCheckboxGroupEvents(t){return{change:t.change||this.defaultFunction}}}};var k=function(){var e=this,n=e._self._c;return n("el-form",e._b({directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryFormRef",attrs:{model:e.queryParams,"label-width":e.labelWidth}},"el-form",e.attrs,!1),[e._l(e.formItem,function(r){return n("el-form-item",e._b({key:r.prop,attrs:{rules:e.getItemRules(r)}},"el-form-item",r,!1),[r.type==="input"?n("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(s,l){return{key:l,fn:function(){return[s?n(e.currentInputComponent(),{key:l,tag:"component",attrs:{templateEle:s}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="input-mobile-verification"?n("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(s,l){return{key:l,fn:function(){return[s?n(e.currentInputComponent(),{key:l,tag:"component",attrs:{templateEle:s}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r)),[n("template",{slot:"append"},[n("verification-button",{attrs:{verificationSetting:r.verificationSetting,getSmscode:r.getSmscode}})],1)],2):r.type==="select"?n("el-select",e._g(e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(r),!1),e.getSelectEvents(r)),e._l(r.option||[],function(s){return n("el-option",{key:s.key||s.value,attrs:{label:s.label,value:s.value}})}),1):r.type==="cascader"?n("el-cascader",e._g(e._b({attrs:{filterable:"",size:e.size,options:r.options||[]},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(r),!1),e.getSelectEvents(r))):r.type==="date-picker"?n("el-date-picker",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(r),!1),e.getDatePackerEvents(r))):e._e(),r.type==="input-number"?n("el-input-number",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="checkbox"?n("el-checkbox-group",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-checkbox-group",e.getCheckboxGroupSetting(r),!1),e.getCheckboxGroupEvents(r)),e._l(r.option||[],function(s){return n("el-checkbox",e._b({key:s.key||s.value||s.label},"el-checkbox",s,!1))}),1):e._e()],1)}),e._t("default"),e.formOnly?e._e():n("el-form-item",[n("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:e.size,loading:e.formLoading},on:{click:e.handleQuery}},[e._v("查询")]),n("el-button",{attrs:{icon:"el-icon-refresh",size:e.size},on:{click:e.resetQuery}},[e._v("重置")])],1),e._t("behind-the-button")],2)},x=[],S=d(v,k,x,!1,null,"f12b237b",null,null);const T=S.exports,M="",F={components:{},props:{query:{type:Object,default:()=>({prefCode:sessionStorage.getItem("prefCode")})},routePath:{type:String,default:()=>"/search/searchDetail"},inputstyle:{type:Object,default:()=>({width:"1280px"})},openHref:{type:Boolean,default:()=>!1},size:{type:String,default:()=>"medium"}},data(){var t,e;return{keyWord:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.keyWord)||"",attrs:{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}},methods:{search(){const t={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(t);window.open(e.href,"_blank")}else this.$router.push(t)}}};var C=function(){var e=this,n=e._self._c;return n("div",{staticClass:"search-box"},[n("el-input",e._b({style:{...e.inputstyle},attrs:{size:e.size},nativeOn:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(r){e.keyWord=r},expression:"keyWord"}},"el-input",e.attrs,!1),[n("svg",{staticClass:"el-input__icon",attrs:{slot:"prefix",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},slot:"prefix"},[n("path",{attrs:{d:"M9.51033 10.2186C8.69189 10.8814 7.64943 11.2784 6.51424 11.2784C3.88302 11.2784 1.75 9.14541 1.75 6.51421C1.75 3.88301 3.88302 1.75 6.51424 1.75C9.14545 1.75 11.2785 3.88301 11.2785 6.51421C11.2785 7.64942 10.8814 8.69189 10.2186 9.51034L13.75 13.0417L13.0417 13.75L9.51033 10.2186ZM10.2768 6.51421C10.2768 4.43623 8.59224 2.75168 6.51424 2.75168C4.43623 2.75168 2.75168 4.43623 2.75168 6.51421C2.75168 8.59219 4.43623 10.2767 6.51424 10.2767C8.59224 10.2767 10.2768 8.59219 10.2768 6.51421Z",fill:"#959A9F"}})])])],1)},P=[],$=d(F,C,P,!1,null,"ef706e31",null,null);const q=$.exports,w={name:"Descriptions",components:{DescriptionsColumn:{functional:!0,props:{column:{default:{render:()=>{}},type:Object},formData:{default:{},type:Object}},render(t,e){const{props:n}=e,{column:r,formData:s}=n;return r.render(s)}}},data(){return{attrs:{border:!0,class:"v-descriptions"}}},props:{formItem:{type:Array,default:()=>[]},formData:{type:Object,default:()=>{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}}};var D=function(){var e=this,n=e._self._c;return n("el-descriptions",e._b({},"el-descriptions",e.attrs,!1),e._l(e.formItem,function(r,s){return n("el-descriptions-item",e._b({key:r.prop,attrs:{label:r.label}},"el-descriptions-item",r.descriptionsItemProps,!1),[r.render?n("DescriptionsColumn",{attrs:{column:r,formData:e.formData}}):n("span",[e._v(e._s(e.formData[r.prop]))])],1)}),1)},I=[],z=d(w,D,I,!1,null,null,null,null);const O=z.exports,X="",B={props:{nodeKey:{type:String,default:"id"},filterable:{type:Boolean,default:!1},dataSource:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]}},watch:{sourceFilterText(t){this.$refs.sourceTree.filter(t)},selectedFilterText(t){this.$refs.selectTree.filter(t)},checkedKeys(t){this.$refs.sourceTree.setCheckedKeys(t),c.nextTick(()=>{this.getSelectedData(),this.$refs.selectTree.setCheckedKeys(t)})}},data(){return{defaultTreeAttributes:{"default-expand-all":!0,"show-checkbox":!0},selectedList:[],sourceFilterText:"",selectedFilterText:""}},methods:{sourceFilterNode(t,e){return t?e.label.indexOf(t)!==-1:!0},getSelectedData(){let t=!0,e;const n=this.$refs.sourceTree.getCheckedNodes(t,e);this.selectedList=n},removeSelectedData(){let t,e;const n=this.$refs.selectTree.getCheckedNodes(t,e),r={};n.forEach(s=>{r[s[this.nodeKey]]=s}),this.selectedList=this.selectedList.filter(s=>!r[s[this.nodeKey]])}}};var E=function(){var e=this,n=e._self._c;return n("div",{staticClass:"tree-box"},[n("div",{staticClass:"left-box"},[e.filterable?n("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.sourceFilterText,callback:function(r){e.sourceFilterText=r},expression:"sourceFilterText"}}):e._e(),n("el-tree",e._b({ref:"sourceTree",attrs:{data:e.dataSource,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1),n("div",{staticClass:"mid-box"},[n("el-button",{attrs:{icon:"el-icon-arrow-right",circle:""},on:{click:e.getSelectedData}}),n("el-button",{attrs:{icon:"el-icon-arrow-left",circle:""},on:{click:e.removeSelectedData}})],1),n("div",{staticClass:"right-box"},[e.filterable?n("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.selectedFilterText,callback:function(r){e.selectedFilterText=r},expression:"selectedFilterText"}}):e._e(),n("el-tree",e._b({ref:"selectTree",attrs:{data:e.selectedList,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1)])},R=[],L=d(B,E,R,!1,null,"49dbad2a",null,null);const N=L.exports,V=T,K=q,G=O,W=N;o.VDescriptions=G,o.VGeneralBasicForm=V,o.VSearchBox=K,o.VTreeTransfer=W,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(o,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(o=typeof globalThis<"u"?globalThis:o||self,c(o.Index={},o.Vue))})(this,function(o,c){"use strict";const X="";function p(t,e,n,r,s,i,f,H){var a=typeof t=="function"?t.options:t;e&&(a.render=e,a.staticRenderFns=n,a._compiled=!0),r&&(a.functional=!0),i&&(a._scopeId="data-v-"+i);var u;if(f?(u=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__<"u"&&(l=__VUE_SSR_CONTEXT__),s&&s.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(f)},a._ssrRegister=u):s&&(u=H?function(){s.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:s),u)if(a.functional){a._injectStyles=u;var J=a.render;a.render=function(M,y){return u.call(y),J(M,y)}}else{var h=a.beforeCreate;a.beforeCreate=h?[].concat(h,u):[u]}return{exports:t,options:a}}const _={props:{verificationSetting:{type:Object,default:()=>{}},getSmscode:{type:Function,default:()=>{}}},data(){return{defaultText:this.verificationSetting.defaultText||"获取验证码",buttonText:this.verificationSetting.defaultText||"获取验证码",restTime:this.verificationSetting.restTime||60,timer:null}},computed:{buttonType(){return this.buttonText===this.defaultText}},destroyed(){this.reset()},methods:{reset(){this.timer&&(clearInterval(this.timer),this.timer=null,this.buttonText=this.defaultText)},async buttonClick(){if(this.buttonText===this.defaultText)if(this.buttonText=this.restTime,this.timer=setInterval(()=>{if(Number(this.buttonText)<=0||!this.buttonText){this.reset();return}else this.buttonText=Number(this.buttonText)-1},1e3),this.getSmscode)await this.getSmscode()===!1&&this.reset();else return}}};var g=function(){var e=this,n=e._self._c;return n("el-button",{on:{click:e.buttonClick}},[e._v(e._s(e.buttonType?e.defaultText:e.buttonText+"s"))])},m=[],b=p(_,g,m,!1,null,null,null,null);const v=b.exports,k=(t={})=>{for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];Object.prototype.toString.call(n)==="[object Object]"&&(t[e]=JSON.stringify(n))}return t},x=(t={})=>{for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];try{t[e]=JSON.parse(n)}catch{}}return t},S={paramsToQuery:k,queryToData:x},d=S,Z="",T={name:"GeneralBasicForm",components:{InputArchive:t=>{const{templateEle:e}=t;return e()},VerificationButton:v},props:{showSearch:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},formOnly:{type:Boolean,default:!1},getList:{type:Function,default:()=>{}},afterReset:{type:Function,default:()=>{}},formItem:{type:Array,default:()=>[]},size:{type:String,default:""},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}},noInputBlank:{type:Boolean,default:()=>!1}},data(){var t;return{queryParams:{...this.noUrlParameters?{}:d.queryToData((t=this.$route)==null?void 0:t.query)},formLoading:this.loading||!1,selectSetting:{placeholder:"请选择",filterable:!0,clearable:!0,style:"width: 200px"},inputSetting:{placeholder:"请输入",style:"width: 200px",clearable:!0},datePackerSetting:{style:"width: 227px","start-placeholder":"开始日期","end-placeholder":"结束日期",type:"daterange"},attrs:{inline:!0,"label-position":"left"}}},watch:{formData:{handler(t,e){JSON.stringify(t)!==JSON.stringify(e)&&(this.queryParams={...this.noUrlParameters?{}:this.queryParams,...t})},immediate:!0},queryParams:{handler(t){this.$emit("update:formData",t)},deep:!0},$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0},loading(t){this.formLoading!==t&&(this.formLoading=t)},formLoading(t){this.loading!==t&&this.$emit("update:loading",t)}},methods:{handleQuery(){var n;const t={page:1,limit:10},e=d.paramsToQuery({...(n=this.$route)==null?void 0:n.query,...this.queryParams,...t});this.noUrlParameters||this.$router.push({query:{...e}}),this.getList({...e})},async resetQuery(){var e;this.$refs.queryFormRef.resetFields();const t={page:1};this.noUrlParameters||await this.$router.push({query:{...t}}),this.queryParams={...this.noUrlParameters?{}:(e=this.$route)==null?void 0:e.query},this.afterReset(),this.handleQuery()},currentInputComponent(){return"input-archive"},getItemRules(t){const{type:e,rules:n=[]}=t,r=[...n];return this.noInputBlank&&e==="input"&&r.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),r},getInputSetting(t){const{inputSetting:e,setting:n}=t;return{...this.inputSetting,...e,...n}},defaultFunction(){},getInputEvents(t){return{blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction,change:t.change||this.defaultFunction,input:t.input||this.defaultFunction,clear:t.clear||this.defaultFunction}},getSelectSetting(t){const{selectSetting:e,setting:n}=t;return{...this.selectSetting,...e,...n}},getSelectEvents(t){return{change:t.change||this.defaultFunction,"visible-change":t["visible-change"]||this.defaultFunction,"remove-tag":t["remove-tag"]||this.defaultFunction,"expand-change":t["expand-change"]||this.defaultFunction,clear:t.clear||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getDatePackerSetting(t){const{datePackerSetting:e,setting:n}=t;return{...this.datePackerSetting,...e,...n}},getDatePackerEvents(t){return{change:t.change||this.defaultFunction,blur:t.blur||this.defaultFunction,focus:t.focus||this.defaultFunction}},getCheckboxGroupSetting(t){const{checkboxGroupSetting:e,setting:n}=t;return{...e,...n}},getCheckboxGroupEvents(t){return{change:t.change||this.defaultFunction}}}};var P=function(){var e=this,n=e._self._c;return n("el-form",e._b({directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryFormRef",attrs:{model:e.queryParams,"label-width":e.labelWidth}},"el-form",e.attrs,!1),[e._l(e.formItem,function(r){return n("el-form-item",e._b({key:r.prop,attrs:{rules:e.getItemRules(r)}},"el-form-item",r,!1),[r.type==="input"?n("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(s,i){return{key:i,fn:function(){return[s?n(e.currentInputComponent(),{key:i,tag:"component",attrs:{templateEle:s}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="input-mobile-verification"?n("el-input",e._g(e._b({attrs:{size:e.size},nativeOn:{keydown:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(r.template,function(s,i){return{key:i,fn:function(){return[s?n(e.currentInputComponent(),{key:i,tag:"component",attrs:{templateEle:s}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(r),!1),e.getInputEvents(r)),[n("template",{slot:"append"},[n("verification-button",{attrs:{verificationSetting:r.verificationSetting,getSmscode:r.getSmscode}})],1)],2):r.type==="select"?n("el-select",e._g(e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(r),!1),e.getSelectEvents(r)),e._l(r.option||[],function(s){return n("el-option",{key:s.key||s.value,attrs:{label:s.label,value:s.value}})}),1):r.type==="cascader"?n("el-cascader",e._g(e._b({attrs:{filterable:"",size:e.size,options:r.options||[]},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(r),!1),e.getSelectEvents(r))):r.type==="date-picker"?n("el-date-picker",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(r),!1),e.getDatePackerEvents(r))):e._e(),r.type==="input-number"?n("el-input-number",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(r),!1),e.getInputEvents(r))):r.type==="checkbox"?n("el-checkbox-group",e._g(e._b({attrs:{size:e.size},model:{value:e.queryParams[r.prop],callback:function(s){e.$set(e.queryParams,r.prop,s)},expression:"queryParams[item.prop]"}},"el-checkbox-group",e.getCheckboxGroupSetting(r),!1),e.getCheckboxGroupEvents(r)),e._l(r.option||[],function(s){return n("el-checkbox",e._b({key:s.key||s.value||s.label},"el-checkbox",s,!1))}),1):e._e()],1)}),e._t("default"),e.formOnly?e._e():n("el-form-item",[n("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:e.size,loading:e.formLoading},on:{click:e.handleQuery}},[e._v("查询")]),n("el-button",{attrs:{icon:"el-icon-refresh",size:e.size},on:{click:e.resetQuery}},[e._v("重置")])],1),e._t("behind-the-button")],2)},F=[],C=p(T,P,F,!1,null,"171c263c",null,null);const $=C.exports,Y="",q={components:{},props:{query:{type:Object,default:()=>({prefCode:sessionStorage.getItem("prefCode")})},routePath:{type:String,default:()=>"/search/searchDetail"},inputstyle:{type:Object,default:()=>({width:"1280px"})},openHref:{type:Boolean,default:()=>!1},size:{type:String,default:()=>"medium"}},data(){var t,e;return{keyWord:((e=(t=this.$route)==null?void 0:t.query)==null?void 0:e.keyWord)||"",attrs:{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}},methods:{search(){const t={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(t);window.open(e.href,"_blank")}else this.$router.push(t)}}};var w=function(){var e=this,n=e._self._c;return n("div",{staticClass:"search-box"},[n("el-input",e._b({style:{...e.inputstyle},attrs:{size:e.size},nativeOn:{keydown:function(r){return!r.type.indexOf("key")&&e._k(r.keyCode,"enter",13,r.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(r){e.keyWord=r},expression:"keyWord"}},"el-input",e.attrs,!1),[n("svg",{staticClass:"el-input__icon",attrs:{slot:"prefix",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},slot:"prefix"},[n("path",{attrs:{d:"M9.51033 10.2186C8.69189 10.8814 7.64943 11.2784 6.51424 11.2784C3.88302 11.2784 1.75 9.14541 1.75 6.51421C1.75 3.88301 3.88302 1.75 6.51424 1.75C9.14545 1.75 11.2785 3.88301 11.2785 6.51421C11.2785 7.64942 10.8814 8.69189 10.2186 9.51034L13.75 13.0417L13.0417 13.75L9.51033 10.2186ZM10.2768 6.51421C10.2768 4.43623 8.59224 2.75168 6.51424 2.75168C4.43623 2.75168 2.75168 4.43623 2.75168 6.51421C2.75168 8.59219 4.43623 10.2767 6.51424 10.2767C8.59224 10.2767 10.2768 8.59219 10.2768 6.51421Z",fill:"#959A9F"}})])])],1)},O=[],D=p(q,w,O,!1,null,"ef706e31",null,null);const I=D.exports,z={name:"Descriptions",components:{DescriptionsColumn:{functional:!0,props:{column:{default:{render:()=>{}},type:Object},formData:{default:{},type:Object}},render(t,e){const{props:n}=e,{column:r,formData:s}=n;return r.render(s)}}},data(){return{attrs:{border:!0,class:"v-descriptions"}}},props:{formItem:{type:Array,default:()=>[]},formData:{type:Object,default:()=>{}}},watch:{$attrs:{handler(t){this.attrs={...this.attrs,...t}},immediate:!0,deep:!0}}};var B=function(){var e=this,n=e._self._c;return n("el-descriptions",e._b({},"el-descriptions",e.attrs,!1),e._l(e.formItem,function(r,s){return n("el-descriptions-item",e._b({key:r.prop,attrs:{label:r.label}},"el-descriptions-item",r.descriptionsItemProps,!1),[r.render?n("DescriptionsColumn",{attrs:{column:r,formData:e.formData}}):n("span",[e._v(e._s(e.formData[r.prop]))])],1)}),1)},E=[],R=p(z,B,E,!1,null,null,null,null);const L=R.exports,te="",N={props:{nodeKey:{type:String,default:"id"},filterable:{type:Boolean,default:!1},dataSource:{type:Array,default:()=>[]},checkedKeys:{type:Array,default:()=>[]}},watch:{sourceFilterText(t){this.$refs.sourceTree.filter(t)},selectedFilterText(t){this.$refs.selectTree.filter(t)},checkedKeys(t){this.$refs.sourceTree.setCheckedKeys(t),c.nextTick(()=>{this.getSelectedData(),this.$refs.selectTree.setCheckedKeys(t)})}},data(){return{defaultTreeAttributes:{"default-expand-all":!0,"show-checkbox":!0},selectedList:[],sourceFilterText:"",selectedFilterText:""}},methods:{sourceFilterNode(t,e){return t?e.label.indexOf(t)!==-1:!0},getSelectedData(){let t=!0,e;const n=this.$refs.sourceTree.getCheckedNodes(t,e);this.selectedList=n},removeSelectedData(){let t,e;const n=this.$refs.selectTree.getCheckedNodes(t,e),r={};n.forEach(s=>{r[s[this.nodeKey]]=s}),this.selectedList=this.selectedList.filter(s=>!r[s[this.nodeKey]])}}};var j=function(){var e=this,n=e._self._c;return n("div",{staticClass:"tree-box"},[n("div",{staticClass:"left-box"},[e.filterable?n("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.sourceFilterText,callback:function(r){e.sourceFilterText=r},expression:"sourceFilterText"}}):e._e(),n("el-tree",e._b({ref:"sourceTree",attrs:{data:e.dataSource,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1),n("div",{staticClass:"mid-box"},[n("el-button",{attrs:{icon:"el-icon-arrow-right",circle:""},on:{click:e.getSelectedData}}),n("el-button",{attrs:{icon:"el-icon-arrow-left",circle:""},on:{click:e.removeSelectedData}})],1),n("div",{staticClass:"right-box"},[e.filterable?n("el-input",{attrs:{placeholder:"输入关键字进行过滤"},model:{value:e.selectedFilterText,callback:function(r){e.selectedFilterText=r},expression:"selectedFilterText"}}):e._e(),n("el-tree",e._b({ref:"selectTree",attrs:{data:e.selectedList,"filter-node-method":e.sourceFilterNode,nodeKey:e.nodeKey}},"el-tree",{...e.defaultTreeAttributes},!1))],1)])},V=[],K=p(N,j,V,!1,null,"49dbad2a",null,null);const G=K.exports,W=$,A=I,U=L,Q=G;o.VDescriptions=U,o.VGeneralBasicForm=W,o.VSearchBox=A,o.VTreeTransfer=Q,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "general-basic-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.umd.cjs",
|
|
6
6
|
"type": "module",
|
|
@@ -63,5 +63,8 @@
|
|
|
63
63
|
},
|
|
64
64
|
"files": [
|
|
65
65
|
"/dist"
|
|
66
|
-
]
|
|
66
|
+
],
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"network-spanner": "^1.2.6"
|
|
69
|
+
}
|
|
67
70
|
}
|