cloud-web-corejs 1.0.54-dev.419 → 1.0.54-dev.420

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.
@@ -147,6 +147,7 @@ export default {
147
147
  this.initData();
148
148
  },
149
149
  initData(option) {
150
+ if (this.designState) return;
150
151
  let reportTemplate = this.getFormRef().reportTemplate;
151
152
  let formCode = reportTemplate.formCode;
152
153
  let scriptCode = this.field.options.formScriptCode;
@@ -104,9 +104,7 @@
104
104
  @change="changeFormatS(scope.row, false)"
105
105
  clearable
106
106
  >
107
- <el-option-group
108
- :label="i18nt('designer.setting.customRenderGroup')"
109
- >
107
+ <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
110
108
  <el-option value="render" label="render"></el-option>
111
109
  </el-option-group>
112
110
  <el-option-group v-for="t in op" :key="t.label" :label="t.label">
@@ -169,12 +167,7 @@
169
167
  <el-switch v-model="scope.row.sortable"></el-switch>
170
168
  </template>
171
169
  </el-table-column>
172
- <el-table-column
173
- label="编辑更多属性"
174
- width="100"
175
- align="center"
176
- fixed="right"
177
- >
170
+ <el-table-column label="编辑更多属性" width="100" align="center" fixed="right">
178
171
  <template #default="scope">
179
172
  <el-button
180
173
  size="mini"
@@ -288,11 +281,7 @@
288
281
  top="7vh"
289
282
  :append-to-body="true"
290
283
  >
291
- <el-alert
292
- type="info"
293
- :closable="!1"
294
- title="function customRender(params,h) {"
295
- />
284
+ <el-alert type="info" :closable="!1" title="function customRender(params,h) {" />
296
285
  <code-editor
297
286
  ref="dsResultEditor"
298
287
  mode="javascript"
@@ -461,9 +450,7 @@
461
450
  @change="changeFormatS(rowData, false)"
462
451
  clearable
463
452
  >
464
- <el-option-group
465
- :label="i18nt('designer.setting.customRenderGroup')"
466
- >
453
+ <el-option-group :label="i18nt('designer.setting.customRenderGroup')">
467
454
  <el-option value="render" label="render"></el-option>
468
455
  </el-option-group>
469
456
  <el-option-group v-for="t in op" :key="t.label" :label="t.label">
@@ -484,8 +471,7 @@
484
471
  icon="el-icon-edit"
485
472
  @click="openFormatConfigDialog(rowData, rowDataIndex)"
486
473
  :disabled="
487
- !columnFormatMap[rowData.formatS] &&
488
- 'widgetRender' !== rowData.formatS
474
+ !columnFormatMap[rowData.formatS] && 'widgetRender' !== rowData.formatS
489
475
  "
490
476
  ></el-button>
491
477
  </el-form-item>
@@ -565,9 +551,7 @@
565
551
  plain=""
566
552
  round=""
567
553
  icon="el-icon-edit"
568
- @click="
569
- editFormEventHandler(rowData, rowDataIndex, 'footerMethodConfg')
570
- "
554
+ @click="editFormEventHandler(rowData, rowDataIndex, 'footerMethodConfg')"
571
555
  :disabled="rowData.footerDataType !== '3'"
572
556
  ></el-button>
573
557
  </el-form-item>
@@ -583,11 +567,7 @@
583
567
  </el-form>
584
568
  </div>
585
569
  <div class="dialog-footer" slot="footer">
586
- <el-button
587
- @click="closeRowEditDialog"
588
- class="button-sty"
589
- icon="el-icon-close"
590
- >
570
+ <el-button @click="closeRowEditDialog" class="button-sty" icon="el-icon-close">
591
571
  {{ i18nt("designer.hint.cancel") }}
592
572
  </el-button>
593
573
  <el-button
@@ -609,7 +589,7 @@ import {
609
589
  generateId,
610
590
  loopHandleWidget,
611
591
  deepClone,
612
- columnFormatMap
592
+ columnFormatMap,
613
593
  } from "../../../../../../components/xform/utils/util";
614
594
  import columnRenderDialog from "./columnRenderDialog.vue";
615
595
 
@@ -871,7 +851,7 @@ export default {
871
851
  showFormEventDialogFlag: false,
872
852
  formEventHandlerCode: "",
873
853
  curEventName: "",
874
- curEventRow:null,
854
+ curEventRow: null,
875
855
 
876
856
  eventParamsMap: {
877
857
  footerMethodConfg: "footerMethodConfg(dataId,formCode,param) {",
@@ -912,21 +892,16 @@ export default {
912
892
  });
913
893
 
914
894
  if (syntaxErrorFlag) {
915
- this.$message.error(
916
- this.i18nt("designer.setting.syntaxCheckWarning")
917
- );
895
+ this.$message.error(this.i18nt("designer.setting.syntaxCheckWarning"));
918
896
  return;
919
897
  }
920
898
  }
921
- this.curEventRow[this.curEventName] =
922
- this.formEventHandlerCode;
899
+ this.curEventRow[this.curEventName] = this.formEventHandlerCode;
923
900
  this.showFormEventDialogFlag = false;
924
901
  },
