Z 1 gadu atpakaļ
vecāks
revīzija
ee5e8b044f

+ 3 - 0
qiankun_config/store.js

@@ -21,4 +21,7 @@ export default function (state) {
   if (state.user?.authorityDept) {
     store.dispatch('user/getCurrentUserAuthorityDept');
   }
+  if (state.paramsSetData) {
+    store.dispatch('paramsSetData/setParamsDataInfo');
+  }
 }

+ 1 - 1
src/main.js

@@ -92,7 +92,7 @@ export async function bootstrap() {
 
 export async function mount(props) {
   console.log('[vue] props from main framework', props);
-
+  Vue.prototype.$portalStore = props.store;
   initParentStore(props.store?.state);
   props.onGlobalStateChange((state, prev) => {
     // state: 变更后的状态; prev 变更前的状态

+ 11 - 2
src/views/system/parmasManage/addOrEditDialog.vue

@@ -31,7 +31,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="24">
-          <el-form-item label="是否启用:" prop="enable">
+          <el-form-item label="状态:" prop="enable">
             <el-switch
               :disabled="type=='view'"
               v-model="dialogForm.enable"
@@ -81,6 +81,11 @@ export default {
       }
     }
   },
+  computed:{
+    isQianKun() {
+      return window.__POWERED_BY_QIANKUN__;
+    }
+  },
   methods: {
     init(type, id = '') {
       this.title = type == 'add' ? '新增' : type == 'edit' ? '修改' : '详情'
@@ -100,7 +105,11 @@ export default {
         if (!valid) return;
         let API = this.type == 'add' ? parameterSaveAPI : updateParameterAPI
         await API(this.dialogForm)
-        await this.$store.dispatch('paramsSetData/setParamsDataInfo');
+        if (this.isQianKun) {
+          await this.$portalStore.dispatch('paramsSetData/setParamsDataInfo');
+        } else {
+          await this.$store.dispatch('paramsSetData/setParamsDataInfo');
+        }
         this.$message.success('操作成功')
         this.cancel();
         this.$emit('reload')

+ 11 - 0
src/views/system/parmasManage/index.vue

@@ -209,6 +209,11 @@ export default {
   },
   created() {
 
+  },
+  computed:{
+    isQianKun() {
+      return window.__POWERED_BY_QIANKUN__;
+    }
   },
   methods: {
     /* 表格数据源 */
@@ -225,6 +230,12 @@ export default {
           message: '修改成功',
           customClass: 'ele-message-border'
         });
+        if (this.isQianKun) {
+          await this.$portalStore.dispatch('paramsSetData/setParamsDataInfo');
+        } else {
+          await this.$store.dispatch('paramsSetData/setParamsDataInfo');
+        }
+
         //this.reload();
       }
     },