general-basic-form 1.0.47 → 1.0.49

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
@@ -1,11 +1,13 @@
1
- # GeneralBasicForm 一个兼容 Vue2 和 Vue3 的表单组件,支持typescript,vue2请使用@1版本,Vue3请使用@2版本
1
+ # GeneralBasicForm
2
2
 
3
- | 组件\兼容性 | vue2 | vue3 | Ant Design Vue | Element Plus | Element(ui) |
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 "general-basic-form";
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
- v-bind:loading:sync="loading"
56
- :formData.sync: {
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
- .el-form-item {
66
- margin-bottom: 22px;
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
 
@@ -77,46 +82,52 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
77
82
  }
78
83
  ) {}
79
84
 
85
+ 带参数搜索
86
+
87
+ ```
88
+ this.$refs["VGeneralBasicFormRef"].handleQuery()
89
+ ```
90
+
80
91
  表单数据校验需要拿到内部表单的ref
81
92
 
82
- const VGeneralBasicFormRef = this.$refs["VGeneralBasicFormRef"];
83
- VGeneralBasicFormRef.$refs["queryFormRef"].validate(async (boolean, object) => {
84
- if (boolean) {
85
- console.log(this.$refs["VGeneralBasicFormRef"]["queryParams"]);
86
- }
87
- });
88
-
89
- 校验单个字段
90
- const VGeneralBasicFormRef = this.$refs["VGeneralBasicFormRef"];
91
- const state = await new Promise((resolve, reject) => {
92
- VGeneralBasicFormRef.$refs["queryFormRef"]?.validateField(
93
- "accNum",
94
- (errorMessage) => {
95
- if (!errorMessage) {
96
- const { accNum } = VGeneralBasicFormRef["queryParams"];
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
- });
93
+ async getSmscode() {
94
+ const VGeneralBasicFormRef = this.$refs['VGeneralBasicFormRef'] as any
95
+ const state = await new Promise<boolean>((resolve, reject) => {
96
+ VGeneralBasicFormRef.$refs['queryFormRef']?.validateField(
97
+ 'user_phone',
98
+ async (valid: boolean, props?: FormItemProp[] | undefined) => {
99
+ if (valid) {
100
+ const { user_phone } = VGeneralBasicFormRef['queryParams']
101
+ const res: any = await SmscodeList({ user_phone })
102
+ if (res) {
103
+ console.log(res)
104
+ resolve(true)
105
+ } else {
106
+ resolve(false)
107
+ }
111
108
  } else {
112
- resolve(false);
109
+ resolve(false)
113
110
  }
114
111
  }
115
- );
116
- });
117
-
118
- 深度更新formData
119
- this.formData = { ...newVal }
112
+ )
113
+ })
114
+ return state
115
+ },
116
+
117
+ setup写法:
118
+ const VGeneralBasicFormRef = ref()
119
+ const params = await new Promise<any>((resolve, reject) => {
120
+ VGeneralBasicFormRef.value.$refs['queryFormRef']?.validate(
121
+ async (valid: boolean, props?: FormItemProp[] | undefined) => {
122
+ if (valid) {
123
+ const params = VGeneralBasicFormRef.value['queryParams']
124
+ resolve(params)
125
+ } else {
126
+ resolve(false)
127
+ }
128
+ }
129
+ )
130
+ })
120
131
 
121
132
 
122
133
  ![image-20211014191532067](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202110141915657.png)
@@ -133,11 +144,11 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
133
144
  noInputBlank: true //校验input框不能仅输入空格
134
145
  //例子:formData.value.x=y ✘ | formData.value={...formData.value,x:y} ✔