925
902
  init() {
926
903
  setTimeout(() => {
927
- this.tableData = this.$baseLodash.cloneDeep(
928
- this.optionModel.tableColumns
929
- );
904
+ this.tableData = this.$baseLodash.cloneDeep(this.optionModel.tableColumns);
930
905
  this.$nextTick(() => {
931
906
  this.rowDrop();
932
907
  setTimeout(() => {
@@ -1026,8 +1001,7 @@ export default {
1026
1001
  let newRow = this.generateRow(generateParentId);
1027
1002
  if (children) {
1028
1003
  if (type === "SIBLING") {
1029
- let addIndex =
1030
- children.findIndex((item) => item.columnId == row.columnId) + 1;
1004
+ let addIndex = children.findIndex((item) => item.columnId == row.columnId) + 1;
1031
1005
  children.splice(addIndex, 0, newRow);
1032
1006
  } else {
1033
1007
  children.push(newRow);
@@ -1074,9 +1048,7 @@ export default {
1074
1048
  const { parentId, columnId } = row;
1075
1049
  // 根节点直接删除
1076
1050
  if (!parentId) {
1077
- const delIndex = this.tableData.findIndex(
1078
- (item) => item.columnId === columnId
1079
- );
1051
+ const delIndex = this.tableData.findIndex((item) => item.columnId === columnId);
1080
1052
  this.tableData.splice(delIndex, 1);
1081
1053
  } else {
1082
1054
  // 找到父节点,通过父节点删除
@@ -1095,9 +1067,7 @@ export default {
1095
1067
 
1096
1068
  const { children } = parentRow;
1097
1069
 
1098
- const delIndex = children.findIndex(
1099
- (item) => item.columnId === columnId
1100
- );
1070
+ const delIndex = children.findIndex((item) => item.columnId === columnId);
1101
1071
 
1102
1072
  children.splice(delIndex, 1);
1103
1073
  }
@@ -1161,9 +1131,7 @@ export default {
1161
1131
  //数组转树
1162
1132
  arrToTree(arr, parentId) {
1163
1133
  return arr
1164
- .filter((item) =>
1165
- !parentId ? !item.parentId : item.parentId === parentId
1166
- )
1134
+ .filter((item) => (!parentId ? !item.parentId : item.parentId === parentId))
1167
1135
  .map((item) => {
1168
1136
  item.children = this.arrToTree(arr, item.columnId);
1169
1137
  return item;
@@ -1257,7 +1225,8 @@ export default {
1257
1225
  let isButtontCell = this.getIsButtontCell(formatS);
1258
1226
  // let columnWidgetConfig = this.getColumnWidgetConfig(row, true, isEdit);
1259
1227
  // let { columnSelectedWidget, columnEditFields } = columnWidgetConfig;
1260
- let columnSelectedWidget = this.designer.createColumnWidget(row, isEdit)
1228
+ let attachmentPrefix = this.designer.getAttachmentPrefix();
1229
+ let columnSelectedWidget = this.designer.createColumnWidget(row, isEdit);
1261
1230
  if (!isEdit) {
1262
1231
  //格式化类型
1263
1232
  if (columnSelectedWidget) {
@@ -1268,6 +1237,11 @@ export default {
1268
1237
  row.widget = null;
1269
1238
  }
1270
1239
  } else {
1240
+ if (row.prop && row.prop.startsWith(attachmentPrefix)) {
1241
+ let suffix = row.prop.replace(attachmentPrefix, "");
1242
+ columnSelectedWidget.options.keyName = row.prop;
1243
+ columnSelectedWidget.options.keyNameSuffix = suffix;
1244
+ }
1271
1245
  //编辑插槽类型
1272
1246
  if (columnSelectedWidget) {
1273
1247
  row.columnOption = columnSelectedWidget.options;
@@ -1300,9 +1274,7 @@ export default {
1300
1274
  if (!row.label) row.label = tmpId;
1301
1275
 
1302
1276
  if (this.userFields.includes(row.formatS)) {
1303
- let item = this.businessOptions.find(
1304
- (item) => item.value == row.formatS
1305
- );
1277
+ let item = this.businessOptions.find((item) => item.value == row.formatS);
1306
1278
  if (item) {
1307
1279
  row.prop = item.value;
1308
1280
  row.label = item.label;
@@ -1311,11 +1283,12 @@ export default {
1311
1283
 
1312
1284
  row.sortable = true;
1313
1285
 
1314
- if (row.formatS == "editAttachment") {
1315
- row.prop = this.designer.createAttachmentKeyName();
1316
- } else {
1317
- let attachmentPrefix = this.designer.getAttachmentPrefix();
1318
- row.prop = row.prop.replaceAll(attachmentPrefix, "");
1286
+ if (!isEdit) {
1287
+ if (formatS == "editAttachment") {
1288
+ row.prop = columnSelectedWidget.options.keyName;
1289
+ } else {
1290
+ row.prop = row.prop.replaceAll(attachmentPrefix, "");
1291
+ }
1319
1292
  }
1320
1293
  }
1321
1294
  }
@@ -1439,10 +1412,7 @@ export default {
1439
1412
  result = column;
1440
1413
  break;
1441
1414
  } else if (column.children && column.children.length) {
1442
- let subColumn = this.findColumnByColumnId(
1443
- column.children,
1444
- children
1445
- );
1415
+ let subColumn = this.findColumnByColumnId(column.children, children);
1446
1416
  if (subColumn) {
1447
1417
  result = subColumn;
1448
1418
  break;
@@ -1473,10 +1443,7 @@ export default {
1473
1443
  loopHandleWidget(formWidgetList, (item) => {
1474
1444
  if (item.options.name == dataTableName) {
1475
1445
  item.options.tableColumns = tableData;
1476
- targetColumn = this.findColumnByColumnId(
1477
- item.options.tableColumns,
1478
- columnId
1479
- );
1446
+ targetColumn = this.findColumnByColumnId(item.options.tableColumns, columnId);
1480
1447
  }
1481
1448
  });
1482
1449
  let getWidgetList = (subWidgetList = []) => {
@@ -1549,7 +1516,6 @@ export default {
1549
1516
  }
1550
1517
  },
1551
1518
  openEditFormatConfigDialog(row, index) {
1552
-
1553
1519
  let selectedWidget = row.editWidget;
1554
1520
  this.operateIndex = index;
1555
1521
 
@@ -1612,9 +1578,7 @@ export default {
1612
1578
  });
1613
1579
 
1614
1580
  if (syntaxErrorFlag) {
1615
- this.$message.error(
1616
- this.i18nt("designer.setting.syntaxCheckWarning")
1617
- );
1581
+ this.$message.error(this.i18nt("designer.setting.syntaxCheckWarning"));
1618
1582
  return;
1619
1583
  }
1620
1584
  }
@@ -1638,25 +1602,19 @@ export default {
1638
1602
  let type1 = this.columnFormatMap[row.formatS];
1639
1603
  let type2 = this.columnFormatMap[row.editFormatS];
1640
1604
  let newWidget = type1
1641
- ? this.designer.copyNewFieldWidget(
1642
- this.designer.getFieldWidgetByType(type1)
1643
- )
1605
+ ? this.designer.copyNewFieldWidget(this.designer.getFieldWidgetByType(type1))
1644
1606
  : null;
1645
1607
 
1646
1608
  let newEditWidget = type2
1647
- ? this.designer.copyNewFieldWidget(
1648
- this.designer.getFieldWidgetByType(type2)
1649
- )
1609
+ ? this.designer.copyNewFieldWidget(this.designer.getFieldWidgetByType(type2))
1650
1610
  : null;
1651
1611
 
1652
1612
  if (newWidget.formItemFlag) {
1653
1613
  if (row.widget) {
1654
- if (row.widget.options[key] !== undefined)
1655
- row.widget.options[key] = value;
1614
+ if (row.widget.options[key] !== undefined) row.widget.options[key] = value;
1656
1615
  }
1657
1616
  if (row.columnOption) {
1658
- if (row.columnOption[key] !== undefined)
1659
- row.columnOption[key] = value;
1617
+ if (row.columnOption[key] !== undefined) row.columnOption[key] = value;
1660
1618
  }
1661
1619
  }
1662
1620
 
@@ -1666,8 +1624,7 @@ export default {
1666
1624
  row.editWidget.options[key] = value;
1667
1625
  }
1668
1626
  if (row.editColumnOption) {
1669
- if (row.editColumnOption[key] !== undefined)
1670
- row.editColumnOption[key] = value;
1627
+ if (row.editColumnOption[key] !== undefined) row.editColumnOption[key] = value;
1671
1628
  }
1672
1629
  }
1673
1630
  },