mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
feat(frontend):增加股票名称点击事件打开行情页面
- 在 SelectStock 组件中添加了 openCenteredWindow 函数,用于打开居中窗口 - 点击股票名称时,会打开东方财富网的股票行情页面 - 优化了表格列的排序功能,支持数值类型的列进行排序- 调整了表格列的最小宽度,提高可读性
This commit is contained in:
parent
062df80712
commit
efe6365ea5
@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {h, onBeforeMount, onMounted, onUnmounted, ref} from 'vue'
|
import {h, onBeforeMount, onMounted, onUnmounted, ref} from 'vue'
|
||||||
import {SearchStock,GetHotStrategy} from "../../wailsjs/go/main/App";
|
import {SearchStock,GetHotStrategy} from "../../wailsjs/go/main/App";
|
||||||
import {useMessage, NText, NTag} from 'naive-ui'
|
import {useMessage, NText, NTag,NButton} from 'naive-ui'
|
||||||
import {RefreshCircleSharp} from "@vicons/ionicons5";
|
import {RefreshCircleSharp} from "@vicons/ionicons5";
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const search = ref('')
|
const search = ref('')
|
||||||
@ -40,7 +40,14 @@ function Search() {
|
|||||||
resizable: true,
|
resizable: true,
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
tooltip: true
|
tooltip: true
|
||||||
}
|
},
|
||||||
|
sorter: (row1, row2) => {
|
||||||
|
if(isNumeric(row1[item.key])&&isNumeric(row2[item.key])){
|
||||||
|
return row1[item.key] - row2[item.key];
|
||||||
|
}else{
|
||||||
|
return 'default'
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -49,11 +56,21 @@ function Search() {
|
|||||||
title:item.title+(item.unit?'['+item.unit+']':''),
|
title:item.title+(item.unit?'['+item.unit+']':''),
|
||||||
key:item.key,
|
key:item.key,
|
||||||
resizable: true,
|
resizable: true,
|
||||||
minWidth:100,
|
minWidth:120,
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
tooltip: true
|
tooltip: true
|
||||||
}
|
},
|
||||||
|
sorter: (row1, row2) => {
|
||||||
|
if(isNumeric(row1[item.key])&&isNumeric(row2[item.key])){
|
||||||
|
return row1[item.key] - row2[item.key];
|
||||||
|
}else{
|
||||||
|
return 'default'
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
dataList.value=res.data.result.dataList
|
dataList.value=res.data.result.dataList
|
||||||
@ -86,6 +103,16 @@ function DoSearch(question){
|
|||||||
Search()
|
Search()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openCenteredWindow(url, width, height) {
|
||||||
|
const left = (window.screen.width - width) / 2;
|
||||||
|
const top = (window.screen.height - height) / 2;
|
||||||
|
|
||||||
|
return window.open(
|
||||||
|
url,
|
||||||
|
'centeredWindow',
|
||||||
|
`width=${width},height=${height},left=${left},top=${top},location=no,menubar=no,toolbar=no,display=standalone`
|
||||||
|
);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@ -167,7 +194,9 @@ function DoSearch(question){
|
|||||||
return h(NText, { type: type }, { default: () => `${value}` })
|
return h(NText, { type: type }, { default: () => `${value}` })
|
||||||
}else{
|
}else{
|
||||||
if(column.key=='SECURITY_SHORT_NAME'){
|
if(column.key=='SECURITY_SHORT_NAME'){
|
||||||
return h(NTag, { type: 'info',bordered: false }, { default: () => `${value}` })
|
return h(NButton, { type: 'info',bordered: false ,size:'small',onClick:()=>{
|
||||||
|
openCenteredWindow(`https://quote.eastmoney.com/concept/${rowData.MARKET_SHORT_NAME}${rowData.SECURITY_CODE}.html`,1240,700)
|
||||||
|
}}, { default: () => `${value}` })
|
||||||
}else{
|
}else{
|
||||||
return h(NText, { type: 'info' }, { default: () => `${value}` })
|
return h(NText, { type: 'info' }, { default: () => `${value}` })
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user