li.shaoyi il y a 3 ans
Parent
commit
d906d9cf51
2 fichiers modifiés avec 29 ajouts et 6 suppressions
  1. 1 1
      public/config/app.config.json
  2. 28 5
      src/views/order/swap_the_order/index.vue

+ 1 - 1
public/config/app.config.json

@@ -1,4 +1,4 @@
 {
-    "apiUrl": "http://218.17.158.45:21001/cfg?key=test_139",
+    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139",
     "icoTitle": "云融"
 }

+ 28 - 5
src/views/order/swap_the_order/index.vue

@@ -15,7 +15,7 @@
 </template>
 
 <script lang="ts">
-import { defineAsyncComponent, defineComponent, ref } from 'vue';
+import { defineAsyncComponent, defineComponent, ref, nextTick } from 'vue';
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
 import thirdMenu from '@/common/components/thirdMenu/index.vue';
 import { handleOrderDetailList } from '@/common/setup/order/orderData';
@@ -34,12 +34,35 @@ export default defineComponent({
     [BARGIN]: defineAsyncComponent(() => import('./components/swap_commodity_contract_bargain/index.vue')), // 议价单
   },
   setup() {
+    const bargainValue = ref<ApplyType>(ApplyType.my);
+    const state = handleOrderDetailList(enumOrderComponents.swap_the_order);
+
     // 切换 我的
     function changeBargain(value: ApplyType) {
       Bus.$emit('bargain', value);
     }
-    const bargainValue = ref<ApplyType>(ApplyType.my);
-    return { ...handleOrderDetailList(enumOrderComponents.swap_the_order), changeBargain, BARGIN, ApplyType, bargainValue };
-  },
-});
+
+    // 组件重载
+    function componentReload() {
+      const tmpComponent = state.componentId.value;
+      state.componentId.value = undefined;
+      nextTick(() => {
+        state.componentId.value = tmpComponent;
+      })
+    }
+
+    // 头寸变化,重新加载数据
+    Bus.$on('posChangedNtf_UI', () => {
+      componentReload();
+    })
+
+    return {
+      ...state,
+      changeBargain,
+      BARGIN,
+      ApplyType,
+      bargainValue
+    }
+  }
+})
 </script>