starfish-form-custom 1.0.26 → 1.0.28

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.
@@ -11,7 +11,7 @@ import 'element-plus/es/components/button/style/css';
11
11
  import 'element-plus/es/components/tooltip/style/css';
12
12
  import { defineComponent, inject, ref, getCurrentInstance, reactive, onMounted, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, toDisplayString, createCommentVNode, createBlock, withCtx, createVNode, Fragment, renderList, withModifiers, createTextVNode } from 'vue';
13
13
  import { Codemirror } from 'vue-codemirror';
14
- import { _ as _export_sfc } from './main-c35b558b.mjs';
14
+ import { _ as _export_sfc } from './main-44859f58.mjs';
15
15
  import 'element-plus/es/components/icon/style/css';
16
16
  import 'element-plus/es/components/checkbox/style/css';
17
17
  import '@element-plus/icons-vue';
@@ -13,9 +13,9 @@ import 'element-plus/es/components/dropdown-item/style/css';
13
13
  import 'element-plus/es/components/button/style/css';
14
14
  import 'element-plus/es/components/tooltip/style/css';
15
15
  import { defineComponent, getCurrentInstance, inject, computed, ref, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode, createBlock, withCtx, createVNode, Fragment, renderList, createTextVNode } from 'vue';
16
- import { _ as _export_sfc, a as _, f as fieldProps, r as ruleList, b as ruleJsonData } from './main-c35b558b.mjs';
16
+ import { _ as _export_sfc, a as _, f as fieldProps, r as ruleList, b as ruleJsonData } from './main-44859f58.mjs';
17
17
  import { Delete } from '@element-plus/icons-vue';
18
- import Dynamicform from './starfish-form-dd44ab87.mjs';
18
+ import Dynamicform from './starfish-form-c0d59f72.mjs';
19
19
  import { Codemirror } from 'vue-codemirror';
20
20
  import 'element-plus/es/components/input/style/css';
21
21
  import 'element-plus/es/components/checkbox/style/css';
@@ -3,7 +3,7 @@ import 'element-plus/es/components/base/style/css';
3
3
  import 'element-plus/es/components/tooltip/style/css';
4
4
  import { defineComponent, ref, onMounted, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode, createBlock, withCtx } from 'vue';
5
5
  import E from 'wangeditor';
6
- import { _ as _export_sfc, g as getFormConfig, f as fieldProps, u as useWatch } from './main-c35b558b.mjs';
6
+ import { _ as _export_sfc, g as getFormConfig, f as fieldProps, u as useWatch } from './main-44859f58.mjs';
7
7
  import 'element-plus/es/components/icon/style/css';
8
8
  import 'element-plus/es/components/input/style/css';
9
9
  import 'element-plus/es/components/checkbox/style/css';
@@ -6,7 +6,7 @@ import 'element-plus/es/components/button/style/css';
6
6
  import 'element-plus/es/components/main/style/css';
7
7
  import 'element-plus/es/components/tooltip/style/css';
8
8
  import { defineComponent, ref, onMounted, watch, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, toDisplayString, createCommentVNode, createBlock, withCtx, createVNode, createTextVNode } from 'vue';
9
- import { _ as _export_sfc, a as _, g as getFormConfig, f as fieldProps, u as useWatch } from './main-c35b558b.mjs';
9
+ import { _ as _export_sfc, a as _, g as getFormConfig, f as fieldProps, u as useWatch } from './main-44859f58.mjs';
10
10
  import JSONEditor from 'jsoneditor';
11
11
  import 'element-plus/es/components/icon/style/css';
12
12
  import 'element-plus/es/components/input/style/css';
@@ -966,6 +966,10 @@ const fieldProps = {
966
966
  return {};
967
967
  }
968
968
  },
