cloud-web-corejs 1.0.95 → 1.0.96

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.95",
4
+ "version": "1.0.96",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -123,7 +123,7 @@
123
123
  <template #default="scope">
124
124
  <el-select
125
125
  v-model="scope.row.formatS"
126
- @change="changeFormatS(scope.row)"
126
+ @change="changeFormatS(scope.row,false)"
127
127
  clearable
128
128
  >
129
129
  <el-option-group
@@ -203,7 +203,7 @@
203
203
  <template #default="scope">
204
204
  <el-select
205
205
  v-model="scope.row.editFormatS"
206
- @change="changeFormatS(scope.row)"
206
+ @change="changeFormatS(scope.row,true)"
207
207
  clearable
208
208
  >
209
209
  <el-option
@@ -1158,55 +1158,71 @@ export default {
1158
1158
  return isButtontCell;
1159
1159
  },
1160
1160
  //drag end
1161
- changeFormatS(row) {
1162
- let isButtontCell = this.getIsButtontCell(row.formatS);
1163
- let columnWidgetConfig = this.getColumnWidgetConfig(row, true);
1161
+ changeFormatS(row,isEdit) {
1162
+ let formatS = isEdit ? row.editFormatS : row.formatS;
1163
+ let isButtontCell = this.getIsButtontCell(formatS);
1164
+ let columnWidgetConfig = this.getColumnWidgetConfig(row, true, isEdit);
1164
1165
  let {columnSelectedWidget, columnEditFields} = columnWidgetConfig;
1165
- if (columnSelectedWidget) {
1166
- row.columnOption = columnSelectedWidget.options;
1167
- row.widget = columnSelectedWidget;
1168
- } else {
1169
- row.columnOption = {};
1170
- row.widget = null;
1166
+ if(!isEdit){
1167
+ //格式化类型
1168
+ if (columnSelectedWidget) {
1169
+ row.columnOption = columnSelectedWidget.options;
1170
+ row.widget = columnSelectedWidget;
1171
+ } else {
1172
+ row.columnOption = {};
1173
+ row.widget = null;
1174
+ }
1175
+ }else{
1176
+ //编辑插槽类型
1177
+ if (columnSelectedWidget) {
1178
+ row.columnOption = columnSelectedWidget.options;
1179
+ row.editWidget = columnSelectedWidget;
1180
+ } else {
1181
+ row.editColumnOption = {};
1182
+ row.editWidget = null;
1183
+ }
1171
1184
  }
1172
1185
 
1173
- if (row.formatS == "editTreeButtonGroup") {
1174
- row.prop = null;
1175
- row.label = null;
1176
- row.sortable = false;
1177
- row.width = 150;
1178
- } else if (isButtontCell) {
1179
- if (row.formatS == "aLink" || row.formatS == "button") {
1180
- if (!row.width || row.width == 47) row.width = 150;
1186
+ if(!isEdit){
1187
+ if (row.formatS == "editTreeButtonGroup") {
1188
+ row.prop = null;
1189
+ row.label = null;
1190
+ row.sortable = false;
1191
+ row.width = 150;
1192
+ } else if (isButtontCell) {
1193
+ if (row.formatS == "aLink" || row.formatS == "button") {
1194
+ if (!row.width || row.width == 47) row.width = 150;
1195
+ } else {
1196
+ row.width = 47;
1197
+ }
1198
+ row.prop = null;
1199
+ row.label = null;
1200
+ row.sortable = false;
1181
1201
  } else {
1182
- row.width = 47;
1183
- }
1184
- row.prop = null;
1185
- row.label = null;
1186
- row.sortable = false;
1187
- } else {
1188
- let tmpId = "column" + generateId();
1189
- if (!row.width || row.width == 47) row.width = 150;
1190
- if (!row.prop) row.prop = tmpId;
1191
- if (!row.label) row.label = tmpId;
1202
+ let tmpId = "column" + generateId();
1203
+ if (!row.width || row.width == 47) row.width = 150;
1204
+ if (!row.prop) row.prop = tmpId;
1205
+ if (!row.label) row.label = tmpId;
1192
1206
 
1193
- if (this.userFields.includes(row.formatS)) {
1194
- let item = this.businessOptions.find(item => item.value == row.formatS);
1195
- if (item) {
1196
- row.prop = item.value;
1197
- row.label = item.label;
1207
+ if (this.userFields.includes(row.formatS)) {
1208
+ let item = this.businessOptions.find(item => item.value == row.formatS);
1209
+ if (item) {
1210
+ row.prop = item.value;
1211
+ row.label = item.label;
1212
+ }
1198
1213
  }
1199
- }
1200
1214
 
1201
- row.sortable = true;
1215
+ row.sortable = true;
1202
1216
 
1203
- if (row.formatS == "editAttachment") {
1204
- row.prop = this.designer.createAttachmentKeyName();
1205
- } else {
1206
- let attachmentPrefix = this.designer.getAttachmentPrefix();
1207
- row.prop = row.prop.replaceAll(attachmentPrefix, "");
1217
+ if (row.formatS == "editAttachment") {
1218
+ row.prop = this.designer.createAttachmentKeyName();
1219
+ } else {
1220
+ let attachmentPrefix = this.designer.getAttachmentPrefix();
1221
+ row.prop = row.prop.replaceAll(attachmentPrefix, "");
1222
+ }
1208
1223
  }
1209
1224
  }
1225
+
1210
1226
  },
1211
1227
  getColumnWidgetConfig(row, isChange, isEdit) {
1212
1228
  let formatS = isEdit ? row.editFormatS : row.formatS;
@@ -1406,7 +1422,18 @@ export default {
1406
1422
  confirmFormatConfigDialog(columnOption, row) {
1407
1423
  // let row = this.tableData[this.operateIndex];
1408
1424
  row.columnOption = columnOption;
1409
- row.widget.options = columnOption;
1425
+
1426
+ if(row.widget){
1427
+ row.widget.options = columnOption;
1428
+ }else{
1429
+ let type = this.columnFormatMap[row.formatS];
1430
+ let fieldWidget = this.designer.copyNewFieldWidget(
1431
+ this.designer.getFieldWidgetByType(type)
1432
+ )
1433
+ fieldWidget.options = columnOption;
1434
+ row.widget = fieldWidget;
1435
+ }
1436
+
1410
1437
  let isButtontCell = this.getIsButtontCell(row.formatS);
1411
1438
  if (!isButtontCell) {
1412
1439
  row.prop = this.getFieldKeyNameByOptions(columnOption);
@@ -1446,7 +1473,19 @@ export default {
1446
1473
  confirmEditFormatConfigDialog(columnOption, row) {
1447
1474
  // let row = this.tableData[this.operateIndex];
1448
1475
  row.editColumnOption = columnOption;
1449
- row.editWidget.options = columnOption;
1476
+ // row.editWidget.options = columnOption;
1477
+
1478
+ if(row.editWidget){
1479
+ row.editWidget.options = columnOption;
1480
+ }else{
1481
+ let type = this.columnFormatMap[row.editFormatS];
1482
+ let fieldWidget = this.designer.copyNewFieldWidget(
1483
+ this.designer.getFieldWidgetByType(type)
1484
+ )
1485
+ fieldWidget.options = columnOption;
1486
+ row.editWidget = fieldWidget;
1487
+ }
1488
+
1450
1489
  /*row.prop = columnOption.name;
1451
1490
  row.label = columnOption.label;
1452
1491
  row.required = columnOption.required;*/