li.shaoyi 2 年 前
コミット
a446584805

+ 85 - 41
src/packages/mobile/components/modules/quote/price/index.vue

@@ -10,7 +10,7 @@
                     <span :class="quote.lastColor">{{ parsePercent(quote.change) }}</span>
                 </div>
             </div>
-            <div class="block-right">
+            <div class="block-right" v-if="quote.marketid === 99201">
                 <ul>
                     <li>
                         <span>开盘</span>
@@ -24,59 +24,103 @@
                             {{ handleNumberValue(quote.highest.toFixed(quote.decimalplace)) }}
                         </span>
                     </li>
-                    <li v-if="quote.marketid != 99201">
-                        <span>涨停</span>
-                        <span class="g-price-up">{{ handleNumberValue(quote.limitup.toFixed(quote.decimalplace)) }}</span>
+                    <li>
+                        <span>最低</span>
+                        <span :class="quote.lowestColor">
+                            {{ handleNumberValue(quote.lowest.toFixed(quote.decimalplace)) }}
+                        </span>
                     </li>
                     <li>
                         <span>昨结</span>
                         <span>{{ handleNumberValue(quote.presettle.toFixed(quote.decimalplace)) }}</span>
                     </li>
                     <li>
+                        <span>均价</span>
+                        <span :class="quote.averagepriceColor">
+                            {{ handleNumberValue(quote.averageprice.toFixed(quote.decimalplace)) }}
+                        </span>
+                    </li>
+                    <li>
+                        <span>振幅</span>
+                        <span>{{ parsePercent(quote.amplitude) }}</span>
+                    </li>
+                </ul>
+            </div>
+            <div class="block-right" v-else>
+                <ul>
+                    <li>
+                        <span>开盘</span>
+                        <span :class="quote.openedColor">
+                            {{ handleNumberValue(quote.opened.toFixed(quote.decimalplace)) }}
+                        </span>
+                    </li>
+                    <li>
+                        <span>最高</span>
+                        <span :class="quote.highestColor">
+                            {{ handleNumberValue(quote.highest.toFixed(quote.decimalplace)) }}
+                        </span>
+                    </li>
+                    <li>
+                        <span>涨停</span>
+                        <span class="g-price-up">
+                            {{ handleNumberValue(quote.limitup.toFixed(quote.decimalplace)) }}
+                        </span>
+                    </li>
+                    <li>
+                        <span>昨结</span>
+                        <span>
+                            {{ handleNumberValue(quote.presettle.toFixed(quote.decimalplace)) }}
+                        </span>
+                    </li>
+                    <li>
                         <span>最低</span>
-                        <span :class="quote.lowestColor">{{ handleNumberValue(quote.lowest.toFixed(quote.decimalplace))
-                        }}</span>
+                        <span :class="quote.lowestColor">
+                            {{ handleNumberValue(quote.lowest.toFixed(quote.decimalplace)) }}
+                        </span>
                     </li>
-                    <li v-if="quote.marketid != 99201">
+                    <li>
                         <span>跌停</span>
-                        <span class="g-price-down">{{ handleNumberValue(quote.limitdown.toFixed(quote.decimalplace))
-                        }}</span>
+                        <span class="g-price-down">
+                            {{ handleNumberValue(quote.limitdown.toFixed(quote.decimalplace)) }}
+                        </span>
                     </li>
                 </ul>
             </div>
         </div>
