ソースを参照

修改文件收集

ZaiZai 1 年間 前
コミット
285d746a12

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240407180401"
+  "value": "20240507152357"
 }

+ 14 - 16
src/global/components/hc-tooltip/index.vue

@@ -1,36 +1,33 @@
 <template>
-    <el-tooltip :content="btn_Info['textInfo']" placement="top" :disabled="!isBubble || !btn_Info['textInfo']" v-if="btn_Info">
-        <slot></slot>
+    <el-tooltip v-if="btn_Info" :content="btn_Info.textInfo" placement="top" :disabled="!isBubble || !btn_Info.textInfo">
+        <slot />
     </el-tooltip>
 </template>
 
 <script setup>
-import {ref,watch,onMounted} from "vue";
-import {useAppStore} from "~src/store";
-const useAppState = useAppStore()
-
+import { onMounted, ref, watch } from 'vue'
+import { useAppStore } from '~src/store'
 //参数
 const props = defineProps({
     keys: {
         type: String,
-        default: ''
-    }
+        default: '',
+    },
 })
 
+const useAppState = useAppStore()
+
 //变量
-const btn_Info = ref(false);
-const btn_key = ref(props.keys);
-const isBubble = ref(useAppState.getBubble);
+const btn_Info = ref(false)
+const btn_key = ref(props.keys)
+const isBubble = ref(useAppState.getBubble)
 
 //监听
-watch(() => [
-    props.keys,
-    useAppState.getBubble,
-], ([keys, bubble]) => {
+watch(() => [props.keys, useAppState.getBubble, useAppState.getButtons], ([keys, bubble, btns]) => {
     btn_key.value = keys
     isBubble.value = bubble
     btn_Info.value = getButtonsVal(keys)
-})
+}, { deep: true })
 
 //渲染完成
 onMounted(()=> {
@@ -41,6 +38,7 @@ onMounted(()=> {
 
 //获取气泡数据
 const getButtonsVal = (value) => {
+    console.log(useAppState.getBubble)
     return useAppState.getButtonsVal(value)
 }
 </script>

+ 6 - 1
src/store/index.js

@@ -5,6 +5,7 @@ import logoIcon from '~src/assets/logo/icon.png'
 import logoName from '~src/assets/logo/name.png'
 import { clearStoreAll, getStoreValue, setStoreValue } from '~src/utils/storage'
 import { removeRefreshToken, removeToken, setRefreshToken, setToken } from '~src/api/util/auth'
+import { isNullES } from 'js-fast-way'
 
 export const useAppStore = defineStore('main', {
     state: () =>({
@@ -135,7 +136,11 @@ export const useAppStore = defineStore('main', {
             setStoreValue('buttons', value)
         },
         getButtonsVal(value) {
-            return this.buttons[value] || false
+            if (isNullES(this.buttons)) {
+                return false
+            } else {
+                return this.buttons[value] || false
+            }
         },
         setHomeUrl(value) {
             this.homeUrl = value

+ 1 - 1
src/views/archives/rolling.vue

@@ -1,5 +1,5 @@
 <template>
-    <hc-body :loading="treeLoading" :project-nmae="projectInfo.name" split>
+    <hc-body :loading="treeLoading" :project-nmae="projectInfo?.name" split>
         <template #tree>
             <HcTree
                 :auto-expand-keys="treeAutoExpandKeys" :contract-id="contractId" :project-id="projectId"

+ 6 - 3
src/views/home/auth.vue

@@ -78,9 +78,12 @@ const loginByTokenApi = async (form) => {
     const res = getObjVal(data)
     if (!error && code === 200 && res) {
         await setUserAppInfo(res)
-        loading.value = false
-        isErrorShow.value = false
-        await router.push({ path: toUrl.value })
+        setTimeout(() => {
+            loading.value = false
+            isErrorShow.value = false
+            window?.$message?.success('授权登录成功')
+            router.push({ path: toUrl.value })
+        }, 500)
     } else {
         window.$message?.error('授权登录失败')
         isErrorShow.value = true