Compare commits

..

No commits in common. "3afde75e856f6ad7b1982660d154a68755ba0dd1" and "f75bdf6d39da9a750e18bf7cb0f5dc161999eaca" have entirely different histories.

126 changed files with 2646 additions and 12170 deletions

2
.gitignore vendored
View File

@ -722,5 +722,3 @@ local.properties
# Typically, this file would be tracked if it contains build/dependency configurations: # Typically, this file would be tracked if it contains build/dependency configurations:
#.project #.project
target
target/*

View File

@ -80,12 +80,6 @@
<artifactId>javax.annotation-api</artifactId> <artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version> <version>1.3.2</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.32</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>requirement</finalName> <finalName>requirement</finalName>

View File

@ -1,83 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-04 10:52:31
* @LastEditors: Kane
* @LastEditTime: 2023-02-04 13:38:58
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/data/RequirementStatus.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.data;
import com.fasterxml.jackson.annotation.JsonProperty;
public final class RequirementStatus
{
public RequirementStatus()
{}
public int getStatus_code()
{
return status_code;
}
public void setStatus_code( int status_code )
{
this.status_code = status_code;
}
public String getStatus_name()
{
return status_name;
}
public void setStatus_name( String status_name )
{
this.status_name = status_name;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + status_code;
result = prime * result + ((status_name == null) ? 0 : status_name.hashCode());
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj )
return true;
if ( obj == null )
return false;
if ( getClass() != obj.getClass() )
return false;
RequirementStatus other = (RequirementStatus) obj;
if ( status_code != other.status_code )
return false;
if ( status_name == null )
{
if ( other.status_name != null )
return false;
} else if ( !status_name.equals( other.status_name ) )
return false;
return true;
}
@Override
public String toString()
{
return "RequirementStatus [status_code=" + status_code + ", status_name=" + status_name
+ "]";
}
@JsonProperty( "status_code" )
private int status_code;
@JsonProperty( "status_name" )
private String status_name;
}

View File

@ -1,99 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-04 11:38:32
* @LastEditors: Kane
* @LastEditTime: 2023-02-17 10:52:40
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/utils/db/RequirementDbOperation.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.utils.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Vector;
import com.cpic.xim.data.RequirementStatus;
public final class RequirementDbOperation
{
private static final String MYSQL_JDBC_CONNECT = "jdbc:mysql://10.39.0.85:3306";
private static final String MYSQL_CLASS_DRIVER = "com.mysql.cj.jdbc.Driver";
/*****************************************************
* 查询需求状态
* @return Vector<RequirementStatus> 需求状态的集合
*****************************************************/
public static Vector<RequirementStatus> queryRequirementStatus()
throws ClassNotFoundException, SQLException
{
Vector<RequirementStatus> vStatus = new Vector<RequirementStatus>();
Class.forName( MYSQL_CLASS_DRIVER );
Connection conn = null;
Statement statement = null;
ResultSet results = null;
String querSQL = "select * from requirement.requirement_status";
try
{
conn = DriverManager.getConnection( MYSQL_JDBC_CONNECT, "cpicxim", "Cpic#1234" );
statement = conn.createStatement();
results = statement.executeQuery( querSQL );
while ( results.next())
{
RequirementStatus status = new RequirementStatus();
status.setStatus_code( results.getInt( "status_code" ) );
status.setStatus_name( results.getString( "status_name" ) );
vStatus.add( status );
}
}
finally
{
if ( results != null )
{
try
{
results.close();
}
catch ( SQLException except )
{
except.printStackTrace();
}
}
if ( statement != null )
{
try
{
statement.close();
}
catch ( SQLException except )
{
except.printStackTrace();
}
}
if ( conn != null )
{
try
{
conn.close();
}
catch ( SQLException except )
{
except.printStackTrace();
}
}
}
return vStatus;
}
}

View File

@ -2,25 +2,27 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-29 13:59:37 * @Date: 2023-01-29 13:59:37
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-04 14:40:07 * @LastEditTime: 2023-01-29 17:10:18
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/controllers/requirements/RequirementController.java * @FilePath: \requirement\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
package com.cpic.xim.web.controllers.requirements; package com.cpic.xim.web.controllers.requirements;
import java.io.IOException;
import java.nio.channels.IllegalSelectorException;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Vector; import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.cpic.xim.data.RequirementStatus; import com.cpic.xim.web.controllers.requirements.param.*;
import com.cpic.xim.utils.db.RequirementDbOperation; import com.cpic.xim.web.controllers.requirements.response.*;
import com.cpic.xim.web.controllers.requirements.param.RequirementQueryParam;
import com.cpic.xim.web.controllers.requirements.response.QueryRequirementStatusResult;
import com.cpic.xim.web.controllers.requirements.response.RequirementQueryResult;
@SuppressWarnings( "unused" ) @SuppressWarnings( "unused" )
@Controller @Controller
@ -37,30 +39,4 @@ public class RequirementController
return result; return result;
} }
@RequestMapping( "/query_requirement_status.do" )
@ResponseBody
public QueryRequirementStatusResult queryRequirementStatus()
{
QueryRequirementStatusResult result = new QueryRequirementStatusResult();
try
{
Vector<RequirementStatus> status = RequirementDbOperation.queryRequirementStatus();
result.setSuccess( true );
result.setRequirementStatus( status );
}
catch ( ClassNotFoundException exception )
{
result.setSuccess( false );
result.setMessage( exception.getMessage() );
}
catch ( SQLException exception )
{
result.setSuccess( false );
result.setMessage( exception.getMessage() );
}
return result;
}
} }

View File

