fix: 代码清理
This commit is contained in:
parent
845f4186db
commit
26f546397a
74
public/jquery-1.12.4.min.js
vendored
74
public/jquery-1.12.4.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,2 +0,0 @@
|
||||
// * 后端微服务端口名
|
||||
// export const BASEURL = import.meta.env.VITE_API_URL;
|
||||
@ -1,64 +0,0 @@
|
||||
// ? 暂时没使用取消请求,目前全局 loading 已经能控制重复请求了
|
||||
import axios, { AxiosRequestConfig, Canceler } from "axios";
|
||||
import { isFunction } from "@/utils/is/index";
|
||||
import qs from "qs";
|
||||
|
||||
// * 声明一个 Map 用于存储每个请求的标识 和 取消函数
|
||||
let pendingMap = new Map<string, Canceler>();
|
||||
|
||||
// * 序列化参数
|
||||
export const getPendingUrl = (config: AxiosRequestConfig) =>
|
||||
[config.method, config.url, qs.stringify(config.data), qs.stringify(config.params)].join("&");
|
||||
|
||||
export class AxiosCanceler {
|
||||
/**
|
||||
* @description: 添加请求
|
||||
* @param {Object} config
|
||||
* @return void
|
||||
*/
|
||||
addPending(config: AxiosRequestConfig) {
|
||||
// * 在请求开始前,对之前的请求做检查取消操作
|
||||
this.removePending(config);
|
||||
const url = getPendingUrl(config);
|
||||
config.cancelToken =
|
||||
config.cancelToken ||
|
||||
new axios.CancelToken(cancel => {
|
||||
if (!pendingMap.has(url)) {
|
||||
// 如果 pending 中不存在当前请求,则添加进去
|
||||
pendingMap.set(url, cancel);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 移除请求
|
||||
* @param {Object} config
|
||||
*/
|
||||
removePending(config: AxiosRequestConfig) {
|
||||
const url = getPendingUrl(config);
|
||||
|
||||
if (pendingMap.has(url)) {
|
||||
// 如果在 pending 中存在当前请求标识,需要取消当前请求,并且移除
|
||||
const cancel = pendingMap.get(url);
|
||||
cancel && cancel();
|
||||
pendingMap.delete(url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 清空所有pending
|
||||
*/
|
||||
removeAllPending() {
|
||||
pendingMap.forEach(cancel => {
|
||||
cancel && isFunction(cancel) && cancel();
|
||||
});
|
||||
pendingMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 重置
|
||||
*/
|
||||
reset(): void {
|
||||
pendingMap = new Map<string, Canceler>();
|
||||
}
|
||||
}
|
||||
@ -1,43 +0,0 @@
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
/**
|
||||
* @description: 校验网络请求状态码
|
||||
* @param {Number} status
|
||||
* @return void
|
||||
*/
|
||||
export const checkStatus = (status: number): void => {
|
||||
switch (status) {
|
||||
case 400:
|
||||
ElMessage.error("请求失败!请您稍后重试");
|
||||
break;
|
||||
case 401:
|
||||
ElMessage.error("登录失效!请您重新登录");
|
||||
break;
|
||||
case 403:
|
||||
ElMessage.error("当前账号无权限访问!");
|
||||
break;
|
||||
case 404:
|
||||
ElMessage.error("你所访问的资源不存在!");
|
||||
break;
|
||||
case 405:
|
||||
ElMessage.error("请求方式错误!请您稍后重试");
|
||||
break;
|
||||
case 408:
|
||||
ElMessage.error("请求超时!请您稍后重试");
|
||||
break;
|
||||
case 500:
|
||||
ElMessage.error("服务异常!");
|
||||
break;
|
||||
case 502:
|
||||
ElMessage.error("网关错误!");
|
||||
break;
|
||||
case 503:
|
||||
ElMessage.error("服务不可用!");
|
||||
break;
|
||||
case 504:
|
||||
ElMessage.error("网关超时!");
|
||||
break;
|
||||
default:
|
||||
ElMessage.error("请求失败!");
|
||||
}
|
||||
};
|
||||
0
src/api/types/company/User.d.ts
vendored
0
src/api/types/company/User.d.ts
vendored
127
src/api/types/government/AIwaring.d.ts
vendored
127
src/api/types/government/AIwaring.d.ts
vendored
@ -1,127 +0,0 @@
|
||||
/**
|
||||
* @description 地图
|
||||
*/
|
||||
|
||||
export declare interface ReqAiMonitorDev {
|
||||
aiMonitorId?: number;
|
||||
code?: string;
|
||||
createTime?: string;
|
||||
engineeringName?: string;
|
||||
engineeringSn?: string;
|
||||
hardwareId?: string;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
name?: string;
|
||||
priority?: string;
|
||||
projectName?: string;
|
||||
projectSn?: string;
|
||||
state?: number;
|
||||
id?: string;
|
||||
}
|
||||
|
||||
export declare interface ResAiMonitorDev {
|
||||
aiMonitorId?: number;
|
||||
code?: string;
|
||||
createTime?: string;
|
||||
engineeringName?: string;
|
||||
engineeringSn?: string;
|
||||
hardwareId?: string;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
name?: string;
|
||||
priority?: string;
|
||||
projectName?: string;
|
||||
projectSn?: string;
|
||||
state?: number;
|
||||
environmentAlarmList: never[];
|
||||
}
|
||||
|
||||
// ai接入情况的新增
|
||||
export declare interface ReqAiadd {
|
||||
alarmId?: number;
|
||||
createBy?: string;
|
||||
createTime?: string;
|
||||
deviceCode?: string;
|
||||
deviceName?: string;
|
||||
hardwareId?: string;
|
||||
projectSn?: number;
|
||||
solveBy?: string;
|
||||
solveImage?: string;
|
||||
solveTime?: string;
|
||||
state?: number;
|
||||
type?: number;
|
||||
typeName?: string;
|
||||
}
|
||||
export declare interface ResAiadd {
|
||||
alarmId?: number;
|
||||
createBy?: string;
|
||||
createTime?: string;
|
||||
deviceCode?: string;
|
||||
deviceName?: string;
|
||||
hardwareId?: string;
|
||||
id?: number;
|
||||
projectSn?: number;
|
||||
solveBy?: string;
|
||||
solveImage?: string;
|
||||
solveTime?: string;
|
||||
state?: number;
|
||||
type?: number;
|
||||
typeName?: string;
|
||||
projectId?: string;
|
||||
}
|
||||
|
||||
export declare interface ReqAiParams {
|
||||
pageNo: number;
|
||||
pageSize: number;
|
||||
total?: number;
|
||||
}
|
||||
|
||||
export declare type ProjectParams = Params & { projectName?: string };
|
||||
|
||||
export declare type EngineerParams = Params & { engineeringName?: string };
|
||||
|
||||
export declare interface ResAiPage {
|
||||
deviceNum: /* 工程设备数量 */ number;
|
||||
latitude: /* 纬度 */ string;
|
||||
longitude: /* 经度 */ sting;
|
||||
questionNum: /* 今日待整改问题 */ number;
|
||||
solveQuestionNum: /* 已整改问题 */ nmber;
|
||||
state: /* 工程状态(1:未开工;2:在建) */ 1 | 2;
|
||||
todayAlarm: /* 今日报警数 */ number;
|
||||
}
|
||||
|
||||
export declare interface ResAiEngineerPage extends ResAiPage {
|
||||
address: /* 详细地址 */ string;
|
||||
city: /* 市 */ string;
|
||||
district: /* 区 */ string;
|
||||
engineeringName: /* 工程名称 */ string;
|
||||
engineeringSn: /* 工程sn */ string;
|
||||
province: /* 省 */ string;
|
||||
projectAddress: /* 详细地址 */ string;
|
||||
aiAlarmStat: object; //项目详细数据
|
||||
environAlarmFlag: boolean;
|
||||
showIconing: boolean; //控制地图图标动起来
|
||||
}
|
||||
|
||||
export declare interface ResAiProjectPage extends ResAiPage {
|
||||
projectAddress: /* 详细地址 */ string;
|
||||
projectName: /* 工程名称 */ string;
|
||||
projectSn: /* 项目sn */ string;
|
||||
engineeringSn: string; //工程
|
||||
aiAlarmStat: object; //工程详细数据
|
||||
showIconing: boolean; //控制地图图标动起来
|
||||
environAlarmFlag: boolean;
|
||||
}
|
||||
|
||||
export declare interface ResPage {
|
||||
current: number;
|
||||
hitCount: boolean;
|
||||
pages: number;
|
||||
searchCount: boolean;
|
||||
size: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export declare type ResProjectPage = ResPage & { records: ResAiProjectPage[] };
|
||||
|
||||
export declare type ResEngineerPage = ResPage & { records: ResAiEngineerPage[] };
|
||||
3
src/api/types/index.d.ts
vendored
3
src/api/types/index.d.ts
vendored
@ -1,8 +1,5 @@
|
||||
import { Result } from "./common";
|
||||
|
||||
export * from "./company/User";
|
||||
export * from "./jxj/User";
|
||||
export * from "./project/Report";
|
||||
|
||||
/**
|
||||
* @description 系统字典查询
|
||||
|
||||
176
src/api/types/project/Report.d.ts
vendored
176
src/api/types/project/Report.d.ts
vendored
@ -1,176 +0,0 @@
|
||||
/**
|
||||
* @description 文件类型
|
||||
*/
|
||||
export declare interface AnnexFile {
|
||||
/** 上传时间 */
|
||||
createTime?: string;
|
||||
/** 文件扩展名 */
|
||||
extendName?: string;
|
||||
/** 文件 id */
|
||||
fileId?: number;
|
||||
/** 文件名称 */
|
||||
fileName?: string;
|
||||
/** 文件大小 */
|
||||
fileSize?: string;
|
||||
/** 文件类型 */
|
||||
fileType?: 1 | 2 | 3;
|
||||
/** 文件 url */
|
||||
fileUrl?: string;
|
||||
/** 自定义标识 */
|
||||
label?: string | number;
|
||||
/** 关联 id */
|
||||
relevanceId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 项目主体责任人
|
||||
*/
|
||||
export declare interface EngineeringMainPerson {
|
||||
/** 工程责任主体id */
|
||||
engineeringMainId?: number;
|
||||
/** id(主键ID) */
|
||||
id?: number;
|
||||
/** 身份证号 */
|
||||
idCard?: string;
|
||||
/** 职务(字典信息) */
|
||||
jobId?: string;
|
||||
/** 姓名 */
|
||||
name?: string;
|
||||
/** 联系电话 */
|
||||
phone?: string;
|
||||
/** 岗位 */
|
||||
station?: string;
|
||||
/** 岗位证号 */
|
||||
stationCode?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 工程主体
|
||||
*/
|
||||
export declare interface EngineeringMain {
|
||||
/** 项目主体责任人列表 */
|
||||
engineeringMainPersonList?: Array<EngineeringMainPerson>;
|
||||
/** 工程sn */
|
||||
engineeringSn?: string;
|
||||
/** 企业名称 */
|
||||
enterpriseName?: string;
|
||||
/** 企业sn */
|
||||
enterpriseSn?: string;
|
||||
/** 工程主体ID(主键ID) */
|
||||
id?: number;
|
||||
/** 类型(1: 建设; 2: 监理; 3: 施工; 4: 勘察; 5: 设计;) */
|
||||
type?: 1 | 2 | 3 | 4 | 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 单体工程
|
||||
*/
|
||||
export declare interface EngineeringSingle {
|
||||
/** 工程面积 */
|
||||
area?: string;
|
||||
/** 工程sn */
|
||||
engineeringSn?: string;
|
||||
/** 地面层数 */
|
||||
floorNum?: string;
|
||||
/** 单体工程名称 */
|
||||
name?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 结构形式 */
|
||||
shape?: number;
|
||||
/** 单体工程ID(主键ID) */
|
||||
singleId?: number;
|
||||
/** 地下层数 */
|
||||
underNum?: string;
|
||||
floorNum?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 项目报监添加接口
|
||||
*/
|
||||
export declare interface ReqAddReport {
|
||||
/** 建设地址 */
|
||||
address?: string;
|
||||
/** 工程附件 */
|
||||
annexFiles?: Array<AnnexFile>;
|
||||
/** 市 */
|
||||
city?: string;
|
||||
/** 项目报监时间 */
|
||||
createTime?: string;
|
||||
/** 区 */
|
||||
district?: string;
|
||||
/** 合同竣工日期 */
|
||||
endTime?: string;
|
||||
/** 工程总面积(㎡) */
|
||||
engineeringArea?: string;
|
||||
/** 工程编码 */
|
||||
engineeringCode?: string;
|
||||
/** 工程造价(万元) */
|
||||
engineeringCost?: string;
|
||||
/** 工程总长度(m) */
|
||||
engineeringLength?: string;
|
||||
/** 工程主体 */
|
||||
engineeringMains?: Array<EngineeringMain>;
|
||||
/** 工程名称 */
|
||||
engineeringName?: string;
|
||||
/** 单体工程 */
|
||||
engineeringSingleList?: Array<EngineeringSingle>;
|
||||
/** 单体工程 */
|
||||
engineeringSingles?: Array<EngineeringSingle>;
|
||||
/** 工程sn */
|
||||
engineeringSn?: string;
|
||||
/** 工程类别(1: 房屋建筑; 2: 市政公用工程; 3: 轨道交通工程; 4: 公共建设项目; 5: 其他) */
|
||||
engineeringType?: 1 | 2 | 3 | 4 | 5;
|
||||
/** 工程类别名称 */
|
||||
engineeringTypeName?: string;
|
||||
/** 工程用途(字典数据) */
|
||||
engineeringUse?: number;
|
||||
/** 工程审核状态(1: 待审批; 2: 审批驳回; 3: 审批通过;) */
|
||||
examineState?: 1 | 2 | 3;
|
||||
/** 工程ID(主键ID) */
|
||||
id?: number;
|
||||
/** 是否重点工程(0: 不是;1: 是;) */
|
||||
isImportant?: 0 | 1;
|
||||
/** 纬度 */
|
||||
latitude?: string;
|
||||
/** 施工许可发放时间 */
|
||||
licenseCreateTime?: string;
|
||||
/** 施工许可证号 */
|
||||
licenseKey?: string;
|
||||
/** 经度 */
|
||||
longitude?: string;
|
||||
/** 项目名称 */
|
||||
projectName?: string;
|
||||
/** 项目sn */
|
||||
projectSn?: string;
|
||||
/** 省 */
|
||||
province?: string;
|
||||
/** 质量监督站 */
|
||||
qualitySupervision?: string;
|
||||
/** 质量监督员 */
|
||||
qualitySupervisionPerson?: string;
|
||||
/** 质量监督编码 */
|
||||
qualitySupervisionCode?: string;
|
||||
/** 质量监督工程进度 */
|
||||
qualitySupervisionPlan?: string;
|
||||
/** 质量监督工程状态 */
|
||||
qualitySupervisionState?: string;
|
||||
/** 驳回原因 */
|
||||
rejectReason?: string;
|
||||
/** 安全监督站 */
|
||||
safetySupervision?: string;
|
||||
/** 安全监督员 */
|
||||
safetySupervisionPerson?: string;
|
||||
/** 安全监督编号 */
|
||||
safetySupervisionCode?: string;
|
||||
/** 安全监督工程进度 */
|
||||
safetySupervisionPlan?: string;
|
||||
/** 安全监督工程状态 */
|
||||
safetySupervisionState?: string;
|
||||
/** 合同开工日期 */
|
||||
startTime?: string;
|
||||
/** 工程状态(1: 未开工; 2: 在建; 3: 在建.普通停工; 4: 在建.处罚停工; 5: 在建.完工; 6: 待竣工; 7: 竣工; 8: 其他) */
|
||||
state?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
||||
/** 工程状态名称 */
|
||||
stateName?: string;
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
export const datas = [
|
||||
{
|
||||
id: 0,
|
||||
title: "企业基本信息"
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: "选择企业主体"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "注册申请成功"
|
||||
}
|
||||
];
|
||||
@ -1,14 +0,0 @@
|
||||
export const datas = [
|
||||
{
|
||||
id: 0,
|
||||
title: "企业基本信息"
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: "选择企业主体"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "注册申请成功"
|
||||
}
|
||||
];
|
||||
@ -1,14 +0,0 @@
|
||||
export const Reports = [
|
||||
{
|
||||
id: 0,
|
||||
title: "工程概况"
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: "责任主体"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "附件信息"
|
||||
}
|
||||
];
|
||||
@ -52,8 +52,10 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由并放行到登陆页
|
||||
if (to.path === LOGIN_URL) {
|
||||
if (globalStore.token) return next(from.fullPath);
|
||||
// if (globalStore.token) return next(from.fullPath);
|
||||
resetRouter();
|
||||
globalStore.resetStore();
|
||||
globalStore.$reset();
|
||||
return next();
|
||||
}
|
||||
|
||||
|
||||
@ -278,7 +278,6 @@ import * as mars3d from "mars3d";
|
||||
import ConfigJson from "@/views/goverment/largeScreen/config.json";
|
||||
import layoutFrontTop from "@/components/layoutFrontTop/index.vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { datas } from "@/enums/company/SetpsEnum";
|
||||
import { initVue3Popup } from "@/utils/file-util";
|
||||
import QueryPopup from "./components/query-popup.vue";
|
||||
import MapMeasurement from "./components/mapMeasurement.vue";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user