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/quotes": ["error", "double",],
"@typescript-eslint/space-before-function-paren": "off", "@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/strict-boolean-expressions": ["error", { "@typescript-eslint/strict-boolean-expressions": ["error", {
"allowString": true, "allowString": false,
},], },],
"comma-style": ["error", "last",], //逗号在行位 "comma-style": ["error", "last",], //逗号在行位
"array-bracket-spacing": ["error", "never",], "array-bracket-spacing": ["error", "never",],

View File

@ -3,4 +3,6 @@ $color-bg-01: #fecb96;
$color-bg-02: #f7954e; $color-bg-02: #f7954e;
$color-bg-03: #f27620; $color-bg-03: #f27620;
$color-bg-04: #da3703; $color-bg-04: #da3703;
$color-bg-05: #ba1800; $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 { #chartWrapper {
min-height: 200px; min-height: 200px;
width: 100%; width: 100%;
background-color: #ffffffaf; background-color: $color-charts-bg;
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
flex-grow: 1; flex-grow: 1;
border-radius: 5px; border-radius: 5px;

View File

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

View File

@ -4,8 +4,8 @@
* @LastEditors: Kane * @LastEditors: Kane
* @FilePath: /task_schedule/src/store/index.ts * @FilePath: /task_schedule/src/store/index.ts
* @Description: vuex配置文件 * @Description: vuex配置文件
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
import { createStore } from "vuex"; import { createStore } from "vuex";
import app from "./modules/app"; import app from "./modules/app";
@ -16,4 +16,4 @@ const store = createStore({
}, },
}); });
export default store; export default store;

View File

@ -3,9 +3,9 @@
* @Date: 2023-03-01 23:03:02 * @Date: 2023-03-01 23:03:02
* @LastEditors: Kane * @LastEditors: Kane
* @FilePath: /task_schedule/src/store/modules/app.ts * @FilePath: /task_schedule/src/store/modules/app.ts
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
const state = { const state = {
staffInfo: null, staffInfo: null,
@ -21,4 +21,4 @@ export default {
getters, getters,
mutations, mutations,
actions, actions,
}; };

View File

@ -3,28 +3,29 @@
* @Date: 2023-03-02 14:48:35 * @Date: 2023-03-02 14:48:35
* @LastEditors: Kane * @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/account.ts * @FilePath: /task_schedule/src/utils/account.ts
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
import { service as instance } from "./api/request"; import { type AxiosResponse } from "axios";
import { API_URL } from "./api/config"; import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js";
interface LoginInfo interface LoginInfo
{ {
p13account: string; p13account: string;
password: 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", method: "post",
url: API_URL.URL_LOGIN, 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. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
export const API_URL = { 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

@ -3,11 +3,11 @@
* @Date: 2023-02-28 09:26:45 * @Date: 2023-02-28 09:26:45
* @LastEditors: Kane * @LastEditors: Kane
* @FilePath: /task_schedule/src/utils/api/localStorage.ts * @FilePath: /task_schedule/src/utils/api/localStorage.ts
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * 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"; const STUFF_ITEM = "stuff_info";
@ -17,7 +17,7 @@ function loadStaffInfo(): StaffInfo
try try
{ {
obj = JSON.parse(window.localStorage.getItem(STUFF_ITEM) || "{}"); obj = JSON.parse(window.localStorage.getItem(STUFF_ITEM) ?? "{}");
} }
catch (error) catch (error)
{ {
@ -25,23 +25,22 @@ function loadStaffInfo(): StaffInfo
} }
const stuff = new StaffInfo( const stuff = new StaffInfo(
obj._p13uid || "", obj._p13uid ?? "",
obj._stuffCode || "", obj._stuffCode ?? "",
obj._stuffName || "", obj._stuffName ?? "",
obj._department_code || "", obj._department_code ?? "",
obj._department_name || "", obj._department_name ?? "",
obj._section_office_code || "", obj._section_office_code ?? "",
obj._section_office_name || ""); obj._section_office_name ?? "");
return stuff; return stuff;
} }
function saveStaffInfo(stuff: StaffInfo) function saveStaffInfo(stuff: StaffInfo): void
{ {
const json = JSON.stringify(stuff); const json = JSON.stringify(stuff);
window.localStorage.setItem(STUFF_ITEM, json); window.localStorage.setItem(STUFF_ITEM, json);
}; };
export { loadStaffInfo, saveStaffInfo }; export { loadStaffInfo, saveStaffInfo };

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"; import axios from "axios";
@ -8,30 +17,30 @@ const service = axios.create(
} }
); );
//请求拦截 // 请求拦截
service.interceptors.request.use( service.interceptors.request.use(
(config) => (config) =>
{ {
return config; return config;
}, },
(error) => async (error) =>
{ {
console.log(error); console.log(error);
return Promise.reject(error); return await Promise.reject(error);
} }
); );
//响应拦截 // 响应拦截
service.interceptors.response.use( service.interceptors.response.use(
(response) => (response) =>
{ {
return response; return response;
}, },
(error) => async (error) =>
{ {
return Promise.reject(error); return await Promise.reject(error);
} }
); );
export { service }; export { service };

View File

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

View File

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

File diff suppressed because it is too large Load Diff