cloud-web-corejs 1.0.54-dev.352 → 1.0.54-dev.354

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.
@@ -1,24 +1,45 @@
1
1
  <template>
2
- <td class="table-cell" :class="[customClass,tdClass,'w'+widget.options.colspan]"
3
- :colspan="widget.options.colspan || 1" :rowspan="widget.options.rowspan || 1"
4
- :style="{width: widget.options.cellWidth + ' !important' || '', height: widget.options.cellHeight + ' !important' || ''}">
2
+ <td
3
+ class="table-cell"
4
+ :class="[customClass, tdClass, 'w' + widget.options.colspan]"
5
+ :colspan="widget.options.colspan || 1"
6
+ :rowspan="widget.options.rowspan || 1"
7
+ :style="{
8
+ width: widget.options.cellWidth + ' !important' || '',
9
+ height: widget.options.cellHeight + ' !important' || '',
10
+ }"
11
+ >
5
12
  <template v-for="(subWidget, swIdx) in widget.widgetList">
6
13
  <template v-if="'container' === subWidget.category">
7
- <component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
8
- :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam">
14
+ <component
15
+ :is="subWidget.type + '-item'"
16
+ :widget="subWidget"
17
+ :key="swIdx"
18
+ :parent-list="widget.widgetList"
19
+ :index-of-parent-list="swIdx"
20
+ :parent-widget="widget"
21
+ :tableParam="tableParam"
22
+ >
9
23
  <!-- 递归传递插槽!!! -->
10
24
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
11
- <slot :name="slot" v-bind="scope"/>
25
+ <slot :name="slot" v-bind="scope" />
12
26
  </template>
13
27
  </component>
14
28
  </template>
15
29
  <template v-else>
16
- <component :is="subWidget.type + '-widget'" :field="subWidget" :key="swIdx" :parent-list="widget.widgetList"
17
- :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam"
18
- :formItemProp="getProp(subWidget)">
30
+ <component
31
+ :is="subWidget.type + '-widget'"
32
+ :field="subWidget"
33
+ :key="swIdx"
34
+ :parent-list="widget.widgetList"
35
+ :index-of-parent-list="swIdx"
36
+ :parent-widget="widget"
37
+ :tableParam="tableParam"
38
+ :formItemProp="getProp(subWidget)"
39
+ >
19
40
  <!-- 递归传递插槽!!! -->
20
41
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
21
- <slot :name="slot" v-bind="scope"/>
42
+ <slot :name="slot" v-bind="scope" />
22
43
  </template>
23
44
  </component>
24
45
  </template>
@@ -27,10 +48,10 @@
27
48
  </template>
28
49
 
29
50
  <script>
30
- import emitter from '../../../../components/xform/utils/emitter'
31
- import i18n from "../../../../components/xform/utils/i18n"
32
- import refMixin from "../../../../components/xform/form-render/refMixin"
33
- import FieldComponents from '../../../../components/xform/form-designer/form-widget/field-widget/index'
51
+ import emitter from "../../../../components/xform/utils/emitter";
52
+ import i18n from "../../../../components/xform/utils/i18n";
53
+ import refMixin from "../../../../components/xform/form-render/refMixin";
54
+ import FieldComponents from "../../../../components/xform/form-designer/form-widget/field-widget/index";
34
55
 
35
56
  export default {
36
57
  name: "Table2CellItem",
@@ -46,21 +67,21 @@ export default {
46
67
  colIndex: Number,
47
68
  parentWidget: Object,
48
69
  parentTarget: Object,
49
- row: Object
70
+ row: Object,
50
71
  },
51
- inject: ['refList', 'globalModel', 'getRows'],
72
+ inject: ["refList", "globalModel", "getRows"],
52
73
  computed: {
53
74
  customClass() {
54
- return this.widget.options.customClass || ''
75
+ return this.widget.options.customClass || "";
55
76
  },
56
77
  tdClass() {
57
- return (this.colIndex + 1) % 2 == 0 ? "" : "odd"
78
+ return (this.colIndex + 1) % 2 == 0 ? "" : "odd";
58
79
  },
59
80
  formModel: {
60
81
  cache: !1,
61
82
  get: function () {
62
83
  return this.globalModel.formModel;
63
- }
84
+ },
64
85
  },
65
86
  formDataId() {
66
87
  let formRef = this.getFormRef();
@@ -69,10 +90,9 @@ export default {
69
90
  tableParam() {
70
91
  return {
71
92
  rowIndex: this.widget.options.rowIndex,
72
- row: this.row
73
- }
74
- }
75
-
93
+ row: this.row,
94
+ };
95
+ },
76
96
  },
77
97
  created() {
78
98
  /* tableCell不生成组件引用,故无须调用initRefList!! */
@@ -85,23 +105,22 @@ export default {
85
105
  if (this.widget.widgetList.length) {
86
106
  let formRef = this.getFormRef();
87
107
  let keyName = formRef.getFieldKeyName(this.widget.widgetList[0]);
108
+ if (!keyName) return;
88
109
  this.$watch(`row.${keyName}`, (newVal, oldVal) => {
89
110
  let rows = this.parentTarget.rows;
90
- rows.find(row => row.f_key == keyName).f_field_value = newVal
111
+ rows.find((row) => row.f_key == keyName).f_field_value = newVal;
91
112
  });
92
113
  }
93
114
  },
94
115
  getProp(subWidget) {
95
- let rowIndex = this.widget.options.rowIndex
116
+ let rowIndex = this.widget.options.rowIndex;
96
117
  let formRef = this.getFormRef();
97
- let keyName1 = formRef.getFieldKeyName(this.parentWidget)
98
- let name = `${keyName1}.${rowIndex}.f_field_value`
99
- return name
100
- }
101
- }
102
- }
118
+ let keyName1 = formRef.getFieldKeyName(this.parentWidget);
119
+ let name = `${keyName1}.${rowIndex}.f_field_value`;
120
+ return name;
121
+ },
122
+ },
123
+ };
103
124
  </script>
104
125
 
105
- <style lang="scss" scoped>
106
-
107
- </style>
126
+ <style lang="scss" scoped></style>