|
|
@@ -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>
|