|
|
@@ -57,7 +57,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <a-button class="market" v-if="isFloat()" @click="openChartComponent">
|
|
|
+ <a-button class="market" v-if="isFloat()" @click="openComponent({ code: 'GoodsChart' })">
|
|
|
<div class="first">{{ selectedRow.goodscode }}</div>
|
|
|
<div class="last red">{{ getGoodsPrice() }}</div>
|
|
|
<LineChartOutlined />
|
|
|
@@ -77,8 +77,7 @@
|
|
|
<Buy :enumName="enumName" ref="buyRef" :time="time" :parantSelectedRow="selectedRow" :btnList="handleBtnList(buyMarket.btnList)" />
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
- <GoodsChart v-if="showChartComponent" :enumName="enumName" :selectedRow="quoteDayInfo" @cancel="closeChartComponent" />
|
|
|
- <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :goodsPrice="getGoodsPrice()" :enumName="enumName" :time="time" @cancel="closeComponent"> </component>
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="getSelectedRow()" :goodsPrice="getGoodsPrice()" :enumName="enumName" :time="time" @cancel="closeComponent"> </component>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -135,9 +134,6 @@ export default defineComponent({
|
|
|
const loading = ref<boolean>(false);
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
|
|
|
- const showChartComponent = ref(false); // 显示/隐藏图表
|
|
|
- const quoteDayInfo = ref<QueryQuoteDayRsp>(); // 盘口数据
|
|
|
-
|
|
|
const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
|
|
|
// 买卖大厅 配置数据
|
|
|
// 表格操作按钮列表
|
|
|
@@ -194,17 +190,15 @@ export default defineComponent({
|
|
|
// 单据挂牌成功 通知买大厅刷新数据
|
|
|
Bus.$on('spotTrade', queryFn);
|
|
|
|
|
|
- const openChartComponent = () => {
|
|
|
- quoteDayInfo.value = getQuoteDayInfoByCode(props.selectedRow.goodscode);
|
|
|
- if (quoteDayInfo.value) {
|
|
|
- showChartComponent.value = true;
|
|
|
- } else {
|
|
|
- console.error('盘口数据获取失败');
|
|
|
+ const quote = getQuoteDayInfoByCode(props.selectedRow.goodscode);
|
|
|
+ // 切换组件数据
|
|
|
+ const getSelectedRow = () => {
|
|
|
+ if (componentId.value === 'GoodsChart') {
|
|
|
+ return quote;
|
|
|
+ }
|
|
|
+ if (componentId.value === 'HisChart') {
|
|
|
+ return props.selectedRow;
|
|
|
}
|
|
|
- };
|
|
|
-
|
|
|
- const closeChartComponent = () => {
|
|
|
- showChartComponent.value = false;
|
|
|
};
|
|
|
|
|
|
return {
|
|
|
@@ -225,10 +219,7 @@ export default defineComponent({
|
|
|
handleBtnList,
|
|
|
isWR,
|
|
|
timeChange,
|
|
|
- quoteDayInfo,
|
|
|
- showChartComponent,
|
|
|
- openChartComponent,
|
|
|
- closeChartComponent,
|
|
|
+ getSelectedRow,
|
|
|
};
|
|
|
},
|
|
|
});
|