Update StockCard.vue
This commit is contained in:
@@ -139,7 +139,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, watch, ref } from 'vue';
|
import { computed, watch, ref } from 'vue';
|
||||||
import { NCard, NDivider, NSpin, NIcon, NTag, NButton, useMessage } from 'naive-ui';
|
import { NCard, NDivider, NIcon, NTag, NButton, useMessage } from 'naive-ui';
|
||||||
import {
|
import {
|
||||||
AlertCircleOutline as AlertCircleIcon,
|
AlertCircleOutline as AlertCircleIcon,
|
||||||
CalendarOutline,
|
CalendarOutline,
|
||||||
@@ -147,7 +147,7 @@ import {
|
|||||||
HourglassOutline,
|
HourglassOutline,
|
||||||
ReloadOutline
|
ReloadOutline
|
||||||
} from '@vicons/ionicons5';
|
} from '@vicons/ionicons5';
|
||||||
import { parseMarkdown, formatMarketValue as formatMarketValueFn } from '@/utils';
|
import { parseMarkdown } from '@/utils';
|
||||||
import type { StockInfo } from '@/types';
|
import type { StockInfo } from '@/types';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -252,11 +252,6 @@ function formatPriceChange(change: number | undefined | null): string {
|
|||||||
return `${sign}${change.toFixed(2)}`;
|
return `${sign}${change.toFixed(2)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatMarketValue(value: number | undefined | null): string {
|
|
||||||
if (value === undefined || value === null) return '--';
|
|
||||||
return formatMarketValueFn(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatDate(dateStr: string | undefined | null): string {
|
function formatDate(dateStr: string | undefined | null): string {
|
||||||
if (!dateStr) return '--';
|
if (!dateStr) return '--';
|
||||||
try {
|
try {
|
||||||
@@ -270,16 +265,6 @@ function formatDate(dateStr: string | undefined | null): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMarketName(marketType: string): string {
|
|
||||||
const marketMap: Record<string, string> = {
|
|
||||||
'A': 'A股',
|
|
||||||
'HK': '港股',
|
|
||||||
'US': '美股'
|
|
||||||
};
|
|
||||||
|
|
||||||
return marketMap[marketType] || marketType;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getScoreClass(score: number): string {
|
function getScoreClass(score: number): string {
|
||||||
if (score >= 80) return 'score-high';
|
if (score >= 80) return 'score-high';
|
||||||
if (score >= 70) return 'score-medium-high';
|
if (score >= 70) return 'score-medium-high';
|
||||||
|
|||||||
Reference in New Issue
Block a user