mooho-base-admin-plus 2.4.40 → 2.4.42

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": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "2.4.40",
4
+ "version": "2.4.42",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -157,6 +157,8 @@
157
157
  :placeholder="column.description"
158
158
  :transfer="true"
159
159
  @on-change="selected => onSelectDataChange(column, selected)"
160
+ @on-query-change="query => onComboQueryChange(column, query)"
161
+ @on-clear="loadOption(data, column, null)"
160
162
  >
161
163
  <Option v-for="item in getDataSource(data, column)" :key="item.id" :value="item.id">{{ item.name }}</Option>
162
164
  </Select>
@@ -177,6 +179,7 @@
177
179
  :placeholder="column.description"
178
180
  :transfer="true"
179
181
  @on-change="selected => onSelectDataChange(column, selected)"
182
+ @on-query-change="query => onComboQueryChange(column, query)"
180
183
  >
181
184
  <Option v-for="item in getDataSource(data, column)" :key="item.id" :value="item.id">{{ item.name }}</Option>
182
185
  </Select>
@@ -565,31 +568,6 @@
565
568
  return column.dataSource == null ? [] : column.dataSource;
566
569
  }
567
570
  },
568
- // // 可筛选下拉框加载数据
569
- // loadOption(data, column, keyword) {
570
- // let param = this.getParam(data, column);
571
-
572
- // if (param != null) {
573
- // if (!(keyword || '').trim() && this.parseFilterData(data, column) != null) {
574
- // param.id = this.parseFilterData(data, column);
575
- // } else {
576
- // param.keyword = keyword;
577
- // }
578
- // param.per = 20;
579
-
580
- // this.fillDataSource(data, column, param);
581
- // } else {
582
- // // 参数不完整,清空数据
583
- // column.dataSource = [];
584
- // this.setData(data, column.code, null);
585
- // // column.displayValue = null;
586
-
587
- // // 触发
588
- // column.triggers.forEach(item => {
589
- // item.needRefresh = true;
590
- // });
591
- // }
592
- // },
593
571
  // 选项变化事件
594
572
  onSelectDataChange(sender, selected) {
595
573
  let code;
@@ -879,9 +857,7 @@
879
857
  data = JSON.parse(value);
880
858
  }
881
859
 
882
- setTimeout(() => {
883
- this.loadComboDataLabel(model, column, data);
884
- });
860
+ this.loadComboDataLabel(model, column, data);
885
861
 
886
862
  return data;
887
863
  },
@@ -914,35 +890,43 @@
914
890
  }
915
891
 
916
892
  // 读取显示内容
917
- if (pendings.length > 0) {
918
- let param = this.getParam(model, column);
919
- param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
920
- let res;
921
-
922
- if (column.isSourceCustom) {
923
- res = await customModelApi.query(column.source, param);
924
- } else {
925
- res = await modelApi.query(column.source, param);
926
- }
893
+ setTimeout(async () => {
894
+ if (pendings.length > 0) {
895
+ let param = this.getParam(model, column);
896
+ param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
897
+ let res;
898
+
899
+ if (column.isSourceCustom) {
900
+ res = await customModelApi.query(column.source, param);
901
+ } else {
902
+ res = await modelApi.query(column.source, param);
903
+ }
927
904
 
928
- res.data.forEach(item => {
929
- let v = this.parseData(item, column.sourceDataCode);
930
- let label = this.parseData(item, column.sourceDisplayCode);
905
+ res.data.forEach(item => {
906
+ let v = this.parseData(item, column.sourceDataCode);
907
+ let label = this.parseData(item, column.sourceDisplayCode);
931
908
 
932
- if (column.controlType == 'ComboSelect') {
933
- // 添加筛选内容
934
- //this.$refs['control_' + column.code][0].$data.query = label;
935
- }
909
+ if (column.controlType == 'ComboSelect') {
910
+ // 添加筛选内容
911
+ //this.$refs['control_' + column.code][0].$data.query = label;
912
+ }
936
913
 
937
- let newValue = pendings.find(i => i.value == v);
914
+ let newValue = pendings.find(i => i.value == v);
938
915
 
939
- if (newValue) {
940
- newValue.label = label;
941
- }
942
- });
916
+ if (newValue) {
917
+ newValue.label = label;
918
+ }
919
+ });
943
920
 
944
- this.$forceUpdate();
945
- }
921
+ this.$forceUpdate();
922
+ }
923
+ });
924
+ }
925
+ },
926
+ // 可筛选下拉框搜索条件变化
927
+ onComboQueryChange(column, query) {
928
+ if (!(query || '').trim()) {
929
+ this.loadOption(this.data, column, null);
946
930
  }
947
931
  }
948
932
  }
