فهرست منبع

🐛 fix(build): resolve vue-tsc errors blocking production deploy

Fix missing get import, deposit network typing, unused withdraw helper,
staking amount formatting, DepositView selectedConfig ref, and
klinecharts v10 createIndicator API usage in spot/futures charts.

Co-authored-by: Cursor <cursoragent@cursor.com>
maotouying_cc 1 ماه پیش
والد
کامیت
f086dcf8fd

+ 1 - 1
code/src/api/staking.ts

@@ -1,4 +1,4 @@
-import { post, postForm } from '@/utils/request'
+import { get, post, postForm } from '@/utils/request'
 
 export interface StakingConfig {
   id: number

+ 6 - 3
code/src/stores/deposit.ts

@@ -78,14 +78,17 @@ export interface RechargeOrderListItem {
   updateTime: string
 }
 
+type NetworkRef = { id?: unknown; name?: unknown; protocol?: unknown }
+
 function mapConfigOption(row: Record<string, unknown>): RechargeConfigOption {
+  const network = row.network as NetworkRef | undefined
   return {
     networkConfigId: Number(row.networkConfigId ?? row.id ?? 0),
     coinName: String(row.coinName ?? ''),
     coinNameCn: String(row.coinNameCn ?? ''),
-    networkId: Number(row.networkId ?? row.network?.id ?? 0),
-    networkName: String(row.networkName ?? row.network?.name ?? ''),
-    protocol: String(row.protocol ?? row.network?.protocol ?? ''),
+    networkId: Number(row.networkId ?? network?.id ?? 0),
+    networkName: String(row.networkName ?? network?.name ?? ''),
+    protocol: String(row.protocol ?? network?.protocol ?? ''),
     contractAddress: String(row.contractAddress ?? ''),
     rechargeAddress: String(row.rechargeAddress ?? ''),
     sort: Number(row.sort ?? 0),

+ 0 - 11
code/src/stores/withdraw.ts

@@ -313,17 +313,6 @@ function mapWithdrawConfigFromDb(
   }
 }
 
-function sortWithdrawCoins(list: WithdrawCoinOption[]): WithdrawCoinOption[] {
-  return [...list].sort((a, b) => {
-    const oa = NETWORK_TAB_ORDER[a.networkLabel] ?? 99
-    const ob = NETWORK_TAB_ORDER[b.networkLabel] ?? 99
-    if (oa !== ob) {
-      return oa - ob
-    }
-    return a.displayName.localeCompare(b.displayName)
-  })
-}
-
 /**
  * 各链默认手续费 / 最小提币(仅当钱包与支持币种接口均未返回有效值时使用,与 App 展示对齐)
  */

+ 4 - 6
code/src/views/FuturesView.vue

@@ -451,7 +451,7 @@ function initChart() {
       name: 'MA',
       calcParams: [5, 10, 30],
       styles: { lines: [{ color: '#f0b90b', size: 1 }, { color: '#5d9cf5', size: 1 }, { color: '#e84d5b', size: 1 }] },
-    }, true, { id: 'candle_pane' })
+    }, { isStack: true, pane: { id: 'candle_pane' } })
   }
   if (showVol.value) {
 
@@ -462,8 +462,7 @@ function initChart() {
         lastValueMark: { show: false },
         tooltip: { showRule: 'none' },
       }},
-      false,
-      { id: 'vol-pane', height: 80, minHeight: 40 }
+      { isStack: false, pane: { id: 'vol-pane', height: 80, minHeight: 40 } },
     )
   }
 
