general-basic-form 1.0.46 → 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 CHANGED
@@ -1,13 +1,16 @@
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 | | √ | √ | √ | |
13
+ | VTreeTransfer | √ | | | | √ |
11
14
 
12
15
  示例:
13
16
 
@@ -20,7 +23,8 @@ app.use(ElementPlus)
20
23
  ```
21
24
 
22
25
  ```
23
- import { VGeneralBasicForm } from "general-basic-form";
26
+ import { VGeneralBasicForm } from 'general-basic-form'
27
+ import 'general-basic-form/style'
24
28
  ```
25
29
 
26
30
  <VGeneralBasicForm
@@ -30,9 +34,10 @@ import { VGeneralBasicForm } from "general-basic-form";
30
34
  :size="size"
31
35
  ref="VGeneralBasicFormRef"
32
36
  labelWidth="90px"
37
+ :noInputBlank="true"
33
38
  >
34
39
  <template v-slot:default>
35
- ...一些传入插槽的内容
40
+ ...一些传入插槽的内容
36
41
  </template>
37
42
  <template v-slot:behind-the-button>
38
43
  <el-form-item>
@@ -51,19 +56,20 @@ import { VGeneralBasicForm } from "general-basic-form";
51
56
  size="small"
52
57
  ref="VGeneralBasicFormRef"
53
58
  :labelWidth="formLabelWidth"
54
- v-bind:loading:sync="loading"
55
- :formData.sync: {
56
- // 外部传入的表单数据(可以是响应式数据),用于回填
59
+ :formData: {
60
+ // 外部传入的表单数据,用于回填
57
61
  }
58
62
  noUrlParameters
59
63
  :afterReset="afterReset"
64
+ v-model:loading="loading"
60
65
  />
61
66
 
62
67
  <style lang="scss" scoped>
63
- :deep {
64
- .el-form-item {
65
- margin-bottom: 22px;
66
- }
68
+ :deep(.el-form-item) {
69
+ margin-bottom: 16px;
70
+ }
71
+ :deep(.el-divider--horizontal) {
72
+ margin: 8px 0px;
67
73
  }
68
74
  </style>
69
75
 
@@ -78,44 +84,44 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
78
84
 
79
85
  表单数据校验需要拿到内部表单的ref
80
86
 
81
- const VGeneralBasicFormRef = this.$refs["VGeneralBasicFormRef"];
82
- VGeneralBasicFormRef.$refs["queryFormRef"].validate(async (boolean, object) => {
83
- if (boolean) {
84
- console.log(this.$refs["VGeneralBasicFormRef"]["queryParams"]);
85
- }
86
- });
87
-
88
- 校验单个字段
89
- const VGeneralBasicFormRef = this.$refs["VGeneralBasicFormRef"];
90
- const state = await new Promise((resolve, reject) => {
91
- VGeneralBasicFormRef.$refs["queryFormRef"]?.validateField(
92
- "accNum",
93
- (errorMessage) => {
94
- if (!errorMessage) {
95
- const { accNum } = VGeneralBasicFormRef["queryParams"];
96
- http
97
- .getMobileByAccNum({ accNum })
98
- .then((res) => {
99
- if (res) {
100
- if (res.data) {
101
- }
102
- resolve(true);
103
- }else {
104
- resolve(false);
105
- }
106
- })
107
- .catch((error) => {
108
- resolve(false);
109
- });
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
+ }
110
102
  } else {
111
- resolve(false);
103
+ resolve(false)
112
104
  }
113
105
  }
114
- );
115
- });
116
-
117
- 深度更新formData
118
- this.formData = { ...newVal }
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
+ })
119
125
 
120
126
 
121
127
  ![image-20211014191532067](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202110141915657.png)
@@ -132,11 +138,11 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
132
138
  noInputBlank: true //校验input框不能仅输入空格
133
139
  //例子:formData.value.x=y ✘ | formData.value={...formData.value,x:y} ✔
134
140
  formItem: [
135
- { // vue2未实现
141
+ {
136
142
  label: '',
137
143
  prop: 'bsName35',
138
144
  type: 'divider',
139
- dividerSetting: {
145
+ setting: {
140
146
  },
141
147
  template: {
142
148
  default: () => {
@@ -147,12 +153,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
147
153
  { label: "款式名称",
148
154
  prop: "bsName",
149
155
  type: "input",
150
- inputSetting: {
156
+ setting: {
151
157
  placeholder: '请输入手机验证码',
152
- style: 'width: 100%',
153
- "prefix-icon": "el-icon-search"
158
+ style: 'width: 100%'
154
159
  },
155
- class: "flex-item",
156
160
  rules: [
157
161
  {
158
162
  message: "请输入信息"
@@ -162,29 +166,30 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
162
166
  message: "请输入正确的Invoice单号"
163
167
  }
164
168
  ],
165
- change: (value) => {
166
- console.log(value)
167
- }
169
+ template: {
170
+ suffix: () => {
171
+ return <svg-icon icon-class="baifenbi" />;
172
+ },
173
+ },
168
174
  },
169
175
  {
170
176
  label: "二次工艺",
171
177
  prop: "spName",
172
178
  type: "select",
173
- selectSetting:{multiple:true, //多选},
179
+ setting:{ multiple:true, //多选},
174
180
  option: [
175
- { value: "3", label: "满印" },
181
+ { value: "3", label: "满印" },
176
182
  { value: "1", label: "区域印花" },
177
183
  { value: "2", label: "绣花" },
178
184
  ],
179
- change: (value) => {
180
- console.log(value)
181
- }
185
+ change:(e) => {
186
+ }
182
187
  },
183
188
  {
184
189
  label: "创建时间",
185
190
  prop: "create_time",
186
191
  type: "date-picker",
187
- datePackerSetting: {
192
+ setting: {
188
193
  "range-separator": "至",
189
194
  }
190
195
  },
@@ -192,12 +197,8 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
192
197
  label: "二次工艺成本价格(人民币分)",
193
198
  prop: "spCost",
194
199
  type: "input-number",
195
- setting: {
196
- style: 'width: 178px',
197
- placeholder: '请输入配比',
198
- precision:2,
199
- min: 0,
200
- },
200
+ "controls-position": "right",
201
+ min: 0,
201
202
  rules: [
202
203
  {
203
204
  required: true,
@@ -207,11 +208,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
207
208
  ],
208
209
  },
209
210
  {
210
- // vue2未实现
211
211
  label: '',
212
212
  prop: 'bsName2',
213
213
  type: 'input-graphic-verification',
214
- inputSetting: {
214
+ setting: {
215
215
  placeholder: '请输入图形验证码',
216
216
  style: 'width: 100%'
217
217
  },
@@ -233,24 +233,23 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
233
233
  placeholder: '请输入手机验证码',
234
234
  style: 'width: 100%'
235
235
  },
236
+ buttonSetting: {
237
+ type: "text",
238
+ style: 'text-align: end',
239
+ },
236
240
  rules: [
237
241
  {
238
242
  message: '请输入手机验证码',
239
243
  trigger: 'blur'
240
244
  }
241
245
  ],
242
- verificationSetting: {
243
- defaultText: "查询",
244
- restTime: 5,
245
- },
246
246
  getSmscode,// 获取验证码的回调函数,获取失败必须返回false,否则计时器不会重新计算
247
247
  },
248
248
  {
249
- // vue2未实现
250
249
  label: '是否必填',
251
250
  prop: 'is_optional',
252
251
  type: 'radio',
253
- radioGroupSetting: {
252
+ setting: {
254
253
  disabled: true
255
254
  },
256
255
  option: [
@@ -266,12 +265,10 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
266
265
  ]
267
266
  },
268
267
  {
269
- // 使用时需要在formData中定义好prop的默认值
270
- // 例 formData:{ is_multi:[]}
271
268
  label: '多选',
272
269
  prop: 'is_multi',
273
270
  type: 'checkbox',
274
- checkboxGroupSetting: {
271
+ setting: {
275
272
  },
276
273
  option: [
277
274
  { value: '是', label: 'true' },
@@ -280,7 +277,6 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
280
277
  rules: []
281
278
  },
282
279
  {
283
- // vue2未实现
284
280
  label: '受访人',
285
281
  prop: 'contactors',
286
282
  type: 'form-item-slot',
@@ -299,7 +295,7 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
299
295
  label: "分类",
300
296
  prop: "分类",
301
297
  type: "cascader",
302
- selectSetting:{},
298
+ setting:{},
303
299
  options: [
304
300
  {
305
301
  value: "zhinan",
@@ -375,31 +371,154 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
375
371
 
376
372
  //divider支持template:
377
373
  //default
374
+ 支持组件type:
378
375
 
379
- 安装:npm i general-basic-form<br/>
380
- install: npm i general-basic-form
376
+ /**
381
377
 
382
- # SearchBox 对搜索框的单独封装
378
+ \* @description: 输入框
383
379
 
384
- ```
385
- import { VSearchBox } from "general-basic-form";
386
- ```
380
+ */
387
381
 
388
- ![image-20240802200107233](C:\Users\陈德立\AppData\Roaming\Typora\typora-user-images\image-20240802200107233.png)
382
+ 'input' = 'input',
389
383
 
390
- ```
391
- <VSearchBox placeholder="请输入您想搜索的商品" openHref :inputstyle="{ display: 'block', width: 'auto', margin: '0 90px' }">
392
- </VSearchBox>
393
- ```
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: 级联选择器
394
419
 
420
+ */
395
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
+ ![image-20231208165229296](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202312081652392.png)
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
+ ```
396
511
 