@@ -200,6 +200,8 @@
200
200
  :placeholder="column.description"
201
201
  :transfer="true"
202
202
  @on-change="selected => onSelectDataChange(column, selected)"
203
+ @on-query-change="query => onComboQueryChange(column, query)"
204
+ @on-clear="loadOption(data, column, null)"
203
205
  >
204
206
  <Option v-for="item in getDataSource(data, column)" :key="item.id" :value="item.id">{{ item.name }}</Option>
205
207
  </Select>
@@ -218,6 +220,7 @@
218
220
  :placeholder="column.description"
219
221
  :transfer="true"
220
222
  @on-change="selected => onSelectDataChange(column, selected)"
223
+ @on-query-change="query => onComboQueryChange(column, query)"
221
224
  >
222
225
  <Option v-for="item in getDataSource(data, column)" :key="item.id" :value="item.id">{{ item.name }}</Option>
223
226
  </Select>
@@ -1085,9 +1088,7 @@
1085
1088
  data = JSON.parse(value);
1086
1089
  }
1087
1090
 
1088
- setTimeout(() => {
1089
- this.loadComboDataLabel(model, column, data);
1090
- });
1091
+ this.loadComboDataLabel(model, column, data);
1091
1092
 
1092
1093
  return data;
1093
1094
  },
@@ -1125,35 +1126,43 @@
1125
1126
  }
1126
1127
 
1127
1128
  // 读取显示内容
1128
- if (pendings.length > 0) {
1129
- let param = this.getParam(model, column);
1130
- param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
1131
- let res;
1132
-
1133
- if (column.isSourceCustom) {
1134
- res = await customModelApi.query(column.source, param);
1135
- } else {
1136
- res = await modelApi.query(column.source, param);
1137
- }
1129
+ setTimeout(async () => {
1130
+ if (pendings.length > 0) {
1131
+ let param = this.getParam(model, column);
1132
+ param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
1133
+ let res;
1134
+
1135
+ if (column.isSourceCustom) {
1136
+ res = await customModelApi.query(column.source, param);
1137
+ } else {
1138
+ res = await modelApi.query(column.source, param);
1139
+ }
1138
1140
 
1139
- res.data.forEach(item => {
1140
- let v = this.parseData(item, column.sourceDataCode);
1141
- let label = this.parseData(item, column.sourceDisplayCode);
1141
+ res.data.forEach(item => {
1142
+ let v = this.parseData(item, column.sourceDataCode);
1143
+ let label = this.parseData(item, column.sourceDisplayCode);
1142
1144
 
1143
- if (column.controlType == 'ComboSelect') {
1144
- // 添加筛选内容
1145
- //this.$refs['control_' + column.code][0].$data.query = label;
1146
- }
1145
+ if (column.controlType == 'ComboSelect') {
1146
+ // 添加筛选内容
1147
+ //this.$refs['control_' + column.code][0].$data.query = label;
1148
+ }
1147
1149
 
1148
- let newValue = pendings.find(i => i.value == v);
1150
+ let newValue = pendings.find(i => i.value == v);
1149
1151
 
1150
- if (newValue) {
1151
- newValue.label = label;
1152
- }
1153
- });
1152
+ if (newValue) {
1153
+ newValue.label = label;
1154
+ }
1155
+ });
1154
1156
 
1155
- this.$forceUpdate();
1156
- }
1157
+ this.$forceUpdate();
1158
+ }
1159
+ });
1160
+ }
1161
+ },
1162
+ // 可筛选下拉框搜索条件变化
1163
+ onComboQueryChange(column, query) {
1164
+ if (!(query || '').trim()) {
1165
+ this.loadOption(this.data, column, null);
1157
1166
  }
1158
1167
  }
1159
1168
  }
@@ -219,6 +219,8 @@
219
219
  :placeholder="column.description"
220
220
  :transfer="true"
221
221
  @on-change="selected => onSelectDataChange(column, selected)"
222
+ @on-query-change="query => onComboQueryChange(column, query)"
223
+ @on-clear="loadOption(data, column, null)"
222
224
  >
223
225
  <Option v-for="item in getDataSource(data, column)" :key="item.id" :value="item.id">{{ item.name }}</Option>
224
226
  </Select>
@@ -1647,9 +1649,7 @@
1647
1649
  data = JSON.parse(value);
1648
1650
  }
1649
1651
 
1650
- setTimeout(() => {
1651
- this.loadComboDataLabel(model, column, data);
1652
- });
1652
+ this.loadComboDataLabel(model, column, data);
1653
1653
 
1654
1654
  return data;
1655
1655
  },
@@ -1660,7 +1660,7 @@
1660
1660
  }
1661
1661
 
