mooho-base-admin-plus 2.8.7 → 2.8.9

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.8.7",
4
+ "version": "2.8.9",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -473,9 +473,9 @@
473
473
  this.disableLoader();
474
474
  let res;
475
475
  if (column.isSourceCustom) {
476
- res = await customModelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
476
+ res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
477
477
  } else {
478
- res = await modelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
478
+ res = await modelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
479
479
  }
480
480
  this.enableLoader();
481
481
 
@@ -647,9 +647,9 @@
647
647
  this.disableLoader();
648
648
  let res;
649
649
  if (column.isSourceCustom) {
650
- res = await customModelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
650
+ res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
651
651
  } else {
652
- res = await modelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
652
+ res = await modelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
653
653
  }
654
654
  this.enableLoader();
655
655
 
@@ -1054,102 +1054,6 @@
1054
1054
  item.needClear = true;
1055
1055
  });
1056
1056
  }
1057
- },
1058
- // 根据表达式取值(可筛选选择框)
1059
- parseComboData(model, column) {
1060
- let value = this.parseData(model, column.code);
1061
-
1062
- setTimeout(() => {
1063
- this.loadComboDataLabel(model, column, value);
1064
- });
1065
-
1066
- return value;
1067
- },
1068
- // 根据表达式取值(可筛选多选选择框)
1069
- parseMultiComboData(model, column) {
1070
- let data = [];
1071
- let value = this.parseData(model, column.code);
1072
-
1073
- if (this.isJSON(value)) {
1074
- data = JSON.parse(value);
1075
- }
1076
-
1077
- this.loadComboDataLabel(model, column, data);
1078
-
1079
- return data;
1080
- },
1081
- // 加载可筛选选择框显示内容
1082
- async loadComboDataLabel(model, column, data) {
1083
- if (column.isStaticItem || (column.dataType && column.dataType.startsWith('Enum:'))) {
1084
- return;
1085
- }
1086
-
1087
- if (this.$refs['control_' + column.code] && data) {
1088
- let values;
1089
- if (Array.isArray(this.$refs['control_' + column.code])) {
1090
- values = this.$refs['control_' + column.code][0].$data.values;
1091
- } else {
1092
- values = this.$refs['control_' + column.code].$data.values;
1093
- }
1094
-
1095
- let pendings = [];
1096
- if (column.controlType == 'MultiComboSelect') {
1097
- data.forEach(value => {
1098
- if (!values.some(v => v.value == value)) {
1099
- // 不在选中项中
1100
- let newValue = { value, label: null, disabled: false };
1101
- values.push(newValue);
1102
- pendings.push(newValue);
1103
- }
1104
- });
1105
- } else {
1106
- if (!values.some(v => v.value == data)) {
1107
- // 不在选中项中
1108
- let newValue = { value: data, label: null, disabled: false };
1109
- values.push(newValue);
1110
- pendings.push(newValue);
1111
- }
1112
- }
1113
-
1114
- // 读取显示内容
1115
- setTimeout(async () => {
1116
- if (pendings.length > 0) {
1117
- let param = this.getParam(model, column);
1118
- param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
1119
- let res;
1120
-
1121
- if (column.isSourceCustom) {
1122
- res = await customModelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
1123
- } else {
1124
- res = await modelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
1125
- }
1126
-
1127
- res.data.forEach(item => {
1128
- let v = this.parseData(item, column.sourceDataCode);
1129
- let label = this.parseData(item, column.sourceDisplayCode);
1130
-
1131
- if (column.controlType == 'ComboSelect') {
1132
- // 添加筛选内容
1133
- //this.$refs['control_' + column.code][0].$data.query = label;
1134
- }
1135
-
1136
- let newValue = pendings.find(i => i.value == v);
1137
-
1138
- if (newValue) {
1139
- newValue.label = label;
1140
- }
1141
- });
1142
-
1143
- this.$forceUpdate();
1144
- }
1145
- });
1146
- }
1147
- },
1148
- // 可筛选下拉框搜索条件变化
1149
- onComboQueryChange(column, query) {
1150
- if (!(query || '').trim()) {
1151
- this.loadOption(this.data, column, null);
1152
- }
1153
1057
  }
1154
1058
  }
1155
1059
  };
@@ -1166,9 +1166,9 @@
1166
1166
  this.disableLoader();
1167
1167
  let res;
1168
1168
  if (column.isSourceCustom) {
1169
- res = await customModelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
1169
+ res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
1170
1170
  } else {
1171
- res = await modelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
1171
+ res = await modelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
1172
1172
  }
1173
1173
  this.enableLoader();
1174
1174
 
@@ -1962,9 +1962,9 @@
1962
1962
  this.disableLoader();
1963
1963
  let res;
1964
1964
  if (column.isSourceCustom) {
1965
- res = await customModelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
1965
+ res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
1966
1966
  } else {
1967
- res = await modelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
1967
+ res = await modelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
1968
1968
  }
1969
1969
  this.enableLoader();
1970
1970
 
@@ -2836,93 +2836,6 @@
2836
2836
  item.needClear = true;
