5
web/backend/go.sum
Normal file
5
web/backend/go.sum
Normal file
@@ -0,0 +1,5 @@
|
||||
github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||
modernc.org/sqlite v1.32.0/go.mod h1:UqoylwmTb9F+IqXERT8bW9zzOWN8qwAIcLdzeBZs4hA=
|
||||
@@ -22,6 +22,7 @@ func (d *Deps) ListScores(w http.ResponseWriter, r *http.Request) {
|
||||
TsCode: q.Get("ts_code"),
|
||||
Start: q.Get("start"),
|
||||
End: q.Get("end"),
|
||||
Signal: q.Get("signal"),
|
||||
Limit: limit,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -48,6 +48,7 @@ type ScoreFilter struct {
|
||||
TsCode string
|
||||
Start string
|
||||
End string
|
||||
Signal string
|
||||
Limit int
|
||||
}
|
||||
|
||||
@@ -69,6 +70,10 @@ func (s *FuturesStore) ListScores(f ScoreFilter) ([]Score, error) {
|
||||
q += " AND trade_date <= " + next()
|
||||
args = append(args, f.End)
|
||||
}
|
||||
if f.Signal != "" {
|
||||
q += " AND signal LIKE " + next()
|
||||
args = append(args, "%"+f.Signal+"%")
|
||||
}
|
||||
q += " ORDER BY trade_date DESC, id DESC"
|
||||
if f.Limit <= 0 || f.Limit > 500 {
|
||||
f.Limit = 200
|
||||
|
||||
@@ -49,6 +49,7 @@ export interface ScoreListParams {
|
||||
ts_code?: string
|
||||
start?: string
|
||||
end?: string
|
||||
signal?: string
|
||||
limit?: number
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,15 @@ import { listContracts, listScores, type Score } from '@/api/scores'
|
||||
import ScoreDetailDrawer from '@/components/ScoreDetailDrawer.vue'
|
||||
import { parseTsCode } from '@/utils/contract'
|
||||
|
||||
const filter = reactive<{ ts_code?: string; range: [string, string] | []; limit: number }>({
|
||||
const filter = reactive<{
|
||||
ts_code?: string
|
||||
range: [string, string] | []
|
||||
signal?: string
|
||||
limit: number
|
||||
}>({
|
||||
ts_code: undefined,
|
||||
range: [],
|
||||
signal: undefined,
|
||||
limit: 200,
|
||||
})
|
||||
|
||||
@@ -23,6 +29,7 @@ async function reload() {
|
||||
ts_code: filter.ts_code,
|
||||
start: start || undefined,
|
||||
end: end || undefined,
|
||||
signal: filter.signal,
|
||||
limit: filter.limit,
|
||||
})
|
||||
} finally {
|
||||
@@ -30,6 +37,11 @@ async function reload() {
|
||||
}
|
||||
}
|
||||
|
||||
function toggleSignal(s: string) {
|
||||
filter.signal = filter.signal === s ? undefined : s
|
||||
reload()
|
||||
}
|
||||
|
||||
function signalTagType(s: string) {
|
||||
if (s.includes('强烈看多')) return 'success'
|
||||
if (s.includes('偏多')) return ''
|
||||
@@ -75,6 +87,22 @@ onMounted(async () => {
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="loading" @click="reload">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="快捷">
|
||||
<el-button-group>
|
||||
<el-button
|
||||
:type="filter.signal === '强烈看多' ? 'success' : ''"
|
||||
@click="toggleSignal('强烈看多')"
|
||||
>
|
||||
强烈看多
|
||||
</el-button>
|
||||
<el-button
|
||||
:type="filter.signal === '强烈看空' ? 'danger' : ''"
|
||||
@click="toggleSignal('强烈看空')"
|
||||
>
|
||||
强烈看空
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user