yahee-components 0.0.84 → 0.0.86
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/es/common-import/common-import.vue.js +314 -311
- package/es/complex-search/complex-search.vue2.js +57 -53
- package/es/filter-container/filter-container.vue.js +67 -0
- package/es/filter-container/filter-container.vue2.js +4 -0
- package/es/filter-container/index.js +7 -0
- package/es/filter-container/style/index.css +17 -0
- package/es/filter-wrapper/filter-wrapper.vue.js +7 -0
- package/es/filter-wrapper/filter-wrapper.vue2.js +59 -0
- package/es/filter-wrapper/index.js +7 -0
- package/es/filter-wrapper/style/index.css +3 -0
- package/es/installs.js +12 -8
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +5 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +8 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +15 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +7 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +5 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +54 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +7 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +6 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +9 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +7 -0
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +22 -0
- package/es/style.css +22 -0
- package/es/utils/translate.js +27 -47
- package/es/yahee-components.css +1 -1
- package/lib/filter-container/style/index.css +17 -0
- package/lib/filter-wrapper/style/index.css +3 -0
- package/lib/style.css +22 -0
- package/package.json +1 -1
- package/types/src/filter-container/filter-container.d.ts +5 -0
- package/types/src/filter-container/filter-container.vue.d.ts +49 -0
- package/types/src/filter-container/props.d.ts +45 -0
- package/types/src/filter-wrapper/filter-wrapper.d.ts +5 -0
- package/types/src/filter-wrapper/filter-wrapper.vue.d.ts +49 -0
- package/types/src/filter-wrapper/props.d.ts +45 -0
- package/types/src/utils/translate.d.ts +0 -3
- package/es/api/server.js +0 -35
- package/es/api/tool.js +0 -71
- package/types/src/installs.d.ts +0 -2649
package/es/utils/translate.js
CHANGED
|
@@ -1,58 +1,38 @@
|
|
|
1
|
-
import { sessionStorageProxy as
|
|
2
|
-
import
|
|
3
|
-
import "../
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const l = r[o];
|
|
14
|
-
if (l)
|
|
15
|
-
return l;
|
|
1
|
+
import { sessionStorageProxy as s, storage as a } from "./storage.js";
|
|
2
|
+
import c from "../_virtual/lodash.js";
|
|
3
|
+
import { i18nType as l } from "../static/CommonObject.js";
|
|
4
|
+
const h = (e) => {
|
|
5
|
+
var u;
|
|
6
|
+
const t = s.get("employee") || {}, n = f(e);
|
|
7
|
+
if (n === 0) return e;
|
|
8
|
+
const r = s.get(`translate${t.Language}`) || {};
|
|
9
|
+
if (c.isEmpty(r) || t.Language === "zh-CN" || !/[\u4e00-\u9fa5]/.test(e)) return e;
|
|
10
|
+
const g = r[n];
|
|
11
|
+
if (g)
|
|
12
|
+
return g;
|
|
16
13
|
{
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
return e;
|
|
20
|
-
n.push(o.toString()), s.set("localStorageListId", n.join(","));
|
|
21
|
-
const m = {
|
|
22
|
-
projectId: "place-order",
|
|
23
|
-
id: o,
|
|
24
|
-
cn: e
|
|
25
|
-
}, p = "https://erptools.yaheecloud.com/api/translation/addTranslate";
|
|
26
|
-
return console.log(p, "url"), y.post(p, m, { withCredentials: !0 }).then((f) => {
|
|
27
|
-
f.data.code;
|
|
28
|
-
}), e;
|
|
14
|
+
const i = ((u = a.get("localStorageListId")) == null ? void 0 : u.split(",")) || [];
|
|
15
|
+
return i.includes(n.toString()) || (i.push(n.toString()), a.set("localStorageListId", i.join(","))), e;
|
|
29
16
|
}
|
|
30
17
|
};
|
|
31
|
-
function
|
|
18
|
+
function f(e) {
|
|
32
19
|
let t = 0;
|
|
33
20
|
if (!e || e.length === 0) return t;
|
|
34
|
-
for (let
|
|
35
|
-
const
|
|
36
|
-
t = (t << 5) - t +
|
|
21
|
+
for (let n = 0, r = e.length; n < r; n++) {
|
|
22
|
+
const o = e.charCodeAt(n);
|
|
23
|
+
t = (t << 5) - t + o, t |= 0;
|
|
37
24
|
}
|
|
38
25
|
return t;
|
|
39
26
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
if (!e ||
|
|
43
|
-
const r =
|
|
44
|
-
if (r.Language ===
|
|
45
|
-
const
|
|
46
|
-
return
|
|
47
|
-
const a = s.getWithExpireTime("totalEmployees") || {}, n = l.data[0];
|
|
48
|
-
return n ? (a[e] = n, s.setWithExpireTime("totalEmployees", a, 3600 * 1e3), r.Language === c.CN ? n.name || "" : n.enName || "") : t;
|
|
49
|
-
}), t);
|
|
50
|
-
}
|
|
51
|
-
function d(e) {
|
|
52
|
-
const t = "/employee/all";
|
|
53
|
-
return h(e ? `${t}?idsStr=${e}` : t);
|
|
27
|
+
function L(e, t = "") {
|
|
28
|
+
const n = a.getWithExpireTime("totalEmployees");
|
|
29
|
+
if (!e || c.isEmpty(n)) return t;
|
|
30
|
+
const r = s.get("employee");
|
|
31
|
+
if (r.Language === l.CN && t) return t;
|
|
32
|
+
const o = n[e];
|
|
33
|
+
return o ? r.Language === l.CN ? o.name || t : o.enName || "" : t;
|
|
54
34
|
}
|
|
55
35
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
36
|
+
h as M2,
|
|
37
|
+
L as translateEmployeeName
|
|
58
38
|
};
|
package/es/yahee-components.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.container[data-v-d3e37633]{box-sizing:initial;display:inline-block;text-align:center;border-radius:50%;overflow:hidden}.spinner[data-v-d3e37633]{box-sizing:initial;border:2px solid #a1a1a1;border-right-color:transparent;width:23px;height:23px;border-radius:50%;animation:spin-d3e37633 .9s linear infinite}@keyframes spin-d3e37633{to{transform:rotate(360deg)}}.v3-infinite-loading[data-v-4bdee133]{width:100%;height:44px}.state-error[data-v-4bdee133]{display:flex;flex-direction:column;align-items:center}.retry[data-v-4bdee133]{margin-top:8px;padding:2px 6px 4px;width:60px;color:inherit;font-size:14px;font-family:inherit;background:transparent;border:2px solid currentColor;border-radius:5px;outline:none;cursor:pointer}.retry[data-v-4bdee133]:hover{opacity:.8}
|
|
1
|
+
.container[data-v-d3e37633]{box-sizing:initial;display:inline-block;text-align:center;border-radius:50%;overflow:hidden}.spinner[data-v-d3e37633]{box-sizing:initial;border:2px solid #a1a1a1;border-right-color:transparent;width:23px;height:23px;border-radius:50%;animation:spin-d3e37633 .9s linear infinite}@keyframes spin-d3e37633{to{transform:rotate(360deg)}}.v3-infinite-loading[data-v-4bdee133]{width:100%;height:44px}.state-error[data-v-4bdee133]{display:flex;flex-direction:column;align-items:center}.retry[data-v-4bdee133]{margin-top:8px;padding:2px 6px 4px;width:60px;color:inherit;font-size:14px;font-family:inherit;background:transparent;border:2px solid currentColor;border-radius:5px;outline:none;cursor:pointer}.retry[data-v-4bdee133]:hover{opacity:.8}.filter-wrapper[data-v-841c990f]{display:inline-block;margin-right:16px;margin-bottom:16px;vertical-align:top}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.yahee-filter-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
.yahee-filter-container .filter-section {
|
|
6
|
+
min-width: 200px;
|
|
7
|
+
}
|
|
8
|
+
.yahee-filter-container .search-section {
|
|
9
|
+
min-height: 60px;
|
|
10
|
+
position: fixed;
|
|
11
|
+
right: -50px;
|
|
12
|
+
}
|
|
13
|
+
.yahee-filter-container .content-section {
|
|
14
|
+
flex: 1;
|
|
15
|
+
padding: 16px;
|
|
16
|
+
overflow: auto;
|
|
17
|
+
}
|
package/lib/style.css
CHANGED
|
@@ -526,6 +526,28 @@
|
|
|
526
526
|
height: 100%;
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
+
.yahee-filter-container {
|
|
530
|
+
display: flex;
|
|
531
|
+
width: 100%;
|
|
532
|
+
}
|
|
533
|
+
.yahee-filter-container .filter-section {
|
|
534
|
+
min-width: 200px;
|
|
535
|
+
}
|
|
536
|
+
.yahee-filter-container .search-section {
|
|
537
|
+
min-height: 60px;
|
|
538
|
+
position: fixed;
|
|
539
|
+
right: -50px;
|
|
540
|
+
}
|
|
541
|
+
.yahee-filter-container .content-section {
|
|
542
|
+
flex: 1;
|
|
543
|
+
padding: 16px;
|
|
544
|
+
overflow: auto;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
.yahee-filter-wrapper {
|
|
548
|
+
font-size: 20px;
|
|
549
|
+
}
|
|
550
|
+
|
|
529
551
|
:root {
|
|
530
552
|
--el-color-primary: #3366cc;
|
|
531
553
|
--el-text-color-regular: #000;
|
package/package.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
type Primitive = string | number | boolean | null | undefined;
|
|
3
|
+
type FilterValue = Primitive | Primitive[];
|
|
4
|
+
interface FilterChangeEvent {
|
|
5
|
+
filterKey: string;
|
|
6
|
+
checkedValues: FilterValue[];
|
|
7
|
+
}
|
|
8
|
+
interface SearchItem {
|
|
9
|
+
[key: string]: FilterValue;
|
|
10
|
+
}
|
|
11
|
+
interface FilterContainerProps {
|
|
12
|
+
debounceInterval?: number;
|
|
13
|
+
immediate?: boolean;
|
|
14
|
+
initialSearchItem?: SearchItem;
|
|
15
|
+
showSearchSection?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function __VLS_template(): {
|
|
18
|
+
attrs: Partial<{}>;
|
|
19
|
+
slots: {
|
|
20
|
+
filters?(_: {}): any;
|
|
21
|
+
search?(_: {}): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {};
|
|
24
|
+
rootEl: HTMLDivElement;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
27
|
+
declare const __VLS_component: DefineComponent<FilterContainerProps, {
|
|
28
|
+
resetAllFilters: () => void;
|
|
29
|
+
getCurrentSearchItem: () => SearchItem;
|
|
30
|
+
updateSearchItem: (changes: FilterChangeEvent | FilterChangeEvent[]) => void;
|
|
31
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
32
|
+
change: (searchItem: SearchItem) => any;
|
|
33
|
+
search: (searchItem: SearchItem) => any;
|
|
34
|
+
}, string, PublicProps, Readonly<FilterContainerProps> & Readonly<{
|
|
35
|
+
onChange?: (searchItem: SearchItem) => any;
|
|
36
|
+
onSearch?: (searchItem: SearchItem) => any;
|
|
37
|
+
}>, {
|
|
38
|
+
debounceInterval: number;
|
|
39
|
+
immediate: boolean;
|
|
40
|
+
initialSearchItem: SearchItem;
|
|
41
|
+
showSearchSection: boolean;
|
|
42
|
+
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
43
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface FilterContainerProps {
|
|
2
|
+
/**
|
|
3
|
+
* 处理输入框粘贴事件并格式化粘贴的内容
|
|
4
|
+
* @default undefined
|
|
5
|
+
*/
|
|
6
|
+
pasteFormat?: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* 默认查询类型
|
|
9
|
+
* default 'integrated':综合搜索
|
|
10
|
+
*/
|
|
11
|
+
defaultSearch?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 输入框的占位符文本
|
|
14
|
+
* default: ''
|
|
15
|
+
*/
|
|
16
|
+
placeholderText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 是否展示批量查询按钮
|
|
19
|
+
* default: false
|
|
20
|
+
*/
|
|
21
|
+
showPatchSearch?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 是否展示在筛选体条件内查询checkbox
|
|
24
|
+
* default: false
|
|
25
|
+
*/
|
|
26
|
+
showWithinFilterCheckbox?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 是否展示下拉选
|
|
29
|
+
* default: false
|
|
30
|
+
*/
|
|
31
|
+
showSelect?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
*批量搜索下拉选项是否和输入框下拉选项相同
|
|
34
|
+
*/
|
|
35
|
+
isBatchSelectOptionsSameWithInput?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function defaultFilterContainerProps(): {
|
|
38
|
+
pasteFormat: () => void;
|
|
39
|
+
defaultSearch: string;
|
|
40
|
+
placeholderText: string;
|
|
41
|
+
showPatchSearch: false;
|
|
42
|
+
showWithinFilterCheckbox: false;
|
|
43
|
+
showSelect: false;
|
|
44
|
+
isBatchSelectOptionsSameWithInput: true;
|
|
45
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
type Primitive = string | number | boolean | null | undefined;
|
|
3
|
+
type FilterValue = Primitive | Primitive[] | Record<string, Primitive>;
|
|
4
|
+
interface SearchItem {
|
|
5
|
+
[key: string]: FilterValue;
|
|
6
|
+
}
|
|
7
|
+
interface ComponentMethods {
|
|
8
|
+
reset?: () => void;
|
|
9
|
+
getValue?: () => FilterValue;
|
|
10
|
+
setValue?: (value: FilterValue) => void;
|
|
11
|
+
}
|
|
12
|
+
interface FilterWrapperProps {
|
|
13
|
+
id: string;
|
|
14
|
+
filterKey: string;
|
|
15
|
+
type?: 'filter' | 'search';
|
|
16
|
+
reset?: () => void;
|
|
17
|
+
immediate?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare function __VLS_template(): {
|
|
20
|
+
attrs: Partial<{}>;
|
|
21
|
+
slots: {
|
|
22
|
+
default?(_: {
|
|
23
|
+
register: (componentMethods?: ComponentMethods) => void;
|
|
24
|
+
update: (checkedValues: FilterValue | FilterValue[]) => void;
|
|
25
|
+
getCurrentSearchItem: () => SearchItem;
|
|
26
|
+
handleSearch: (searchData: SearchItem) => void;
|
|
27
|
+
}): any;
|
|
28
|
+
};
|
|
29
|
+
refs: {};
|
|
30
|
+
rootEl: HTMLDivElement;
|
|
31
|
+
};
|
|
32
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
33
|
+
declare const __VLS_component: DefineComponent<FilterWrapperProps, {
|
|
34
|
+
register: (componentMethods?: ComponentMethods) => void;
|
|
35
|
+
updateFilter: (checkedValues: FilterValue | FilterValue[]) => void;
|
|
36
|
+
getCurrentSearchItem: () => SearchItem;
|
|
37
|
+
handleSearch: (searchData: SearchItem) => void;
|
|
38
|
+
reset: () => void;
|
|
39
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<FilterWrapperProps> & Readonly<{}>, {
|
|
40
|
+
type: "filter" | "search";
|
|
41
|
+
immediate: boolean;
|
|
42
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
43
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
44
|
+
export default _default;
|
|
45
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface FilterWrapperProps {
|
|
2
|
+
/**
|
|
3
|
+
* 处理输入框粘贴事件并格式化粘贴的内容
|
|
4
|
+
* @default undefined
|
|
5
|
+
*/
|
|
6
|
+
pasteFormat?: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* 默认查询类型
|
|
9
|
+
* default 'integrated':综合搜索
|
|
10
|
+
*/
|
|
11
|
+
defaultSearch?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 输入框的占位符文本
|
|
14
|
+
* default: ''
|
|
15
|
+
*/
|
|
16
|
+
placeholderText?: string;
|
|
17
|
+
/**
|
|
18
|
+
* 是否展示批量查询按钮
|
|
19
|
+
* default: false
|
|
20
|
+
*/
|
|
21
|
+
showPatchSearch?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 是否展示在筛选体条件内查询checkbox
|
|
24
|
+
* default: false
|
|
25
|
+
*/
|
|
26
|
+
showWithinFilterCheckbox?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 是否展示下拉选
|
|
29
|
+
* default: false
|
|
30
|
+
*/
|
|
31
|
+
showSelect?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
*批量搜索下拉选项是否和输入框下拉选项相同
|
|
34
|
+
*/
|
|
35
|
+
isBatchSelectOptionsSameWithInput?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function defaultFilterContainerProps(): {
|
|
38
|
+
pasteFormat: () => void;
|
|
39
|
+
defaultSearch: string;
|
|
40
|
+
placeholderText: string;
|
|
41
|
+
showPatchSearch: false;
|
|
42
|
+
showWithinFilterCheckbox: false;
|
|
43
|
+
showSelect: false;
|
|
44
|
+
isBatchSelectOptionsSameWithInput: true;
|
|
45
|
+
};
|
|
@@ -1,5 +1,2 @@
|
|
|
1
1
|
export declare const M2: (str: string) => string;
|
|
2
|
-
export declare const getAllTranslate: () => Promise<void>;
|
|
3
2
|
export declare function translateEmployeeName(employeeId: string, name?: string): string;
|
|
4
|
-
export declare const initTranslate: () => Promise<void>;
|
|
5
|
-
export declare const isNeedTranslate: () => boolean;
|
package/es/api/server.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/index.js";
|
|
2
|
-
import { handleChangeRequestHeader as i, handleConfigureAuth as u, handleAuthError as d, handleGeneralError as l, handleNetworkError as c } from "./tool.js";
|
|
3
|
-
import o from "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/lib/axios.js";
|
|
4
|
-
o.interceptors.request.use((t) => {
|
|
5
|
-
let e = i(t);
|
|
6
|
-
return e = u(e), e;
|
|
7
|
-
});
|
|
8
|
-
o.defaults.withCredentials = !0;
|
|
9
|
-
o.interceptors.response.use(
|
|
10
|
-
(t) => {
|
|
11
|
-
if (t.status !== 200) return Promise.reject(t.data);
|
|
12
|
-
const { errno: e, status: r, msg: s } = t.data;
|
|
13
|
-
return e != null && e !== 0 && d(e), r != null && r !== 0 && s && l(r, s), t;
|
|
14
|
-
},
|
|
15
|
-
(t) => {
|
|
16
|
-
var e;
|
|
17
|
-
return (e = t.response) != null && e.status && c(t.response.status), Promise.reject(t.response);
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
const g = (t, e = {}, r) => new Promise((s) => {
|
|
21
|
-
o.get(t, { params: e }).then((a) => {
|
|
22
|
-
let n;
|
|
23
|
-
n = a.data, s(n);
|
|
24
|
-
}).catch((a) => {
|
|
25
|
-
const n = {
|
|
26
|
-
msg: a.msg,
|
|
27
|
-
data: a.data
|
|
28
|
-
// 其他错误属性...
|
|
29
|
-
};
|
|
30
|
-
s(n);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
export {
|
|
34
|
-
g as Get
|
|
35
|
-
};
|
package/es/api/tool.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ElMessage as o, ElMessageBox as n } from "element-plus";
|
|
2
|
-
import "element-plus/theme-chalk/src/base.scss";
|
|
3
|
-
import "element-plus/theme-chalk/src/badge.scss";
|
|
4
|
-
import "element-plus/theme-chalk/src/message.scss";
|
|
5
|
-
import "element-plus/theme-chalk/src/message-box.scss";
|
|
6
|
-
import "element-plus/theme-chalk/src/button.scss";
|
|
7
|
-
import "element-plus/theme-chalk/src/input.scss";
|
|
8
|
-
import "element-plus/theme-chalk/src/overlay.scss";
|
|
9
|
-
import { AxiosHeaders as a } from "../node_modules/.pnpm/axios@1.10.0/node_modules/axios/index.js";
|
|
10
|
-
const w = (e) => ({
|
|
11
|
-
...e,
|
|
12
|
-
timeout: 2e4
|
|
13
|
-
}), E = (e) => {
|
|
14
|
-
const r = new a(e.headers);
|
|
15
|
-
return {
|
|
16
|
-
...e,
|
|
17
|
-
headers: r
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
let t = !1;
|
|
21
|
-
const g = (e) => {
|
|
22
|
-
const r = {
|
|
23
|
-
400: "错误的请求",
|
|
24
|
-
// token 失效
|
|
25
|
-
403: "拒绝访问",
|
|
26
|
-
404: "请求错误,未找到该资源",
|
|
27
|
-
405: "请求方法未允许",
|
|
28
|
-
408: "请求超时",
|
|
29
|
-
500: "服务器端出错",
|
|
30
|
-
501: "网络未实现",
|
|
31
|
-
502: "网络错误",
|
|
32
|
-
503: "服务不可用",
|
|
33
|
-
504: "网络超时",
|
|
34
|
-
505: "http版本不支持该请求"
|
|
35
|
-
};
|
|
36
|
-
switch (e) {
|
|
37
|
-
case 401:
|
|
38
|
-
window.location.href = `https://portal.yaheecloud.com//Latest/Account/LogOn?returnUrl=${encodeURIComponent(window.location.href)}`;
|
|
39
|
-
break;
|
|
40
|
-
case 403:
|
|
41
|
-
t || (t = !0, n.alert("对不起,您没有权限进行当前操作!").finally(() => {
|
|
42
|
-
t = !1;
|
|
43
|
-
}));
|
|
44
|
-
break;
|
|
45
|
-
default:
|
|
46
|
-
e && o.error(r[e] ?? `其他连接错误 --${e}`);
|
|
47
|
-
}
|
|
48
|
-
}, M = (e) => {
|
|
49
|
-
if (!e || e === 0)
|
|
50
|
-
return !0;
|
|
51
|
-
const r = {
|
|
52
|
-
10031: "登录失效,需要重新登录",
|
|
53
|
-
// token 失效
|
|
54
|
-
10032: "您太久没登录,请重新登录~",
|
|
55
|
-
// token 过期
|
|
56
|
-
10033: "账户未绑定角色,请联系管理员绑定角色",
|
|
57
|
-
10034: "该用户未注册,请联系管理员注册用户",
|
|
58
|
-
10035: "code 无法获取对应第三方平台用户",
|
|
59
|
-
10036: "该账户未关联员工,请联系管理员做关联",
|
|
60
|
-
10037: "账号已无效",
|
|
61
|
-
10038: "账号未找到"
|
|
62
|
-
};
|
|
63
|
-
return e in r ? (o.error(r[e]), !1) : !0;
|
|
64
|
-
}, k = (e, r) => e !== 0 && r && r.trim() && r !== "OK" ? (o.error(r), !1) : !0;
|
|
65
|
-
export {
|
|
66
|
-
M as handleAuthError,
|
|
67
|
-
w as handleChangeRequestHeader,
|
|
68
|
-
E as handleConfigureAuth,
|
|
69
|
-
k as handleGeneralError,
|
|
70
|
-
g as handleNetworkError
|
|
71
|
-
};
|