cloud-web-corejs 1.0.54-dev.145 → 1.0.54-dev.148

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.
Files changed (26) hide show
  1. package/package.json +1 -1
  2. package/src/components/xform/form-designer/designer.js +1 -1514
  3. package/src/components/xform/form-designer/form-widget/dialog/formDialog.vue +1 -1
  4. package/src/components/xform/form-designer/form-widget/dialog/formDrawer.vue +1 -1
  5. package/src/components/xform/form-designer/form-widget/dialog/searchFormDialog.vue +1 -1
  6. package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +1175 -1
  7. package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +4 -2
  8. package/src/components/xform/form-designer/indexMixin.js +1 -0
  9. package/src/components/xform/form-designer/setting-panel/indexMixin.js +322 -1
  10. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/columnRenderDialog.vue +76 -30
  11. package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/table-column-dialog.vue +20 -8
  12. package/src/components/xform/form-designer/setting-panel/property-editor/container-detail/detail-editor.vue +2 -2
  13. package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +1 -566
  14. package/src/components/xform/form-designer/widget-panel/indexMixin.js +276 -1
  15. package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +36 -1
  16. package/src/components/xform/form-render/container-item/containerItemMixin.js +330 -1
  17. package/src/components/xform/form-render/container-item/data-table-item.vue +22 -1
  18. package/src/components/xform/form-render/container-item/data-table-mixin.js +65 -46
  19. package/src/components/xform/form-render/container-item/grid-col-item.vue +6 -3
  20. package/src/components/xform/form-render/container-item/grid-item.vue +1 -1
  21. package/src/components/xform/form-render/container-item/tab-item.vue +11 -6
  22. package/src/components/xform/form-render/container-item/table-cell-item.vue +35 -33
  23. package/src/components/xform/form-render/container-item/table-item.vue +4 -2
  24. package/src/components/xform/form-render/indexMixin.js +1 -1819
  25. package/src/components/xform/mixins/scriptHttp.js +1 -1
  26. package/src/views/user/form/vform/designer.vue +8 -3
@@ -5,13 +5,13 @@ import containerItemMixin from "./containerItemMixin";
5
5
 
6
6
  import * as formatUtil from "../../../../components/xform/utils/format.js";
7
7
  import tableConfig from "../../../../components/table/config.js";
8
- import { extendDeeply } from "../../../../utils/index.js";
8
+ import {extendDeeply} from "../../../../utils/index.js";
9
9
  import {
10
10
  assembleAxiosConfig,
11
11
  getReportGlobalMap,
12
12
  generateId,
13
13
  } from "../../../../components/xform/utils/util";
14
- import { tableTreeMixins } from "../../../../mixins/tableTree/index.js";
14
+ import {tableTreeMixins} from "../../../../mixins/tableTree/index.js";
15
15
 
16
16
  let modules = {};
