修改退出登录弹框,添加数据填报预览视频和图片,添加上传轮询加载
This commit is contained in:
parent
f5e9bf6cc7
commit
fb582add0f
@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onBeforeUnmount } from "vue";
|
import { onMounted, onBeforeUnmount } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { ElMessageBox } from "element-plus";
|
import { Modal } from "ant-design-vue";
|
||||||
import { UserOutlined, LogoutOutlined } from "@ant-design/icons-vue";
|
import { UserOutlined, LogoutOutlined } from "@ant-design/icons-vue";
|
||||||
// 国际化
|
// 国际化
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
@ -20,11 +20,12 @@ const userStore = useUserStore();
|
|||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
function logout() {
|
function logout() {
|
||||||
ElMessageBox.confirm("确定注销并退出系统吗?", "提示", {
|
Modal.confirm({
|
||||||
confirmButtonText: "确定",
|
title: "提示?",
|
||||||
cancelButtonText: "取消",
|
content: "确定注销并退出系统吗?",
|
||||||
|
okText: "确定",
|
||||||
type: "warning",
|
type: "warning",
|
||||||
}).then(() => {
|
onOk: async () => {
|
||||||
userStore
|
userStore
|
||||||
.logout()
|
.logout()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -33,15 +34,14 @@ function logout() {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
router.push(`/login`);
|
router.push(`/login`);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function changePassword() {
|
function changePassword() {
|
||||||
router.push('/changePassword');
|
router.push("/changePassword");
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {});
|
||||||
});
|
onBeforeUnmount(() => {});
|
||||||
onBeforeUnmount(() => {
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -54,8 +54,7 @@ onBeforeUnmount(() => {
|
|||||||
>
|
>
|
||||||
<!-- <h1 class="text-blank font-bold text-[16px]">{{ t("login.title") }}</h1> -->
|
<!-- <h1 class="text-blank font-bold text-[16px]">{{ t("login.title") }}</h1> -->
|
||||||
<h1 class="text-blank font-bold text-[16px]">{{ t("login.titleSjtb") }}</h1>
|
<h1 class="text-blank font-bold text-[16px]">{{ t("login.titleSjtb") }}</h1>
|
||||||
</a
|
</a>
|
||||||
>
|
|
||||||
</transition>
|
</transition>
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
|
|
||||||
|
|||||||
@ -271,6 +271,7 @@
|
|||||||
:multiple="false"
|
:multiple="false"
|
||||||
accept=".mp4"
|
accept=".mp4"
|
||||||
:before-upload="beforeVideoUpload"
|
:before-upload="beforeVideoUpload"
|
||||||
|
@preview="handleVideoPreview"
|
||||||
:disabled="isView"
|
:disabled="isView"
|
||||||
:maxCount="5"
|
:maxCount="5"
|
||||||
@remove="handleVideoRemove"
|
@remove="handleVideoRemove"
|
||||||
@ -651,11 +652,8 @@ const handleVideoPreview = () => {
|
|||||||
|
|
||||||
// 预览图片
|
// 预览图片
|
||||||
const handleImagePreview = async (file: any) => {
|
const handleImagePreview = async (file: any) => {
|
||||||
if (!props.isView) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
emit("preview-click", { picpthList: imageFileList.value }, "formImage", 0);
|
emit("preview-click", { picpthList: imageFileList.value }, "formImage", 0);
|
||||||
return "";
|
return Promise.reject();
|
||||||
};
|
};
|
||||||
// 确认操作
|
// 确认操作
|
||||||
const handleOk = async () => {
|
const handleOk = async () => {
|
||||||
@ -847,23 +845,6 @@ defineExpose({
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
border: 1px solid #d9d9d9;
|
border: 1px solid #d9d9d9;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
|
|
||||||
/* 删除预览按钮 */
|
|
||||||
.ant-upload-list-item-actions {
|
|
||||||
a {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.imgupload_hidden {
|
|
||||||
:deep(.ant-upload-list-item) {
|
|
||||||
/* 删除预览按钮 */
|
|
||||||
.ant-upload-list-item-actions {
|
|
||||||
a {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -311,7 +311,12 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed, onMounted, h, nextTick, watch } from "vue";
|
import { ref, computed, onMounted, h, nextTick, watch } from "vue";
|
||||||
import { message, Modal } from "ant-design-vue"; // 假设使用 ant-design-vue
|
import { message, Modal } from "ant-design-vue"; // 假设使用 ant-design-vue
|
||||||
import { LeftOutlined, RightOutlined, CloseCircleOutlined, ExclamationCircleOutlined } from "@ant-design/icons-vue"; // 引入图标组件
|
import {
|
||||||
|
LeftOutlined,
|
||||||
|
RightOutlined,
|
||||||
|
CloseCircleOutlined,
|
||||||
|
ExclamationCircleOutlined,
|
||||||
|
} from "@ant-design/icons-vue"; // 引入图标组件
|
||||||
import BasicTable from "@/components/BasicTable/index.vue";
|
import BasicTable from "@/components/BasicTable/index.vue";
|
||||||
import GuoYuSheShiShuJuTianBaoSearch from "./guoYuSheShiShuJuTianBaoSearch.vue";
|
import GuoYuSheShiShuJuTianBaoSearch from "./guoYuSheShiShuJuTianBaoSearch.vue";
|
||||||
import GuoYuSheShiShuJuTianBaoTable from "./guoYuSheShiShuJuTianBaoTable.vue";
|
import GuoYuSheShiShuJuTianBaoTable from "./guoYuSheShiShuJuTianBaoTable.vue";
|
||||||
@ -337,7 +342,6 @@ import { Tag } from "ant-design-vue"; // 确保导入 Tag
|
|||||||
import { getDictItemsByCode } from "@/api/dict";
|
import { getDictItemsByCode } from "@/api/dict";
|
||||||
|
|
||||||
const baseUrl = import.meta.env.VITE_APP_PREVIEW_URL;
|
const baseUrl = import.meta.env.VITE_APP_PREVIEW_URL;
|
||||||
const baseUrlPreview = import.meta.env.VITE_APP_BASE_URL;
|
|
||||||
const baseUrlApi = import.meta.env.VITE_APP_BASE_API_URL;
|
const baseUrlApi = import.meta.env.VITE_APP_BASE_API_URL;
|
||||||
// --- 类型定义 ---
|
// --- 类型定义 ---
|
||||||
interface FormData {
|
interface FormData {
|
||||||
@ -747,8 +751,9 @@ const handleModalOk = () => {
|
|||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: "是否提交导入数据?",
|
title: "是否提交导入数据?",
|
||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
|
try {
|
||||||
let res: any = await batchSaveDraft({
|
let res: any = await batchSaveDraft({
|
||||||
taskId: taskId.value
|
taskId: taskId.value,
|
||||||
});
|
});
|
||||||
if (res && res?.code == 0) {
|
if (res && res?.code == 0) {
|
||||||
fileTableData.value = [];
|
fileTableData.value = [];
|
||||||
@ -759,6 +764,9 @@ const handleModalOk = () => {
|
|||||||
} else {
|
} else {
|
||||||
message.error("导入失败,请检查数据是否正确");
|
message.error("导入失败,请检查数据是否正确");
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
message.error("导入数据失败");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -796,17 +804,16 @@ const importBtn = async () => {
|
|||||||
visible.value = true;
|
visible.value = true;
|
||||||
fileLoading.value = true;
|
fileLoading.value = true;
|
||||||
if (currentTask.status == "UPLOADED") {
|
if (currentTask.status == "UPLOADED") {
|
||||||
if (visible.value) message.warning(currentTask.statusText);
|
if (visible.value) {
|
||||||
|
// message.warning(currentTask.statusText)
|
||||||
|
setTimeout(() => {
|
||||||
|
if (visible.value) importBtn();
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
} else if (currentTask.status == "VALIDATED") {
|
} else if (currentTask.status == "VALIDATED") {
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
try {
|
|
||||||
modalTableRef.value.editingRowIndex = null;
|
modalTableRef.value.editingRowIndex = null;
|
||||||
getFileList();
|
getFileList();
|
||||||
} catch (error) {
|
|
||||||
message.error("导入失败");
|
|
||||||
} finally {
|
|
||||||
fileLoading.value = false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -818,39 +825,28 @@ const importBtn = async () => {
|
|||||||
};
|
};
|
||||||
const getFileList = async () => {
|
const getFileList = async () => {
|
||||||
let res: any = await getLastImportResult();
|
let res: any = await getLastImportResult();
|
||||||
fileTableaAnalysis(res, "get");
|
fileTableaAnalysis(res);
|
||||||
}
|
};
|
||||||
// 上传文件
|
// 上传文件
|
||||||
const fileChange = (file: File) => {
|
const fileChange = (file: File) => {
|
||||||
try {
|
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
fileLoading.value = true;
|
fileLoading.value = true;
|
||||||
fileTableData.value = [];
|
fileTableData.value = [];
|
||||||
|
setTimeout(() => {
|
||||||
|
if (visible.value) importBtn();
|
||||||
|
}, 5000);
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append("file", file);
|
formData.append("file", file);
|
||||||
let res: any = await importFishZip(formData);
|
await importFishZip(formData);
|
||||||
const { code } = res.data || {};
|
|
||||||
try {
|
try {
|
||||||
if (code == 1) {
|
setTimeout(() => {
|
||||||
message.error("导入失败");
|
if (visible.value) importBtn();
|
||||||
} else {
|
}, 5000);
|
||||||
taskId.value = res.data.taskId;
|
|
||||||
if (res.data.summary) {
|
|
||||||
message.success(res.data.summary);
|
|
||||||
} else {
|
|
||||||
message.success("导入成功");
|
|
||||||
}
|
|
||||||
fileTableaAnalysis(res, "file");
|
|
||||||
}
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.error("导入失败");
|
message.error("导入失败");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (error) {
|
|
||||||
} finally {
|
|
||||||
fileLoading.value = false;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
// 获取文件列表
|
// 获取文件列表
|
||||||
const handleFileSelect = (e: Event) => {
|
const handleFileSelect = (e: Event) => {
|
||||||
@ -886,14 +882,10 @@ const resetFileInput = () => {
|
|||||||
fileInputRef.value.value = "";
|
fileInputRef.value.value = "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const fileTableaAnalysis = (res: any, type: string) => {
|
const fileTableaAnalysis = (res: any) => {
|
||||||
let data = [];
|
let data = [];
|
||||||
let list = [];
|
let list = [];
|
||||||
if (type == "file") {
|
|
||||||
list = res.data.rows;
|
|
||||||
} else {
|
|
||||||
list = res.data.result.rows;
|
list = res.data.result.rows;
|
||||||
}
|
|
||||||
list.sort((a: any, b: any) => {
|
list.sort((a: any, b: any) => {
|
||||||
const keyA =
|
const keyA =
|
||||||
a.rowIndex !== undefined && a.rowIndex !== null ? Number(a.rowIndex) : -1;
|
a.rowIndex !== undefined && a.rowIndex !== null ? Number(a.rowIndex) : -1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user