|
@@ -70,12 +70,12 @@ const postFile = (url: string, data: Record<string, any>) => {
|
|
);
|
|
);
|
|
};
|
|
};
|
|
|
|
|
|
-let isLoging = false
|
|
|
|
|
|
+let isLoging = false;
|
|
const login = (isBack = true) => {
|
|
const login = (isBack = true) => {
|
|
if (isLoging) {
|
|
if (isLoging) {
|
|
- throw '登录中'
|
|
|
|
|
|
+ throw "登录中";
|
|
}
|
|
}
|
|
- isLoging = true
|
|
|
|
|
|
+ isLoging = true;
|
|
if (import.meta.env.DEV && params.value.caseId) {
|
|
if (import.meta.env.DEV && params.value.caseId) {
|
|
post("/service/manage/login", {
|
|
post("/service/manage/login", {
|
|
password: "JwiuK95dExMjM0NTY=7nHGf5ySQWSuC4G1An",
|
|
password: "JwiuK95dExMjM0NTY=7nHGf5ySQWSuC4G1An",
|
|
@@ -83,10 +83,10 @@ const login = (isBack = true) => {
|
|
userName: "super-admin",
|
|
userName: "super-admin",
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
params.value.token = res.token;
|
|
params.value.token = res.token;
|
|
- console.error(res.token)
|
|
|
|
|
|
+ console.error(res.token);
|
|
// console.log(res.token, {...params.value})
|
|
// console.log(res.token, {...params.value})
|
|
- setTimeout(() => location.reload(), 1000)
|
|
|
|
- isLoging = false
|
|
|
|
|
|
+ setTimeout(() => location.reload(), 1000);
|
|
|
|
+ isLoging = false;
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -113,8 +113,8 @@ const login = (isBack = true) => {
|
|
delete query["redirect"];
|
|
delete query["redirect"];
|
|
link = urlUpdateQuery(url.toString(), query, true);
|
|
link = urlUpdateQuery(url.toString(), query, true);
|
|
}
|
|
}
|
|
- // location.replace(link);
|
|
|
|
- isLoging = false
|
|
|
|
|
|
+ location.replace(link);
|
|
|
|
+ isLoging = false;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -177,7 +177,7 @@ const saveOverviewData = genLoading(
|
|
store: StoreData;
|
|
store: StoreData;
|
|
viewport: number[] | null;
|
|
viewport: number[] | null;
|
|
caseTabulation: {
|
|
caseTabulation: {
|
|
- id: string,
|
|
|
|
|
|
+ id: string;
|
|
store: StoreData;
|
|
store: StoreData;
|
|
viewport: number[] | null;
|
|
viewport: number[] | null;
|
|
isAutoGen: boolean;
|
|
isAutoGen: boolean;
|
|
@@ -201,7 +201,7 @@ const saveOverviewData = genLoading(
|
|
isAutoGen: Number(data.caseTabulation.isAutoGen),
|
|
isAutoGen: Number(data.caseTabulation.isAutoGen),
|
|
paperKey: data.caseTabulation.paperKey,
|
|
paperKey: data.caseTabulation.paperKey,
|
|
overviewId: data.caseTabulation.overviewId,
|
|
overviewId: data.caseTabulation.overviewId,
|
|
- }
|
|
|
|
|
|
+ },
|
|
});
|
|
});
|
|
return item.id;
|
|
return item.id;
|
|
}
|
|
}
|
|
@@ -243,12 +243,14 @@ const getTabulationData = genLoading(async (id: string) => {
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
|
|
-if (!params.value.caseId || !token) {
|
|
|
|
- ElMessage.error("当前项目号不存在!");
|
|
|
|
- window.platform.login(!!params.value.caseId);
|
|
|
|
-} else {
|
|
|
|
- setTimeout(() => getSceneList(""), 500);
|
|
|
|
-}
|
|
|
|
|
|
+setTimeout(() => {
|
|
|
|
+ if (!params.value.caseId || !token) {
|
|
|
|
+ ElMessage.error("当前项目号不存在!");
|
|
|
|
+ window.platform.login(!!params.value.caseId);
|
|
|
|
+ } else {
|
|
|
|
+ getSceneList("");
|
|
|
|
+ }
|
|
|
|
+}, 500);
|
|
|
|
|
|
const saveTabulationData = genLoading(
|
|
const saveTabulationData = genLoading(
|
|
async (
|
|
async (
|
|
@@ -290,27 +292,27 @@ const uploadResourse = genLoading(async (file: File) => {
|
|
});
|
|
});
|
|
|
|
|
|
const getTableTemp = () => {
|
|
const getTableTemp = () => {
|
|
- let table: Record<string, string>
|
|
|
|
- let title: string = params.value.title
|
|
|
|
|
|
+ let table: Record<string, string>;
|
|
|
|
+ let title: string = params.value.title;
|
|
if (params.value.table) {
|
|
if (params.value.table) {
|
|
try {
|
|
try {
|
|
- table = JSON.parse(params.value.table)
|
|
|
|
|
|
+ table = JSON.parse(params.value.table);
|
|
} catch (e) {
|
|
} catch (e) {
|
|
- console.log('tableTemp模板解析失败')
|
|
|
|
|
|
+ console.log("tableTemp模板解析失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!table!) {
|
|
if (!table!) {
|
|
table = {
|
|
table = {
|
|
- 案发时间: '',
|
|
|
|
- 案发地点: '',
|
|
|
|
- 绘图单位: '',
|
|
|
|
- 绘图人: '',
|
|
|
|
- 绘图时间: '',
|
|
|
|
- }
|
|
|
|
- title = '默认标题'
|
|
|
|
|
|
+ 案发时间: "",
|
|
|
|
+ 案发地点: "",
|
|
|
|
+ 绘图单位: "",
|
|
|
|
+ 绘图人: "",
|
|
|
|
+ 绘图时间: "",
|
|
|
|
+ };
|
|
|
|
+ title = "默认标题";
|
|
}
|
|
}
|
|
- return { table, title }
|
|
|
|
-}
|
|
|
|
|
|
+ return { table, title };
|
|
|
|
+};
|
|
|
|
|
|
window.platform = {
|
|
window.platform = {
|
|
login,
|
|
login,
|
|
@@ -323,7 +325,7 @@ window.platform = {
|
|
saveTabulationData,
|
|
saveTabulationData,
|
|
uploadResourse,
|
|
uploadResourse,
|
|
getTabulationId,
|
|
getTabulationId,
|
|
- getTableTemp
|
|
|
|
|
|
+ getTableTemp,
|
|
};
|
|
};
|
|
|
|
|
|
/* @vite-ignore */
|
|
/* @vite-ignore */
|