17
17
  const baseRefUtil = {
@@ -141,7 +141,7 @@ modules = {
141
141
  return void 0 === this.widget.options.buttonsColumnFixed
142
142
  ? "right"
143
143
  : !!this.widget.options.buttonsColumnFixed &&
144
- this.widget.options.buttonsColumnFixed;
144
+ this.widget.options.buttonsColumnFixed;
145
145
  },
146
146
  formModel: {
147
147
  cache: !1,
@@ -184,24 +184,35 @@ modules = {
184
184
  let name = params.widget.options.name;
185
185
  return this.getWidgetRefByTableRow(index, name);
186
186
  },
187
- getRowWidget(rowParam) {
187
+ getRowWidget(rowParam, fieldWidget) {
188
188
  let row = rowParam.row;
189
189
  let params = rowParam.column.params;
190
- let key = this.getRowRefKey(row, params.widget.options.name);
190
+ let name = fieldWidget ? fieldWidget.options.name : params.widget.options.name;
191
+ let key = this.getRowRefKey(row, name);
191
192
  let widget = this.widgetMap[key];
192
193
  if (!widget) {
193
194
  this.$set(
194
195
  this.widgetMap,
195
196
  key,
196
- this.$baseLodash.cloneDeep(params.widget)
197
+ this.$baseLodash.cloneDeep(fieldWidget ? fieldWidget : params.widget)
197
198
  );
198
199
  }
200
+
199
201
  return this.widgetMap[key];
200
202
  },
201
- getRowWidgetKey(rowParam) {
203
+ getRowWidgetOption(rowParam, fieldWidget) {
204
+ let widget = this.getRowWidget(rowParam, fieldWidget);
205
+ let field = widget.category == 'container' ? 'widget' : 'field'
206
+ let option = {
207
+ [field]:widget
208
+ }
209
+ return option
210
+ },
211
+ getRowWidgetKey(rowParam, fieldWidget) {
202
212
  let row = rowParam.row;
203
213
  let params = rowParam.column.params;
204
- let key = this.getRowRefKey(row, params.widget.options.name);
214
+ let name = fieldWidget ? fieldWidget.options.name : params.widget.options.name;
215
+ let key = this.getRowRefKey(row, name);
205
216
  return key;
206
217
  },
207
218
  getGridTableName() {
@@ -237,7 +248,7 @@ modules = {
237
248
  selectWidget: function (e) {
238
249
  this.designer.setSelected(e);
239
250
  },
240
- formatterValue: function ({ cellValue, row, column }) {
251
+ formatterValue: function ({cellValue, row, column}) {
241
252
  if (cellValue === null || cellValue === undefined) return cellValue;
242
253
 
243
254
  if (column.params && column.params.formatS)
@@ -323,10 +334,11 @@ modules = {
323
334
  let formRef = this.getFormRef();
324
335
  let parentTarget = formRef.$attrs["parent-target"];
325
336
  parentTarget &&
326
- parentTarget.$attrs.openEditDialog &&
327
- parentTarget.$attrs.openEditDialog(row, param);
337
+ parentTarget.$attrs.openEditDialog &&
338
+ parentTarget.$attrs.openEditDialog(row, param);
339
+ },
340
+ importExcel() {
328
341
  },
329
- importExcel() {},
330
342
  getGrid(that, tableRef) {
331
343
  var $grid;
332
344
  if (Array.isArray(that.$refs[tableRef])) {
@@ -383,6 +395,7 @@ modules = {
383
395
  isItemLine: t.isItemLine,
384
396
  footerDataType: t.footerDataType,
385
397
  footerMethodConfg: t.footerMethodConfg,
398
+ widgetList: t.widgetList
386
399
  },
387
400
  visible: t.show,
388
401
  slots: {},
@@ -423,7 +436,7 @@ modules = {
423
436
  let columnOption;
424
437
  let widget;
425
438
  let columnWidgetConfig = this.getColumnWidgetConfig(t);
426
- let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
439
+ let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
427
440
  if (columnSelectedWidget) {
428
441
  widget = columnSelectedWidget;
429
442
  columnOption = widget.options;
@@ -431,7 +444,7 @@ modules = {
431
444
  columnOption = {};
432
445
  }
433
446
 
434
- let { columnSelectedWidget: editWidget } = this.getColumnWidgetConfig(
447
+ let {columnSelectedWidget: editWidget} = this.getColumnWidgetConfig(
435
448
  t,
436
449
  true
437
450
  );
@@ -456,10 +469,12 @@ modules = {
456
469
  col.slots.default = "widget";
457
470
  } else if (t.formatS == "editTreeButtonGroup") {
458
471
  col.slots.default = "editTreeButtonGroup";
472
+ } else if (t.formatS == "widgetRender") {
473
+ col.slots.default = "widgetList";
459
474
  }
460
475
 
461
476
  if (editWidget) {
462
- col.editRender = { name: "input" };
477
+ col.editRender = {name: "input"};
463
478
  // col.slots.edit = editWidget.id;
464
479
  col.slots.edit = "editWidget";
465
480
  }
@@ -550,9 +565,9 @@ modules = {
550
565
  valueFormat: options.valueFormat ?? null,
551
566
  };
552
567
  let typeMap = {
553
- input: { type: "input" },
554
- number: { type: "number" },
555
- inputBatch: { type: "inputBatch" },
568
+ input: {type: "input"},
569
+ number: {type: "number"},
570
+ inputBatch: {type: "inputBatch"},
556
571
  date: {
557
572
  type: "date",
558
573
  widgetType: options.type,
@@ -568,7 +583,7 @@ modules = {
568
583
  "date-range": {
569
584
  type: "date",
570
585
  widgetType: "daterange",
571
- widgetConfig: { ...dateConfig, isRange: true },
586
+ widgetConfig: {...dateConfig, isRange: true},
572
587
  },
573
588
  "time-range": {
574
589
  type: "time",
@@ -665,7 +680,7 @@ modules = {
665
680
  parentField: "f_parent",
666
681
  transform: true,
667
682
  expandAll: true,
668
- loadMethod({ $table, row }) {
683
+ loadMethod({$table, row}) {
669
684
  // 模拟后台接口
670
685
  let $grid = that.getGridTable();
671
686
  let parentField = $grid.treeConfig.parentField;
@@ -755,7 +770,7 @@ modules = {
755
770
  let $grid = this.getGridTable();
756
771
  let pageSize = param.size;
757
772
  let currentPage = param.current;
758
- let page = { pageSize, currentPage };
773
+ let page = {pageSize, currentPage};
759
774
  let customParam = {
760
775
  config: {
761
776
  modal: false,
@@ -784,7 +799,7 @@ modules = {
784
799
  },
785
800
  ajax: {
786
801
  // 接收 Promise 对象
787
- query: ({ page, sorts, filters, form, param, customParam }) => {
802
+ query: ({page, sorts, filters, form, param, customParam}) => {
788
803
  let formData = tableOption.param ? tableOption.param() || {} : {};
789
804
  const queryParams = Object.assign({}, formData);
790
805
 
@@ -799,7 +814,7 @@ modules = {
799
814
 
800
815
  // 处理筛选条件
801
816
  if (filters) {
802
- filters.forEach(({ property, values }) => {
817
+ filters.forEach(({property, values}) => {
803
818
  queryParams[property] = values.join(",");
804
819
  });
805
820
  }
@@ -991,8 +1006,8 @@ modules = {
991
1006
  .map((item) => item[parentField]);
992
1007
  let expandRows = expandIds.length
993
1008
  ? rows.filter((item) =>
994
- expandIds.includes(item.id)
995
- )
1009
+ expandIds.includes(item.id)
1010
+ )
996
1011
  : [];
997
1012
  if (expandAll && expandRows.length) {
998
1013
  that.$nextTick(() => {
@@ -1089,7 +1104,7 @@ modules = {
1089
1104
  .map((item) => item.params.columnId);
1090
1105
  if (footerColumnIds.length) {
1091
1106
  tableOption.config.footerMethod = (param) => {
1092
- let { columns: column1s, data } = param;
1107
+ let {columns: column1s, data} = param;
1093
1108
  return [
1094
1109
  column1s.map((column, columnIndex) => {
1095
1110
  let columnId = column.params?.columnId;
@@ -1141,7 +1156,7 @@ modules = {
1141
1156
  return count;
1142
1157
  },
1143
1158
  getSearchFormData() {
1144
- let map = { condition: [] };
1159
+ let map = {condition: []};
1145
1160
  let formData = this.globalModel.formModel;
1146
1161
  let widgetList = this.widget.widgetList;
1147
1162
  if (!!widgetList && widgetList.length > 0) {
@@ -1351,7 +1366,7 @@ modules = {
1351
1366
  param = item.accessParam;
1352
1367
  }
1353
1368
  } else {
1354
- param = { id: dataId };
1369
+ param = {id: dataId};
1355
1370
  }
1356
1371
  return param;
1357
1372
  },
@@ -1363,12 +1378,12 @@ modules = {
1363
1378
  let tableRef = this.getTableRef();
1364
1379
  let serviceName = this.getFormRef().reportTemplate.serviceName;
1365
1380
  option.prefix = option.prefix || "/" + serviceName;
1366
- this.$excelExport({ targetRef: tableRef, ...option });
1381
+ this.$excelExport({targetRef: tableRef, ...option});
1367
1382
  },
1368
1383
  async deleteRow(row, rowIndex) {
1369
1384
  let isTreeTable = this.widget.options.isTreeTable;
1370
1385
  if (isTreeTable) {
1371
- this.removeTreeRow({ row });
1386
+ this.removeTreeRow({row});
1372
1387
  return;
1373
1388
  }
1374
1389
  let $grid = this.getGridTable();
@@ -1554,7 +1569,7 @@ modules = {
1554
1569
  columnSelectedWidget.options.labelHidden = true;
1555
1570
  }
1556
1571
  }
1557
- return { columnSelectedWidget, columnEditFields };
1572
+ return {columnSelectedWidget, columnEditFields};
1558
1573
  },
1559
1574
  getColumnProp(widget, obj, isEdit) {
1560
1575
  if (!widget) {
@@ -1590,7 +1605,11 @@ modules = {
1590
1605
  },
1591
1606
  getColumnWidgetName(e) {
1592
1607
  if (e && e.type) {
1593
- return e.type + "-widget";
1608
+ if (e.category == "container") {
1609
+ return this.getContainerWidgetName(e);
1610
+ } else {
1611
+ return e.type + "-widget";
1612
+ }
1594
1613
  }
1595
1614
  },
1596
1615
  getGridTable() {
@@ -1623,7 +1642,7 @@ modules = {
1623
1642
  let formRef = this.getFormRef();
1624
1643
  let dataTableConfig = formRef.$attrs.dataTableOption || {};
1625
1644
  dataTableConfig.onCheckboxChange &&
1626
- dataTableConfig.onCheckboxChange(param);
1645
+ dataTableConfig.onCheckboxChange(param);
1627
1646
  },
1628
1647
  handleCheckboxAll(param) {
1629
1648
  if (this.widget.options.onCheckboxAll) {
@@ -1851,9 +1870,9 @@ modules = {
1851
1870
  let loopDo = (item) => {
1852
1871
  if (item.id) delIds.push(item.id);
1853
1872
  item[childrenField] &&
1854
- item[childrenField].forEach((subItem) => {
1855
- loopDo(subItem);
1856
- });
1873
+ item[childrenField].forEach((subItem) => {
1874
+ loopDo(subItem);
1875
+ });
1857
1876
  };
1858
1877
  loopDo(row);
1859
1878
  }
@@ -1972,10 +1991,10 @@ modules = {
1972
1991
  item.f_wbs = wbs;
1973
1992
  map[item._X_ROW_KEY] = wbs;
1974
1993
  item[childrenField] &&
1975
- item[childrenField].forEach((subitem, subindex) => {
1976
- let sub_wbs = wbs + "." + (subindex + 1) + "";
1977
- loopDo(subitem, sub_wbs);
1978
- });
1994
+ item[childrenField].forEach((subitem, subindex) => {
1995
+ let sub_wbs = wbs + "." + (subindex + 1) + "";
1996
+ loopDo(subitem, sub_wbs);
1997
+ });
1979
1998
  };
1980
1999
  fullData.forEach((item, index) => {
1981
2000
  let wbs = index + 1 + "";
@@ -2130,7 +2149,7 @@ modules = {
2130
2149
  },
2131
2150
  // 通用行合并函数(将相同多列数据合并为一行)
2132
2151
  mergeRowMethod(tableParam) {
2133
- let { row, _rowIndex, column, visibleData } = tableParam;
2152
+ let {row, _rowIndex, column, visibleData} = tableParam;
2134
2153
  let mergeRowEnabled = this.widget.options.mergeRowEnabled || false;
2135
2154
  let unikey = this.widget.options.mergeRowKey;
2136
2155
  const cellValue = row[unikey];
@@ -2139,35 +2158,35 @@ modules = {
2139
2158
  const prevRow = visibleData[_rowIndex - 1];
2140
2159
  let nextRow = visibleData[_rowIndex + 1];
2141
2160
  if (prevRow && prevRow[unikey] === cellValue) {
2142
- return { rowspan: 0, colspan: 0 };
2161
+ return {rowspan: 0, colspan: 0};
2143
2162
  } else {
2144
2163
  let countRowspan = 1;
2145
2164
  while (nextRow && nextRow[unikey] === cellValue) {
2146
2165
  nextRow = visibleData[++countRowspan + _rowIndex];
2147
2166
  }
2148
2167
  if (countRowspan > 1) {
2149
- return { rowspan: countRowspan, colspan: 1 };
2168
+ return {rowspan: countRowspan, colspan: 1};
2150
2169
  }
2151
2170
  }
2152
2171
  } else {
2153
2172
  // return { rowspan: 1, colspan: 1 }
2154
2173
  }
2155
2174
  },
2156
- mergeRowMethod2({ row, _rowIndex, column, visibleData }) {
2175
+ mergeRowMethod2({row, _rowIndex, column, visibleData}) {
2157
2176
  const fields = ["key"];
2158
2177
  const cellValue = row[column.field];
2159
2178
  if (cellValue && fields.includes(column.field)) {
2160
2179
  const prevRow = visibleData[_rowIndex - 1];
2161
2180
  let nextRow = visibleData[_rowIndex + 1];
2162
2181
  if (prevRow && prevRow[column.field] === cellValue) {
2163
- return { rowspan: 0, colspan: 0 };
2182
+ return {rowspan: 0, colspan: 0};
2164
2183
  } else {
2165
2184
  let countRowspan = 1;
2166
2185
  while (nextRow && nextRow[column.field] === cellValue) {
2167
2186
  nextRow = visibleData[++countRowspan + _rowIndex];
2168
2187
  }
2169
2188
  if (countRowspan > 1) {
2170
- return { rowspan: countRowspan, colspan: 1 };
2189
+ return {rowspan: countRowspan, colspan: 1};
2171
2190
  }
2172
2191
  }
2173
2192
  }
@@ -5,7 +5,7 @@
5
5
  <template v-for="(subWidget, swIdx) in widget.widgetList">
6
6
  <template v-if="'container' === subWidget.category">
7
7
  <component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
8
- :index-of-parent-list="swIdx" :parent-widget="widget">
8
+ :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
9
9
  <!-- 递归传递插槽!!! -->
10
10
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
11
11
  <slot :name="slot" v-bind="scope"/>
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
  <template v-else>
16
16
  <component :is="subWidget.type + '-widget'" :field="subWidget" :designer="null" :key="swIdx" :parent-list="widget.widgetList"
17
- :index-of-parent-list="swIdx" :parent-widget="widget">
17
+ :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
18
18
  <!-- 递归传递插槽!!! -->
19
19
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
20
20
  <slot :name="slot" v-bind="scope"/>
@@ -54,7 +54,10 @@
54
54
  type: String,
55
55
  default: null
56
56
  },
57
-
57
+ tableParam: {
58
+ type: Object,
59
+ default: null,
60
+ }
58
61
  },
59
62
  inject: ['refList', 'globalModel', 'previewState'],
60
63
  data() {
@@ -7,7 +7,7 @@
7
7
  <template v-for="(colWidget, colIdx) in widget.cols">
8
8
  <grid-col-item :widget="colWidget" :key="colIdx" :parent-list="widget.cols"
9
9
  :index-of-parent-list="colIdx" :parent-widget="widget"
10
- :col-height="widget.options.colHeight">
10
+ :col-height="widget.options.colHeight" :tableParam="tableParam" :formItemProp="formItemProp">
11
11
  <!-- 递归传递插槽!!! -->
12
12
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
13
13
  <slot :name="slot" v-bind="scope"/>
@@ -1,22 +1,27 @@
1
1
  <template>
2
2
  <container-item-wrapper :widget="widget" :class="widget.options.isFullscreen ? 'full-height':''">
3
3
  <div :key="widget.id" class="tab-container" v-show="!widget.options.hidden">
4
- <el-tabs v-model="activeTabName" :type="widget.displayType" :ref="widget.id" :class="[customClass,widget.options.tabClass]" :style="{'height': widget.options.isFullscreen ? '' : widget.options.height}">
5
- <el-tab-pane v-for="(tab, index) in visibleTabs" :key="index" :label="getI18nLabel(tab.options.label)" :disabled="tab.options.disabled" :name="tab.options.name">
4
+ <el-tabs v-model="activeTabName" :type="widget.displayType" :ref="widget.id"
5
+ :class="[customClass,widget.options.tabClass]"
6
+ :style="{'height': widget.options.isFullscreen ? '' : widget.options.height}">
7
+ <el-tab-pane v-for="(tab, index) in visibleTabs" :key="index" :label="getI18nLabel(tab.options.label)"
8
+ :disabled="tab.options.disabled" :name="tab.options.name">
6
9
  <template v-for="(subWidget, swIdx) in tab.widgetList">
7
10
  <template v-if="'container' === subWidget.category">
8
- <component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="tab.widgetList" :index-of-parent-list="swIdx" :parent-widget="widget">
11
+ <component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="tab.widgetList"
12
+ :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
9
13
  <!-- 递归传递插槽!!! -->
10
14
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
11
- <slot :name="slot" v-bind="scope" />
15
+ <slot :name="slot" v-bind="scope"/>
12
16
  </template>
13
17
  </component>
14
18
  </template>
15
19
  <template v-else>
16
- <component :is="subWidget.type + '-widget'" :field="subWidget" :key="swIdx" :parent-list="tab.widgetList" :index-of-parent-list="swIdx" :parent-widget="widget">
20
+ <component :is="subWidget.type + '-widget'" :field="subWidget" :key="swIdx" :parent-list="tab.widgetList"
21
+ :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
17
22
  <!-- 递归传递插槽!!! -->
18
23
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
19
- <slot :name="slot" v-bind="scope" />
24
+ <slot :name="slot" v-bind="scope"/>
20
25
  </template>
21
26
  </component>
22
27
  </template>
@@ -5,7 +5,7 @@
5
5
  <template v-for="(subWidget, swIdx) in widget.widgetList">
6
6
  <template v-if="'container' === subWidget.category">
7
7
  <component :is="subWidget.type + '-item'" :widget="subWidget" :key="swIdx" :parent-list="widget.widgetList"
8
- :index-of-parent-list="swIdx" :parent-widget="widget">
8
+ :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
9
9
  <!-- 递归传递插槽!!! -->
10
10
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
11
11
  <slot :name="slot" v-bind="scope"/>
@@ -14,7 +14,7 @@
14
14
  </template>
15
15
  <template v-else>
16
16
  <component :is="subWidget.type + '-widget'" :field="subWidget" :key="swIdx" :parent-list="widget.widgetList"
17
- :index-of-parent-list="swIdx" :parent-widget="widget">
17
+ :index-of-parent-list="swIdx" :parent-widget="widget" :tableParam="tableParam" :formItemProp="formItemProp">
18
18
  <!-- 递归传递插槽!!! -->
19
19
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
20
20
  <slot :name="slot" v-bind="scope"/>
@@ -26,42 +26,44 @@
26
26
  </template>
27
27
 
28
28
  <script>
29
- import emitter from '../../../../components/xform/utils/emitter'
30
- import i18n from "../../../../components/xform/utils/i18n"
31
- import refMixin from "../../../../components/xform/form-render/refMixin"
32
- import FieldComponents from '../../../../components/xform/form-designer/form-widget/field-widget/index'
29
+ import emitter from '../../../../components/xform/utils/emitter'
30
+ import i18n from "../../../../components/xform/utils/i18n"
31
+ import refMixin from "../../../../components/xform/form-render/refMixin"
32
+ import FieldComponents from '../../../../components/xform/form-designer/form-widget/field-widget/index'
33
33
 
34
- export default {
35
- name: "TableCellItem",
36
- componentName: "ContainerItem",
37
- mixins: [emitter, i18n, refMixin],
38
- components: {
39
- ...FieldComponents,
40
- },
41
- props: {
42
- widget: Object,
43
-
44
- rowIndex: Number,
45
- colIndex: Number,
46
- },
47
- inject: ['refList', 'globalModel'],
48
- computed: {
49
- customClass() {
50
- return this.widget.options.customClass || ''
51
- },
52
- tdClass(){
53
- return (this.colIndex+1)%2 ==0 ? "":"odd"
54
- },
34
+ export default {
35
+ name: "TableCellItem",
36
+ componentName: "ContainerItem",
37
+ mixins: [emitter, i18n, refMixin],
38
+ components: {
39
+ ...FieldComponents,
40
+ },
41
+ props: {
42
+ widget: Object,
55
43
 
44
+ rowIndex: Number,
45
+ colIndex: Number,
46
+ tableParam: {
47
+ type: Object,
48
+ default: null,
49
+ }
50
+ },
51
+ inject: ['refList', 'globalModel'],
52
+ computed: {
53
+ customClass() {
54
+ return this.widget.options.customClass || ''
56
55
  },
57
- created() {
58
- /* tableCell不生成组件引用,故无须调用initRefList!! */
59
- //this.initRefList()
56
+ tdClass() {
57
+ return (this.colIndex + 1) % 2 == 0 ? "" : "odd"
60
58
  },
61
- methods: {
62
59
 
63
- }
64
- }
60
+ },
61
+ created() {
62
+ /* tableCell不生成组件引用,故无须调用initRefList!! */
63
+ //this.initRefList()
64
+ },
65
+ methods: {}
66
+ }
65
67
  </script>
66
68
 
67
69
  <style lang="scss" scoped>
@@ -3,12 +3,14 @@
3
3
 
4
4
  <div :key="widget.id" class="table-container"
5
5
  v-show="!widget.options.hidden">
6
- <table :ref="widget.id" class="table-layout table-d-box" :class="[customClass,widget.options.styleTableClass]" :style="tableStyle">
6
+ <table :ref="widget.id" class="table-layout table-d-box" :class="[customClass,widget.options.styleTableClass]"
7
+ :style="tableStyle">
7
8
  <tbody>
8
9
  <tr v-for="(row, rowIdx) in widget.rows" :key="row.id">
9
10
  <template v-for="(colWidget, colIdx) in row.cols">
10
11
  <table-cell-item v-if="!colWidget.merged" :widget="colWidget" :key="colIdx" :parent-list="widget.cols"
11
- :row-index="rowIdx" :col-index="colIdx" :parent-widget="widget">
12
+ :row-index="rowIdx" :col-index="colIdx" :parent-widget="widget" :tableParam="tableParam"
13
+ :formItemProp="formItemProp">
12
14
  <!-- 递归传递插槽!!! -->
13
15
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
14
16
  <slot :name="slot" v-bind="scope"/>