969
+ readonly: {
970
+ type: Boolean,
971
+ default: false
972
+ },
969
973
  labelalign: {
970
974
  type: String,
971
975
  default: "top"
@@ -2097,7 +2101,7 @@ function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
2097
2101
  class: "control",
2098
2102
  style: normalizeStyle({ marginLeft: _ctx.labelalign != "top" ? _ctx.labelWidth + "px" : "" })
2099
2103
  }, [
2100
- !_ctx.drag && _ctx.data[_ctx.item.data.fieldName] && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$a, toDisplayString(_ctx.data[_ctx.item.data.fieldName].join(",") || "--"), 1)) : !_ctx.drag && _ctx.data[_ctx.item.data.fieldName] ? (openBlock(), createBlock(_component_el_checkbox_group, {
2104
+ !_ctx.drag && _ctx.data[_ctx.item.data.fieldName] && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$a, toDisplayString(_ctx.data[_ctx.item.data.fieldName].join(",") || "--"), 1)) : !_ctx.drag && _ctx.data[_ctx.item.data.fieldName] ? (openBlock(), createBlock(_component_el_checkbox_group, {
2101
2105
  key: 1,
2102
2106
  modelValue: _ctx.data[_ctx.item.data.fieldName],
2103
2107
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.data[_ctx.item.data.fieldName] = $event),
@@ -2356,7 +2360,7 @@ function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
2356
2360
  disabled: _ctx.item.data.state === "disabled",
2357
2361
  readonly: _ctx.item.data.state === "readonly"
2358
2362
  }, null, 8, ["modelValue", "type", "format", "value-format", "placeholder", "size", "disabled", "readonly"])) : createCommentVNode("", true),
2359
- !_ctx.drag && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$8, toDisplayString(_ctx.formatReadonlyDate(_ctx.data[_ctx.item.data.fieldName], _ctx.item.data.format)), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_date_picker, {
2363
+ !_ctx.drag && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$8, toDisplayString(_ctx.formatReadonlyDate(_ctx.data[_ctx.item.data.fieldName], _ctx.item.data.format)), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_date_picker, {
2360
2364
  key: 2,
2361
2365
  modelValue: _ctx.data[_ctx.item.data.fieldName],
2362
2366
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.data[_ctx.item.data.fieldName] = $event),
@@ -2555,7 +2559,7 @@ function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
2555
2559
  precision: _ctx.item.data.precision,
2556
2560
  disabled: _ctx.item.data.state === "disabled" || _ctx.item.data.state === "readonly"
2557
2561
  }, null, 8, ["modelValue", "controls-position", "size", "precision", "disabled"])) : createCommentVNode("", true),
2558
- !_ctx.drag && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$7, toDisplayString(_ctx.formatReadonlyNumber(_ctx.data[_ctx.item.data.fieldName], _ctx.item.data.precision)), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_input_number, {
2562
+ !_ctx.drag && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$7, toDisplayString(_ctx.formatReadonlyNumber(_ctx.data[_ctx.item.data.fieldName], _ctx.item.data.precision)), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_input_number, {
2559
2563
  key: 2,
2560
2564
  modelValue: _ctx.data[_ctx.item.data.fieldName],
2561
2565
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.data[_ctx.item.data.fieldName] = $event),
@@ -2635,7 +2639,7 @@ function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
2635
2639
  class: "control",
2636
2640
  style: normalizeStyle({ marginLeft: _ctx.labelalign != "top" ? _ctx.labelWidth + "px" : "" })
2637
2641
  }, [
2638
- !_ctx.drag && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$6, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_radio_group, {
2642
+ !_ctx.drag && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$6, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_radio_group, {
2639
2643
  key: 1,
2640
2644
  modelValue: _ctx.data[_ctx.item.data.fieldName],
2641
2645
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.data[_ctx.item.data.fieldName] = $event),
@@ -3204,7 +3208,7 @@ function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
3204
3208
  ]),
3205
3209
  _: 1
3206
3210
  }, 8, ["modelValue", "placeholder", "size", "disabled"])) : createCommentVNode("", true),
