@byteluck-fe/model-driven-upgrade 2.8.1-alpha.4 → 2.8.1-alpha.5

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.
@@ -3,7 +3,7 @@
3
3
  * @Autor: SuperLucky-Q
4
4
  * @Date: 2023-02-16 14:45:22
5
5
  * @LastEditors: SuperLuckyqi
6
- * @LastEditTime: 2023-11-20 15:24:08
6
+ * @LastEditTime: 2023-11-21 14:56:03
7
7
  */ function _define_property(obj, key, value) {
8
8
  if (key in obj) {
9
9
  Object.defineProperty(obj, key, {
@@ -126,6 +126,27 @@ function conversion(schema, payload) {
126
126
  }
127
127
  });
128
128
  }
129
+ // 4.5.0-lh2 列表批量选择需求 -> 如果历史数据 or 新数据内存在 batch 操作 则将复选框开启。
130
+ if (schema.type === CONTROL_TYPE.LIST_VIEW && schema.props.is_show_selection === false) {
131
+ var batchButtonTypes = [
132
+ CONTROL_TYPE.BATCH_SUBMISSION_LIST_BUTTON,
133
+ CONTROL_TYPE.LIST_PAGE_BTN_BATCH_PRINT,
134
+ CONTROL_TYPE.BATCH_DELETE_LIST_BUTTON
135
+ ];
136
+ schema.children.forEach(function(item) {
137
+ if (item.type === CONTROL_TYPE.GRID_TABLE) {
138
+ var childrenType = item.children.map(function(tableItem) {
139
+ return tableItem.type;
140
+ });
141
+ var isOpenCheckbox = childrenType.some(function(type) {
142
+ return batchButtonTypes.includes(type);
143
+ });
144
+ if (isOpenCheckbox === true) {
145
+ schema.props.is_show_selection = true;
146
+ }
147
+ }
148
+ });
149
+ }
129
150
  //将操作项按钮的完成时事件转成点击时事件
130
151
  conversionListener(payload);
131
152
  return schema;