cloud-web-corejs 1.0.54-dev.634 → 1.0.54-dev.636

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.54-dev.634",
4
+ "version": "1.0.54-dev.636",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -296,7 +296,6 @@ function columnDrop(t, tableName, tableRef) {
296
296
  let oldColumn = tableColumn.find((item) => item.id === draggedColId);
297
297
  let newColumn = tableColumn.find((item) => item.id === relatedColId);
298
298
  if (!oldColumn || !newColumn) {
299
- debugger;
300
299
  return;
301
300
  }
302
301
 
@@ -310,7 +309,6 @@ function columnDrop(t, tableName, tableRef) {
310
309
  const oldLeafColumn = fullColumn[oldColumnIndex];
311
310
  const newLeafColumn = fullColumn[newColumnIndex];
312
311
  if (!oldLeafColumn || !newLeafColumn) {
313
- debugger;
314
312
  return;
315
313
  }
316
314
 
@@ -50,10 +50,10 @@ function collectTopRootIndex(collectColumn, leaf) {
50
50
  async function initVxeTable(option) {
51
51
  let tableName = option.tableName;
52
52
  if (
53
- !configUtil.tableConfig.disableTableName
54
- && option.tableNameRequired !== false
55
- && !tableName
56
- && settingConfig.tableStorageDisabled !== true
53
+ !configUtil.tableConfig.disableTableName &&
54
+ option.tableNameRequired !== false &&
55
+ !tableName &&
56
+ settingConfig.tableStorageDisabled !== true
57
57
  ) {
58
58
  return false;
59
59
  }
@@ -171,8 +171,8 @@ async function initVxeTable(option) {
171
171
  function handleToolbar($grid, option) {
172
172
  let selfConfig = getSelfConfig();
173
173
  if (
174
- option.bindToolbar
175
- || (option.bindToolbar !== false && selfConfig.bindToolbar)
174
+ option.bindToolbar ||
175
+ (option.bindToolbar !== false && selfConfig.bindToolbar)
176
176
  ) {
177
177
  let loopDo = function (children) {
178
178
  if (children && children.length) {
@@ -195,17 +195,17 @@ function handleToolbar($grid, option) {
195
195
  function handleCustomAlign(option) {
196
196
  let selfConfig = getSelfConfig();
197
197
  // let customAlign = option.customAlign || selfConfig.customAlign || "right";
198
- let customAlign
199
- = selfConfig.customAlign === false
198
+ let customAlign =
199
+ selfConfig.customAlign === false
200
200
  ? false
201
201
  : selfConfig.customAlign || "right";
202
- customAlign
203
- = option.customAlign === false ? false : option.customAlign || customAlign;
202
+ customAlign =
203
+ option.customAlign === false ? false : option.customAlign || customAlign;
204
204
 
205
- let customColumnWidth
206
- = option.customColumnWidth || selfConfig.customColumnWidth || 47;
207
- let checkBoxColumnWidth
208
- = option.checkBoxColumnWidth || selfConfig.checkBoxColumnWidth || 48;
205
+ let customColumnWidth =
206
+ option.customColumnWidth || selfConfig.customColumnWidth || 47;
207
+ let checkBoxColumnWidth =
208
+ option.checkBoxColumnWidth || selfConfig.checkBoxColumnWidth || 48;
209
209
 
210
210
  let checkBoxRequired = selfConfig.checkBoxRequired !== false;
211
211
  if (option.checkBoxRequired === false) {
@@ -300,15 +300,17 @@ function columnDrop(t, tableName, tableRef) {
300
300
  let { item } = dropParam;
301
301
  let oldIndex = dragStartIndex;
302
302
  let newIndex = dragEndIndex;
303
- if(newIndex < 0) newIndex = dropParam.newIndex;
304
- const { fullColumn, tableColumn, collectColumn }
305
- = $table.getTableColumn();
303
+
304
+ if (newIndex < 0) newIndex = dropParam.newIndex;
305
+ const { fullColumn, tableColumn, collectColumn } =
306
+ $table.getTableColumn();
306
307
  const targetThElem = item;
307
308
  const wrapperElem = targetThElem.parentNode;
308
309
  let oldColumn = tableColumn[oldIndex];
309
310
  let oldTitle = oldColumn.title;
310
311
 
311
312
  const newColumn = tableColumn[newIndex];
313
+ if (!newColumn) return;
312
314
  let newTitle = newColumn.title;
313
315
  if (newColumn.fixed) {
314
316
  // 错误的移动
@@ -372,25 +374,25 @@ function getSelfConfig() {
372
374
  function initColumnDefaulAttrs(columns, opts) {
373
375
  let tableConfig = configUtil.tableConfig || {};
374
376
  let selfConfig = getSelfConfig();
375
- let lockCheckboxWidth
376
- = opts.lockCheckboxWidth !== false
377
+ let lockCheckboxWidth =
378
+ opts.lockCheckboxWidth !== false
377
379
  ? opts.lockCheckboxWidth || selfConfig.lockCheckboxWidth
378
380
  : null;
379
- let filterType
380
- = opts.filterType !== false && !opts.treeNodeUrl
381
+ let filterType =
382
+ opts.filterType !== false && !opts.treeNodeUrl
381
383
  ? opts.filterType || selfConfig.filterType || "filterContent"
382
384
  : null;
383
- let sortAll
384
- = opts.sortAll === true || (opts.sortAll !== false && !opts.treeNodeUrl);
385
+ let sortAll =
386
+ opts.sortAll === true || (opts.sortAll !== false && !opts.treeNodeUrl);
385
387
 
386
388
  columns.forEach((column) => {
387
389
  // 只有最底层的列(没有 children)才设置默认属性
388
390
  if (!column.children || column.children.length === 0) {
389
391
  // 设置 sortable
390
392
  if (
391
- sortAll
392
- && column.title
393
- && (column.sortable === null || column.sortable === undefined)
393
+ sortAll &&
394
+ column.title &&
395
+ (column.sortable === null || column.sortable === undefined)
394
396
  ) {
395
397
  column.sortable = true;
396
398
  }
@@ -398,9 +400,9 @@ function initColumnDefaulAttrs(columns, opts) {
398
400
  // 设置过滤器
399
401
  if (filterType && column.title && column.field) {
400
402
  if (
401
- column.filterType === "filterContent"
402
- || ((column.filterType === null || column.filterType === undefined)
403
- && filterType === "filterContent")
403
+ column.filterType === "filterContent" ||
404
+ ((column.filterType === null || column.filterType === undefined) &&
405
+ filterType === "filterContent")
404
406
  ) {
405
407
  if (!column.filters) {
406
408
  column.filters = [
@@ -415,9 +417,9 @@ function initColumnDefaulAttrs(columns, opts) {
415
417
  };
416
418
  }
417
419
  } else if (
418
- column.filterType === "filterInput"
419
- || ((column.filterType === null || column.filterType === undefined)
420
- && filterType === "filterInput")
420
+ column.filterType === "filterInput" ||
421
+ ((column.filterType === null || column.filterType === undefined) &&
422
+ filterType === "filterInput")
421
423
  ) {
422
424
  if (!column.filters) {
423
425
  column.filters = [
@@ -566,8 +568,8 @@ function initOption(opts) {
566
568
  },*/
567
569
  columns: columns,
568
570
  };
569
- let tableDefaultConfig
570
- = corejsConfig?.componentConfig?.table?.defaultConfig || {};
571
+ let tableDefaultConfig =
572
+ corejsConfig?.componentConfig?.table?.defaultConfig || {};
571
573
  defaultOptions = configUtil.extendDeeply(defaultOptions, tableConfig);
572
574
  defaultOptions = configUtil.extendDeeply(defaultOptions, customConfig);
573
575
  defaultOptions = configUtil.extendDeeply(defaultOptions, tableDefaultConfig);
@@ -617,12 +619,12 @@ function initOption(opts) {
617
619
  }
618
620
 
619
621
  let reqPath = typeof path === "function" ? path() : path;
620
- let addUserForTableEnabled
621
- = settingConfig.addUserForTableDisabled !== true;
622
- let addCreateInfo
623
- = opts.addCreateInfo === true || addUserForTableEnabled;
624
- let queryCreateInfo
625
- = opts.queryCreateInfo === true || addUserForTableEnabled;
622
+ let addUserForTableEnabled =
623
+ settingConfig.addUserForTableDisabled !== true;
624
+ let addCreateInfo =
625
+ opts.addCreateInfo === true || addUserForTableEnabled;
626
+ let queryCreateInfo =
627
+ opts.queryCreateInfo === true || addUserForTableEnabled;
626
628
  let reqData = queryParams;
627
629
  if (opts.paramHandle) {
628
630
  reqData = opts.paramHandle
@@ -649,10 +651,10 @@ function initOption(opts) {
649
651
  .treeConditions || ["enabled"];
650
652
  let treeFiled = Object.keys(formData).some((key) => {
651
653
  return (
652
- !treeConditions.includes(key)
653
- && formData[key] !== null
654
- && formData[key] !== undefined
655
- && formData[key] !== ""
654
+ !treeConditions.includes(key) &&
655
+ formData[key] !== null &&
656
+ formData[key] !== undefined &&
657
+ formData[key] !== ""
656
658
  );
657
659
  });
658
660
  if (treeFiled) {
@@ -661,8 +663,8 @@ function initOption(opts) {
661
663
  let isLazy = $t.treeConfig.lazy;
662
664
  $t.treeConfig.lazy = false;
663
665
  $t.setAllTreeExpand(true).then(() => {
664
- let fullAllDataRowMap
665
- = $t.$refs.xTable.fullAllDataRowMap;
666
+ let fullAllDataRowMap =
667
+ $t.$refs.xTable.fullAllDataRowMap;
666
668
  let fullData = $t.getTableData().fullData;
667
669
  fullData.forEach((lineData) => {
668
670
  if (
@@ -818,8 +820,8 @@ function initOption(opts) {
818
820
 
819
821
  function getTableJson(tableName, that, success) {
820
822
  if (
821
- configUtil.tableConfig.disableTableName
822
- || settingConfig.tableStorageDisabled
823
+ configUtil.tableConfig.disableTableName ||
824
+ settingConfig.tableStorageDisabled
823
825
  )
824
826
  return false;
825
827
  if (!tableName) return;
@@ -840,8 +842,8 @@ function addTableExportJson() {}
840
842
 
841
843
  function addTableJson(that, $grid, tableName, columns, success) {
842
844
  if (
843
- configUtil.tableConfig.disableTableName
844
- || settingConfig.tableStorageDisabled
845
+ configUtil.tableConfig.disableTableName ||
846
+ settingConfig.tableStorageDisabled
845
847
  )
846
848
  return false;
847
849
  if (!tableName) return;
@@ -942,8 +944,8 @@ function initColumn(option, syncColumns) {
942
944
  if (!oldColumn) return;
943
945
  matchedOld.add(oldColumn);
944
946
  if (!oldColumn.params) oldColumn.params = {};
945
- const visibleSync
946
- = option.visibleSync !== false && oldColumn.visibleSync !== false;
947
+ const visibleSync =
948
+ option.visibleSync !== false && oldColumn.visibleSync !== false;
947
949
  if (visibleSync) {
948
950
  oldColumn.visible = syncColumn.visible;
949
951
  }
@@ -967,9 +969,9 @@ function initColumn(option, syncColumns) {
967
969
  return syncCol.field === newColumn.field;
968
970
  });
969
971
  if (
970
- syncParentColumn
971
- && syncParentColumn.children
972
- && syncParentColumn.children.length > 0
972
+ syncParentColumn &&
973
+ syncParentColumn.children &&
974
+ syncParentColumn.children.length > 0
973
975
  ) {
974
976
  // 递归处理 children
975
977
  newColumn.children = initColumn(
@@ -1104,8 +1106,8 @@ function changeSelectCount(checked) {
1104
1106
 
1105
1107
  function getTableData(that, tableRef, type, success) {
1106
1108
  if (
1107
- configUtil.tableConfig.disableTableName
1108
- || settingConfig.tableStorageDisabled
1109
+ configUtil.tableConfig.disableTableName ||
1110
+ settingConfig.tableStorageDisabled
1109
1111
  )
1110
1112
  return false;
1111
1113
  let $grid = getGrid(that, tableRef);
@@ -1127,8 +1129,8 @@ function getTableData(that, tableRef, type, success) {
1127
1129
 
1128
1130
  function addTableData(that, tableRef, value, success) {
1129
1131
  if (
1130
- configUtil.tableConfig.disableTableName
1131
- || settingConfig.tableStorageDisabled
1132
+ configUtil.tableConfig.disableTableName ||
1133
+ settingConfig.tableStorageDisabled
1132
1134
  )
1133
1135
  return false;
1134
1136
  let $grid = getGrid(that, tableRef);
@@ -715,7 +715,7 @@ modules = {
715
715
  }
716
716
  if (t.children && t.children.length) {
717
717
  col.align = "center";
718
- delete col.field;
718
+ // delete col.field;
719
719
  let childColumns = t.children.map((child) => {
720
720
  return createColumn(child, true);
721
721
  });
@@ -100,6 +100,7 @@ export default {
100
100
  2: "date",
101
101
  3: "number",
102
102
  4: "text",
103
+ 5: "select",
103
104
  },
104
105
  };
105
106
  },
@@ -150,6 +151,20 @@ export default {
150
151
  options.label = item.f_field_name;
151
152
  options.required = item.f_is_required;
152
153
  tableCell.widgetList.push(widget);
154
+
155
+ if (type === "select") {
156
+ if (item.f_enum_values) {
157
+ let enumValues = item.f_enum_values
158
+ .split(",")
159
+ .filter((value) => !!value);
160
+ options.optionItems = enumValues.map((value) => ({
161
+ label: value,
162
+ value: value,
163
+ }));
164
+ } else {
165
+ options.optionItems = [];
166
+ }
167
+ }
153
168
  }
154
169
 
155
170
  if (index === -1) {
@@ -281,9 +296,10 @@ export default {
281
296
  {
282
297
  f_field_name: "姓名", //显示名称
283
298
  f_key: "name", //字段名
284
- f_field_type: 4, //类型,0: "文本输入框",1: "多行输入框",2: "日期输入框",3: "数字输入框",4:"纯文本"
299
+ f_field_type: 4, //类型,0: "文本输入框",1: "多行输入框",2: "日期输入框",3: "数字输入框",4:"纯文本",5: "下拉框"
285
300
  f_is_required: false, //是否必填
286
301
  f_field_value: "张三", //字段值
302
+ f_enum_values: "张三,李四,王五", //下拉框选项
287
303
  },
288
304
  ];
289
305
  let a = 1;