3207
- !_ctx.drag && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$5, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_select, {
3211
+ !_ctx.drag && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$5, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_select, {
3208
3212
  key: 2,
3209
3213
  modelValue: _ctx.data[_ctx.item.data.fieldName],
3210
3214
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.data[_ctx.item.data.fieldName] = $event),
@@ -3325,7 +3329,7 @@ function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
3325
3329
  ]),
3326
3330
  _: 1
3327
3331
  }, 8, ["modelValue", "placeholder", "disabled", "size"])) : createCommentVNode("", true),
3328
- !_ctx.drag && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(_ctx.data[_ctx.item.data.fieldName].join(",") || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_select, {
3332
+ !_ctx.drag && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$4, toDisplayString(_ctx.data[_ctx.item.data.fieldName].join(",") || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_select, {
3329
3333
  key: 2,
3330
3334
  modelValue: _ctx.data[_ctx.item.data.fieldName],
3331
3335
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.data[_ctx.item.data.fieldName] = $event),
@@ -3730,7 +3734,7 @@ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
3730
3734
  minlength: _ctx.item.data.minLength,
3731
3735
  class: normalizeClass("input-" + _ctx.item.data.align)
3732
3736
  }, null, 8, ["modelValue", "placeholder", "size", "disabled", "readonly", "maxlength", "minlength", "class"])) : createCommentVNode("", true),
3733
- !_ctx.drag && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_input, {
3737
+ !_ctx.drag && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$2, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_input, {
3734
3738
  key: 2,
3735
3739
  modelValue: _ctx.data[_ctx.item.data.fieldName],
3736
3740
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.data[_ctx.item.data.fieldName] = $event),
@@ -3839,7 +3843,7 @@ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
3839
3843
  autosize: _ctx.item.data.autoHeight,
3840
3844
  size: _ctx.size
3841
3845
  }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "maxlength", "minlength", "autosize", "size"])) : createCommentVNode("", true),
3842
- !_ctx.drag && _ctx.item.data.state === "readonly" ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_input, {
3846
+ !_ctx.drag && (_ctx.item.data.state === "readonly" || _ctx.readonly) ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(_ctx.data[_ctx.item.data.fieldName] || "--"), 1)) : !_ctx.drag ? (openBlock(), createBlock(_component_el_input, {
3843
3847
  key: 2,
3844
3848
  type: "textarea",
3845
3849
  modelValue: _ctx.data[_ctx.item.data.fieldName],
@@ -4497,8 +4501,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
4497
4501
  item: listItem,
4498
4502
  size: "default",
4499
4503
  data: _ctx.data || "{}",
4500
- drag: false
4501
- }, null, 40, ["item", "data"]))
4504
+ drag: false,
4505
+ readonly: _ctx.readonly
4506
+ }, null, 40, ["item", "data", "readonly"]))
4502
4507
  ]),
4503
4508
  _: 2
4504
4509
  }, 1032, ["prop"])) : (openBlock(), createBlock(resolveDynamicComponent(listItem.ControlType), {
@@ -4509,8 +4514,9 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
4509
4514
  size: "default",
4510
4515
  item: listItem,
4511
4516
  data: _ctx.data || "{}",
4512
- drag: false
4513
- }, null, 40, ["item", "data"]))
4517
+ drag: false,
4518
+ readonly: _ctx.readonly
4519
+ }, null, 40, ["item", "data", "readonly"]))
4514
4520
  ], 64);
4515
4521
  }), 256))
4516
4522
  ]),
@@ -4643,8 +4649,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
4643
4649
  item: listItem,
4644
4650
  data: _ctx.data || "{}",
4645
4651
  size: "default",
4646
- drag: false
4647
- }, null, 40, ["item", "data"]))
4652
+ drag: false,
4653
+ readonly: _ctx.readonly
4654
+ }, null, 40, ["item", "data", "readonly"]))
4648
4655
  ]),
4649
4656
  _: 2
