Compare commits

..

3 Commits

Author SHA1 Message Date
Kane Wang 12dd277a2a 完善typescript的调试。 2023-03-07 17:54:52 +08:00
Kane Wang e99d092862 规范代码 2023-03-06 11:26:47 +08:00
Kane Wang ef78c2e42e 代码优化 2023-03-06 11:22:43 +08:00
16 changed files with 4813 additions and 4799 deletions

View File

@ -84,7 +84,7 @@ module.exports = {
"@typescript-eslint/quotes": ["error", "double",],
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/strict-boolean-expressions": ["error", {
"allowString": true,
"allowString": false,
},],
"comma-style": ["error", "last",], //逗号在行位
"array-bracket-spacing": ["error", "never",],

View File

@ -4,3 +4,5 @@ $color-bg-02: #f7954e;
$color-bg-03: #f27620;
$color-bg-04: #da3703;
$color-bg-05: #ba1800;
$color-charts-bg:#ffffff9f;

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

View File

@ -100,7 +100,7 @@ export default {
#chartWrapper {
min-height: 200px;
width: 100%;
background-color: #ffffffaf;
background-color: $color-charts-bg;
backdrop-filter: blur(10px);
flex-grow: 1;
border-radius: 5px;

View File

@ -2,7 +2,7 @@
* @Author: Kane
* @Date: 2023-02-28 14:48:30
* @LastEditors: Kane
* @FilePath: /task_schedule/src/data/cpicxim/StuffInfo.ts
* @FilePath: /task_schedule/src/data/cpicxim/StaffInfo.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -12,21 +12,21 @@ class StaffInfo
{
constructor(
p13uid: string,
staff_code: string,
staff_name: string,
department_code: string,
department_name: string,
section_office_code: string,
section_office_name: string
staffCode: string,
staffName: string,
departmentCode: string,
departmentName: string,
sectionOfficeCode: string,
sectionOfficeName: string
)
{
this._stuffCode = staff_code;
this._stuffName = staff_name;
this._stuffCode = staffCode;
this._stuffName = staffName;
this._p13uid = p13uid;
this._department_code = department_code;
this._department_name = department_name;
this._section_office_code = section_office_code;
this._section_office_name = section_office_name;
this._departmentCode = departmentCode;
this._departmentName = departmentName;
this._sectionOfficeCode = sectionOfficeCode;
this._sectionOfficeName = sectionOfficeName;
}
public get stuffCode(): string
@ -34,9 +34,9 @@ class StaffInfo
return this._stuffCode;
}
public set stuffCode(stuff_code: string)
public set stuffCode(stuffCode: string)
{
this._stuffCode = stuff_code;
this._stuffCode = stuffCode;
}
public get stuffName(): string
@ -44,9 +44,9 @@ class StaffInfo
return this._stuffName;
}
public set stuffName(stuff_name: string)
public set stuffName(stuffName: string)
{
this._stuffName = stuff_name;
this._stuffName = stuffName;
}
public get P13UID(): string
@ -59,34 +59,33 @@ class StaffInfo
this._p13uid = p13uid;
}
public set departmentCode(department_code: string)
public set departmentCode(departmentCode: string)
{
this._department_code = department_code;
this._departmentCode = departmentCode;
}
public get departmentCode()
public get departmentCode(): string
{
return this._department_code;
return this._departmentCode;
}
public set departmentName(department_name: string)
public set departmentName(departmentName: string)
{
this._department_name = department_name;
this._departmentName = departmentName;
}
public get departmentName()
public get departmentName(): string
{
return this._department_name;
return this._departmentName;
}
private _stuffCode: string;
private _stuffName: string;
private _p13uid: string;
private _department_code: string;
private _department_name: string;
private _section_office_code: string;
private _section_office_name: string;
private _departmentCode: string;
private _departmentName: string;
private readonly _sectionOfficeCode: string;
private readonly _sectionOfficeName: string;
}
export { StaffInfo };

View File

@ -8,23 +8,24 @@
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { service as instance } from "./api/request";
import { API_URL } from "./api/config";
import { type AxiosResponse } from "axios";
import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js";
interface LoginInfo
{
p13account: string;
password: string;
}
function login(data: LoginInfo)
async function login(data: LoginInfo): Promise<AxiosResponse<any, any>>
{
return instance.request(
return await instance.request(
{
method: "post",
url: API_URL.URL_LOGIN,
data: data,
data,
}
);
}
export { LoginInfo, login };
export { type LoginInfo, login };

View File

@ -8,5 +8,6 @@
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
export const API_URL = {
URL_LOGIN: import.meta.env.VITE_URL_LOGIN,
// URL_LOGIN: import.meta.env.VITE_URL_LOGIN,
URL_LOGIN: "http://222.76.244.118:11001/admin-system/account/p13_account_check",
};

View File

@ -7,7 +7,7 @@
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { StaffInfo } from "@/data/cpicxim/StaffInfo";
import { StaffInfo } from "@/data/cpicxim/StaffInfo.js";
const STUFF_ITEM = "stuff_info";
@ -17,7 +17,7 @@ function loadStaffInfo(): StaffInfo
try
{
obj = JSON.parse(window.localStorage.getItem(STUFF_ITEM) || "{}");
obj = JSON.parse(window.localStorage.getItem(STUFF_ITEM) ?? "{}");
}
catch (error)
{
@ -25,19 +25,18 @@ function loadStaffInfo(): StaffInfo
}
const stuff = new StaffInfo(
obj._p13uid || "",
obj._stuffCode || "",
obj._stuffName || "",
obj._department_code || "",
obj._department_name || "",
obj._section_office_code || "",
obj._section_office_name || "");
obj._p13uid ?? "",
obj._stuffCode ?? "",
obj._stuffName ?? "",
obj._department_code ?? "",
obj._department_name ?? "",
obj._section_office_code ?? "",
obj._section_office_name ?? "");
return stuff;
}
function saveStaffInfo(stuff: StaffInfo)
function saveStaffInfo(stuff: StaffInfo): void
{
const json = JSON.stringify(stuff);

View File

@ -1,3 +1,12 @@
/*
* @Author: Kane
* @Date: 2023-02-28 17:47:22
* @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/api/request.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import axios from "axios";
@ -8,29 +17,29 @@ const service = axios.create(
}
);
//请求拦截
// 请求拦截
service.interceptors.request.use(
(config) =>
{
return config;
},
(error) =>
async (error) =>
{
console.log(error);
return Promise.reject(error);
return await Promise.reject(error);
}
);
//响应拦截
// 响应拦截
service.interceptors.response.use(
(response) =>
{
return response;
},
(error) =>
async (error) =>
{
return Promise.reject(error);
return await Promise.reject(error);
}
);

View File

@ -75,7 +75,7 @@ function getParamsFromURL(url: string): stringkey
const param = item.split("=");
paramObj[param[0]] = param[1] || "";
paramObj[param[0]] = param[1] ?? "";
});
return paramObj;

View File

@ -13,7 +13,7 @@
"useDefineForClassFields": true,
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "node",
"moduleResolution": "nodenext",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
@ -26,8 +26,8 @@
],
},
"lib": [
"esnext",
"dom"
"ESNext",
"DOM"
],
"types": [
"vite/client"
@ -41,4 +41,7 @@
"src/router/index.js",
"src/router/index.js",
],
"exclude": [
"./node_modules",
]
}

File diff suppressed because it is too large Load Diff