general-basic-form 1.0.33 → 1.0.35

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
@@ -2,10 +2,10 @@
2
2
 
3
3
  | 组件\兼容性 | vue2 | vue3 |
4
4
  | ------------------- | ---- | ---- |
5
- | GeneralBasicForm | √ | √ |
6
- | SearchBox | √ | |
5
+ | VGeneralBasicForm | √ | √ |
6
+ | VSearchBox | √ | |
7
7
  | VInfiniteScrollList | | √ |
8
- | VDescriptions | | √ |
8
+ | VDescriptions || √ |
9
9
 
10
10
  示例:
11
11
 
@@ -49,6 +49,7 @@ import { VGeneralBasicForm } from "general-basic-form";
49
49
  size="small"
50
50
  ref="VGeneralBasicFormRef"
51
51
  :labelWidth="formLabelWidth"
52
+ v-bind:loading:sync="loading"
52
53
  :formData: {
53
54
  // 外部传入的表单数据,用于回填
54
55
  }
@@ -384,3 +385,38 @@ openHref:Boolean//是否在新标签页中打开搜索结果
384
385
  size:String//el-input的size
385
386
  ```
386
387
 
388
+ # VDescriptions对展示描述列表的封装
389
+
390
+ ![image-20231208182455415](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202312081824708.png)
391
+
392
+ ```
393
+ import { VDescriptions } from 'general-basic-form'
394
+ <VDescriptions
395
+ :formData="props.formData"
396
+ :formItem="formItem"
397
+ ...其他el-descriptions的配置
398
+ 如:size="mini" :column="1"
399
+ />
400
+ ```
401
+
402
+ ```
403
+ formData:Object
404
+ formItem:[ {
405
+ label: '受访人',
406
+ prop: 'contactors',
407
+ render: (scope: any) => {
408
+ const { $index, row = {} } = scope
409
+ const { contactors = [] } = row
410
+ const ele = (contactors.length > 0 ? <span>{contactors.map((item: any) => item.name).join(",")} </span> : null)
411
+ return ele
412
+ }
413
+ },
414
+ {
415
+ label: '拜访详情',
416
+ prop: 'detail',
417
+ descriptionsItemProps:{
418
+ 'label-class-name': 'label-class-name'
419
+ }
420
+ }]
421
+ descriptionsItemProps:el-descriptions-item的配置
422
+ ```
package/dist/index.js CHANGED
@@ -1,33 +1,33 @@
1
- function u(r, e, a, t, n, o, p, d) {
2
- var s = typeof r == "function" ? r.options : r;
3
- e && (s.render = e, s.staticRenderFns = a, s._compiled = !0), t && (s.functional = !0), o && (s._scopeId = "data-v-" + o);
1
+ function u(r, e, n, t, s, o, p, d) {
2
+ var a = typeof r == "function" ? r.options : r;
3
+ e && (a.render = e, a.staticRenderFns = n, a._compiled = !0), t && (a.functional = !0), o && (a._scopeId = "data-v-" + o);
4
4
  var l;
5
5
  if (p ? (l = function(i) {
6
6
  i = i || // cached call
7
7
  this.$vnode && this.$vnode.ssrContext || // stateful
8
- this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !i && typeof __VUE_SSR_CONTEXT__ < "u" && (i = __VUE_SSR_CONTEXT__), n && n.call(this, i), i && i._registeredComponents && i._registeredComponents.add(p);
9
- }, s._ssrRegister = l) : n && (l = d ? function() {
10
- n.call(
8
+ 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(p);
9
+ }, a._ssrRegister = l) : s && (l = d ? function() {
10
+ s.call(
11
11
  this,
12
- (s.functional ? this.parent : this).$root.$options.shadowRoot
12
+ (a.functional ? this.parent : this).$root.$options.shadowRoot
13
13
  );
14
- } : n), l)
15
- if (s.functional) {
16
- s._injectStyles = l;
17
- var h = s.render;
18
- s.render = function(y, f) {
19
- return l.call(f), h(y, f);
14
+ } : s), l)
15
+ if (a.functional) {
16
+ a._injectStyles = l;
17
+ var _ = a.render;
18
+ a.render = function(h, f) {
19
+ return l.call(f), _(h, f);
20
20
  };
21
21
  } else {
22
- var c = s.beforeCreate;
23
- s.beforeCreate = c ? [].concat(c, l) : [l];
22
+ var c = a.beforeCreate;
23
+ a.beforeCreate = c ? [].concat(c, l) : [l];
24
24
  }
25
25
  return {
26
26
  exports: r,
27
- options: s
27
+ options: a
28
28
  };
29
29
  }
30
- const _ = {
30
+ const y = {
31
31
  props: {
32
32
  verificationSetting: {
33
33
  type: Object,
@@ -76,10 +76,10 @@ const _ = {
76
76
  }
77
77
  };
78
78
  var m = function() {
79
- var e = this, a = e._self._c;
80
- return a("el-button", { on: { click: e.buttonClick } }, [e._v(e._s(e.buttonType ? e.defaultText : e.buttonText + "s"))]);
79
+ var e = this, n = e._self._c;
80
+ return n("el-button", { on: { click: e.buttonClick } }, [e._v(e._s(e.buttonType ? e.defaultText : e.buttonText + "s"))]);
81
81
  }, g = [], b = /* @__PURE__ */ u(
82
- _,
82
+ y,
83
83
  m,
84
84
  g,
85
85
  !1,
@@ -132,9 +132,9 @@ const k = {
132
132
  default: []
133
133
  },
134
134
  size: {
135
- // 控制按钮大小
135
+ // 控制按钮大小 vue2 medium / small / mini
136
136
  type: String,
137
- default: "default"
137
+ default: ""
138
138
  },
139
139
  labelWidth: {
140
140
  // 表单文字宽度
@@ -228,9 +228,9 @@ const k = {
228
228
  methods: {
229
229
  /** 搜索按钮操作 */
230
230
  handleQuery() {
231
- var a;
231
+ var n;
232
232
  const r = { page: 1, limit: 10 }, e = {
233
- ...(a = this.$route) == null ? void 0 : a.query,
233
+ ...(n = this.$route) == null ? void 0 : n.query,
234
234
  ...this.queryParams,
235
235
  ...r
236
236
  };
@@ -255,7 +255,7 @@ const k = {
255
255
  return "input-archive";
256
256
  },
257
257
  getItemRules(r) {
258
- const { type: e, rules: a = [] } = r, t = [...a];
258
+ const { type: e, rules: n = [] } = r, t = [...n];
259
259
  return this.noInputBlank && e === "input" && t.push({
260
260
  pattern: this.trimRegex,
261
261
  message: "请输入(不能仅输入空格)",
@@ -263,66 +263,69 @@ const k = {
263
263
  }), t;
264
264
  },
265
265
  getInputSetting(r) {
266
- const { inputSetting: e } = r;
266
+ const { inputSetting: e, setting: n } = r;
267
267
  return {
268
268
  ...this.inputSetting,
269
- ...e
269
+ ...e,
270
+ ...n
270
271
  };
271
272
  },
272
273
  getSelectSetting(r) {
273
- const { selectSetting: e } = r;
274
+ const { selectSetting: e, setting: n } = r;
274
275
  return {
275
276
  ...this.selectSetting,
276
- ...e
277
+ ...e,
278
+ ...n
277
279
  };
278
280
  },
279
281
  getDatePackerSetting(r) {
280
- const { datePackerSetting: e } = r;
282
+ const { datePackerSetting: e, setting: n } = r;
281
283
  return {
282
284
  ...this.datePackerSetting,
283
- ...e
285
+ ...e,
286
+ ...n
284
287
  };
285
288
  }
286
289
  }
287
290
  };
288
291
  var S = function() {
289
- var e = this, a = e._self._c;
290
- return a("el-form", e._b({ directives: [{ name: "show", rawName: "v-show", value: e.showSearch, expression: "showSearch" }], ref: "queryFormRef", attrs: { model: e.queryParams, inline: "", "label-position": "left", "label-width": e.labelWidth } }, "el-form", e.$attrs, !1), [e._l(e.formItem, function(t) {
291
- return a("el-form-item", { key: t.prop, attrs: { label: t.label, prop: t.prop, rules: e.getItemRules(t) } }, [t.type === "input" ? a("el-input", e._b({ attrs: { size: e.size }, nativeOn: { keydown: function(n) {
292
- return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.getList.apply(null, arguments);
293
- } }, scopedSlots: e._u([e._l(t.template, function(n, o) {
292
+ var e = this, n = e._self._c;
293
+ return n("el-form", e._b({ directives: [{ name: "show", rawName: "v-show", value: e.showSearch, expression: "showSearch" }], ref: "queryFormRef", attrs: { model: e.queryParams, inline: "", "label-position": "left", "label-width": e.labelWidth } }, "el-form", e.$attrs, !1), [e._l(e.formItem, function(t) {
294
+ return n("el-form-item", { key: t.prop, attrs: { label: t.label, prop: t.prop, rules: e.getItemRules(t) } }, [t.type === "input" ? n("el-input", e._b({ attrs: { size: e.size }, nativeOn: { keydown: function(s) {
295
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.getList.apply(null, arguments);
296
+ } }, scopedSlots: e._u([e._l(t.template, function(s, o) {
294
297
  return { key: o, fn: function() {
295
- return [n ? a(e.currentInputComponent(), { key: o, tag: "component", attrs: { templateEle: n } }) : e._e()];
298
+ return [s ? n(e.currentInputComponent(), { key: o, tag: "component", attrs: { templateEle: s } }) : e._e()];
296
299
  }, proxy: !0 };
297
- })], null, !0), model: { value: e.queryParams[t.prop], callback: function(n) {
298
- e.$set(e.queryParams, t.prop, n);
299
- }, expression: "queryParams[item.prop]" } }, "el-input", e.getInputSetting(t), !1)) : t.type === "input-mobile-verification" ? a("el-input", e._b({ attrs: { size: e.size }, nativeOn: { keydown: function(n) {
300
- return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.getList.apply(null, arguments);
301
- } }, scopedSlots: e._u([e._l(t.template, function(n, o) {
300
+ })], null, !0), model: { value: e.queryParams[t.prop], callback: function(s) {
301
+ e.$set(e.queryParams, t.prop, s);
302
+ }, expression: "queryParams[item.prop]" } }, "el-input", e.getInputSetting(t), !1)) : t.type === "input-mobile-verification" ? n("el-input", e._b({ attrs: { size: e.size }, nativeOn: { keydown: function(s) {
303
+ return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.getList.apply(null, arguments);
304
+ } }, scopedSlots: e._u([e._l(t.template, function(s, o) {
302
305
  return { key: o, fn: function() {
303
- return [n ? a(e.currentInputComponent(), { key: o, tag: "component", attrs: { templateEle: n } }) : e._e()];
306
+ return [s ? n(e.currentInputComponent(), { key: o, tag: "component", attrs: { templateEle: s } }) : e._e()];
304
307
  }, proxy: !0 };
305
- })], null, !0), model: { value: e.queryParams[t.prop], callback: function(n) {
306
- e.$set(e.queryParams, t.prop, n);
307
- }, expression: "queryParams[item.prop]" } }, "el-input", e.getInputSetting(t), !1), [a("template", { slot: "append" }, [a("verification-button", { attrs: { verificationSetting: t.verificationSetting, getSmscode: t.getSmscode } })], 1)], 2) : t.type === "select" ? a("el-select", e._b({ attrs: { filterable: "", size: e.size }, model: { value: e.queryParams[t.prop], callback: function(n) {
308
- e.$set(e.queryParams, t.prop, n);
309
- }, expression: "queryParams[item.prop]" } }, "el-select", e.getSelectSetting(t), !1), e._l(t.option || [], function(n) {
310
- return a("el-option", { key: n.value, attrs: { label: n.label, value: n.value } });
311
- }), 1) : t.type === "cascader" ? a("el-cascader", e._b({ attrs: { filterable: "", size: e.size, options: t.options || [] }, model: { value: e.queryParams[t.prop], callback: function(n) {
312
- e.$set(e.queryParams, t.prop, n);
313
- }, expression: "queryParams[item.prop]" } }, "el-cascader", e.getSelectSetting(t), !1)) : t.type === "date-picker" ? a("el-date-picker", e._b({ attrs: { size: e.size }, model: { value: e.queryParams[t.prop], callback: function(n) {
314
- e.$set(e.queryParams, t.prop, n);
315
- }, expression: "queryParams[item.prop]" } }, "el-date-picker", e.getDatePackerSetting(t), !1)) : e._e(), t.type === "input-number" ? a("el-input-number", e._b({ attrs: { size: e.size }, model: { value: e.queryParams[t.prop], callback: function(n) {
316
- e.$set(e.queryParams, t.prop, n);
308
+ })], null, !0), model: { value: e.queryParams[t.prop], callback: function(s) {
309
+ e.$set(e.queryParams, t.prop, s);
310
+ }, expression: "queryParams[item.prop]" } }, "el-input", e.getInputSetting(t), !1), [n("template", { slot: "append" }, [n("verification-button", { attrs: { verificationSetting: t.verificationSetting, getSmscode: t.getSmscode } })], 1)], 2) : t.type === "select" ? n("el-select", e._b({ attrs: { filterable: "", size: e.size }, model: { value: e.queryParams[t.prop], callback: function(s) {
311
+ e.$set(e.queryParams, t.prop, s);
312
+ }, expression: "queryParams[item.prop]" } }, "el-select", e.getSelectSetting(t), !1), e._l(t.option || [], function(s) {
313
+ return n("el-option", { key: s.value, attrs: { label: s.label, value: s.value } });
314
+ }), 1) : t.type === "cascader" ? n("el-cascader", e._b({ attrs: { filterable: "", size: e.size, options: t.options || [] }, model: { value: e.queryParams[t.prop], callback: function(s) {
315
+ e.$set(e.queryParams, t.prop, s);
316
+ }, expression: "queryParams[item.prop]" } }, "el-cascader", e.getSelectSetting(t), !1)) : t.type === "date-picker" ? n("el-date-picker", e._b({ attrs: { size: e.size }, model: { value: e.queryParams[t.prop], callback: function(s) {
317
+ e.$set(e.queryParams, t.prop, s);
318
+ }, expression: "queryParams[item.prop]" } }, "el-date-picker", e.getDatePackerSetting(t), !1)) : e._e(), t.type === "input-number" ? n("el-input-number", e._b({ attrs: { size: e.size }, model: { value: e.queryParams[t.prop], callback: function(s) {
319
+ e.$set(e.queryParams, t.prop, s);
317
320
  }, expression: "queryParams[item.prop]" } }, "el-input-number", e.getInputSetting(t), !1)) : e._e()], 1);
318
- }), e._t("default"), e.formOnly ? e._e() : a("el-form-item", [a("el-button", { attrs: { type: "primary", icon: "el-icon-search", size: e.size, loading: e.formLoading }, on: { click: e.handleQuery } }, [e._v("查询")]), a("el-button", { attrs: { icon: "el-icon-refresh", size: e.size }, on: { click: e.resetQuery } }, [e._v("重置")])], 1), e._t("behind-the-button")], 2);
321
+ }), 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);
319
322
  }, x = [], P = /* @__PURE__ */ u(
320
323
  k,
321
324
  S,
322
325
  x,
323
326
  !1,
324
327
  null,
325
- "1a16ba8f",
328
+ "eb469405",
326
329
  null,
327
330
  null
328
331
  );
@@ -374,25 +377,77 @@ const C = {
374
377
  }
375
378
  }
376
379
  };
377
- var w = function() {
378
- var e = this, a = e._self._c;
379
- return a("div", { staticClass: "search-box" }, [a("el-input", e._b({ style: { ...e.inputstyle }, attrs: { size: e.size }, nativeOn: { keydown: function(t) {
380
+ var $ = function() {
381
+ var e = this, n = e._self._c;
382
+ return n("div", { staticClass: "search-box" }, [n("el-input", e._b({ style: { ...e.inputstyle }, attrs: { size: e.size }, nativeOn: { keydown: function(t) {
380
383
  return !t.type.indexOf("key") && e._k(t.keyCode, "enter", 13, t.key, "Enter") ? null : e.search.apply(null, arguments);
381
384
  } }, model: { value: e.keyWord, callback: function(t) {
382
385
  e.keyWord = t;
383
- }, expression: "keyWord" } }, "el-input", e.$attrs, !1), [a("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" }, [a("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);
384
- }, $ = [], T = /* @__PURE__ */ u(
386
+ }, 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);
387
+ }, w = [], T = /* @__PURE__ */ u(
385
388
  C,
386
- w,
387
389
  $,
390
+ w,
388
391
  !1,
389
392
  null,
390
393
  "f4757253",
391
394
  null,
392
395
  null
393
396
  );
394
- const z = T.exports, B = q, I = z;
397
+ const z = T.exports, I = {
398
+ functional: !0,
399
+ props: {
400
+ column: {
401
+ default: { render: () => {
402
+ } },
403
+ type: Object
404
+ },
405
+ formData: {
406
+ default: {},
407
+ type: Object
408
+ }
409
+ },
410
+ render(r, e) {
411
+ const { props: n } = e, { column: t, formData: s } = n;
412
+ return t.render(s);
413
+ }
414
+ }, O = {
415
+ name: "Descriptions",
416
+ components: {
417
+ DescriptionsColumn: I
418
+ },
419
+ props: {
420
+ formItem: {
421
+ // 定义表单的数据
422
+ type: Array,
423
+ default: []
424
+ },
425
+ formData: {
426
+ // 外部传入的表单数据,用于回填
427
+ type: Object,
428
+ default: () => {
429
+ }
430
+ }
431
+ }
432
+ };
433
+ var B = function() {
434
+ var e = this, n = e._self._c;
435
+ return n("el-descriptions", e._b({ staticClass: "v-descriptions", attrs: { border: "" } }, "el-descriptions", e.$attrs, !1), e._l(e.formItem, function(t, s) {
436
+ return n("el-descriptions-item", e._b({ key: t.prop, attrs: { label: t.label } }, "el-descriptions-item", t.descriptionsItemProps, !1), [t.render ? n("DescriptionsColumn", { attrs: { column: t, formData: e.formData } }) : n("span", [e._v(e._s(e.formData[t.prop]))])], 1);
437
+ }), 1);
438
+ }, D = [], R = /* @__PURE__ */ u(
439
+ O,
440
+ B,
441
+ D,
442
+ !1,
443
+ null,
444
+ null,
445
+ null,
446
+ null
447
+ );
448
+ const F = R.exports, L = q, W = z, U = F;
395
449
  export {
396
- B as VGeneralBasicForm,
397
- I as VSearchBox
450
+ U as VDescriptions,
451
+ L as VGeneralBasicForm,
452
+ W as VSearchBox
398
453
  };
@@ -1 +1 @@
1
- (function(u,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(u=typeof globalThis<"u"?globalThis:u||self,p(u.Index={}))})(this,function(u){"use strict";const p="";function c(r,e,a,t,n,o,f,I){var s=typeof r=="function"?r.options:r;e&&(s.render=e,s.staticRenderFns=a,s._compiled=!0),t&&(s.functional=!0),o&&(s._scopeId="data-v-"+o);var l;if(f?(l=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__),n&&n.call(this,i),i&&i._registeredComponents&&i._registeredComponents.add(f)},s._ssrRegister=l):n&&(l=I?function(){n.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(s.functional){s._injectStyles=l;var O=s.render;s.render=function(F,h){return l.call(h),O(F,h)}}else{var d=s.beforeCreate;s.beforeCreate=d?[].concat(d,l):[l]}return{exports:r,options:s}}const y={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 _=function(){var e=this,a=e._self._c;return a("el-button",{on:{click:e.buttonClick}},[e._v(e._s(e.buttonType?e.defaultText:e.buttonText+"s"))])},m=[],g=c(y,_,m,!1,null,null,null,null);const b=g.exports,R="",v={name:"GeneralBasicForm",components:{InputArchive:r=>{const{templateEle:e}=r;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:"default"},labelWidth:{type:String,default:"90px"},noUrlParameters:{type:Boolean,default:()=>!1},formData:{type:Object,default:()=>{}},noInputBlank:{type:Boolean,default:()=>!1}},data(){var r;return{queryParams:{...this.noUrlParameters?{}:(r=this.$route)==null?void 0:r.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"}}},watch:{formData:{handler(r,e){JSON.stringify(r)!==JSON.stringify(e)&&(this.queryParams={...this.noUrlParameters?{}:this.queryParams,...r})},immediate:!0},queryParams:{handler(r){this.$emit("update:formData",r)},deep:!0},loading(r){this.formLoading!==r&&(this.formLoading=r)},formLoading(r){this.loading!==r&&this.$emit("update:loading",r)}},methods:{handleQuery(){var a;const r={page:1,limit:10},e={...(a=this.$route)==null?void 0:a.query,...this.queryParams,...r};this.noUrlParameters||this.$router.push({query:{...e}}),this.getList({...e})},async resetQuery(){var e;this.$refs.queryFormRef.resetFields();const r={page:1};this.noUrlParameters||await this.$router.push({query:{...r}}),this.queryParams={...this.noUrlParameters?{}:(e=this.$route)==null?void 0:e.query},this.afterReset(),this.handleQuery()},currentInputComponent(){return"input-archive"},getItemRules(r){const{type:e,rules:a=[]}=r,t=[...a];return this.noInputBlank&&e==="input"&&t.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),t},getInputSetting(r){const{inputSetting:e}=r;return{...this.inputSetting,...e}},getSelectSetting(r){const{selectSetting:e}=r;return{...this.selectSetting,...e}},getDatePackerSetting(r){const{datePackerSetting:e}=r;return{...this.datePackerSetting,...e}}}};var k=function(){var e=this,a=e._self._c;return a("el-form",e._b({directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryFormRef",attrs:{model:e.queryParams,inline:"","label-position":"left","label-width":e.labelWidth}},"el-form",e.$attrs,!1),[e._l(e.formItem,function(t){return a("el-form-item",{key:t.prop,attrs:{label:t.label,prop:t.prop,rules:e.getItemRules(t)}},[t.type==="input"?a("el-input",e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(t.template,function(n,o){return{key:o,fn:function(){return[n?a(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[t.prop],callback:function(n){e.$set(e.queryParams,t.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(t),!1)):t.type==="input-mobile-verification"?a("el-input",e._b({attrs:{size:e.size},nativeOn:{keydown:function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"enter",13,n.key,"Enter")?null:e.getList.apply(null,arguments)}},scopedSlots:e._u([e._l(t.template,function(n,o){return{key:o,fn:function(){return[n?a(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:n}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[t.prop],callback:function(n){e.$set(e.queryParams,t.prop,n)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(t),!1),[a("template",{slot:"append"},[a("verification-button",{attrs:{verificationSetting:t.verificationSetting,getSmscode:t.getSmscode}})],1)],2):t.type==="select"?a("el-select",e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[t.prop],callback:function(n){e.$set(e.queryParams,t.prop,n)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(t),!1),e._l(t.option||[],function(n){return a("el-option",{key:n.value,attrs:{label:n.label,value:n.value}})}),1):t.type==="cascader"?a("el-cascader",e._b({attrs:{filterable:"",size:e.size,options:t.options||[]},model:{value:e.queryParams[t.prop],callback:function(n){e.$set(e.queryParams,t.prop,n)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(t),!1)):t.type==="date-picker"?a("el-date-picker",e._b({attrs:{size:e.size},model:{value:e.queryParams[t.prop],callback:function(n){e.$set(e.queryParams,t.prop,n)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(t),!1)):e._e(),t.type==="input-number"?a("el-input-number",e._b({attrs:{size:e.size},model:{value:e.queryParams[t.prop],callback:function(n){e.$set(e.queryParams,t.prop,n)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(t),!1)):e._e()],1)}),e._t("default"),e.formOnly?e._e():a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:e.size,loading:e.formLoading},on:{click:e.handleQuery}},[e._v("查询")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:e.size},on:{click:e.resetQuery}},[e._v("重置")])],1),e._t("behind-the-button")],2)},S=[],x=c(v,k,S,!1,null,"1a16ba8f",null,null);const P=x.exports,L="",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 r,e;return{keyWord:((e=(r=this.$route)==null?void 0:r.query)==null?void 0:e.keyWord)||""}},methods:{search(){const r={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(r);window.open(e.href,"_blank")}else this.$router.push(r)}}};var C=function(){var e=this,a=e._self._c;return a("div",{staticClass:"search-box"},[a("el-input",e._b({style:{...e.inputstyle},attrs:{size:e.size},nativeOn:{keydown:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(t){e.keyWord=t},expression:"keyWord"}},"el-input",e.$attrs,!1),[a("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"},[a("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)},T=[],w=c(q,C,T,!1,null,"f4757253",null,null);const $=w.exports,z=P,B=$;u.VGeneralBasicForm=z,u.VSearchBox=B,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
1
+ (function(l,p){typeof exports=="object"&&typeof module<"u"?p(exports):typeof define=="function"&&define.amd?define(["exports"],p):(l=typeof globalThis<"u"?globalThis:l||self,p(l.Index={}))})(this,function(l){"use strict";const p="";function c(r,e,n,t,s,o,f,W){var a=typeof r=="function"?r.options:r;e&&(a.render=e,a.staticRenderFns=n,a._compiled=!0),t&&(a.functional=!0),o&&(a._scopeId="data-v-"+o);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=W?function(){s.call(this,(a.functional?this.parent:this).$root.$options.shadowRoot)}:s),u)if(a.functional){a._injectStyles=u;var V=a.render;a.render=function(U,h){return u.call(h),V(U,h)}}else{var d=a.beforeCreate;a.beforeCreate=d?[].concat(d,u):[u]}return{exports:r,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"))])},m=[],g=c(_,y,m,!1,null,null,null,null);const b=g.exports,j="",v={name:"GeneralBasicForm",components:{InputArchive:r=>{const{templateEle:e}=r;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 r;return{queryParams:{...this.noUrlParameters?{}:(r=this.$route)==null?void 0:r.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"}}},watch:{formData:{handler(r,e){JSON.stringify(r)!==JSON.stringify(e)&&(this.queryParams={...this.noUrlParameters?{}:this.queryParams,...r})},immediate:!0},queryParams:{handler(r){this.$emit("update:formData",r)},deep:!0},loading(r){this.formLoading!==r&&(this.formLoading=r)},formLoading(r){this.loading!==r&&this.$emit("update:loading",r)}},methods:{handleQuery(){var n;const r={page:1,limit:10},e={...(n=this.$route)==null?void 0:n.query,...this.queryParams,...r};this.noUrlParameters||this.$router.push({query:{...e}}),this.getList({...e})},async resetQuery(){var e;this.$refs.queryFormRef.resetFields();const r={page:1};this.noUrlParameters||await this.$router.push({query:{...r}}),this.queryParams={...this.noUrlParameters?{}:(e=this.$route)==null?void 0:e.query},this.afterReset(),this.handleQuery()},currentInputComponent(){return"input-archive"},getItemRules(r){const{type:e,rules:n=[]}=r,t=[...n];return this.noInputBlank&&e==="input"&&t.push({pattern:this.trimRegex,message:"请输入(不能仅输入空格)",trigger:"blur"}),t},getInputSetting(r){const{inputSetting:e,setting:n}=r;return{...this.inputSetting,...e,...n}},getSelectSetting(r){const{selectSetting:e,setting:n}=r;return{...this.selectSetting,...e,...n}},getDatePackerSetting(r){const{datePackerSetting:e,setting:n}=r;return{...this.datePackerSetting,...e,...n}}}};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,inline:"","label-position":"left","label-width":e.labelWidth}},"el-form",e.$attrs,!1),[e._l(e.formItem,function(t){return n("el-form-item",{key:t.prop,attrs:{label:t.label,prop:t.prop,rules:e.getItemRules(t)}},[t.type==="input"?n("el-input",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(t.template,function(s,o){return{key:o,fn:function(){return[s?n(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:s}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[t.prop],callback:function(s){e.$set(e.queryParams,t.prop,s)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(t),!1)):t.type==="input-mobile-verification"?n("el-input",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(t.template,function(s,o){return{key:o,fn:function(){return[s?n(e.currentInputComponent(),{key:o,tag:"component",attrs:{templateEle:s}}):e._e()]},proxy:!0}})],null,!0),model:{value:e.queryParams[t.prop],callback:function(s){e.$set(e.queryParams,t.prop,s)},expression:"queryParams[item.prop]"}},"el-input",e.getInputSetting(t),!1),[n("template",{slot:"append"},[n("verification-button",{attrs:{verificationSetting:t.verificationSetting,getSmscode:t.getSmscode}})],1)],2):t.type==="select"?n("el-select",e._b({attrs:{filterable:"",size:e.size},model:{value:e.queryParams[t.prop],callback:function(s){e.$set(e.queryParams,t.prop,s)},expression:"queryParams[item.prop]"}},"el-select",e.getSelectSetting(t),!1),e._l(t.option||[],function(s){return n("el-option",{key:s.value,attrs:{label:s.label,value:s.value}})}),1):t.type==="cascader"?n("el-cascader",e._b({attrs:{filterable:"",size:e.size,options:t.options||[]},model:{value:e.queryParams[t.prop],callback:function(s){e.$set(e.queryParams,t.prop,s)},expression:"queryParams[item.prop]"}},"el-cascader",e.getSelectSetting(t),!1)):t.type==="date-picker"?n("el-date-picker",e._b({attrs:{size:e.size},model:{value:e.queryParams[t.prop],callback:function(s){e.$set(e.queryParams,t.prop,s)},expression:"queryParams[item.prop]"}},"el-date-picker",e.getDatePackerSetting(t),!1)):e._e(),t.type==="input-number"?n("el-input-number",e._b({attrs:{size:e.size},model:{value:e.queryParams[t.prop],callback:function(s){e.$set(e.queryParams,t.prop,s)},expression:"queryParams[item.prop]"}},"el-input-number",e.getInputSetting(t),!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)},S=[],x=c(v,k,S,!1,null,"eb469405",null,null);const P=x.exports,N="",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 r,e;return{keyWord:((e=(r=this.$route)==null?void 0:r.query)==null?void 0:e.keyWord)||""}},methods:{search(){const r={path:this.routePath,query:{...this.query,keyWord:this.keyWord}};if(this.openHref){const e=this.$router.resolve(r);window.open(e.href,"_blank")}else this.$router.push(r)}}};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(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.keyWord,callback:function(t){e.keyWord=t},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)},$=[],T=c(q,C,$,!1,null,"f4757253",null,null);const w=T.exports,z={name:"Descriptions",components:{DescriptionsColumn:{functional:!0,props:{column:{default:{render:()=>{}},type:Object},formData:{default:{},type:Object}},render(r,e){const{props:n}=e,{column:t,formData:s}=n;return t.render(s)}}},props:{formItem:{type:Array,default:[]},formData:{type:Object,default:()=>{}}}};var I=function(){var e=this,n=e._self._c;return n("el-descriptions",e._b({staticClass:"v-descriptions",attrs:{border:""}},"el-descriptions",e.$attrs,!1),e._l(e.formItem,function(t,s){return n("el-descriptions-item",e._b({key:t.prop,attrs:{label:t.label}},"el-descriptions-item",t.descriptionsItemProps,!1),[t.render?n("DescriptionsColumn",{attrs:{column:t,formData:e.formData}}):n("span",[e._v(e._s(e.formData[t.prop]))])],1)}),1)},B=[],D=c(z,I,B,!1,null,null,null,null);const O=D.exports,F=P,R=w,L=O;l.VDescriptions=L,l.VGeneralBasicForm=F,l.VSearchBox=R,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "general-basic-form",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "description": "",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "type": "module",