|
@@ -105,7 +105,7 @@
|
|
<div class="card-image-container">
|
|
<div class="card-image-container">
|
|
<el-image
|
|
<el-image
|
|
ref="imageRef"
|
|
ref="imageRef"
|
|
- :src="file.type === 'old' ? file.filesUrl : file.listCover"
|
|
|
|
|
|
+ :src="file.filesUrl"
|
|
:preview-teleported="true"
|
|
:preview-teleported="true"
|
|
class="card-image"
|
|
class="card-image"
|
|
>
|
|
>
|
|
@@ -168,15 +168,14 @@
|
|
<!-- 卡片底部:文件名 -->
|
|
<!-- 卡片底部:文件名 -->
|
|
<div class="card-footer">
|
|
<div class="card-footer">
|
|
<div class="file-title">
|
|
<div class="file-title">
|
|
- <span v-if="!inputCaseTitles.includes(file)" :title="file.type === 'old' ? file.filesTitle : file.title" class="title-text">
|
|
|
|
- {{ file.type === 'old' ? file.filesTitle : file.title }}
|
|
|
|
|
|
+ <span v-if="!inputCaseTitles.includes(file)" :title="file.filesTitle" class="title-text">
|
|
|
|
+ {{ file.filesTitle }}
|
|
<el-icon class="edit-title" @click="inputCaseTitles.push(file)">
|
|
<el-icon class="edit-title" @click="inputCaseTitles.push(file)">
|
|
<EditPen />
|
|
<EditPen />
|
|
</el-icon>
|
|
</el-icon>
|
|
</span>
|
|
</span>
|
|
<template v-else>
|
|
<template v-else>
|
|
<ElInput
|
|
<ElInput
|
|
- v-if="file.type === 'old'"
|
|
|
|
v-model="file.filesTitle"
|
|
v-model="file.filesTitle"
|
|
placeholder="请输入文件名"
|
|
placeholder="请输入文件名"
|
|
focus
|
|
focus
|
|
@@ -190,21 +189,6 @@
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
</ElInput>
|
|
</ElInput>
|
|
- <ElInput
|
|
|
|
- v-else
|
|
|
|
- v-model="file.title"
|
|
|
|
- placeholder="请输入文件名"
|
|
|
|
- focus
|
|
|
|
- :maxlength="50"
|
|
|
|
- size="default"
|
|
|
|
- class="edit-input"
|
|
|
|
- >
|
|
|
|
- <template #append>
|
|
|
|
- <el-button type="primary" plain @click="updateFileTitle(file)">
|
|
|
|
- 确定
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </ElInput>
|
|
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -275,16 +259,12 @@ const inputCaseTitles = ref<CaseFile[]>([]);
|
|
|
|
|
|
// 处理标题输入事件
|
|
// 处理标题输入事件
|
|
const handleTitleInput = (file: CaseFile, value: string) => {
|
|
const handleTitleInput = (file: CaseFile, value: string) => {
|
|
- if (file.type === 'old') {
|
|
|
|
- file.filesTitle = value;
|
|
|
|
- } else {
|
|
|
|
- file.title = value;
|
|
|
|
- }
|
|
|
|
|
|
+ file.filesTitle = value;
|
|
};
|
|
};
|
|
|
|
|
|
const updateFileTitle = async (caseFile: CaseFile) => {
|
|
const updateFileTitle = async (caseFile: CaseFile) => {
|
|
// 根据文件类型检查不同的标题字段
|
|
// 根据文件类型检查不同的标题字段
|
|
- const title = caseFile.type === 'old' ? caseFile.filesTitle : caseFile.title;
|
|
|
|
|
|
+ const title = caseFile.filesTitle;
|
|
if (!title || !title.trim()) {
|
|
if (!title || !title.trim()) {
|
|
ElMessage.error("标题不能为空!");
|
|
ElMessage.error("标题不能为空!");
|
|
return;
|
|
return;
|
|
@@ -292,40 +272,42 @@ const updateFileTitle = async (caseFile: CaseFile) => {
|
|
|
|
|
|
try {
|
|
try {
|
|
// 根据文件类型调用不同的更新接口
|
|
// 根据文件类型调用不同的更新接口
|
|
- if (caseFile.type === 'old') {
|
|
|
|
- await updateCaseInfo(caseFile);
|
|
|
|
- } else if (caseFile.type === 'tabulation') {
|
|
|
|
- // updateCaseTabulation 参数:id, caseId, store, viewport, cover, paperKey, overviewId, isAutoGen, listCover, mapUrl, high, width
|
|
|
|
- await updateCaseTabulation({
|
|
|
|
- id: caseFile.id,
|
|
|
|
- caseId: caseFile.caseId,
|
|
|
|
- store: caseFile.store,
|
|
|
|
- viewport: caseFile.viewport,
|
|
|
|
- cover: caseFile.cover,
|
|
|
|
- paperKey: caseFile.paperKey,
|
|
|
|
- overviewId: caseFile.overviewId,
|
|
|
|
- isAutoGen: caseFile.isAutoGen,
|
|
|
|
- listCover: caseFile.listCover,
|
|
|
|
- mapUrl: caseFile.mapUrl,
|
|
|
|
- high: caseFile.high,
|
|
|
|
- width: caseFile.width,
|
|
|
|
- title: title // 使用最新输入的 title
|
|
|
|
- });
|
|
|
|
- } else if (caseFile.type === 'overview') {
|
|
|
|
- // updateCaseOverview 参数:id, caseId, store, title, cover, mapUrl, listCover, high, width, kankanCover
|
|
|
|
- await updateCaseOverview({
|
|
|
|
- id: caseFile.id,
|
|
|
|
- caseId: caseFile.caseId,
|
|
|
|
- store: caseFile.store,
|
|
|
|
- title: title, // 使用最新输入的 title
|
|
|
|
- cover: caseFile.cover,
|
|
|
|
- mapUrl: caseFile.mapUrl,
|
|
|
|
- listCover: caseFile.listCover,
|
|
|
|
- high: caseFile.high,
|
|
|
|
- width: caseFile.width,
|
|
|
|
- kankanCover: caseFile.kankanCover
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ await updateCaseInfo(caseFile);
|
|
|
|
+ // if (caseFile.type === 'old') {
|
|
|
|
+ // await updateCaseInfo(caseFile);
|
|
|
|
+ // }
|
|
|
|
+ // else if (caseFile.type === 'tabulation') {
|
|
|
|
+ // // updateCaseTabulation 参数:id, caseId, store, viewport, cover, paperKey, overviewId, isAutoGen, listCover, mapUrl, high, width
|
|
|
|
+ // await updateCaseTabulation({
|
|
|
|
+ // id: caseFile.id,
|
|
|
|
+ // caseId: caseFile.caseId,
|
|
|
|
+ // store: caseFile.store,
|
|
|
|
+ // viewport: caseFile.viewport,
|
|
|
|
+ // cover: caseFile.cover,
|
|
|
|
+ // paperKey: caseFile.paperKey,
|
|
|
|
+ // overviewId: caseFile.overviewId,
|
|
|
|
+ // isAutoGen: caseFile.isAutoGen,
|
|
|
|
+ // listCover: caseFile.listCover,
|
|
|
|
+ // mapUrl: caseFile.mapUrl,
|
|
|
|
+ // high: caseFile.high,
|
|
|
|
+ // width: caseFile.width,
|
|
|
|
+ // title: title // 使用最新输入的 title
|
|
|
|
+ // });
|
|
|
|
+ // } else if (caseFile.type === 'overview') {
|
|
|
|
+ // // updateCaseOverview 参数:id, caseId, store, title, cover, mapUrl, listCover, high, width, kankanCover
|
|
|
|
+ // await updateCaseOverview({
|
|
|
|
+ // id: caseFile.id,
|
|
|
|
+ // caseId: caseFile.caseId,
|
|
|
|
+ // store: caseFile.store,
|
|
|
|
+ // title: title, // 使用最新输入的 title
|
|
|
|
+ // cover: caseFile.cover,
|
|
|
|
+ // mapUrl: caseFile.mapUrl,
|
|
|
|
+ // listCover: caseFile.listCover,
|
|
|
|
+ // high: caseFile.high,
|
|
|
|
+ // width: caseFile.width,
|
|
|
|
+ // kankanCover: caseFile.kankanCover
|
|
|
|
+ // });
|
|
|
|
+ // }
|
|
|
|
|
|
inputCaseTitles.value = inputCaseTitles.value.filter(
|
|
inputCaseTitles.value = inputCaseTitles.value.filter(
|
|
(item) => item !== caseFile
|
|
(item) => item !== caseFile
|
|
@@ -371,7 +353,7 @@ const files = ref<CaseFile[]>([]);
|
|
const srcList = computed(() => {
|
|
const srcList = computed(() => {
|
|
return files.value.map(file => {
|
|
return files.value.map(file => {
|
|
// 根据文件类型返回对应的图片URL
|
|
// 根据文件类型返回对应的图片URL
|
|
- return file.type === 'old' ? file.filesUrl : (file.listCover || file.filesUrl);
|
|
|
|
|
|
+ return file.filesUrl;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
|
|
@@ -410,7 +392,7 @@ const previewImage = (index: number) => {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
// tabulation 和 overview 类型的查看逻辑
|
|
// tabulation 和 overview 类型的查看逻辑
|
|
- if (file.listCover) {
|
|
|
|
|
|
+ if (file.filesUrl) {
|
|
// 如果有封面图,显示预览
|
|
// 如果有封面图,显示预览
|
|
showPreview.value = true
|
|
showPreview.value = true
|
|
} else {
|
|
} else {
|
|
@@ -433,25 +415,24 @@ const refresh = async () => {
|
|
]);
|
|
]);
|
|
|
|
|
|
// 提取数据并为每种类型添加标记
|
|
// 提取数据并为每种类型添加标记
|
|
- let tabulationList = (tabulationRes?.data || []).map(item => ({
|
|
|
|
- ...item,
|
|
|
|
- title: item.title || '方位图',
|
|
|
|
- type: 'tabulation' as const
|
|
|
|
- }));
|
|
|
|
- // 方位图需要清除封面图为空的数据
|
|
|
|
- tabulationList = tabulationList.filter(item => item.listCover !== '');
|
|
|
|
- const overviewList = (overviewRes?.data || []).map(item => ({
|
|
|
|
- ...item,
|
|
|
|
- title: item.title || '平面图',
|
|
|
|
- type: 'overview' as const
|
|
|
|
- }));
|
|
|
|
|
|
+ // let tabulationList = (tabulationRes?.data || []).map(item => ({
|
|
|
|
+ // ...item,
|
|
|
|
+ // title: item.title || '方位图',
|
|
|
|
+ // type: 'tabulation' as const
|
|
|
|
+ // }));
|
|
|
|
+ // // 方位图需要清除封面图为空的数据
|
|
|
|
+ // tabulationList = tabulationList.filter(item => item.listCover !== '');
|
|
|
|
+ // const overviewList = (overviewRes?.data || []).map(item => ({
|
|
|
|
+ // ...item,
|
|
|
|
+ // title: item.title || '平面图',
|
|
|
|
+ // type: 'overview' as const
|
|
|
|
+ // }));
|
|
const caseFiles = (caseFilesRes || []).map(item => ({
|
|
const caseFiles = (caseFilesRes || []).map(item => ({
|
|
...item,
|
|
...item,
|
|
- type: 'old' as const
|
|
|
|
|
|
+ type: item.tabulationId ? 'tabulation' : item.overviewId ? 'overview' : 'old'
|
|
}));
|
|
}));
|
|
|
|
|
|
- files.value = [...tabulationList, ...overviewList, ...caseFiles];
|
|
|
|
- console.log(files.value)
|
|
|
|
|
|
+ files.value = [...caseFiles];
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('获取文件列表失败:', error);
|
|
console.error('获取文件列表失败:', error);
|
|
files.value = [];
|
|
files.value = [];
|
|
@@ -477,16 +458,17 @@ const del = async (file: CaseFile) => {
|
|
if (await confirm("确定要删除此数据?")) {
|
|
if (await confirm("确定要删除此数据?")) {
|
|
try {
|
|
try {
|
|
// 根据文件类型调用不同的删除接口
|
|
// 根据文件类型调用不同的删除接口
|
|
- if (file.type === 'old') {
|
|
|
|
- // old 类型的删除逻辑不变
|
|
|
|
- await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
|
|
|
|
- } else if (file.type === 'tabulation') {
|
|
|
|
- // tabulation 类型调用 /fusion/caseTabulation/del
|
|
|
|
- await delCaseTabulation({ id: file.id! });
|
|
|
|
- } else if (file.type === 'overview') {
|
|
|
|
- // overview 类型调用 /fusion/caseOverview/del
|
|
|
|
- await delCaseOverview({ id: file.id! });
|
|
|
|
- }
|
|
|
|
|
|
+ await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
|
|
|
|
+ // if (file.type === 'old') {
|
|
|
|
+ // // old 类型的删除逻辑不变
|
|
|
|
+ // await delCaseFile({ caseId: caseId.value!, filesId: file.filesId });
|
|
|
|
+ // } else if (file.type === 'tabulation') {
|
|
|
|
+ // // tabulation 类型调用 /fusion/caseTabulation/del
|
|
|
|
+ // await delCaseTabulation({ id: file.id! });
|
|
|
|
+ // } else if (file.type === 'overview') {
|
|
|
|
+ // // overview 类型调用 /fusion/caseOverview/del
|
|
|
|
+ // await delCaseOverview({ id: file.id! });
|
|
|
|
+ // }
|
|
|
|
|
|
refresh();
|
|
refresh();
|
|
ElMessage.success("删除成功!");
|
|
ElMessage.success("删除成功!");
|
|
@@ -514,16 +496,28 @@ const handleEdit = (file: CaseFile) => {
|
|
if (file.type === 'tabulation') {
|
|
if (file.type === 'tabulation') {
|
|
// tabulation 类型的编辑链接
|
|
// tabulation 类型的编辑链接
|
|
if(appId === 'fire'){
|
|
if(appId === 'fire'){
|
|
- window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.id}&token=${user.value.token}`, '_blank');
|
|
|
|
- } else {
|
|
|
|
- window.open(`${url}/draw/criminal/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.id}&token=${user.value.token}`, '_blank');
|
|
|
|
|
|
+ window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else if(appId === 'criminal'){
|
|
|
|
+ window.open(`${url}/draw/criminal/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else if(appId === 'cjzfire'){
|
|
|
|
+ window.open(`${url}/draw/cjzfire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else if(appId === 'xmfire'){
|
|
|
|
+ window.open(`${url}/draw/xmfire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else{
|
|
|
|
+ window.open(`${url}/draw/fire/index.html#/tabulation?caseId=${caseId.value}&tabulationId=${file.tabulationId}&token=${user.value.token}`, '_blank');
|
|
}
|
|
}
|
|
} else if (file.type === 'overview') {
|
|
} else if (file.type === 'overview') {
|
|
// overview 类型的编辑链接
|
|
// overview 类型的编辑链接
|
|
if(appId === 'fire'){
|
|
if(appId === 'fire'){
|
|
- window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.id}&token=${user.value.token}`, '_blank');
|
|
|
|
- } else {
|
|
|
|
- window.open(`${url}/draw/criminal/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.id}&token=${user.value.token}`, '_blank');
|
|
|
|
|
|
+ window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else if(appId === 'criminal'){
|
|
|
|
+ window.open(`${url}/draw/criminal/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else if(appId === 'cjzfire'){
|
|
|
|
+ window.open(`${url}/draw/cjzfire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else if(appId === 'xmfire'){
|
|
|
|
+ window.open(`${url}/draw/xmfire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
|
|
|
|
+ } else{
|
|
|
|
+ window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&overviewId=${file.overviewId}&token=${user.value.token}`, '_blank');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -544,8 +538,14 @@ const openOverView = () => {
|
|
console.log('appId', appId)
|
|
console.log('appId', appId)
|
|
if(appId === 'fire'){
|
|
if(appId === 'fire'){
|
|
window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
|
|
window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
|
|
- } else {
|
|
|
|
|
|
+ } else if(appId === 'criminal'){
|
|
window.open(`${url}/draw/criminal/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
|
|
window.open(`${url}/draw/criminal/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
|
|
|
|
+ } else if(appId === 'cjzfire'){
|
|
|
|
+ window.open(`${url}/draw/cjzfire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
|
|
|
|
+ } else if(appId === 'xmfire'){
|
|
|
|
+ window.open(`${url}/draw/xmfire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
|
|
|
|
+ } else{
|
|
|
|
+ window.open(`${url}/draw/fire/index.html#/overview?caseId=${caseId.value!}&token=${user.value.token}`, '_blank')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|