397
512
  ```
398
- query:Object //搜索条件,会带到跳转后的路由query里
399
- routePath:String //搜索后跳转路径
400
- inputstyle:Object//输入框样式
401
- openHref:Boolean//是否在新标签页中打开搜索结果
402
- size:String//el-input的size
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:加载中
403
522
  ```
404
523
 
405
524
  # VDescriptions对展示描述列表的封装
@@ -411,8 +530,8 @@ import { VDescriptions } from 'general-basic-form'
411
530
  <VDescriptions
412
531
  :formData="props.formData"
413
532
  :formItem="formItem"
533
+ componentType="Ant Design Vue"
414
534
  ...其他el-descriptions的配置
415
- 如:size="mini" :column="1"
416
535
  />
417
536
  ```
418
537
 
@@ -435,20 +554,40 @@ formItem:[ {
435
554
  'label-class-name': 'label-class-name'
436
555
  }
437
556
  }]
438
- descriptionsItemProps:el-descriptions-item的配置
557
+ componentType:"Ant Design Vue"|"Element Plus"(默认)
558
+ strict:Boolean //使用strict参数后,如果formData内的某个字段没有值,对应的描述元素将不会展示(包括标签文字),但有render的字段仍然会展示
559
+ descriptionsItemProps:a-descriptions-item|el-descriptions-item的配置
439
560
  ```
440
561
 
441
- # VTreeTransfer树形穿梭框
562
+ # VInputMobilecVerification,VInputGraphicVerification表单里的图形验证码、手机验证码组件,可以单独引入
442
563
 
443
- ```javascript
444
- import { VTreeTransfer } from 'general-basic-form'
445
- <VTreeTransfer ref="TreeTransferRef" :data-source.sync="treeFromData" filterable :checkedKeys="checkedKeys">
446
- </VTreeTransfer>
447
564
  ```
565
+ <VInputGraphicVerification :item="{同表单,可忽略label和rules字段}" :loading="loading"></VInputGraphicVerification>
448
566
 
567
+ <VInputMobilecVerification :item="{同表单,可忽略label和rules字段}" componentType="Ant Design Vue" ref="VInputMobilecVerificationRef"></VInputMobilecVerification>
449
568
  ```
450
- treeFromData:Array //树的数据源
451
- checkedKeys:Array //设置选中的数据
452
- 获取穿梭框右侧数据:setup写法:TreeTransferRef.value["selectedList"]
569
+
570
+ ```
571
+ componentType:"Ant Design Vue"|"Element Plus"(默认)
572
+ ```
573
+
453
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
454
593
 
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
+ 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{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.46",
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
  }