135
146
  formItem: [
136
- { // vue2未实现
147
+ {
137
148
  label: '',
138
149
  prop: 'bsName35',
139
150
  type: 'divider',
140
- dividerSetting: {
151
+ setting: {
141
152
  },
142
153
  template: {
143
154
  default: () => {
@@ -148,12 +159,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
148
159
  { label: "款式名称",
149
160
  prop: "bsName",
150
161
  type: "input",
151
- inputSetting: {
162
+ setting: {
152
163
  placeholder: '请输入手机验证码',
153
- style: 'width: 100%',
154
- "prefix-icon": "el-icon-search"
164
+ style: 'width: 100%'
155
165
  },
156
- class: "flex-item",
157
166
  rules: [
158
167
  {
159
168
  message: "请输入信息"
@@ -163,29 +172,30 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
163
172
  message: "请输入正确的Invoice单号"
164
173
  }
165
174
  ],
166
- change: (value) => {
167
- console.log(value)
168
- }
175
+ template: {
176
+ suffix: () => {
177
+ return <svg-icon icon-class="baifenbi" />;
178
+ },
179
+ },
169
180
  },
170
181
  {
171
182
  label: "二次工艺",
172
183
  prop: "spName",
173
184
  type: "select",
174
- selectSetting:{multiple:true, //多选},
185
+ setting:{ multiple:true, //多选},
175
186
  option: [
176
- { value: "3", label: "满印" },
187
+ { value: "3", label: "满印" },
177
188
  { value: "1", label: "区域印花" },
178
189
  { value: "2", label: "绣花" },
179
190
  ],
180
- change: (value) => {
181
- console.log(value)
182
- }
191
+ change:(e) => {
192
+ }
183
193
  },
184
194
  {
185
195
  label: "创建时间",
186
196
  prop: "create_time",
187
197
  type: "date-picker",
188
- datePackerSetting: {
198
+ setting: {
189
199
  "range-separator": "至",
190
200
  }
191
201
  },
@@ -193,12 +203,8 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
193
203
  label: "二次工艺成本价格(人民币分)",
194
204
  prop: "spCost",
195
205
  type: "input-number",
196
- setting: {
197
- style: 'width: 178px',
198
- placeholder: '请输入配比',
199
- precision:2,
200
- min: 0,
201
- },
206
+ "controls-position": "right",
207
+ min: 0,
202
208
  rules: [
203
209
  {
204
210
  required: true,
@@ -208,11 +214,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
208
214
  ],
209
215
  },
210
216
  {
211
- // vue2未实现
212
217
  label: '',
213
218
  prop: 'bsName2',
214
219
  type: 'input-graphic-verification',
215
- inputSetting: {
220
+ setting: {
216
221
  placeholder: '请输入图形验证码',
217
222
  style: 'width: 100%'
218
223
  },
@@ -234,24 +239,23 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
234
239
  placeholder: '请输入手机验证码',
235
240
  style: 'width: 100%'
236
241
  },
242
+ buttonSetting: {
243
+ type: "text",
244
+ style: 'text-align: end',
245
+ },
237
246
  rules: [
238
247
  {
239
248
  message: '请输入手机验证码',
240
249
  trigger: 'blur'
241
250
  }
242
251
  ],
243
- verificationSetting: {
244
- defaultText: "查询",
245
- restTime: 5,
246
- },
247
252
  getSmscode,// 获取验证码的回调函数,获取失败必须返回false,否则计时器不会重新计算
248
253
  },
249
254
  {
250
- // vue2未实现
251
255
  label: '是否必填',
252
256
  prop: 'is_optional',
253
257
  type: 'radio',
254
- radioGroupSetting: {
258
+ setting: {
255
259
  disabled: true
256
260
  },
257
261
  option: [
@@ -267,12 +271,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
267
271
  ]
268
272
  },
269
273
  {
270
- // 使用时需要在formData中定义好prop的默认值
271
- // 例 formData:{ is_multi:[]}
272
274
  label: '多选',
273
275
  prop: 'is_multi',
274
276
  type: 'checkbox',
275
- checkboxGroupSetting: {
277
+ setting: {
276
278
  },
277
279
  option: [
278
280
  { value: '是', label: 'true' },
@@ -281,7 +283,6 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
281
283
  rules: []
282
284
  },
283
285
  {
284
- // vue2未实现
285
286
  label: '受访人',
286
287
  prop: 'contactors',
287
288
  type: 'form-item-slot',
@@ -300,7 +301,7 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
300
301
  label: "分类",
301
302
  prop: "分类",
302
303
  type: "cascader",
303
- selectSetting:{},
304
+ setting:{},
304
305
  options: [
305
306
  {
306
307
  value: "zhinan",
@@ -376,31 +377,154 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
376
377
 
377
378
  //divider支持template:
378
379
  //default
380
+ 支持组件type:
379
381
 
380
- 安装:npm i general-basic-form<br/>
381
- install: npm i general-basic-form
382
+ /**
382
383
 
383
- # SearchBox 对搜索框的单独封装
384
+ \* @description: 输入框
384
385
 
385
- ```
386
- import { VSearchBox } from "general-basic-form";
387
- ```
386
+ */
388
387
 
389
- ![image-20240802200107233](C:\Users\陈德立\AppData\Roaming\Typora\typora-user-images\image-20240802200107233.png)
388
+ 'input' = 'input',
390
389
 
391
- ```
392
- <VSearchBox placeholder="请输入您想搜索的商品" openHref :inputstyle="{ display: 'block', width: 'auto', margin: '0 90px' }">
393
- </VSearchBox>
394
- ```
390
+ /**
391
+
392
+ \* @description: 输入框/图像验证码
393
+
394
+ */
395
+
396
+ 'input-graphic-verification' = 'input-graphic-verification',
397
+
398
+ /**
399
+
400
+ \* @description: 输入框/手机验证码
401
+
402
+ */
403
+
404
+ 'input-mobile-verification' = 'input-mobile-verification',
405
+
406
+ /**
407
+
408
+ \* @description: 分割线
409
+
410
+ */
411
+
412
+ 'divider' = 'divider',
413
+
414
+ /**
415
+
416
+ \* @description: 选择器
417
+
418
+ */
419
+
420
+ 'select' = 'select',
395
421
 
422
+ /**
396
423
 
424
+ \* @description: 级联选择器
397
425
 
426
+ */
427
+
428
+ 'cascader' = 'cascader',
429
+
430
+ /**
431
+
432
+ \* @description: 日期选择器
433
+
434
+ */
435
+
436
+ 'date-picker' = 'date-picker',
437
+
438
+ /**
439
+
440
+ \* @description: 数字输入框
441
+
442
+ */
443
+
444
+ 'input-number' = 'input-number',
445
+
446
+ /**
447
+
448
+ \* @description: 单选框
449
+
450
+ */
451
+
452
+ 'radio' = 'radio',
453
+
454
+ /**
455
+
456
+ \* @description: 自定义元素,插槽组件
457
+
458
+ */
459
+
460
+ 'form-item-slot'='form-item-slot',
461
+
462
+ /**
463
+
464
+ \* @description: 多选框
465
+
466
+ */
467
+
468
+ 'checkbox'='checkbox',
469
+
470
+
471
+
472
+ # VInfiniteScrollList对虚拟滚动列表+接口的封装
473
+
474
+
475
+
476
+ ![image-20231208165229296](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202312081652392.png)
477
+
478
+ ```
479
+ import { VInfiniteScrollList } from 'general-basic-form'
480
+ import 'general-basic-form/style'
481
+ <VInfiniteScrollList
482
+ :search="search"
483
+ id="user_id"
484
+ name="name"
485
+ ref="InfiniteScrollListRef"
486
+ checkbox
487
+ :extra="extraRender"
488
+ :max="1"
489
+ />
490
+ ```
491
+ ```
492
+ 移动端配合下拉刷新使用
493
+ import { getOrderItem } from "../orderItem/functional"
494
+ // getOrderItem为JSX函数,返回一个VUE组件
495
+
496
+ <t-pull-down-refresh v-model="refreshing" @refresh="onRefresh" class="refresh-content">
497
+ <VInfiniteScrollList :search="loadData" :checkbox="false" id="cancelId" ref="InfiniteScrollListRef" checkbox
498
+ :extra="getOrderItem" height="100%" infinite-scroll-distance="50"/>
499
+ </t-pull-down-refresh>
398
500
  ```
399
- query:Object //搜索条件,会带到跳转后的路由query里
400
- routePath:String //搜索后跳转路径
401
- inputstyle:Object//输入框样式
402
- openHref:Boolean//是否在新标签页中打开搜索结果
403
- size:String//el-input的size
501
+ ```
502
+ search:数据接口 (page: Number) => Promise<[]>
503
+ id:数据key值(唯一和选择值)
504
+ name:显示名字
505
+ checkbox:是否有多选功能,不传的话就是单纯的虚拟滚动列表
506
+ extra:同行额外显示的内容,(item: any) => VNode | String;
507
+ //el-checkbox有固定高度,如果需要配置高度比较高,例如有换行的自定义extra,最好处理一下样式,例子:
508
+ //:deep(.el-checkbox) {
509
+ // padding: 6px 16px !important;
510
+ // display: flex;
511
+ // align-items: baseline;
512
+ // height: auto;
513
+ //}
514
+ defaultSelection:包含数据key值的对象数组或者直接传入key值数组
515
+ height:默认272px String
516
+ ```
517
+
518
+ ```
519
+ defineExpose({ reset, loadList, selectInfo, list, ifbottom });
520
+ InfiniteScrollListRef?.value?.reset():重置列表内容
521
+ InfiniteScrollListRef?.value?.lowReset():重置列表内容,但保留已选择的选项
522
+ InfiniteScrollListRef?.value?.loadList():向下滚动列表内容,受到loading和ifbottom的影响
523
+ InfiniteScrollListRef?.value?.refreshList():刷新列表,滚动列表会对整个内容重新请求数据,已选择的内容会自动选择
524
+ InfiniteScrollListRef?.value?.selectInfo:选择的内容
525
+ InfiniteScrollListRef?.value?.list:列表的内容
526
+ InfiniteScrollListRef?.value?.ifbottom:是否到底部
527
+ InfiniteScrollListRef?.value?.loading:加载中
404
528
  ```
405
529
 
406
530
  # VDescriptions对展示描述列表的封装
@@ -412,8 +536,8 @@ import { VDescriptions } from 'general-basic-form'
412
536
  <VDescriptions
413
537
  :formData="props.formData"
414
538
  :formItem="formItem"
539
+ componentType="Ant Design Vue"
415
540
  ...其他el-descriptions的配置
416
- 如:size="mini" :column="1"
417
541
  />
418
542
  ```
419
543
 
@@ -436,22 +560,40 @@ formItem:[ {
436
560
  'label-class-name': 'label-class-name'
437
561
  }
438
562
  }]
439
- descriptionsItemProps:el-descriptions-item的配置
563
+ componentType:"Ant Design Vue"|"Element Plus"(默认)
564
+ strict:Boolean //使用strict参数后,如果formData内的某个字段没有值,对应的描述元素将不会展示(包括标签文字),但有render的字段仍然会展示
565
+ descriptionsItemProps:a-descriptions-item|el-descriptions-item的配置
440
566
  ```
441
567
 
442
- # VTreeTransfer树形穿梭框
568
+ # VInputMobilecVerification,VInputGraphicVerification表单里的图形验证码、手机验证码组件,可以单独引入
443
569
 
444
- ![image-20241113173459422](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202411131735541.png)
570
+ ```
571
+ <VInputGraphicVerification :item="{同表单,可忽略label和rules字段}" :loading="loading"></VInputGraphicVerification>
445
572
 
446
- ```javascript
447
- import { VTreeTransfer } from 'general-basic-form'
448
- <VTreeTransfer ref="TreeTransferRef" :data-source.sync="treeFromData" filterable :checkedKeys="checkedKeys">
449
- </VTreeTransfer>
573
+ <VInputMobilecVerification :item="{同表单,可忽略label和rules字段}" componentType="Ant Design Vue" ref="VInputMobilecVerificationRef"></VInputMobilecVerification>
450
574
  ```
451
575
 
452
576
  ```
453
- treeFromData:Array //树的数据源
454
- checkedKeys:Array //设置选中的数据
455
- 获取穿梭框右侧数据:setup写法:TreeTransferRef.value["selectedList"]
577
+ componentType:"Ant Design Vue"|"Element Plus"(默认)
578
+ ```
579
+
456
580
  ```
581
+ 此用法下必须提供:
582
+ provide(/* 注入名 */ "queryParams", /* 表单值对象 */ queryParams);
583
+
584
+ componentType为Ant Design Vue需要提供:
585
+ import { Form } from 'ant-design-vue';
586
+ provide(/* 注入名 */ "Form", /* Ant Design Vue Form实例,用于表单数据更新等 */ Form);
587
+
588
+ 可选:
589
+ provide("size", size); // 同组件size
590
+ provide("getList", getList); // 输入框回车触发
591
+
592
+ 调用发送短信验证码和重置的方法
593
+ VInputMobilecVerificationRef.value.VerificationButtonRef.buttonClick()
594
+ VInputMobilecVerificationRef.value.VerificationButtonRef.reset()
595
+ ```
596
+
597
+ 安装:npm i general-basic-form<br/>
598
+ install: npm i general-basic-form
457
599
 
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { nextTick as y } from "vue";
2
- function u(t, e, n, r, s, o, c, f) {
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 = f ? function() {
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 h = a.render;
19
- a.render = function(_, d) {
20
- return i.call(d), h(_, 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 g = {
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 m = function() {
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
- }, b = [], v = /* @__PURE__ */ u(
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 k = v.exports;
93
- const x = {
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
+ /[{]+/g.test(n) && /[}]+/g.test(n) && (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: k
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
- ...(n = this.$route) == null ? void 0 : n.query,
249
- ...this.queryParams,
250
- ...t
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 S = function() {
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
- }, T = [], F = /* @__PURE__ */ u(
383
- x,
384
- S,
385
- T,
401
+ }, $ = [], q = /* @__PURE__ */ u(
402
+ F,
403
+ C,
404
+ $,
386
405
  !1,
387
406
  null,
388
- "f12b237b",
407
+ "171c263c",
389
408
  null,
390
409
  null
391
410
  );
392
- const C = F.exports;
393
- const P = {
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 $ = function() {
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
- }, q = [], w = /* @__PURE__ */ u(
461
- P,
462
- $,
463
- q,
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 D = w.exports, I = {
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
- }, z = {
506
+ }, R = {
488
507
  name: "Descriptions",
489
508
  components: {
490
- DescriptionsColumn: I
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 O = function() {
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
- }, B = [], E = /* @__PURE__ */ u(
532
- z,
533
- O,
534
- B,
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 R = E.exports;
542
- const L = {
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), y(() => {
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 N = function() {
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
- }, K = [], W = /* @__PURE__ */ u(
611
- L,
612
- N,
613
- K,
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 A = W.exports, U = C, V = D, j = R, Q = A;
639
+ const Q = U.exports, H = w, J = B, M = j, X = Q;
621
640
  export {
622
- j as VDescriptions,
623
- U as VGeneralBasicForm,
624
- V as VSearchBox,
625
- Q as VTreeTransfer
641
+ M as VDescriptions,
642
+ H as VGeneralBasicForm,
643
+ J as VSearchBox,
644
+ X as VTreeTransfer
626
645
  };
@@ -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{/[{]+/g.test(n)&&/[}]+/g.test(n)&&(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.47",
3
+ "version": "1.0.49",
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.8"
69
+ }
67
70
  }