-        <Divider @click="showMore = !showMore">
-            <Icon :name="showMore ? 'arrow-up' : 'arrow-down'" />
-        </Divider>
-        <div class="app-quote-price__more" v-if="quote">
-            <ul v-show="showMore">
-                <li v-if="quote.marketid != 99201">
-                    <span>买量</span>
-                    <span>{{ handleNumberValue(quote.bidvolume) }}</span>
-                </li>
-                <li v-if="quote.marketid != 99201">
-                    <span>卖量</span>
-                    <span>{{ handleNumberValue(quote.askvolume) }}</span>
-                </li>
-                <li v-if="quote.marketid != 99201">
-                    <span>买价</span>
-                    <span :class="quote.bidColor">{{ handleNumberValue(quote.bid.toFixed(quote.decimalplace)) }}</span>
-                </li>
-                <li v-if="quote.marketid != 99201">
-                    <span>卖价</span>
-                    <span :class="quote.askColor">{{ handleNumberValue(quote.ask.toFixed(quote.decimalplace)) }}</span>
-                </li>
-                <li>
-                    <span>均价</span>
-                    <span :class="quote.averagepriceColor">{{
-                        handleNumberValue(quote.averageprice.toFixed(quote.decimalplace)) }}</span>
-                </li>
-                <li>
-                    <span>振幅</span>
-                    <span>{{ parsePercent(quote.amplitude) }}</span>
-                </li>
-            </ul>
-        </div>
+        <template v-if="quote?.marketid !== 99201">
+            <Divider @click="showMore = !showMore">
+                <Icon :name="showMore ? 'arrow-up' : 'arrow-down'" />
+            </Divider>
+            <div class="app-quote-price__more" v-if="quote">
+                <ul v-show="showMore">
+                    <li>
+                        <span>买量</span>
+                        <span>{{ handleNumberValue(quote.bidvolume) }}</span>
+                    </li>
+                    <li>
+                        <span>卖量</span>
+                        <span>{{ handleNumberValue(quote.askvolume) }}</span>
+                    </li>
+                    <li>
+                        <span>买价</span>
+                        <span :class="quote.bidColor">{{ handleNumberValue(quote.bid.toFixed(quote.decimalplace)) }}</span>
+                    </li>
+                    <li>
+                        <span>卖价</span>
+                        <span :class="quote.askColor">{{ handleNumberValue(quote.ask.toFixed(quote.decimalplace)) }}</span>
+                    </li>
+                    <li>
+                        <span>均价</span>
+                        <span :class="quote.averagepriceColor">{{
+                            handleNumberValue(quote.averageprice.toFixed(quote.decimalplace)) }}</span>
+                    </li>
+                    <li>
+                        <span>振幅</span>
+                        <span>{{ parsePercent(quote.amplitude) }}</span>
+                    </li>
+                </ul>
+            </div>
+        </template>
     </div>
 </template>
 

+ 4 - 2
src/packages/pc/views/footer/goods/order/index.vue

@@ -1,7 +1,7 @@
 <!-- 商品订单- 委托 -->
 <template>
-    <app-table :data="tableList" selection-type="multiple" v-model:columns="tableColumns" :loading="loading"
-        @selection-change="onTableSelect" @cell-dblclick="onCancelSumit">
+    <app-table ref="tableRef" :data="tableList" selection-type="multiple" v-model:columns="tableColumns" :loading="loading"
+        @selection-change="onTableSelect" @row-dblclick="onCancelSumit">
         <template #headerRight>
             <div class="buttonbar">
                 <el-button type="primary" size="small" :disabled="selectedRows.length === 0"
@@ -52,6 +52,7 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const { tableList, showLoadMore, initTableData, loadMore } = useLocalPagination<Model.TradeOrderDetailRsp>()
+const tableRef = ref()
 const selectedRows = ref<Model.TradeOrderDetailRsp[]>([])
 
 const { dataList, loading, run, runAsync } = useRequest(queryTradeOrderDetail, {
@@ -82,6 +83,7 @@ const tableColumns = ref<Model.TableColumn[]>([
 /// 双击单据撤销
 const onCancelSumit = (row: Model.TradeOrderDetailRsp) => {
     selectedRows.value = [row]
+    tableRef.value?.elTable.toggleRowSelection(row, true) // 双击选中该行
     openComponent('cancel')
 }
 

+ 19 - 13
src/stores/modules/setting.ts

@@ -12,19 +12,25 @@ export const useSettingStore = defineStore(() => {
 
     const settingIndex = computed(() => settings.findIndex(((e) => e.loginId === loginStore.userId)))
 
-    const userSetting = computed<Model.LocalSetting>(() => (settings[settingIndex.value] ?? {
-        loginId: 0,
-        showOrderDialog: true,
-        showOrderSuccessMessage: true,
-        showOrderFailMessage: true,
-        showOrderEnableQty: false,
-        showOrderCancelDialog: true,
-        orderMaxQty: 10000000,
-        orderFocusType: 1,
-        orderPriceType: 1,
-        orderQtyIsEmpty: false,
-        orderBuyOrSell: 0,
-    }))
+    const userSetting = computed(() => {
+        const defaultValue: Model.LocalSetting = {
+            loginId: 0,
+            showOrderDialog: true,
+            showOrderSuccessMessage: true,
+            showOrderFailMessage: true,
+            showOrderEnableQty: false,
+            showOrderCancelDialog: true,
+            orderMaxQty: 10000000,
+            orderFocusType: 1,
+            orderPriceType: 1,
+            orderQtyIsEmpty: false,
+            orderBuyOrSell: 0,
+        }
+        return {
+            ...defaultValue,
+            ...settings[settingIndex.value]
+        }
+    })
 
     // 获取设置项值
     const getSettingValue = <K extends keyof Omit<Model.LocalSetting, 'loginId'>>(key: K) => {