项目启动优化
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
# Vue 3 + Vite
|
||||
|
||||
# 运行项目使用:npm run dev
|
||||
# 运行项目使用
|
||||
|
||||
先启动后端服务,默认接口地址为 `http://127.0.0.1:18080`。
|
||||
|
||||
```sh
|
||||
npm run dev
|
||||
```
|
||||
|
||||
如果后端端口或地址不同,可以启动前端时覆盖代理目标:
|
||||
|
||||
```sh
|
||||
VITE_API_PROXY_TARGET=http://127.0.0.1:18080 npm run dev
|
||||
```
|
||||
|
||||
@@ -33,9 +33,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="筛选">
|
||||
<div class="checkbox-group">
|
||||
<el-checkbox v-model="tOpenGainLt101">
|
||||
T开盘小于1%
|
||||
</el-checkbox>
|
||||
<el-checkbox v-model="tOpenGainLt101"> T开盘小于1% </el-checkbox>
|
||||
<el-checkbox v-model="breakTimeBefore1100">
|
||||
11点前炸板
|
||||
</el-checkbox>
|
||||
@@ -124,7 +122,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatSignedPct(row.t_pct_chg) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatSignedPct(row.t_pct_chg)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="t_open_gain_lt_101"
|
||||
@@ -193,7 +193,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatSignedPct(row.next_high_profit_pct) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatSignedPct(row.next_high_profit_pct)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="next_open_pct_chg"
|
||||
@@ -202,7 +204,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatSignedPct(row.next_open_pct_chg) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatSignedPct(row.next_open_pct_chg)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="market"
|
||||
@@ -225,7 +229,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatPrice(row.t_open) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatPrice(row.t_open)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="t_open_pct_chg"
|
||||
@@ -234,7 +240,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatSignedPct(row.t_open_pct_chg) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatSignedPct(row.t_open_pct_chg)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="t_high"
|
||||
@@ -243,7 +251,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatPrice(row.t_high) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatPrice(row.t_high)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="t_close"
|
||||
@@ -252,7 +262,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatPrice(row.t_close) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatPrice(row.t_close)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="has_tushare_break_data"
|
||||
@@ -278,7 +290,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatPrice(row.next_open) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatPrice(row.next_open)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="next_high"
|
||||
@@ -287,7 +301,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatPrice(row.next_high) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatPrice(row.next_high)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="next_low"
|
||||
@@ -296,7 +312,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatPrice(row.next_low) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatPrice(row.next_low)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="next_close"
|
||||
@@ -305,7 +323,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatPrice(row.next_close) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatPrice(row.next_close)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="next_low_loss_pct"
|
||||
@@ -314,7 +334,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatSignedPct(row.next_low_loss_pct) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatSignedPct(row.next_low_loss_pct)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="next_close_pct_chg"
|
||||
@@ -323,7 +345,9 @@
|
||||
align="right"
|
||||
sortable
|
||||
>
|
||||
<template #default="{ row }">{{ formatSignedPct(row.next_close_pct_chg) }}</template>
|
||||
<template #default="{ row }">{{
|
||||
formatSignedPct(row.next_close_pct_chg)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
@@ -390,7 +414,9 @@ const paginationLayout = computed(() =>
|
||||
: "total, sizes, prev, pager, next, jumper",
|
||||
);
|
||||
|
||||
const paginationPagerCount = computed(() => (viewportWidth.value <= 820 ? 5 : 7));
|
||||
const paginationPagerCount = computed(() =>
|
||||
viewportWidth.value <= 820 ? 5 : 7,
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
window.addEventListener("resize", syncViewport);
|
||||
|
||||
+3
-1
@@ -2,6 +2,8 @@ import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import path from 'path'
|
||||
|
||||
const apiProxyTarget = process.env.VITE_API_PROXY_TARGET || 'http://127.0.0.1:18080'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
resolve: {
|
||||
@@ -12,7 +14,7 @@ export default defineConfig({
|
||||
port: 5173, // 你的端口号
|
||||
proxy: {
|
||||
'/api/v1': {
|
||||
target: 'http://localhost:18080',
|
||||
target: apiProxyTarget,
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user