feat: 🚀 hTML提示框
This commit is contained in:
@@ -116,7 +116,6 @@ class RequestHttp {
|
|||||||
location.href = usePathUrl();
|
location.href = usePathUrl();
|
||||||
return Promise.reject(data);
|
return Promise.reject(data);
|
||||||
}
|
}
|
||||||
console.log("1232323");
|
|
||||||
let statusStr = data.status + "";
|
let statusStr = data.status + "";
|
||||||
const STATUS_STRS = [
|
const STATUS_STRS = [
|
||||||
"600006",
|
"600006",
|
||||||
@@ -130,6 +129,13 @@ class RequestHttp {
|
|||||||
// "70003",
|
// "70003",
|
||||||
// "70001"
|
// "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)) {
|
if (statusStr.length > 3 && !STATUS_STRS.includes(statusStr)) {
|
||||||
console.log("32121");
|
console.log("32121");
|
||||||
ElMessage.error(data.msg || data.message);
|
ElMessage.error(data.msg || data.message);
|
||||||
|
|||||||
1
src/auto-import.d.ts
vendored
1
src/auto-import.d.ts
vendored
@@ -5,6 +5,7 @@
|
|||||||
export {}
|
export {}
|
||||||
declare global {
|
declare global {
|
||||||
const EffectScope: typeof import("vue")["EffectScope"];
|
const EffectScope: typeof import("vue")["EffectScope"];
|
||||||
|
const ElMessage: typeof import("element-plus/es")["ElMessage"];
|
||||||
const ElMessageBox: typeof import("element-plus/es")["ElMessageBox"];
|
const ElMessageBox: typeof import("element-plus/es")["ElMessageBox"];
|
||||||
const computed: typeof import("vue")["computed"];
|
const computed: typeof import("vue")["computed"];
|
||||||
const createApp: typeof import("vue")["createApp"];
|
const createApp: typeof import("vue")["createApp"];
|
||||||
|
|||||||
@@ -111,14 +111,27 @@ const handleBtnClick = async () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
const result: any = await getTransferSnJCApi({ ids: ids });
|
const result: any = await getTransferSnJCApi({ ids: ids });
|
||||||
|
console.log(result, "===result==");
|
||||||
if (result.status === 200) {
|
if (result.status === 200) {
|
||||||
getTransferSn(ids);
|
getTransferSn(ids);
|
||||||
} else {
|
} 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>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped lang="scss">
|
||||||
@import "../index.scss";
|
@import "../index.scss";
|
||||||
|
|
||||||
|
// .el-message {
|
||||||
|
// width: 800px;
|
||||||
|
// height: 800px;
|
||||||
|
// overflow-y: auto;
|
||||||
|
// }
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
3
src/hooks/useHtmlMsg.vue
Normal file
3
src/hooks/useHtmlMsg.vue
Normal 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 }); };
|
||||||
@@ -4,6 +4,12 @@
|
|||||||
z-index: 2058 !important;
|
z-index: 2058 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// .el-message {
|
||||||
|
// width: 800px;
|
||||||
|
// height: 800px;
|
||||||
|
// overflow-y: auto;
|
||||||
|
// }
|
||||||
|
|
||||||
// .el-message,
|
// .el-message,
|
||||||
// .el-message--info {
|
// .el-message--info {
|
||||||
// color: red !important;
|
// color: red !important;
|
||||||
|
|||||||
Reference in New Issue
Block a user