|
@@ -1,5 +1,10 @@
|
|
|
<template>
|
|
|
- <a-config-provider :theme="theme" :locale="zhCN">
|
|
|
+ <a-config-provider
|
|
|
+ :theme="theme"
|
|
|
+ :locale="zhCN"
|
|
|
+ :autoInsertSpaceInButton="false"
|
|
|
+ :renderEmpty="emptyTextHandle"
|
|
|
+ >
|
|
|
<router-view> </router-view>
|
|
|
<a-spin
|
|
|
v-if="spinning"
|
|
@@ -14,7 +19,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import zhCN from "ant-design-vue/es/locale/zh_CN";
|
|
|
-import { watch, watchEffect } from "vue";
|
|
|
+import { watch, watchEffect, h } from "vue";
|
|
|
import { useMainStore } from "@/store";
|
|
|
import { useTimers } from "./setups/useTimers";
|
|
|
import { getToken } from "./auth/auth";
|
|
@@ -31,6 +36,20 @@ addInterval(() => {
|
|
|
let spinning = $ref(false);
|
|
|
const mainStore = useMainStore();
|
|
|
|
|
|
+const emptyTextHandle = (componentName: string) => {
|
|
|
+ if (componentName === "Table") {
|
|
|
+ return h(
|
|
|
+ "div",
|
|
|
+ {
|
|
|
+ class: "table-empty",
|
|
|
+ },
|
|
|
+ [h("div", { class: "table-empty-bg" }), h("p", "暂无数据")]
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return h("div", { class: "app-empty" }, "暂无数据");
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
watch(
|
|
|
() => mainStore.globalMask,
|
|
|
() => (spinning = mainStore.globalMask)
|