4650
4657
  }, 1032, ["prop"])) : (openBlock(), createBlock(resolveDynamicComponent(listItem.ControlType), {
@@ -4655,8 +4662,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
4655
4662
  key: listItem.id,
4656
4663
  item: listItem,
4657
4664
  data: _ctx.data || "{}",
4658
- drag: false
4659
- }, null, 40, ["item", "data"]))
4665
+ drag: false,
4666
+ readonly: _ctx.readonly
4667
+ }, null, 40, ["item", "data", "readonly"]))
4660
4668
  ], 64);
4661
4669
  }), 256)) : createCommentVNode("", true)
4662
4670
  ]);
@@ -5317,7 +5325,7 @@ Object.keys(files).forEach((fileName) => {
5317
5325
  }
5318
5326
  });
5319
5327
  const RichText = defineAsyncComponent({
5320
- loader: () => import('./index-32206a30.mjs'),
5328
+ loader: () => import('./index-28c1c8c7.mjs'),
5321
5329
  loadingComponent: Loading
5322
5330
  });
5323
5331
  RichText.ControlType = "RichText";
@@ -5326,7 +5334,7 @@ RichText.icon = "icon-textEdit";
5326
5334
  RichText.formConfig = getFormConfig("RichText");
5327
5335
  utilFuns[RichText.ControlType] = RichText;
5328
5336
  const jsonEditor = defineAsyncComponent({
5329
- loader: () => import('./index-99892fc1.mjs'),
5337
+ loader: () => import('./index-da6c3466.mjs'),
5330
5338
  loadingComponent: Loading
5331
5339
  });
5332
5340
  jsonEditor.ControlType = "JsonEditor";
@@ -5336,14 +5344,14 @@ jsonEditor.formConfig = getFormConfig("JsonEditor", [{ fieldName: "default", com
5336
5344
  jsonEditor.rule = _.getJsonValidate();
5337
5345
  utilFuns[jsonEditor.ControlType] = jsonEditor;
5338
5346
  const formAction = defineAsyncComponent({
5339
- loader: () => import('./formAction-cad81869.mjs'),
5347
+ loader: () => import('./formAction-47d46ff6.mjs'),
5340
5348
  loadingComponent: Loading
5341
5349
  });
5342
5350
  formAction.ControlType = "FormAction";
5343
5351
  formAction.isHide = true;
5344
5352
  utilFuns[formAction.ControlType] = formAction;
5345
5353
  const Rule = defineAsyncComponent({
5346
- loader: () => import('./index-c1995810.mjs'),
5354
+ loader: () => import('./index-283831d1.mjs'),
5347
5355
  loadingComponent: Loading
5348
5356
  });
5349
5357
  Rule.ControlType = "Rule";
@@ -5352,7 +5360,7 @@ utilFuns[Rule.ControlType] = Rule;
5352
5360
  const install = (app) => {
5353
5361
  app.config.globalProperties.$formcomponents = utilFuns;
5354
5362
  };
5355
- const Dynamicform = defineAsyncComponent(() => import('./starfish-form-dd44ab87.mjs'));
5363
+ const Dynamicform = defineAsyncComponent(() => import('./starfish-form-c0d59f72.mjs'));
5356
5364
  const main = {
5357
5365
  install
5358
5366
  };
@@ -3,7 +3,7 @@ import 'element-plus/es/components/base/style/css';
3
3
  import 'element-plus/es/components/form/style/css';
4
4
  import 'element-plus/es/components/form-item/style/css';
5
5
  import { defineComponent, getCurrentInstance, ref, onMounted, openBlock, createElementBlock, createVNode, mergeProps, withCtx, Fragment, renderList, createBlock, resolveDynamicComponent, createCommentVNode, toRaw } from 'vue';
6
- import { _ as _export_sfc } from './main-c35b558b.mjs';
6
+ import { _ as _export_sfc } from './main-44859f58.mjs';
7
7
  import 'element-plus/es/components/icon/style/css';
8
8
  import 'element-plus/es/components/input/style/css';
9
9
  import 'element-plus/es/components/checkbox/style/css';
@@ -56,6 +56,10 @@ const _sfc_main = defineComponent({
56
56
  default() {
57
57
  return {};
58
58
  }
59
+ },
60
+ readonly: {
61
+ type: Boolean,
62
+ default: false
59
63
  }
60
64
  },
61
65
  setup(props, { emit }) {
@@ -78,7 +82,9 @@ const _sfc_main = defineComponent({
78
82
  });
79
83
  } else if (item.type == "func") {
80
84
  const mainData = props.formResult;
81
- const func = eval(`((rule, value, callback, mainData = mainData) => {${item.value.func}})`);
85
+ const func = eval(
86
+ `((rule, value, callback, mainData = mainData) => {${item.value.func}})`
87
+ );
82
88
  result.push({
83
89
  validator: func,
84
90
  trigger: "blur"
@@ -167,7 +173,9 @@ const _sfc_main = defineComponent({
167
173
  } else {
168
174
  try {
169
175
  if (Array.isArray(item2.data.showRule)) {
170
- item2.show = conditionChange(transformData(toRaw(item2.data.showRule)));
176
+ item2.show = conditionChange(
177
+ transformData(toRaw(item2.data.showRule))
178
+ );
171
179
  } else {
172
180
  item2.show = conditionChange(toRaw(item2.data.showRule));
173
181
  }
@@ -315,11 +323,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
315
323
  ref: "controlObj",
316
324
  onChange: _ctx.handleControlChange
317
325
  }, _ctx.globalConfig, {
326
+ readonly: _ctx.readonly,
318
327
  item: item2,
319
328
  data: _ctx.formResult || "{}",
320
329
  drag: false,
321
330
  size: "default"
322
- }), null, 16, ["onChange", "item", "data"]))
331
+ }), null, 16, ["onChange", "readonly", "item", "data"]))
323
332
  ]),