@@ -545,7 +544,7 @@ watch(klines, updateChart)
 watch(showMA, (show) => {
   if (!chart) return
   if (show) {
-    chart.createIndicator({ name: 'MA', calcParams: [5, 10, 30], styles: { lines: [{ color: '#f0b90b', size: 1 }, { color: '#5d9cf5', size: 1 }, { color: '#e84d5b', size: 1 }] } }, true, { id: 'candle_pane' })
+    chart.createIndicator({ name: 'MA', calcParams: [5, 10, 30], styles: { lines: [{ color: '#f0b90b', size: 1 }, { color: '#5d9cf5', size: 1 }, { color: '#e84d5b', size: 1 }] } }, { isStack: true, pane: { id: 'candle_pane' } })
   } else {
     chart.removeIndicator({ name: 'MA', paneId: 'candle_pane' })
   }
@@ -561,8 +560,7 @@ watch(showVol, (show) => {
         lastValueMark: { show: false },
         tooltip: { showRule: 'none' },
       }},
-      false,
-      { id: 'vol-pane', height: 80, minHeight: 40 }
+      { isStack: false, pane: { id: 'vol-pane', height: 80, minHeight: 40 } },
     )
   } else {
     chart.removeIndicator({ name: 'VOL', paneId: 'vol-pane' })

+ 1 - 1
code/src/views/assets/AssetsView.vue

@@ -862,7 +862,7 @@ function formatStakingOrderAmount(
   value: string | number | undefined,
 ): string {
   if (obscure.value) return '****'
-  return `${fmt(value)} ${stakingOrderCoinUnit(order)}`
+  return `${fmt(value ?? 0)} ${stakingOrderCoinUnit(order)}`
 }
 
 function shortDate(value?: string) {

+ 1 - 0
code/src/views/assets/DepositView.vue

@@ -28,6 +28,7 @@ const {
   hashSubmitting,
   selectedParent,
   selectedNetwork,
+  selectedConfig,
 } = storeToRefs(store)
 
 const toast = useToast()

+ 4 - 6
code/src/views/spot/SpotView.vue

@@ -597,7 +597,7 @@ function initChart() {
     chart.createIndicator({
       name: 'MA', calcParams: [5, 10, 30],
       styles: { lines: [{ color: '#f0b90b', size: 1 }, { color: '#5d9cf5', size: 1 }, { color: '#e84d5b', size: 1 }] },
-    }, true, { id: 'candle_pane' })
+    }, { isStack: true, pane: { id: 'candle_pane' } })
   }
   if (showVol.value) {
     chart.createIndicator(
@@ -607,8 +607,7 @@ function initChart() {
         lastValueMark: { show: false },
         tooltip: { showRule: 'none' },
       }},
-      false,
-      { id: 'vol-pane', height: 80, minHeight: 40 },
+      { isStack: false, pane: { id: 'vol-pane', height: 80, minHeight: 40 } },
     )
   }
 
@@ -666,7 +665,7 @@ function zoomOut() { (chart as any)?.zoomAtCoordinate?.(0.8) }
 watch(showMA, (show) => {
   if (!chart) return
   if (show) {
-    chart.createIndicator({ name: 'MA', calcParams: [5, 10, 30], styles: { lines: [{ color: '#f0b90b', size: 1 }, { color: '#5d9cf5', size: 1 }, { color: '#e84d5b', size: 1 }] } }, true, { id: 'candle_pane' })
+    chart.createIndicator({ name: 'MA', calcParams: [5, 10, 30], styles: { lines: [{ color: '#f0b90b', size: 1 }, { color: '#5d9cf5', size: 1 }, { color: '#e84d5b', size: 1 }] } }, { isStack: true, pane: { id: 'candle_pane' } })
   } else {
     chart.removeIndicator({ name: 'MA', paneId: 'candle_pane' })
   }
@@ -680,8 +679,7 @@ watch(showVol, (show) => {
         lines: [{ size: 0, color: 'rgba(0,0,0,0)' }, { size: 0, color: 'rgba(0,0,0,0)' }, { size: 0, color: 'rgba(0,0,0,0)' }],
         lastValueMark: { show: false }, tooltip: { showRule: 'none' },
       }},
-      false,
-      { id: 'vol-pane', height: 80, minHeight: 40 },
+      { isStack: false, pane: { id: 'vol-pane', height: 80, minHeight: 40 } },
     )
   } else {
     chart.removeIndicator({ name: 'VOL', paneId: 'vol-pane' })