feat: 🚀 hTML提示框

This commit is contained in:
2025-08-08 14:35:05 +08:00
parent e6e37c13bd
commit e23037fb23
5 changed files with 32 additions and 3 deletions

View File

@@ -116,7 +116,6 @@ class RequestHttp {
location.href = usePathUrl();
return Promise.reject(data);
}
console.log("1232323");
let statusStr = data.status + "";
const STATUS_STRS = [
"600006",
@@ -130,6 +129,13 @@ class RequestHttp {
// "70003",
// "70001"
];
//单数70005
const STATUS_STRS1 = ["70005", "70004", "70003"];
if (statusStr.length > 3 && STATUS_STRS1.includes(statusStr)) {
console.log("走到了这里");
return data;
// return Promise.reject(data);
}
if (statusStr.length > 3 && !STATUS_STRS.includes(statusStr)) {
console.log("32121");
ElMessage.error(data.msg || data.message);

View File

@@ -5,6 +5,7 @@
export {}
declare global {
const EffectScope: typeof import("vue")["EffectScope"];
const ElMessage: typeof import("element-plus/es")["ElMessage"];
const ElMessageBox: typeof import("element-plus/es")["ElMessageBox"];
const computed: typeof import("vue")["computed"];
const createApp: typeof import("vue")["createApp"];

View File

@@ -111,14 +111,27 @@ const handleBtnClick = async () => {
}
});
const result: any = await getTransferSnJCApi({ ids: ids });
console.log(result, "===result==");
if (result.status === 200) {
getTransferSn(ids);
} else {
useMsg("error", result.message);
ElMessage({
dangerouslyUseHTMLString: true,
message: `<div style="line-height:1.5;max-width:800px;max-height: 800px;
overflow-y: auto;">${result.msg || result.message}</div>`,
type: "error"
// duration: 100000
});
}
};
</script>
<style scoped>
<style scoped lang="scss">
@import "../index.scss";
// .el-message {
// width: 800px;
// height: 800px;
// overflow-y: auto;
// }
</style>

3
src/hooks/useHtmlMsg.vue Normal file
View File

@@ -0,0 +1,3 @@
import { ElMessage } from "element-plus"; export const useMsg = (type: any = "success", msg: string, duration?: number,
showClose?: boolean) => { ElMessage({ showClose: showClose ? showClose : false, message: msg, type: type, duration: duration ?
duration : 3000 }); };

View File

@@ -4,6 +4,12 @@
z-index: 2058 !important;
}
// .el-message {
// width: 800px;
// height: 800px;
// overflow-y: auto;
// }
// .el-message,
// .el-message--info {
// color: red !important;