1662
1662
  if (this.$refs['control_' + column.code] && data) {
1663
- let values = this.$refs['control_' + column.code][0].$data.values;
1663
+ let values = this.$refs['control_' + column.code][0].values;
1664
1664
 
1665
1665
  let pendings = [];
1666
1666
  if (column.controlType == 'MultiComboSelect') {
@@ -1668,7 +1668,7 @@
1668
1668
  if (!values.some(v => v.value == value)) {
1669
1669
  // 不在选中项中
1670
1670
  let newValue = { value, label: null, disabled: false };
1671
- values.push(newValue);
1671
+ this.$refs['control_' + column.code][0].values.push(newValue);
1672
1672
  pendings.push(newValue);
1673
1673
  }
1674
1674
  });
@@ -1682,35 +1682,43 @@
1682
1682
  }
1683
1683
 
1684
1684
  // 读取显示内容
1685
- if (pendings.length > 0) {
1686
- let param = this.getParam(model, column);
1687
- param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
1688
- let res;
1689
-
1690
- if (column.isSourceCustom) {
1691
- res = await customModelApi.query(column.source, param);
1692
- } else {
1693
- res = await modelApi.query(column.source, param);
1694
- }
1685
+ setTimeout(async () => {
1686
+ if (pendings.length > 0) {
1687
+ let param = this.getParam(model, column);
1688
+ param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
1689
+ let res;
1690
+
1691
+ if (column.isSourceCustom) {
1692
+ res = await customModelApi.query(column.source, param);
1693
+ } else {
1694
+ res = await modelApi.query(column.source, param);
1695
+ }
1695
1696
 
1696
- res.data.forEach(item => {
1697
- let v = this.parseData(item, column.sourceDataCode);
1698
- let label = this.parseData(item, column.sourceDisplayCode);
1697
+ res.data.forEach(item => {
1698
+ let v = this.parseData(item, column.sourceDataCode);
1699
+ let label = this.parseData(item, column.sourceDisplayCode);
1699
1700
 
1700
- if (column.controlType == 'ComboSelect') {
1701
- // 添加筛选内容
1702
- //this.$refs['control_' + column.code][0].$data.query = label;
1703
- }
1701
+ if (column.controlType == 'ComboSelect') {
1702
+ // 添加筛选内容
1703
+ //this.$refs['control_' + column.code][0].$data.query = label;
1704
+ }
1704
1705
 
1705
- let newValue = pendings.find(i => i.value == v);
1706
+ let newValue = pendings.find(i => i.value == v);
1706
1707
 
1707
- if (newValue) {
1708
- newValue.label = label;
1709
- }
1710
- });
1708
+ if (newValue) {
1709
+ newValue.label = label;
1710
+ }
1711
+ });
1711
1712
 
1712
- this.$forceUpdate();
1713
- }
1713
+ this.$forceUpdate();
1714
+ }
1715
+ });
1716
+ }
1717
+ },
1718
+ // 可筛选下拉框搜索条件变化
1719
+ onComboQueryChange(column, query) {
1720
+ if (!(query || '').trim()) {
1721
+ this.loadOption(this.data, column, null);
1714
1722
  }
1715
1723
  }
1716
1724
  }
@@ -110,7 +110,7 @@ export default {
110
110
  return this.userPermissions[key];
111
111
  } else {
112
112
  // 页面权限点
113
- let url = router.currentRoute.value.fullPath.substr(1);
113
+ let url = router.currentRoute.value.fullPath.substr(1).split('?')[0];
114
114
 
115
115
  if (this.userPermissions[url + '$' + key] == true) {
116
116
  return true;
@@ -413,7 +413,6 @@ export default {
413
413
  },
414
414
  // 根据表达式赋值(数组)
415
415
  setArrayData(model, expression, value) {
416
- console.log('setArrayData', expression, value);
417
416
  let data = '';
418
417
  if (value != null) {
419
418
  data = JSON.stringify(value);
@@ -301,13 +301,7 @@ export default {
301
301
 
302
302
  let permissions = {};
303
303
  res.permissions.forEach(key => {
304
- let permissionKey = key.split('?')[0];
305
-
306
- if (key.split('$').length > 1) {
307
- permissionKey = permissionKey + '$' + key.split('$')[1];
308
- }
309
-
310
- permissions[permissionKey] = true;
304
+ permissions[key.split('?')[0]] = true;
311
305
  });
312
306
 
313
307
  state.userPermissions = permissions;
@@ -52,7 +52,7 @@
52
52
  }
53
53
 
54
54
  .i-layout-page-header {
55
- margin-bottom: -80px;
55
+ margin: 0px -12px -80px -12px;
56
56
  }
57
57
 
58
58
  .i-layout-content-main {