修正
This commit is contained in:
Generated
+41
-1
@@ -11,9 +11,11 @@
|
|||||||
"@element-plus/icons-vue": "^2.3.2",
|
"@element-plus/icons-vue": "^2.3.2",
|
||||||
"axios": "^1.15.2",
|
"axios": "^1.15.2",
|
||||||
"element-plus": "^2.13.7",
|
"element-plus": "^2.13.7",
|
||||||
"vue": "^3.5.32"
|
"vue": "^3.5.32",
|
||||||
|
"vue-router": "^4.6.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^25.6.0",
|
||||||
"@vitejs/plugin-vue": "^6.0.6",
|
"@vitejs/plugin-vue": "^6.0.6",
|
||||||
"vite": "^8.0.10"
|
"vite": "^8.0.10"
|
||||||
}
|
}
|
||||||
@@ -495,6 +497,16 @@
|
|||||||
"@types/lodash": "*"
|
"@types/lodash": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "25.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.6.0.tgz",
|
||||||
|
"integrity": "sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"undici-types": "~7.19.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/web-bluetooth": {
|
"node_modules/@types/web-bluetooth": {
|
||||||
"version": "0.0.20",
|
"version": "0.0.20",
|
||||||
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
|
"resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.20.tgz",
|
||||||
@@ -568,6 +580,12 @@
|
|||||||
"@vue/shared": "3.5.33"
|
"@vue/shared": "3.5.33"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@vue/devtools-api": {
|
||||||
|
"version": "6.6.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
|
||||||
|
"integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@vue/reactivity": {
|
"node_modules/@vue/reactivity": {
|
||||||
"version": "3.5.33",
|
"version": "3.5.33",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.33.tgz",
|
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.33.tgz",
|
||||||
@@ -1498,6 +1516,13 @@
|
|||||||
"license": "0BSD",
|
"license": "0BSD",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"node_modules/undici-types": {
|
||||||
|
"version": "7.19.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.19.2.tgz",
|
||||||
|
"integrity": "sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "8.0.10",
|
"version": "8.0.10",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.0.10.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-8.0.10.tgz",
|
||||||
@@ -1602,6 +1627,21 @@
|
|||||||
"resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-3.2.7.tgz",
|
"resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-3.2.7.tgz",
|
||||||
"integrity": "sha512-+gPp5YGmhfsj1IN+xUo7y0fb4clfnOiiUA39y07yW1VzCRjzVgwLbtmdWlghh7mXrPsEaYc7rrIir/HT6C8vYQ==",
|
"integrity": "sha512-+gPp5YGmhfsj1IN+xUo7y0fb4clfnOiiUA39y07yW1VzCRjzVgwLbtmdWlghh7mXrPsEaYc7rrIir/HT6C8vYQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/vue-router": {
|
||||||
|
"version": "4.6.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.4.tgz",
|
||||||
|
"integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@vue/devtools-api": "^6.6.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/posva"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"vue": "^3.5.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -12,9 +12,11 @@
|
|||||||
"@element-plus/icons-vue": "^2.3.2",
|
"@element-plus/icons-vue": "^2.3.2",
|
||||||
"axios": "^1.15.2",
|
"axios": "^1.15.2",
|
||||||
"element-plus": "^2.13.7",
|
"element-plus": "^2.13.7",
|
||||||
"vue": "^3.5.32"
|
"vue": "^3.5.32",
|
||||||
|
"vue-router": "^4.6.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^25.6.0",
|
||||||
"@vitejs/plugin-vue": "^6.0.6",
|
"@vitejs/plugin-vue": "^6.0.6",
|
||||||
"vite": "^8.0.10"
|
"vite": "^8.0.10"
|
||||||
}
|
}
|
||||||
|
|||||||
+50
-28
@@ -51,21 +51,48 @@
|
|||||||
<el-table-column prop="code" label="代码" width="100" />
|
<el-table-column prop="code" label="代码" width="100" />
|
||||||
<el-table-column prop="name" label="名称" width="120" />
|
<el-table-column prop="name" label="名称" width="120" />
|
||||||
<el-table-column prop="day_open" label="当日开盘" align="right" />
|
<el-table-column prop="day_open" label="当日开盘" align="right" />
|
||||||
<el-table-column prop="max_high" label="区间最高" sortable align="right" />
|
<el-table-column
|
||||||
<el-table-column prop="max_date" label="最高日期" width="120" align="center" />
|
prop="max_high"
|
||||||
|
label="区间最高"
|
||||||
|
sortable
|
||||||
|
align="right"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="max_date"
|
||||||
|
label="最高日期"
|
||||||
|
width="120"
|
||||||
|
align="center"
|
||||||
|
/>
|
||||||
<el-table-column prop="post_min_low" label="见顶后最低" align="right" />
|
<el-table-column prop="post_min_low" label="见顶后最低" align="right" />
|
||||||
|
|
||||||
<el-table-column prop="drop_pct" label="最大回落幅度%" sortable align="right">
|
<el-table-column
|
||||||
|
prop="drop_pct"
|
||||||
|
label="最大回落幅度%"
|
||||||
|
sortable
|
||||||
|
align="right"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span class="text-success">{{ scope.row.drop_pct.toFixed(2) }}%</span>
|
<span v-if="scope.row.drop_pct !== null" class="text-success">
|
||||||
|
{{ scope.row.drop_pct.toFixed(2) }}%
|
||||||
|
</span>
|
||||||
|
<span v-else class="text-gray">--</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="rebound_pct" label="低位反弹%" sortable align="right">
|
<el-table-column
|
||||||
|
prop="rebound_pct"
|
||||||
|
label="低位反弹%"
|
||||||
|
sortable
|
||||||
|
align="right"
|
||||||
|
>
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span :class="scope.row.rebound_pct > 0 ? 'text-danger' : 'text-gray'">
|
<span
|
||||||
|
v-if="scope.row.rebound_pct !== null"
|
||||||
|
:class="scope.row.rebound_pct > 0 ? 'text-danger' : 'text-gray'"
|
||||||
|
>
|
||||||
{{ scope.row.rebound_pct.toFixed(2) }}%
|
{{ scope.row.rebound_pct.toFixed(2) }}%
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else class="text-gray">--</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -74,39 +101,38 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue'
|
import { ref } from "vue";
|
||||||
import { getAnalyzeData } from '@/api/stock'
|
import { getAnalyzeData } from "@/api/stock";
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
// 修改默认日期为 2026-04-22
|
const startDate = ref("2026-03-02");
|
||||||
const startDate = ref('2026-04-22')
|
const endDate = ref("2026-04-23");
|
||||||
const endDate = ref('2026-04-23')
|
const tableData = ref([]);
|
||||||
const tableData = ref([])
|
const loading = ref(false);
|
||||||
const loading = ref(false)
|
|
||||||
|
|
||||||
const fetchData = async () => {
|
const fetchData = async () => {
|
||||||
if (!startDate.value || !endDate.value) {
|
if (!startDate.value || !endDate.value) {
|
||||||
return ElMessage.warning('请选择日期')
|
return ElMessage.warning("请选择日期");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new Date(startDate.value) > new Date(endDate.value)) {
|
if (new Date(startDate.value) > new Date(endDate.value)) {
|
||||||
return ElMessage.warning('选定日期不能晚于结束日期')
|
return ElMessage.warning("选定日期不能晚于结束日期");
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const res = await getAnalyzeData({
|
const res = await getAnalyzeData({
|
||||||
start_date: startDate.value,
|
start_date: startDate.value,
|
||||||
end_date: endDate.value
|
end_date: endDate.value,
|
||||||
})
|
});
|
||||||
tableData.value = res.data
|
tableData.value = res.data;
|
||||||
ElMessage.success(`加载成功: ${res.data.length} 条数据`)
|
ElMessage.success(`加载成功: ${res.data.length} 条数据`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
ElMessage.error('数据获取失败')
|
ElMessage.error("数据获取失败");
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -135,21 +161,17 @@ const fetchData = async () => {
|
|||||||
color: #606266;
|
color: #606266;
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-success {
|
.text-success {
|
||||||
color: #67c23a;
|
color: #67c23a;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-danger {
|
.text-danger {
|
||||||
color: #f56c6c;
|
color: #f56c6c;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.text-gray {
|
.text-gray {
|
||||||
color: #909399;
|
color: #909399;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-table .cell) {
|
:deep(.el-table .cell) {
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user