cnhis-design-vue 2.1.158 → 2.1.160

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +70 -42
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +35 -26
  4. package/es/button/index.js +88 -58
  5. package/es/button/style.css +1 -1
  6. package/es/captcha/index.js +3 -3
  7. package/es/card-reader-sdk/index.js +1 -1
  8. package/es/checkbox/index.js +1 -1
  9. package/es/color-picker/index.js +1 -1
  10. package/es/drag-layout/index.js +3 -3
  11. package/es/editor/index.js +1 -1
  12. package/es/ellipsis/index.js +1 -1
  13. package/es/fabric-chart/index.js +9 -9
  14. package/es/form-table/index.js +20 -20
  15. package/es/full-calendar/index.js +4 -4
  16. package/es/index/index.js +724 -373
  17. package/es/index/style.css +1 -1
  18. package/es/input/index.js +1 -1
  19. package/es/map/index.js +1 -1
  20. package/es/multi-chat/index.js +25 -25
  21. package/es/multi-chat-client/index.js +19 -19
  22. package/es/multi-chat-history/index.js +4 -4
  23. package/es/multi-chat-record/index.js +4 -4
  24. package/es/multi-chat-setting/index.js +20 -20
  25. package/es/multi-chat-sip/index.js +1 -1
  26. package/es/radio/index.js +1 -1
  27. package/es/scale-container/index.js +1 -1
  28. package/es/scale-view/index.js +56 -54
  29. package/es/scale-view/style.css +1 -1
  30. package/es/select/index.js +4 -4
  31. package/es/select-label/index.js +3 -3
  32. package/es/select-person/index.js +2 -2
  33. package/es/select-tag/index.js +4 -4
  34. package/es/shortcut-setter/index.js +2 -2
  35. package/es/slider-tree/index.js +1 -1
  36. package/es/table-filter/index.js +533 -193
  37. package/es/table-filter/style.css +1 -1
  38. package/es/tag/index.js +1 -1
  39. package/es/verification-code/index.js +2 -2
  40. package/lib/cui.common.js +816 -442
  41. package/lib/cui.umd.js +816 -442
  42. package/lib/cui.umd.min.js +17 -17
  43. package/package.json +1 -1
  44. package/packages/big-table/src/utils/headerFilter.js +6 -0
  45. package/packages/button/src/ButtonPrint/new.vue +47 -24
  46. package/packages/table-filter/src/base-search-com/BaseSearch.vue +20 -6
  47. package/packages/table-filter/src/components/render-widget/components/SelectDynamic.vue +3 -2
  48. package/packages/table-filter/src/components/render-widget/components/SelectTree.vue +145 -0
  49. package/packages/table-filter/src/components/render-widget/components/index.js +2 -1
  50. package/packages/table-filter/src/components/render-widget/enums.js +2 -1
  51. package/packages/table-filter/src/components/render-widget/index.vue +3 -0
  52. package/packages/table-filter/src/components/render-widget/mixins/dynamic-method.js +47 -28
  53. package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +26 -1
  54. package/packages/table-filter/src/mixins/renderWidget.js +10 -1
  55. package/packages/upload/chunk-upload/chunk-upload-new.vue +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.158",
3
+ "version": "2.1.160",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -354,6 +354,12 @@ export default {
354
354
  end_val: item.end_val || '', // 结束时间
355
355
  unit: item.unit || '' // 年龄
356
356
  };
357
+ if (item.extendKey) {
358
+ temp.extendKey = item.extendKey;
359
+ }
360
+ if (item.extendType) {
361
+ temp.extendType = item.extendType;
362
+ }
357
363
  conObj.push(temp);
358
364
  }
359
365
  // let dateCons = this.dateTeam.map(item => item.con);
