cloud-web-corejs 1.1.0-dev.63 → 1.1.0-dev.64
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/package.json
CHANGED
|
@@ -534,7 +534,7 @@
|
|
|
534
534
|
<el-form-item :label="i18nt('designer.setting.visibleColumn')">
|
|
535
535
|
<el-switch v-model="rowData.show"></el-switch>
|
|
536
536
|
</el-form-item>
|
|
537
|
-
<el-form-item label="动态显示脚本">
|
|
537
|
+
<el-form-item label="动态显示脚本">
|
|
538
538
|
<a
|
|
539
539
|
href="javascript:void(0);"
|
|
540
540
|
class="a-link link-oneLind"
|
|
@@ -542,21 +542,21 @@
|
|
|
542
542
|
>
|
|
543
543
|
<span>{{ rowData.columnShow }}</span>
|
|
544
544
|
<i class="el-icon-edit"></i>
|
|
545
|
-
</a>
|
|
546
|
-
</el-form-item>
|
|
547
|
-
<el-form-item
|
|
548
|
-
label="单元格可编辑条件"
|
|
549
|
-
v-if="rowData.editFormatS"
|
|
550
|
-
>
|
|
551
|
-
<a
|
|
552
|
-
href="javascript:void(0);"
|
|
553
|
-
class="a-link link-oneLind"
|
|
554
|
-
@click="editFormEventHandler(rowData, rowDataIndex, 'cellEditable')"
|
|
555
|
-
>
|
|
556
|
-
<span>{{ rowData.cellEditable }}</span>
|
|
557
|
-
<i class="el-icon-edit"></i>
|
|
558
|
-
</a>
|
|
559
|
-
</el-form-item>
|
|
545
|
+
</a>
|
|
546
|
+
</el-form-item>
|
|
547
|
+
<el-form-item
|
|
548
|
+
label="单元格可编辑条件"
|
|
549
|
+
v-if="rowData.editFormatS"
|
|
550
|
+
>
|
|
551
|
+
<a
|
|
552
|
+
href="javascript:void(0);"
|
|
553
|
+
class="a-link link-oneLind"
|
|
554
|
+
@click="editFormEventHandler(rowData, rowDataIndex, 'cellEditable')"
|
|
555
|
+
>
|
|
556
|
+
<span>{{ rowData.cellEditable }}</span>
|
|
557
|
+
<i class="el-icon-edit"></i>
|
|
558
|
+
</a>
|
|
559
|
+
</el-form-item>
|
|
560
560
|
<el-form-item :label="i18nt('designer.setting.sortableColumn')">
|
|
561
561
|
<el-switch v-model="rowData.sortable"></el-switch>
|
|
562
562
|
</el-form-item>
|
|
@@ -1034,10 +1034,10 @@ export default {
|
|
|
1034
1034
|
curEventRow: null,
|
|
1035
1035
|
|
|
1036
1036
|
eventParamsMap: {
|
|
1037
|
-
footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
|
|
1038
|
-
columnShow: "columnShow(dataId,formCode,columnConfig) {",
|
|
1039
|
-
cellEditable:
|
|
1040
|
-
"cellEditable(dataId,formCode,tableParam,columnConfig) {",
|
|
1037
|
+
footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
|
|
1038
|
+
columnShow: "columnShow(dataId,formCode,columnConfig) {",
|
|
1039
|
+
cellEditable:
|
|
1040
|
+
"cellEditable(dataId,formCode,tableParam,columnConfig) {",
|
|
1041
1041
|
},
|
|
1042
1042
|
|
|
1043
1043
|
showColumnRenderDialog: false,
|
|
@@ -1403,9 +1403,9 @@ export default {
|
|
|
1403
1403
|
rowAddAuthName: this.createRowAuthName("Add"),
|
|
1404
1404
|
rowEditAuthName: this.createRowAuthName("Edit"),
|
|
1405
1405
|
rowAddShow: null,
|
|
1406
|
-
rowEditShow: null,
|
|
1407
|
-
columnShow: null,
|
|
1408
|
-
cellEditable: null,
|
|
1406
|
+
rowEditShow: null,
|
|
1407
|
+
columnShow: null,
|
|
1408
|
+
cellEditable: null,
|
|
1409
1409
|
utcTransformEnabled: false,
|
|
1410
1410
|
labelIconClass: null,
|
|
1411
1411
|
labelIconPosition: "rear",
|
|
@@ -1632,6 +1632,10 @@ export default {
|
|
|
1632
1632
|
row.widget = null;
|
|
1633
1633
|
}
|
|
1634
1634
|
row.utcTransformEnabled = false;
|
|
1635
|
+
// 组件渲染才使用 widgetList。切到 text 等格式时清掉,避免旧的必填组件继续留在列配置里。
|
|
1636
|
+
if (row.formatS !== "widgetRender") {
|
|
1637
|
+
row.widgetList = [];
|
|
1638
|
+
}
|
|
1635
1639
|
} else {
|
|
1636
1640
|
if (row.prop && row.prop.startsWith(attachmentPrefix)) {
|
|
1637
1641
|
let suffix = row.prop.replace(attachmentPrefix, "");
|
|
@@ -1726,9 +1726,28 @@ modules = {
|
|
|
1726
1726
|
const index = rows.indexOf(row);
|
|
1727
1727
|
return index >= 0 ? index : fallbackIndex;
|
|
1728
1728
|
},
|
|
1729
|
+
/**
|
|
1730
|
+
* 单元格实际挂载的是 widgetList,还是列格式组件 widget。
|
|
1731
|
+
* 与建列插槽一致:有 widget 时走 #widget;只有 formatS 为组件渲染且没有 widget 时才走 #widgetList。
|
|
1732
|
+
* 格式从组件渲染改成 text 等之后,旧的 widgetList 会留在列配置里,不能再参与校验。
|
|
1733
|
+
* @param {Object} column 列配置。
|
|
1734
|
+
* @returns {Boolean}
|
|
1735
|
+
*/
|
|
1736
|
+
isWidgetListColumn(column) {
|
|
1737
|
+
return column?.formatS === "widgetRender" && !column.widget;
|
|
1738
|
+
},
|
|
1729
1739
|
/** @param {Object} column 列配置。@param {Boolean} isEditTable 是否编辑表。@param {Array} entries 输出数组。 */
|
|
1730
1740
|
collectColumnValidateEntries(column, isEditTable, entries) {
|
|
1731
|
-
if (column
|
|
1741
|
+
if (this.isWidgetListColumn(column)) {
|
|
1742
|
+
if (column.widgetList?.length) {
|
|
1743
|
+
loopHandleWidget(column.widgetList, (w) => {
|
|
1744
|
+
entries.push({
|
|
1745
|
+
column,
|
|
1746
|
+
templateWidget: w,
|
|
1747
|
+
});
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
} else if (column.widget) {
|
|
1732
1751
|
entries.push({
|
|
1733
1752
|
column,
|
|
1734
1753
|
templateWidget: column.widget,
|
|
@@ -1740,14 +1759,6 @@ modules = {
|
|
|
1740
1759
|
templateWidget: column.editWidget,
|
|
1741
1760
|
});
|
|
1742
1761
|
}
|
|
1743
|
-
if (column.widgetList?.length) {
|
|
1744
|
-
loopHandleWidget(column.widgetList, (w) => {
|
|
1745
|
-
entries.push({
|
|
1746
|
-
column,
|
|
1747
|
-
templateWidget: w,
|
|
1748
|
-
});
|
|
1749
|
-
});
|
|
1750
|
-
}
|
|
1751
1762
|
},
|
|
1752
1763
|
/** @param {Object} row 行数据。@param {Object} templateWidget 组件模板。@returns {Object} 当前行组件 schema。 */
|
|
1753
1764
|
resolveRowFieldWidget(row, templateWidget) {
|
|
@@ -4712,6 +4723,19 @@ modules = {
|
|
|
4712
4723
|
checkRows.forEach((row) => {
|
|
4713
4724
|
let fieldSchema = this.getRowFieldSchema(row) || {};
|
|
4714
4725
|
tableColumns.forEach((column) => {
|
|
4726
|
+
if (this.isWidgetListColumn(column)) {
|
|
4727
|
+
if (column.widgetList) {
|
|
4728
|
+
column.widgetList.forEach((itemWidget) => {
|
|
4729
|
+
let widget = fieldSchema[itemWidget.id];
|
|
4730
|
+
let required = widget?.options?.required || false;
|
|
4731
|
+
if (required) {
|
|
4732
|
+
let propName = this.getColumnWidgetProp(widget, row);
|
|
4733
|
+
fieldsToValidate.push(propName);
|
|
4734
|
+
}
|
|
4735
|
+
});
|
|
4736
|
+
}
|
|
4737
|
+
return;
|
|
4738
|
+
}
|
|
4715
4739
|
if (column.widget) {
|
|
4716
4740
|
// 列未就绪时 getRowFieldSchema 会给 null,取不到行级组件就按"不必填"跳过,
|
|
4717
4741
|
// 而不是在这里抛异常把整个校验打断
|
|
@@ -4722,16 +4746,6 @@ modules = {
|
|
|
4722
4746
|
fieldsToValidate.push(propName);
|
|
4723
4747
|
}
|
|
4724
4748
|
}
|
|
4725
|
-
if (column.widgetList) {
|
|
4726
|
-
column.widgetList.forEach((itemWidget) => {
|
|
4727
|
-
let widget = fieldSchema[itemWidget.id];
|
|
4728
|
-
let required = widget?.options?.required || false;
|
|
4729
|
-
if (required) {
|
|
4730
|
-
let propName = this.getColumnWidgetProp(widget, row);
|
|
4731
|
-
fieldsToValidate.push(propName);
|
|
4732
|
-
}
|
|
4733
|
-
});
|
|
4734
|
-
}
|
|
4735
4749
|
});
|
|
4736
4750
|
});
|
|
4737
4751
|
let formRef = this.getFormRef();
|