@ -1,73 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-04 13:24:14
* @LastEditors: Kane
* @LastEditTime: 2023-02-04 13:38:03
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/controllers/requirements/response/QueryRequirementStatusResult.java
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
package com.cpic.xim.web.controllers.requirements.response;
import com.cpic.xim.data.RequirementStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Vector;
public class QueryRequirementStatusResult
{
public QueryRequirementStatusResult()
{}
public String getMessage()
{
return message;
}
public void setMessage( String message )
{
this.message = message;
}
public boolean isSuccess()
{
return success;
}
public void setSuccess( boolean success )
{
this.success = success;
}
public int getReturnCode()
{
return returnCode;
}
public void setReturnCode( int returnCode )
{
this.returnCode = returnCode;
}
public Vector<RequirementStatus> getRequirementStatus()
{
return requirementStatus;
}
public void setRequirementStatus( Vector<RequirementStatus> requirement_status )
{
this.requirementStatus = requirement_status;
}
@JsonProperty( "message" )
private String message;
@JsonProperty( "success" )
private boolean success;
@JsonProperty( "return_code" )
private int returnCode;
@JsonProperty( "requirement_status" )
private Vector<RequirementStatus> requirementStatus;
}

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-29 10:39:41 * @Date: 2023-01-29 10:39:41
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-04 17:12:05 * @LastEditTime: 2023-01-29 10:39:44
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/filters/cros/CrosFilter.java * @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
* @Description: 过滤器用于对CROS访问进行响应允许任何来源的访问 * @Description: 过滤器用于对CROS访问进行响应允许任何来源的访问
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -33,7 +33,7 @@ public class CrosFilter implements Filter
response.setHeader( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" ); response.setHeader( "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" );
response.setHeader( "Access-Control-Max-Age", "0" ); response.setHeader( "Access-Control-Max-Age", "0" );
response.setHeader( "Access-Control-Allow-Headers", response.setHeader( "Access-Control-Allow-Headers",
"Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token,username" ); "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With,userId,token" );
response.setHeader( "Access-Control-Allow-Credentials", "true" ); response.setHeader( "Access-Control-Allow-Credentials", "true" );
response.setHeader( "XDomainRequestAllowed", "1" ); response.setHeader( "XDomainRequestAllowed", "1" );
response.setHeader( "XDomainRequestAllowed", "1" ); response.setHeader( "XDomainRequestAllowed", "1" );

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-29 10:50:49 * @Date: 2023-01-29 10:50:49
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-04 18:05:18 * @LastEditTime: 2023-01-29 10:55:27
* @FilePath: /后端-需求/src/main/java/com/cpic/xim/web/filters/token/TokenFilter.java * @FilePath: \requirement\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -11,7 +11,6 @@
package com.cpic.xim.web.filters.token; package com.cpic.xim.web.filters.token;
import java.io.IOException; import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.Filter; import javax.servlet.Filter;
import javax.servlet.FilterChain; import javax.servlet.FilterChain;
import javax.servlet.ServletException; import javax.servlet.ServletException;
@ -20,11 +19,9 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@SuppressWarnings( "unused" ) @SuppressWarnings( "unused")
public class TokenFilter implements Filter public class TokenFilter implements Filter
{ {
private static final String FILTE_METHODS = "POST,GET";
@Override @Override
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain ) public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain )
throws ServletException, IOException throws ServletException, IOException
@ -32,14 +29,8 @@ public class TokenFilter implements Filter
HttpServletRequest request = (HttpServletRequest) req; HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) resp; HttpServletResponse response = (HttpServletResponse) resp;
String method = request.getMethod().toUpperCase(); // 获取请求中的token字符串
String token = request.getHeader( "Token" );
// 只处理POST和GET
if ( FILTE_METHODS.indexOf( method ) != -1 )
{
// 检查token
String token = request.getHeader( "token" );
}
chain.doFilter( request, response ); chain.doFilter( request, response );
} }

View File

@ -1,8 +1,5 @@
com\cpic\xim\data\RequirementStatus.class
com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.class
com\cpic\xim\web\filters\cros\CrosFilter.class
com\cpic\xim\utils\db\RequirementDbOperation.class
com\cpic\xim\web\controllers\requirements\response\QueryRequirementStatusResult.class
com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.class com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.class
com\cpic\xim\web\filters\token\TokenFilter.class com\cpic\xim\web\filters\token\TokenFilter.class
com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.class
com\cpic\xim\web\filters\cros\CrosFilter.class
com\cpic\xim\web\controllers\requirements\RequirementController.class com\cpic\xim\web\controllers\requirements\RequirementController.class

View File

@ -1,8 +1,5 @@
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\data\RequirementStatus.java D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.java D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.java D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\param\RequirementQueryParam.java
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\response\QueryRequirementStatusResult.java D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\controllers\requirements\response\RequirementQueryResult.java
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\filters\cros\CrosFilter.java D:\develop\cpicxim\it-console\code\java\requirement\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\filters\token\TokenFilter.java
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\web\controllers\requirements\RequirementController.java
D:\develop\cpicxim\it-console\code\java\后端-需求\src\main\java\com\cpic\xim\utils\db\RequirementDbOperation.java

View File

@ -1,4 +0,0 @@
node_modules
dist
target
tsconfig.json

View File

@ -1,60 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-09 15:26:18
* @LastEditors: Kane
* @LastEditTime: 2023-02-10 10:25:42
* @FilePath: /后端辅助工具/.eslintrc.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
// project: ["./tsconfig.json",],
tsconfigRootDir: __dirname,
},
plugins: [
"@typescript-eslint",
],
extends: [
// "standard-with-typescript",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"no-console": "warn",
"quote-props": ["warn", "as-needed",],
quotes: ["warn", "double", { allowTemplateLiterals: true, },],
indent: ["warn", 4,],
"no-unused-vars": "off",
semi: ["error", "always",], // 控制行尾部分号
"comma-dangle": ["error", {
arrays: "always",
objects: "always",
imports: "never",
exports: "never",
functions: "never",
},], // 数组和对象键值对最后一个逗号
"comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": ["error", "never",],
"no-undef-init": "error",
"no-invalid-this": "error",
"no-use-before-define": "error",
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等
// "comma-spacing": ["error", { "before": false, "after": true, },],
"brace-style": ["error", "allman", { allowSingleLine: true, },],
"prefer-const": "warn",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off",
},
};

View File

@ -1,21 +0,0 @@
{
"name": "pako",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "pako",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"pako": "^2.1.0"
}
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug=="
}
}
}

View File