324
333
  _: 2
325
334
  }, 1032, ["prop"])) : item2.show ? (openBlock(), createBlock(resolveDynamicComponent(item2.ControlType), mergeProps({
@@ -329,11 +338,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
329
338
  onChange: _ctx.handleControlChange,
330
339
  key: item2.id
331
340
  }, _ctx.globalConfig, {
341
+ readonly: _ctx.readonly,
332
342
  item: item2,
333
343
  data: _ctx.formResult || "{}",
334
344
  drag: false,
335
345
  size: "default"
336
- }), null, 16, ["onChange", "item", "data"])) : createCommentVNode("", true)
346
+ }), null, 16, ["onChange", "readonly", "item", "data"])) : createCommentVNode("", true)
337
347
  ], 64);
338
348
  }), 256))
339
349
  ]),
@@ -1,4 +1,4 @@
1
- export { D as Dynamicform, m as default } from './main-c35b558b.mjs';
1
+ export { D as Dynamicform, m as default } from './main-44859f58.mjs';
2
2
  import 'vue';
3
3
  import 'element-plus/es';
4
4
  import 'element-plus/es/components/base/style/css';
@@ -14,6 +14,10 @@ export declare const Dynamicform: DefineComponent<{
14
14
  type: ObjectConstructor;
15
15
  default(): {};
16
16
  };
