Browse Source

委托单

ZaiZai 1 year ago
parent
commit
2991ad042c

+ 3 - 7
src/global/components/hc-tooltip/index.vue

@@ -1,8 +1,5 @@
 <template>
-    <el-tooltip
-        v-if="btn_Info" :content="btn_Info.textInfo" placement="top"
-        :disabled="!isBubble || !btn_Info.textInfo"
-    >
+    <el-tooltip v-if="btn_Info" :content="btn_Info.textInfo" placement="top" :disabled="!isBubble || !btn_Info.textInfo">
         <slot />
     </el-tooltip>
 </template>
@@ -28,9 +25,8 @@ const isBubble = ref(useAppState.getBubble)
 
 //监听
 watch(() => [
-    props.keys,
-    useAppState.getBubble,
-], ([keys, bubble]) => {
+    props.keys, useAppState.getBubble, useAppState.getButtons,
+], ([keys, bubble, btns]) => {
     btn_key.value = keys
     isBubble.value = bubble
     btn_Info.value = getButtonsVal(keys)

+ 1 - 4
src/global/components/hc-tooltip/item.vue

@@ -27,10 +27,7 @@ const content_tip = ref(props.content)
 const isBubble = ref(useAppState.getBubble)
 
 //监听
-watch(() => [
-    props.content,
-    useAppState.getBubble,
-], ([tip, bubble]) => {
+watch(() => [props.content, useAppState.getBubble], ([tip, bubble]) => {
     content_tip.value = tip
     isBubble.value = bubble
 })

+ 6 - 1
src/store/index.js

@@ -1,3 +1,4 @@
+import { isNullES } from 'js-fast-way'
 import { defineStore } from 'pinia'
 import pinia from '~src/store/init'
 import appConfig from '~src/config/app'
@@ -147,7 +148,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
+            }
         },
         //项目合同段数据
         setProjectContract(value) {