cloud-web-corejs 1.0.54-dev.328 → 1.0.54-dev.329

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.
@@ -252,7 +252,7 @@
252
252
  :columnConfig="obj.column.params.columnConfig"
253
253
  :subFormRowIndex="obj.rowIndex"
254
254
  :subFormRowId="obj.row._X_ROW_KEY"
255
- formItemProp="false"
255
+ :formItemProp="getColumnProp2(fieldWidget, obj)"
256
256
  :tableParam="obj"
257
257
  >
258
258
  <template v-for="slot in Object.keys($scopedSlots)" v-slot:[slot]="scope">
@@ -1488,6 +1488,7 @@ modules = {
1488
1488
  this.removeTreeRow({ row });
1489
1489
  return;
1490
1490
  }
1491
+ delete this.fieldSchemaMap[row._X_ROW_KEY]
1491
1492
  let $grid = this.getGridTable();
1492
1493
  $grid.remove(row);
1493
1494
  let tableData = $grid.getTableData();
@@ -1498,35 +1499,77 @@ modules = {
1498
1499
  this.$nextTick(() => {
1499
1500
  this.handleWbs();
1500
1501
  });
1501
-
1502
1502
  // this.deleteRowWidgets(row);
1503
1503
  },
1504
+ isSingerlSearch(widget){
1505
+ let widgetType = widget?.type;
1506
+ let result = widgetType === "singerSearch" || (widgetType === 'vabsearch' && !widget.options.multipleChoices)
1507
+ return result
1508
+ },
1509
+ getColumnNullValue(widget){
1510
+ if(!widget)return null
1511
+ let nullValue = null;
1512
+ let widgetType = widget.type;
1513
+ let multiWidgetTypes = ["checkbox","time-range","baseAttachment","vabUpload","project-tag"];
1514
+
1515
+ let defaultValue = widget.options.defaultValue;
1516
+ if (defaultValue !== undefined && defaultValue !== null && defaultValue !== "") {
1517
+ nullValue = defaultValue;
1518
+ } else if (widgetType === 'select' && widget.options.multiple) {
1519
+ nullValue = [];
1520
+ } else if (widgetType === 'date' && widget.options.type == "dates") {
1521
+ nullValue = [];
1522
+ }else if (widgetType === 'vabsearch' && widget.options.multipleChoices) {
1523
+ nullValue = [];
1524
+ } else if (multiWidgetTypes.includes(widgetType)){
1525
+ nullValue = [];
1526
+ }
1527
+ return nullValue;
1528
+ },
1529
+ getIsFormWidget(widget){
1530
+ let widgetTypes = ["baseAttachment"];
1531
+ let result = false;
1532
+ if(widget.formItemFlag){
1533
+ result = true;
1534
+ }
1535
+ return result;
1536
+ },
1537
+ handleWidgetNullValue(widget,newData){
1538
+ if(!widget || !newData)return
1539
+ if(this.getIsFormWidget(widget)){
1540
+ let field = this.getFieldKeyName(widget)
1541
+ let nullValue = newData.hasOwnProperty(field) ? null : this.getColumnNullValue(widget);
1542
+ newData[field] = nullValue;
1543
+ if(this.isSingerlSearch(widget)){
1544
+ let vabSearchName = widget.options.vabSearchName;
1545
+ if (vabSearchName) newData[vabSearchName] = null;
1546
+ }
1547
+ }
1548
+ },
1504
1549
  createNewTableData(isEdit) {
1505
1550
  let newData = {};
1506
1551
  this.loodHandleColumns(this.widget.options.tableColumns, (item) => {
1507
1552
  if (!item.children?.length && item.prop && item.label) {
1508
1553
  let formatS = !isEdit ? item.formatS : item.editFormatS;
1509
- let columnOption = !isEdit
1510
- ? item.columnOption
1511
- : item.editColumnOption;
1512
- if (formatS == "editSearch") {
1513
- newData[item.prop] = null;
1514
- let vabSearchName = item?.columnOption?.vabSearchName;
1515
- if (vabSearchName) newData[vabSearchName] = null;
1516
- }
1517
- if (formatS == "editAttachment") {
1518
- newData[item.prop] = [];
1519
- } else {
1520
- newData[item.prop] = null;
1521
- if (
1522
- columnOption &&
1523
- columnOption.defaultValue !== undefined &&
1524
- columnOption.defaultValue !== null &&
1525
- columnOption.defaultValue !== ""
1526
- ) {
1527
- newData[item.prop] = columnOption.defaultValue;
1554
+ let widget = null;
1555
+ if(isEdit){
1556
+ widget = item.editWidget || item.widget;
1557
+ }else {
1558
+ widget = item.widget;
1559
+ }
1560
+ if (formatS == "widgetRender") {
1561
+ if(item.widgetList){
1562
+ loopHandleWidget(item.widgetList, (w, p) => {
1563
+ this.handleWidgetNullValue(w, newData);
1564
+ });
1565
+ }
1566
+ }else {
1567
+ if(widget){
1568
+ this.handleWidgetNullValue(widget, newData);
1569
+ }else {
1570
+ newData[item.prop] = null
1571
+ }
1528
1572
  }
1529
- }
1530
1573
  }
1531
1574
  });
1532
1575
 
@@ -1558,6 +1601,7 @@ modules = {
1558
1601
  return newData;
1559
1602
  },
1560
1603
  addTableData(rows, field) {
1604
+ debugger
1561
1605
  let $grid = this.getGridTable();
1562
1606
  let formDataModel = this.formModel;
1563
1607
  let tableRows = formDataModel[this.fieldKeyName] || [];
@@ -1707,11 +1751,8 @@ modules = {
1707
1751
  property = fieldWidget.options.vabSearchName || property;
1708
1752
  }
1709
1753
  let rowIndex = Math.max(obj.rowIndex, 0);
1710
-
1754
+
1711
1755
  let propName = fieldKeyName + "." + rowIndex + "." + property;
1712
- if(rowIndex){
1713
- debugger
1714
- }
1715
1756
  return propName
1716
1757
  },
1717
1758
  getColumnProp(widget, obj, isEdit) {
@@ -1721,9 +1762,6 @@ modules = {
1721
1762
  /*if(isEdit){
1722
1763
  return "false"
1723
1764
  }*/
1724
-
1725
-
1726
-
1727
1765
  let isQueryTable = this.widget.options.isQueryTable || false;
1728
1766
  if (isEdit || !isQueryTable) {
1729
1767
  let sourceWidgetId = isEdit?obj.column.params.editWidget.id:obj.column.params.widget.id;
@@ -1737,6 +1775,10 @@ modules = {
1737
1775
  let rowIndex = Math.max(obj.rowIndex, 0);
1738
1776
 
1739
1777
  let property = this.getFieldKeyName(fieldWidget);
1778
+ if(obj.row[property] && Array.isArray(obj.row[property])){
1779
+ return "false"
1780
+ }
1781
+ // let property = obj.column.property
1740
1782
  if (this.isVabsearchFlagWidget(fieldWidget)) {
1741
1783
  property = fieldWidget.options.vabSearchName || property;
1742
1784
  }
@@ -1753,7 +1795,6 @@ modules = {
1753
1795
  this.getFieldKeyName(lineWidget);
1754
1796
  propName = fieldKeyName + "." + rowIndex + "." + fieldName;
1755
1797
  } */
1756
-
1757
1798
  return propName;
1758
1799
  } else {
1759
1800
  return "false";