Explorar el Código

删除没用的东西

xiaochan hace 6 meses
padre
commit
7c95ee87fd

+ 0 - 1
src/api/emr-control/emr-control.ts

@@ -17,7 +17,6 @@ export function obtainTheProportionOfMedicalRecords(startDate: string, endDate:
     })
 }
 
-
 export function finalControl(data: any) {
     return request({
         url: '/emrQualityControl/finalControl',

+ 0 - 7
src/api/inpatient/dictionary.js

@@ -1,12 +1,5 @@
 import request from '../../utils/request'
 
-export function getVisitAndResponce() {
-  return request({
-    url: '/dictionary/visitAndResponce',
-    method: 'get',
-  })
-}
-
 export function searchData(data) {
   return request({
     url: '/dictionary/executeSearch',

+ 1 - 1
src/utils/loading.js

@@ -1,6 +1,6 @@
 import {ElLoading} from 'element-plus'
 
-var loading
+let loading;
 
 /*开启遮罩*/
 export function startLoading() {

+ 169 - 162
src/utils/request.js

@@ -1,185 +1,192 @@
 import axios from "axios";
-import { ElMessage, ElNotification } from "element-plus";
+import {ElMessage, ElNotification} from "element-plus";
 import router from "@/router";
-import { endLoading, startLoading } from "./loading";
-import { CyMessageBox } from "@/components/cy/message-box";
-import { useProgressBarStore } from "@/pinia/progress-bar-store";
+import {endLoading, startLoading} from "./loading";
+import {CyMessageBox} from "@/components/cy/message-box";
+import {useProgressBarStore} from "@/pinia/progress-bar-store";
 import XEUtils from "xe-utils";
-import { stringify } from "qs";
+import {stringify} from "qs";
 import env from "@/utils/setting";
 
 const service = axios.create({
-  baseURL: env.VITE_BASE_URL,
-  withCredentials: true,
-  timeout: 0,
-  showLoading: true,
-  paramsSerializer: {
-    serialize: stringify,
-  },
+    baseURL: env.VITE_BASE_URL,
+    withCredentials: true,
+    timeout: 0,
+    showLoading: true,
+    paramsSerializer: {
+        serialize: stringify,
+    },
 });
 
+let onceFun = null;
 /*axios请求拦截*/
 service.interceptors.request.use(
-  config => {
-    if (typeof config.jdtTitle !== "undefined") {
-      useProgressBarStore().initialize({
-        title: config.jdtTitle,
-        isOpen: true,
-        closeButton: false,
-      });
-    } else {
-      if (
-        config.url !== "/caseFrontSheet/printVerify" &&
-        !config.url.startsWith("/mixLabelPrint")
-      ) {
-        if (config.showLoading) {
-          startLoading();
+    config => {
+        if (typeof config.jdtTitle !== "undefined") {
+            useProgressBarStore().initialize({
+                title: config.jdtTitle,
+                isOpen: true,
+                closeButton: false,
+            });
+        } else {
+            if (
+                config.url !== "/caseFrontSheet/printVerify" &&
+                !config.url.startsWith("/mixLabelPrint")
+            ) {
+                if (config.showLoading) {
+                    startLoading();
+                }
+            }
         }
-      }
+        config.headers["token"] = localStorage.token;
+        return config;
+    },
+    error => {
+        endLoading();
+        return Promise.reject(error);
     }
-    config.headers["token"] = localStorage.token;
-    return config;
-  },
-  error => {
-    endLoading();
-    return Promise.reject(error);
-  }
 );
 
 service.interceptors.response.use(
-  response => {
-    endLoading();
-    if (response.data.code === 200 || response.data.code === 0) {
-      return response.data.data;
-    }
-    if (response.data.code === 2002) {
-      return response.data;
-    }
-    if (response.data.code === 201) {
-      ElMessage({
-        type: "success",
-        title: "成功",
-        duration: 3500,
-        dangerouslyUseHTMLString: true,
-        message: response.data.message,
-      });
-      return response.data.data;
-    }
-    if (response.data.code === 202) {
-      CyMessageBox.alert({
-        type: "success",
-        message: response.data.message,
-        dangerouslyUseHTMLString: true,
-      }).then(XEUtils.noop);
-      return response.data.data;
-    }
-    if (response.data.code === 203) {
-      ElNotification({
-        type: "success",
-        message: response.data.message,
-        duration: 3000,
-        title: "成功",
-      });
-      return response.data.data;
-    }
+    response => {
+        endLoading();
+        if (response.data.code === 200 || response.data.code === 0) {
+            return response.data.data;
+        }
+        if (response.data.code === 2002) {
+            return response.data;
+        }
+        if (response.data.code === 201) {
+            ElMessage({
+                type: "success",
+                title: "成功",
+                duration: 3500,
+                dangerouslyUseHTMLString: true,
+                message: response.data.message,
+            });
+            return response.data.data;
+        }
+        if (response.data.code === 202) {
+            CyMessageBox.alert({
+                type: "success",
+                message: response.data.message,
+                dangerouslyUseHTMLString: true,
+            }).then(XEUtils.noop);
+            return response.data.data;
+        }
+        if (response.data.code === 203) {
+            ElNotification({
+                type: "success",
+                message: response.data.message,
+                duration: 3000,
+                title: "成功",
+            });
+            return response.data.data;
+        }
 
-    if (response.data.code > 1000 && response.data.code < 2000) {
-      ElMessage({
-        type: "error",
-        message: response.data.message,
-        duration: 3500,
-        grouping: true,
-      });
-    } else if (response.data.code > 2000 && response.data.code < 3000) {
-      if (response.data.code === 2003) {
-        CyMessageBox.alert({
-          type: "error",
-          message: response.data.message,
-          title: "提示",
-          dangerouslyUseHTMLString: true,
-        }).then(XEUtils.noop);
-      } else {
-        CyMessageBox.alert({
-          type: "error",
-          message: response.data.message,
-          title: "提示",
-        }).then(XEUtils.noop);
-      }
-    } else if (response.data.code > 3000 && response.data.code < 4000) {
-      CyMessageBox.alert({
-        type: "error",
-        message: response.data.message,
-        title: "提示",
-        showIcon: false,
-      }).then(() => {
-        router.push("/login").then(XEUtils.noop);
-      });
-    } else if (response.data.code === 5001) {
-      CyMessageBox.alert({
-        type: "error",
-        message: response.data.message,
-        title: "提示",
-      }).then(XEUtils.noop);
-    }
-    if (response.data.code === 6001) {
-      ElMessage({
-        message: response.data.message,
-        type: "error",
-        duration: 2500,
-        grouping: true,
-      });
-      return {
-        error: true,
-        data: response.data.data,
-      };
-    } else if (response.data.code === 6002) {
-      CyMessageBox.alert({
-        type: "error",
-        message: response.data.message,
-        title: "提示",
-      }).then(XEUtils.noop);
-      return Promise.reject(response.data.data);
-    }
+        if (response.data.code > 1000 && response.data.code < 2000) {
+            ElMessage({
+                type: "error",
+                message: response.data.message,
+                duration: 3500,
+                grouping: true,
+            });
+        } else if (response.data.code > 2000 && response.data.code < 3000) {
+            if (response.data.code === 2003) {
+                CyMessageBox.alert({
+                    type: "error",
+                    message: response.data.message,
+                    title: "提示",
+                    dangerouslyUseHTMLString: true,
+                }).then(XEUtils.noop);
+            } else {
+                CyMessageBox.alert({
+                    type: "error",
+                    message: response.data.message,
+                    title: "提示",
+                }).then(XEUtils.noop);
+            }
+        } else if (response.data.code > 3000 && response.data.code < 4000) {
+            if (onceFun == null) {
+                onceFun = true
+                CyMessageBox.alert({
+                    type: "error",
+                    message: response.data.message,
+                    title: "提示",
+                    showIcon: false,
+                }).then(() => {
+                    router.push("/login").then(XEUtils.noop);
+                }).finally(() => {
+                    onceFun = null;
+                })
+            }
 
-    if (response.data.code > 7000 && response.data.code < 8000) {
-      CyMessageBox.alert({
-        type: "error",
-        message: response.data.message,
-        title: "提示",
-      }).then(XEUtils.noop);
-      return Promise.reject(response.data);
-    }
+        } else if (response.data.code === 5001) {
+            CyMessageBox.alert({
+                type: "error",
+                message: response.data.message,
+                title: "提示",
+            }).then(XEUtils.noop);
+        }
+        if (response.data.code === 6001) {
+            ElMessage({
+                message: response.data.message,
+                type: "error",
+                duration: 2500,
+                grouping: true,
+            });
+            return {
+                error: true,
+                data: response.data.data,
+            };
+        } else if (response.data.code === 6002) {
+            CyMessageBox.alert({
+                type: "error",
+                message: response.data.message,
+                title: "提示",
+            }).then(XEUtils.noop);
+            return Promise.reject(response.data.data);
+        }
 
-    if (response.data.data) {
-      return Promise.reject(response.data);
-    }
+        if (response.data.code > 7000 && response.data.code < 8000) {
+            CyMessageBox.alert({
+                type: "error",
+                message: response.data.message,
+                title: "提示",
+            }).then(XEUtils.noop);
+            return Promise.reject(response.data);
+        }
 
-    return Promise.reject(response.data.message || "服务器内部错误");
-  },
-  error => {
-    endLoading();
-    // 取消请求,不显示 message
-    if (error.code && error.code === "ERR_CANCELED") {
-      useProgressBarStore().initialize({
-        title: "",
-        isOpen: false,
-        closeButton: true,
-      });
-      return Promise.reject(error);
+        if (response.data.data) {
+            return Promise.reject(response.data);
+        }
+
+        return Promise.reject(response.data.message || "服务器内部错误");
+    },
+    error => {
+        endLoading();
+        // 取消请求,不显示 message
+        if (error.code && error.code === "ERR_CANCELED") {
+            useProgressBarStore().initialize({
+                title: "",
+                isOpen: false,
+                closeButton: true,
+            });
+            return Promise.reject(error);
+        }
+        ElMessage({
+            message: error,
+            type: "error",
+            duration: 3500,
+            grouping: true,
+        });
+        useProgressBarStore().initialize({
+            title: "",
+            isOpen: false,
+            closeButton: true,
+        });
+        return Promise.reject(error);
     }
-    ElMessage({
-      message: error,
-      type: "error",
-      duration: 3500,
-      grouping: true,
-    });
-    useProgressBarStore().initialize({
-      title: "",
-      isOpen: false,
-      closeButton: true,
-    });
-    return Promise.reject(error);
-  }
 );
 
 export default service;

+ 5 - 5
src/views/data-base/page-editor-help-v2/components/page-editor-v2/PageHelpV2.vue

@@ -375,17 +375,17 @@ let shortcutKeyRegistration = {
 
 let keyWatch = XEUtils.noop
 
-onDeactivated(() => {
-  keyWatch()
-})
-
-onActivated(() => {
+onMounted(() => {
   if (!props.isEditor) return
   keyWatch = watch(() => xcEvent.value, () => {
     shortcutTrigger(xcEvent.value, shortcutKeyRegistration)
   })
 })
 
+onUnmounted(() => {
+  keyWatch()
+})
+
 defineExpose({
   setPageData,
   setTableData,