@ -1,19 +0,0 @@
{
"name": "pako",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node index.js"
},
"keywords": [
"pako"
],
"type": "module",
"author": "Kane",
"license": "ISC",
"dependencies": {
"pako": "^2.1.0"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,37 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-13 14:54:46
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 14:55:19
* @FilePath: /pako/src/utils/StringConverter.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
function Uint8ArrayToString(fileData)
{
var dataString = "";
for (var i = 0; i < fileData.length; i++)
{
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
function stringToUint8Array(str)
{
var arr = [];
for (var i = 0, j = str.length; i < j; ++i)
{
arr.push(str.charCodeAt(i));
}
var tmpUint8Array = new Uint8Array(arr);
return tmpUint8Array;
}
export { Uint8ArrayToString, stringToUint8Array };

View File

@ -1,4 +0,0 @@
node_modules
dist
target
tsconfig.json

View File

@ -1,61 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-09 15:26:18
* @LastEditors: Kane
* @LastEditTime: 2023-02-18 23:36:07
* @FilePath: /后端辅助工具/.eslintrc.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
// project: ["./tsconfig.json",],
tsconfigRootDir: __dirname,
},
plugins: [
"@typescript-eslint",
],
extends: [
// "standard-with-typescript",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"no-console": "off",
"quote-props": ["warn", "as-needed",],
quotes: ["warn", "double", { allowTemplateLiterals: true, },],
indent: ["warn", 4,],
"no-unused-vars": "off",
semi: ["error", "always",], // 控制行尾部分号
"comma-dangle": ["error", {
arrays: "always",
objects: "always",
imports: "never",
exports: "never",
functions: "never",
},], // 数组和对象键值对最后一个逗号
"comma-style": ["error", "last",], // 逗号在行位
"array-bracket-spacing": ["error", "never",],
"no-undef-init": "error",
"no-invalid-this": "error",
"no-use-before-define": "error",
"no-shadow-restricted-names": "error", // 禁止对一些关键字或者保留字进行赋值操作比如NaN、Infinity、undefined、eval、arguments等
// "comma-spacing": ["error", { "before": false, "after": true, },],
"brace-style": ["error", "allman", { allowSingleLine: true, },],
"prefer-const": "warn",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-unused-vars": "off",
},
};

View File

@ -1,20 +0,0 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${file}",
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
]
}

View File

@ -1,3 +0,0 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}

View File

@ -1,14 +0,0 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"problemMatcher": [
"$tsc"
],
"group": "build",
"label": "tsc: build - tsconfig.json"
}
]
}

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +0,0 @@
{
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint": "^8.33.0"
},
"dependencies": {
"axios": "^1.3.2",
"pako": "^2.1.0"
}
}

View File

@ -1,41 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-17 22:35:49
* @LastEditors: Kane
* @LastEditTime: 2023-02-19 21:38:18
* @FilePath: //src/DataType/Class.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
class CpicximStuff
{
constructor(
private _stuffName: string,
private _stuffCode: string,
private _p13UID: string
) { }
get stuffName(): string
{
return this._stuffName;
}
set stuffName(stuffName: string)
{
this._stuffName = stuffName;
}
get stuffCode(): string
{
return this._stuffCode;
}
set stuffCode(code: string)
{
this._stuffCode = code;
}
};
export { CpicximStuff };

View File

@ -1,73 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-10 15:08:53
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 10:04:33
* @FilePath: //src/DataType/DataType.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
/*eslint no-unused-vars: "off" */
/*eslint @typescript-eslint/no-unused-vars: "off" */
//Tuple
function dataTypes()
{
const tu: readonly [number, number, number] = [1, 1, 2,];
const toArray: [number, number, string] = [1, 2, "3",];
const v1: (number | string)[] = toArray;
const s1 = "string";
console.log(typeof s1);
let point: {
x: number,
y: number,
};
point = { x: 0, y: 0, };
function addOne(x: number, y: number = 1): number
{
return x + y;
}
console.log(addOne(1));
function allParams(x: number, y: number): void
{
const z = x + y;
}
//剩余参数,数组形式
function overplusArgusWithArray(x: number, ...argus: number[]): number
{
return argus.length;
}
function overplusArugsWithTuple(x: number, ...argus: [number, number, string]): number
{
console.log(`元组形式的参数表${argus},剩余参数的数量${argus.length}`);
console.log(argus[2]);
return argus.length;
}
overplusArugsWithTuple(1, 2, 3, "test");
console.log(overplusArgusWithArray(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
//测试null
const nulltest: null = null;
let var_2: { x: string; } = { x: "test", };
// var_2 = null;
}
export default dataTypes;

View File

@ -1,30 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-13 23:08:34
* @LastEditors: Kane
* @LastEditTime: 2023-02-16 22:43:22
* @FilePath: //src/DataType/Function.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
function f(x: number, y: number): number
{
return x + y;
}
f.version = "1.0.0";
const func: {
(x: number, y: number): void,
version: string,
} = f;
function func_this_void(this: void, arg1: number): number
{
return arg1;
}
let constructor: {
new(x: string, y: string): object;
};

View File

@ -1,24 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-14 22:24:26
* @LastEditors: Kane
* @LastEditTime: 2023-02-21 23:31:40
* @FilePath: //src/DataType/Interface.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
interface document
{
getElementById(id: string): HTMLElement | null;
}
interface CpicStuff
{
stuffName: string;
stuffCode: string;
p13uid: string;
password: string;
}

View File

@ -1,23 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-21 17:39:01
* @LastEditors: Kane
* @LastEditTime: 2023-02-22 14:08:48
* @FilePath: //src/DataType/Template.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
interface Point
{
x: number;
y: number;
}
function radius<TPoint>(x: TPoint): TPoint
{
const result: TPoint = x;
return result;
}

View File

@ -1,11 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-13 15:46:17
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 23:34:55
* @FilePath: //src/axios/AxiosTest.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import axios from "axios";

View File

@ -1,19 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-13 15:53:45
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 22:41:50
* @FilePath: //src/axios/request.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import axios, {AxiosInstance, AxiosRequestConfig, AxiosResponse} from 'axios';
// const service = axios.create({
// baseURL: "",
// timeout: 10000,
// timeoutErrorMessage: "请求超时!",
// });

File diff suppressed because one or more lines are too long

View File

@ -1,21 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-09 22:14:30
* @LastEditors: Kane
* @LastEditTime: 2023-02-21 23:32:00
* @FilePath: //src/main.ts
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import dataTypes from "./DataType/DataType";
import { pakoTest } from "./gzip/PakoTest";
const greetings = "hello, this is kane's typescript!";
console.log(greetings);
console.log("all");
//dataTypes();
pakoTest();

View File

@ -1,38 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-13 14:54:46
* @LastEditors: Kane
* @LastEditTime: 2023-02-13 14:55:19
* @FilePath: /pako/src/utils/StringConverter.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
function Uint8ArrayToString(fileData: Uint8Array): string
{
let dataString: string = "";
for (let i = 0; i < fileData.length; i++)
{
dataString += String.fromCharCode(fileData[i]);
}
return dataString;
}
function stringToUint8Array(str: string): Uint8Array
{
const arr: number[] = [];
for (let i = 0, j = str.length; i < j; ++i)
{
arr.push(str.charCodeAt(i));
}
const tmpUint8Array: Uint8Array = new Uint8Array(arr);
return tmpUint8Array;
}
export { Uint8ArrayToString, stringToUint8Array };

View File

@ -1,40 +0,0 @@
/*
* @Author: Kane
* @Date: 2023-02-09 15:24:20
* @LastEditors: Kane
* @LastEditTime: 2023-02-17 23:15:11
* @FilePath: //tsconfig.json
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
{
"compilerOptions": {
"outDir": "./target",
"strict": false,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"sourceMap": true,
"allowJs": true,
"checkJs": true,
"moduleResolution": "node",
"module": "CommonJS",
"target": "ES2015"
},
// "files": [
// "./src/main.ts",
// ],
"include": [
"./src/**/*",
// "./src/*.ts",
// "src/main.ts",
// ".eslintrc.js",
],
"exclude": [
"./target",
"node_modules",
"bower_componets",
"jspm_packages",
],
// "outFile": "./target/mian.js",
}

