mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
refactor(market-news):优化市场新闻API日志输出
- 注释掉 XUEQIUHotStock 的日志输出,减少不必要的日志信息 - 调整前端股票组件中的关注和 AI 分析逻辑 - 优化 AI 分析相关的用户交互和数据处理 - 美化模态框标题和按钮文案
This commit is contained in:
parent
7021a59ee6
commit
5b9a81d770
@ -599,7 +599,7 @@ func (m MarketNewsApi) XUEQIUHotStock(size int, marketType string) *[]models.Hot
|
|||||||
logger.SugaredLogger.Errorf("XUEQIUHotStock err:%s", err.Error())
|
logger.SugaredLogger.Errorf("XUEQIUHotStock err:%s", err.Error())
|
||||||
return &[]models.HotItem{}
|
return &[]models.HotItem{}
|
||||||
}
|
}
|
||||||
logger.SugaredLogger.Infof("XUEQIUHotStock:%+v", res)
|
//logger.SugaredLogger.Infof("XUEQIUHotStock:%+v", res)
|
||||||
return &res.Data.Items
|
return &res.Data.Items
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,8 +223,11 @@ onMounted(() => {
|
|||||||
if (!stocks.value.includes(followedStock.StockCode)) {
|
if (!stocks.value.includes(followedStock.StockCode)) {
|
||||||
stocks.value.push(followedStock.StockCode)
|
stocks.value.push(followedStock.StockCode)
|
||||||
}
|
}
|
||||||
|
Greet(followedStock.StockCode).then(result => {
|
||||||
|
updateData(result)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
monitor()
|
//monitor()
|
||||||
message.destroyAll()
|
message.destroyAll()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -464,6 +467,7 @@ function removeMonitor(code, name, key) {
|
|||||||
|
|
||||||
UnFollow(code).then(result => {
|
UnFollow(code).then(result => {
|
||||||
message.success(result)
|
message.success(result)
|
||||||
|
monitor()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,7 +585,6 @@ async function monitor() {
|
|||||||
showPopover.value = true
|
showPopover.value = true
|
||||||
}
|
}
|
||||||
for (let code of stocks.value) {
|
for (let code of stocks.value) {
|
||||||
|
|
||||||
Greet(code).then(result => {
|
Greet(code).then(result => {
|
||||||
updateData(result)
|
updateData(result)
|
||||||
})
|
})
|
||||||
@ -590,8 +593,7 @@ async function monitor() {
|
|||||||
|
|
||||||
|
|
||||||
function GetSortKey(sort, code) {
|
function GetSortKey(sort, code) {
|
||||||
let sortKey = padStart(sort, 8, '0') + "_" + code
|
return padStart(sort, 8, '0') + "_" + code
|
||||||
return sortKey
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSelect(item) {
|
function onSelect(item) {
|
||||||
@ -1383,12 +1385,12 @@ function aiCheckStock(stock, stockCode) {
|
|||||||
data.time = ""
|
data.time = ""
|
||||||
data.name = stock
|
data.name = stock
|
||||||
data.code = stockCode
|
data.code = stockCode
|
||||||
data.loading = true
|
data.loading = false
|
||||||
modalShow4.value = true
|
modalShow4.value = true
|
||||||
message.loading("ai检测中...", {
|
// message.loading("ai检测中...", {
|
||||||
duration: 0,
|
// duration: 0,
|
||||||
})
|
// })
|
||||||
NewChatStream(stock, stockCode, "", data.sysPromptId)
|
// NewChatStream(stock, stockCode, "", data.sysPromptId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1573,18 +1575,20 @@ function AddStockGroupInfo(groupId, code, name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateTab(name) {
|
function updateTab(name) {
|
||||||
|
stocks.value = []
|
||||||
currentGroupId.value = Number(name)
|
currentGroupId.value = Number(name)
|
||||||
GetFollowList(currentGroupId.value).then(result => {
|
GetFollowList(currentGroupId.value).then(result => {
|
||||||
stocks.value = []
|
|
||||||
followList.value = result
|
followList.value = result
|
||||||
for (const followedStock of result) {
|
for (const followedStock of result) {
|
||||||
if (followedStock.StockCode.startsWith("us")) {
|
if (followedStock.StockCode.startsWith("us")) {
|
||||||
followedStock.StockCode = "gb_" + followedStock.StockCode.replace("us", "").toLowerCase()
|
followedStock.StockCode = "gb_" + followedStock.StockCode.replace("us", "").toLowerCase()
|
||||||
}
|
}
|
||||||
////console.log("followList",followedStock.StockCode)
|
|
||||||
stocks.value.push(followedStock.StockCode)
|
stocks.value.push(followedStock.StockCode)
|
||||||
|
Greet(followedStock.StockCode).then(result => {
|
||||||
|
updateData(result)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
monitor()
|
//monitor()
|
||||||
message.destroyAll()
|
message.destroyAll()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1739,11 +1743,10 @@ function searchStockReport(stockCode) {
|
|||||||
@click="removeMonitor(result['股票代码'],result['股票名称'],result.key)">
|
@click="removeMonitor(result['股票代码'],result['股票名称'],result.key)">
|
||||||
取消关注
|
取消关注
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button size="tiny" v-if="data.openAiEnable" secondary type="warning"
|
|
||||||
@click="aiCheckStock(result['股票名称'],result['股票代码'])">
|
<n-button size="tiny" v-if="data.openAiEnable" secondary type="warning" @click="aiCheckStock(result['股票名称'],result['股票代码'])">
|
||||||
AI分析
|
AI分析
|
||||||
</n-button>
|
</n-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<n-flex justify="center">
|
<n-flex justify="center">
|
||||||
@ -1876,10 +1879,10 @@ function searchStockReport(stockCode) {
|
|||||||
@click="removeMonitor(result['股票代码'],result['股票名称'],result.key)">
|
@click="removeMonitor(result['股票代码'],result['股票名称'],result.key)">
|
||||||
取消关注
|
取消关注
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button size="tiny" v-if="data.openAiEnable" secondary type="warning"
|
|
||||||
@click="aiCheckStock(result['股票名称'],result['股票代码'])">
|
<n-button size="tiny" v-if="data.openAiEnable" secondary type="warning" @click="aiCheckStock(result['股票名称'],result['股票代码'])">
|
||||||
AI分析
|
AI分析
|
||||||
</n-button>
|
</n-button>
|
||||||
<n-button secondary type="error" size="tiny"
|
<n-button secondary type="error" size="tiny"
|
||||||
@click="delStockGroup(result['股票代码'],result['股票名称'],group.ID)">移出分组
|
@click="delStockGroup(result['股票代码'],result['股票名称'],group.ID)">移出分组
|
||||||
</n-button>
|
</n-button>
|
||||||
@ -2045,7 +2048,7 @@ function searchStockReport(stockCode) {
|
|||||||
</n-modal>
|
</n-modal>
|
||||||
|
|
||||||
<n-modal transform-origin="center" v-model:show="modalShow4" preset="card" style="width: 800px;"
|
<n-modal transform-origin="center" v-model:show="modalShow4" preset="card" style="width: 800px;"
|
||||||
:title="'['+data.name+']AI分析结果'">
|
:title="'['+data.name+']AI分析'">
|
||||||
<n-spin size="small" :show="data.loading">
|
<n-spin size="small" :show="data.loading">
|
||||||
<MdEditor v-if="enableEditor" :toolbars="toolbars" ref="mdEditorRef" style="height: 440px;text-align: left"
|
<MdEditor v-if="enableEditor" :toolbars="toolbars" ref="mdEditorRef" style="height: 440px;text-align: left"
|
||||||
:modelValue="data.airesult" :theme="theme">
|
:modelValue="data.airesult" :theme="theme">
|
||||||
@ -2087,7 +2090,7 @@ function searchStockReport(stockCode) {
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
<!-- <n-button size="tiny" type="error" @click="enableEditor=!enableEditor">编辑/预览</n-button>-->
|
<!-- <n-button size="tiny" type="error" @click="enableEditor=!enableEditor">编辑/预览</n-button>-->
|
||||||
<n-button size="tiny" type="warning" @click="aiReCheckStock(data.name,data.code)">再次分析</n-button>
|
<n-button size="tiny" type="warning" @click="aiReCheckStock(data.name,data.code)">开始AI分析</n-button>
|
||||||
<n-button size="tiny" type="info" @click="saveAsImage(data.name,data.code)">保存为图片</n-button>
|
<n-button size="tiny" type="info" @click="saveAsImage(data.name,data.code)">保存为图片</n-button>
|
||||||
<n-button size="tiny" type="success" @click="copyToClipboard">复制到剪切板</n-button>
|
<n-button size="tiny" type="success" @click="copyToClipboard">复制到剪切板</n-button>
|
||||||
<n-button size="tiny" type="primary" @click="saveAsMarkdown">保存为Markdown文件</n-button>
|
<n-button size="tiny" type="primary" @click="saveAsMarkdown">保存为Markdown文件</n-button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user