Przeglądaj źródła

[Fix 0000] 修复了矿码级联选择器无法在初始化时传递参数的问题

houzekong 5 miesięcy temu
rodzic
commit
7ab068c992

+ 2 - 5
src/components/Form/src/jeecg/components/MineCascader/MineCascader.vue

@@ -20,7 +20,7 @@
 
 
 <script lang="ts">
 <script lang="ts">
   import { get, last } from 'lodash';
   import { get, last } from 'lodash';
-  import { defineComponent, onMounted, computed } from 'vue';
+  import { defineComponent, computed } from 'vue';
   // import { useMessage } from '/@/hooks/web/useMessage';
   // import { useMessage } from '/@/hooks/web/useMessage';
   import { propTypes } from '/@/utils/propTypes';
   import { propTypes } from '/@/utils/propTypes';
   import { useMineStore } from '/@/store/modules/mine';
   import { useMineStore } from '/@/store/modules/mine';
@@ -63,10 +63,7 @@
         emit('change', val);
         emit('change', val);
       }
       }
 
 
-      onMounted(() => {
-        mineStore.fetchMineTree();
-        // mineStore.fetchMineTree(props.level);
-      });
+      handleChange([mineStore.mineId]);
 
 
       return {
       return {
         innerValue,
         innerValue,

+ 4 - 0
src/main.ts

@@ -18,6 +18,7 @@ import { registerGlobComp } from '/@/components/registerGlobComp';
 import { registerThirdComp } from '/@/settings/registerThirdComp';
 import { registerThirdComp } from '/@/settings/registerThirdComp';
 import { useSso } from '/@/hooks/web/useSso';
 import { useSso } from '/@/hooks/web/useSso';
 import { useAppStoreWithOut } from '@/store/modules/app';
 import { useAppStoreWithOut } from '@/store/modules/app';
+import { useMineStore } from './store/modules/mine';
 
 
 // 程序入口
 // 程序入口
 async function main() {
 async function main() {
@@ -116,4 +117,7 @@ function setupProps(props?: MainAppProps) {
   }
   }
   const appStore = useAppStoreWithOut();
   const appStore = useAppStoreWithOut();
   appStore.setMainAppProps(props);
   appStore.setMainAppProps(props);
+
+  const mineStore = useMineStore();
+  mineStore.fetchMineTree();
 }
 }