View File

@ -0,0 +1,2 @@
VUE_APP_API_URL_LOGIN = "http://222.76.244.118:11001/admin-system/account/p13_account_check"
VUR_APPP_API_URL_UPLOAD_FILE= "http://222.76.244.118:11001/admin-system/file/file-upload.do"

View File

@ -0,0 +1,27 @@
/*
* @Author: Kane
* @Date: 2022-12-14 15:12:46
* @LastEditors: Kane
* @LastEditTime: 2022-12-14 15:20:20
* @FilePath: \admin_system\.eslintrc.js
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
parserOptions: {
parser: '@babel/eslint-parser'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
}
}

View File

@ -0,0 +1,36 @@
{
"name": "CPIC-IT-Console",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@element-plus/icons-vue": "^2.0.10",
"axios": "^1.2.1",
"core-js": "^3.8.3",
"element-plus": "^2.2.26",
"sass": "^1.56.2",
"sass-loader": "^13.2.0",
"scss": "^0.2.4",
"scss-loader": "^0.0.1",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/eslint-parser": "^7.12.16",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0",
"eslint": "^7.32.0",
"eslint-plugin-vue": "^8.0.3",
"svg-sprite-loader": "^2.1.0",
"vue-cli-plugin-element-plus": "~0.0.13"
}
}

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-17 11:08:18 * @Date: 2022-12-17 11:08:18
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-23 00:44:29 * @LastEditTime: 2023-01-29 09:46:42
* @FilePath: /it-console-toVite/public/index.html * @FilePath: \IT工具综合平台\public\index.html
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -14,7 +14,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="favicon.ico" /> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title>王炜的工具箱</title> <title>王炜的工具箱</title>
</head> </head>
<body> <body>
@ -25,10 +25,9 @@
continue.</strong continue.</strong
> >
</noscript> </noscript>
<div id="app"></div> <div id="app" v-cloak></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->
</body> </body>
<script type="module" src="../src/main.js"></script>
<style> <style>
.v-cloak { .v-cloak {
display: none; display: none;

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-14 15:12:46 * @Date: 2022-12-14 15:12:46
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-15 09:34:25 * @LastEditTime: 2023-01-19 14:26:17
* @FilePath: /IT/src/App.vue * @FilePath: \admin_system\src\App.vue
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -20,11 +20,10 @@ import zhCn from "element-plus/lib/locale/lang/zh-cn";
export default { export default {
name: "App", name: "App",
setup() data() {
{ return {
const locale = zhCn; locale: zhCn, //
};
return { locale, };
}, },
components: { components: {
// HelloWorld, // HelloWorld,
@ -33,5 +32,4 @@ export default {
</script> </script>
<style> <style>
</style> </style>

View File

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-06 20:33:57 * @Date: 2023-01-06 20:33:57
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-22 17:10:18 * @LastEditTime: 2023-01-07 17:10:07
* @FilePath: /IT/src/components/svg/SvgIcon.vue * @FilePath: \admin_system\src\components\svg\SvgIcon.vue
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -18,10 +18,10 @@ export default {
data() data()
{ {
return { return {
iconName: "", iconName: ""
}; };
}, },
props: ["icon",], props: ["icon"],
created() created()
{ {
console.log("svg"); console.log("svg");
@ -31,4 +31,6 @@ export default {
}; };
</script> </script>
<style scoped></style> <style scoped>
</style>

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

Before

Width:  |  Height:  |  Size: 928 B

After

Width:  |  Height:  |  Size: 928 B

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -2,14 +2,14 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-04 11:05:44 * @Date: 2023-01-04 11:05:44
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-06 09:26:48 * @LastEditTime: 2023-01-28 23:35:47
* @FilePath: /IT/src/layout/Index.vue * @FilePath: \admin_system\src\layout\Index.vue
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
--> -->
<template> <template>
<el-container id="layout-container" v-loading="ui.ageVisible" element-loading-text="载入应用数据…"> <el-container id="layout-container">
<el-header id="layout-header"> <el-header id="layout-header">
<LayoutHeader /> <LayoutHeader />
</el-header> </el-header>
@ -28,62 +28,28 @@
import LayoutAside from "./components/Aside.vue"; import LayoutAside from "./components/Aside.vue";
import LayoutHeader from "./components/Header.vue"; import LayoutHeader from "./components/Header.vue";
import LayoutMain from "./components/Main.vue"; import LayoutMain from "./components/Main.vue";
import { useStore } from "vuex";
import { onMounted, computed, reactive } from "vue";
// import { query_requirement_status } from "@/utils/api/requirement/requirement.js";
export default { export default {
name: "layoutPage", name: "layoutPage",
setup()
{
const store = useStore();
const ui = reactive(
{
pageVisible: true,
});
const asideWidth = computed(() =>
{
const collapse = store.state.app.asideBarCollapse;
return collapse === true ? "65px" : "180px";
});
onMounted(() =>
{
//
// query_requirement_status()
// .then((response) =>
// {
// // debugger;
// const data = response.data;
// console.log(data);
// })
// .catch((error) =>
// {
// // debugger;
// console.log(error);
// });
});
return {
ui,
asideWidth,
};
},
components: { components: {
LayoutAside, LayoutAside,
LayoutHeader, LayoutHeader,
LayoutMain, LayoutMain,
}, },
computed: {
asideWidth()
{
const collapse = this.$store.state.app.asideBarCollapse;
return collapse === true ? "65px" : "180px";
},
},
}; };
</script> </script>
<style scoped> <style scoped>
#layout-container { #layout-container {
height: 100vh; height: 100vh;
/* width: 100vw; */
max-height: 100vh; max-height: 100vh;
} }
@ -97,9 +63,10 @@ export default {
/* width: 175px; */ /* width: 175px; */
background-color: #2f4156; background-color: #2f4156;
overflow-x: hidden; overflow-x: hidden;
height: calc(100vh - 50px); /* height: calc(100vh - 50px);
max-height: calc(100vh - 50px); max-height: calc(100vh - 50px);
min-height: calc(100vh - 50px); min-height: calc(100vh - 50px); */
height: 100%;
} }
#layout-header { #layout-header {

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-04 11:30:33 * @Date: 2023-01-04 11:30:33
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-06 09:28:16 * @LastEditTime: 2023-01-28 16:01:49
* @FilePath: /IT/src/layout/components/Aside.vue * @FilePath: \admin_system\src\layout\components\Aside.vue
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. 223142 2f4156 * Copyright (c) ${2022} by Kane, All Rights Reserved. 223142 2f4156
@ -12,7 +12,7 @@
<el-scrollbar class="wrapper"> <el-scrollbar class="wrapper">
<el-menu id="side-bar" router :default-active="currentPath" background-color="#2f4156" text-color="#fff" <el-menu id="side-bar" router :default-active="currentPath" background-color="#2f4156" text-color="#fff"
active-text-color="#ffd04b" :collapse="asideCollapse"> active-text-color="#ffd04b" :collapse="asideCollapse">
<template v-for="route in routes" :key="route.path"> <template v-for="route in this.routers" :key="route.path">
<template v-if="!route.hidden"> <template v-if="!route.hidden">
<template v-if="hasOnlyChild(route.children)"> <template v-if="hasOnlyChild(route.children)">
<!-- 当只有一个子路由时直接渲染子路由 --> <!-- 当只有一个子路由时直接渲染子路由 -->
@ -46,20 +46,19 @@
</template> </template>
<script> <script>
import { computed } from "vue";
import { useStore } from "vuex";
import { useRouter, useRoute } from "vue-router"; import { useRouter, useRoute } from "vue-router";
export default { export default {
name: "LayoutAside", name: "LayoutAside",
setup() data()
{ {
const router = useRouter();// return {
const routes = router.getRoutes();// routers: null,
const store = useStore(); };
},
methods: {
// //
const hasOnlyChild = (children) => hasOnlyChild: function (children)
{ {
// //
if (!children) if (!children)
@ -79,31 +78,27 @@ export default {
} }
return false; return false;
}; },
// },
computed: {
// //
const currentPath = computed(() => currentPath()
{ {
let path = useRoute().path; let path = useRoute().path;
return path; return path;
});
//
const asideCollapse = computed(() =>
{
return store.state.app.ui.asideBarCollapse;
});
return {
router,
routes,
hasOnlyChild,
currentPath,
asideCollapse,
};
}, },
//
asideCollapse()
{
return this.$store.state.app.asideBarCollapse;
}
},
created()
{
this.routers = useRouter().options.routes;
}
}; };
</script> </script>
@ -125,22 +120,12 @@ export default {
user-select: none; user-select: none;
} }
.el-menu-item {
font-weight: normal;
}
.el-sub-menu {
font-weight: normal;
}
/* 顺序必须在上面两个之后*/
.is-active { .is-active {
background-color: #ffffff4f !important; background-color: #ffffff4f !important;
/* font-weight: 1000; */
/* font-size: 15px; */
color: #ffd04b;
} }
/* .is-opened { /* .is-opened {
border-left: 5px solid #1d74b2; border-left: 5px solid #1d74b2;
} */ } */
@ -161,6 +146,5 @@ export default {
.wrapper { .wrapper {
height: 100%; height: 100%;
/* min-height: 400px; */
} }
</style> </style>

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-04 11:39:04 * @Date: 2023-01-04 11:39:04
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-04 01:09:49 * @LastEditTime: 2023-01-19 14:53:38
* @FilePath: \IT工具综合平台\src\layout\components\Header.vue * @FilePath: \admin_system\src\layout\components\Header.vue
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -16,8 +16,13 @@
<div>3.6.7 x64 Build 202208301257</div> <div>3.6.7 x64 Build 202208301257</div>
</div> </div>
<div class="buttons_div"> <div class="buttons_div">
<User style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;" /> <User
<SwitchButton style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;" @click="logout" /> style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;"
/>
<SwitchButton
style="width: 25px; height; 25px; margin-right: 8px; cursor:pointer;"
@click="logout"
/>
</div> </div>
</div> </div>
</template> </template>
@ -28,26 +33,22 @@ import { Logout } from "../../utils/api/info/account";
export default { export default {
name: "AppBanner", name: "AppBanner",
data() data() {
{
return {}; return {};
}, },
// created() { // created() {
// console.log("banner"); // console.log("banner");
// }, // },
mounted() mounted() {
{
//console.log("banner"); //console.log("banner");
}, },
methods: { methods: {
logout() logout() {
{
this.$confirm("是否退出系统?", "请确认", { this.$confirm("是否退出系统?", "请确认", {
confirmButtonText: "是", confirmButtonText: "是",
cancelButtonText: "否", cancelButtonText: "否",
type: "warning", type: "warning",
}).then(() => }).then(() => {
{
Logout(); Logout();
}); });
}, },
@ -79,7 +80,7 @@ export default {
user-select: none; user-select: none;
} }
.app_banner>*+* { .app_banner > * + * {
margin-left: 10px; margin-left: 10px;
} }

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-04 11:40:03 * @Date: 2023-01-04 11:40:03
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-07 10:47:57 * @LastEditTime: 2023-01-26 12:34:20
* @FilePath: /IT/src/layout/components/Main.vue * @FilePath: \admin_system\src\layout\components\Main.vue
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -20,7 +20,7 @@
<script> <script>
export default { export default {
name: "LayoutMain", name: "LayoutMain"
}; };
</script> </script>
@ -31,6 +31,6 @@ export default {
} }
.view-wrapper { .view-wrapper {
padding: 10px; padding: 15px;
} }
</style> </style>

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-14 15:12:46 * @Date: 2022-12-14 15:12:46
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-17 13:11:43 * @LastEditTime: 2023-01-30 21:43:21
* @FilePath: /IT/src/main.js * @FilePath: \IT工具综合平台\src\main.js
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -25,13 +25,13 @@ import("element-plus/dist/index.css");
import ElementPlus from "element-plus"; import ElementPlus from "element-plus";
import * as ElementPlusIconsVue from "@element-plus/icons-vue"; import * as ElementPlusIconsVue from "@element-plus/icons-vue";
//import SvgIcon from "./components/svg/SvgIcon"; import SvgIcon from "./components/svg/SvgIcon";
const app = createApp(App); const app = createApp(App);
//app.component("SvgIcon", SvgIcon); app.component("SvgIcon", SvgIcon);
for (const [key, component,] of Object.entries(ElementPlusIconsVue)) for (const [key, component] of Object.entries(ElementPlusIconsVue))
{ {
app.component(key, component); app.component(key, component);
} }
@ -39,5 +39,5 @@ for (const [key, component,] of Object.entries(ElementPlusIconsVue))
app.use(ElementPlus); app.use(ElementPlus);
app.use(store); app.use(store);
app.use(router); app.use(router);
app.use(global); app.use( global );
app.mount('#app'); app.mount('#app');

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-14 15:12:46 * @Date: 2022-12-14 15:12:46
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-21 13:09:15 * @LastEditTime: 2023-01-30 22:43:16
* @FilePath: /IT/src/router/index.js * @FilePath: \IT工具综合平台\src\router\index.js
* @Description: 定义应用路由配置 * @Description: 定义应用路由配置
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -18,12 +18,6 @@ const routes = [
redirect: "Login", //默认路由指向登录页面 redirect: "Login", //默认路由指向登录页面
hidden: true, hidden: true,
}, },
{
path: "/error-page",
name: "ErrorPage",
hidden: true,
component: () => import("@/views/ErrorPage.vue"),
},
{ {
path: "/login", path: "/login",
name: "Login", name: "Login",
@ -35,7 +29,7 @@ const routes = [
name: "Home", name: "Home",
hidden: true, hidden: true,
meta: { meta: {
title: "控制台", title: "控制台"
}, },
component: () => import("../layout/Index.vue"), component: () => import("../layout/Index.vue"),
}, },
@ -91,52 +85,49 @@ const routes = [
}, },
], ],
}, },
{ {//信息管理
//信息查询 path: "/news",
path: "/query_info", name: "News",
name: "QueryInfo",
meta: { meta: {
title: "信息查询", title: "信息管理",
icon: "search",
},
component: () => import("@/layout/Index.vue"),
children: [
{
path: "/query_stuff",
name: "QueryStuff",
meta: {
title: "人员信息",
icon: "user",
},
component: () => import("@/views/info/StaffInfo.vue"),
},
],
},
{//权限管理
path: "/privilege",
name: "Privilege",
meta: {
title: "权限管理",
icon: "User",
},
children: [
{
path: "/user-manager",
name: "UserManager",
meta: {
title: "用户管理",
icon: "User",
},
component: () => import("../views/privilege/StaffInfo.vue"),
},
{
path: "/privilege-manager",
name: "PrivilegeManager",
meta: {
title: "权限管理",
icon: "edit", icon: "edit",
}, },
component: () => import("../views/privilege/PrivilegeManager.vue"), children: [
{
path: "/staffInfo",
name: "StaffInfo",
meta: {
title: "人员信息",
icon: "edit",
},
component: () => import("../views/info/StaffInfo.vue"),
},
{
path: "/editStuffInfo",
name: "EditStaffInfo",
hidden: true,
meta: {
title: "编辑人员信息",
},
component: () => import("../views/info/EditStaffInfo.vue"),
},
{
path: "/newsIndex",
name: "NewsIndex",
meta: {
title: "信息列表",
icon: "edit",
},
component: () => import("../views/news/News.vue"),
},
{
path: "/newsedit",
name: "NewsEdit",
meta: {
title: "信息编辑",
icon: "edit",
},
component: () => import("../views/news/NewsEdit.vue"),
}, },
], ],
component: () => import("../layout/Index.vue"), component: () => import("../layout/Index.vue"),
@ -146,7 +137,7 @@ const routes = [
name: "NetworkManager", name: "NetworkManager",
meta: { meta: {
title: "网络管理", title: "网络管理",
icon: "switch", icon: "User",
}, },
component: () => import("../layout/Index.vue"), component: () => import("../layout/Index.vue"),
children: [ children: [
@ -173,14 +164,14 @@ const routes = [
icon: "switch", icon: "switch",
}, },
component: () => import("../views/network/switch/SwitchManager.vue"), component: () => import("../views/network/switch/SwitchManager.vue"),
}, }
], ],
}, },
]; ];
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(), history: createWebHashHistory(),
routes, routes
}); });
//前置路由守卫 //前置路由守卫