2837
2837
  });
2838
2838
  }
2839
- },
2840
- // 根据表达式取值(可筛选选择框)
2841
- parseComboData(model, column, index) {
2842
- let value = this.parseData(model, column.code);
2843
-
2844
- setTimeout(() => {
2845
- this.loadComboDataLabel(model, column, value, index);
2846
- });
2847
-
2848
- return value;
2849
- },
2850
- // 根据表达式取值(可筛选多选选择框)
2851
- parseMultiComboData(model, column, index) {
2852
- let data = [];
2853
- let value = this.parseData(model, column.code);
2854
-
2855
- if (this.isJSON(value)) {
2856
- data = JSON.parse(value);
2857
- }
2858
-
2859
- setTimeout(() => {
2860
- this.loadComboDataLabel(model, column, data, index);
2861
- });
2862
-
2863
- return data;
2864
- },
2865
- // 加载可筛选选择框显示内容
2866
- async loadComboDataLabel(model, column, data, index) {
2867
- if (column.isStaticItem || (column.dataType && column.dataType.startsWith('Enum:'))) {
2868
- return;
2869
- }
2870
-
2871
- // 取不到ref对象,无法给values赋值。所以可筛选选择框控件在table中暂时不可用
2872
- if (this.$refs['control_' + column.code + '_' + index] && data) {
2873
- let values = this.$refs['control_' + column.code + '_' + index].$data.values;
2874
-
2875
- let pendings = [];
2876
- if (column.controlType == 'MultiComboSelect') {
2877
- data.forEach(value => {
2878
- if (!values.some(v => v.value == value)) {
2879
- // 不在选中项中
2880
- let newValue = { value, label: null, disabled: false };
2881
- values.push(newValue);
2882
- pendings.push(newValue);
2883
- }
2884
- });
2885
- } else {
2886
- if (!values.some(v => v.value == data)) {
2887
- // 不在选中项中
2888
- let newValue = { value: data, label: null, disabled: false };
2889
- values.push(newValue);
2890
- pendings.push(newValue);
2891
- }
2892
- }
2893
-
2894
- // 读取显示内容
2895
- if (pendings.length > 0) {
2896
- let param = this.getParam(model, column);
2897
- param[column.sourceDataCode] = pendings.map(item => item.value).join(',');
2898
- let res;
2899
-
2900
- if (column.isSourceCustom) {
2901
- res = await customModelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
2902
- } else {
2903
- res = await modelApi.query(column.source, param, [column.sourceDataCode, column.sourceDisplayCode]);
2904
- }
2905
-
2906
- res.data.forEach(item => {
2907
- let v = this.parseData(item, column.sourceDataCode);
2908
- let label = this.parseData(item, column.sourceDisplayCode);
2909
-
2910
- if (column.controlType == 'ComboSelect') {
2911
- // 添加筛选内容
2912
- //this.$refs['control_' + column.code + '_' + index].$data.query = label;
2913
- //this.$refs['control_' + column.code + '_' + index].setQuery(label);
2914
- }
2915
-
2916
- let newValue = pendings.find(i => i.value == v);
2917
-
2918
- if (newValue) {
2919
- newValue.label = label;
2920
- }
2921
-
2922
- this.$forceUpdate();
2923
- });
2924
- }
2925
- }
2926
2839
  }
2927
2840
  }
2928
2841
  };
@@ -542,22 +542,6 @@ export default {
542
542
  }
543
543
  }
544
544
 
545
- // if (!!(expression || '').trim()) {
546
- // if (!isNaN(expression) || expression.substr(0, 1) == "'" || expression.substr(0, 1) == '"' || expression == 'null') {
547
- // result += expression;
548
- // } else {
549
- // let data = this.parseData(model, expression);
550
-
551
- // if (data == null) {
552
- // result += 'null';
553
- // } else if (isNaN(data) || data > 1416732604056469504) {
554
- // result += "'" + String(data) + "'";
555
- // } else {
556
- // result += String(data);
557
- // }
558
- // }
559
- // }
560
-
561
545
  let data = null;
562
546
  try {
563
547
  console.log('expression', text, result);
@@ -5,7 +5,10 @@
5
5
  </div>
6
6
  <Card :bordered="false" dis-hover class="ivu-mt">
7
7
  <view-table ref="table" v-if="page" :filter="filter" :create-enable="allow('create')" @create="create">
8
- <template #command="{ row }">
8
+ <template #filter>
9
+ <slot name="filter"></slot>
10
+ </template>
11
+ <template #command="{ row, index }">
9
12
  <Button
10
13
  size="small"
11
14
  v-if="row.application.status != 'Draft' && row.application.status != 'Rejected'"
@@ -22,6 +25,7 @@
22
25
  custom-icon="fa fa-edit"
23
26
  @click="$refs.form.open(row)"
24
27
  ></Button>
28
+ <slot name="command" :row="row" :index="index"></slot>
25
29
  </template>
26
30
  </view-table>
27
31
  </Card>