@spacecorexdev/core 0.0.4 → 0.1.0
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/dist/api/index.js +1 -1553
- package/dist/contract.js +1 -5
- package/dist/hooks/index.js +1 -133
- package/dist/index.js +7 -4492
- package/dist/styles/ant-table.css +5 -26
- package/dist/styles/index.css +8 -8
- package/dist/types/index.js +1 -49
- package/dist/ui/index.js +1 -22245
- package/dist/utils/index.js +7 -4296
- package/package.json +32 -69
- package/types/api/project.d.ts +9 -1
- package/types/hooks.d.ts +1 -1
- package/types/index.d.ts +4 -4
- package/types/types/index.d.ts +1 -3
- package/types/types/project/base.d.ts +3 -1
- package/types/types/project/index.d.ts +1 -0
- package/types/types/project/member.d.ts +1 -1
- package/types/types/project/projectRole.d.ts +17 -0
- package/types/types/projectRole.d.ts +2 -2
- package/types/ui/FileManager/types.d.ts +1 -5
- package/types/ui/FileManager/utils/fileUtils.d.ts +0 -16
- package/types/ui/ResizableTable/index.d.ts +7 -0
- package/types/ui/RoleSelector/index.d.ts +7 -1
- package/types/ui/UIFilePreview/RichDocEditor/index.d.ts +0 -13
- package/types/ui/UIFilePreview/WordEditor/style.d.ts +0 -6
- package/types/ui/UIFileUpload.d.ts +2 -2
- package/types/ui/index.d.ts +1 -10
- package/types/ui/upload/index.d.ts +6 -0
- package/types/ui.d.ts +1 -1
- package/types/utils/CacheIndexedDB.d.ts +9 -0
- package/types/utils/index.d.ts +2 -2
- package/types/utils/mailto.d.ts +12 -0
- package/types/utils.d.ts +1 -1
- package/dist/ui/index.css +0 -1876
- package/public/cmaps/78-EUC-H.bcmap +0 -0
- package/public/cmaps/78-EUC-V.bcmap +0 -0
- package/public/cmaps/78-H.bcmap +0 -0
- package/public/cmaps/78-RKSJ-H.bcmap +0 -0
- package/public/cmaps/78-RKSJ-V.bcmap +0 -0
- package/public/cmaps/78-V.bcmap +0 -0
- package/public/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/public/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/public/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/public/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/public/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/public/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/public/cmaps/Add-H.bcmap +0 -0
- package/public/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/public/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/public/cmaps/Add-V.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/public/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/public/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/public/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/public/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/public/cmaps/B5-H.bcmap +0 -0
- package/public/cmaps/B5-V.bcmap +0 -0
- package/public/cmaps/B5pc-H.bcmap +0 -0
- package/public/cmaps/B5pc-V.bcmap +0 -0
- package/public/cmaps/CNS-EUC-H.bcmap +0 -0
- package/public/cmaps/CNS-EUC-V.bcmap +0 -0
- package/public/cmaps/CNS1-H.bcmap +0 -0
- package/public/cmaps/CNS1-V.bcmap +0 -0
- package/public/cmaps/CNS2-H.bcmap +0 -0
- package/public/cmaps/CNS2-V.bcmap +0 -3
- package/public/cmaps/ETHK-B5-H.bcmap +0 -0
- package/public/cmaps/ETHK-B5-V.bcmap +0 -0
- package/public/cmaps/ETen-B5-H.bcmap +0 -0
- package/public/cmaps/ETen-B5-V.bcmap +0 -0
- package/public/cmaps/ETenms-B5-H.bcmap +0 -3
- package/public/cmaps/ETenms-B5-V.bcmap +0 -0
- package/public/cmaps/EUC-H.bcmap +0 -0
- package/public/cmaps/EUC-V.bcmap +0 -0
- package/public/cmaps/Ext-H.bcmap +0 -0
- package/public/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/public/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/public/cmaps/Ext-V.bcmap +0 -0
- package/public/cmaps/GB-EUC-H.bcmap +0 -0
- package/public/cmaps/GB-EUC-V.bcmap +0 -0
- package/public/cmaps/GB-H.bcmap +0 -4
- package/public/cmaps/GB-V.bcmap +0 -0
- package/public/cmaps/GBK-EUC-H.bcmap +0 -0
- package/public/cmaps/GBK-EUC-V.bcmap +0 -0
- package/public/cmaps/GBK2K-H.bcmap +0 -0
- package/public/cmaps/GBK2K-V.bcmap +0 -0
- package/public/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/public/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/public/cmaps/GBT-EUC-H.bcmap +0 -0
- package/public/cmaps/GBT-EUC-V.bcmap +0 -0
- package/public/cmaps/GBT-H.bcmap +0 -0
- package/public/cmaps/GBT-V.bcmap +0 -0
- package/public/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/public/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/public/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/public/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/public/cmaps/H.bcmap +0 -0
- package/public/cmaps/HKdla-B5-H.bcmap +0 -0
- package/public/cmaps/HKdla-B5-V.bcmap +0 -0
- package/public/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/public/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/public/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/public/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/public/cmaps/HKm314-B5-H.bcmap +0 -0
- package/public/cmaps/HKm314-B5-V.bcmap +0 -0
- package/public/cmaps/HKm471-B5-H.bcmap +0 -0
- package/public/cmaps/HKm471-B5-V.bcmap +0 -0
- package/public/cmaps/HKscs-B5-H.bcmap +0 -0
- package/public/cmaps/HKscs-B5-V.bcmap +0 -0
- package/public/cmaps/Hankaku.bcmap +0 -0
- package/public/cmaps/Hiragana.bcmap +0 -0
- package/public/cmaps/KSC-EUC-H.bcmap +0 -0
- package/public/cmaps/KSC-EUC-V.bcmap +0 -0
- package/public/cmaps/KSC-H.bcmap +0 -0
- package/public/cmaps/KSC-Johab-H.bcmap +0 -0
- package/public/cmaps/KSC-Johab-V.bcmap +0 -0
- package/public/cmaps/KSC-V.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/public/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/public/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/public/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/public/cmaps/Katakana.bcmap +0 -0
- package/public/cmaps/LICENSE +0 -36
- package/public/cmaps/NWP-H.bcmap +0 -0
- package/public/cmaps/NWP-V.bcmap +0 -0
- package/public/cmaps/RKSJ-H.bcmap +0 -0
- package/public/cmaps/RKSJ-V.bcmap +0 -0
- package/public/cmaps/Roman.bcmap +0 -0
- package/public/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/public/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/public/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/public/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/public/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/public/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/public/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/public/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/public/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/public/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/public/cmaps/V.bcmap +0 -0
- package/public/cmaps/WP-Symbol.bcmap +0 -0
- package/public/polyfills/polyfills.js +0 -802
- package/public/vendor/docx/docx.worker.js +0 -5
- package/public/vendor/docx/jszip.min.js +0 -13
- package/public/vendor/libarchive/libarchive.wasm +0 -0
- package/public/vendor/libarchive/worker-bundle.js +0 -6
- package/public/vendor/pptx/pptx.worker.js +0 -26
- package/public/wasm/cad/0.8.2/dwfv-render.wasm +0 -0
- package/public/wasm/cad/0.8.2/dwg-worker.js +0 -24
- package/public/wasm/cad/0.8.2/dwg-worker.js.map +0 -1
- package/public/wasm/cad/0.8.2/libredwg-web.js +0 -2
- package/public/wasm/cad/0.8.2/libredwg-web.wasm +0 -0
- package/public/wasm/cad/dwfv-render.wasm +0 -0
- package/public/wasm/cad/dwg-worker.js +0 -24
- package/public/wasm/cad/dwg-worker.js.map +0 -1
- package/public/wasm/cad/libredwg-web.js +0 -2
- package/public/wasm/cad/libredwg-web.wasm +0 -0
- package/public/wasm/data/sql-wasm.wasm +0 -0
- package/public/wasm/hdiff.wasm +0 -0
- package/public/wasm/model/LICENSE.occt-import-js.txt +0 -504
- package/public/wasm/model/LICENSE.occt.txt +0 -502
- package/public/wasm/model/occt-import-js.js +0 -19
- package/public/wasm/model/occt-import-js.wasm +0 -0
- package/public/wasm/model/occt-worker.js +0 -83
- package/public/wasm/typst/fonts/DejaVuSansMono-Bold.ttf +0 -0
- package/public/wasm/typst/fonts/DejaVuSansMono-BoldOblique.ttf +0 -0
- package/public/wasm/typst/fonts/DejaVuSansMono-Oblique.ttf +0 -0
- package/public/wasm/typst/fonts/DejaVuSansMono.ttf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Bold.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-BoldItalic.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Italic.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Regular.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-Semibold.otf +0 -0
- package/public/wasm/typst/fonts/LibertinusSerif-SemiboldItalic.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-Bold.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-BoldItalic.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-Italic.otf +0 -0
- package/public/wasm/typst/fonts/NewCM10-Regular.otf +0 -0
- package/public/wasm/typst/fonts/NewCMMath-Bold.otf +0 -0
- package/public/wasm/typst/fonts/NewCMMath-Book.otf +0 -0
- package/public/wasm/typst/fonts/NewCMMath-Regular.otf +0 -0
- package/public/wasm/typst/fonts/README.md +0 -7
- package/public/wasm/typst/typst_ts_renderer_bg.wasm +0 -0
- package/public/wasm/typst/typst_ts_web_compiler_bg.wasm +0 -0
- package/scripts/patch-docx-grid.cjs +0 -412
package/dist/api/index.js
CHANGED
|
@@ -1,1553 +1 @@
|
|
|
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 __export = (target, all) => {
|
|
4
|
-
for (var name in all)
|
|
5
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
6
|
-
};
|
|
7
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
-
|
|
9
|
-
// src/api/_base.ts
|
|
10
|
-
var base_exports = {};
|
|
11
|
-
__export(base_exports, {
|
|
12
|
-
AuthorizationHandler: () => AuthorizationHandler,
|
|
13
|
-
HttpRequest: () => HttpRequest,
|
|
14
|
-
ResponseCode: () => ResponseCode
|
|
15
|
-
});
|
|
16
|
-
import axios, { AxiosError } from "axios";
|
|
17
|
-
|
|
18
|
-
// src/ui/UIToast.tsx
|
|
19
|
-
import { useEffect, useState, useRef } from "react";
|
|
20
|
-
import { notification } from "antd";
|
|
21
|
-
import { CheckCircleOutlined, CloseCircleOutlined, InfoCircleOutlined, WarningOutlined } from "@ant-design/icons";
|
|
22
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
-
var iconMap = {
|
|
24
|
-
success: /* @__PURE__ */ jsx(CheckCircleOutlined, { style: { color: "#52c41a" } }),
|
|
25
|
-
error: /* @__PURE__ */ jsx(CloseCircleOutlined, { style: { color: "#ff4d4f" } }),
|
|
26
|
-
info: /* @__PURE__ */ jsx(InfoCircleOutlined, { style: { color: "#1677ff" } }),
|
|
27
|
-
warning: /* @__PURE__ */ jsx(WarningOutlined, { style: { color: "#faad14" } })
|
|
28
|
-
};
|
|
29
|
-
notification.config({
|
|
30
|
-
placement: "topRight",
|
|
31
|
-
duration: 3,
|
|
32
|
-
// 确保 toast 显示在全屏 Modal(z-index 1000+)之上,避免被弹窗遮挡
|
|
33
|
-
...{ zIndex: 1e4 }
|
|
34
|
-
});
|
|
35
|
-
var _SingletonToastManager = class _SingletonToastManager {
|
|
36
|
-
constructor() {
|
|
37
|
-
__publicField(this, "currentToast", null);
|
|
38
|
-
__publicField(this, "api", null);
|
|
39
|
-
__publicField(this, "isInitialized", false);
|
|
40
|
-
__publicField(this, "pendingToast", null);
|
|
41
|
-
}
|
|
42
|
-
static getInstance() {
|
|
43
|
-
if (!_SingletonToastManager.instance) {
|
|
44
|
-
_SingletonToastManager.instance = new _SingletonToastManager();
|
|
45
|
-
}
|
|
46
|
-
return _SingletonToastManager.instance;
|
|
47
|
-
}
|
|
48
|
-
// 初始化 API
|
|
49
|
-
init(api2) {
|
|
50
|
-
this.api = api2;
|
|
51
|
-
this.isInitialized = true;
|
|
52
|
-
if (this.pendingToast) {
|
|
53
|
-
const config = this.pendingToast;
|
|
54
|
-
this.pendingToast = null;
|
|
55
|
-
this.show(config);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
// 显示全局唯一Toast
|
|
59
|
-
show(config) {
|
|
60
|
-
const { key, type, message: message2, descs, duration, placement, onClose } = config;
|
|
61
|
-
if (!this.isInitialized || !this.api) {
|
|
62
|
-
this.pendingToast = config;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
if (this.currentToast?.timer) {
|
|
66
|
-
clearTimeout(this.currentToast.timer);
|
|
67
|
-
}
|
|
68
|
-
if (this.currentToast && this.currentToast.key === key) {
|
|
69
|
-
notification.destroy(key);
|
|
70
|
-
this.createNotification({ key, type, message: message2, descs, duration, placement, onClose });
|
|
71
|
-
} else {
|
|
72
|
-
if (this.currentToast) {
|
|
73
|
-
notification.destroy(this.currentToast.key);
|
|
74
|
-
}
|
|
75
|
-
this.createNotification({ key, type, message: message2, descs, duration, placement, onClose });
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
// 创建通知
|
|
79
|
-
createNotification(config) {
|
|
80
|
-
if (!this.api) return;
|
|
81
|
-
const { key, type, message: message2, descs, duration, placement, onClose } = config;
|
|
82
|
-
const notificationMethod = {
|
|
83
|
-
success: this.api.success.bind(this.api),
|
|
84
|
-
error: this.api.error.bind(this.api),
|
|
85
|
-
info: this.api.info.bind(this.api),
|
|
86
|
-
warning: this.api.warning.bind(this.api)
|
|
87
|
-
}[type];
|
|
88
|
-
notificationMethod({
|
|
89
|
-
key,
|
|
90
|
-
message: message2,
|
|
91
|
-
description: descs,
|
|
92
|
-
duration,
|
|
93
|
-
placement: placement || "topRight",
|
|
94
|
-
icon: iconMap[type],
|
|
95
|
-
onClose: () => {
|
|
96
|
-
if (this.currentToast?.key === key) {
|
|
97
|
-
if (this.currentToast.timer) {
|
|
98
|
-
clearTimeout(this.currentToast.timer);
|
|
99
|
-
}
|
|
100
|
-
this.currentToast = null;
|
|
101
|
-
}
|
|
102
|
-
onClose?.();
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
this.currentToast = {
|
|
106
|
-
key,
|
|
107
|
-
type,
|
|
108
|
-
message: message2,
|
|
109
|
-
descs,
|
|
110
|
-
duration,
|
|
111
|
-
placement,
|
|
112
|
-
timer: null
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
// 关闭当前 toast
|
|
116
|
-
close() {
|
|
117
|
-
if (this.currentToast) {
|
|
118
|
-
if (this.currentToast.timer) {
|
|
119
|
-
clearTimeout(this.currentToast.timer);
|
|
120
|
-
}
|
|
121
|
-
notification.destroy(this.currentToast.key);
|
|
122
|
-
this.currentToast = null;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
// 销毁所有 toast
|
|
126
|
-
destroy() {
|
|
127
|
-
this.close();
|
|
128
|
-
notification.destroy();
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
__publicField(_SingletonToastManager, "instance");
|
|
132
|
-
var SingletonToastManager = _SingletonToastManager;
|
|
133
|
-
var singletonManager = SingletonToastManager.getInstance();
|
|
134
|
-
function parseToastOptions(options) {
|
|
135
|
-
if (typeof options === "string") {
|
|
136
|
-
return { message: options, duration: 3 };
|
|
137
|
-
}
|
|
138
|
-
return options;
|
|
139
|
-
}
|
|
140
|
-
function getIcon(type) {
|
|
141
|
-
return iconMap[type];
|
|
142
|
-
}
|
|
143
|
-
var uiToast = {
|
|
144
|
-
success: (options) => {
|
|
145
|
-
if (!options) return;
|
|
146
|
-
const config = parseToastOptions(options);
|
|
147
|
-
notification.success({
|
|
148
|
-
message: config.message,
|
|
149
|
-
description: config.descs,
|
|
150
|
-
duration: config.duration,
|
|
151
|
-
placement: config.placement,
|
|
152
|
-
icon: getIcon("success"),
|
|
153
|
-
onClose: config.onClose
|
|
154
|
-
});
|
|
155
|
-
},
|
|
156
|
-
error: (options) => {
|
|
157
|
-
if (!options) return;
|
|
158
|
-
const config = parseToastOptions(options);
|
|
159
|
-
notification.error({
|
|
160
|
-
message: config.message,
|
|
161
|
-
description: config.descs,
|
|
162
|
-
duration: config.duration,
|
|
163
|
-
placement: config.placement,
|
|
164
|
-
icon: getIcon("error"),
|
|
165
|
-
onClose: config.onClose
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
info: (options) => {
|
|
169
|
-
if (!options) return;
|
|
170
|
-
const config = parseToastOptions(options);
|
|
171
|
-
notification.info({
|
|
172
|
-
message: config.message,
|
|
173
|
-
description: config.descs,
|
|
174
|
-
duration: config.duration,
|
|
175
|
-
placement: config.placement,
|
|
176
|
-
icon: getIcon("info"),
|
|
177
|
-
onClose: config.onClose
|
|
178
|
-
});
|
|
179
|
-
},
|
|
180
|
-
warning: (options) => {
|
|
181
|
-
if (!options) return;
|
|
182
|
-
const config = parseToastOptions(options);
|
|
183
|
-
notification.warning({
|
|
184
|
-
message: config.message,
|
|
185
|
-
description: config.descs,
|
|
186
|
-
duration: config.duration,
|
|
187
|
-
placement: config.placement,
|
|
188
|
-
icon: getIcon("warning"),
|
|
189
|
-
onClose: config.onClose
|
|
190
|
-
});
|
|
191
|
-
},
|
|
192
|
-
// 自定义类型的toast
|
|
193
|
-
custom: (type, options) => {
|
|
194
|
-
const { message: message2, descs, duration, placement, onClose } = options;
|
|
195
|
-
notification[type]({
|
|
196
|
-
message: message2,
|
|
197
|
-
description: descs,
|
|
198
|
-
duration,
|
|
199
|
-
placement,
|
|
200
|
-
icon: getIcon(type),
|
|
201
|
-
onClose
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
var UIToast_default = uiToast;
|
|
206
|
-
|
|
207
|
-
// src/ui/UILoading.tsx
|
|
208
|
-
import { Spin } from "antd";
|
|
209
|
-
import { LoadingOutlined } from "@ant-design/icons";
|
|
210
|
-
import { createRoot } from "react-dom/client";
|
|
211
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
212
|
-
var loadingSymbol = /* @__PURE__ */ Symbol("loading");
|
|
213
|
-
function getLoadingGlobalProps() {
|
|
214
|
-
let props = window[loadingSymbol];
|
|
215
|
-
if (!props) {
|
|
216
|
-
props = { count: 0, timeoutId: 0, inTimeout: false };
|
|
217
|
-
window[loadingSymbol] = props;
|
|
218
|
-
}
|
|
219
|
-
return props;
|
|
220
|
-
}
|
|
221
|
-
var defaultOptions = {
|
|
222
|
-
tip: "",
|
|
223
|
-
fullscreen: true,
|
|
224
|
-
delay: 0,
|
|
225
|
-
mask: true,
|
|
226
|
-
iconSize: 40,
|
|
227
|
-
wrapperClassName: "ui-loading-wrapper"
|
|
228
|
-
};
|
|
229
|
-
var UILoading = (props) => {
|
|
230
|
-
const options = { ...defaultOptions, ...props };
|
|
231
|
-
const {
|
|
232
|
-
tip,
|
|
233
|
-
fullscreen,
|
|
234
|
-
mask,
|
|
235
|
-
maskStyle,
|
|
236
|
-
iconSize,
|
|
237
|
-
iconStyle,
|
|
238
|
-
containerStyle,
|
|
239
|
-
wrapperClassName
|
|
240
|
-
} = options;
|
|
241
|
-
const loadingIcon = /* @__PURE__ */ jsx2(
|
|
242
|
-
LoadingOutlined,
|
|
243
|
-
{
|
|
244
|
-
style: {
|
|
245
|
-
fontSize: iconSize,
|
|
246
|
-
color: "#1677ff",
|
|
247
|
-
...iconStyle
|
|
248
|
-
},
|
|
249
|
-
spin: true
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
const fullscreenStyle = fullscreen ? {
|
|
253
|
-
position: "fixed",
|
|
254
|
-
top: 0,
|
|
255
|
-
left: 0,
|
|
256
|
-
right: 0,
|
|
257
|
-
bottom: 0,
|
|
258
|
-
zIndex: 9999,
|
|
259
|
-
display: "flex",
|
|
260
|
-
justifyContent: "center",
|
|
261
|
-
alignItems: "center",
|
|
262
|
-
backgroundColor: mask ? "rgba(0, 0, 0, 0.45)" : "transparent",
|
|
263
|
-
...maskStyle
|
|
264
|
-
} : {};
|
|
265
|
-
const containerStyles = {
|
|
266
|
-
display: "flex",
|
|
267
|
-
flexDirection: "column",
|
|
268
|
-
alignItems: "center",
|
|
269
|
-
justifyContent: "center",
|
|
270
|
-
...containerStyle
|
|
271
|
-
};
|
|
272
|
-
return /* @__PURE__ */ jsx2("div", { style: fullscreenStyle, className: wrapperClassName, children: /* @__PURE__ */ jsx2("div", { style: containerStyles, children: /* @__PURE__ */ jsx2(Spin, { indicator: loadingIcon, children: tip }) }) });
|
|
273
|
-
};
|
|
274
|
-
var loadingInstance = null;
|
|
275
|
-
var rootInstance = null;
|
|
276
|
-
var createLoadingInstance = (options = {}) => {
|
|
277
|
-
if (loadingInstance && rootInstance) {
|
|
278
|
-
rootInstance.unmount();
|
|
279
|
-
document.body.removeChild(loadingInstance);
|
|
280
|
-
loadingInstance = null;
|
|
281
|
-
rootInstance = null;
|
|
282
|
-
}
|
|
283
|
-
loadingInstance = document.createElement("div");
|
|
284
|
-
document.body.appendChild(loadingInstance);
|
|
285
|
-
rootInstance = createRoot(loadingInstance);
|
|
286
|
-
rootInstance.render(/* @__PURE__ */ jsx2(UILoading, { ...options }));
|
|
287
|
-
return loadingInstance;
|
|
288
|
-
};
|
|
289
|
-
var uiLoading = {
|
|
290
|
-
// 显示加载
|
|
291
|
-
show: (options = {}) => {
|
|
292
|
-
let props = getLoadingGlobalProps();
|
|
293
|
-
props.count++;
|
|
294
|
-
const mergedOptions = { ...defaultOptions, ...options };
|
|
295
|
-
if (mergedOptions.delay && mergedOptions.delay > 0) {
|
|
296
|
-
if (props.timeoutId != 0) {
|
|
297
|
-
window.clearTimeout(props.timeoutId);
|
|
298
|
-
props.timeoutId = 0;
|
|
299
|
-
}
|
|
300
|
-
props.timeoutId = window.setTimeout(() => {
|
|
301
|
-
props.timeoutId = 0;
|
|
302
|
-
createLoadingInstance(mergedOptions);
|
|
303
|
-
}, mergedOptions.delay);
|
|
304
|
-
return;
|
|
305
|
-
} else {
|
|
306
|
-
createLoadingInstance(mergedOptions);
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
// 隐藏加载
|
|
310
|
-
hide: () => {
|
|
311
|
-
let props = getLoadingGlobalProps();
|
|
312
|
-
if (props.count <= 0) {
|
|
313
|
-
console.warn("Loading count is less than 0");
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
props.count--;
|
|
317
|
-
if (props.timeoutId != 0) {
|
|
318
|
-
window.clearTimeout(props.timeoutId);
|
|
319
|
-
props.timeoutId = 0;
|
|
320
|
-
}
|
|
321
|
-
if (props.count == 0 && loadingInstance && rootInstance) {
|
|
322
|
-
rootInstance.unmount();
|
|
323
|
-
document.body.removeChild(loadingInstance);
|
|
324
|
-
loadingInstance = null;
|
|
325
|
-
rootInstance = null;
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
// 服务方法 - 自动在Promise完成后隐藏
|
|
329
|
-
service: (promise, options = {}) => {
|
|
330
|
-
uiLoading.show(options);
|
|
331
|
-
return promise.then((res) => {
|
|
332
|
-
uiLoading.hide();
|
|
333
|
-
return res;
|
|
334
|
-
}).catch((err) => {
|
|
335
|
-
uiLoading.hide();
|
|
336
|
-
throw err;
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
};
|
|
340
|
-
var UILoading_default = uiLoading;
|
|
341
|
-
|
|
342
|
-
// src/api/_base.ts
|
|
343
|
-
import * as febs2 from "febs-browser";
|
|
344
|
-
|
|
345
|
-
// src/utils/storage.ts
|
|
346
|
-
import * as febs from "febs-browser";
|
|
347
|
-
import store from "store2";
|
|
348
|
-
var Store = class {
|
|
349
|
-
constructor(s) {
|
|
350
|
-
__publicField(this, "s");
|
|
351
|
-
this.s = s;
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* @descs: 数据条数.
|
|
355
|
-
*/
|
|
356
|
-
get length() {
|
|
357
|
-
return this.s.size();
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* @descs: 所有的key.
|
|
361
|
-
*/
|
|
362
|
-
keys() {
|
|
363
|
-
return this.s.keys();
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* @descs: 设置信息.
|
|
367
|
-
*/
|
|
368
|
-
set(key, data) {
|
|
369
|
-
if (!data) {
|
|
370
|
-
return this.remove(key);
|
|
371
|
-
}
|
|
372
|
-
data = JSON.stringify(data);
|
|
373
|
-
data = febs.crypt.base64_encode(data);
|
|
374
|
-
this.s.set(key, data, true);
|
|
375
|
-
return this;
|
|
376
|
-
}
|
|
377
|
-
/**
|
|
378
|
-
* @descs: 获取信息.
|
|
379
|
-
* @param alt: 如果获取不到信息, 使用此数据返回.
|
|
380
|
-
*/
|
|
381
|
-
get(key, alt = null) {
|
|
382
|
-
if (!this.s.has(key)) {
|
|
383
|
-
return alt;
|
|
384
|
-
}
|
|
385
|
-
let r = this.s.get(key);
|
|
386
|
-
if (r) {
|
|
387
|
-
r = febs.crypt.base64_decode(r);
|
|
388
|
-
r = febs.string.bytesToUtf8(r || []);
|
|
389
|
-
try {
|
|
390
|
-
return JSON.parse(r);
|
|
391
|
-
} catch (e) {
|
|
392
|
-
this.remove(key);
|
|
393
|
-
return null;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
return r;
|
|
397
|
-
}
|
|
398
|
-
/**
|
|
399
|
-
* @descs: 移除信息.
|
|
400
|
-
*/
|
|
401
|
-
remove(key) {
|
|
402
|
-
this.s.remove(key);
|
|
403
|
-
return this;
|
|
404
|
-
}
|
|
405
|
-
/**
|
|
406
|
-
* @descs: 清空.
|
|
407
|
-
*/
|
|
408
|
-
clear() {
|
|
409
|
-
this.s.clearAll();
|
|
410
|
-
return this;
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
var storage = {
|
|
414
|
-
/**
|
|
415
|
-
* @descs: 通用命名空间获取一个新的store.
|
|
416
|
-
*/
|
|
417
|
-
namespace: function(nm) {
|
|
418
|
-
return new Store(store.namespace(nm || "default"));
|
|
419
|
-
},
|
|
420
|
-
/**
|
|
421
|
-
* @descs: 使用session方式存储.
|
|
422
|
-
*/
|
|
423
|
-
namespace_session: function(nm) {
|
|
424
|
-
return new Store(store.session.namespace(nm || "default"));
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// src/api/_base.ts
|
|
429
|
-
var ResponseCode = /* @__PURE__ */ ((ResponseCode4) => {
|
|
430
|
-
ResponseCode4[ResponseCode4["SUCCESS"] = 200] = "SUCCESS";
|
|
431
|
-
ResponseCode4[ResponseCode4["OPERATOR_ERROR"] = 400] = "OPERATOR_ERROR";
|
|
432
|
-
ResponseCode4[ResponseCode4["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
433
|
-
ResponseCode4[ResponseCode4["UNPERMISSION"] = 402] = "UNPERMISSION";
|
|
434
|
-
ResponseCode4[ResponseCode4["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
435
|
-
ResponseCode4[ResponseCode4["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
436
|
-
ResponseCode4[ResponseCode4["PARAM_ERROR"] = 601] = "PARAM_ERROR";
|
|
437
|
-
ResponseCode4[ResponseCode4["REQUEST_LIMIT"] = 602] = "REQUEST_LIMIT";
|
|
438
|
-
return ResponseCode4;
|
|
439
|
-
})(ResponseCode || {});
|
|
440
|
-
function getResponseCodeMsg(code) {
|
|
441
|
-
switch (code) {
|
|
442
|
-
case 404 /* NOT_FOUND */:
|
|
443
|
-
return "\u8D44\u6E90\u4E0D\u5B58\u5728";
|
|
444
|
-
case 400 /* OPERATOR_ERROR */:
|
|
445
|
-
return "\u7CFB\u7EDF\u64CD\u4F5C\u9519\u8BEF";
|
|
446
|
-
case 601 /* PARAM_ERROR */:
|
|
447
|
-
return "\u53C2\u6570\u9519\u8BEF";
|
|
448
|
-
case 602 /* REQUEST_LIMIT */:
|
|
449
|
-
return "\u8FBE\u5230\u8BBF\u95EE\u9650\u5236";
|
|
450
|
-
case 503 /* SERVICE_UNAVAILABLE */:
|
|
451
|
-
return "\u670D\u52A1\u4E0D\u53EF\u7528";
|
|
452
|
-
case 401 /* UNAUTHORIZED */:
|
|
453
|
-
return "\u672A\u767B\u5F55";
|
|
454
|
-
case 402 /* UNPERMISSION */:
|
|
455
|
-
return "\u65E0\u6743\u9650";
|
|
456
|
-
default:
|
|
457
|
-
return "\u672A\u77E5\u9519\u8BEF";
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
var api = axios.create({
|
|
461
|
-
baseURL: import.meta.env.VITE_API_BASE,
|
|
462
|
-
timeout: Number(import.meta.env.VITE_API_TIMEOUT) || 5e3,
|
|
463
|
-
headers: {
|
|
464
|
-
"Content-Type": "application/json;charset=UTF-8"
|
|
465
|
-
},
|
|
466
|
-
withCredentials: true
|
|
467
|
-
});
|
|
468
|
-
var _AuthorizationHandler = class _AuthorizationHandler {
|
|
469
|
-
static clearStoreToken() {
|
|
470
|
-
this.setStoreToken(null, 0);
|
|
471
|
-
}
|
|
472
|
-
static getStoreToken() {
|
|
473
|
-
let token = storage.namespace("bp.ss").get("ss");
|
|
474
|
-
if (token) {
|
|
475
|
-
let exp = storage.namespace("bp.ss").get("exp");
|
|
476
|
-
return {
|
|
477
|
-
token: JSON.parse(token),
|
|
478
|
-
exp: exp ? JSON.parse(exp) : 0
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
return null;
|
|
482
|
-
}
|
|
483
|
-
static getValidStoreToken() {
|
|
484
|
-
const token = _AuthorizationHandler.getStoreToken();
|
|
485
|
-
if (token && token.exp > Date.now() - _AuthorizationHandler.TOKEN_EXP) {
|
|
486
|
-
return token.token;
|
|
487
|
-
}
|
|
488
|
-
return null;
|
|
489
|
-
}
|
|
490
|
-
static setStoreToken(token, exp) {
|
|
491
|
-
if (!token) {
|
|
492
|
-
storage.namespace("bp.ss").clear();
|
|
493
|
-
} else {
|
|
494
|
-
storage.namespace("bp.ss").set("ss", JSON.stringify(token));
|
|
495
|
-
storage.namespace("bp.ss").set("exp", JSON.stringify(exp));
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
static requestHandleSid(ctx) {
|
|
499
|
-
let token = _AuthorizationHandler.getStoreToken();
|
|
500
|
-
if (token) {
|
|
501
|
-
if (token.exp > Date.now() - _AuthorizationHandler.TOKEN_EXP) {
|
|
502
|
-
ctx.headers.set(
|
|
503
|
-
_AuthorizationHandler.HEADER_NAME,
|
|
504
|
-
_AuthorizationHandler.HEADER_PREFIX + token.token
|
|
505
|
-
);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
static responseHandleSid(ctx) {
|
|
510
|
-
let token = ctx.headers.get(_AuthorizationHandler.HEADER_NAME);
|
|
511
|
-
if (token && token.startsWith(_AuthorizationHandler.HEADER_PREFIX.trim())) {
|
|
512
|
-
token = token.replace(_AuthorizationHandler.HEADER_PREFIX, "");
|
|
513
|
-
let oldToken = token;
|
|
514
|
-
token = token.split(".")[1];
|
|
515
|
-
if (token) {
|
|
516
|
-
token = febs2.string.bytesToUtf8(febs2.crypt.base64_decode(token));
|
|
517
|
-
if (token) {
|
|
518
|
-
let tokenObj = JSON.parse(token);
|
|
519
|
-
if (tokenObj.exp < Date.now() - _AuthorizationHandler.TOKEN_EXP) {
|
|
520
|
-
_AuthorizationHandler.clearStoreToken();
|
|
521
|
-
return false;
|
|
522
|
-
} else {
|
|
523
|
-
_AuthorizationHandler.setStoreToken(oldToken, tokenObj.exp);
|
|
524
|
-
return true;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
_AuthorizationHandler.clearStoreToken();
|
|
529
|
-
if (typeof navigator !== "undefined" && navigator.onLine) {
|
|
530
|
-
window.location.href = "/";
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
return false;
|
|
534
|
-
}
|
|
535
|
-
};
|
|
536
|
-
__publicField(_AuthorizationHandler, "HEADER_NAME", "Authorization");
|
|
537
|
-
__publicField(_AuthorizationHandler, "HEADER_PREFIX", "SPBearer ");
|
|
538
|
-
__publicField(_AuthorizationHandler, "TOKEN_EXP", 20 * 1e3);
|
|
539
|
-
var AuthorizationHandler = _AuthorizationHandler;
|
|
540
|
-
api.interceptors.request.use(
|
|
541
|
-
(config) => {
|
|
542
|
-
UILoading_default.show({
|
|
543
|
-
delay: 5e3
|
|
544
|
-
});
|
|
545
|
-
AuthorizationHandler.requestHandleSid(config);
|
|
546
|
-
return config;
|
|
547
|
-
},
|
|
548
|
-
(error) => {
|
|
549
|
-
UILoading_default.hide();
|
|
550
|
-
console.log("Request Error ==========");
|
|
551
|
-
return Promise.reject(error);
|
|
552
|
-
}
|
|
553
|
-
);
|
|
554
|
-
api.interceptors.response.use(
|
|
555
|
-
(res) => {
|
|
556
|
-
UILoading_default.hide();
|
|
557
|
-
if (res.data.code !== 200 /* SUCCESS */) {
|
|
558
|
-
UIToast_default.warning(res.data.message || getResponseCodeMsg(res.data.code));
|
|
559
|
-
}
|
|
560
|
-
AuthorizationHandler.responseHandleSid(res);
|
|
561
|
-
return res.data;
|
|
562
|
-
},
|
|
563
|
-
(error) => {
|
|
564
|
-
UILoading_default.hide();
|
|
565
|
-
if (error instanceof AxiosError) {
|
|
566
|
-
if (error.code === "ERR_NETWORK" || error.code === "ECONNABORTED") {
|
|
567
|
-
UIToast_default.error("\u7F51\u7EDC\u9519\u8BEF");
|
|
568
|
-
} else if (error.code === "ERR_BAD_RESPONSE") {
|
|
569
|
-
UIToast_default.error("\u670D\u52A1\u5668\u65E0\u54CD\u5E94");
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
console.log("Response Error ==========");
|
|
573
|
-
return Promise.reject(error);
|
|
574
|
-
}
|
|
575
|
-
);
|
|
576
|
-
var HttpRequest = {
|
|
577
|
-
get(url, params, data) {
|
|
578
|
-
const config = {
|
|
579
|
-
method: "get",
|
|
580
|
-
url,
|
|
581
|
-
params,
|
|
582
|
-
data
|
|
583
|
-
};
|
|
584
|
-
return api(config);
|
|
585
|
-
},
|
|
586
|
-
post(url, params, data) {
|
|
587
|
-
const config = {
|
|
588
|
-
method: "post",
|
|
589
|
-
url,
|
|
590
|
-
params,
|
|
591
|
-
data
|
|
592
|
-
};
|
|
593
|
-
return api(config);
|
|
594
|
-
},
|
|
595
|
-
put(url, params, data) {
|
|
596
|
-
const config = {
|
|
597
|
-
method: "put",
|
|
598
|
-
url,
|
|
599
|
-
params,
|
|
600
|
-
data
|
|
601
|
-
};
|
|
602
|
-
return api(config);
|
|
603
|
-
},
|
|
604
|
-
delete(url, params, data) {
|
|
605
|
-
const config = {
|
|
606
|
-
method: "delete",
|
|
607
|
-
url,
|
|
608
|
-
params,
|
|
609
|
-
data
|
|
610
|
-
};
|
|
611
|
-
return api(config);
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
// src/api/user.ts
|
|
616
|
-
var user_exports = {};
|
|
617
|
-
__export(user_exports, {
|
|
618
|
-
admin: () => admin,
|
|
619
|
-
gateway: () => gateway,
|
|
620
|
-
message: () => message,
|
|
621
|
-
role: () => role,
|
|
622
|
-
user: () => user
|
|
623
|
-
});
|
|
624
|
-
var admin = {
|
|
625
|
-
/*
|
|
626
|
-
* 注册管理员
|
|
627
|
-
* 注册管理员
|
|
628
|
-
*/
|
|
629
|
-
registerAdmin: (data) => {
|
|
630
|
-
return HttpRequest.post("/api/admin/registerAdmin", null, { phone: data.phone, email: data.email, displayModules: data.displayModules, username: data.username, nickname: data.nickname, pwd: data.pwd, smsCode: data.smsCode }).then((res) => {
|
|
631
|
-
return res;
|
|
632
|
-
});
|
|
633
|
-
},
|
|
634
|
-
/*
|
|
635
|
-
* 注册普通用户
|
|
636
|
-
* 注册普通用户
|
|
637
|
-
*/
|
|
638
|
-
registerUser: (data) => {
|
|
639
|
-
return HttpRequest.post("/api/admin/registerUser", null, { phone: data.phone, email: data.email, displayModules: data.displayModules, username: data.username, nickname: data.nickname, pwd: data.pwd, smsCode: data.smsCode, manager_id: data.manager_id }).then((res) => {
|
|
640
|
-
return res;
|
|
641
|
-
});
|
|
642
|
-
},
|
|
643
|
-
/*
|
|
644
|
-
* 更新其他用户信息: 用户名与手机号
|
|
645
|
-
* 更新其他用户信息: 用户名与手机号
|
|
646
|
-
*/
|
|
647
|
-
updateInfoByAdmin: (data) => {
|
|
648
|
-
return HttpRequest.post("/api/admin/updateByAdmin", null, { id: data.id, is_forbidden: data.is_forbidden, title: data.title, phone: data.phone, email: data.email, displayModules: data.displayModules, username: data.username, nickname: data.nickname, pwd: data.pwd, smsCode: data.smsCode, manager_id: data.manager_id, created_at: data.created_at, tick_avatar_self: data.tick_avatar_self, role_ids: data.role_ids, isAdmin: data.isAdmin, thirdPlatformInfo: data.thirdPlatformInfo, unreadMessageCount: data.unreadMessageCount }).then((res) => {
|
|
649
|
-
return res;
|
|
650
|
-
});
|
|
651
|
-
},
|
|
652
|
-
/*
|
|
653
|
-
* 获取管理员列表
|
|
654
|
-
* 获取管理员列表
|
|
655
|
-
*/
|
|
656
|
-
list: (params) => {
|
|
657
|
-
return HttpRequest.get("/api/admin/list", { pageNum: params.pageNum, pageSize: params.pageSize }, null).then((res) => {
|
|
658
|
-
return res;
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
var gateway = {
|
|
663
|
-
/*
|
|
664
|
-
* 注册用户
|
|
665
|
-
* 注册用户
|
|
666
|
-
*/
|
|
667
|
-
register: (data) => {
|
|
668
|
-
return HttpRequest.post("/api/register", null, { phone: data.phone, email: data.email, displayModules: data.displayModules, username: data.username, nickname: data.nickname, pwd: data.pwd, smsCode: data.smsCode, manager_id: data.manager_id }).then((res) => {
|
|
669
|
-
return res;
|
|
670
|
-
});
|
|
671
|
-
},
|
|
672
|
-
/*
|
|
673
|
-
* 发送短信
|
|
674
|
-
* 发送短信
|
|
675
|
-
*/
|
|
676
|
-
sendSms: (params) => {
|
|
677
|
-
return HttpRequest.post("/api/sendSms", { phone: params.phone, imageCode: params.imageCode }, null).then((res) => {
|
|
678
|
-
return res;
|
|
679
|
-
});
|
|
680
|
-
},
|
|
681
|
-
/*
|
|
682
|
-
* 判断是否登录
|
|
683
|
-
* 判断是否登录
|
|
684
|
-
*/
|
|
685
|
-
isLogin: () => {
|
|
686
|
-
return HttpRequest.get("/api/isLogin", null, null).then((res) => {
|
|
687
|
-
return res;
|
|
688
|
-
});
|
|
689
|
-
},
|
|
690
|
-
/*
|
|
691
|
-
* 登录
|
|
692
|
-
* 登录
|
|
693
|
-
*/
|
|
694
|
-
login: (data) => {
|
|
695
|
-
return HttpRequest.post("/api/login", null, { phone: data.phone, pwd: data.pwd, pwdSN: data.pwdSN, smsCode: data.smsCode }).then((res) => {
|
|
696
|
-
return res;
|
|
697
|
-
});
|
|
698
|
-
},
|
|
699
|
-
/*
|
|
700
|
-
* 校验当前登录用户的登录密码摘要,用于需要二次确认的业务入口。
|
|
701
|
-
* 校验当前登录用户的登录密码摘要,用于需要二次确认的业务入口。
|
|
702
|
-
*/
|
|
703
|
-
verifyPasswordHash: (data) => {
|
|
704
|
-
return HttpRequest.post("/api/verifyPasswordHash", null, { passwordHash: data.passwordHash, passwordSalt: data.passwordSalt }).then((res) => {
|
|
705
|
-
return res;
|
|
706
|
-
});
|
|
707
|
-
},
|
|
708
|
-
/*
|
|
709
|
-
* 退出登录
|
|
710
|
-
* 退出登录
|
|
711
|
-
*/
|
|
712
|
-
logout: () => {
|
|
713
|
-
return HttpRequest.get("/api/logout", null, null).then((res) => {
|
|
714
|
-
return res;
|
|
715
|
-
});
|
|
716
|
-
},
|
|
717
|
-
/*
|
|
718
|
-
* 列出所有权限
|
|
719
|
-
* 列出所有权限
|
|
720
|
-
*/
|
|
721
|
-
listPermissions: () => {
|
|
722
|
-
return HttpRequest.get("/api/listPermissions", null, null).then((res) => {
|
|
723
|
-
return res;
|
|
724
|
-
});
|
|
725
|
-
},
|
|
726
|
-
/*
|
|
727
|
-
* 列出角色权限
|
|
728
|
-
* 列出角色权限
|
|
729
|
-
*/
|
|
730
|
-
listRolePermissions: (params) => {
|
|
731
|
-
return HttpRequest.get("/api/listRolePermissions", { id: params.id }, null).then((res) => {
|
|
732
|
-
return res;
|
|
733
|
-
});
|
|
734
|
-
}
|
|
735
|
-
};
|
|
736
|
-
var message = {
|
|
737
|
-
/*
|
|
738
|
-
* /api/user/message/list
|
|
739
|
-
*/
|
|
740
|
-
list: (params) => {
|
|
741
|
-
return HttpRequest.get("/api/user/message/list", { pageNum: params.pageNum, pageSize: params.pageSize, unread_only: params.unread_only }, null).then((res) => {
|
|
742
|
-
return res;
|
|
743
|
-
});
|
|
744
|
-
},
|
|
745
|
-
/*
|
|
746
|
-
* /api/user/message/unread/count
|
|
747
|
-
*/
|
|
748
|
-
countUnread: () => {
|
|
749
|
-
return HttpRequest.get("/api/user/message/unread/count", null, null).then((res) => {
|
|
750
|
-
return res;
|
|
751
|
-
});
|
|
752
|
-
},
|
|
753
|
-
/*
|
|
754
|
-
* /api/user/message/read
|
|
755
|
-
*/
|
|
756
|
-
markRead: (data) => {
|
|
757
|
-
return HttpRequest.post("/api/user/message/read", null, { messageIds: data.messageIds }).then((res) => {
|
|
758
|
-
return res;
|
|
759
|
-
});
|
|
760
|
-
},
|
|
761
|
-
/*
|
|
762
|
-
* 清除已读消息
|
|
763
|
-
* 清除已读消息
|
|
764
|
-
*/
|
|
765
|
-
clearReaded: (data) => {
|
|
766
|
-
return HttpRequest.delete("/api/user/message/clearReaded", null, { messageIds: data.messageIds }).then((res) => {
|
|
767
|
-
return res;
|
|
768
|
-
});
|
|
769
|
-
}
|
|
770
|
-
};
|
|
771
|
-
var role = {
|
|
772
|
-
/*
|
|
773
|
-
* 列出所有角色
|
|
774
|
-
* 列出所有角色
|
|
775
|
-
*/
|
|
776
|
-
listRoles: () => {
|
|
777
|
-
return HttpRequest.get("/api/role/listRoles", null, null).then((res) => {
|
|
778
|
-
return res;
|
|
779
|
-
});
|
|
780
|
-
},
|
|
781
|
-
/*
|
|
782
|
-
* 创建新角色
|
|
783
|
-
* 创建新角色
|
|
784
|
-
*/
|
|
785
|
-
createRole: (params) => {
|
|
786
|
-
return HttpRequest.post("/api/role/createRole", { name: params.name, descs: params.descs, admin_id: params.admin_id, parent_id: params.parent_id }, null).then((res) => {
|
|
787
|
-
return res;
|
|
788
|
-
});
|
|
789
|
-
},
|
|
790
|
-
/*
|
|
791
|
-
* 更新角色
|
|
792
|
-
* 更新角色
|
|
793
|
-
*/
|
|
794
|
-
updateRole: (params) => {
|
|
795
|
-
return HttpRequest.post("/api/role/updateRole", { id: params.id, name: params.name, descs: params.descs, admin_id: params.admin_id, parent_id: params.parent_id }, null).then((res) => {
|
|
796
|
-
return res;
|
|
797
|
-
});
|
|
798
|
-
},
|
|
799
|
-
/*
|
|
800
|
-
* 为角色分配权限
|
|
801
|
-
* 为角色分配权限
|
|
802
|
-
*/
|
|
803
|
-
assignPermissionsToRole: (data) => {
|
|
804
|
-
return HttpRequest.post("/api/role/assignPermissionsToRole", null, { role_id: data.role_id, permissions: data.permissions }).then((res) => {
|
|
805
|
-
return res;
|
|
806
|
-
});
|
|
807
|
-
},
|
|
808
|
-
/*
|
|
809
|
-
* 为用户分配角色
|
|
810
|
-
* 为用户分配角色
|
|
811
|
-
*/
|
|
812
|
-
assignRoleToUserPermission: () => {
|
|
813
|
-
return HttpRequest.post("/api/role/assignRoleToUserPermission", null, null).then((res) => {
|
|
814
|
-
return res;
|
|
815
|
-
});
|
|
816
|
-
},
|
|
817
|
-
/*
|
|
818
|
-
* 为用户分配角色
|
|
819
|
-
* 为用户分配角色
|
|
820
|
-
*/
|
|
821
|
-
assignRoleToUser: (data) => {
|
|
822
|
-
return HttpRequest.post("/api/role/assignRoleToUser", null, { user_id: data.user_id, role_ids: data.role_ids }).then((res) => {
|
|
823
|
-
return res;
|
|
824
|
-
});
|
|
825
|
-
},
|
|
826
|
-
/*
|
|
827
|
-
* 获取用户拥有的所有角色
|
|
828
|
-
* 获取用户拥有的所有角色
|
|
829
|
-
*/
|
|
830
|
-
listUserRoles: (params) => {
|
|
831
|
-
return HttpRequest.get("/api/role/listUserRoles", { user_id: params.user_id }, null).then((res) => {
|
|
832
|
-
return res;
|
|
833
|
-
});
|
|
834
|
-
},
|
|
835
|
-
/*
|
|
836
|
-
* 获取用户拥有的所有权限
|
|
837
|
-
* 获取用户拥有的所有权限
|
|
838
|
-
*/
|
|
839
|
-
listUserPermissions: (params) => {
|
|
840
|
-
return HttpRequest.get("/api/role/listUserPermissions", { user_id: params.user_id }, null).then((res) => {
|
|
841
|
-
return res;
|
|
842
|
-
});
|
|
843
|
-
},
|
|
844
|
-
/*
|
|
845
|
-
* 列出所有部门
|
|
846
|
-
* 列出所有部门
|
|
847
|
-
*/
|
|
848
|
-
listCompanies: () => {
|
|
849
|
-
return HttpRequest.get("/api/role/listCompanies", null, null).then((res) => {
|
|
850
|
-
return res;
|
|
851
|
-
});
|
|
852
|
-
},
|
|
853
|
-
/*
|
|
854
|
-
* 创建新公司
|
|
855
|
-
* 创建新公司
|
|
856
|
-
*/
|
|
857
|
-
createCompany: (params) => {
|
|
858
|
-
return HttpRequest.post("/api/role/createCompany", { name: params.name, descs: params.descs, admin_id: params.admin_id, parent_id: params.parent_id, is_spv_company: params.is_spv_company }, null).then((res) => {
|
|
859
|
-
return res;
|
|
860
|
-
});
|
|
861
|
-
},
|
|
862
|
-
/*
|
|
863
|
-
* 更新公司
|
|
864
|
-
* 更新公司
|
|
865
|
-
*/
|
|
866
|
-
updateCompany: (params) => {
|
|
867
|
-
return HttpRequest.post("/api/role/updateCompany", { id: params.id, name: params.name, descs: params.descs, admin_id: params.admin_id, parent_id: params.parent_id, is_spv_company: params.is_spv_company }, null).then((res) => {
|
|
868
|
-
return res;
|
|
869
|
-
});
|
|
870
|
-
},
|
|
871
|
-
/*
|
|
872
|
-
* 列出所有部门
|
|
873
|
-
* 列出所有部门
|
|
874
|
-
*/
|
|
875
|
-
listDepartments: () => {
|
|
876
|
-
return HttpRequest.get("/api/role/listDepartments", null, null).then((res) => {
|
|
877
|
-
return res;
|
|
878
|
-
});
|
|
879
|
-
},
|
|
880
|
-
/*
|
|
881
|
-
* 创建新部门
|
|
882
|
-
* 创建新部门
|
|
883
|
-
*/
|
|
884
|
-
createDepartment: (params) => {
|
|
885
|
-
return HttpRequest.post("/api/role/createDepartment", { name: params.name, descs: params.descs, admin_id: params.admin_id, company_id: params.company_id, parent_id: params.parent_id }, null).then((res) => {
|
|
886
|
-
return res;
|
|
887
|
-
});
|
|
888
|
-
},
|
|
889
|
-
/*
|
|
890
|
-
* 更新部门
|
|
891
|
-
* 更新部门
|
|
892
|
-
*/
|
|
893
|
-
updateDepartment: (params) => {
|
|
894
|
-
return HttpRequest.post("/api/role/updateDepartment", { id: params.id, name: params.name, descs: params.descs, admin_id: params.admin_id, company_id: params.company_id, parent_id: params.parent_id }, null).then((res) => {
|
|
895
|
-
return res;
|
|
896
|
-
});
|
|
897
|
-
},
|
|
898
|
-
/*
|
|
899
|
-
* 为用户分配部门
|
|
900
|
-
* 为用户分配部门
|
|
901
|
-
*/
|
|
902
|
-
assignUserToDepartment: (params) => {
|
|
903
|
-
return HttpRequest.post("/api/role/assignUserToDepartment", { user_id: params.user_id, department_id: params.department_id, position: params.position }, null).then((res) => {
|
|
904
|
-
return res;
|
|
905
|
-
});
|
|
906
|
-
},
|
|
907
|
-
/*
|
|
908
|
-
* 为用户移除部门
|
|
909
|
-
* 为用户移除部门
|
|
910
|
-
*/
|
|
911
|
-
removeUserFromDepartment: (params) => {
|
|
912
|
-
return HttpRequest.post("/api/role/removeUserFromDepartment", { user_id: params.user_id, department_id: params.department_id }, null).then((res) => {
|
|
913
|
-
return res;
|
|
914
|
-
});
|
|
915
|
-
},
|
|
916
|
-
/*
|
|
917
|
-
* 获取公司拥有的所有部门
|
|
918
|
-
* 获取公司拥有的所有部门
|
|
919
|
-
*/
|
|
920
|
-
listCompanyDepartments: (params) => {
|
|
921
|
-
return HttpRequest.get("/api/role/listCompanyDepartments", { company_id: params.company_id }, null).then((res) => {
|
|
922
|
-
return res;
|
|
923
|
-
});
|
|
924
|
-
},
|
|
925
|
-
/*
|
|
926
|
-
* 获取用户拥有的所有部门
|
|
927
|
-
* 获取用户拥有的所有部门
|
|
928
|
-
*/
|
|
929
|
-
listUserDepartments: (params) => {
|
|
930
|
-
return HttpRequest.get("/api/role/listUserDepartments", { user_id: params.user_id }, null).then((res) => {
|
|
931
|
-
return res;
|
|
932
|
-
});
|
|
933
|
-
},
|
|
934
|
-
/*
|
|
935
|
-
* 获取用户拥有的所有部门
|
|
936
|
-
* 获取用户拥有的所有部门
|
|
937
|
-
*/
|
|
938
|
-
listDepartmentUsers: (params) => {
|
|
939
|
-
return HttpRequest.get("/api/role/listDepartmentUsers", { department_id: params.department_id }, null).then((res) => {
|
|
940
|
-
return res;
|
|
941
|
-
});
|
|
942
|
-
}
|
|
943
|
-
};
|
|
944
|
-
var user = {
|
|
945
|
-
/*
|
|
946
|
-
* 获取用户信息; (也可以获取管理员信息)
|
|
947
|
-
* 获取用户信息; (也可以获取管理员信息)
|
|
948
|
-
*/
|
|
949
|
-
getInfoByUsername: (params) => {
|
|
950
|
-
return HttpRequest.get("/api/user/infoByUsername", { username: params.username }, null).then((res) => {
|
|
951
|
-
return res;
|
|
952
|
-
});
|
|
953
|
-
},
|
|
954
|
-
/*
|
|
955
|
-
* 获取用户信息; (也可以获取管理员信息)
|
|
956
|
-
* 获取用户信息; (也可以获取管理员信息)
|
|
957
|
-
*/
|
|
958
|
-
getInfo: (params) => {
|
|
959
|
-
return HttpRequest.get("/api/user/info", { id: params.id }, null).then((res) => {
|
|
960
|
-
return res;
|
|
961
|
-
});
|
|
962
|
-
},
|
|
963
|
-
/*
|
|
964
|
-
* 获取用户头像信息; (也可以获取管理员信息)
|
|
965
|
-
* 获取用户头像信息; (也可以获取管理员信息)
|
|
966
|
-
*/
|
|
967
|
-
getAvatar: (params) => {
|
|
968
|
-
return HttpRequest.get("/api/user/avatar", { id: params.id, tick: params.tick }, null).then((res) => {
|
|
969
|
-
return res;
|
|
970
|
-
});
|
|
971
|
-
},
|
|
972
|
-
/*
|
|
973
|
-
* 获取用户头像列表信息; (也可以获取管理员信息)
|
|
974
|
-
* 获取用户头像列表信息; (也可以获取管理员信息)
|
|
975
|
-
*/
|
|
976
|
-
getAvatarList: (params) => {
|
|
977
|
-
return HttpRequest.get("/api/user/avatar_list", { ids: params.ids }, null).then((res) => {
|
|
978
|
-
return res;
|
|
979
|
-
});
|
|
980
|
-
},
|
|
981
|
-
/*
|
|
982
|
-
* 更新用户头像
|
|
983
|
-
* 更新用户头像
|
|
984
|
-
*/
|
|
985
|
-
updateAvatar: (data) => {
|
|
986
|
-
return HttpRequest.post("/api/user/updateAvatar", null, { id: data.id, avatar: data.avatar, avatar_small: data.avatar_small, tick_self: data.tick_self }).then((res) => {
|
|
987
|
-
return res;
|
|
988
|
-
});
|
|
989
|
-
},
|
|
990
|
-
/*
|
|
991
|
-
* 更新直接领导
|
|
992
|
-
* 更新直接领导
|
|
993
|
-
*/
|
|
994
|
-
updateManager: (params) => {
|
|
995
|
-
return HttpRequest.post("/api/user/updateManager", { id: params.id, managerid: params.managerid }, null).then((res) => {
|
|
996
|
-
return res;
|
|
997
|
-
});
|
|
998
|
-
},
|
|
999
|
-
/*
|
|
1000
|
-
* 更新用户信息
|
|
1001
|
-
* 更新用户信息
|
|
1002
|
-
*/
|
|
1003
|
-
updateInfo: (data) => {
|
|
1004
|
-
return HttpRequest.post("/api/user/update", null, { id: data.id, is_forbidden: data.is_forbidden, title: data.title, phone: data.phone, email: data.email, displayModules: data.displayModules, username: data.username, nickname: data.nickname, pwd: data.pwd, smsCode: data.smsCode, manager_id: data.manager_id, created_at: data.created_at, tick_avatar_self: data.tick_avatar_self, role_ids: data.role_ids, isAdmin: data.isAdmin, thirdPlatformInfo: data.thirdPlatformInfo, unreadMessageCount: data.unreadMessageCount }).then((res) => {
|
|
1005
|
-
return res;
|
|
1006
|
-
});
|
|
1007
|
-
},
|
|
1008
|
-
/*
|
|
1009
|
-
* 更新用户密码
|
|
1010
|
-
* 更新用户密码
|
|
1011
|
-
*/
|
|
1012
|
-
updatePassword: (data) => {
|
|
1013
|
-
return HttpRequest.post("/api/user/updatePassword", null, { old_password: data.old_password, old_password_sn: data.old_password_sn, new_password: data.new_password }).then((res) => {
|
|
1014
|
-
return res;
|
|
1015
|
-
});
|
|
1016
|
-
},
|
|
1017
|
-
/*
|
|
1018
|
-
* 删除用户
|
|
1019
|
-
* 删除用户
|
|
1020
|
-
*/
|
|
1021
|
-
deleteUser: (params) => {
|
|
1022
|
-
return HttpRequest.post("/api/user/delete", { id: params.id }, null).then((res) => {
|
|
1023
|
-
return res;
|
|
1024
|
-
});
|
|
1025
|
-
},
|
|
1026
|
-
/*
|
|
1027
|
-
* 获取用户列表
|
|
1028
|
-
* 获取用户列表
|
|
1029
|
-
*/
|
|
1030
|
-
list: (params) => {
|
|
1031
|
-
return HttpRequest.get("/api/user/list", { pageNum: params.pageNum, pageSize: params.pageSize }, null).then((res) => {
|
|
1032
|
-
return res;
|
|
1033
|
-
});
|
|
1034
|
-
},
|
|
1035
|
-
/*
|
|
1036
|
-
* 通过用户ids,获取用户列表(可以包含管理员)
|
|
1037
|
-
* 通过用户ids,获取用户列表(可以包含管理员)
|
|
1038
|
-
*/
|
|
1039
|
-
listByIds: (params) => {
|
|
1040
|
-
return HttpRequest.get("/api/user/list_by_ids", { ids: params.ids }, null).then((res) => {
|
|
1041
|
-
return res;
|
|
1042
|
-
});
|
|
1043
|
-
},
|
|
1044
|
-
/*
|
|
1045
|
-
* 搜索用户列表
|
|
1046
|
-
* 搜索用户列表
|
|
1047
|
-
*/
|
|
1048
|
-
search: (params) => {
|
|
1049
|
-
return HttpRequest.get("/api/user/search", { keyword: params.keyword, pageNum: params.pageNum, pageSize: params.pageSize }, null).then((res) => {
|
|
1050
|
-
return res;
|
|
1051
|
-
});
|
|
1052
|
-
},
|
|
1053
|
-
/*
|
|
1054
|
-
* 禁用用户
|
|
1055
|
-
* 禁用用户
|
|
1056
|
-
*/
|
|
1057
|
-
forbid: (params) => {
|
|
1058
|
-
return HttpRequest.post("/api/user/forbid", { id: params.id, forbid: params.forbid }, null).then((res) => {
|
|
1059
|
-
return res;
|
|
1060
|
-
});
|
|
1061
|
-
}
|
|
1062
|
-
};
|
|
1063
|
-
|
|
1064
|
-
// src/api/project.ts
|
|
1065
|
-
var project_exports = {};
|
|
1066
|
-
__export(project_exports, {
|
|
1067
|
-
contract: () => contract,
|
|
1068
|
-
file: () => file,
|
|
1069
|
-
fileversion: () => fileversion,
|
|
1070
|
-
project: () => project,
|
|
1071
|
-
projectprogress: () => projectprogress
|
|
1072
|
-
});
|
|
1073
|
-
var contract = {
|
|
1074
|
-
/*
|
|
1075
|
-
* /api/project/contract/create
|
|
1076
|
-
*/
|
|
1077
|
-
createContract: (data) => {
|
|
1078
|
-
return HttpRequest.post("/api/project/contract/create", null, { projectId: data.projectId, name: data.name, tag: data.tag, code: data.code, partyA: data.partyA, partyB: data.partyB, amount: data.amount, startDate: data.startDate, endDate: data.endDate, descs: data.descs }).then((res) => {
|
|
1079
|
-
return res;
|
|
1080
|
-
});
|
|
1081
|
-
},
|
|
1082
|
-
/*
|
|
1083
|
-
* /api/project/contract/delete
|
|
1084
|
-
*/
|
|
1085
|
-
deleteContract: (params) => {
|
|
1086
|
-
return HttpRequest.delete("/api/project/contract/delete", { id: params.id }, null).then((res) => {
|
|
1087
|
-
return res;
|
|
1088
|
-
});
|
|
1089
|
-
},
|
|
1090
|
-
/*
|
|
1091
|
-
* /api/project/contract/update
|
|
1092
|
-
*/
|
|
1093
|
-
updateContract: (data) => {
|
|
1094
|
-
return HttpRequest.post("/api/project/contract/update", null, { id: data.id, name: data.name, code: data.code, tag: data.tag, partyA: data.partyA, partyB: data.partyB, amount: data.amount, startDate: data.startDate, endDate: data.endDate, descs: data.descs, markdown: data.markdown }).then((res) => {
|
|
1095
|
-
return res;
|
|
1096
|
-
});
|
|
1097
|
-
},
|
|
1098
|
-
/*
|
|
1099
|
-
* /api/project/contract/detail
|
|
1100
|
-
*/
|
|
1101
|
-
getContractDetail: (params) => {
|
|
1102
|
-
return HttpRequest.get("/api/project/contract/detail", { id: params.id }, null).then((res) => {
|
|
1103
|
-
return res;
|
|
1104
|
-
});
|
|
1105
|
-
},
|
|
1106
|
-
/*
|
|
1107
|
-
* /api/project/contract/list
|
|
1108
|
-
*/
|
|
1109
|
-
getContractList: (params) => {
|
|
1110
|
-
return HttpRequest.get("/api/project/contract/list", { projectId: params.projectId, pageNum: params.pageNum, pageSize: params.pageSize }, null).then((res) => {
|
|
1111
|
-
return res;
|
|
1112
|
-
});
|
|
1113
|
-
},
|
|
1114
|
-
/*
|
|
1115
|
-
* 提交合同版本进行用印审批(提交后将变为PENDING状态).
|
|
1116
|
-
* 提交合同版本进行用印审批(提交后将变为PENDING状态).
|
|
1117
|
-
*/
|
|
1118
|
-
submitApproval: (params) => {
|
|
1119
|
-
return HttpRequest.post("/api/project/contract/submit", { id: params.id, sealType: params.sealType }, null).then((res) => {
|
|
1120
|
-
return res;
|
|
1121
|
-
});
|
|
1122
|
-
},
|
|
1123
|
-
/*
|
|
1124
|
-
* 撤销合同版本审批.
|
|
1125
|
-
* 撤销合同版本审批.
|
|
1126
|
-
*/
|
|
1127
|
-
cancelApproval: (params) => {
|
|
1128
|
-
return HttpRequest.post("/api/project/contract/cancelApproval", { id: params.id }, null).then((res) => {
|
|
1129
|
-
return res;
|
|
1130
|
-
});
|
|
1131
|
-
},
|
|
1132
|
-
/*
|
|
1133
|
-
* /api/project/contract/version/upload
|
|
1134
|
-
*/
|
|
1135
|
-
uploadVersion: (data) => {
|
|
1136
|
-
return HttpRequest.post("/api/project/contract/version/upload", null, { contractId: data.contractId, fileName: data.fileName, fileType: data.fileType, fileSize: data.fileSize, changeLog: data.changeLog }).then((res) => {
|
|
1137
|
-
return res;
|
|
1138
|
-
});
|
|
1139
|
-
},
|
|
1140
|
-
/*
|
|
1141
|
-
* /api/project/contract/version/list
|
|
1142
|
-
*/
|
|
1143
|
-
getVersionList: (params) => {
|
|
1144
|
-
return HttpRequest.get("/api/project/contract/version/list", { contractId: params.contractId }, null).then((res) => {
|
|
1145
|
-
return res;
|
|
1146
|
-
});
|
|
1147
|
-
},
|
|
1148
|
-
/*
|
|
1149
|
-
* 删除合同版本(仅草稿状态合同允许删除).
|
|
1150
|
-
* /api/project/contract/version/delete
|
|
1151
|
-
*/
|
|
1152
|
-
deleteVersion: (params) => {
|
|
1153
|
-
return HttpRequest.delete("/api/project/contract/version/delete", { id: params.id }, null).then((res) => {
|
|
1154
|
-
return res;
|
|
1155
|
-
});
|
|
1156
|
-
},
|
|
1157
|
-
/*
|
|
1158
|
-
* /api/project/contract/version/detail
|
|
1159
|
-
*/
|
|
1160
|
-
getVersionDetail: (params) => {
|
|
1161
|
-
return HttpRequest.get("/api/project/contract/version/detail", { id: params.id }, null).then((res) => {
|
|
1162
|
-
return res;
|
|
1163
|
-
});
|
|
1164
|
-
},
|
|
1165
|
-
/*
|
|
1166
|
-
* /api/project/contract/version/layerOpinion
|
|
1167
|
-
*/
|
|
1168
|
-
setVersionLayerOpinion: (data) => {
|
|
1169
|
-
return HttpRequest.post("/api/project/contract/version/layerOpinion", null, { contractId: data.contractId, version: data.version, opinion: data.opinion }).then((res) => {
|
|
1170
|
-
return res;
|
|
1171
|
-
});
|
|
1172
|
-
},
|
|
1173
|
-
/*
|
|
1174
|
-
* 获取新的合同编号.
|
|
1175
|
-
* 获取新的合同编号.
|
|
1176
|
-
*/
|
|
1177
|
-
getNewContractCode: (params) => {
|
|
1178
|
-
return HttpRequest.get("/api/project/contract/newCode", { contractCode: params.contractCode, sequenceLength: params.sequenceLength }, null).then((res) => {
|
|
1179
|
-
return res;
|
|
1180
|
-
});
|
|
1181
|
-
},
|
|
1182
|
-
/*
|
|
1183
|
-
* 获取合同历史参与方.
|
|
1184
|
-
* 获取合同历史参与方.
|
|
1185
|
-
*/
|
|
1186
|
-
getContractHistoryParties: () => {
|
|
1187
|
-
return HttpRequest.get("/api/project/contract/historyParties", null, null).then((res) => {
|
|
1188
|
-
return res;
|
|
1189
|
-
});
|
|
1190
|
-
}
|
|
1191
|
-
};
|
|
1192
|
-
var file = {
|
|
1193
|
-
/*
|
|
1194
|
-
* /api/project/files/detail
|
|
1195
|
-
*/
|
|
1196
|
-
getDetail: (params) => {
|
|
1197
|
-
return HttpRequest.get("/api/project/files/detail", { fileId: params.fileId }, null).then((res) => {
|
|
1198
|
-
return res;
|
|
1199
|
-
});
|
|
1200
|
-
},
|
|
1201
|
-
/*
|
|
1202
|
-
* /api/project/files/list
|
|
1203
|
-
*/
|
|
1204
|
-
listFiles: (params) => {
|
|
1205
|
-
return HttpRequest.get("/api/project/files/list", { projectId: params.projectId }, null).then((res) => {
|
|
1206
|
-
return res;
|
|
1207
|
-
});
|
|
1208
|
-
},
|
|
1209
|
-
/*
|
|
1210
|
-
* 跨项目搜索当前用户有权限查看的项目文件.
|
|
1211
|
-
* 跨项目搜索当前用户有权限查看的项目文件.
|
|
1212
|
-
*/
|
|
1213
|
-
searchFiles: (params) => {
|
|
1214
|
-
return HttpRequest.get("/api/project/files/search", { keyword: params.keyword, pageNum: params.pageNum, pageSize: params.pageSize }, null).then((res) => {
|
|
1215
|
-
return res;
|
|
1216
|
-
});
|
|
1217
|
-
},
|
|
1218
|
-
/*
|
|
1219
|
-
* /api/project/files/add
|
|
1220
|
-
*/
|
|
1221
|
-
addFile: (params, data) => {
|
|
1222
|
-
return HttpRequest.post("/api/project/files/add", { projectId: params.projectId }, { fileName: data.fileName, filePath: data.filePath, isSecure: data.isSecure, descs: data.descs, fileType: data.fileType, fileSize: data.fileSize, crc32: data.crc32, fileResourcePath: data.fileResourcePath }).then((res) => {
|
|
1223
|
-
return res;
|
|
1224
|
-
});
|
|
1225
|
-
},
|
|
1226
|
-
/*
|
|
1227
|
-
* /api/project/files/remove
|
|
1228
|
-
*/
|
|
1229
|
-
removeFile: (params) => {
|
|
1230
|
-
return HttpRequest.post("/api/project/files/remove", { fileId: params.fileId }, null).then((res) => {
|
|
1231
|
-
return res;
|
|
1232
|
-
});
|
|
1233
|
-
},
|
|
1234
|
-
/*
|
|
1235
|
-
* /api/project/files/move
|
|
1236
|
-
*/
|
|
1237
|
-
moveFile: (params, data) => {
|
|
1238
|
-
return HttpRequest.post("/api/project/files/move", { projectId: params.projectId }, { oldFileName: data.oldFileName, oldFilePath: data.oldFilePath, newFileName: data.newFileName, newFilePath: data.newFilePath }).then((res) => {
|
|
1239
|
-
return res;
|
|
1240
|
-
});
|
|
1241
|
-
},
|
|
1242
|
-
/*
|
|
1243
|
-
* /api/project/files/updateDescs
|
|
1244
|
-
*/
|
|
1245
|
-
updateFileDescs: (data) => {
|
|
1246
|
-
return HttpRequest.post("/api/project/files/updateDescs", null, { fileId: data.fileId, descs: data.descs }).then((res) => {
|
|
1247
|
-
return res;
|
|
1248
|
-
});
|
|
1249
|
-
},
|
|
1250
|
-
/*
|
|
1251
|
-
* /api/project/files/copyToProject
|
|
1252
|
-
*/
|
|
1253
|
-
copyFileToProject: (params) => {
|
|
1254
|
-
return HttpRequest.post("/api/project/files/copyToProject", { projectId: params.projectId, fileId: params.fileId }, null).then((res) => {
|
|
1255
|
-
return res;
|
|
1256
|
-
});
|
|
1257
|
-
},
|
|
1258
|
-
/*
|
|
1259
|
-
* /api/project/files/moveToProject
|
|
1260
|
-
*/
|
|
1261
|
-
moveFileToProject: (params) => {
|
|
1262
|
-
return HttpRequest.post("/api/project/files/moveToProject", { projectId: params.projectId, fileId: params.fileId }, null).then((res) => {
|
|
1263
|
-
return res;
|
|
1264
|
-
});
|
|
1265
|
-
},
|
|
1266
|
-
/*
|
|
1267
|
-
* 增量更新文件 通过上传差异数据(BSDiff补丁)来更新文件,减少上传数据量
|
|
1268
|
-
* 增量更新文件 通过上传差异数据(BSDiff补丁)来更新文件,减少上传数据量
|
|
1269
|
-
*/
|
|
1270
|
-
updateFileDelta: (data) => {
|
|
1271
|
-
return HttpRequest.post("/api/project/files/updateDelta", null, { fileId: data.fileId, deltaData: data.deltaData, deltaSize: data.deltaSize, newFileSize: data.newFileSize, crc32: data.crc32, recordVersion: data.recordVersion, rotateResourcePath: data.rotateResourcePath }).then((res) => {
|
|
1272
|
-
return res;
|
|
1273
|
-
});
|
|
1274
|
-
},
|
|
1275
|
-
/*
|
|
1276
|
-
* 全量文件更新 通过上传完整文件数据来更新文件
|
|
1277
|
-
* 全量文件更新 通过上传完整文件数据来更新文件
|
|
1278
|
-
*/
|
|
1279
|
-
updateFile: (data) => {
|
|
1280
|
-
return HttpRequest.post("/api/project/files/updateData", null, { fileId: data.fileId, fileSize: data.fileSize, crc32: data.crc32, fileName: data.fileName, fileResourcePath: data.fileResourcePath, recordVersion: data.recordVersion, rotateResourcePath: data.rotateResourcePath }).then((res) => {
|
|
1281
|
-
return res;
|
|
1282
|
-
});
|
|
1283
|
-
},
|
|
1284
|
-
/*
|
|
1285
|
-
* 生成临时访问令牌 用于文件下载或上传
|
|
1286
|
-
* 生成临时访问令牌 用于文件下载或上传
|
|
1287
|
-
*/
|
|
1288
|
-
generateTempAccessToken: (params) => {
|
|
1289
|
-
return HttpRequest.post("/api/project/files/generateTempAccessToken", { fileId: params.fileId, expireSeconds: params.expireSeconds }, null).then((res) => {
|
|
1290
|
-
return res;
|
|
1291
|
-
});
|
|
1292
|
-
},
|
|
1293
|
-
/*
|
|
1294
|
-
* 发起文件夹异步打包下载(仅项目负责人/管理员)
|
|
1295
|
-
*/
|
|
1296
|
-
folderDownload: (params, data) => {
|
|
1297
|
-
return HttpRequest.post("/api/project/files/folderDownload", { projectId: params.projectId }, { folderPath: data.folderPath, folderName: data.folderName }).then((res) => {
|
|
1298
|
-
return res;
|
|
1299
|
-
});
|
|
1300
|
-
},
|
|
1301
|
-
/*
|
|
1302
|
-
* 查询文件夹打包下载任务状态
|
|
1303
|
-
*/
|
|
1304
|
-
folderDownloadStatus: (params) => {
|
|
1305
|
-
return HttpRequest.get("/api/project/files/folderDownloadStatus", { jobId: params.jobId }, null).then((res) => {
|
|
1306
|
-
return res;
|
|
1307
|
-
});
|
|
1308
|
-
},
|
|
1309
|
-
/*
|
|
1310
|
-
* /api/project/files/listByTempAccessToken
|
|
1311
|
-
*/
|
|
1312
|
-
listFilesByTempAccessToken: (params) => {
|
|
1313
|
-
return HttpRequest.get("/api/project/files/listByTempAccessToken", { tempToken: params.tempToken }, null).then((res) => {
|
|
1314
|
-
return res;
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
};
|
|
1318
|
-
var fileversion = {
|
|
1319
|
-
/*
|
|
1320
|
-
* 获取文件版本列表
|
|
1321
|
-
* 获取文件版本列表
|
|
1322
|
-
*/
|
|
1323
|
-
listVersions: (params) => {
|
|
1324
|
-
return HttpRequest.get("/api/project/files/version/list", { fileId: params.fileId }, null).then((res) => {
|
|
1325
|
-
return res;
|
|
1326
|
-
});
|
|
1327
|
-
},
|
|
1328
|
-
/*
|
|
1329
|
-
* 获取版本详情
|
|
1330
|
-
* 获取版本详情
|
|
1331
|
-
*/
|
|
1332
|
-
getVersionDetail: (params) => {
|
|
1333
|
-
return HttpRequest.get("/api/project/files/version/detail", { versionId: params.versionId }, null).then((res) => {
|
|
1334
|
-
return res;
|
|
1335
|
-
});
|
|
1336
|
-
}
|
|
1337
|
-
};
|
|
1338
|
-
var project = {
|
|
1339
|
-
/*
|
|
1340
|
-
* /api/project/enablePrivateProject
|
|
1341
|
-
*/
|
|
1342
|
-
enableUserPrivateProject: () => {
|
|
1343
|
-
return HttpRequest.post("/api/project/enablePrivateProject", null, null).then((res) => {
|
|
1344
|
-
return res;
|
|
1345
|
-
});
|
|
1346
|
-
},
|
|
1347
|
-
/*
|
|
1348
|
-
* /api/project/create
|
|
1349
|
-
*/
|
|
1350
|
-
createProject: (data) => {
|
|
1351
|
-
return HttpRequest.post("/api/project/create", null, { name: data.name, descs: data.descs, companyId: data.companyId, markdown: data.markdown, startTime: data.startTime, plannedEndTime: data.plannedEndTime, endTime: data.endTime, leaderId: data.leaderId, customerId: data.customerId, order: data.order, isUserPrivate: data.isUserPrivate }).then((res) => {
|
|
1352
|
-
return res;
|
|
1353
|
-
});
|
|
1354
|
-
},
|
|
1355
|
-
/*
|
|
1356
|
-
* /api/project/update
|
|
1357
|
-
*/
|
|
1358
|
-
updateProject: (data) => {
|
|
1359
|
-
return HttpRequest.post("/api/project/update", null, { id: data.id, name: data.name, descs: data.descs, companyId: data.companyId, markdown: data.markdown, status: data.status, startTime: data.startTime, plannedEndTime: data.plannedEndTime, endTime: data.endTime, leaderId: data.leaderId, customerId: data.customerId, order: data.order, isUserPrivate: data.isUserPrivate, createTime: data.createTime, updateTime: data.updateTime, createBy: data.createBy, updateBy: data.updateBy }).then((res) => {
|
|
1360
|
-
return res;
|
|
1361
|
-
});
|
|
1362
|
-
},
|
|
1363
|
-
/*
|
|
1364
|
-
* /api/project/updateUserdataOrder
|
|
1365
|
-
*/
|
|
1366
|
-
updateUserdataOrder: (data) => {
|
|
1367
|
-
return HttpRequest.post("/api/project/updateUserdataOrder", null, { projectIds: data.projectIds }).then((res) => {
|
|
1368
|
-
return res;
|
|
1369
|
-
});
|
|
1370
|
-
},
|
|
1371
|
-
/*
|
|
1372
|
-
* 获取用户的项目排序数据. [{pid,order}]
|
|
1373
|
-
* 获取用户的项目排序数据. [{pid,order}]
|
|
1374
|
-
*/
|
|
1375
|
-
getUserdataOrder: () => {
|
|
1376
|
-
return HttpRequest.get("/api/project/userdataOrder", null, null).then((res) => {
|
|
1377
|
-
return res;
|
|
1378
|
-
});
|
|
1379
|
-
},
|
|
1380
|
-
/*
|
|
1381
|
-
* /api/project/detail
|
|
1382
|
-
*/
|
|
1383
|
-
getProjectDetail: (params) => {
|
|
1384
|
-
return HttpRequest.get("/api/project/detail", { id: params.id }, null).then((res) => {
|
|
1385
|
-
return res;
|
|
1386
|
-
});
|
|
1387
|
-
},
|
|
1388
|
-
/*
|
|
1389
|
-
* 获取项目名称.
|
|
1390
|
-
* 获取项目名称.
|
|
1391
|
-
*/
|
|
1392
|
-
getProjectName: (params) => {
|
|
1393
|
-
return HttpRequest.get("/api/project/name", { projectId: params.projectId }, null).then((res) => {
|
|
1394
|
-
return res;
|
|
1395
|
-
});
|
|
1396
|
-
},
|
|
1397
|
-
/*
|
|
1398
|
-
* 仅查看当前用户参与的项目
|
|
1399
|
-
* 仅查看当前用户参与的项目
|
|
1400
|
-
*/
|
|
1401
|
-
listProjects: (params) => {
|
|
1402
|
-
return HttpRequest.get("/api/project/list", { pageNum: params.pageNum, pageSize: params.pageSize, status: params.status, companyId: params.companyId, customerId: params.customerId }, null).then((res) => {
|
|
1403
|
-
return res;
|
|
1404
|
-
});
|
|
1405
|
-
},
|
|
1406
|
-
/*
|
|
1407
|
-
* 仅查看当前用户为管理员及以上的项目
|
|
1408
|
-
* 仅查看当前用户为管理员及以上的项目
|
|
1409
|
-
*/
|
|
1410
|
-
listProjectsByManager: (params) => {
|
|
1411
|
-
return HttpRequest.get("/api/project/listByManager", { pageNum: params.pageNum, pageSize: params.pageSize }, null).then((res) => {
|
|
1412
|
-
return res;
|
|
1413
|
-
});
|
|
1414
|
-
},
|
|
1415
|
-
/*
|
|
1416
|
-
* /api/project/status
|
|
1417
|
-
*/
|
|
1418
|
-
changeStatus: (params) => {
|
|
1419
|
-
return HttpRequest.put("/api/project/status", { id: params.id, status: params.status }, null).then((res) => {
|
|
1420
|
-
return res;
|
|
1421
|
-
});
|
|
1422
|
-
},
|
|
1423
|
-
/*
|
|
1424
|
-
* /api/project/members
|
|
1425
|
-
*/
|
|
1426
|
-
getProjectMembers: (params) => {
|
|
1427
|
-
return HttpRequest.get("/api/project/members", { projectId: params.projectId }, null).then((res) => {
|
|
1428
|
-
return res;
|
|
1429
|
-
});
|
|
1430
|
-
},
|
|
1431
|
-
/*
|
|
1432
|
-
* 获取用户在项目中的角色.
|
|
1433
|
-
* 获取用户在项目中的角色.
|
|
1434
|
-
*/
|
|
1435
|
-
getMemberRole: (params) => {
|
|
1436
|
-
return HttpRequest.get("/api/project/member/role", { projectId: params.projectId, userId: params.userId }, null).then((res) => {
|
|
1437
|
-
return res;
|
|
1438
|
-
});
|
|
1439
|
-
},
|
|
1440
|
-
/*
|
|
1441
|
-
* /api/project/members/assign
|
|
1442
|
-
*/
|
|
1443
|
-
assignMember: (data) => {
|
|
1444
|
-
return HttpRequest.post("/api/project/members/assign", null, { userId: data.userId, role: data.role, projectId: data.projectId }).then((res) => {
|
|
1445
|
-
return res;
|
|
1446
|
-
});
|
|
1447
|
-
},
|
|
1448
|
-
/*
|
|
1449
|
-
* /api/project/members/remove
|
|
1450
|
-
*/
|
|
1451
|
-
removeMember: (data) => {
|
|
1452
|
-
return HttpRequest.post("/api/project/members/remove", null, { userId: data.userId, role: data.role, projectId: data.projectId }).then((res) => {
|
|
1453
|
-
return res;
|
|
1454
|
-
});
|
|
1455
|
-
}
|
|
1456
|
-
};
|
|
1457
|
-
var projectprogress = {
|
|
1458
|
-
/*
|
|
1459
|
-
* 创建项目进展记录 POST /api/project/progress/create
|
|
1460
|
-
* 创建项目进展记录 POST /api/project/progress/create
|
|
1461
|
-
*/
|
|
1462
|
-
createProgress: (data) => {
|
|
1463
|
-
return HttpRequest.post("/api/project/progress/create", null, { projectId: data.projectId, descs: data.descs, commentCount: data.commentCount, progressTime: data.progressTime }).then((res) => {
|
|
1464
|
-
return res;
|
|
1465
|
-
});
|
|
1466
|
-
},
|
|
1467
|
-
/*
|
|
1468
|
-
* 更新项目进展记录 PUT /api/project/progress/update/:id
|
|
1469
|
-
* 更新项目进展记录 PUT /api/project/progress/update/:id
|
|
1470
|
-
*/
|
|
1471
|
-
updateProgress: (data) => {
|
|
1472
|
-
return HttpRequest.put("/api/project/progress/update", null, { id: data.id, descs: data.descs, progressTime: data.progressTime }).then((res) => {
|
|
1473
|
-
return res;
|
|
1474
|
-
});
|
|
1475
|
-
},
|
|
1476
|
-
/*
|
|
1477
|
-
* 删除项目进展记录 DELETE /api/project/progress/delete/:id
|
|
1478
|
-
* 删除项目进展记录 DELETE /api/project/progress/delete/:id
|
|
1479
|
-
*/
|
|
1480
|
-
deleteProgress: (params) => {
|
|
1481
|
-
return HttpRequest.delete("/api/project/progress/delete", { id: params.id }, null).then((res) => {
|
|
1482
|
-
return res;
|
|
1483
|
-
});
|
|
1484
|
-
},
|
|
1485
|
-
/*
|
|
1486
|
-
* 获取项目进展列表 GET /api/project/progress/list/:projectId
|
|
1487
|
-
* 获取项目进展列表 GET /api/project/progress/list/:projectId
|
|
1488
|
-
*/
|
|
1489
|
-
getProgressList: (params) => {
|
|
1490
|
-
return HttpRequest.get("/api/project/progress/list", { projectId: params.projectId }, null).then((res) => {
|
|
1491
|
-
return res;
|
|
1492
|
-
});
|
|
1493
|
-
},
|
|
1494
|
-
/*
|
|
1495
|
-
* 添加进展评论 POST /api/project/progress/comment/add
|
|
1496
|
-
* 添加进展评论 POST /api/project/progress/comment/add
|
|
1497
|
-
*/
|
|
1498
|
-
addComment: (data) => {
|
|
1499
|
-
return HttpRequest.post("/api/project/progress/comment/add", null, { progressId: data.progressId, comment: data.comment }).then((res) => {
|
|
1500
|
-
return res;
|
|
1501
|
-
});
|
|
1502
|
-
},
|
|
1503
|
-
/*
|
|
1504
|
-
* 删除进展评论 DELETE /api/project/progress/comment/delete/:id
|
|
1505
|
-
* 删除进展评论 DELETE /api/project/progress/comment/delete/:id
|
|
1506
|
-
*/
|
|
1507
|
-
deleteComment: (params) => {
|
|
1508
|
-
return HttpRequest.delete("/api/project/progress/comment/delete", { id: params.id }, null).then((res) => {
|
|
1509
|
-
return res;
|
|
1510
|
-
});
|
|
1511
|
-
},
|
|
1512
|
-
/*
|
|
1513
|
-
* 更新进展评论 PUT /api/project/progress/comment/update/:id
|
|
1514
|
-
* 更新进展评论 PUT /api/project/progress/comment/update/:id
|
|
1515
|
-
*/
|
|
1516
|
-
updateComment: (params) => {
|
|
1517
|
-
return HttpRequest.put("/api/project/progress/comment/update", { id: params.id }, {}).then((res) => {
|
|
1518
|
-
return res;
|
|
1519
|
-
});
|
|
1520
|
-
},
|
|
1521
|
-
/*
|
|
1522
|
-
* 获取进展评论列表 GET /api/project/progress/comment/list/:progressId
|
|
1523
|
-
* 获取进展评论列表 GET /api/project/progress/comment/list/:progressId
|
|
1524
|
-
*/
|
|
1525
|
-
getCommentList: (params) => {
|
|
1526
|
-
return HttpRequest.get("/api/project/progress/comment/list", { progressId: params.progressId, pageNum: params.pageNum, pageSize: params.pageSize }, null).then((res) => {
|
|
1527
|
-
return res;
|
|
1528
|
-
});
|
|
1529
|
-
}
|
|
1530
|
-
};
|
|
1531
|
-
|
|
1532
|
-
// src/api/index.ts
|
|
1533
|
-
var API = {
|
|
1534
|
-
base: base_exports,
|
|
1535
|
-
user: user_exports,
|
|
1536
|
-
project: project_exports
|
|
1537
|
-
};
|
|
1538
|
-
export {
|
|
1539
|
-
API,
|
|
1540
|
-
AuthorizationHandler,
|
|
1541
|
-
HttpRequest,
|
|
1542
|
-
ResponseCode,
|
|
1543
|
-
admin,
|
|
1544
|
-
contract,
|
|
1545
|
-
file,
|
|
1546
|
-
fileversion,
|
|
1547
|
-
gateway,
|
|
1548
|
-
message,
|
|
1549
|
-
project,
|
|
1550
|
-
projectprogress,
|
|
1551
|
-
role,
|
|
1552
|
-
user
|
|
1553
|
-
};
|
|
1
|
+
var O=Object.defineProperty;var X=(e,t,s)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var v=(e,t)=>{for(var s in t)O(e,s,{get:t[s],enumerable:!0})};var d=(e,t,s)=>X(e,typeof t!="symbol"?t+"":t,s);var U={};v(U,{AuthorizationHandler:()=>C,HttpRequest:()=>n,ResponseCode:()=>V});import ne,{AxiosError as se}from"axios";import{useEffect as Ie,useState as _e,useRef as be}from"react";import{notification as g}from"antd";import{CheckCircleOutlined as K,CloseCircleOutlined as G,InfoCircleOutlined as W,WarningOutlined as Q}from"@ant-design/icons";import{Fragment as Se,jsx as T,jsxs as De}from"react/jsx-runtime";var z={success:T(K,{style:{color:"#52c41a"}}),error:T(G,{style:{color:"#ff4d4f"}}),info:T(W,{style:{color:"#1677ff"}}),warning:T(Q,{style:{color:"#faad14"}})};g.config({placement:"topRight",duration:3,zIndex:1e4});var y=class y{constructor(){d(this,"currentToast",null);d(this,"api",null);d(this,"isInitialized",!1);d(this,"pendingToast",null)}static getInstance(){return y.instance||(y.instance=new y),y.instance}init(t){if(this.api=t,this.isInitialized=!0,this.pendingToast){let s=this.pendingToast;this.pendingToast=null,this.show(s)}}show(t){let{key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i}=t;if(!this.isInitialized||!this.api){this.pendingToast=t;return}this.currentToast?.timer&&clearTimeout(this.currentToast.timer),this.currentToast&&this.currentToast.key===s?(g.destroy(s),this.createNotification({key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i})):(this.currentToast&&g.destroy(this.currentToast.key),this.createNotification({key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i}))}createNotification(t){if(!this.api)return;let{key:s,type:r,message:a,descs:p,duration:m,placement:c,onClose:i}=t,N={success:this.api.success.bind(this.api),error:this.api.error.bind(this.api),info:this.api.info.bind(this.api),warning:this.api.warning.bind(this.api)}[r];N({key:s,message:a,description:p,duration:m,placement:c||"topRight",icon:z[r],onClose:()=>{this.currentToast?.key===s&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),this.currentToast=null),i?.()}}),this.currentToast={key:s,type:r,message:a,descs:p,duration:m,placement:c,timer:null}}close(){this.currentToast&&(this.currentToast.timer&&clearTimeout(this.currentToast.timer),g.destroy(this.currentToast.key),this.currentToast=null)}destroy(){this.close(),g.destroy()}};d(y,"instance");var k=y,Re=k.getInstance();function R(e){return typeof e=="string"?{message:e,duration:3}:e}function I(e){return z[e]}var Z={success:e=>{if(!e)return;let t=R(e);g.success({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("success"),onClose:t.onClose})},error:e=>{if(!e)return;let t=R(e);g.error({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("error"),onClose:t.onClose})},info:e=>{if(!e)return;let t=R(e);g.info({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("info"),onClose:t.onClose})},warning:e=>{if(!e)return;let t=R(e);g.warning({message:t.message,description:t.descs,duration:t.duration,placement:t.placement,icon:I("warning"),onClose:t.onClose})},custom:(e,t)=>{let{message:s,descs:r,duration:a,placement:p,onClose:m}=t;g[e]({message:s,description:r,duration:a,placement:p,icon:I(e),onClose:m})}};var S=Z;import{Spin as Y}from"antd";import{LoadingOutlined as $}from"@ant-design/icons";import{createRoot as ee}from"react-dom/client";import{jsx as _}from"react/jsx-runtime";var M=Symbol("loading");function B(){let e=window[M];return e||(e={count:0,timeoutId:0,inTimeout:!1},window[M]=e),e}var L={tip:"",fullscreen:!0,delay:0,mask:!0,iconSize:40,wrapperClassName:"ui-loading-wrapper"},te=e=>{let t={...L,...e},{tip:s,fullscreen:r,mask:a,maskStyle:p,iconSize:m,iconStyle:c,containerStyle:i,wrapperClassName:N}=t,H=_($,{style:{fontSize:m,color:"#1677ff",...c},spin:!0}),q=r?{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:9999,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:a?"rgba(0, 0, 0, 0.45)":"transparent",...p}:{},J={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",...i};return _("div",{style:q,className:N,children:_("div",{style:J,children:_(Y,{indicator:H,children:s})})})},l=null,u=null,x=(e={})=>(l&&u&&(u.unmount(),document.body.removeChild(l),l=null,u=null),l=document.createElement("div"),document.body.appendChild(l),u=ee(l),u.render(_(te,{...e})),l),D={show:(e={})=>{let t=B();t.count++;let s={...L,...e};if(s.delay&&s.delay>0){t.timeoutId!=0&&(window.clearTimeout(t.timeoutId),t.timeoutId=0),t.timeoutId=window.setTimeout(()=>{t.timeoutId=0,x(s)},s.delay);return}else x(s)},hide:()=>{let e=B();if(e.count<=0){console.warn("Loading count is less than 0");return}e.count--,e.timeoutId!=0&&(window.clearTimeout(e.timeoutId),e.timeoutId=0),e.count==0&&l&&u&&(u.unmount(),document.body.removeChild(l),l=null,u=null)},service:(e,t={})=>(D.show(t),e.then(s=>(D.hide(),s)).catch(s=>{throw D.hide(),s}))},b=D;import*as w from"febs-browser";import*as P from"febs-browser";import F from"store2";var j=class{constructor(t){d(this,"s");this.s=t}get length(){return this.s.size()}keys(){return this.s.keys()}set(t,s){return s?(s=JSON.stringify(s),s=P.crypt.base64_encode(s),this.s.set(t,s,!0),this):this.remove(t)}get(t,s=null){if(!this.s.has(t))return s;let r=this.s.get(t);if(r){r=P.crypt.base64_decode(r),r=P.string.bytesToUtf8(r||[]);try{return JSON.parse(r)}catch{return this.remove(t),null}}return r}remove(t){return this.s.remove(t),this}clear(){return this.s.clearAll(),this}},f={namespace:function(e){return new j(F.namespace(e||"default"))},namespace_session:function(e){return new j(F.session.namespace(e||"default"))}};var V=(i=>(i[i.SUCCESS=200]="SUCCESS",i[i.OPERATOR_ERROR=400]="OPERATOR_ERROR",i[i.UNAUTHORIZED=401]="UNAUTHORIZED",i[i.UNPERMISSION=402]="UNPERMISSION",i[i.NOT_FOUND=404]="NOT_FOUND",i[i.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",i[i.PARAM_ERROR=601]="PARAM_ERROR",i[i.REQUEST_LIMIT=602]="REQUEST_LIMIT",i))(V||{});function re(e){switch(e){case 404:return"\u8D44\u6E90\u4E0D\u5B58\u5728";case 400:return"\u7CFB\u7EDF\u64CD\u4F5C\u9519\u8BEF";case 601:return"\u53C2\u6570\u9519\u8BEF";case 602:return"\u8FBE\u5230\u8BBF\u95EE\u9650\u5236";case 503:return"\u670D\u52A1\u4E0D\u53EF\u7528";case 401:return"\u672A\u767B\u5F55";case 402:return"\u65E0\u6743\u9650";default:return"\u672A\u77E5\u9519\u8BEF"}}var h=ne.create({baseURL:import.meta.env.VITE_API_BASE,timeout:Number(import.meta.env.VITE_API_TIMEOUT)||5e3,headers:{"Content-Type":"application/json;charset=UTF-8"},withCredentials:!0}),o=class o{static clearStoreToken(){this.setStoreToken(null,0)}static getStoreToken(){let t=f.namespace("bp.ss").get("ss");if(t){let s=f.namespace("bp.ss").get("exp");return{token:JSON.parse(t),exp:s?JSON.parse(s):0}}return null}static getValidStoreToken(){let t=o.getStoreToken();return t&&t.exp>Date.now()-o.TOKEN_EXP?t.token:null}static setStoreToken(t,s){t?(f.namespace("bp.ss").set("ss",JSON.stringify(t)),f.namespace("bp.ss").set("exp",JSON.stringify(s))):f.namespace("bp.ss").clear()}static requestHandleSid(t){let s=o.getStoreToken();s&&s.exp>Date.now()-o.TOKEN_EXP&&t.headers.set(o.HEADER_NAME,o.HEADER_PREFIX+s.token)}static responseHandleSid(t){let s=t.headers.get(o.HEADER_NAME);if(s&&s.startsWith(o.HEADER_PREFIX.trim())){s=s.replace(o.HEADER_PREFIX,"");let r=s;if(s=s.split(".")[1],s&&(s=w.string.bytesToUtf8(w.crypt.base64_decode(s)),s)){let a=JSON.parse(s);return a.exp<Date.now()-o.TOKEN_EXP?(o.clearStoreToken(),!1):(o.setStoreToken(r,a.exp),!0)}o.clearStoreToken(),typeof navigator<"u"&&navigator.onLine&&(window.location.href="/")}return!1}};d(o,"HEADER_NAME","Authorization"),d(o,"HEADER_PREFIX","SPBearer "),d(o,"TOKEN_EXP",20*1e3);var C=o;h.interceptors.request.use(e=>(b.show({delay:5e3}),C.requestHandleSid(e),e),e=>(b.hide(),console.log("Request Error =========="),Promise.reject(e)));h.interceptors.response.use(e=>(b.hide(),e.data.code!==200&&S.warning(e.data.message||re(e.data.code)),C.responseHandleSid(e),e.data),e=>(b.hide(),e instanceof se&&(e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?S.error("\u7F51\u7EDC\u9519\u8BEF"):e.code==="ERR_BAD_RESPONSE"&&S.error("\u670D\u52A1\u5668\u65E0\u54CD\u5E94")),console.log("Response Error =========="),Promise.reject(e)));var n={get(e,t,s){return h({method:"get",url:e,params:t,data:s})},post(e,t,s){return h({method:"post",url:e,params:t,data:s})},put(e,t,s){return h({method:"put",url:e,params:t,data:s})},delete(e,t,s){return h({method:"delete",url:e,params:t,data:s})}};var E={};v(E,{admin:()=>ie,gateway:()=>oe,message:()=>ae,role:()=>de,user:()=>ge});var ie={registerAdmin:e=>n.post("/api/admin/registerAdmin",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode}).then(t=>t),registerUser:e=>n.post("/api/admin/registerUser",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),updateInfoByAdmin:e=>n.post("/api/admin/updateByAdmin",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),list:e=>n.get("/api/admin/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)},oe={register:e=>n.post("/api/register",null,{phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id}).then(t=>t),sendSms:e=>n.post("/api/sendSms",{phone:e.phone,imageCode:e.imageCode},null).then(t=>t),isLogin:()=>n.get("/api/isLogin",null,null).then(e=>e),login:e=>n.post("/api/login",null,{phone:e.phone,pwd:e.pwd,pwdSN:e.pwdSN,smsCode:e.smsCode}).then(t=>t),verifyPasswordHash:e=>n.post("/api/verifyPasswordHash",null,{passwordHash:e.passwordHash,passwordSalt:e.passwordSalt}).then(t=>t),logout:()=>n.get("/api/logout",null,null).then(e=>e),listPermissions:()=>n.get("/api/listPermissions",null,null).then(e=>e),listRolePermissions:e=>n.get("/api/listRolePermissions",{id:e.id},null).then(t=>t)},ae={list:e=>n.get("/api/user/message/list",{pageNum:e.pageNum,pageSize:e.pageSize,unread_only:e.unread_only},null).then(t=>t),countUnread:()=>n.get("/api/user/message/unread/count",null,null).then(e=>e),markRead:e=>n.post("/api/user/message/read",null,{messageIds:e.messageIds}).then(t=>t),clearReaded:e=>n.delete("/api/user/message/clearReaded",null,{messageIds:e.messageIds}).then(t=>t)},de={listRoles:()=>n.get("/api/role/listRoles",null,null).then(e=>e),createRole:e=>n.post("/api/role/createRole",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),updateRole:e=>n.post("/api/role/updateRole",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id},null).then(t=>t),assignPermissionsToRole:e=>n.post("/api/role/assignPermissionsToRole",null,{role_id:e.role_id,permissions:e.permissions}).then(t=>t),assignRoleToUserPermission:()=>n.post("/api/role/assignRoleToUserPermission",null,null).then(e=>e),assignRoleToUser:e=>n.post("/api/role/assignRoleToUser",null,{user_id:e.user_id,role_ids:e.role_ids}).then(t=>t),listUserRoles:e=>n.get("/api/role/listUserRoles",{user_id:e.user_id},null).then(t=>t),listUserPermissions:e=>n.get("/api/role/listUserPermissions",{user_id:e.user_id},null).then(t=>t),listCompanies:()=>n.get("/api/role/listCompanies",null,null).then(e=>e),createCompany:e=>n.post("/api/role/createCompany",{name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),updateCompany:e=>n.post("/api/role/updateCompany",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,parent_id:e.parent_id,is_spv_company:e.is_spv_company},null).then(t=>t),listDepartments:()=>n.get("/api/role/listDepartments",null,null).then(e=>e),createDepartment:e=>n.post("/api/role/createDepartment",{name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),updateDepartment:e=>n.post("/api/role/updateDepartment",{id:e.id,name:e.name,descs:e.descs,admin_id:e.admin_id,company_id:e.company_id,parent_id:e.parent_id},null).then(t=>t),assignUserToDepartment:e=>n.post("/api/role/assignUserToDepartment",{user_id:e.user_id,department_id:e.department_id,position:e.position},null).then(t=>t),removeUserFromDepartment:e=>n.post("/api/role/removeUserFromDepartment",{user_id:e.user_id,department_id:e.department_id},null).then(t=>t),listCompanyDepartments:e=>n.get("/api/role/listCompanyDepartments",{company_id:e.company_id},null).then(t=>t),listUserDepartments:e=>n.get("/api/role/listUserDepartments",{user_id:e.user_id},null).then(t=>t),listDepartmentUsers:e=>n.get("/api/role/listDepartmentUsers",{department_id:e.department_id},null).then(t=>t)},ge={getInfoByUsername:e=>n.get("/api/user/infoByUsername",{username:e.username},null).then(t=>t),getInfo:e=>n.get("/api/user/info",{id:e.id},null).then(t=>t),getAvatar:e=>n.get("/api/user/avatar",{id:e.id,tick:e.tick},null).then(t=>t),getAvatarList:e=>n.get("/api/user/avatar_list",{ids:e.ids},null).then(t=>t),updateAvatar:e=>n.post("/api/user/updateAvatar",null,{id:e.id,avatar:e.avatar,avatar_small:e.avatar_small,tick_self:e.tick_self}).then(t=>t),updateManager:e=>n.post("/api/user/updateManager",{id:e.id,managerid:e.managerid},null).then(t=>t),updateInfo:e=>n.post("/api/user/update",null,{id:e.id,is_forbidden:e.is_forbidden,title:e.title,phone:e.phone,email:e.email,displayModules:e.displayModules,username:e.username,nickname:e.nickname,pwd:e.pwd,smsCode:e.smsCode,manager_id:e.manager_id,created_at:e.created_at,tick_avatar_self:e.tick_avatar_self,role_ids:e.role_ids,isAdmin:e.isAdmin,thirdPlatformInfo:e.thirdPlatformInfo,unreadMessageCount:e.unreadMessageCount}).then(t=>t),updatePassword:e=>n.post("/api/user/updatePassword",null,{old_password:e.old_password,old_password_sn:e.old_password_sn,new_password:e.new_password}).then(t=>t),deleteUser:e=>n.post("/api/user/delete",{id:e.id},null).then(t=>t),list:e=>n.get("/api/user/list",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),listByIds:e=>n.get("/api/user/list_by_ids",{ids:e.ids},null).then(t=>t),search:e=>n.get("/api/user/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),forbid:e=>n.post("/api/user/forbid",{id:e.id,forbid:e.forbid},null).then(t=>t)};var A={};v(A,{contract:()=>le,file:()=>pe,fileversion:()=>me,project:()=>ue,projectprogress:()=>ce});var le={createContract:e=>n.post("/api/project/contract/create",null,{projectId:e.projectId,name:e.name,tag:e.tag,code:e.code,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs}).then(t=>t),deleteContract:e=>n.delete("/api/project/contract/delete",{id:e.id},null).then(t=>t),updateContract:e=>n.post("/api/project/contract/update",null,{id:e.id,name:e.name,code:e.code,tag:e.tag,partyA:e.partyA,partyB:e.partyB,amount:e.amount,startDate:e.startDate,endDate:e.endDate,descs:e.descs,markdown:e.markdown}).then(t=>t),getContractDetail:e=>n.get("/api/project/contract/detail",{id:e.id},null).then(t=>t),getContractList:e=>n.get("/api/project/contract/list",{projectId:e.projectId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),submitApproval:e=>n.post("/api/project/contract/submit",{id:e.id,sealType:e.sealType},null).then(t=>t),cancelApproval:e=>n.post("/api/project/contract/cancelApproval",{id:e.id},null).then(t=>t),uploadVersion:e=>n.post("/api/project/contract/version/upload",null,{contractId:e.contractId,fileName:e.fileName,fileType:e.fileType,fileSize:e.fileSize,changeLog:e.changeLog}).then(t=>t),getVersionList:e=>n.get("/api/project/contract/version/list",{contractId:e.contractId},null).then(t=>t),deleteVersion:e=>n.delete("/api/project/contract/version/delete",{id:e.id},null).then(t=>t),renameVersion:e=>n.post("/api/project/contract/version/rename",null,{id:e.id,fileName:e.fileName}).then(t=>t),getVersionDetail:e=>n.get("/api/project/contract/version/detail",{id:e.id},null).then(t=>t),setVersionLayerOpinion:e=>n.post("/api/project/contract/version/layerOpinion",null,{contractId:e.contractId,version:e.version,opinion:e.opinion}).then(t=>t),getNewContractCode:e=>n.get("/api/project/contract/newCode",{contractCode:e.contractCode,sequenceLength:e.sequenceLength},null).then(t=>t),getContractHistoryParties:()=>n.get("/api/project/contract/historyParties",null,null).then(e=>e)},pe={getDetail:e=>n.get("/api/project/files/detail",{fileId:e.fileId},null).then(t=>t),listFiles:e=>n.get("/api/project/files/list",{projectId:e.projectId},null).then(t=>t),searchFiles:e=>n.get("/api/project/files/search",{keyword:e.keyword,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),addFile:(e,t)=>n.post("/api/project/files/add",{projectId:e.projectId},{fileName:t.fileName,filePath:t.filePath,isSecure:t.isSecure,descs:t.descs,fileType:t.fileType,fileSize:t.fileSize,crc32:t.crc32,fileResourcePath:t.fileResourcePath}).then(s=>s),removeFile:e=>n.post("/api/project/files/remove",{fileId:e.fileId},null).then(t=>t),moveFile:(e,t)=>n.post("/api/project/files/move",{projectId:e.projectId},{oldFileName:t.oldFileName,oldFilePath:t.oldFilePath,newFileName:t.newFileName,newFilePath:t.newFilePath}).then(s=>s),updateFileDescs:e=>n.post("/api/project/files/updateDescs",null,{fileId:e.fileId,descs:e.descs}).then(t=>t),copyFileToProject:e=>n.post("/api/project/files/copyToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),moveFileToProject:e=>n.post("/api/project/files/moveToProject",{projectId:e.projectId,fileId:e.fileId},null).then(t=>t),updateFileDelta:e=>n.post("/api/project/files/updateDelta",null,{fileId:e.fileId,deltaData:e.deltaData,deltaSize:e.deltaSize,newFileSize:e.newFileSize,crc32:e.crc32,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),updateFile:e=>n.post("/api/project/files/updateData",null,{fileId:e.fileId,fileSize:e.fileSize,crc32:e.crc32,fileName:e.fileName,fileResourcePath:e.fileResourcePath,recordVersion:e.recordVersion,rotateResourcePath:e.rotateResourcePath}).then(t=>t),generateTempAccessToken:e=>n.post("/api/project/files/generateTempAccessToken",{fileId:e.fileId,expireSeconds:e.expireSeconds},null).then(t=>t),folderDownload:(e,t)=>n.post("/api/project/files/folderDownload",{projectId:e.projectId},{folderPath:t.folderPath,folderName:t.folderName}).then(s=>s),folderDownloadStatus:e=>n.get("/api/project/files/folderDownloadStatus",{jobId:e.jobId},null).then(t=>t),listFilesByTempAccessToken:e=>n.get("/api/project/files/listByTempAccessToken",{tempToken:e.tempToken},null).then(t=>t)},me={listVersions:e=>n.get("/api/project/files/version/list",{fileId:e.fileId},null).then(t=>t),getVersionDetail:e=>n.get("/api/project/files/version/detail",{versionId:e.versionId},null).then(t=>t)},ue={enableUserPrivateProject:()=>n.post("/api/project/enablePrivateProject",null,null).then(e=>e),createProject:e=>n.post("/api/project/create",null,{name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate}).then(t=>t),updateProject:e=>n.post("/api/project/update",null,{id:e.id,name:e.name,descs:e.descs,companyId:e.companyId,markdown:e.markdown,status:e.status,startTime:e.startTime,plannedEndTime:e.plannedEndTime,endTime:e.endTime,leaderId:e.leaderId,customerId:e.customerId,order:e.order,isUserPrivate:e.isUserPrivate,createTime:e.createTime,updateTime:e.updateTime,createBy:e.createBy,updateBy:e.updateBy}).then(t=>t),updateUserdataOrder:e=>n.post("/api/project/updateUserdataOrder",null,{projectIds:e.projectIds}).then(t=>t),getUserdataOrder:()=>n.get("/api/project/userdataOrder",null,null).then(e=>e),getProjectDetail:e=>n.get("/api/project/detail",{id:e.id},null).then(t=>t),getProjectName:e=>n.get("/api/project/name",{projectId:e.projectId},null).then(t=>t),listProjects:e=>n.get("/api/project/list",{pageNum:e.pageNum,pageSize:e.pageSize,status:e.status,companyId:e.companyId,customerId:e.customerId},null).then(t=>t),listProjectsByManager:e=>n.get("/api/project/listByManager",{pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t),changeStatus:e=>n.put("/api/project/status",{id:e.id,status:e.status},null).then(t=>t),getProjectMembers:e=>n.get("/api/project/members",{projectId:e.projectId},null).then(t=>t),getMemberRole:e=>n.get("/api/project/member/role",{projectId:e.projectId,userId:e.userId},null).then(t=>t),assignMember:e=>n.post("/api/project/members/assign",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t),removeMember:e=>n.post("/api/project/members/remove",null,{userId:e.userId,role:e.role,projectId:e.projectId}).then(t=>t)},ce={createProgress:e=>n.post("/api/project/progress/create",null,{projectId:e.projectId,descs:e.descs,commentCount:e.commentCount,progressTime:e.progressTime}).then(t=>t),updateProgress:e=>n.put("/api/project/progress/update",null,{id:e.id,descs:e.descs,progressTime:e.progressTime}).then(t=>t),deleteProgress:e=>n.delete("/api/project/progress/delete",{id:e.id},null).then(t=>t),getProgressList:e=>n.get("/api/project/progress/list",{projectId:e.projectId},null).then(t=>t),addComment:e=>n.post("/api/project/progress/comment/add",null,{progressId:e.progressId,comment:e.comment}).then(t=>t),deleteComment:e=>n.delete("/api/project/progress/comment/delete",{id:e.id},null).then(t=>t),updateComment:e=>n.put("/api/project/progress/comment/update",{id:e.id},{}).then(t=>t),getCommentList:e=>n.get("/api/project/progress/comment/list",{progressId:e.progressId,pageNum:e.pageNum,pageSize:e.pageSize},null).then(t=>t)};var Ge={base:U,user:E,project:A};export{Ge as API,C as AuthorizationHandler,n as HttpRequest,V as ResponseCode,ie as admin,le as contract,pe as file,me as fileversion,oe as gateway,ae as message,ue as project,ce as projectprogress,de as role,ge as user};
|