View File

@ -2,21 +2,19 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-14 15:12:46 * @Date: 2022-12-14 15:12:46
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-04 15:59:09 * @LastEditTime: 2023-01-11 14:20:04
* @FilePath: /IT/src/store/index.js * @FilePath: \admin_system\src\store\index.js
* @Description: * @Description:
* *
* 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";
import requirement from "./modules/requirement";
const store = createStore({ const store = createStore({
modules: { modules: {
app, app,
requirement, }
},
}); });
export default store; export default store;

View File

@ -2,19 +2,16 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-01-07 22:25:43 * @Date: 2023-01-07 22:25:43
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-14 23:10:22 * @LastEditTime: 2023-01-11 09:44:46
* @FilePath: /IT/src/store/modules/app.js * @FilePath: \admin_system\src\store\modules\app.js
* @Description: vuex中存放全局数据的模块 * @Description: vuex中存放全局数据的模块
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
const state = { const state = {
count: 1001, count: 1001,
userInfo: null, //用户信息和token
ui:{ //ui相关的数据
asideBarCollapse: false, //侧边栏折叠标志位 asideBarCollapse: false, //侧边栏折叠标志位
userInfo: null, //用户信息和token
},
}; };
const getters = {}; const getters = {};
const mutations = { const mutations = {
@ -29,7 +26,7 @@ const mutations = {
SET_USERINFO(state, userInfo) SET_USERINFO(state, userInfo)
{ {
state.userInfo = userInfo; state.userInfo = userInfo;
}, }
}; };
const actions = {}; const actions = {};

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-22 17:16:53 * @Date: 2022-12-22 17:16:53
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-22 14:49:58 * @LastEditTime: 2022-12-22 20:48:03
* @FilePath: /IT/src/utils/api/common.js * @FilePath: \admin_system\src\utils\api\common.js
* @Description: 通用请求 * @Description: 通用请求
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -15,8 +15,6 @@ const URL_GET_VALIDATE_CODE = "";
/** /**
* 获取验证码 * 获取验证码
* @param {*} data 承载数据的对象
* @returns Promise对象
*/ */
export function GetValidate(data) export function GetValidate(data)
{ {

View File

@ -2,8 +2,8 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-23 11:10:23 * @Date: 2022-12-23 11:10:23
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-04 17:08:15 * @LastEditTime: 2022-12-23 11:11:58
* @FilePath: /IT/src/utils/api/config.js * @FilePath: \admin_system\src\utils\api\config.js
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
@ -11,5 +11,4 @@
export const API_URL = { export const API_URL = {
URL_LOGIN: process.env.VUE_APP_API_URL_LOGIN, URL_LOGIN: process.env.VUE_APP_API_URL_LOGIN,
URL_QUERY_REQUIREMENT_STATUS: process.env.VUE_APP_API_URL_REQUIREMENT_STATUS,
}; };

View File

@ -2,15 +2,16 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-22 09:10:20 * @Date: 2022-12-22 09:10:20
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-04 15:45:51 * @LastEditTime: 2023-01-25 00:29:54
* @FilePath: /IT/src/utils/api/info/account.js * @FilePath: \admin_system\src\utils\api\info\account.js
* @Description: 登录登出相关的API * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
import instance from "@/utils/api/request"; import instance from "@/utils/api/request";
import { API_URL } from "@/utils/api/config"; //所有API的地址 import { API_URL } from "@/utils/api/config"; //所有API的地址
import router from "../../../router/index"; import router from "../../../router/index";
import store from "../../../store/index";
/** /**
* 登录请求函数 * 登录请求函数
@ -19,6 +20,8 @@ import router from "../../../router/index";
*/ */
export function Login(userInfo) export function Login(userInfo)
{ {
//console.log("登录请求地址:", API_URL.URL_LOGIN);
//const url = "http://localhost:8080/admin-system/account/p13_account_check";
return instance.request( return instance.request(
{ {
method: "post", method: "post",
@ -33,6 +36,8 @@ export function Login(userInfo)
*/ */
export function Logout() export function Logout()
{ {
console.log(store);
window.localStorage.removeItem("token"); window.localStorage.removeItem("token");
window.localStorage.removeItem("user_info"); window.localStorage.removeItem("user_info");

View File

@ -2,24 +2,25 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-22 17:18:10 * @Date: 2022-12-22 17:18:10
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-06 09:19:32 * @LastEditTime: 2023-01-12 17:47:39
* @FilePath: /IT/src/utils/api/request.js * @FilePath: \admin_system\src\utils\api\request.js
* @Description: 配置axios拦截器 * @Description: 配置axios拦截器
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
*/ */
import axios from "axios"; import axios from "axios";
import store from "../../store/index"; import store from "../../store/index";
import router from "@/router";
import { ElMessageBox } from "element-plus"; import { ElMessageBox } from "element-plus";
import router from "@/router";
const service = axios.create( const service = axios.create(
{ {
baseURL: "", baseURL: "",
timeout: 10000, //十秒超时 timeout: 5000,
} }
); );
/** /**
* 加上请求拦截器 * 加上请求拦截器
*/ */
@ -30,7 +31,7 @@ service.interceptors.request.use(
if (store.state.app.userInfo) if (store.state.app.userInfo)
{ {
//如果userInfo存在则加上用户名和token //如果userInfo存在则加上用户名和token
const username = store.state.app.userInfo.staff_info.p13uid; const username = store.state.app.userInfo.user_info.p13uid;
const token = store.state.app.userInfo.token; const token = store.state.app.userInfo.token;
config.headers["token"] = token; config.headers["token"] = token;
@ -47,7 +48,6 @@ service.interceptors.request.use(
}, },
function (error) function (error)
{ {
console.log("请求拦截器失败!");
return Promise.reject(error); return Promise.reject(error);
} }
); );
@ -72,7 +72,7 @@ service.interceptors.response.use(
confirmButtonText: "是", confirmButtonText: "是",
cancelButtonText: "否", cancelButtonText: "否",
type: "warning", type: "warning",
} },
).then(() => ).then(() =>
{ {
router.replace("/login"); router.replace("/login");

View File

@ -3,18 +3,18 @@
* @Author: Kane * @Author: Kane
* @Date: 2022-12-14 15:23:54 * @Date: 2022-12-14 15:23:54
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-02-07 10:46:48 * @LastEditTime: 2023-01-28 21:35:47
* @FilePath: /IT/src/views/account/Login.vue * @FilePath: \admin_system\src\views\account\Login.vue
* @Description: * @Description:
* *
* Copyright (c) ${2022} by Kane, All Rights Reserved. * Copyright (c) ${2022} by Kane, All Rights Reserved.
--> -->
<template> <template>
<div id="login"> <div id="login">
<div class="form-wrapper"> <div class="form-warp">
<ul class="menu-tab"> <ul class="menu-tab">
<li :class="{ 'current': ui.current_menu === item.type }" @click="onToggleMenu(item.type)" <li :class="{ 'current': current_menu === item.type }" @click="onToggleMenu(item.type)" v-for="item in tab_menu"
v-for="item in tab_menu" :key="item.type">{{ item.label }} :key="item.type">{{ item.label }}
</li> </li>
</ul> </ul>
<!-- <el-form ref="form" :model="form"> --> <!-- <el-form ref="form" :model="form"> -->
@ -27,7 +27,7 @@
<label class="form-label">密码</label> <label class="form-label">密码</label>
<el-input type="password" v-model.lazy.trim="loginForm.password"></el-input> <el-input type="password" v-model.lazy.trim="loginForm.password"></el-input>
</el-form-item> </el-form-item>
<el-form-item v-show="ui.current_menu === tab_menu[1].type"> <el-form-item v-show="current_menu === tab_menu[1].type">
<label class="form-label">确认密码</label> <label class="form-label">确认密码</label>
<el-input type="password" disabled v-model.lazy.trim="loginForm.confirm_password"></el-input> <el-input type="password" disabled v-model.lazy.trim="loginForm.confirm_password"></el-input>
</el-form-item> </el-form-item>
@ -43,9 +43,9 @@
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" class="el-button-block" @click="login" :disabled="ui.submit_btn_disable" <el-button type="primary" class="el-button-block" @click="login" :disabled="submit_btn_disable"
:loading="ui.submit_btn_loading"> :loading="submit_btn_loading">
{{ ui.current_menu === "login" ? "登录" : "注册" }} {{ current_menu === "login" ? "登录" : "注册" }}
</el-button> </el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -54,79 +54,51 @@
</template> </template>
<script> <script>
import { reactive, onBeforeMount, onMounted } from "vue";
import { useStore } from "vuex";
import { useRouter } from "vue-router";
import { Login } from "@/utils/api/info/account"; import { Login } from "@/utils/api/info/account";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import router from "../../router/index";
//import router from "../../router/index";
export default { export default {
name: "loginPage", name: "loginPage",
setup() data()
{ {
const store = useStore(); return {
const router = useRouter(); loginForm: {
const loginForm = reactive({
username: "", username: "",
password: "", password: "",
confirm_password: "", confirm_password: "",
validateCode: "", validateCode: "",
}); },
tab_menu: [
const tab_menu = reactive( { type: "login", label: "登录" },
[ { type: "regiester", label: "注册" },
{ type: "login", label: "登录", }, ],
{ type: "regiester", label: "注册", },
]);
const ui = reactive(
{
current_menu: "", current_menu: "",
staffInfo: null, staffInfo: null,
submit_btn_disable: false, submit_btn_disable: false,
submit_btn_loading: false, submit_btn_loading: false,
});
const onToggleMenu = (type) =>
{
ui.current_menu = type;
console.log(process.env.VUE_APP_API_URL_LOGIN);
}; };
},
const getValidateCode = () => methods: {
onToggleMenu(type)
{
this.current_menu = type;
console.log(process.env.VUE_APP_API_URL_LOGIN);
},
getValidateCode()
{ {
ElMessage({ ElMessage({
message: "测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字", message: "测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字测试文字",
center: true, center: true,
type: "error", type: "error",
}); });
}; },
//tokenvuexlocalStorage
const saveUserInfo = (userInfo) =>
{
console.log("保存用户信息");
console.log("保存用户信息", store);
//vuex
store.commit("app/SET_USERINFO", userInfo);
//localStorage
const token = userInfo.token;
const userInfoJson = JSON.stringify(userInfo);
window.localStorage.setItem("token", token);
window.localStorage.setItem("user_info", userInfoJson);
};
/** /**
* 登录 * 登录
*/ */
const login = () => login()
{ {
if (loginForm.username.length === 0 || loginForm.password === 0) if (this.loginForm.username.length === 0 || this.loginForm.password === 0)
{ {
ElMessage({ ElMessage({
message: "请填写您的P13账号和密码", message: "请填写您的P13账号和密码",
@ -136,12 +108,12 @@ export default {
return; return;
} }
ui.submit_btn_disable = true; this.submit_btn_disable = true;
ui.submit_btn_loading = true; this.submit_btn_loading = true;
const userInfo = { const userInfo = {
p13account: loginForm.username, p13account: this.loginForm.username,
password: loginForm.password, password: this.loginForm.password,
}; };
Login(userInfo) Login(userInfo)
@ -161,10 +133,10 @@ export default {
center: true, center: true,
}); });
ui.staffInfo = data.staffInfo; this.staffInfo = data.staffInfo;
//token //token
saveUserInfo(data); this.saveUserInfo(data);
// //
router.push("/Desktop"); router.push("/Desktop");
@ -178,8 +150,8 @@ export default {
center: true, center: true,
}); });
ui.submit_btn_disable = false; this.submit_btn_disable = false;
ui.submit_btn_loading = false; this.submit_btn_loading = false;
} }
}) })
.catch((error) => .catch((error) =>
@ -193,34 +165,32 @@ export default {
center: true, center: true,
}); });
ui.submit_btn_disable = false; this.submit_btn_disable = false;
ui.submit_btn_loading = false; this.submit_btn_loading = false;
}); });
}; },
saveUserInfo(userInfo) //tokenvuexlocalStorage
{
//vuex
this.$store.commit("app/SET_USERINFO", userInfo);
onBeforeMount(() => //localStorage
const token = userInfo.token;
const userInfoJson = JSON.stringify(userInfo);
window.localStorage.setItem("token", token);
window.localStorage.setItem("user_info", userInfoJson);
}
},
created()
{ {
// //
ui.current_menu = tab_menu[0].type; this.current_menu = this.tab_menu[0].type;
}); },
mounted()
onMounted(() =>
{ {
// //
store.state.app.userInfo = null; this.$store.state.app.userInfo = null;
});
return {
//
ui,
loginForm,
tab_menu,
//
onToggleMenu,
saveUserInfo,
login,
getValidateCode,
};
}, },
}; };
</script> </script>
@ -230,14 +200,13 @@ export default {
height: 100vh; height: 100vh;
background-color: #344a5f; background-color: #344a5f;
padding-top: 50px; padding-top: 50px;
background-image: url("@/assets/img/cropped-1600-900-36302.jpg");
} }
.form-wrapper { .form-warp {
width: 320px; width: 320px;
padding: 30px; padding: 30px;
margin: auto; margin: auto;
background-color: #ffffffaf; background-color: #ffffff10;
border-radius: 5px; border-radius: 5px;
} }
@ -268,7 +237,7 @@ export default {
display: inline-block; display: inline-block;
padding: 10px 24px; padding: 10px 24px;
margin: 0 10px; margin: 0 10px;
color: #344a5fef; color: #fff;
font-size: 14px; font-size: 14px;
border-radius: 5px; border-radius: 5px;
cursor: pointer; cursor: pointer;
@ -280,15 +249,10 @@ export default {
.form-label { .form-label {
display: block; display: block;
/* color: #fff; */ color: #fff;
color: #344a5fef;
font-size: 14px; font-size: 14px;
} }
.el-input {
color: #344a5fef;
}
.el-button-block { .el-button-block {
width: 100%; width: 100%;
} }

Some files were not shown because too many files have changed in this diff Show More