mooho-base-admin-plus 2.8.6 → 2.8.8
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/history.md +2 -0
- package/package/mooho-base-admin-plus.min.esm.js +9795 -7906
- package/package/mooho-base-admin-plus.min.js +88 -58
- package/package/style.css +1 -1
- package/package.json +2 -1
- package/src/api/user.js +4 -0
- package/src/components/upload/upload-attachment.vue +7 -0
- package/src/components/view/table-filter.vue +2 -2
- package/src/components/view/view-form-draggable.vue +2 -98
- package/src/components/view/view-form.vue +2 -2
- package/src/components/view/view-table.vue +2 -89
- package/src/libs/encrypt.js +12 -0
- package/src/setting.js +12 -0
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.
|
|
4
|
+
"version": "2.8.8",
|
|
5
5
|
"author": "jinyifan <jinyifan@mooho.com.cn>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"echarts": "^5.3.2",
|
|
21
21
|
"file-saver": "^2.0.2",
|
|
22
22
|
"js-cookie": "^3.0.1",
|
|
23
|
+
"jsencrypt": "^3.3.2",
|
|
23
24
|
"lodash": "^4.17.21",
|
|
24
25
|
"lowdb": "^1.0.0",
|
|
25
26
|
"screenfull": "^4.2.1",
|
package/src/api/user.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import request from '../libs/request';
|
|
2
|
+
import encrypt from '../libs/encrypt';
|
|
2
3
|
|
|
3
4
|
const res = 'User';
|
|
4
5
|
|
|
@@ -13,6 +14,7 @@ export default {
|
|
|
13
14
|
});
|
|
14
15
|
},
|
|
15
16
|
login(data) {
|
|
17
|
+
data.password = encrypt(data.password);
|
|
16
18
|
return request({
|
|
17
19
|
url: `api/${res}/login`,
|
|
18
20
|
method: 'post',
|
|
@@ -29,6 +31,8 @@ export default {
|
|
|
29
31
|
});
|
|
30
32
|
},
|
|
31
33
|
updatePassword(data) {
|
|
34
|
+
data.oldPassword = encrypt(data.oldPassword);
|
|
35
|
+
data.newPassword = encrypt(data.newPassword);
|
|
32
36
|
return request({
|
|
33
37
|
url: `api/${res}/updatePassword`,
|
|
34
38
|
method: 'post',
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
<Upload
|
|
4
|
+
ref="upload"
|
|
4
5
|
:action="uploadAction"
|
|
5
6
|
:headers="uploadHeaders"
|
|
6
7
|
:default-file-list="defaultList"
|
|
@@ -133,6 +134,12 @@
|
|
|
133
134
|
},
|
|
134
135
|
// 上传成功
|
|
135
136
|
onUploadSuccess(res, file) {
|
|
137
|
+
if (res.code != 0) {
|
|
138
|
+
this.error(res.message);
|
|
139
|
+
this.$refs.upload.fileList = this.$refs.upload.fileList.filter(item => item.uid != file.uid);
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
|
|
136
143
|
let list = this.fileList;
|
|
137
144
|
|
|
138
145
|
list.push({
|
|
@@ -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
|
|
476
|
+
res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
|
|
477
477
|
} else {
|
|
478
|
-
res = await modelApi.query(column.source, param
|
|
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
|
|
650
|
+
res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
|
|
651
651
|
} else {
|
|
652
|
-
res = await modelApi.query(column.source, param
|
|
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
|
|
1169
|
+
res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
|
|
1170
1170
|
} else {
|
|
1171
|
-
res = await modelApi.query(column.source, param
|
|
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
|
|
1965
|
+
res = await customModelApi.query(column.source, param); //, [column.sourceDataCode, column.sourceDisplayCode]);
|
|
1966
1966
|
} else {
|
|
1967
|
-
res = await modelApi.query(column.source, param
|
|
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
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import JSEncrypt from 'jsencrypt';
|
|
2
|
+
import setting from '../setting';
|
|
3
|
+
|
|
4
|
+
// 使用生成的密钥对进行加密
|
|
5
|
+
const encryptor = new JSEncrypt();
|
|
6
|
+
encryptor.setPublicKey(setting.encrypt.publicKey);
|
|
7
|
+
|
|
8
|
+
export default str => {
|
|
9
|
+
let encrypted = encryptor.encrypt(str);
|
|
10
|
+
|
|
11
|
+
return encrypted;
|
|
12
|
+
};
|
package/src/setting.js
CHANGED
|
@@ -175,6 +175,18 @@ const Setting = {
|
|
|
175
175
|
// 水印配置
|
|
176
176
|
options: {}
|
|
177
177
|
},
|
|
178
|
+
/**
|
|
179
|
+
* 加密配置
|
|
180
|
+
* */
|
|
181
|
+
encrypt: {
|
|
182
|
+
// 公钥
|
|
183
|
+
publicKey: `-----BEGIN PUBLIC KEY-----
|
|
184
|
+
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6q617CxtIUoK2qzxUFDpzpLnx
|
|
185
|
+
3UfwD1VfF5+ZZY1zDtd/CljGIbXvqyjeeAfSvnMYHMWrwakHFOev6W1+rW4Zt6UD
|
|
186
|
+
A2a/DmlGjIJfxXnX95Gp4hX/aBV12RTS2QYdVjoxHep/m3q7+JXD5fleLp2yvdCF
|
|
187
|
+
F5CPyToId81c4cawpQIDAQAB
|
|
188
|
+
-----END PUBLIC KEY-----`
|
|
189
|
+
},
|
|
178
190
|
/**
|
|
179
191
|
* 功能配置
|
|
180
192
|
* */
|