@@ -1062,15 +1062,35 @@ export default create({
1062
1062
  },
1063
1063
  handleClickPrint(curPrintParamList, templateCode, templateId, formatId, printToParam=[], needContinuePrint) {
1064
1064
  let len = curPrintParamList.length;
1065
- const callLocalServicesSuccessCb = async data => {
1065
+ const successParams = [];
1066
+ const errorParams = [];
1067
+ const callLocalServicesSuccessErrorCb = async data => {
1066
1068
  try {
1069
+ if (data.printCbStatus) {
1070
+ successParams.push(data);
1071
+ } else {
1072
+ errorParams.push(data);
1073
+ }
1067
1074
  if (--len <= 0) {
1068
- this.callLocalServicesSuccessCb(data, 'print');
1075
+ if (errorParams.length == curPrintParamList.length) {
1076
+ this.callLocalServicesErrorCb(data, {
1077
+ successList: [],
1078
+ errorList: errorParams,
1079
+ isMulti: true
1080
+ });
1081
+ } else {
1082
+ this.callLocalServicesSuccessCb(data, 'print', {
1083
+ successList: successParams,
1084
+ errorList: errorParams,
1085
+ isMulti: true
1086
+ });
1087
+ }
1069
1088
  }
1070
1089
  } catch (error) {
1071
1090
  console.log('error', error);
1072
1091
  }
1073
1092
  };
1093
+
1074
1094
  if (this.getCurrentLoading() && !needContinuePrint) return;
1075
1095
  this.toggleExpandLoading(true, formatId);
1076
1096
  this.prevFn()
@@ -1111,49 +1131,47 @@ export default create({
1111
1131
  printdlgshow: this.printdlgshow
1112
1132
  };
1113
1133
  if (this.strategy === 'MULTI') {
1114
- // 循环多条
1115
- // for (let i = 0; i < curPrintParamList.length; i++) {
1116
- // if (i > 0) queryParams.printdlgshow = '0';
1117
- // const params = JSON.stringify(Object.assign({}, JSON.parse(this.getPrintParams()), this.printCustomProps, curPrintParamList[i]));
1118
- // this.printInstance.printDirect(
1119
- // {
1120
- // ...queryParams,
1121
- // params
1122
- // },
1123
- // callLocalServicesSuccessCb,
1124
- // this.callLocalServicesErrorCb,
1125
- // this.callLocalServicesCancelCb
1126
- // );
1127
- // }
1128
1134
  // 循环剩余数据
1129
1135
  const multiOtherPrint = () => {
1130
1136
  for (let i = 1; i < curPrintParamList.length; i++) {
1131
1137
  queryParams.printdlgshow = '0';
1132
1138
  const params = JSON.stringify(Object.assign({}, JSON.parse(this.getPrintParams()), this.printCustomProps, curPrintParamList[i]));
1139
+ const originParam = this.findOriginParam(curPrintParamList[i], printToParam);
1133
1140
  this.printInstance.printDirect(
1134
1141
  {
1135
1142
  ...queryParams,
1136
1143
  params
1137
1144
  },
1138
- callLocalServicesSuccessCb,
1139
- this.callLocalServicesErrorCb,
1145
+ (res) => {
1146
+ res.originPrintParam = originParam || undefined;
1147
+ res.printCbStatus = true;
1148
+ callLocalServicesSuccessErrorCb(res);
1149
+ },
1150
+ (error) => {
1151
+ error.originPrintParam = originParam || undefined;
1152
+ callLocalServicesSuccessErrorCb(error);
1153
+ },
1140
1154
  this.callLocalServicesCancelCb
1141
1155
  );
1142
1156
  }
1143
1157
  }
1144
1158
  // 先执行第一条如果取消了,则不再往下执行
1145
1159
  const params = JSON.stringify(Object.assign({}, JSON.parse(this.getPrintParams()), this.printCustomProps, curPrintParamList[0]));
1160
+ const originParam = this.findOriginParam(curPrintParamList[0], printToParam);
1146
1161
  this.printInstance.printDirect(
1147
1162
  {
1148
1163
  ...queryParams,
1149
1164
  params
1150
1165
  },
1151
1166
  (res) => {
1152
- callLocalServicesSuccessCb(res);
1167
+ res.originPrintParam = originParam || undefined;
1168
+ res.printCbStatus = true;
1169
+ callLocalServicesSuccessErrorCb(res);
1153
1170
  multiOtherPrint();
1154
1171
  },
1155
1172
  (error) => {
1156
- this.callLocalServicesErrorCb(error);
1173
+ error.originPrintParam = originParam || undefined;
1174
+ callLocalServicesSuccessErrorCb(error);
1157
1175
  multiOtherPrint();
1158
1176
  },
1159
1177
  (res) => {
@@ -1180,6 +1198,11 @@ export default create({
1180
1198
  }
1181
1199
  })
1182
1200
  },
1201
+
1202
+ findOriginParam(printParam, originParams) {
1203
+ const keys = Object.keys(printParam);
1204
+ return originParams.find(param => keys.every(key => printParam[key] == param[key]));
1205
+ },
1183
1206
  getHisParams(index = 0) {
1184
1207
  const { templateParams, hisParams, params } = this;
1185
1208
  const { reportid = '280' } = hisParams;
@@ -1346,7 +1369,7 @@ export default create({
1346
1369
  this.visible = false;
1347
1370
  },
1348
1371
  /* */
1349
- callLocalServicesSuccessCb(res, type) {
1372
+ callLocalServicesSuccessCb(res, type, config) {
1350
1373
  this.toggleExpandLoading(false);
1351
1374
  let info = {
1352
1375
  type,
@@ -1354,11 +1377,11 @@ export default create({
1354
1377
  templateId: res?.templateId || this.getTemplateIdByFormatId(this.currentFormatId),
1355
1378
  templateCode: res?.templateCode || this.getTemplateCodeByFormatId(this.currentFormatId),
1356
1379
  };
1357
- this.$emit('success', res, info);
1380
+ this.$emit('success', res, info, config);
1358
1381
  },
1359
- callLocalServicesErrorCb(res) {
1382
+ callLocalServicesErrorCb(res, config) {
1360
1383
  this.toggleExpandLoading(false);
1361
- this.$emit('error', res);
1384
+ this.$emit('error', res, config);
1362
1385
  },
1363
1386
  callLocalServicesCancelCb(res) {
1364
1387
  this.toggleExpandLoading(false);
@@ -1992,6 +1992,7 @@ export default create({
1992
1992
  };
1993
1993
  // paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj })));
1994
1994
  let resParams = utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })) || {}
1995
+ resParams._originRow = i;
1995
1996
  if(btn?.__printConfig?.number) {
1996
1997
  resParams.templateNumbers = [btn.__printConfig.number]
1997
1998
  }
@@ -1999,7 +2000,7 @@ export default create({
1999
2000
  });
2000
2001
  return paramsArray;
2001
2002
  },
2002
- async receivePrintSuccessAboutPrint(res, info) {
2003
+ async receivePrintSuccessAboutPrint(res, info, config) {
2003
2004
  const printBtn = this.printBtn;
2004
2005
  const templateId = info.templateId;
2005
2006
  const formatId = info.formatId;
@@ -2011,7 +2012,7 @@ export default create({
2011
2012
  const result = await this.printConfig.postStepRule(printBtn.settingObj, {
2012
2013
  result: res,
2013
2014
  print: print
2014
- });
2015
+ }, config);
2015
2016
 
2016
2017
  let isSync = result?.method
2017
2018
  if(!isSync || isSync!=='sync') return;
@@ -2023,15 +2024,28 @@ export default create({
2023
2024
  console.log('error', error);
2024
2025
  }
2025
2026
  },
2026
- async receivePrintSuccess(res, info) {
2027
+ async receivePrintSuccess(res, info, config={}) {
2028
+ const {isMulti, errorList=[]} = config
2029
+ let useRes = res;
2030
+ // 批量打印如果有失败就取errorList的最后一项
2031
+ if(isMulti && errorList.length) {
2032
+ useRes = errorList[errorList.length -1];
2033
+ }
2034
+ const {result, message, errinfo} = useRes || {}
2035
+ const messageType = isMulti ? result == 'error' ?'error' : 'success' : 'success';
2036
+ let msg = message;
2037
+ if(messageType === 'error' && errinfo) {
2038
+ msg = (message + `:${errinfo}`)
2039
+ }
2027
2040
  if (info.type === 'print') {
2028
- await this.receivePrintSuccessAboutPrint(res, info);
2041
+ await this.receivePrintSuccessAboutPrint(useRes, info, config);
2029
2042
  }
2030
2043
  if(info.type === 'download' && this.receivePrintSuccessDownloadPdf && typeof this.receivePrintSuccessDownloadPdf === 'function') {
2031
- this.receivePrintSuccessDownloadPdf(res)
2044
+ this.receivePrintSuccessDownloadPdf(useRes, config)
2032
2045
  }
2046
+
2033
2047
  setTimeout(() => {
2034
- this.$message.success(res.message);
2048
+ this.$message[messageType](message);
2035
2049
  }, 3500);
2036
2050
  },
2037
2051
  receivePrintError(res) {
@@ -9,7 +9,7 @@
9
9
  :maxTagCount="maxTagCount"
10
10
  :maxTagPlaceholder="maxTagPlaceholder"
11
11
  :filterOption="false"
12
- :allowClear="true"
12
+ :allowClear="allowClear"
13
13
  :showArrow="true"
14
14
  ref="quickInputSelect"
15
15
  class="quick-dynamic-select"
@@ -90,7 +90,8 @@ export default {
90
90
  placeholder: String,
91
91
  mode: String,
92
92
  handleWordBookSearchRender: Function,
93
- dropdownVisibleChangeRender: Function
93
+ dropdownVisibleChangeRender: Function,
94
+ allowClear: Boolean
94
95
  },
95
96
  data() {
96
97
  return {};
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <div class="valueCfg-SelectDynamicTree">
3
+ <a-tree-select
4
+ v-model="valueCp"
5
+ showSearch
6
+ :multiple="isMultiple"
7
+ :placeholder="placeholder"
8
+ :dropdownMatchSelectWidth="false"
9
+ :maxTagCount="maxTagCount"
10
+ :maxTagPlaceholder="maxTagPlaceholder"
11
+ :tree-data="componentCfg.dataSource"
12
+ :allowClear="allowClear"
13
+ :replaceFields="replaceFields"
14
+ class="valueCfg-dynamic-select-tree"
15
+ dropdownClassName="valueCfg-dynamic-tree-drop"
16
+ ref="quickInputSelectTree"
17
+ treeNodeFilterProp="title"
18
+ @change="handleChange"
19
+ :dropdown-style="{ maxHeight: '293px', overflow: 'auto', zIndex: 2023 }"
20
+ >
21
+ <span
22
+ class="init-key-loading"
23
+ v-if="key === '_init_key_'"
24
+ slot="title"
25
+ slot-scope="{ key, value }"
26
+ style="color: #08c"
27
+ >
28
+ <span v-show="false">{{ value }}</span>
29
+ <a-spin :tip="`${$t('1.1.7.14')}...`" />
30
+ </span>
31
+ </a-tree-select>
32
+ </div>
33
+ </template>
34
+ <script>
35
+ export default {
36
+ name: "SelectTree",
37
+ components: {},
38
+ props: {
39
+ value: { type: [Array, String, Number] },
40
+ componentCfg: { type: Object },
41
+ placeholder: String,
42
+ mode: String,
43
+ handleWordBookSearchRender: Function,
44
+ dropdownVisibleChangeRender: Function,
45
+ isQuick: Boolean,
46
+ allowClear: Boolean,
47
+ },
48
+ data() {
49
+ return {
50
+ open: false,
51
+ replaceFields: {
52
+ children: "children",
53
+ title: "_show_title",
54
+ key: "myName",
55
+ value: "myName"
56
+ }
57
+ };
58
+ },
59
+ model: {
60
+ prop: "value",
61
+ event: "update:value"
62
+ },
63
+ computed: {
64
+ valueCp: {
65
+ set(val) {
66
+ this.$emit("update:value", val);
67
+ },
68
+ get() {
69
+ return this.value;
70
+ }
71
+ },
72
+ isMultiple() {
73
+ return this.mode === "multiple";
74
+ },
75
+ showSelectTitle() {
76
+ let { fetchingWordbook, dataSource } = this.componentCfg || {};
77
+ return !fetchingWordbook && !!dataSource?.length;
78
+ },
79
+
80
+ showKeys() {
81
+ let { showKeys } = this.componentCfg?.dynamicOptionInfo || {};
82
+ return showKeys;
83
+ },
84
+ _showKeys_() {
85
+ let { _showKeys_ } = this.componentCfg || {};
86
+ if (_showKeys_?.length) return _showKeys_;
87
+ return this.showKeys;
88
+ },
89
+ getShowKeysMax() {
90
+ let len = this.showKeys?.length || 1;
91
+ let maxWidth = 100 / len;
92
+ return {
93
+ maxWidth: `${maxWidth}%`
94
+ };
95
+ },
96
+ selectHasTitle() {
97
+ const { showSelectTitle, showKeys, componentCfg } = this;
98
+ return (
99
+ showSelectTitle &&
100
+ Array.isArray(showKeys) &&
101
+ showKeys?.length > 1 &&
102
+ componentCfg?.dataSource?.length
103
+ );
104
+ },
105
+ maxTagCount() {
106
+ if (!Array.isArray(this.value)) return undefined;
107
+ const len = this.value.length || 0;
108
+ return len > 1 ? 0 : 1;
109
+ }
110
+ },
111
+ watch: {
112
+ // value: {
113
+ // immediate: true,
114
+ // handler(val) {}
115
+ // }
116
+ },
117
+ // 生命周期
118
+ created() {},
119
+ mounted() {
120
+ if(!this.isQuick) return;
121
+ this.handleWordBookSearchRender('', this.componentCfg, {skipFirstDef: true});
122
+ },
123
+
124
+ // 方法
125
+ methods: {
126
+ maxTagPlaceholder() {
127
+ if (!Array.isArray(this.value)) return undefined;
128
+ const { alias, title } = this.componentCfg;
129
+ const len = this.value.length || 0;
130
+ return this.value.length > 1 ? `已选${len}个${alias || title}` : "";
131
+ },
132
+ handleChange(value, label, extra) {
133
+ console.log(value, label, extra, "--value, label, extra");
134
+ }
135
+ }
136
+ };
137
+ </script>
138
+ <style lang="less">
139
+ .valueCfg-SelectDynamicTree {
140
+ width: 100%;
141
+ }
142
+ .valueCfg-dynamic-select-tree {
143
+ width: 100%;
144
+ }
145
+ </style>
@@ -6,5 +6,6 @@ import SelectDynamic from './SelectDynamic.vue';
6
6
  import Label from './Label.vue';
7
7
  import SelectLabel from './SelectLabel.vue';
8
8
  import Text from './Text.vue';
9
+ import SelectTree from './SelectTree.vue';
9
10
 
10
- export { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel, Text };
11
+ export { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel, Text, SelectTree };
@@ -11,7 +11,8 @@ export const WidgetTypeEnums = {
11
11
  DATETIME_RANGE: 'DATETIME_RANGE',
12
12
  DATE_RANGE_QUICK: 'DATE_RANGE_QUICK',
13
13
  LABEL: 'LABEL',
14
- SELECT_LABEL: 'SELECT_LABEL'
14
+ SELECT_LABEL: 'SELECT_LABEL',
15
+ SELECT_TREE: 'SELECT_TREE'
15
16
  };
16
17
 
17
18
  export const DatePresetValEnums = {
@@ -92,6 +92,9 @@ export default {
92
92
  Props.dropdownVisibleChangeRender = this.dropdownVisibleChangeRender;
93
93
  Props.handleWordBookSearchRender = this.handleWordBookSearchRender;
94
94
  }
95
+ if(widgetType === WidgetTypeEnums.SELECT_TREE) {
96
+ Props.handleWordBookSearchRender = this.handleWordBookSearchRender;
97
+ }
95
98
  if(widgetType === WidgetTypeEnums.LABEL || widgetType === WidgetTypeEnums.SELECT_LABEL) {
96
99
  Props.getLabelListMethodRender = this.getLabelListMethodRender;
97
100
  }
@@ -7,7 +7,7 @@ export default {
7
7
  },
8
8
  methods: {
9
9
  wordbookDataParamsRender(dynamicOptionInfo) {
10
- let { dataSourceId, dataSourceType = 'WORDBOOK', filterKeys, autograph, defaultParams } = dynamicOptionInfo;
10
+ let { dataSourceId, dataSourceType = 'WORDBOOK', filterKeys, autograph, defaultParams, treeInfo = {} } = dynamicOptionInfo;
11
11
  if (Array.isArray(filterKeys)) {
12
12
  filterKeys = JSON.stringify(filterKeys);
13
13
  }
@@ -17,6 +17,10 @@ export default {
17
17
  fieldKeys: filterKeys,
18
18
  autograph
19
19
  };
20
+ if (treeInfo.enable) {
21
+ params.levelKey = treeInfo.levelKey;
22
+ params.primaryKey = treeInfo.primaryKey;
23
+ }
20
24
  return params;
21
25
  },
22
26
  handleRenderFirstDef(item, rows) {
@@ -50,6 +54,46 @@ export default {
50
54
  this.$set(row, 'fetchingWordbook', false);
51
55
  });
52
56
  },
57
+ handleWordbookRows(list, valueKey, showKeys, isTree) {
58
+ if (!list?.length) return [];
59
+ return list.map(row => {
60
+ let showKeysStr = [];
61
+ // 取值是value, 展示是change_text
62
+ let valueKeyN = `_${valueKey}_`;
63
+ for (let key in row) {
64
+ let showVal = vexutils.stringToValue(row[key], 'change_text');
65
+ if (key === valueKey) {
66
+ row[valueKeyN] = vexutils.stringToValue(row[key]);
67
+ }
68
+ row[key] = showVal;
69
+ }
70
+ showKeys.forEach(s => {
71
+ showKeysStr.push(row[s]);
72
+ });
73
+ let name = row[valueKeyN];
74
+ // 保存的时候值会变成字符串, 如果是数字的话回显会出问题, 这里全部处理成字符串
75
+ if (typeof name === 'number') {
76
+ name = String(name);
77
+ }
78
+ const _show_title = showKeysStr.join(' ');
79
+ if (isTree) {
80
+ row.scopedSlots = {
81
+ title: 'title'
82
+ };
83
+ row.title = _show_title;
84
+ row.key = name;
85
+ row.value = name;
86
+ }
87
+ if (isTree && row.children?.length) {
88
+ row.children = this.handleWordbookRows(row.children, valueKey, showKeys, isTree);
89
+ }
90
+ return {
91
+ ...row,
92
+ myName: name,
93
+ _show_title
94
+ };
95
+ });
96
+ },
53
97
 
54
98
  formatWordbookDataRender(item, data, params) {
55
99
  let searchPageConfig = {
@@ -62,7 +106,7 @@ export default {
62
106
  resArr = [];
63
107
  if (data && data.result === 'SUCCESS') {
64
108
  let reqParams = data?.reqParams || {};
65
- let { showKeys, valueKey } = item?.widgetCfg?.dynamicOptionInfo || {};
109
+ let { showKeys, valueKey, treeInfo = {} } = item?.widgetCfg?.dynamicOptionInfo || {};
66
110
  showKeys = Array.isArray(showKeys) ? showKeys : [showKeys];
67
111
  let { page, hasNextPage, fieldList, rows = [] } = data.map;
68
112
 
@@ -84,32 +128,7 @@ export default {
84
128
  keyword: params?.keyword || undefined,
85
129
  asyncCount: reqParams?.asyncCount || undefined
86
130
  });
87
- let rowsArr = rows.map(row => {
88
- let showKeysStr = [];
89
- // 取值是value, 展示是change_text
90
- let valueKeyN = `_${valueKey}_`;
91
- for (let key in row) {
92
- let showVal = vexutils.stringToValue(row[key], 'change_text');
93
- if (key === valueKey) {
94
- row[valueKeyN] = vexutils.stringToValue(row[key]);
95
- }
96
- row[key] = showVal;
97
- }
98
- showKeys.forEach(s => {
99
- // let str = vexutils.stringToValue(row[s]);
100
- showKeysStr.push(row[s]);
101
- });
102
- // let name = vexutils.stringToValue(row[valueKey]);
103
- let name = row[valueKeyN];
104
- // 保存的时候值会变成字符串, 如果是数字的话回显会出问题, 这里全部处理成字符串
105
- if (typeof name === 'number') {
106
- name = String(name);
107
- }
108
- return Object.assign(row, {
109
- myName: name,
110
- _show_title: showKeysStr.join(' ')
111
- });
112
- });
131
+ let rowsArr = this.handleWordbookRows(rows, valueKey, showKeys, treeInfo?.enable);
113
132
  // 数组对象去重
114
133
  let obj = {};
115
134
  resArr = rowsArr.reduce((cur, next) => {
@@ -1,6 +1,6 @@
1
1
  import { WidgetTypeEnums, DatePresetValEnums } from './enums';
2
2
  import { InputNumber, Input, DatePicker } from 'ant-design-vue';
3
- import { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel, Text } from './components';
3
+ import { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel, Text, SelectTree } from './components';
4
4
  import moment from 'moment';
5
5
  import { presetValToTimestamp } from './helpers/presetValToTimestamp';
6
6
 
@@ -260,6 +260,31 @@ export const WidgetCfgMaps = new Map([
260
260
  setDefaultValue: SetDefVal
261
261
  }
262
262
  ],
263
+ [
264
+ WidgetTypeEnums.SELECT_TREE,
265
+ {
266
+ component: SelectTree,
267
+ props: {},
268
+ eventsBySearch: [
269
+ {
270
+ name: 'change',
271
+ handler(e, search, props) {
272
+ const { mode } = props;
273
+ if (mode !== 'multiple') {
274
+ search();
275
+ }
276
+ }
277
+ }
278
+ ],
279
+ handlerProps(props, { multiple, title, explicitRequired, isQuick } = {}) {
280
+ const allowClear = explicitRequired != 1;
281
+ const Props = { ...props, placeholder: `请选择${title}`, allowClear, isQuick };
282
+ Props.mode = multiple ? 'multiple' : 'default';
283
+ return Props;
284
+ },
285
+ setDefaultValue: SetDefVal
286
+ }
287
+ ],
263
288
  [
264
289
  WidgetTypeEnums.SELECT_DYNAMIC,
265
290
  {
@@ -74,6 +74,12 @@ export default {
74
74
  value: val.length > 0 ? val : null,
75
75
  unit
76
76
  };
77
+ if (widgetCfg.extendKey) {
78
+ obj.extendKey = widgetCfg.extendKey;
79
+ }
80
+ if (widgetCfg.extendType) {
81
+ obj.extendType = widgetCfg.extendType;
82
+ }
77
83
 
78
84
  if (widgetType === WidgetTypeEnums.INPUT && widgetCfg?.accurateSearch?.switchEnable) {
79
85
  obj.isAccurateSearch = isAccurateSearch;
@@ -91,9 +97,12 @@ export default {
91
97
  }
92
98
  return !Array.isArray(value) ? value : value[0];
93
99
  },
100
+ isDynamicTree(cfg) {
101
+ return !cfg?.manualMapping && cfg?.widgetCfg?.dynamicOptionInfo && cfg?.widgetCfg?.dynamicOptionInfo?.treeInfo?.enable;
102
+ },
94
103
  isExplicitDefaultVal(cfg) {
95
104
  const { explicitDefaultVal } = cfg.widgetCfg || {};
96
- return explicitDefaultVal === 'firstOption';
105
+ return explicitDefaultVal === 'firstOption' || this.isDynamicTree(cfg);
97
106
  },
98
107
  isExistDefValByRenderWidget(cfg) {
99
108
  const { defaultValue, defValueUnit } = cfg.widgetCfg || {};
@@ -739,7 +739,8 @@ export default {
739
739
  return new Promise((resolve, reject) => {
740
740
  const obj = {
741
741
  ...data,
742
- ...this.uploadArguments
742
+ ...this.uploadArguments,
743
+ size: file.size,
743
744
  };
744
745
 
745
746
  instance