create-ssnode-cli 0.1.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/index.js +10 -4
- package/package.json +2 -2
- package/secrets.js +10 -7
- package/templates/backend/Dockerfile +4 -0
- package/templates/backend/config/config.develop.yaml +10 -0
- package/templates/backend/config/config.prod.yaml +10 -0
- package/templates/backend/dist/config/configuration.js +1 -1
- package/templates/backend/dist/config/configuration.js.map +1 -1
- package/templates/backend/dist/modules/auth/auth.service.js +1 -1
- package/templates/backend/dist/modules/auth/auth.service.js.map +1 -1
- package/templates/backend/dist/modules/page-data/page-data.controller.js +1 -1
- package/templates/backend/dist/modules/page-data/page-data.controller.js.map +1 -1
- package/templates/backend/dist/modules/screen-config/screen-config.controller.js +1 -1
- package/templates/backend/dist/modules/screen-config/screen-config.controller.js.map +1 -1
- package/templates/backend/dist/tsconfig.build.tsbuildinfo +1 -1
- package/templates/backend/node_modules/.bin/js-yaml +2 -2
- package/templates/backend/node_modules/.bin/typeorm +2 -2
- package/templates/backend/node_modules/.bin/typeorm-ts-node-commonjs +2 -2
- package/templates/backend/node_modules/.bin/typeorm-ts-node-esm +2 -2
- package/templates/backend/ops/docker/.env.example +4 -0
- package/templates/backend/ops/docker/config.sh +2 -0
- package/templates/backend/ops/docker/install.sh +35 -0
- package/templates/backend/ops/install.sh +17 -3
- package/templates/backend/ops/pm2/config.sh +2 -0
- package/templates/backend/ops/systemd/config.sh +2 -0
- package/templates/backend/package.json +13 -6
- package/templates/backend/scripts/build.cjs +67 -1
- package/templates/backend/src/config/config.interface.ts +9 -0
- package/templates/backend/src/config/configuration.ts +11 -0
- package/templates/backend/src/modules/auth/auth.service.ts +57 -12
- package/templates/backend/src/modules/page-data/page-data.controller.ts +33 -10
- package/templates/backend/src/modules/screen-config/screen-config.controller.ts +33 -5
- package/templates/root/AGENTS.md +1 -1
- package/templates/root/README.md +9 -6
- package/templates/root/package.json +9 -1
- package/templates/web/dist/assets/{404-f80ef771.js → 404-e6edada0.js} +1 -1
- package/templates/web/dist/assets/{404-legacy-3002ee98.js → 404-legacy-f6ca5b91.js} +1 -1
- package/templates/web/dist/assets/AuthLayout-bcf98efb.js +1 -0
- package/templates/web/dist/assets/AuthLayout-legacy-6e7a8ae1.js +1 -0
- package/templates/web/dist/assets/Background-90a49ee7.css +1 -0
- package/templates/web/dist/assets/Background-eb77ef54.js +1 -0
- package/templates/web/dist/assets/Background-legacy-50457007.js +1 -0
- package/templates/web/dist/assets/{Screen-2126fd8d.js → Screen-318c3fc2.js} +1 -1
- package/templates/web/dist/assets/{Screen-legacy-e1974f1b.js → Screen-legacy-af123b0f.js} +1 -1
- package/templates/web/dist/assets/{ScreenChartOption-cc9d0192.js → ScreenChartOption-953b9157.js} +1 -1
- package/templates/web/dist/assets/{ScreenChartOption-legacy-b1b2d49d.js → ScreenChartOption-legacy-2e8fcfd8.js} +1 -1
- package/templates/web/dist/assets/api-beff4a3e.js +1 -0
- package/templates/web/dist/assets/api-legacy-9fe41d4b.js +1 -0
- package/templates/web/dist/assets/{base-8cbac341.js → base-a14309c8.js} +1 -1
- package/templates/web/dist/assets/{base-legacy-ee9fb316.js → base-legacy-2bc6e427.js} +1 -1
- package/templates/web/dist/assets/{child-10cea360.js → child-2a48ca65.js} +1 -1
- package/templates/web/dist/assets/{child-legacy-5af47aba.js → child-legacy-7665b5f8.js} +1 -1
- package/templates/web/dist/assets/{component-ae0df581.js → component-89b5253e.js} +1 -1
- package/templates/web/dist/assets/{component-legacy-7824b5dc.js → component-legacy-8c5a28ef.js} +1 -1
- package/templates/web/dist/assets/{demo-1b5e36be.js → demo-d7272cf4.js} +1 -1
- package/templates/web/dist/assets/{demo-legacy-e12d2ac9.js → demo-legacy-f7bbfe55.js} +1 -1
- package/templates/web/dist/assets/echarts-vendor-50090982.js +9 -0
- package/templates/web/dist/assets/echarts-vendor-legacy-50b58722.js +10 -0
- package/templates/web/dist/assets/{grandson-d5883b90.js → grandson-05f8bb58.js} +1 -1
- package/templates/web/dist/assets/{grandson-legacy-10cd2476.js → grandson-legacy-3e10990b.js} +1 -1
- package/templates/web/dist/assets/{index-9fbd51da.js → index-466a1ec1.js} +1 -1
- package/templates/web/dist/assets/{index-5dbae75a.js → index-5b5a8146.js} +1 -1
- package/templates/web/dist/assets/{index-6faaa6d8.js → index-7277cbfb.js} +1 -1
- package/templates/web/dist/assets/{index-8f6fba9f.js → index-777ef781.js} +1 -1
- package/templates/web/dist/assets/{index-2e42b180.js → index-86214b19.js} +1 -1
- package/templates/web/dist/assets/{index-463d9205.js → index-9cd5622a.js} +1 -1
- package/templates/web/dist/assets/{index-16f6b85c.js → index-a79e448b.js} +1 -1
- package/templates/web/dist/assets/{index-3a9a0a97.js → index-b60badf7.js} +1 -1
- package/templates/web/dist/assets/{index-fbf4ee3f.js → index-bd4ed808.js} +1 -1
- package/templates/web/dist/assets/{index-687d6cfe.js → index-cba19800.js} +1 -1
- package/templates/web/dist/assets/{index-5dbcad00.js → index-d70eb540.js} +1 -1
- package/templates/web/dist/assets/{index-25ea283a.js → index-e6071630.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-ced5a7f1.js → index-legacy-028ed5d5.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-8c7d1ee7.js → index-legacy-06483318.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-ba034322.js → index-legacy-0da8de82.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-3d221bb6.js → index-legacy-3965dcaf.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-f3e49a4e.js → index-legacy-4a13dddc.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-e9af81d8.js → index-legacy-783129a7.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-07d00151.js → index-legacy-8a2cfb9d.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-dd62c9e7.js → index-legacy-993ef005.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-38c170dc.js → index-legacy-b075295d.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-95da3338.js → index-legacy-b3bd40c1.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-9be704da.js → index-legacy-d510e318.js} +1 -1
- package/templates/web/dist/assets/{index-legacy-0f01787c.js → index-legacy-feb54578.js} +1 -1
- package/templates/web/dist/assets/{parent-e7114c1b.js → parent-bba709aa.js} +1 -1
- package/templates/web/dist/assets/{parent-legacy-9e493d04.js → parent-legacy-48111978.js} +1 -1
- package/templates/web/dist/assets/vendor-affac96c.js +124 -0
- package/templates/web/dist/assets/vendor-legacy-55fa76eb.js +122 -0
- package/templates/web/dist/index.html +3 -3
- package/templates/web/package.json +7 -7
- package/templates/web/src/js/xlsl.ts +110 -59
- package/templates/web/src/layouts/AuthLayout.tsx +16 -11
- package/templates/web/src/layouts/Background.module.less +5 -3
- package/templates/web/src/services/api/admin/user.ts +9 -2
- package/templates/web/dist/assets/AuthLayout-f07f2dff.js +0 -1
- package/templates/web/dist/assets/AuthLayout-legacy-635887dd.js +0 -1
- package/templates/web/dist/assets/Background-63ce83a2.js +0 -1
- package/templates/web/dist/assets/Background-b264d337.css +0 -1
- package/templates/web/dist/assets/Background-legacy-a34b521f.js +0 -1
- package/templates/web/dist/assets/api-21ca288f.js +0 -1
- package/templates/web/dist/assets/api-legacy-b464070b.js +0 -1
- package/templates/web/dist/assets/echarts-vendor-fdb2c14f.js +0 -9
- package/templates/web/dist/assets/echarts-vendor-legacy-e99e5121.js +0 -10
- package/templates/web/dist/assets/vendor-e7ea3a11.js +0 -96
- package/templates/web/dist/assets/vendor-legacy-a62a28c9.js +0 -87
- package/templates/web/node_modules/.bin/xlsx +0 -17
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
/>
|
|
10
10
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
11
11
|
<title>-</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-86214b19.js"></script>
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-affac96c.js">
|
|
14
14
|
<link rel="stylesheet" href="/assets/index-ec1f790a.css">
|
|
15
15
|
<script type="module">import.meta.url;import("_").catch(()=>1);async function* g(){};if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
|
|
16
16
|
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<script src="/env.config.js"></script>
|
|
22
22
|
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
|
|
23
23
|
<script nomodule crossorigin id="vite-legacy-polyfill" src="/assets/polyfills-legacy-b0716348.js"></script>
|
|
24
|
-
<script nomodule crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-
|
|
24
|
+
<script nomodule crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-06483318.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
|
|
25
25
|
</body>
|
|
26
26
|
|
|
27
27
|
</html>
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@ant-design/icons": "5.3.0",
|
|
30
30
|
"antd": "5.14.2",
|
|
31
|
-
"axios": "1.
|
|
31
|
+
"axios": "1.20.0",
|
|
32
32
|
"dayjs": "1.11.10",
|
|
33
|
-
"echarts": "
|
|
33
|
+
"echarts": "6.1.0",
|
|
34
|
+
"exceljs": "4.4.0",
|
|
34
35
|
"js-sha256": "^1.0.0",
|
|
35
|
-
"lodash": "4.
|
|
36
|
-
"qs": "6.
|
|
36
|
+
"lodash": "4.18.1",
|
|
37
|
+
"qs": "6.16.0",
|
|
37
38
|
"react": "18.2.0",
|
|
38
39
|
"react-dom": "18.2.0",
|
|
39
|
-
"react-router-dom": "6.
|
|
40
|
+
"react-router-dom": "6.30.6",
|
|
40
41
|
"react-svg": "15.1.7",
|
|
41
|
-
"recoil": "0.7.7"
|
|
42
|
-
"xlsx": "0.18.5"
|
|
42
|
+
"recoil": "0.7.7"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/react": "18.2.67",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ExcelJS from 'exceljs';
|
|
2
2
|
import request from 'axios';
|
|
3
3
|
|
|
4
4
|
interface ExportTableColumns {
|
|
@@ -9,31 +9,74 @@ interface ExportTableColumns {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* exceljs 单元格值归一化:
|
|
13
|
+
* 公式单元格取 result,富文本/超链接取 text,其余原样返回
|
|
14
|
+
*/
|
|
15
|
+
const normalizeCell = (value: any): any => {
|
|
16
|
+
if (value === null || value === undefined) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
if (typeof value === 'object') {
|
|
20
|
+
if (value instanceof Date) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
if (value.result !== undefined) {
|
|
24
|
+
return normalizeCell(value.result);
|
|
25
|
+
}
|
|
26
|
+
if (Array.isArray(value.richText)) {
|
|
27
|
+
return value.richText.map((t: { text: string }) => t.text).join('');
|
|
28
|
+
}
|
|
29
|
+
if (value.text !== undefined) {
|
|
30
|
+
return value.text;
|
|
31
|
+
}
|
|
32
|
+
if (value.error !== undefined) {
|
|
33
|
+
return value.error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 获取excel数据信息(首行为表头,与原 xlsx sheet_to_json 行为一致)
|
|
13
41
|
* @returns
|
|
14
42
|
*/
|
|
15
|
-
const importExcelData = (
|
|
43
|
+
const importExcelData = async (
|
|
16
44
|
data: ArrayBuffer,
|
|
17
45
|
aWorkSheets: string[] = []
|
|
18
|
-
): Promise<{ [key: string]: any[] }> =>
|
|
19
|
-
new
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (let index = 0; index < workSheets.length; index += 1) {
|
|
30
|
-
const sheetName = workSheets[index];
|
|
31
|
-
const workSheet = webbook.Sheets[sheetName];
|
|
32
|
-
const json = XLSX.utils.sheet_to_json(workSheet);
|
|
33
|
-
dict[sheetName] = json;
|
|
46
|
+
): Promise<{ [key: string]: any[] }> => {
|
|
47
|
+
const workbook = new ExcelJS.Workbook();
|
|
48
|
+
await workbook.xlsx.load(data);
|
|
49
|
+
const workSheets =
|
|
50
|
+
aWorkSheets.length > 0 ? aWorkSheets : workbook.worksheets.map((ws) => ws.name);
|
|
51
|
+
const dict: { [key: string]: any[] } = {};
|
|
52
|
+
for (let index = 0; index < workSheets.length; index += 1) {
|
|
53
|
+
const sheetName = workSheets[index];
|
|
54
|
+
const workSheet = workbook.getWorksheet(sheetName);
|
|
55
|
+
if (!workSheet) {
|
|
56
|
+
continue;
|
|
34
57
|
}
|
|
35
|
-
|
|
36
|
-
|
|
58
|
+
const aoa: any[][] = [];
|
|
59
|
+
workSheet.eachRow({ includeEmpty: true }, (row) => {
|
|
60
|
+
const values = new Array(workSheet.columnCount).fill(null);
|
|
61
|
+
row.eachCell({ includeEmpty: true }, (cell, colNumber) => {
|
|
62
|
+
values[colNumber - 1] = normalizeCell(cell.value);
|
|
63
|
+
});
|
|
64
|
+
aoa.push(values);
|
|
65
|
+
});
|
|
66
|
+
const headers = aoa[0] || [];
|
|
67
|
+
const json = aoa.slice(1).map((row) => {
|
|
68
|
+
const item: { [key: string]: any } = {};
|
|
69
|
+
headers.forEach((header, i) => {
|
|
70
|
+
if (header !== null && header !== '') {
|
|
71
|
+
item[String(header)] = row[i];
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return item;
|
|
75
|
+
});
|
|
76
|
+
dict[sheetName] = json;
|
|
77
|
+
}
|
|
78
|
+
return dict;
|
|
79
|
+
};
|
|
37
80
|
|
|
38
81
|
/**
|
|
39
82
|
* 获取excel数据信息 <无权限校验>
|
|
@@ -74,25 +117,31 @@ function download(url: string | Blob | ArrayBuffer, fileName?: string) {
|
|
|
74
117
|
alink.dispatchEvent(event);
|
|
75
118
|
}
|
|
76
119
|
|
|
120
|
+
/**
|
|
121
|
+
* 工作簿写为 xlsx 并触发下载
|
|
122
|
+
*/
|
|
123
|
+
async function writeWorkbookToFile(workbook: ExcelJS.Workbook, fileName?: string) {
|
|
124
|
+
const buffer = await workbook.xlsx.writeBuffer();
|
|
125
|
+
download(new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }), fileName);
|
|
126
|
+
}
|
|
127
|
+
|
|
77
128
|
/**
|
|
78
129
|
* 将数据导出为excel文件
|
|
79
130
|
* @param sheets 数据
|
|
80
131
|
* @param aFileName 文件名称
|
|
81
132
|
*/
|
|
82
|
-
function exportExcel(sheets: { [key: string]: any[] }, fileName: string) {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const sheet =
|
|
87
|
-
|
|
133
|
+
async function exportExcel(sheets: { [key: string]: any[] }, fileName: string) {
|
|
134
|
+
const workbook = new ExcelJS.Workbook();
|
|
135
|
+
Object.keys(sheets).forEach((key) => {
|
|
136
|
+
const rows = sheets[key] || [];
|
|
137
|
+
const sheet = workbook.addWorksheet(key);
|
|
138
|
+
if (rows.length > 0) {
|
|
139
|
+
const headers = Object.keys(rows[0]);
|
|
140
|
+
sheet.columns = headers.map((header) => ({ header, key: header }));
|
|
141
|
+
rows.forEach((row) => sheet.addRow(row));
|
|
142
|
+
}
|
|
88
143
|
});
|
|
89
|
-
|
|
90
|
-
{
|
|
91
|
-
SheetNames: sheetKeys,
|
|
92
|
-
Sheets
|
|
93
|
-
},
|
|
94
|
-
fileName
|
|
95
|
-
);
|
|
144
|
+
await writeWorkbookToFile(workbook, fileName);
|
|
96
145
|
}
|
|
97
146
|
|
|
98
147
|
/**
|
|
@@ -100,12 +149,15 @@ function exportExcel(sheets: { [key: string]: any[] }, fileName: string) {
|
|
|
100
149
|
* @param sheets 数据
|
|
101
150
|
* @param aFileName 文件名称
|
|
102
151
|
*/
|
|
103
|
-
function exportExcelFromTable(tablee: HTMLTableElement, fileName?: string) {
|
|
104
|
-
const workbook =
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
152
|
+
async function exportExcelFromTable(tablee: HTMLTableElement, fileName?: string) {
|
|
153
|
+
const workbook = new ExcelJS.Workbook();
|
|
154
|
+
const sheet = workbook.addWorksheet('Sheet1');
|
|
155
|
+
const trList = tablee.querySelectorAll('tr');
|
|
156
|
+
trList.forEach((tr) => {
|
|
157
|
+
const cells = tr.querySelectorAll('th,td');
|
|
158
|
+
sheet.addRow(Array.from(cells).map((cell) => (cell.textContent || '').trim()));
|
|
159
|
+
});
|
|
160
|
+
await writeWorkbookToFile(workbook, fileName);
|
|
109
161
|
}
|
|
110
162
|
|
|
111
163
|
/**
|
|
@@ -114,16 +166,16 @@ function exportExcelFromTable(tablee: HTMLTableElement, fileName?: string) {
|
|
|
114
166
|
* @param dataList 表格数据
|
|
115
167
|
* @param fileName 文件名称
|
|
116
168
|
*/
|
|
117
|
-
function exportExcelFromColumns(columns: ExportTableColumns[], dataList: any[], fileName: string) {
|
|
169
|
+
async function exportExcelFromColumns(columns: ExportTableColumns[], dataList: any[], fileName: string) {
|
|
118
170
|
// 将头部标题数据 拉平
|
|
119
|
-
const mergeOptions = [];
|
|
171
|
+
const mergeOptions: Array<{ s: { r: number; c: number }; e: { r: number; c: number } }> = [];
|
|
120
172
|
let maxHeaderLevel = 1;
|
|
121
173
|
const flatteHeaders = (
|
|
122
174
|
columns: ExportTableColumns[],
|
|
123
175
|
prevHeaders: ExportTableColumns[] = [],
|
|
124
176
|
level = 1
|
|
125
177
|
) => {
|
|
126
|
-
const list = [];
|
|
178
|
+
const list: ExportTableColumns[] = [];
|
|
127
179
|
for (let index = 0; index < columns.length; index++) {
|
|
128
180
|
const element = columns[index];
|
|
129
181
|
|
|
@@ -145,7 +197,7 @@ function exportExcelFromColumns(columns: ExportTableColumns[], dataList: any[],
|
|
|
145
197
|
list.push({
|
|
146
198
|
...element,
|
|
147
199
|
prevHeaders: [...prevHeaders, element]
|
|
148
|
-
});
|
|
200
|
+
} as ExportTableColumns);
|
|
149
201
|
}
|
|
150
202
|
}
|
|
151
203
|
maxHeaderLevel = Math.max(maxHeaderLevel, level);
|
|
@@ -154,7 +206,7 @@ function exportExcelFromColumns(columns: ExportTableColumns[], dataList: any[],
|
|
|
154
206
|
|
|
155
207
|
const flatteColumns = flatteHeaders(columns, []);
|
|
156
208
|
const headerDatas: string[][] = [];
|
|
157
|
-
const dataIndexKeys = [];
|
|
209
|
+
const dataIndexKeys: Array<string | string[] | undefined> = [];
|
|
158
210
|
for (let index = 0; index < flatteColumns.length; index++) {
|
|
159
211
|
const element = flatteColumns[index];
|
|
160
212
|
dataIndexKeys.push(element.dataIndex);
|
|
@@ -164,10 +216,10 @@ function exportExcelFromColumns(columns: ExportTableColumns[], dataList: any[],
|
|
|
164
216
|
headerDatas[j] = [];
|
|
165
217
|
}
|
|
166
218
|
const headerData = headerDatas[j];
|
|
167
|
-
const targetElement = element.prevHeaders[j] || {};
|
|
219
|
+
const targetElement = element.prevHeaders?.[j] || {};
|
|
168
220
|
headerData.push(targetElement.title || '');
|
|
169
221
|
|
|
170
|
-
if (j === element.prevHeaders
|
|
222
|
+
if (j === (element.prevHeaders?.length || 0) - 1) {
|
|
171
223
|
mergeOptions.push({
|
|
172
224
|
s: {
|
|
173
225
|
r: j,
|
|
@@ -192,7 +244,7 @@ function exportExcelFromColumns(columns: ExportTableColumns[], dataList: any[],
|
|
|
192
244
|
return getValueFromProps(keys, target);
|
|
193
245
|
};
|
|
194
246
|
|
|
195
|
-
const contentDatas = [];
|
|
247
|
+
const contentDatas: any[][] = [];
|
|
196
248
|
for (let index = 0; index < dataList.length; index++) {
|
|
197
249
|
const element = dataList[index];
|
|
198
250
|
const values = [];
|
|
@@ -204,22 +256,21 @@ function exportExcelFromColumns(columns: ExportTableColumns[], dataList: any[],
|
|
|
204
256
|
if (dataIndex instanceof Array) {
|
|
205
257
|
value = getValueFromProps([...dataIndex], element);
|
|
206
258
|
} else {
|
|
207
|
-
value = getValueFromProps([dataIndex], element);
|
|
259
|
+
value = getValueFromProps([dataIndex as string], element);
|
|
208
260
|
}
|
|
209
261
|
values.push(value);
|
|
210
262
|
}
|
|
211
263
|
contentDatas.push(values);
|
|
212
264
|
}
|
|
213
265
|
|
|
214
|
-
// 创建工作簿
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
XLSX.writeFile(wb, fileName);
|
|
266
|
+
// 创建工作簿(单元格合并,r/c 从 0 起转为 exceljs 的 1 起行列)
|
|
267
|
+
const workbook = new ExcelJS.Workbook();
|
|
268
|
+
const sheet = workbook.addWorksheet('Sheet1');
|
|
269
|
+
[...headerDatas, ...contentDatas].forEach((row) => sheet.addRow(row));
|
|
270
|
+
mergeOptions.forEach((merge) => {
|
|
271
|
+
sheet.mergeCells(merge.s.r + 1, merge.s.c + 1, merge.e.r + 1, merge.e.c + 1);
|
|
272
|
+
});
|
|
273
|
+
await writeWorkbookToFile(workbook, fileName);
|
|
223
274
|
}
|
|
224
275
|
|
|
225
276
|
/**
|
|
@@ -231,7 +282,7 @@ const createMultiMap = (aList = [], aUniqePropNames: string[]): { [key: string]:
|
|
|
231
282
|
const resault = {};
|
|
232
283
|
for (let index = 0; index < aList.length; index += 1) {
|
|
233
284
|
const element = aList[index];
|
|
234
|
-
for (let j = 0; j < aUniqePropNames.length; j
|
|
285
|
+
for (let j = 0; j < aUniqePropNames.length; j++) {
|
|
235
286
|
const aPropName = aUniqePropNames[j];
|
|
236
287
|
const dict = resault[aPropName] || {};
|
|
237
288
|
|
|
@@ -24,20 +24,25 @@ export default function AuthLayout() {
|
|
|
24
24
|
|
|
25
25
|
// 判断登录 -- 优先判断sso登录 --- 如果不是单点登录情况 --- 未登录
|
|
26
26
|
setLoading(true);
|
|
27
|
-
// 存在单点登录
|
|
27
|
+
// 存在单点登录(接入方跳转 URL 携带 ?user=<用户名>&ts=<unix秒>&sign=<票据>)
|
|
28
28
|
const query = QueryString.parse(location.search.replace('?', ''));
|
|
29
29
|
if (query.user) {
|
|
30
|
-
// 执行 sso登录
|
|
31
|
-
api.admin.user
|
|
32
|
-
|
|
30
|
+
// 执行 sso登录(票据由接入方用 backend sso.ticketKey 生成,见 docs/api-security.md)
|
|
31
|
+
api.admin.user
|
|
32
|
+
.ssoLogin({
|
|
33
|
+
username: query.user as string,
|
|
34
|
+
ts: query.ts as string,
|
|
35
|
+
sign: query.sign as string
|
|
36
|
+
})
|
|
37
|
+
.then((success) => {
|
|
33
38
|
setLoading(false);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
if (success) {
|
|
40
|
+
setSystemAuthorization(true);
|
|
41
|
+
} else {
|
|
42
|
+
setSystemAuthorization(false);
|
|
43
|
+
reLogin();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
41
46
|
return;
|
|
42
47
|
}
|
|
43
48
|
// 非单点登录 --- 普通处理
|
|
@@ -125,10 +125,12 @@
|
|
|
125
125
|
flex: 1;
|
|
126
126
|
overflow-y: auto;
|
|
127
127
|
overflow-x: hidden;
|
|
128
|
+
|
|
128
129
|
// 隐藏滚动条美化
|
|
129
130
|
&::-webkit-scrollbar {
|
|
130
131
|
width: 4px;
|
|
131
132
|
}
|
|
133
|
+
|
|
132
134
|
&::-webkit-scrollbar-thumb {
|
|
133
135
|
background: #3a3f48;
|
|
134
136
|
border-radius: 2px;
|
|
@@ -198,12 +200,12 @@
|
|
|
198
200
|
.contentview {
|
|
199
201
|
overflow: auto;
|
|
200
202
|
height: calc(100% - 84px);
|
|
201
|
-
padding: 20px;
|
|
203
|
+
// padding: 20px;
|
|
202
204
|
box-sizing: border-box;
|
|
203
205
|
// Airtable: hairline 边框 + 白底
|
|
204
206
|
background-color: white;
|
|
205
|
-
border: 1px solid #dddddd;
|
|
206
|
-
border-radius: 12px;
|
|
207
|
+
// border: 1px solid #dddddd;
|
|
208
|
+
// border-radius: 12px;
|
|
207
209
|
}
|
|
208
210
|
}
|
|
209
211
|
}
|
|
@@ -58,9 +58,16 @@ export function login(params: {
|
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* 单点登录 /api/ssologin
|
|
61
|
+
* 票据由接入方(门户/统一认证)用 backend sso.ticketKey 生成:
|
|
62
|
+
* sign = HMAC-SHA256(`${username}\n${ts}`, ticketKey) hex
|
|
63
|
+
* backend 未开启 sso(yaml sso.enabled=false)时该接口返回 404。
|
|
61
64
|
*/
|
|
62
|
-
export function ssoLogin(params: {
|
|
63
|
-
|
|
65
|
+
export function ssoLogin(params: {
|
|
66
|
+
username: string;
|
|
67
|
+
ts: string;
|
|
68
|
+
sign: string;
|
|
69
|
+
}): Promise<boolean> {
|
|
70
|
+
if (!params?.username || !params?.ts || !params?.sign) {
|
|
64
71
|
return Promise.resolve(false);
|
|
65
72
|
}
|
|
66
73
|
return request.get('/api/ssologin', { params }).then((res: ResponseItem) => {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as m,e as p,r as s,Q as d,j as f,S as g,O as h}from"./vendor-e7ea3a11.js";import{a as r}from"./api-21ca288f.js";import"./index-2e42b180.js";function E(){const c=m(),n=p(),[l,t]=s.useState(!0),[o,i]=s.useState(!1);return s.useEffect(()=>{if(!window.ENV.checkToken){t(!1);return}const e=()=>{c("/login?redirect=".concat(encodeURIComponent(n.pathname+n.search)))};t(!0);const u=d.parse(n.search.replace("?",""));if(u.user){r.admin.user.ssoLogin(u.token).then(a=>{a?(t(!1),i(!0)):(t(!1),i(!1))});return}r.admin.user.isLogin().then(a=>{a.login?(t(!1),i(a.permission)):(t(!1),e())})},[]),s.useEffect(()=>{o&&r.admin.user.getInfo().then(e=>{e.status==="SUCCESS"&&(e.data.menu?e.data.menuArray=JSON.parse(e.data.menu):e.data.menuArray=[])})},[o]),l?f.jsx(g,{spinning:!0,tip:"登录中...",size:"large",style:{height:"100vh",width:"100vw",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}}):f.jsx(h,{})}export{E as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./vendor-legacy-a62a28c9.js","./api-legacy-b464070b.js","./index-legacy-8c7d1ee7.js"],(function(e,t){"use strict";var n,s,r,a,i,u,o,c;return{setters:[e=>{n=e.u,s=e.e,r=e.r,a=e.Q,i=e.j,u=e.S,o=e.O},e=>{c=e.a},null],execute:function(){e("default",(function(){const e=n(),t=s(),[d,l]=r.useState(!0),[f,g]=r.useState(!1);return r.useEffect((()=>{if(!window.ENV.checkToken)return void l(!1);l(!0);const n=a.parse(t.search.replace("?",""));n.user?c.admin.user.ssoLogin(n.token).then((e=>{e?(l(!1),g(!0)):(l(!1),g(!1))})):c.admin.user.isLogin().then((n=>{n.login?(l(!1),g(n.permission)):(l(!1),e(`/login?redirect=${encodeURIComponent(t.pathname+t.search)}`))}))}),[]),r.useEffect((()=>{f&&c.admin.user.getInfo().then((e=>{"SUCCESS"===e.status&&(e.data.menu?e.data.menuArray=JSON.parse(e.data.menu):e.data.menuArray=[])}))}),[f]),d?i.jsx(u,{spinning:!0,tip:"登录中...",size:"large",style:{height:"100vh",width:"100vw",display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center"}}):i.jsx(o,{})}))}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as I,u as w,r as c,j as e,C as M,Z as P,D as K,f as E,A as O,U as R,g as S,M as T,h as D,i as F,k as W,O as B,l as U,z,m as L,L as $}from"./vendor-e7ea3a11.js";import{g as A,R as V,P as Z}from"./index-2e42b180.js";import{a as q}from"./api-21ca288f.js";import{a as G}from"./theme-3a4c7290.js";const H="_background_1usvo_10",J="_header_1usvo_19",Q="_logo_1usvo_28",X="_logotext_1usvo_31",Y="_menus_1usvo_36",ee="_menublock_1usvo_45",se="_menublockimg_1usvo_56",ne="_menublockselect_1usvo_64",oe="_userview_1usvo_68",te="_version_1usvo_75",le="_screenEntry_1usvo_85",ae="_bottom_1usvo_101",ce="_slider_1usvo_108",re="_menuWrap_1usvo_115",ie="_menuIcon_1usvo_127",ue="_sliderFooter_1usvo_139",de="_collapseText_1usvo_157",me="_right_1usvo_160",he="_route_1usvo_169",_e="_breadcrumb_1usvo_175",pe="_contentview_1usvo_178",o={background:H,header:J,logo:Q,logotext:X,menus:Y,menublock:ee,menublockimg:se,menublockselect:ne,userview:oe,version:te,screenEntry:le,bottom:ae,slider:ce,menuWrap:re,menuIcon:ie,sliderFooter:ue,collapseText:de,right:me,route:he,breadcrumb:_e,contentview:pe};U.locale(z);L.object;function be(){const i=I(),h=w(),b=c.useRef(),[_,j]=c.useState([]),[u,k]=c.useState(!1),[m,p]=c.useState({selectKeys:[],openKeys:[]}),y=c.useCallback(s=>e.jsx("a",{href:s.path,style:{color:"unset",fontSize:16},children:s.title},s.path),[]),v=c.useCallback((s,l)=>{const n=l&&s.selectIcon||s.icon;if(n)return typeof n!="string"?n:e.jsx("i",{className:o.menuIcon,style:{maskImage:"url(".concat(n,")"),WebkitMaskImage:"url(".concat(n,")")}})},[]);c.useEffect(()=>{const{routes:s}=A(i.pathname),l=[...s];l.pop(),p({openKeys:l.map(n=>n.fullPath),selectKeys:s.map(n=>n.fullPath)})},[i.pathname]),c.useEffect(()=>{var r,a;const s=V.find(t=>t.name==="系统"),l=(r=s==null?void 0:s.children)==null?void 0:r.find(t=>t.name==="后台管理系统"),n=(a=l==null?void 0:l.children)==null?void 0:a.find(t=>t.name==="后台管理系统");j((n==null?void 0:n.children)||[])},[]);const N=c.useMemo(()=>{const s=(l,n,r=[])=>l.filter(a=>a.name&&!a.hideInMenu).reduce((a,t)=>{var f;if(a)return a;const d=[...r,t];if(t.fullPath===n)return d;if((f=t.children)!=null&&f.length){const g=s(t.children,n,d);if(g)return g}return null},null);return s(_,i.pathname)||[]},[_,i.pathname]),x=(s,l=[])=>s.filter(n=>n.name&&!n.hideInMenu).map(n=>{var t;const r=m.selectKeys.includes(n.fullPath);return((t=n.children)==null?void 0:t.filter(d=>d.name&&!d.hideInMenu).length)>0?{key:n.fullPath,icon:v(n,r),label:n.name,children:x(n.children,[...l,n])}:{key:n.fullPath,icon:v(n,r),label:n.name}}),C=[{key:"logout",label:"退出系统",icon:e.jsx($,{}),onClick:()=>{q.admin.user.logout().then(s=>{s&&h("/login?redirect=".concat(encodeURIComponent(i.pathname+i.search)))})}}];return e.jsx(M,{locale:P,theme:G,children:e.jsx("div",{style:{width:"100vw",height:"100vh"},children:e.jsxs("div",{className:o.background,ref:b,children:[e.jsxs("div",{className:o.header,children:[e.jsx("img",{className:o.logo,alt:"logo",src:"/logo.svg"}),e.jsx("span",{className:o.logotext,children:Z.title}),e.jsx("div",{style:{flex:1}}),e.jsxs("div",{className:o.userview,children:[e.jsx("span",{className:o.version,children:"v1.0.0"}),e.jsx("button",{type:"button",className:o.screenEntry,title:"进入大屏",onClick:()=>h("/screen"),children:e.jsx(K,{})}),e.jsx(E,{menu:{items:C},children:e.jsxs("div",{className:o.userInfo,children:[e.jsx(O,{style:{backgroundColor:"transparent",border:"2px solid #d1d1d1"},icon:e.jsx(R,{})}),e.jsx("span",{style:{margin:"0 10px"},children:"admin"}),e.jsx(S,{})]})})]})]}),e.jsxs("div",{className:o.bottom,children:[e.jsxs("div",{className:o.slider,style:{width:u?64:240},children:[e.jsx("div",{className:o.menuWrap,children:e.jsx(T,{mode:"inline",inlineCollapsed:u,items:x(_),onSelect:s=>{h(s.key)},selectedKeys:m.selectKeys,openKeys:u?[]:m.openKeys,onOpenChange:s=>{p({...m,openKeys:s})}})}),e.jsxs("div",{className:o.sliderFooter,onClick:()=>k(s=>!s),role:"button",tabIndex:0,children:[u?e.jsx(D,{}):e.jsx(F,{}),!u&&e.jsx("span",{className:o.collapseText,children:"收起菜单"})]})]}),e.jsxs("div",{className:o.right,children:[e.jsx("div",{className:o.route,children:e.jsx(W,{items:N.map(s=>({key:s.name,title:s.name,path:s.fullPath})),className:o.breadcrumb,itemRender:y})}),e.jsx("div",{className:o.contentview,children:e.jsx(B,{})})]})]})]})})})}export{be as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._background_1usvo_10{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;transform-origin:left top;background-color:#f8fafc}._background_1usvo_10 ._header_1usvo_19{display:flex;flex-direction:row;align-items:center;padding:0 15px;height:60px;color:#fff;background-color:#181d26}._background_1usvo_10 ._header_1usvo_19 ._logo_1usvo_28{width:32px}._background_1usvo_10 ._header_1usvo_19 ._logotext_1usvo_31{margin-left:10px;font-size:20px;line-height:20px}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;margin-right:50px;font-size:16px;flex:1}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublock_1usvo_45{display:flex;flex-direction:row;align-items:center;margin-left:30px;border-bottom:2px solid transparent;height:60px;color:#d0d6e0;box-sizing:border-box;cursor:pointer}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublock_1usvo_45 ._menublockimg_1usvo_56{margin-right:8px;width:20px}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublock_1usvo_45:hover,._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublockselect_1usvo_64{border-color:#fff;color:#fff}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68{cursor:pointer;display:flex;align-items:center;gap:14px}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68 ._version_1usvo_75{color:#9297a0;font-size:12px;line-height:1;padding:3px 8px;border:1px solid #3a3f48;border-radius:10px;background:rgba(255,255,255,.04);white-space:nowrap}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68 ._screenEntry_1usvo_85{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;color:#9297a0;font-size:16px;line-height:1;transition:color .2s,background .2s}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68 ._screenEntry_1usvo_85:hover{color:#fff;background:rgba(255,255,255,.08)}._background_1usvo_10 ._bottom_1usvo_101{display:flex;flex-direction:row;width:100%;height:calc(100% - 60px);box-sizing:border-box}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108{display:flex;flex-direction:column;background-color:#1d1f25;transition:width .2s ease;overflow:hidden}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuWrap_1usvo_115{flex:1;overflow-y:auto;overflow-x:hidden}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuWrap_1usvo_115::-webkit-scrollbar{width:4px}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuWrap_1usvo_115::-webkit-scrollbar-thumb{background:#3a3f48;border-radius:2px}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuIcon_1usvo_127{display:inline-block;width:16px;height:16px;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center;-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;-webkit-mask-position:center}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._sliderFooter_1usvo_139{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;height:48px;border-top:1px solid #2a2d35;color:#d0d6e0;font-size:14px;cursor:pointer;user-select:none;flex-shrink:0}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._sliderFooter_1usvo_139:hover{background-color:#23262e;color:#fff}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._sliderFooter_1usvo_139 ._collapseText_1usvo_157{white-space:nowrap}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160{display:flex;flex-direction:column;padding:0 40px;flex:1;width:0;box-sizing:border-box;background-color:#f8fafc}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160 ._route_1usvo_169{display:flex;flex-direction:row;align-items:center;height:44px}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160 ._route_1usvo_169 ._breadcrumb_1usvo_175{color:#333840}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160 ._contentview_1usvo_178{overflow:auto;height:calc(100% - 84px);padding:20px;box-sizing:border-box;background-color:#fff;border:1px solid #dddddd;border-radius:12px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./vendor-legacy-a62a28c9.js","./index-legacy-8c7d1ee7.js","./api-legacy-b464070b.js","./theme-legacy-ad78aecb.js"],(function(e,o){"use strict";var s,_,r,n,t,i,u,l,a,c,d,v,m,h,b,x,g,p,f,k,y,j,w,N,z;return{setters:[e=>{s=e.e,_=e.u,r=e.r,n=e.j,t=e.C,i=e.Z,u=e.D,l=e.f,a=e.A,c=e.U,d=e.g,v=e.M,m=e.h,h=e.i,b=e.k,x=e.O,g=e.l,p=e.z,f=e.m,k=e.L},e=>{y=e.g,j=e.R,w=e.P},e=>{N=e.a},e=>{z=e.a}],execute:function(){var o=document.createElement("style");o.textContent="._background_1usvo_10{display:flex;flex-direction:column;width:100%;height:100%;box-sizing:border-box;transform-origin:left top;background-color:#f8fafc}._background_1usvo_10 ._header_1usvo_19{display:flex;flex-direction:row;align-items:center;padding:0 15px;height:60px;color:#fff;background-color:#181d26}._background_1usvo_10 ._header_1usvo_19 ._logo_1usvo_28{width:32px}._background_1usvo_10 ._header_1usvo_19 ._logotext_1usvo_31{margin-left:10px;font-size:20px;line-height:20px}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;margin-right:50px;font-size:16px;flex:1}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublock_1usvo_45{display:flex;flex-direction:row;align-items:center;margin-left:30px;border-bottom:2px solid transparent;height:60px;color:#d0d6e0;box-sizing:border-box;cursor:pointer}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublock_1usvo_45 ._menublockimg_1usvo_56{margin-right:8px;width:20px}._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublock_1usvo_45:hover,._background_1usvo_10 ._header_1usvo_19 ._menus_1usvo_36 ._menublockselect_1usvo_64{border-color:#fff;color:#fff}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68{cursor:pointer;display:flex;align-items:center;gap:14px}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68 ._version_1usvo_75{color:#9297a0;font-size:12px;line-height:1;padding:3px 8px;border:1px solid #3a3f48;border-radius:10px;background:rgba(255,255,255,.04);white-space:nowrap}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68 ._screenEntry_1usvo_85{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;color:#9297a0;font-size:16px;line-height:1;transition:color .2s,background .2s}._background_1usvo_10 ._header_1usvo_19 ._userview_1usvo_68 ._screenEntry_1usvo_85:hover{color:#fff;background:rgba(255,255,255,.08)}._background_1usvo_10 ._bottom_1usvo_101{display:flex;flex-direction:row;width:100%;height:calc(100% - 60px);box-sizing:border-box}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108{display:flex;flex-direction:column;background-color:#1d1f25;transition:width .2s ease;overflow:hidden}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuWrap_1usvo_115{flex:1;overflow-y:auto;overflow-x:hidden}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuWrap_1usvo_115::-webkit-scrollbar{width:4px}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuWrap_1usvo_115::-webkit-scrollbar-thumb{background:#3a3f48;border-radius:2px}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._menuIcon_1usvo_127{display:inline-block;width:16px;height:16px;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center;-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;-webkit-mask-position:center}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._sliderFooter_1usvo_139{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;height:48px;border-top:1px solid #2a2d35;color:#d0d6e0;font-size:14px;cursor:pointer;user-select:none;flex-shrink:0}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._sliderFooter_1usvo_139:hover{background-color:#23262e;color:#fff}._background_1usvo_10 ._bottom_1usvo_101 ._slider_1usvo_108 ._sliderFooter_1usvo_139 ._collapseText_1usvo_157{white-space:nowrap}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160{display:flex;flex-direction:column;padding:0 40px;flex:1;width:0;box-sizing:border-box;background-color:#f8fafc}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160 ._route_1usvo_169{display:flex;flex-direction:row;align-items:center;height:44px}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160 ._route_1usvo_169 ._breadcrumb_1usvo_175{color:#333840}._background_1usvo_10 ._bottom_1usvo_101 ._right_1usvo_160 ._contentview_1usvo_178{overflow:auto;height:calc(100% - 84px);padding:20px;box-sizing:border-box;background-color:#fff;border:1px solid #dddddd;border-radius:12px}\n",document.head.appendChild(o),e("default",(function(){const e=s(),o=_(),g=r.useRef(),[p,f]=r.useState([]),[I,K]=r.useState(!1),[E,P]=r.useState({selectKeys:[],openKeys:[]}),W=r.useCallback((e=>n.jsx("a",{href:e.path,style:{color:"unset",fontSize:16},children:e.title},e.path)),[]),F=r.useCallback(((e,o)=>{const s=o&&e.selectIcon||e.icon;if(s)return"string"!=typeof s?s:n.jsx("i",{className:C.menuIcon,style:{maskImage:`url(${s})`,WebkitMaskImage:`url(${s})`}})}),[]);r.useEffect((()=>{const{routes:o}=y(e.pathname),s=[...o];s.pop(),P({openKeys:s.map((e=>e.fullPath)),selectKeys:o.map((e=>e.fullPath))})}),[e.pathname]),r.useEffect((()=>{const e=j.find((e=>"系统"===e.name)),o=e?.children?.find((e=>"后台管理系统"===e.name)),s=o?.children?.find((e=>"后台管理系统"===e.name));f(s?.children||[])}),[]);const M=r.useMemo((()=>{const o=(e,s,_=[])=>e.filter((e=>e.name&&!e.hideInMenu)).reduce(((e,r)=>{if(e)return e;const n=[..._,r];if(r.fullPath===s)return n;if(r.children?.length){const e=o(r.children,s,n);if(e)return e}return null}),null);return o(p,e.pathname)||[]}),[p,e.pathname]),S=(e,o=[])=>e.filter((e=>e.name&&!e.hideInMenu)).map((e=>{const s=E.selectKeys.includes(e.fullPath);return e.children?.filter((e=>e.name&&!e.hideInMenu)).length>0?{key:e.fullPath,icon:F(e,s),label:e.name,children:S(e.children,[...o,e])}:{key:e.fullPath,icon:F(e,s),label:e.name}})),R=[{key:"logout",label:"退出系统",icon:n.jsx(k,{}),onClick:()=>{N.admin.user.logout().then((s=>{s&&o(`/login?redirect=${encodeURIComponent(e.pathname+e.search)}`)}))}}];return n.jsx(t,{locale:i,theme:z,children:n.jsx("div",{style:{width:"100vw",height:"100vh"},children:n.jsxs("div",{className:C.background,ref:g,children:[n.jsxs("div",{className:C.header,children:[n.jsx("img",{className:C.logo,alt:"logo",src:"/logo.svg"}),n.jsx("span",{className:C.logotext,children:w.title}),n.jsx("div",{style:{flex:1}}),n.jsxs("div",{className:C.userview,children:[n.jsx("span",{className:C.version,children:"v1.0.0"}),n.jsx("button",{type:"button",className:C.screenEntry,title:"进入大屏",onClick:()=>o("/screen"),children:n.jsx(u,{})}),n.jsx(l,{menu:{items:R},children:n.jsxs("div",{className:C.userInfo,children:[n.jsx(a,{style:{backgroundColor:"transparent",border:"2px solid #d1d1d1"},icon:n.jsx(c,{})}),n.jsx("span",{style:{margin:"0 10px"},children:"admin"}),n.jsx(d,{})]})})]})]}),n.jsxs("div",{className:C.bottom,children:[n.jsxs("div",{className:C.slider,style:{width:I?64:240},children:[n.jsx("div",{className:C.menuWrap,children:n.jsx(v,{mode:"inline",inlineCollapsed:I,items:S(p),onSelect:e=>{o(e.key)},selectedKeys:E.selectKeys,openKeys:I?[]:E.openKeys,onOpenChange:e=>{P({...E,openKeys:e})}})}),n.jsxs("div",{className:C.sliderFooter,onClick:()=>K((e=>!e)),role:"button",tabIndex:0,children:[I?n.jsx(m,{}):n.jsx(h,{}),!I&&n.jsx("span",{className:C.collapseText,children:"收起菜单"})]})]}),n.jsxs("div",{className:C.right,children:[n.jsx("div",{className:C.route,children:n.jsx(b,{items:M.map((e=>({key:e.name,title:e.name,path:e.fullPath}))),className:C.breadcrumb,itemRender:W})}),n.jsx("div",{className:C.contentview,children:n.jsx(x,{})})]})]})]})})})}));const C={background:"_background_1usvo_10",header:"_header_1usvo_19",logo:"_logo_1usvo_28",logotext:"_logotext_1usvo_31",menus:"_menus_1usvo_36",menublock:"_menublock_1usvo_45",menublockimg:"_menublockimg_1usvo_56",menublockselect:"_menublockselect_1usvo_64",userview:"_userview_1usvo_68",version:"_version_1usvo_75",screenEntry:"_screenEntry_1usvo_85",bottom:"_bottom_1usvo_101",slider:"_slider_1usvo_108",menuWrap:"_menuWrap_1usvo_115",menuIcon:"_menuIcon_1usvo_127",sliderFooter:"_sliderFooter_1usvo_139",collapseText:"_collapseText_1usvo_157",right:"_right_1usvo_160",route:"_route_1usvo_169",breadcrumb:"_breadcrumb_1usvo_175",contentview:"_contentview_1usvo_178"};g.locale(p),f.object}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a3 as i,w as s}from"./vendor-e7ea3a11.js";import{P as _}from"./index-2e42b180.js";const{CancelToken:y}=i,b=y.source(),u=i.create({baseURL:"",timeoutErrorMessage:"网络出点小差,请稍等重试",withCredentials:!1,responseType:"json",cancelToken:b.token});u.interceptors.request.use(e=>e);u.interceptors.response.use(e=>{const t=_.request.ignoreContentTypes,r=e.headers["content-type"];return t.some(n=>r.includes(n))?e:e.data},e=>Promise.reject(e));const o=u,l=i.create({timeoutErrorMessage:"网络出点小差,请稍等重试",withCredentials:!1,responseType:"json"});l.interceptors.response.use(e=>e.data);const d="login_type",a="storage_usertoken",p=(e,t)=>{localStorage.setItem(d,e),e==="sso"?sessionStorage.setItem(a,t):e==="password"&&localStorage.setItem(a,t),c(t&&"Bearer ".concat(t))},S=()=>{switch(localStorage.getItem(d)){case"password":return localStorage.getItem(a);case"sso":return sessionStorage.getItem(a);default:return""}};function h(e){return o.post("/api/login",e).then(t=>t.code===200&&t.data?(p("password",t.data),!0):!1)}function O(e){return!e||Object.keys(e).length===0?Promise.resolve(!1):o.get("/api/ssologin",{params:e}).then(t=>t.code===200&&t.data?(p("sso",t.data),!0):!1)}function j(){return S()}function T(){return o.get("/api/user/islogin").then(e=>{var t,r;return{login:e.code===200&&((t=e.data)==null?void 0:t.login),permission:e.code===200&&((r=e.data)==null?void 0:r.permission)}})}function I(){return o.get("/api/user/captcha").then(e=>e.data||{captchaId:"",svg:""})}function v(){return o.get("/api/user/info").then(e=>e.code===200?{status:"SUCCESS",data:e.data}:{status:"FAIL"})}function M(){return o.post("/api/user/logout").then(e=>e.code===200).finally(()=>{localStorage.removeItem(a),c(null)})}const P=Object.freeze(Object.defineProperty({__proto__:null,getAuthorization:j,getCaptcha:I,getInfo:v,isLogin:T,login:h,logout:M,ssoLogin:O},Symbol.toStringTag,{value:"Module"}));function L(){return o.get("/api/user/captcha")}const Y=Object.freeze(Object.defineProperty({__proto__:null,getCaptcha:L},Symbol.toStringTag,{value:"Module"})),w=10*1024*1024;function $(e){const t=new FormData;return t.append("file",e),o.post("/api/upload",t,{headers:{"Content-Type":"multipart/form-data"}})}const z=Object.freeze(Object.defineProperty({__proto__:null,UPLOAD_MAX_SIZE:w,upload:$},Symbol.toStringTag,{value:"Module"}));function U(e){return o.post("/api/add",e)}function B(e){return o.get("/api/getList",{params:e})}function C(e){return o.put("/api/edit",e)}function A(e){return o.delete("/api/deleteById",{params:e})}function E(e,t){const r=new FormData;return r.append("file",e),o.post("/api/v1/import",r,t)}const q=Object.freeze(Object.defineProperty({__proto__:null,add:U,deleteById:A,getList:B,update:C,upload:E},Symbol.toStringTag,{value:"Module"}));function N(){return o.get("/api/ops/overview")}function F(e){return o.get("/api/ops/probe/".concat(e))}const R=Object.freeze(Object.defineProperty({__proto__:null,overview:N,probe:F},Symbol.toStringTag,{value:"Module"}));function D(e){return o.get("/api/getList",{params:e})}function x(e){return o.post("/api/add",e)}function k(e){return o.put("/api/edit",e)}function G(e){return o.delete("/api/deleteById",{params:{id:e}})}const K=Object.freeze(Object.defineProperty({__proto__:null,add:x,deleteById:G,edit:k,getList:D},Symbol.toStringTag,{value:"Module"}));function W(e){return o.get("/api/image/getList",{params:e})}function V(e){return o.post("/api/image/add",e)}function X(e){return o.put("/api/image/edit",e)}function Z(e){return o.delete("/api/image/deleteById",{params:{id:e}})}const H=Object.freeze(Object.defineProperty({__proto__:null,add:V,deleteById:Z,edit:X,getList:W},Symbol.toStringTag,{value:"Module"}));function J(e){return o.get("/api/user/list",{params:e})}function Q(e){return o.post("/api/user/create",e)}function ee(e){return o.put("/api/user/update",e)}function te(e){return o.delete("/api/user/delete",{params:{id:e}})}function oe(e){return o.post("/api/user/resetPassword",null,{params:{id:e}})}function re(e){return o.post("/api/user/toggleStatus",null,{params:{id:e}})}const ne=Object.freeze(Object.defineProperty({__proto__:null,createUser:Q,deleteUser:te,listUsers:J,resetUserPassword:oe,toggleUserStatus:re,updateUser:ee},Symbol.toStringTag,{value:"Module"}));function ae(e){return o.get("/api/audit/list",{params:e})}const se=Object.freeze(Object.defineProperty({__proto__:null,listAuditLogs:ae},Symbol.toStringTag,{value:"Module"})),f={user:P,captcha:Y,upload:z,test:q,ops:R,pageData:K,image:H,userManage:ne,auditLog:se},ie=e=>{let t="YYYYMM";switch(e){case 1:t="YYYYMMDD";break;case 2:t="YYYYMM";break;case 3:t="YYYY";break}return t};function ue(e,t=2){return Number.isInteger(e)?e.toString():e.toFixed(t)}const ce=(e,t)=>{let r=e.id?1/e.id:0,n=t.id?1/t.id:0;return e.sort<0?r+=-1e3-e.sort:e.sort>0&&(r+=20*1e3*(e.sort?1/e.sort:1)),t.sort<0?n+=-1e3-t.sort:t.sort>0&&(n+=20*1e3*(t.sort?1/t.sort:1)),n-r},le=e=>{if(e.data instanceof Blob){const t=e.headers["content-disposition"],g=(t==null?void 0:t.split(";")).find(m=>m.trim().startsWith("filename=")).trim().replace("filename=","");return{data:e.data,fileName:decodeURIComponent(g)}}return{}},de=Object.freeze(Object.defineProperty({__proto__:null,exportFile:le,formatNumber:ue,getTimeFormatter:ie,sort:ce},Symbol.toStringTag,{value:"Module"})),pe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));o.defaults.baseURL=window.ENV.requestBaseUrl;o.defaults.validateStatus=e=>(e===401&&s.info("登录失效,请重新登录"),e>=200&&e<300);o.interceptors.response.use(e=>(e&&e.code!==void 0&&e.code!==200&&s.error(e.message||e.msg||"请求失败,请重试"),e),e=>{var t;s.error("".concat(e==null?void 0:e.message,"(").concat(decodeURIComponent((t=e.request)==null?void 0:t.responseURL),")"),5)});const c=e=>{const t=e&&(e.startsWith("Bearer ")?e:"Bearer ".concat(e));o.defaults.headers.Authorization=t,l.defaults.headers.Authorization=t};c(f.user.getAuthorization());const me={admin:f,common:de,mysql:pe};export{w as U,me as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./vendor-legacy-a62a28c9.js","./index-legacy-8c7d1ee7.js"],(function(e,t){"use strict";var r,o,n;return{setters:[e=>{r=e.a3,o=e.w},e=>{n=e.P}],execute:function(){const{CancelToken:t}=r,a=t.source(),s=r.create({baseURL:"",timeoutErrorMessage:"网络出点小差,请稍等重试",withCredentials:!1,responseType:"json",cancelToken:a.token});s.interceptors.request.use((e=>e)),s.interceptors.response.use((e=>{const t=n.request.ignoreContentTypes,r=e.headers["content-type"];return t.some((e=>r.includes(e)))?e:e.data}),(e=>Promise.reject(e)));const i=s,u=r.create({timeoutErrorMessage:"网络出点小差,请稍等重试",withCredentials:!1,responseType:"json"});u.interceptors.response.use((e=>e.data));const d="login_type",l="storage_usertoken",p=(e,t)=>{localStorage.setItem(d,e),"sso"===e?sessionStorage.setItem(l,t):"password"===e&&localStorage.setItem(l,t),y(t?`Bearer ${t}`:t)},c=Object.freeze(Object.defineProperty({__proto__:null,getAuthorization:function(){return(()=>{switch(localStorage.getItem(d)){case"password":return localStorage.getItem(l);case"sso":return sessionStorage.getItem(l);default:return""}})()},getCaptcha:function(){return i.get("/api/user/captcha").then((e=>e.data||{captchaId:"",svg:""}))},getInfo:function(){return i.get("/api/user/info").then((e=>200===e.code?{status:"SUCCESS",data:e.data}:{status:"FAIL"}))},isLogin:function(){return i.get("/api/user/islogin").then((e=>({login:200===e.code&&e.data?.login,permission:200===e.code&&e.data?.permission})))},login:function(e){return i.post("/api/login",e).then((e=>!(200!==e.code||!e.data||(p("password",e.data),0))))},logout:function(){return i.post("/api/user/logout").then((e=>200===e.code)).finally((()=>{localStorage.removeItem(l),y(null)}))},ssoLogin:function(e){return e&&0!==Object.keys(e).length?i.get("/api/ssologin",{params:e}).then((e=>!(200!==e.code||!e.data||(p("sso",e.data),0)))):Promise.resolve(!1)}},Symbol.toStringTag,{value:"Module"})),g=Object.freeze(Object.defineProperty({__proto__:null,getCaptcha:function(){return i.get("/api/user/captcha")}},Symbol.toStringTag,{value:"Module"})),f=e("U",10485760),m={user:c,captcha:g,upload:Object.freeze(Object.defineProperty({__proto__:null,UPLOAD_MAX_SIZE:f,upload:function(e){const t=new FormData;return t.append("file",e),i.post("/api/upload",t,{headers:{"Content-Type":"multipart/form-data"}})}},Symbol.toStringTag,{value:"Module"})),test:Object.freeze(Object.defineProperty({__proto__:null,add:function(e){return i.post("/api/add",e)},deleteById:function(e){return i.delete("/api/deleteById",{params:e})},getList:function(e){return i.get("/api/getList",{params:e})},update:function(e){return i.put("/api/edit",e)},upload:function(e,t){const r=new FormData;return r.append("file",e),i.post("/api/v1/import",r,t)}},Symbol.toStringTag,{value:"Module"})),ops:Object.freeze(Object.defineProperty({__proto__:null,overview:function(){return i.get("/api/ops/overview")},probe:function(e){return i.get(`/api/ops/probe/${e}`)}},Symbol.toStringTag,{value:"Module"})),pageData:Object.freeze(Object.defineProperty({__proto__:null,add:function(e){return i.post("/api/add",e)},deleteById:function(e){return i.delete("/api/deleteById",{params:{id:e}})},edit:function(e){return i.put("/api/edit",e)},getList:function(e){return i.get("/api/getList",{params:e})}},Symbol.toStringTag,{value:"Module"})),image:Object.freeze(Object.defineProperty({__proto__:null,add:function(e){return i.post("/api/image/add",e)},deleteById:function(e){return i.delete("/api/image/deleteById",{params:{id:e}})},edit:function(e){return i.put("/api/image/edit",e)},getList:function(e){return i.get("/api/image/getList",{params:e})}},Symbol.toStringTag,{value:"Module"})),userManage:Object.freeze(Object.defineProperty({__proto__:null,createUser:function(e){return i.post("/api/user/create",e)},deleteUser:function(e){return i.delete("/api/user/delete",{params:{id:e}})},listUsers:function(e){return i.get("/api/user/list",{params:e})},resetUserPassword:function(e){return i.post("/api/user/resetPassword",null,{params:{id:e}})},toggleUserStatus:function(e){return i.post("/api/user/toggleStatus",null,{params:{id:e}})},updateUser:function(e){return i.put("/api/user/update",e)}},Symbol.toStringTag,{value:"Module"})),auditLog:Object.freeze(Object.defineProperty({__proto__:null,listAuditLogs:function(e){return i.get("/api/audit/list",{params:e})}},Symbol.toStringTag,{value:"Module"}))},_=Object.freeze(Object.defineProperty({__proto__:null,exportFile:e=>{if(e.data instanceof Blob){const t=e.headers["content-disposition"],r=t?.split(";"),o=r.find((e=>e.trim().startsWith("filename="))).trim().replace("filename=","");return{data:e.data,fileName:decodeURIComponent(o)}}return{}},formatNumber:function(e,t=2){return Number.isInteger(e)?e.toString():e.toFixed(t)},getTimeFormatter:e=>{let t="YYYYMM";switch(e){case 1:t="YYYYMMDD";break;case 2:t="YYYYMM";break;case 3:t="YYYY"}return t},sort:(e,t)=>{let r=e.id?1/e.id:0,o=t.id?1/t.id:0;return e.sort<0?r+=-1e3-e.sort:e.sort>0&&(r+=2e4*(e.sort?1/e.sort:1)),t.sort<0?o+=-1e3-t.sort:t.sort>0&&(o+=2e4*(t.sort?1/t.sort:1)),o-r}},Symbol.toStringTag,{value:"Module"})),b=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));i.defaults.baseURL=window.ENV.requestBaseUrl,i.defaults.validateStatus=e=>(401===e&&o.info("登录失效,请重新登录"),e>=200&&e<300),i.interceptors.response.use((e=>(e&&void 0!==e.code&&200!==e.code&&o.error(e.message||e.msg||"请求失败,请重试"),e)),(e=>{o.error(`${e?.message}(${decodeURIComponent(e.request?.responseURL)})`,5)}));const y=e=>{const t=e?e.startsWith("Bearer ")?e:`Bearer ${e}`:e;i.defaults.headers.Authorization=t,u.defaults.headers.Authorization=t};y(m.user.getAuthorization()),e("a",{admin:m,common:_,mysql:b})}}}));
|