yxuse 3.0.41 → 3.0.43
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/README.md +12 -568
- package/lib/api.cjs.js +2 -1
- package/lib/api.cjs.js.map +1 -0
- package/lib/api.es.js +5 -4
- package/lib/api.es.js.map +1 -0
- package/lib/app.cjs.js +2 -1
- package/lib/app.cjs.js.map +1 -0
- package/lib/app.es.js +2 -1
- package/lib/app.es.js.map +1 -0
- package/lib/components.cjs.js +2 -1
- package/lib/components.cjs.js.map +1 -0
- package/lib/components.es.js +7 -6
- package/lib/components.es.js.map +1 -0
- package/lib/dayjs.min.cjs.js +2 -0
- package/lib/dayjs.min.cjs.js.map +1 -0
- package/lib/dayjs.min.es.js +313 -0
- package/lib/dayjs.min.es.js.gz +0 -0
- package/lib/dayjs.min.es.js.map +1 -0
- package/lib/directives.cjs.js +2 -1
- package/lib/directives.cjs.js.map +1 -0
- package/lib/directives.es.js +2 -1
- package/lib/directives.es.js.map +1 -0
- package/lib/hooks.cjs.js +2 -1
- package/lib/hooks.cjs.js.map +1 -0
- package/lib/hooks.es.js +2 -1
- package/lib/hooks.es.js.map +1 -0
- package/lib/index.cjs.js +2 -1
- package/lib/index.cjs.js.map +1 -0
- package/lib/index.cjs10.js +2 -1
- package/lib/index.cjs10.js.map +1 -0
- package/lib/index.cjs11.js +2 -1
- package/lib/index.cjs11.js.map +1 -0
- package/lib/index.cjs12.js +2 -1
- package/lib/index.cjs12.js.gz +0 -0
- package/lib/index.cjs12.js.map +1 -0
- package/lib/index.cjs13.js +2 -1
- package/lib/index.cjs13.js.map +1 -0
- package/lib/index.cjs14.js +2 -0
- package/lib/index.cjs14.js.map +1 -0
- package/lib/index.cjs2.js +2 -1
- package/lib/index.cjs2.js.map +1 -0
- package/lib/index.cjs3.js +2 -1
- package/lib/index.cjs3.js.map +1 -0
- package/lib/index.cjs4.js +2 -1
- package/lib/index.cjs4.js.map +1 -0
- package/lib/index.cjs5.js +7 -5
- package/lib/index.cjs5.js.gz +0 -0
- package/lib/index.cjs5.js.map +1 -0
- package/lib/index.cjs6.js +5 -1
- package/lib/index.cjs6.js.gz +0 -0
- package/lib/index.cjs6.js.map +1 -0
- package/lib/index.cjs7.js +17 -1
- package/lib/index.cjs7.js.gz +0 -0
- package/lib/index.cjs7.js.map +1 -0
- package/lib/index.cjs8.js +2 -1
- package/lib/index.cjs8.js.map +1 -0
- package/lib/index.cjs9.js +2 -1
- package/lib/index.cjs9.js.map +1 -0
- package/lib/index.es.js +8 -17
- package/lib/index.es.js.map +1 -0
- package/lib/index.es10.js +11 -298
- package/lib/index.es10.js.map +1 -0
- package/lib/index.es11.js +16 -2363
- package/lib/index.es11.js.map +1 -0
- package/lib/index.es12.js +2808 -151
- package/lib/index.es12.js.gz +0 -0
- package/lib/index.es12.js.map +1 -0
- package/lib/index.es13.js +231 -20
- package/lib/index.es13.js.map +1 -0
- package/lib/index.es14.js +23 -0
- package/lib/index.es14.js.map +1 -0
- package/lib/index.es2.js +101 -3
- package/lib/index.es2.js.map +1 -0
- package/lib/index.es3.js +3 -2
- package/lib/index.es3.js.map +1 -0
- package/lib/index.es4.js +3 -2
- package/lib/index.es4.js.map +1 -0
- package/lib/index.es5.js +14644 -135
- package/lib/index.es5.js.gz +0 -0
- package/lib/index.es5.js.map +1 -0
- package/lib/index.es6.js +20644 -603
- package/lib/index.es6.js.gz +0 -0
- package/lib/index.es6.js.map +1 -0
- package/lib/index.es7.js +5386 -17
- package/lib/index.es7.js.gz +0 -0
- package/lib/index.es7.js.map +1 -0
- package/lib/index.es8.js +25 -4
- package/lib/index.es8.js.map +1 -0
- package/lib/index.es9.js +5 -9
- package/lib/index.es9.js.map +1 -0
- package/lib/style.css +1 -1
- package/lib/style.css.gz +0 -0
- package/lib/theme.cjs.js +2 -1
- package/lib/theme.cjs.js.map +1 -0
- package/lib/theme.es.js +14 -11
- package/lib/theme.es.js.map +1 -0
- package/lib/translate.cjs.js +2 -1
- package/lib/translate.cjs.js.map +1 -0
- package/lib/translate.es.js +12 -6
- package/lib/translate.es.js.map +1 -0
- package/lib/utils.cjs.js +2 -1
- package/lib/utils.cjs.js.map +1 -0
- package/lib/utils.es.js +13 -7
- package/lib/utils.es.js.map +1 -0
- package/lib/yxIcon.cjs.js +2 -1
- package/lib/yxIcon.cjs.js.map +1 -0
- package/lib/yxIcon.es.js +3 -2
- package/lib/yxIcon.es.js.map +1 -0
- package/lib/yxi18n.cjs.js +2 -0
- package/lib/yxi18n.cjs.js.map +1 -0
- package/lib/yxi18n.es.js +6 -0
- package/lib/yxi18n.es.js.map +1 -0
- package/package.json +14 -6
- package/types/api/auth/index.d.ts +2 -0
- package/types/components/Common/DynamicComponent/index.vue.d.ts +5 -4
- package/types/components/Toolbar/index.d.ts +1 -0
- package/types/components/Toolbar/src/index.vue.d.ts +1 -1
- package/types/components/Toolbar/src/utils/mounted.d.ts +1 -0
- package/types/components/Update/index.d.ts +1 -1
- package/types/components/Update/index.vue.d.ts +1 -1
- package/types/components/YxDialog/index.d.ts +3 -3
- package/types/components/YxDialog/index.vue.d.ts +4 -3
- package/types/components/YxDrawer/index.d.ts +3 -0
- package/types/components/YxDrawer/index.vue.d.ts +14 -0
- package/types/components/YxDrawer/type.d.ts +18 -0
- package/types/components/YxForm/index.d.ts +3 -3
- package/types/components/YxForm/index.vue.d.ts +47 -0
- package/types/components/YxForm/type.d.ts +69 -0
- package/types/components/YxIcon/index.d.ts +3 -3
- package/types/components/YxIcon/type.d.ts +1 -0
- package/types/components/YxSearchForm/index.d.ts +3 -3
- package/types/components/YxSearchForm/index.vue.d.ts +8 -7
- package/types/components/YxTable/index.d.ts +3 -3
- package/types/components/YxTable/index.vue.d.ts +8 -8
- package/types/components/YxTable/type.d.ts +18 -6
- package/types/components/YxUpload/index.d.ts +3 -3
- package/types/components/YxUpload/index.vue.d.ts +7 -4
- package/types/components/YxUpload/type.d.ts +7 -1
- package/types/components/index.d.ts +9 -9
- package/types/components/type.d.ts +5 -5
- package/types/directives/index.d.ts +2 -1
- package/types/directives/modules/auth.d.ts +2 -1
- package/types/hooks/index.d.ts +1 -1
- package/types/hooks/useTime/index.d.ts +1 -1
- package/types/index.d.ts +12 -12
- package/types/theme/config.d.ts +2 -0
- package/types/theme/index.d.ts +2 -1
- package/types/translate/index.d.ts +3 -1
- package/types/utils/common/index.d.ts +20 -1
- package/types/utils/common/util.d.ts +2 -1
- package/types/utils/excel/index.d.ts +35 -0
- package/types/utils/fecth/index.d.ts +8 -0
- package/types/utils/fecth/interface.d.ts +8 -0
- package/types/utils/http/config.d.ts +1 -0
- package/types/utils/http/index.d.ts +2 -1
- package/types/utils/index.d.ts +4 -3
- package/types/utils/mqtt/index.d.ts +16 -0
- package/types/utils/mqtt/interface.d.ts +17 -0
- package/types/yxIcon/index.d.ts +2 -1
- package/types/yxi18n/index.d.ts +2 -4
- package/lib/index.cjs11.js.gz +0 -0
- package/lib/index.es10.js.gz +0 -0
- package/lib/index.es11.js.gz +0 -0
package/lib/index.es13.js
CHANGED
|
@@ -1,22 +1,233 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import { ElMessage } from "element-plus";
|
|
5
|
+
import "./index.es12.js";
|
|
6
|
+
import { d as dayjs } from "./dayjs.min.es.js";
|
|
7
|
+
const notifyMessageToSystems = (message) => {
|
|
8
|
+
const themeBc = new BroadcastChannel("YXUSE_BC");
|
|
9
|
+
themeBc.postMessage(message);
|
|
10
|
+
};
|
|
11
|
+
const receiveMessage = (callback) => {
|
|
12
|
+
const themeBc = new BroadcastChannel("YXUSE_BC");
|
|
13
|
+
themeBc.onmessage = () => {
|
|
14
|
+
callback();
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
const getSelectOptions = (arr, labelKey, valueKey, isValueToNumber) => {
|
|
18
|
+
if (!Array.isArray(arr)) return [];
|
|
19
|
+
return arr.map((item) => {
|
|
20
|
+
return {
|
|
21
|
+
label: item == null ? void 0 : item[labelKey],
|
|
22
|
+
value: isValueToNumber ? +item[valueKey] : item[valueKey]
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
const enumToArray = (enumObject) => {
|
|
27
|
+
const result = [];
|
|
28
|
+
for (const key in enumObject) {
|
|
29
|
+
if (isNaN(Number(key))) {
|
|
30
|
+
result.push({ label: key, value: enumObject[key] });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
const isDarkColor = (color) => {
|
|
36
|
+
const parseColor = (color2) => {
|
|
37
|
+
let r2 = 0, g2 = 0, b2 = 0, a = 1;
|
|
38
|
+
if (color2.startsWith("#")) {
|
|
39
|
+
color2 = color2.slice(1);
|
|
40
|
+
if (color2.length === 3) {
|
|
41
|
+
r2 = parseInt(color2[0] + color2[0], 16);
|
|
42
|
+
g2 = parseInt(color2[1] + color2[1], 16);
|
|
43
|
+
b2 = parseInt(color2[2] + color2[2], 16);
|
|
44
|
+
} else if (color2.length === 6) {
|
|
45
|
+
r2 = parseInt(color2.slice(0, 2), 16);
|
|
46
|
+
g2 = parseInt(color2.slice(2, 4), 16);
|
|
47
|
+
b2 = parseInt(color2.slice(4, 6), 16);
|
|
48
|
+
} else {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
} else if (color2.startsWith("rgb")) {
|
|
52
|
+
const rgbaMatch = color2.match(/(\d+(\.\d+)?)/g);
|
|
53
|
+
if (rgbaMatch) {
|
|
54
|
+
r2 = parseFloat(rgbaMatch[0]);
|
|
55
|
+
g2 = parseFloat(rgbaMatch[1]);
|
|
56
|
+
b2 = parseFloat(rgbaMatch[2]);
|
|
57
|
+
if (rgbaMatch.length > 3) {
|
|
58
|
+
a = parseFloat(rgbaMatch[3]);
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
return [r2, g2, b2, a];
|
|
67
|
+
};
|
|
68
|
+
const colorComponents = parseColor(color);
|
|
69
|
+
if (!colorComponents) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const [r, g, b, _] = colorComponents;
|
|
73
|
+
const normalizedR = r / 255;
|
|
74
|
+
const normalizedG = g / 255;
|
|
75
|
+
const normalizedB = b / 255;
|
|
76
|
+
const max = Math.max(normalizedR, normalizedG, normalizedB);
|
|
77
|
+
const min = Math.min(normalizedR, normalizedG, normalizedB);
|
|
78
|
+
let l = (max + min) / 2;
|
|
79
|
+
return l < 0.5;
|
|
80
|
+
};
|
|
81
|
+
const areColorsSimilar = (color1, color2, threshold = 100) => {
|
|
82
|
+
const getColorComponents = (color) => {
|
|
83
|
+
let r, g, b, a = 1;
|
|
84
|
+
if (color.startsWith("#")) {
|
|
85
|
+
color = color.slice(1);
|
|
86
|
+
if (color.length === 3) {
|
|
87
|
+
r = parseInt(color[0] + color[0], 16);
|
|
88
|
+
g = parseInt(color[1] + color[1], 16);
|
|
89
|
+
b = parseInt(color[2] + color[2], 16);
|
|
90
|
+
} else if (color.length === 6) {
|
|
91
|
+
r = parseInt(color.slice(0, 2), 16);
|
|
92
|
+
g = parseInt(color.slice(2, 4), 16);
|
|
93
|
+
b = parseInt(color.slice(4, 6), 16);
|
|
94
|
+
} else {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
} else if (color.startsWith("rgb")) {
|
|
98
|
+
const rgbaMatch = color.match(/(\d+(\.\d+)?)/g);
|
|
99
|
+
r = parseFloat(rgbaMatch[0]);
|
|
100
|
+
g = parseFloat(rgbaMatch[1]);
|
|
101
|
+
b = parseFloat(rgbaMatch[2]);
|
|
102
|
+
if (rgbaMatch.length > 3) {
|
|
103
|
+
a = parseFloat(rgbaMatch[3]);
|
|
104
|
+
}
|
|
105
|
+
} else {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return [r, g, b, a];
|
|
109
|
+
};
|
|
110
|
+
const color1Components = getColorComponents(color1);
|
|
111
|
+
const color2Components = getColorComponents(color2);
|
|
112
|
+
if (!color1Components || !color2Components) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
const euclideanDistance = Math.sqrt(
|
|
116
|
+
Math.pow(color1Components[0] - color2Components[0], 2) + Math.pow(color1Components[1] - color2Components[1], 2) + Math.pow(color1Components[2] - color2Components[2], 2) + Math.pow(color1Components[3] - color2Components[3], 2)
|
|
117
|
+
);
|
|
118
|
+
return euclideanDistance <= threshold;
|
|
119
|
+
};
|
|
120
|
+
const isColorEqual = (color1, color2) => {
|
|
121
|
+
function toRGBA(color) {
|
|
122
|
+
if (color.toLowerCase().startsWith("rgba")) {
|
|
123
|
+
return color.toLowerCase();
|
|
124
|
+
} else if (color.toLowerCase().startsWith("rgb")) {
|
|
125
|
+
return color.replace("rgb", "rgba").replace(")", ", 1)");
|
|
126
|
+
} else if (color.length === 7) {
|
|
127
|
+
const r = parseInt(color.substring(1, 3), 16);
|
|
128
|
+
const g = parseInt(color.substring(3, 5), 16);
|
|
129
|
+
const b = parseInt(color.substring(5, 7), 16);
|
|
130
|
+
return `rgba(${r}, ${g}, ${b}, 1)`;
|
|
131
|
+
} else if (color.length === 9 && color.toLowerCase().startsWith("rrggbbaa")) {
|
|
132
|
+
const r = parseInt(color.substring(1, 3), 16);
|
|
133
|
+
const g = parseInt(color.substring(3, 5), 16);
|
|
134
|
+
const b = parseInt(color.substring(5, 7), 16);
|
|
135
|
+
const a = Math.round(parseInt(color.substring(7, 9), 16) / 255 * 100) / 100;
|
|
136
|
+
return `rgba(${r}, ${g}, ${b}, ${a})`;
|
|
137
|
+
} else {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const rgbaColor1 = toRGBA(convertShortHexToLongHex(color1));
|
|
142
|
+
const rgbaColor2 = toRGBA(convertShortHexToLongHex(color2));
|
|
143
|
+
if (!rgbaColor1 || !rgbaColor2) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
return rgbaColor1 === rgbaColor2;
|
|
147
|
+
};
|
|
148
|
+
const convertShortHexToLongHex = (shortHex) => {
|
|
149
|
+
if (shortHex.length === 4 && shortHex[0] === "#") {
|
|
150
|
+
const r = shortHex[1];
|
|
151
|
+
const g = shortHex[2];
|
|
152
|
+
const b = shortHex[3];
|
|
153
|
+
const longHex = `#${r}${r}${g}${g}${b}${b}`;
|
|
154
|
+
return longHex;
|
|
155
|
+
} else {
|
|
156
|
+
return shortHex;
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
const yxMessage = (data, callback, isShowError = true) => {
|
|
160
|
+
if (data.isSuccess) {
|
|
161
|
+
ElMessage.success(data.resultMsg || "操作成功");
|
|
162
|
+
callback && callback();
|
|
163
|
+
} else {
|
|
164
|
+
if (isShowError) {
|
|
165
|
+
ElMessage.error(data.resultMsg || "操作失败");
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
const copyText = (text) => {
|
|
170
|
+
const textField = document.createElement("textarea");
|
|
171
|
+
textField.innerText = text;
|
|
172
|
+
document.body.appendChild(textField);
|
|
173
|
+
textField.select();
|
|
174
|
+
document.execCommand("copy");
|
|
175
|
+
textField.remove();
|
|
176
|
+
ElMessage.success("路径已成功复制到剪贴板");
|
|
177
|
+
};
|
|
178
|
+
const getCownDownTime = (time) => {
|
|
179
|
+
const diffTimeSecond = dayjs(time).diff(dayjs(), "second");
|
|
180
|
+
let formattedTime = "00:00:00";
|
|
181
|
+
if (diffTimeSecond > 0) {
|
|
182
|
+
const hours = Math.floor(diffTimeSecond / 3600);
|
|
183
|
+
const minutes = Math.floor(diffTimeSecond % 3600 / 60);
|
|
184
|
+
const seconds = diffTimeSecond % 60;
|
|
185
|
+
formattedTime = `${hours.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}:${seconds.toString().padStart(2, "0")}`;
|
|
186
|
+
}
|
|
187
|
+
return formattedTime;
|
|
188
|
+
};
|
|
189
|
+
class YxSubscribe {
|
|
190
|
+
constructor() {
|
|
191
|
+
__publicField(this, "subscribers");
|
|
192
|
+
this.subscribers = {};
|
|
193
|
+
}
|
|
194
|
+
subscribe(sub, fn) {
|
|
195
|
+
if (!this.subscribers[sub]) {
|
|
196
|
+
this.subscribers[sub] = [];
|
|
197
|
+
}
|
|
198
|
+
this.subscribers[sub].push(fn);
|
|
199
|
+
}
|
|
200
|
+
unsubscribe(sub, fn) {
|
|
201
|
+
const subscribers = this.subscribers[sub];
|
|
202
|
+
if (!fn) return this.subscribers[sub] = [];
|
|
203
|
+
if (subscribers) {
|
|
204
|
+
const index = subscribers.indexOf(fn);
|
|
205
|
+
if (index !== -1) {
|
|
206
|
+
subscribers.splice(index, 1);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
publish(message) {
|
|
211
|
+
const subscribers = this.subscribers[message.type];
|
|
212
|
+
if (subscribers) {
|
|
213
|
+
subscribers.forEach((fn) => {
|
|
214
|
+
fn(message.data);
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
const yxSubscribe = new YxSubscribe();
|
|
17
220
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
221
|
+
areColorsSimilar as a,
|
|
222
|
+
getSelectOptions as b,
|
|
223
|
+
copyText as c,
|
|
224
|
+
isDarkColor as d,
|
|
225
|
+
enumToArray as e,
|
|
226
|
+
yxSubscribe as f,
|
|
227
|
+
getCownDownTime as g,
|
|
228
|
+
isColorEqual as i,
|
|
229
|
+
notifyMessageToSystems as n,
|
|
230
|
+
receiveMessage as r,
|
|
231
|
+
yxMessage as y
|
|
22
232
|
};
|
|
233
|
+
//# sourceMappingURL=index.es13.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es13.js","sources":["../packages/utils/common/index.ts","../packages/utils/subscribe/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2023-09-13 16:21:13\n * @LastEditors: WangXin\n * @LastEditTime: 2025-04-25 14:51:05\n * @FilePath: /yxuse/packages/utils/common/index.ts\n * @Description:\n *\n * Copyright (c) 2023 by YuXing, All Rights Reserved.\n */\nimport { ElMessage } from \"element-plus\";\nimport dayjs from \"dayjs\";\n/**\n * @description 给各分系统发送消息\n * @param data 发送的消息\n */\ninterface Message {\n\ttype: string; //消息类型\n\tdata: any; //消息data\n}\nexport const notifyMessageToSystems = (message: Message) => {\n\tconst themeBc = new BroadcastChannel(\"YXUSE_BC\");\n\tthemeBc.postMessage(message);\n};\n/**\n * @description 接收系统消息\n * @param callback 接收后的回调\n */\nexport const receiveMessage = (callback: Function) => {\n\tconst themeBc = new BroadcastChannel(\"YXUSE_BC\");\n\tthemeBc.onmessage = () => {\n\t\tcallback();\n\t};\n};\n\n/**\n * @param arr 处理的参数\n * @param labelKey label的key\n * @param valueKey value的key\n * @param isValueToNumber 是否将value转为number\n * @return [{label:\"\",value:\"\"}]\n */\nexport const getSelectOptions = (\n\tarr: [],\n\tlabelKey: string,\n\tvalueKey: string,\n\tisValueToNumber?: boolean\n): { label: string; value: string | number }[] => {\n\tif (!Array.isArray(arr)) return [];\n\treturn arr.map(item => {\n\t\treturn {\n\t\t\tlabel: item?.[labelKey],\n\t\t\tvalue: isValueToNumber ? +item[valueKey] : item[valueKey]\n\t\t};\n\t});\n};\n\n/**\n * @param enumObject 处理的枚举类\n */\nexport const enumToArray = <T extends Record<string, string | number>>(\n\tenumObject: T\n): { label: string; value: string | number }[] => {\n\tconst result: { label: string; value: string | number }[] = [];\n\tfor (const key in enumObject) {\n\t\tif (isNaN(Number(key))) {\n\t\t\tresult.push({ label: key, value: enumObject[key] });\n\t\t}\n\t}\n\treturn result;\n};\n\n/**\n * @description 判断该色值是否是深色\n * @param color 色值\n */\nexport const isDarkColor = (color: string) => {\n\tconst parseColor = (color: string): [number, number, number, number] | null => {\n\t\tlet r = 0,\n\t\t\tg = 0,\n\t\t\tb = 0,\n\t\t\ta = 1;\n\t\tif (color.startsWith(\"#\")) {\n\t\t\t// 解析十六进制颜色值\n\t\t\tcolor = color.slice(1);\n\t\t\tif (color.length === 3) {\n\t\t\t\tr = parseInt(color[0] + color[0], 16);\n\t\t\t\tg = parseInt(color[1] + color[1], 16);\n\t\t\t\tb = parseInt(color[2] + color[2], 16);\n\t\t\t} else if (color.length === 6) {\n\t\t\t\tr = parseInt(color.slice(0, 2), 16);\n\t\t\t\tg = parseInt(color.slice(2, 4), 16);\n\t\t\t\tb = parseInt(color.slice(4, 6), 16);\n\t\t\t} else {\n\t\t\t\t// 非法的颜色值\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else if (color.startsWith(\"rgb\")) {\n\t\t\t// 解析 RGB 或 RGBA 格式的颜色值\n\t\t\tconst rgbaMatch = color.match(/(\\d+(\\.\\d+)?)/g);\n\t\t\tif (rgbaMatch) {\n\t\t\t\tr = parseFloat(rgbaMatch[0]);\n\t\t\t\tg = parseFloat(rgbaMatch[1]);\n\t\t\t\tb = parseFloat(rgbaMatch[2]);\n\t\t\t\tif (rgbaMatch.length > 3) {\n\t\t\t\t\ta = parseFloat(rgbaMatch[3]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else {\n\t\t\treturn null; // 非法的颜色值\n\t\t}\n\t\treturn [r, g, b, a];\n\t};\n\n\tconst colorComponents = parseColor(color);\n\n\tif (!colorComponents) {\n\t\treturn null; // 非法的颜色值\n\t}\n\n\tconst [r, g, b, _] = colorComponents;\n\n\t// 转换为 HSL 颜色空间\n\tconst normalizedR = r / 255;\n\tconst normalizedG = g / 255;\n\tconst normalizedB = b / 255;\n\tconst max = Math.max(normalizedR, normalizedG, normalizedB);\n\tconst min = Math.min(normalizedR, normalizedG, normalizedB);\n\tlet h,\n\t\ts,\n\t\tl = (max + min) / 2;\n\n\tif (max === min) {\n\t\th = s = 0; // 灰色\n\t} else {\n\t\tconst d = max - min;\n\t\ts = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n\t\tswitch (max) {\n\t\t\tcase normalizedR:\n\t\t\t\th = (normalizedG - normalizedB) / d + (normalizedG < normalizedB ? 6 : 0);\n\t\t\t\tbreak;\n\t\t\tcase normalizedG:\n\t\t\t\th = (normalizedB - normalizedR) / d + 2;\n\t\t\t\tbreak;\n\t\t\tcase normalizedB:\n\t\t\t\th = (normalizedR - normalizedG) / d + 4;\n\t\t\t\tbreak;\n\t\t}\n\t\th /= 6;\n\t}\n\n\t// 根据亮度判断是深色还是浅色\n\treturn l < 0.5; // 深色为 true,浅色为 false\n};\n\n/**\n * @description 判断两个色值是否为相近色\n * @param color1 第一个色值\n * @param color2 第二个色值\n * @param threshold 阈值,用于判断两个颜色是否相近\n */\nexport const areColorsSimilar = (color1: string, color2: string, threshold: number = 100): boolean => {\n\tconst getColorComponents = (color: string): [number, number, number, number] | null => {\n\t\tlet r,\n\t\t\tg,\n\t\t\tb,\n\t\t\ta = 1;\n\t\tif (color.startsWith(\"#\")) {\n\t\t\tcolor = color.slice(1);\n\t\t\tif (color.length === 3) {\n\t\t\t\tr = parseInt(color[0] + color[0], 16);\n\t\t\t\tg = parseInt(color[1] + color[1], 16);\n\t\t\t\tb = parseInt(color[2] + color[2], 16);\n\t\t\t} else if (color.length === 6) {\n\t\t\t\tr = parseInt(color.slice(0, 2), 16);\n\t\t\t\tg = parseInt(color.slice(2, 4), 16);\n\t\t\t\tb = parseInt(color.slice(4, 6), 16);\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t} else if (color.startsWith(\"rgb\")) {\n\t\t\tconst rgbaMatch = color.match(/(\\d+(\\.\\d+)?)/g) as string[];\n\t\t\tr = parseFloat(rgbaMatch[0]);\n\t\t\tg = parseFloat(rgbaMatch[1]);\n\t\t\tb = parseFloat(rgbaMatch[2]);\n\t\t\tif (rgbaMatch.length > 3) {\n\t\t\t\ta = parseFloat(rgbaMatch[3]);\n\t\t\t}\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t\treturn [r, g, b, a];\n\t};\n\n\tconst color1Components = getColorComponents(color1);\n\tconst color2Components = getColorComponents(color2);\n\n\tif (!color1Components || !color2Components) {\n\t\treturn false; // 非法的颜色值\n\t}\n\n\tconst euclideanDistance = Math.sqrt(\n\t\tMath.pow(color1Components[0] - color2Components[0], 2) +\n\t\t\tMath.pow(color1Components[1] - color2Components[1], 2) +\n\t\t\tMath.pow(color1Components[2] - color2Components[2], 2) +\n\t\t\tMath.pow(color1Components[3] - color2Components[3], 2)\n\t);\n\tconsole.log(euclideanDistance);\n\n\treturn euclideanDistance <= threshold;\n};\n\n//判断两个色值是否相等\nexport const isColorEqual = (color1: string, color2: string) => {\n\tfunction toRGBA(color: string) {\n\t\tif (color.toLowerCase().startsWith(\"rgba\")) {\n\t\t\t// 如果是 RGBA 格式,则直接返回\n\t\t\treturn color.toLowerCase();\n\t\t} else if (color.toLowerCase().startsWith(\"rgb\")) {\n\t\t\t// 如果是 RGB 格式,则转换为 RGBA 格式,alpha 默认为 1\n\t\t\treturn color.replace(\"rgb\", \"rgba\").replace(\")\", \", 1)\");\n\t\t} else if (color.length === 7) {\n\t\t\t// 如果是十六进制格式,则转换为 RGBA 格式,alpha 默认为 1\n\t\t\tconst r = parseInt(color.substring(1, 3), 16);\n\t\t\tconst g = parseInt(color.substring(3, 5), 16);\n\t\t\tconst b = parseInt(color.substring(5, 7), 16);\n\t\t\treturn `rgba(${r}, ${g}, ${b}, 1)`;\n\t\t} else if (color.length === 9 && color.toLowerCase().startsWith(\"rrggbbaa\")) {\n\t\t\t// 如果是 RRGGBBAA 十六进制格式,则转换为 RGBA 格式\n\t\t\tconst r = parseInt(color.substring(1, 3), 16);\n\t\t\tconst g = parseInt(color.substring(3, 5), 16);\n\t\t\tconst b = parseInt(color.substring(5, 7), 16);\n\t\t\tconst a = Math.round((parseInt(color.substring(7, 9), 16) / 255) * 100) / 100; // 转换 alpha 值\n\t\t\treturn `rgba(${r}, ${g}, ${b}, ${a})`;\n\t\t} else {\n\t\t\t// 其他情况视为无效颜色值\n\t\t\treturn null;\n\t\t}\n\t}\n\n\tconst rgbaColor1 = toRGBA(convertShortHexToLongHex(color1));\n\tconst rgbaColor2 = toRGBA(convertShortHexToLongHex(color2));\n\t// 如果转换失败,则返回 false\n\tif (!rgbaColor1 || !rgbaColor2) {\n\t\treturn false;\n\t}\n\n\t// 比较两个 RGBA 格式的颜色值是否相等\n\treturn rgbaColor1 === rgbaColor2;\n};\n\nconst convertShortHexToLongHex = (shortHex: string) => {\n\tif (shortHex.length === 4 && shortHex[0] === \"#\") {\n\t\t// 提取每个字符\n\t\tconst r = shortHex[1];\n\t\tconst g = shortHex[2];\n\t\tconst b = shortHex[3];\n\t\t// 转换为6位十六进制表示\n\t\tconst longHex = `#${r}${r}${g}${g}${b}${b}`;\n\t\treturn longHex;\n\t} else {\n\t\t// 如果不是3位十六进制表示,直接返回原始值\n\t\treturn shortHex;\n\t}\n};\n\n/**\n * @param data //后端返回的数据\n * @param isShowError //是否显示后端服务的报错信息\n * @param callback //回调\n * @description 消息提示\n */\n\nexport const yxMessage = (data: any, callback?: Function, isShowError = true) => {\n\tif (data.isSuccess) {\n\t\tElMessage.success(data.resultMsg || \"操作成功\");\n\t\tcallback && callback();\n\t} else {\n\t\tif (isShowError) {\n\t\t\tElMessage.error(data.resultMsg || \"操作失败\");\n\t\t}\n\t}\n};\n\n/**\n * @param text 要复制的文本\n * @description 复制文本到剪贴板\n * @return void\n */\nexport const copyText = (text: string) => {\n\tconst textField = document.createElement(\"textarea\");\n\ttextField.innerText = text;\n\tdocument.body.appendChild(textField);\n\ttextField.select();\n\tdocument.execCommand(\"copy\");\n\ttextField.remove();\n\tElMessage.success(\"路径已成功复制到剪贴板\");\n};\n\n/**\n * @param time 时间\n * @description 将传入的时间转为距离当前时间的 时 分 秒 的字符串\n * @return void\n */\nexport const getCownDownTime = (time: string) => {\n\tconst diffTimeSecond = dayjs(time).diff(dayjs(), \"second\");\n\tlet formattedTime = \"00:00:00\";\n\tif (diffTimeSecond > 0) {\n\t\tconst hours = Math.floor(diffTimeSecond / 3600);\n\t\tconst minutes = Math.floor((diffTimeSecond % 3600) / 60);\n\t\tconst seconds = diffTimeSecond % 60;\n\t\tformattedTime = `${hours.toString().padStart(2, \"0\")}:${minutes.toString().padStart(2, \"0\")}:${seconds\n\t\t\t.toString()\n\t\t\t.padStart(2, \"0\")}`;\n\t}\n\n\treturn formattedTime;\n};\n","/*\n * @Author: WangXin\n * @Date: 2024-01-01 10:33:25\n * @LastEditors: WangXin\n * @LastEditTime: 2024-01-03 10:59:31\n * @FilePath: \\yxUse\\packages\\utils\\subscribe\\index.ts\n * @Description:\n *\n * Copyright (c) 2024 by YuXing, All Rights Reserved.\n */\ninterface Message {\n\ttype: string;\n\tdata: any;\n}\ninterface Subscribe {\n\t[key: string]: Function[];\n}\nclass YxSubscribe {\n\tprivate subscribers: Subscribe;\n\tconstructor() {\n\t\tthis.subscribers = {};\n\t}\n\tsubscribe(sub: string, fn: Function) {\n\t\tif (!this.subscribers[sub]) {\n\t\t\tthis.subscribers[sub] = [];\n\t\t}\n\t\tthis.subscribers[sub].push(fn);\n\t}\n\tunsubscribe(sub: string, fn?: Function) {\n\t\tconst subscribers = this.subscribers[sub];\n\t\tif (!fn) return (this.subscribers[sub] = []);\n\t\tif (subscribers) {\n\t\t\tconst index = subscribers.indexOf(fn);\n\t\t\tif (index !== -1) {\n\t\t\t\tsubscribers.splice(index, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublish(message: Message) {\n\t\tconst subscribers = this.subscribers[message.type];\n\t\tif (subscribers) {\n\t\t\tsubscribers.forEach(fn => {\n\t\t\t\tfn(message.data);\n\t\t\t});\n\t\t}\n\t}\n}\n\nexport default new YxSubscribe();\n"],"names":["color","r","g","b"],"mappings":";;;;;;AAoBa,MAAA,yBAAyB,CAAC,YAAqB;AACrD,QAAA,UAAU,IAAI,iBAAiB,UAAU;AAC/C,UAAQ,YAAY,OAAO;AAC5B;AAKa,MAAA,iBAAiB,CAAC,aAAuB;AAC/C,QAAA,UAAU,IAAI,iBAAiB,UAAU;AAC/C,UAAQ,YAAY,MAAM;AAChB,aAAA;AAAA,EACV;AACD;AASO,MAAM,mBAAmB,CAC/B,KACA,UACA,UACA,oBACiD;AACjD,MAAI,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC;AAC1B,SAAA,IAAI,IAAI,CAAQ,SAAA;AACf,WAAA;AAAA,MACN,OAAO,6BAAO;AAAA,MACd,OAAO,kBAAkB,CAAC,KAAK,QAAQ,IAAI,KAAK,QAAQ;AAAA,IACzD;AAAA,EAAA,CACA;AACF;AAKa,MAAA,cAAc,CAC1B,eACiD;AACjD,QAAM,SAAsD,CAAC;AAC7D,aAAW,OAAO,YAAY;AAC7B,QAAI,MAAM,OAAO,GAAG,CAAC,GAAG;AAChB,aAAA,KAAK,EAAE,OAAO,KAAK,OAAO,WAAW,GAAG,GAAG;AAAA,IAAA;AAAA,EACnD;AAEM,SAAA;AACR;AAMa,MAAA,cAAc,CAAC,UAAkB;AACvC,QAAA,aAAa,CAACA,WAA2D;AAC9E,QAAIC,KAAI,GACPC,KAAI,GACJC,KAAI,GACJ,IAAI;AACDH,QAAAA,OAAM,WAAW,GAAG,GAAG;AAE1BA,eAAQA,OAAM,MAAM,CAAC;AACjBA,UAAAA,OAAM,WAAW,GAAG;AACvBC,aAAI,SAASD,O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IAAI,QAAQ,SAAA,EAAW,SAAS,GAAG,GAAG,CAAC,IAAI,QAC7F,SACA,EAAA,SAAS,GAAG,GAAG,CAAC;AAAA,EAAA;AAGZ,SAAA;AACR;AC9SA,MAAM,YAAY;AAAA,EAEjB,cAAc;AADN;AAEP,SAAK,cAAc,CAAC;AAAA,EAAA;AAAA,EAErB,UAAU,KAAa,IAAc;AACpC,QAAI,CAAC,KAAK,YAAY,GAAG,GAAG;AACtB,WAAA,YAAY,GAAG,IAAI,CAAC;AAAA,IAAA;AAE1B,SAAK,YAAY,GAAG,EAAE,KAAK,EAAE;AAAA,EAAA;AAAA,EAE9B,YAAY,KAAa,IAAe;AACjC,UAAA,cAAc,KAAK,YAAY,GAAG;AACxC,QAAI,CAAC,GAAI,QAAQ,KAAK,YAAY,GAAG,IAAI,CAAC;AAC1C,QAAI,aAAa;AACV,YAAA,QAAQ,YAAY,QAAQ,EAAE;AACpC,UAAI,UAAU,IAAI;AACL,oBAAA,OAAO,OAAO,CAAC;AAAA,MAAA;AAAA,IAC5B;AAAA,EACD;AAAA,EAGD,QAAQ,SAAkB;AACzB,UAAM,cAAc,KAAK,YAAY,QAAQ,IAAI;AACjD,QAAI,aAAa;AAChB,kBAAY,QAAQ,CAAM,OAAA;AACzB,WAAG,QAAQ,IAAI;AAAA,MAAA,CACf;AAAA,IAAA;AAAA,EACF;AAEF;AAEA,MAAe,cAAA,IAAI,YAAY;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { a as http, U as URL } from "./index.es12.js";
|
|
2
|
+
const uploadResourceApi = (params, config) => http.post(`${URL["ttc"].INTEGRATED_BASE_URL}/file/upload`, params, config);
|
|
3
|
+
const getGroupListApi = () => http.get(
|
|
4
|
+
`${URL["ttc"].INTEGRATED_BASE_URL}/resource/group/list`,
|
|
5
|
+
{},
|
|
6
|
+
{
|
|
7
|
+
headers: { noLoading: true }
|
|
8
|
+
}
|
|
9
|
+
);
|
|
10
|
+
const getResourceListApi = (groupUuid, sign) => http.get(`${URL["ttc"].INTEGRATED_BASE_URL}/resource/file/list/${sign}/${groupUuid}`, {}, { headers: { noLoading: true } });
|
|
11
|
+
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
12
|
+
__proto__: null,
|
|
13
|
+
getGroupListApi,
|
|
14
|
+
getResourceListApi,
|
|
15
|
+
uploadResourceApi
|
|
16
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
export {
|
|
18
|
+
getResourceListApi as a,
|
|
19
|
+
getGroupListApi as g,
|
|
20
|
+
index as i,
|
|
21
|
+
uploadResourceApi as u
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.es14.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es14.js","sources":["../packages/api/modules/assets/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2024-04-11 11:09:04\n * @LastEditors: WangXin\n * @LastEditTime: 2024-08-16 10:16:23\n * @FilePath: /yxuse/packages/api/modules/assets/index.ts\n * @Description:\n *\n * Copyright (c) 2024 by YuXing, All Rights Reserved.\n */\nimport http from \"@packages/utils/http\";\nimport { URL } from \"@packages/config\";\n\nexport const uploadResourceApi = (params: FormData, config?: Object) =>\n\thttp.post(`${URL[\"ttc\"].INTEGRATED_BASE_URL}/file/upload`, params, config);\n\n//获取资源分组\nexport const getGroupListApi = () =>\n\thttp.get(\n\t\t`${URL[\"ttc\"].INTEGRATED_BASE_URL}/resource/group/list`,\n\t\t{},\n\t\t{\n\t\t\theaders: { noLoading: true }\n\t\t}\n\t);\n//获取icon的配置\nexport const getResourceListApi = (groupUuid: string, sign: number) =>\n\thttp.get(`${URL[\"ttc\"].INTEGRATED_BASE_URL}/resource/file/list/${sign}/${groupUuid}`, {}, { headers: { noLoading: true } });\n"],"names":[],"mappings":";AAaO,MAAM,oBAAoB,CAAC,QAAkB,WACnD,KAAK,KAAK,GAAG,IAAI,KAAK,EAAE,mBAAmB,gBAAgB,QAAQ,MAAM;AAG7D,MAAA,kBAAkB,MAC9B,KAAK;AAAA,EACJ,GAAG,IAAI,KAAK,EAAE,mBAAmB;AAAA,EACjC,CAAC;AAAA,EACD;AAAA,IACC,SAAS,EAAE,WAAW,KAAK;AAAA,EAAA;AAE7B;AAEY,MAAA,qBAAqB,CAAC,WAAmB,SACrD,KAAK,IAAI,GAAG,IAAI,KAAK,EAAE,mBAAmB,uBAAuB,IAAI,IAAI,SAAS,IAAI,CAAA,GAAI,EAAE,SAAS,EAAE,WAAW,OAAQ,CAAA;;;;;;;"}
|
package/lib/index.es2.js
CHANGED
|
@@ -1,17 +1,115 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __async = (__this, __arguments, generator) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
step(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var rejected = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.throw(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
import { g as getToken, s as showFullScreenLoading, h as hideFullScreenLoading, c as checkStatus, a as http } from "./index.es12.js";
|
|
38
|
+
import { a as areColorsSimilar, c as copyText, e as enumToArray, g as getCownDownTime, b as getSelectOptions, i as isColorEqual, d as isDarkColor, n as notifyMessageToSystems, r as receiveMessage, y as yxMessage, f as yxSubscribe } from "./index.es13.js";
|
|
39
|
+
import "element-plus";
|
|
40
|
+
function buildQuery(params) {
|
|
41
|
+
if (!params) return "";
|
|
42
|
+
const query = new URLSearchParams();
|
|
43
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
44
|
+
if (value !== void 0 && value !== null) {
|
|
45
|
+
query.append(key, String(value));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return `?${query.toString()}`;
|
|
49
|
+
}
|
|
50
|
+
function baseRequest(_0, _1, _2) {
|
|
51
|
+
return __async(this, arguments, function* (url, method, data, config = {}) {
|
|
52
|
+
const { headers = {}, responseType = "json", signal, noAuth = false } = config;
|
|
53
|
+
const fullUrl = method === "GET" ? `${url}${buildQuery(data)}` : `${url}`;
|
|
54
|
+
const token = getToken();
|
|
55
|
+
if (!config.noLoading) {
|
|
56
|
+
showFullScreenLoading();
|
|
57
|
+
}
|
|
58
|
+
const res = yield fetch(fullUrl, {
|
|
59
|
+
method,
|
|
60
|
+
headers: __spreadValues(__spreadValues({
|
|
61
|
+
"Content-Type": "application/json"
|
|
62
|
+
}, token && !noAuth ? { token } : ""), headers),
|
|
63
|
+
body: method !== "GET" && data ? JSON.stringify(data) : void 0,
|
|
64
|
+
signal
|
|
65
|
+
});
|
|
66
|
+
hideFullScreenLoading();
|
|
67
|
+
if (!res.ok) {
|
|
68
|
+
let errorMessage = "";
|
|
69
|
+
try {
|
|
70
|
+
const errorData = yield res.json();
|
|
71
|
+
if (errorData == null ? void 0 : errorData.resultMsg) {
|
|
72
|
+
errorMessage = errorData.resultMsg;
|
|
73
|
+
}
|
|
74
|
+
} catch (_) {
|
|
75
|
+
}
|
|
76
|
+
checkStatus(res.status, errorMessage);
|
|
77
|
+
throw new Error(errorMessage);
|
|
78
|
+
}
|
|
79
|
+
switch (responseType) {
|
|
80
|
+
case "text":
|
|
81
|
+
return res.text();
|
|
82
|
+
case "blob":
|
|
83
|
+
return res.blob();
|
|
84
|
+
default:
|
|
85
|
+
return res.json();
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
const yxFecth = {
|
|
90
|
+
get: (url, params, config) => baseRequest(url, "GET", params, config),
|
|
91
|
+
post: (url, data, config) => baseRequest(url, "POST", data, config),
|
|
92
|
+
put: (url, data, config) => baseRequest(url, "PUT", data, config),
|
|
93
|
+
delete: (url, data, config) => baseRequest(url, "DELETE", data, config)
|
|
94
|
+
};
|
|
3
95
|
const utils2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4
96
|
__proto__: null,
|
|
5
97
|
areColorsSimilar,
|
|
98
|
+
copyText,
|
|
6
99
|
enumToArray,
|
|
100
|
+
getCownDownTime,
|
|
7
101
|
getSelectOptions,
|
|
8
102
|
http,
|
|
9
103
|
isColorEqual,
|
|
10
104
|
isDarkColor,
|
|
11
105
|
notifyMessageToSystems,
|
|
12
106
|
receiveMessage,
|
|
107
|
+
yxFecth,
|
|
108
|
+
yxMessage,
|
|
13
109
|
yxSubscribe
|
|
14
110
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
15
111
|
export {
|
|
16
|
-
utils2 as u
|
|
112
|
+
utils2 as u,
|
|
113
|
+
yxFecth as y
|
|
17
114
|
};
|
|
115
|
+
//# sourceMappingURL=index.es2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es2.js","sources":["../packages/utils/fecth/index.ts"],"sourcesContent":["import { ElMessage } from \"element-plus\";\nimport type { HttpMethod, RequestConfig } from \"./interface\";\nimport { auth } from \"@packages/api\";\nimport { checkStatus, showFullScreenLoading, hideFullScreenLoading } from \"../http/config\";\nfunction buildQuery(params?: Record<string, any>): string {\n\tif (!params) return \"\";\n\tconst query = new URLSearchParams();\n\tObject.entries(params).forEach(([key, value]) => {\n\t\tif (value !== undefined && value !== null) {\n\t\t\tquery.append(key, String(value));\n\t\t}\n\t});\n\treturn `?${query.toString()}`;\n}\n\nasync function baseRequest<T = any>(url: string, method: HttpMethod, data?: any, config: RequestConfig = {}): Promise<T> {\n\tconst { headers = {}, responseType = \"json\", signal, noAuth = false } = config;\n\tconst fullUrl = method === \"GET\" ? `${url}${buildQuery(data)}` : `${url}`;\n\tconst token = auth.getToken();\n\tif (!config.noLoading) {\n\t\tshowFullScreenLoading();\n\t}\n\tconst res = await fetch(fullUrl, {\n\t\tmethod,\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...(token && !noAuth ? { token: token } : \"\"),\n\t\t\t...headers\n\t\t},\n\t\tbody: method !== \"GET\" && data ? JSON.stringify(data) : undefined,\n\t\tsignal\n\t});\n\thideFullScreenLoading();\n\t// 统一错误处理\n\tif (!res.ok) {\n\t\tlet errorMessage = \"\";\n\t\ttry {\n\t\t\tconst errorData = await res.json();\n\t\t\tif (errorData?.resultMsg) {\n\t\t\t\terrorMessage = errorData.resultMsg;\n\t\t\t}\n\t\t} catch (_) {}\n\t\tcheckStatus(res.status, errorMessage);\n\t\tthrow new Error(errorMessage);\n\t}\n\n\tswitch (responseType) {\n\t\tcase \"text\":\n\t\t\treturn res.text() as Promise<T>;\n\t\tcase \"blob\":\n\t\t\treturn res.blob() as Promise<T>;\n\t\tdefault:\n\t\t\treturn res.json() as Promise<T>;\n\t}\n}\n\nexport const yxFecth = {\n\tget: <T = any>(url: string, params?: Record<string, any>, config?: RequestConfig) => baseRequest<T>(url, \"GET\", params, config),\n\n\tpost: <T = any>(url: string, data?: any, config?: RequestConfig) => baseRequest<T>(url, \"POST\", data, config),\n\n\tput: <T = any>(url: string, data?: any, config?: RequestConfig) => baseRequest<T>(url, \"PUT\", data, config),\n\n\tdelete: <T = any>(url: string, data?: any, config?: RequestConfig) => baseRequest<T>(url, \"DELETE\", data, config)\n};\n"],"names":["auth.getToken"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,SAAS,WAAW,QAAsC;AACrD,MAAA,CAAC,OAAe,QAAA;AACd,QAAA,QAAQ,IAAI,gBAAgB;AAC3B,SAAA,QAAQ,MAAM,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AAC5C,QAAA,UAAU,UAAa,UAAU,MAAM;AAC1C,YAAM,OAAO,KAAK,OAAO,KAAK,CAAC;AAAA,IAAA;AAAA,EAChC,CACA;AACM,SAAA,IAAI,MAAM,SAAU,CAAA;AAC5B;AAEA,SAAe,YAAqB,IAAa,IAAoB,IAAoD;AAAA,6CAArF,KAAa,QAAoB,MAAY,SAAwB,CAAA,GAAgB;AAClH,UAAA,EAAE,UAAU,CAAA,GAAI,eAAe,QAAQ,QAAQ,SAAS,MAAA,IAAU;AAClE,UAAA,UAAU,WAAW,QAAQ,GAAG,GAAG,GAAG,WAAW,IAAI,CAAC,KAAK,GAAG,GAAG;AACjE,UAAA,QAAQA,SAAc;AACxB,QAAA,CAAC,OAAO,WAAW;AACA,4BAAA;AAAA,IAAA;AAEjB,UAAA,MAAM,MAAM,MAAM,SAAS;AAAA,MAChC;AAAA,MACA,SAAS;AAAA,QACR,gBAAgB;AAAA,SACZ,SAAS,CAAC,SAAS,EAAE,MAAiB,IAAA,KACvC;AAAA,MAEJ,MAAM,WAAW,SAAS,OAAO,KAAK,UAAU,IAAI,IAAI;AAAA,MACxD;AAAA,IAAA,CACA;AACqB,0BAAA;AAElB,QAAA,CAAC,IAAI,IAAI;AACZ,UAAI,eAAe;AACf,UAAA;AACG,cAAA,YAAY,MAAM,IAAI,KAAK;AACjC,YAAI,uCAAW,WAAW;AACzB,yBAAe,UAAU;AAAA,QAAA;AAAA,eAElB,GAAG;AAAA,MAAA;AACA,kBAAA,IAAI,QAAQ,YAAY;AAC9B,YAAA,IAAI,MAAM,YAAY;AAAA,IAAA;AAG7B,YAAQ,cAAc;AAAA,MACrB,KAAK;AACJ,eAAO,IAAI,KAAK;AAAA,MACjB,KAAK;AACJ,eAAO,IAAI,KAAK;AAAA,MACjB;AACC,eAAO,IAAI,KAAK;AAAA,IAAA;AAAA,EAEnB;AAAA;AAEO,MAAM,UAAU;AAAA,EACtB,KAAK,CAAU,KAAa,QAA8B,WAA2B,YAAe,KAAK,OAAO,QAAQ,MAAM;AAAA,EAE9H,MAAM,CAAU,KAAa,MAAY,WAA2B,YAAe,KAAK,QAAQ,MAAM,MAAM;AAAA,EAE5G,KAAK,CAAU,KAAa,MAAY,WAA2B,YAAe,KAAK,OAAO,MAAM,MAAM;AAAA,EAE1G,QAAQ,CAAU,KAAa,MAAY,WAA2B,YAAe,KAAK,UAAU,MAAM,MAAM;AACjH;;;;;;;;;;;;;;;;;"}
|
package/lib/index.es3.js
CHANGED
|
@@ -18,9 +18,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
import "./index.
|
|
21
|
+
import "./index.es12.js";
|
|
22
22
|
import "element-plus";
|
|
23
|
-
import { g as getGroupListApi, a as getResourceListApi } from "./index.
|
|
23
|
+
import { g as getGroupListApi, a as getResourceListApi } from "./index.es14.js";
|
|
24
24
|
const ICON_GROUP_NAME = "yxIcon";
|
|
25
25
|
const initYxIcon = () => {
|
|
26
26
|
getYxIconGroupUuid();
|
|
@@ -63,3 +63,4 @@ export {
|
|
|
63
63
|
index as i,
|
|
64
64
|
yxIcon2 as y
|
|
65
65
|
};
|
|
66
|
+
//# sourceMappingURL=index.es3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es3.js","sources":["../packages/yxIcon/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2024-04-11 14:07:04\n * @LastEditors: WangXin\n * @LastEditTime: 2024-04-15 15:34:49\n * @FilePath: /yxuse/packages/yxIcon/index.ts\n * @Description:\n *\n * Copyright (c) 2024 by YuXing, All Rights Reserved.\n */\nimport type { App } from \"vue\";\nimport { assets } from \"@packages/api\";\nconst ICON_GROUP_NAME = \"yxIcon\";\nconst initYxIcon = () => {\n\tgetYxIconGroupUuid();\n\t// combineYxIconStr();\n};\nconst getYxIconGroupUuid = async () => {\n\tconst { data } = await assets.getGroupListApi();\n\tconst groupUuid = data.find((item: any) => item.groupName === ICON_GROUP_NAME)?.groupUuid;\n\tgetYxIconFileContent(groupUuid);\n};\nconst getYxIconFileContent = async (groupUuid: string) => {\n\tconst { data } = await assets.getResourceListApi(groupUuid, 1);\n\tcombineYxIconStr(data);\n\treturn data;\n};\nconst combineYxIconStr = (data: any) => {\n\tconst svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\tsvg.setAttribute(\"xmlns\", \"http://www.w3.org/2000/svg\");\n\tsvg.setAttribute(\"xmlns:xlin\", \"http://www.w3.org/1999/xlink\");\n\tlet svgHtml = \"\";\n\tdata.forEach((svgElement: any) => {\n\t\tsvgHtml += svgElement.text\n\t\t\t.replace(/\\\\/g, \"\")\n\t\t\t.trim()\n\t\t\t.replace(/^\"(.*)\"$/, \"$1\");\n\t});\n\tsvg.innerHTML = svgHtml;\n\tsvg.style.position = \"absolute\";\n\tsvg.style.width = \"0\";\n\tsvg.style.height = \"0\";\n\tdocument.head.appendChild(svg);\n};\nexport default {\n\tinstall: function (app: App<Element>) {\n\t\tinitYxIcon();\n\t}\n};\n"],"names":["assets.getGroupListApi","assets.getResourceListApi"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAYA,MAAM,kBAAkB;AACxB,MAAM,aAAa,MAAM;AACL,qBAAA;AAEpB;AACA,MAAM,qBAAqB,MAAY;;AACtC,QAAM,EAAE,SAAS,MAAMA,gBAAuB;AACxC,QAAA,aAAY,UAAK,KAAK,CAAC,SAAc,KAAK,cAAc,eAAe,MAA3D,mBAA8D;AAChF,uBAAqB,SAAS;AAC/B;AACA,MAAM,uBAAuB,CAAO,cAAsB;AACzD,QAAM,EAAE,KAAK,IAAI,MAAMC,mBAA0B,WAAW,CAAC;AAC7D,mBAAiB,IAAI;AACd,SAAA;AACR;AACA,MAAM,mBAAmB,CAAC,SAAc;AACvC,QAAM,MAAM,SAAS,gBAAgB,8BAA8B,KAAK;AACpE,MAAA,aAAa,SAAS,4BAA4B;AAClD,MAAA,aAAa,cAAc,8BAA8B;AAC7D,MAAI,UAAU;AACT,OAAA,QAAQ,CAAC,eAAoB;AACtB,eAAA,WAAW,KACpB,QAAQ,OAAO,EAAE,EACjB,KAAK,EACL,QAAQ,YAAY,IAAI;AAAA,EAAA,CAC1B;AACD,MAAI,YAAY;AAChB,MAAI,MAAM,WAAW;AACrB,MAAI,MAAM,QAAQ;AAClB,MAAI,MAAM,SAAS;AACV,WAAA,KAAK,YAAY,GAAG;AAC9B;AACA,MAAe,QAAA;AAAA,EACd,SAAS,SAAU,KAAmB;AAC1B,eAAA;AAAA,EAAA;AAEb;;;;;"}
|
package/lib/index.es4.js
CHANGED
|
@@ -18,8 +18,8 @@ var __async = (__this, __arguments, generator) => {
|
|
|
18
18
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
|
-
import {
|
|
22
|
-
import { i as index } from "./index.
|
|
21
|
+
import { a as http, U as URL, j as index$1 } from "./index.es12.js";
|
|
22
|
+
import { i as index } from "./index.es14.js";
|
|
23
23
|
const getUserSelectSatelliteList = (systemName = "ttc") => __async(void 0, null, function* () {
|
|
24
24
|
const data = yield http.get(`${URL[systemName].INTEGRATED_BASE_URL}/basic/data/satellite/select`);
|
|
25
25
|
return data;
|
|
@@ -50,3 +50,4 @@ export {
|
|
|
50
50
|
getUserSelectAnteList as d,
|
|
51
51
|
getCommentUntreatedCount as g
|
|
52
52
|
};
|
|
53
|
+
//# sourceMappingURL=index.es4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.es4.js","sources":["../packages/api/index.ts"],"sourcesContent":["/*\n * @Author: WangXin\n * @Date: 2023-08-17 09:30:47\n * @LastEditors: WangXin\n * @LastEditTime: 2024-08-15 18:45:26\n * @FilePath: /yxuse/packages/api/index.ts\n * @Description:\n *\n * Copyright (c) 2023 by YuXing, All Rights Reserved.\n */\nimport * as auth from \"./auth/index\";\nimport * as assets from \"./modules/assets/index\";\nexport { auth, assets };\nimport http from \"@packages/utils/http\";\nimport { URL } from \"@packages/config\";\n\n/**\n * 获取用户可选择的星\n *\n */\nexport const getUserSelectSatelliteList = async (systemName = \"ttc\") => {\n\tconst data = await http.get<any>(`${URL[systemName].INTEGRATED_BASE_URL}/basic/data/satellite/select`);\n\treturn data;\n};\n\n/**\n * 获取用户可选择的测站\n *\n */\nexport const getUserSelectAnteList = async (systemName = \"ttc\") => {\n\tconst data = await http.get<any>(`${URL[systemName].INTEGRATED_BASE_URL}/basic/data/ante/select`);\n\treturn data;\n};\n\n/**\n * 获取用户可选择的主题\n *\n */\nexport const getUserThemeList = async (systemName = \"ttc\") => {\n\treturn await http.get<any>(`${URL[systemName].INTEGRATED_BASE_URL}/theme/list`, {}, { headers: { noLoading: true } });\n};\n\nexport const getCommentUntreatedCount = async (systemName = \"ttc\") => {\n\treturn await http.get<any>(`${URL[systemName].INTEGRATED_BASE_URL}/workorder/comment/untreated/count`);\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBa,MAAA,6BAA6B,CAAO,aAAa,UAAU;AACjE,QAAA,OAAO,MAAM,KAAK,IAAS,GAAG,IAAI,UAAU,EAAE,mBAAmB,8BAA8B;AAC9F,SAAA;AACR;AAMa,MAAA,wBAAwB,CAAO,aAAa,UAAU;AAC5D,QAAA,OAAO,MAAM,KAAK,IAAS,GAAG,IAAI,UAAU,EAAE,mBAAmB,yBAAyB;AACzF,SAAA;AACR;AAMa,MAAA,mBAAmB,CAAO,aAAa,UAAU;AAC7D,SAAO,MAAM,KAAK,IAAS,GAAG,IAAI,UAAU,EAAE,mBAAmB,eAAe,IAAI,EAAE,SAAS,EAAE,WAAW,KAAA,GAAQ;AACrH;AAEa,MAAA,2BAA2B,CAAO,aAAa,UAAU;AAC9D,SAAA,MAAM,KAAK,IAAS,GAAG,IAAI,UAAU,EAAE,mBAAmB,oCAAoC;AACtG;;;;;;;;;;"}
|