17
+ readonly: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
17
21
  }, {
18
22
  rules: any;
19
23
  ruleForm: Ref<any>;
@@ -34,7 +38,12 @@ export declare const Dynamicform: DefineComponent<{
34
38
  type: ObjectConstructor;
35
39
  default(): {};
36
40
  };
41
+ readonly: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
37
45
  }>>, {
46
+ readonly: boolean;
38
47
  allFormList: any;
39
48
  formResult: Record<string, any>;
40
49
  globalConfig: Record<string, any>;
@@ -14,6 +14,10 @@ declare const _sfc_main: DefineComponent<{
14
14
  type: ObjectConstructor;
15
15
  default(): {};
16
16
  };
17
+ readonly: {
18
+ type: BooleanConstructor;
19
+ default: boolean;
20
+ };
17
21
  }, {
18
22
  rules: any;
19
23
  ruleForm: Ref<any>;
@@ -34,7 +38,12 @@ declare const _sfc_main: DefineComponent<{
34
38
  type: ObjectConstructor;
35
39
  default(): {};
36
40
  };
41
+ readonly: {
42
+ type: BooleanConstructor;
43
+ default: boolean;
44
+ };
37
45
  }>>, {
46
+ readonly: boolean;
38
47
  allFormList: any;
39
48
  formResult: Record<string, any>;
40
49
  globalConfig: Record<string, any>;
@@ -16,6 +16,10 @@ declare const _default: {
16
16
  type: ObjectConstructor;
17
17
  default(): {};
18
18
  };
19
+ readonly: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
19
23
  labelalign: {
20
24
  type: StringConstructor;
21
25
  default: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starfish-form-custom",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "main": "dist/starfish-form.mjs",
5
5
  "style": "dist/style.css",
6
6
  "module": "dist/starfish-form.mjs",
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
  <div class="control" :style="{marginLeft: labelalign != 'top'?labelWidth + 'px': ''}">
11
11
  <!-- 只读的时候就只展示文本 -->
12
- <span v-if="!drag && data[item.data.fieldName] && item.data.state === 'readonly'">{{ data[item.data.fieldName].join(',') || '--' }}</span>
12
+ <span v-if="!drag && data[item.data.fieldName] && (item.data.state === 'readonly' || readonly)">{{ data[item.data.fieldName].join(',') || '--' }}</span>
13
13
  <el-checkbox-group v-model="data[item.data.fieldName]" :class="{'vertical-group': item.data.arrangeMent === 'vertical'}" v-else-if="!drag && data[item.data.fieldName]" :size="size" :disabled="item.data.state === 'disabled' || item.data.state === 'readonly'">
14
14
  <el-checkbox v-for="(sitem, sindex) in item.data.itemConfig.items" :key="sindex" :label="sitem.value">{{ sitem.label }}</el-checkbox>
15
15
  </el-checkbox-group>
@@ -24,7 +24,7 @@
24
24
 
25
25
  <!-- 实际运行时的组件 -->
26
26
  <!-- 只读的时候就展示文字 -->
27
- <span v-if="!drag && item.data.state === 'readonly'">{{ formatReadonlyDate(data[item.data.fieldName], item.data.format) }}</span>
27
+ <span v-if="!drag && (item.data.state === 'readonly' || readonly)">{{ formatReadonlyDate(data[item.data.fieldName], item.data.format) }}</span>
28
28
  <el-date-picker
29
29
  v-model="data[item.data.fieldName]"
30
30
  style="width: 320px;"
@@ -38,7 +38,7 @@
38
38
  v-if="drag"
39
39
  />
40
40
  <!-- 只读展示文字 -->
41
- <span v-if="!drag && item.data.state === 'readonly'">{{ formatReadonlyNumber(data[item.data.fieldName], item.data.precision) }}</span>
41
+ <span v-if="!drag && (item.data.state === 'readonly' || readonly)">{{ formatReadonlyNumber(data[item.data.fieldName], item.data.precision) }}</span>
42
42
  <el-input-number
43
43
  v-model="data[item.data.fieldName]"
44
44
  style="width: 320px;"
@@ -29,7 +29,7 @@
29
29
  class="control"
30
30
  :style="{ marginLeft: labelalign != 'top' ? labelWidth + 'px' : '' }"
31
31
  >
32
- <span v-if="!drag && item.data.state === 'readonly'">{{ data[item.data.fieldName] || '--' }}</span>
32
+ <span v-if="!drag && (item.data.state === 'readonly' || readonly)">{{ data[item.data.fieldName] || '--' }}</span>
33
33
  <el-radio-group
34
34
  v-else-if="!drag"
35
35
  v-model="data[item.data.fieldName]"
@@ -43,7 +43,7 @@
43
43
  :value="items.value"
44
44
  />
45
45
  </el-select>
46
- <span v-if="!drag && item.data.state === 'readonly'">{{ data[item.data.fieldName] || '--' }}</span>
46
+ <span v-if="!drag && (item.data.state === 'readonly' || readonly)">{{ data[item.data.fieldName] || '--' }}</span>
47
47
  <el-select
48
48
  v-model="data[item.data.fieldName]"
49
49
  style="width: 320px;"
@@ -44,7 +44,7 @@
44
44
  :value="items.value"
45
45
  />
46
46
  </el-select>
47
- <span v-if="!drag && item.data.state === 'readonly'">{{ data[item.data.fieldName].join(',') || '--' }}</span>
47
+ <span v-if="!drag && (item.data.state === 'readonly' || readonly)">{{ data[item.data.fieldName].join(',') || '--' }}</span>
48
48
  <el-select
49
49
  v-model="data[item.data.fieldName]"
50
50
  style="width: 320px;"
@@ -41,7 +41,7 @@
41
41
  :minlength="item.data.minLength"
42
42
  :class="'input-' + item.data.align"
43
43
  />
44
- <span v-if="!drag && item.data.state === 'readonly'">{{ data[item.data.fieldName] || '--' }}</span>
44
+ <span v-if="!drag && (item.data.state === 'readonly' || readonly)">{{ data[item.data.fieldName] || '--' }}</span>
45
45
  <el-input
46
46
  v-model="data[item.data.fieldName]"
47
47
  style="width: 320px;"
@@ -40,7 +40,7 @@
40
40
  :autosize="item.data.autoHeight"
41
41
  :size="size"
42
42
  />
43
- <span v-if="!drag && item.data.state === 'readonly'">{{ data[item.data.fieldName] || '--' }}</span>
43
+ <span v-if="!drag && (item.data.state === 'readonly' || readonly)">{{ data[item.data.fieldName] || '--' }}</span>
44
44
  <el-input
45
45
  type="textarea"
46
46
  v-else-if="!drag"
@@ -16,10 +16,10 @@
16
16
  <el-col class="grid-col" v-for="(colItem, index) in item.data.columns" :key="index" :span="colItem.span">
17
17
  <template v-for="listItem in colItem.list" >
18
18
  <el-form-item :prop="listItem.data.fieldName" :key="listItem.id" v-if="!listItem.layout">
19
- <component ref="controlObj" @change="$emit('change')" :is="listItem.ControlType" :item="listItem" size="default" :data="data || '{}'" :drag="false"></component>
19
+ <component ref="controlObj" @change="$emit('change')" :is="listItem.ControlType" :item="listItem" size="default" :data="data || '{}'" :drag="false" :readonly="readonly"></component>
20
20
  </el-form-item>
21
21
  <template v-else>
22
- <component ref="controlObj" @change="$emit('change')" :key="listItem.id" :is="listItem.ControlType" size="default" :item="listItem" :data="data || '{}'" :drag="false"></component>
22
+ <component ref="controlObj" @change="$emit('change')" :key="listItem.id" :is="listItem.ControlType" size="default" :item="listItem" :data="data || '{}'" :drag="false" :readonly="readonly"></component>
23
23
  </template>
24
24
  </template>
25
25
  </el-col>
@@ -53,6 +53,7 @@
53
53
  :data="data || '{}'"
54
54
  size="default"
55
55
  :drag="false"
56
+ :readonly="readonly"
56
57
  ></component>
57
58
  </el-form-item>
58
59
  <template v-else>
@@ -65,6 +66,7 @@
65
66
  :item="listItem"
66
67
  :data="data || '{}'"
67
68
  :drag="false"
69
+ :readonly="readonly"
68
70
  ></component>
69
71
  </template>
70
72
  </template>