lcw
This commit is contained in:
29
src/App.vue
29
src/App.vue
@ -10,7 +10,6 @@
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
import * as ocr from "@paddlejs-models/ocr";
|
||||
import Watermark from "@/components/Watermark.vue";
|
||||
import { ref, reactive, nextTick, provide, onMounted, getCurrentInstance, onBeforeUnmount } from "vue";
|
||||
import { useStore } from "vuex";
|
||||
@ -19,14 +18,15 @@ import { getItem, setItem } from "@/utils/storage";
|
||||
import { generateNewStyle, writeNewStyle } from "@/utils/theme";
|
||||
import { timeValidate } from "@/utils/tools";
|
||||
import Fzq from '@/components/fzq/index.vue'
|
||||
import router from "./router";
|
||||
import * as ocr from "@paddlejs-models/ocr";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
|
||||
const store = useStore();
|
||||
generateNewStyle(store.getters.mainColor).then((newStyle) => {
|
||||
writeNewStyle(newStyle);
|
||||
});
|
||||
// 只在首次加载时调用一次,避免多次创建style元素
|
||||
if (!document.getElementById('dynamic-theme-style')) {
|
||||
generateNewStyle(store.getters.mainColor).then((newStyle) => {
|
||||
writeNewStyle(newStyle);
|
||||
});
|
||||
}
|
||||
const isRouterAlive = ref(true);
|
||||
const reload = () => {
|
||||
isRouterAlive.value = false;
|
||||
@ -60,11 +60,18 @@ const initPage = async () => {
|
||||
}
|
||||
}
|
||||
const content = ref([])
|
||||
const frashJs = () => {
|
||||
const sfzh = getItem("idEntityCard")
|
||||
const userName = getItem("USERNAME")
|
||||
// 获取初始水印内容
|
||||
const getWatermarkContent = () => {
|
||||
const sfzh = getItem("idEntityCard") || ''
|
||||
const userName = getItem("USERNAME") || ''
|
||||
const time = timeValidate()
|
||||
content.value = [userName, sfzh, time, "林芝哨岗系统", "禁止泄露公民个人信息和警务工作秘密"]
|
||||
return [userName, sfzh, time, "林芝哨岗系统", "禁止泄露公民个人信息和警务工作秘密"]
|
||||
}
|
||||
// 初始化水印内容
|
||||
content.value = getWatermarkContent()
|
||||
// 只在需要时调用,避免频繁更新导致重新渲染
|
||||
const frashJs = () => {
|
||||
content.value = getWatermarkContent()
|
||||
}
|
||||
// 监听标签页切换
|
||||
|
||||
|
||||
Reference in New Issue
Block a user