init: LOF 基金实时溢价监控系统
前后端分离项目,展示 LOF 基金的实时交易价格、溢价率和申购限额。 - 后端: FastAPI + akshare + pandas - 前端: Vue 3 + Vite + Element Plus + Axios
This commit is contained in:
commit
f23ffa7610
19
.gitignore
vendored
Normal file
19
.gitignore
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
venv/
|
||||
.env
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
|
||||
# npm cache
|
||||
.npm-cache/
|
||||
|
||||
# virtual environments
|
||||
venv*/
|
||||
venv/
|
||||
167
README.md
Normal file
167
README.md
Normal file
@ -0,0 +1,167 @@
|
||||
# LOF 实时数据查询系统
|
||||
|
||||
前后端分离项目,展示 LOF 基金的实时交易价格、溢价率和申购限额。
|
||||
|
||||
## 技术栈
|
||||
|
||||
| 端 | 技术 |
|
||||
|---|---|
|
||||
| 前端 | Vue 3 + Vite + Element Plus + Axios |
|
||||
| 后端 | FastAPI + Uvicorn + akshare + pandas |
|
||||
|
||||
---
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
lof_project/
|
||||
├── back/ # 后端服务
|
||||
│ ├── main.py # FastAPI 主程序
|
||||
│ └── requirements.txt
|
||||
├── front/ # 前端项目
|
||||
│ └── vite-project/
|
||||
│ ├── package.json
|
||||
│ └── src/
|
||||
└── README.md
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 一、后端服务
|
||||
|
||||
### 前置要求
|
||||
|
||||
- Python 3.10+([下载地址](https://www.python.org/downloads/))
|
||||
|
||||
### 1. 安装依赖
|
||||
|
||||
```bash
|
||||
cd back
|
||||
|
||||
# 创建虚拟环境(推荐)
|
||||
python -m venv venv
|
||||
|
||||
# 激活虚拟环境
|
||||
# macOS / Linux
|
||||
source venv/bin/activate
|
||||
|
||||
# Windows
|
||||
venv\Scripts\activate
|
||||
|
||||
# 安装依赖
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
### 2. 启动服务
|
||||
|
||||
```bash
|
||||
# 确保在 back 目录且虚拟环境已激活
|
||||
source venv/bin/activate
|
||||
|
||||
uvicorn main:app --reload --port 8000
|
||||
```
|
||||
|
||||
- `main:app` — `main.py` 中的 `app` 实例
|
||||
- `--reload` — 开发模式,代码修改自动重启
|
||||
- `--port 8000` — 服务端口
|
||||
|
||||
### 3. 验证
|
||||
|
||||
- API 文档:[http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs)
|
||||
- LOF 数据接口:[http://127.0.0.1:8000/api/lof](http://127.0.0.1:8000/api/lof)
|
||||
|
||||
---
|
||||
|
||||
## 二、前端服务
|
||||
|
||||
> **前置要求**:电脑上需安装 [nvm](https://github.com/nvm-sh/nvm)(Node 版本管理工具)。
|
||||
|
||||
### 1. 切换 Node 版本
|
||||
|
||||
前端项目通过 `.nvmrc` 文件锁定 Node 版本(当前为 `v22.21.1`)。
|
||||
|
||||
**macOS / Linux:**
|
||||
|
||||
```bash
|
||||
cd front/vite-project
|
||||
|
||||
# 自动读取 .nvmrc 中的版本并切换
|
||||
nvm use
|
||||
|
||||
# 如果该版本未安装,先安装再切换
|
||||
nvm install
|
||||
nvm use
|
||||
```
|
||||
|
||||
**Windows:**
|
||||
|
||||
Windows 版 nvm 不支持自动读取 `.nvmrc`,需显式指定版本号:
|
||||
|
||||
```bash
|
||||
cd front/vite-project
|
||||
|
||||
nvm install v22.21.1
|
||||
nvm use v22.21.1
|
||||
```
|
||||
|
||||
### 2. 安装依赖
|
||||
|
||||
```bash
|
||||
npm install
|
||||
```
|
||||
|
||||
### 3. 启动服务
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
默认运行在 [http://localhost:5173](http://localhost:5173)
|
||||
|
||||
### 3. 构建生产包
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 三、接口说明
|
||||
|
||||
### GET `/api/lof`
|
||||
|
||||
获取全量 LOF 实时数据。
|
||||
|
||||
**返回字段:**
|
||||
|
||||
| 字段 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| `fundCode` | string | 基金代码 |
|
||||
| `fundName` | string | 基金名称 |
|
||||
| `tradePrice` | number | 最新交易价 |
|
||||
| `increaseRate` | number | 涨跌幅(%)|
|
||||
| `netValue` | number | 最新净值 |
|
||||
| `premiumRate` | number | 溢价率(%)|
|
||||
| `purchaseLimit` | string | 日申购限额 |
|
||||
| `purchaseStatus` | string | 申购状态 |
|
||||
|
||||
**限额显示规则:**
|
||||
- `不限` — 日限额 ≥ 1 亿
|
||||
- `暂停申购` — 日限额为 0
|
||||
- `xx元/日` — 日限额 < 1 万
|
||||
- `xx万/日` — 日限额 ≥ 1 万
|
||||
|
||||
---
|
||||
|
||||
## 四、常见问题
|
||||
|
||||
### 1. 后端端口被占用
|
||||
|
||||
```bash
|
||||
# 查找占用 8000 端口的进程并结束
|
||||
lsof -ti:8000 | xargs kill -9
|
||||
```
|
||||
|
||||
### 2. 前端请求后端接口失败
|
||||
|
||||
确保后端服务已启动,且 CORS 配置正确(默认允许所有来源)。
|
||||
242
back/main.py
Normal file
242
back/main.py
Normal file
@ -0,0 +1,242 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
import akshare as ak
|
||||
import pandas as pd
|
||||
import logging
|
||||
import concurrent.futures
|
||||
import requests
|
||||
|
||||
# 配置日志
|
||||
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
# 缓存最近一次成功的数据
|
||||
cache_data = {"data": [], "time": None}
|
||||
|
||||
# 解决跨域,让 Vue 能调用
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
def format_limit(value):
|
||||
"""格式化限额显示"""
|
||||
if pd.isna(value):
|
||||
return "-"
|
||||
if value == 0:
|
||||
return "-"
|
||||
if value >= 1e8:
|
||||
return "不限"
|
||||
if value < 10000:
|
||||
return f"{value:.0f}元/日"
|
||||
return f"{value / 10000:.0f}万/日"
|
||||
|
||||
|
||||
def format_amount(value):
|
||||
"""格式化金额:成交额/总市值"""
|
||||
if pd.isna(value):
|
||||
return "-"
|
||||
if value >= 1e8:
|
||||
return f"{value / 1e8:.2f}亿"
|
||||
if value >= 1e4:
|
||||
return f"{value / 1e4:.2f}万"
|
||||
return f"{value:.0f}"
|
||||
|
||||
|
||||
def fetch_spot_data():
|
||||
"""获取 LOF 实时交易数据(直接请求东方财富接口,绕过 akshare 失效域名)"""
|
||||
url = "https://push2delay.eastmoney.com/api/qt/clist/get"
|
||||
base_params = {
|
||||
"pn": "1",
|
||||
"pz": "100",
|
||||
"po": "1",
|
||||
"np": "1",
|
||||
"ut": "bd1d9ddb04089700cf9c27f6f7426281",
|
||||
"fltt": "2",
|
||||
"invt": "2",
|
||||
"wbp2u": "|0|0|0|web",
|
||||
"fid": "f3",
|
||||
"fs": "b:MK0404,b:MK0405,b:MK0406,b:MK0407",
|
||||
"fields": "f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f12,f13,f14,f15,f16,f17,f18,f20,f21,f23,f24,f25,f22,f11,f62,f128,f136,f115,f152",
|
||||
}
|
||||
|
||||
# 获取第一页
|
||||
r = requests.get(url, params=base_params, timeout=30)
|
||||
r.raise_for_status()
|
||||
data_json = r.json()
|
||||
per_page_num = len(data_json["data"]["diff"])
|
||||
total_page = (data_json["data"]["total"] + per_page_num - 1) // per_page_num
|
||||
|
||||
temp_list = [pd.DataFrame(data_json["data"]["diff"])]
|
||||
|
||||
# 获取剩余页面
|
||||
for page in range(2, total_page + 1):
|
||||
params = base_params.copy()
|
||||
params["pn"] = str(page)
|
||||
r = requests.get(url, params=params, timeout=30)
|
||||
r.raise_for_status()
|
||||
data_json = r.json()
|
||||
temp_list.append(pd.DataFrame(data_json["data"]["diff"]))
|
||||
|
||||
temp_df = pd.concat(temp_list, ignore_index=True)
|
||||
temp_df.rename(
|
||||
columns={
|
||||
"f12": "代码",
|
||||
"f14": "名称",
|
||||
"f2": "最新价",
|
||||
"f4": "涨跌额",
|
||||
"f3": "涨跌幅",
|
||||
"f5": "成交量",
|
||||
"f6": "成交额",
|
||||
"f17": "开盘价",
|
||||
"f15": "最高价",
|
||||
"f16": "最低价",
|
||||
"f18": "昨收",
|
||||
"f20": "总市值",
|
||||
},
|
||||
inplace=True,
|
||||
)
|
||||
# 数值类型转换
|
||||
numeric_cols = ["最新价", "涨跌额", "涨跌幅", "成交量", "成交额", "开盘价", "最高价", "最低价", "昨收", "总市值"]
|
||||
for col in numeric_cols:
|
||||
if col in temp_df.columns:
|
||||
temp_df[col] = pd.to_numeric(temp_df[col], errors="coerce")
|
||||
return temp_df
|
||||
|
||||
|
||||
def fetch_purchase_data():
|
||||
"""获取基金净值和限额信息"""
|
||||
df = ak.fund_purchase_em()
|
||||
return df[["基金代码", "最新净值/万份收益", "日累计限定金额", "申购状态"]]
|
||||
|
||||
|
||||
def fetch_estimate_data():
|
||||
"""获取基金实时估算净值(东方财富估值数据)"""
|
||||
try:
|
||||
df = ak.fund_value_estimation_em()
|
||||
# 列名格式如:2026-05-07-估算数据-估算值,每天日期会变,需要模糊匹配
|
||||
estimate_col = [c for c in df.columns if "估算数据-估算值" in c]
|
||||
if not estimate_col:
|
||||
logger.warning("未找到估算净值列,返回空数据")
|
||||
return pd.DataFrame(columns=["基金代码", "估算净值"])
|
||||
df = df.rename(columns={estimate_col[0]: "估算净值"})
|
||||
df["估算净值"] = pd.to_numeric(df["估算净值"], errors="coerce")
|
||||
return df[["基金代码", "估算净值"]].copy()
|
||||
except Exception as e:
|
||||
logger.warning("获取估算净值失败:%s", e)
|
||||
return pd.DataFrame(columns=["基金代码", "估算净值"])
|
||||
|
||||
|
||||
@app.get("/api/lof")
|
||||
def get_lof_data():
|
||||
"""获取 LOF 实时数据 + 溢价率 + 限额"""
|
||||
global cache_data
|
||||
try:
|
||||
logger.info("开始获取 LOF 数据...")
|
||||
|
||||
# 1. 获取 LOF 实时交易数据(带 30 秒超时)
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
|
||||
future = executor.submit(fetch_spot_data)
|
||||
spot = future.result(timeout=30)
|
||||
logger.info("LOF 实时数据获取成功,共 %d 条", len(spot))
|
||||
|
||||
# 2. 获取基金净值和限额信息(带 30 秒超时)
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
|
||||
future = executor.submit(fetch_purchase_data)
|
||||
purchase = future.result(timeout=30)
|
||||
logger.info("基金净值/限额数据获取成功,共 %d 条", len(purchase))
|
||||
|
||||
# 2.5 获取实时估算净值(带 30 秒超时)
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
|
||||
future = executor.submit(fetch_estimate_data)
|
||||
estimate = future.result(timeout=30)
|
||||
logger.info("基金估算净值获取成功,共 %d 条", len(estimate))
|
||||
|
||||
# 3. 合并数据
|
||||
df = spot.merge(
|
||||
purchase,
|
||||
left_on="代码",
|
||||
right_on="基金代码",
|
||||
how="left"
|
||||
).merge(
|
||||
estimate,
|
||||
left_on="代码",
|
||||
right_on="基金代码",
|
||||
how="left"
|
||||
)
|
||||
|
||||
# 4. 计算溢价率
|
||||
# 静态溢价率:基于最新公布的收盘净值(通常是昨日)
|
||||
df["溢价率"] = (
|
||||
(df["最新价"] - df["最新净值/万份收益"])
|
||||
/ df["最新净值/万份收益"]
|
||||
* 100
|
||||
).round(2)
|
||||
|
||||
# 动态溢价率(估算溢价率):基于实时估算净值,交易时间内更真实
|
||||
df["估算溢价率"] = (
|
||||
(df["最新价"] - df["估算净值"])
|
||||
/ df["估算净值"]
|
||||
* 100
|
||||
).round(2)
|
||||
|
||||
# 5. 格式化限额
|
||||
df["限额"] = df["日累计限定金额"].apply(format_limit)
|
||||
|
||||
# 6. 格式化总市值和成交额
|
||||
df["总市值_格式化"] = df["总市值"].apply(format_amount)
|
||||
df["成交额_格式化"] = df["成交额"].apply(format_amount)
|
||||
|
||||
# 7. 只保留需要的字段
|
||||
df = df[[
|
||||
"代码", "名称", "最新价", "涨跌幅",
|
||||
"最新净值/万份收益", "估算净值", "溢价率", "估算溢价率",
|
||||
"限额", "申购状态",
|
||||
"总市值_格式化", "成交量", "成交额_格式化"
|
||||
]]
|
||||
|
||||
# 8. 格式化字段名(给前端用)
|
||||
df.columns = [
|
||||
"fundCode",
|
||||
"fundName",
|
||||
"tradePrice",
|
||||
"increaseRate",
|
||||
"netValue",
|
||||
"estimateValue",
|
||||
"premiumRate",
|
||||
"estimatePremiumRate",
|
||||
"purchaseLimit",
|
||||
"purchaseStatus",
|
||||
"fundSize",
|
||||
"volume",
|
||||
"turnover"
|
||||
]
|
||||
|
||||
# 8. 处理 NaN 值,避免 JSON 序列化失败
|
||||
df = df.replace({pd.NA: "-"})
|
||||
df = df.where(pd.notnull(df), "-")
|
||||
|
||||
# 9. 转成 JSON 格式
|
||||
data = df.to_dict(orient="records")
|
||||
cache_data = {"data": data, "time": pd.Timestamp.now()}
|
||||
logger.info("数据返回成功,共 %d 条", len(data))
|
||||
return {"code": 200, "data": data}
|
||||
|
||||
except concurrent.futures.TimeoutError:
|
||||
logger.error("请求 akshare 数据源超时(超过 30 秒)")
|
||||
if cache_data["data"]:
|
||||
logger.info("返回缓存数据,缓存时间:%s", cache_data["time"])
|
||||
return {"code": 200, "data": cache_data["data"], "cached": True}
|
||||
return {"code": 500, "msg": "数据获取超时,请稍后重试"}
|
||||
|
||||
except Exception as e:
|
||||
logger.exception("数据获取失败")
|
||||
if cache_data["data"]:
|
||||
logger.info("返回缓存数据,缓存时间:%s", cache_data["time"])
|
||||
return {"code": 200, "data": cache_data["data"], "cached": True}
|
||||
return {"code": 500, "msg": f"数据获取失败:{str(e)}"}
|
||||
4
back/requirements.txt
Normal file
4
back/requirements.txt
Normal file
@ -0,0 +1,4 @@
|
||||
fastapi
|
||||
uvicorn
|
||||
akshare
|
||||
pandas
|
||||
24
front/vite-project/.gitignore
vendored
Normal file
24
front/vite-project/.gitignore
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
1
front/vite-project/.nvmrc
Normal file
1
front/vite-project/.nvmrc
Normal file
@ -0,0 +1 @@
|
||||
v22.21.1
|
||||
3
front/vite-project/.vscode/extensions.json
vendored
Normal file
3
front/vite-project/.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"recommendations": ["Vue.volar"]
|
||||
}
|
||||
5
front/vite-project/README.md
Normal file
5
front/vite-project/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Vue 3 + Vite
|
||||
|
||||
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
||||
|
||||
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).
|
||||
13
front/vite-project/index.html
Normal file
13
front/vite-project/index.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>vite-project</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
1576
front/vite-project/package-lock.json
generated
Normal file
1576
front/vite-project/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
20
front/vite-project/package.json
Normal file
20
front/vite-project/package.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "vite-project",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.16.0",
|
||||
"element-plus": "^2.13.7",
|
||||
"vue": "^3.5.32"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^6.0.6",
|
||||
"vite": "^8.0.10"
|
||||
}
|
||||
}
|
||||
1
front/vite-project/public/favicon.svg
Normal file
1
front/vite-project/public/favicon.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 9.3 KiB |
24
front/vite-project/public/icons.svg
Normal file
24
front/vite-project/public/icons.svg
Normal file
@ -0,0 +1,24 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<symbol id="bluesky-icon" viewBox="0 0 16 17">
|
||||
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
|
||||
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
|
||||
</symbol>
|
||||
<symbol id="discord-icon" viewBox="0 0 20 19">
|
||||
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
|
||||
</symbol>
|
||||
<symbol id="documentation-icon" viewBox="0 0 21 20">
|
||||
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
|
||||
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
|
||||
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
|
||||
</symbol>
|
||||
<symbol id="github-icon" viewBox="0 0 19 19">
|
||||
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
|
||||
</symbol>
|
||||
<symbol id="social-icon" viewBox="0 0 20 20">
|
||||
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
|
||||
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
|
||||
</symbol>
|
||||
<symbol id="x-icon" viewBox="0 0 19 19">
|
||||
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
|
||||
</symbol>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.9 KiB |
237
front/vite-project/src/App.vue
Normal file
237
front/vite-project/src/App.vue
Normal file
@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<div class="lof-app">
|
||||
<div class="header">
|
||||
<div class="title">
|
||||
<h2>LOF 基金实时溢价监控</h2>
|
||||
<span class="update-time">数据更新时间:{{ lastUpdateTime }}</span>
|
||||
</div>
|
||||
<div class="tool-bar">
|
||||
<div class="refresh">
|
||||
<el-button @click="manualRefresh" :loading="loading" type="primary" :icon="Refresh">
|
||||
手动刷新
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="sort">
|
||||
<span class="sort-label">排序依据</span>
|
||||
<el-button @click="toggleSortField" :disabled="loading" size="small">
|
||||
{{ sortField === 'premiumRate' ? '按昨日净值溢价' : '按实时估算溢价' }}
|
||||
</el-button>
|
||||
<el-button @click="toggleSort" :disabled="loading" size="small">
|
||||
{{ sortType === 'desc' ? '▼ 从高到低' : '▲ 从低到高' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="filter-bar">
|
||||
<el-input v-model="searchCode" placeholder="基金代码" clearable style="width: 160px;" />
|
||||
<el-input v-model="searchName" placeholder="基金名称" clearable style="width: 200px;" />
|
||||
<el-select v-model="filterStatus" placeholder="申购状态" clearable style="width: 140px;">
|
||||
<el-option v-for="s in statusOptions" :key="s" :label="s" :value="s" />
|
||||
</el-select>
|
||||
<el-button @click="resetFilter" :icon="RefreshRight">重置</el-button>
|
||||
</div>
|
||||
|
||||
<el-table :data="displayList" v-loading="loading" height="700" border>
|
||||
<el-table-column prop="fundCode" label="基金代码" align="center" />
|
||||
<el-table-column prop="fundName" label="基金名称" align="center" />
|
||||
<el-table-column prop="tradePrice" label="场内价格" align="center" />
|
||||
<el-table-column prop="netValue" label="场外净值(昨日)" align="center" />
|
||||
<el-table-column prop="estimateValue" label="估算净值(实时)" align="center" />
|
||||
<el-table-column label="涨跌幅" align="center">
|
||||
<template #default="{ row }">
|
||||
<span :class="getRateClass(row.increaseRate)">
|
||||
{{ row.increaseRate }}%
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="溢价率(昨日)" align="center">
|
||||
<template #default="{ row }">
|
||||
<span :class="getRateClass(row.premiumRate)">
|
||||
{{ row.premiumRate }}%
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="溢价率(实时)" align="center">
|
||||
<template #default="{ row }">
|
||||
<span :class="getRateClass(row.estimatePremiumRate)">
|
||||
{{ row.estimatePremiumRate }}%
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="purchaseLimit" label="日限额" align="center" />
|
||||
<el-table-column label="申购状态" align="center" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.purchaseStatus === '暂停申购' ? 'danger' : row.purchaseStatus === '开放申购' ? 'success' : 'info'" size="small" style="white-space: nowrap;">
|
||||
{{ row.purchaseStatus }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="fundSize" label="基金规模" align="center" />
|
||||
<el-table-column prop="turnover" label="成交额" align="center" />
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, computed } from 'vue'
|
||||
import axios from 'axios'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Refresh, RefreshRight } from '@element-plus/icons-vue'
|
||||
|
||||
// 后端接口地址
|
||||
const API_URL = 'http://127.0.0.1:8000/api/lof'
|
||||
|
||||
const fundList = ref([])
|
||||
const loading = ref(false)
|
||||
const sortType = ref('desc')
|
||||
const sortField = ref('premiumRate')
|
||||
const searchCode = ref('')
|
||||
const searchName = ref('')
|
||||
const filterStatus = ref('')
|
||||
const lastUpdateTime = ref('')
|
||||
|
||||
function formatTime(date) {
|
||||
const pad = n => String(n).padStart(2, '0')
|
||||
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`
|
||||
}
|
||||
|
||||
// 申购状态选项
|
||||
const statusOptions = computed(() => {
|
||||
const set = new Set(fundList.value.map(i => i.purchaseStatus).filter(Boolean))
|
||||
return Array.from(set).sort()
|
||||
})
|
||||
|
||||
// 筛选 + 排序
|
||||
const displayList = computed(() => {
|
||||
let list = [...fundList.value]
|
||||
if (searchCode.value) {
|
||||
list = list.filter(i => String(i.fundCode).includes(searchCode.value.trim()))
|
||||
}
|
||||
if (searchName.value) {
|
||||
list = list.filter(i => String(i.fundName).includes(searchName.value.trim()))
|
||||
}
|
||||
if (filterStatus.value) {
|
||||
list = list.filter(i => i.purchaseStatus === filterStatus.value)
|
||||
}
|
||||
list.sort((a, b) => {
|
||||
const field = sortField.value
|
||||
const pa = parseFloat(a[field]) || 0
|
||||
const pb = parseFloat(b[field]) || 0
|
||||
return sortType.value === 'desc' ? pb - pa : pa - pb
|
||||
})
|
||||
return list
|
||||
})
|
||||
|
||||
function resetFilter() {
|
||||
searchCode.value = ''
|
||||
searchName.value = ''
|
||||
filterStatus.value = ''
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
async function fetchData() {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await axios.get(API_URL)
|
||||
if (res.data.code === 200) {
|
||||
fundList.value = res.data.data
|
||||
lastUpdateTime.value = formatTime(new Date())
|
||||
} else {
|
||||
ElMessage.error(res.data.msg || '数据获取失败')
|
||||
}
|
||||
} catch (err) {
|
||||
ElMessage.error('请求失败:请确认 Python 后端已启动')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 手动刷新
|
||||
function manualRefresh() {
|
||||
fetchData()
|
||||
}
|
||||
|
||||
// 切换排序
|
||||
function toggleSort() {
|
||||
sortType.value = sortType.value === 'desc' ? 'asc' : 'desc'
|
||||
}
|
||||
|
||||
function toggleSortField() {
|
||||
sortField.value = sortField.value === 'premiumRate' ? 'estimatePremiumRate' : 'premiumRate'
|
||||
}
|
||||
|
||||
// 颜色样式
|
||||
function getRateClass(rate) {
|
||||
const num = parseFloat(rate) || 0
|
||||
if (num > 0) return 'rate-up'
|
||||
if (num < 0) return 'rate-down'
|
||||
return 'rate-zero'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.lof-app {
|
||||
max-width: 100%;
|
||||
/* margin: 20px auto; */
|
||||
padding: 24px;
|
||||
}
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.title {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
.update-time {
|
||||
font-size: 13px;
|
||||
color: #999;
|
||||
text-align: left;
|
||||
}
|
||||
.tool-bar {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
}
|
||||
button {
|
||||
padding: 4px 10px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
.sort {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.sort-label {
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.filter-bar {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-bottom: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.rate-up {
|
||||
color: #f53f3f;
|
||||
font-weight: bold;
|
||||
}
|
||||
.rate-down {
|
||||
color: #009944;
|
||||
font-weight: bold;
|
||||
}
|
||||
.rate-zero {
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
BIN
front/vite-project/src/assets/hero.png
Normal file
BIN
front/vite-project/src/assets/hero.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
1
front/vite-project/src/assets/vite.svg
Normal file
1
front/vite-project/src/assets/vite.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 8.5 KiB |
1
front/vite-project/src/assets/vue.svg
Normal file
1
front/vite-project/src/assets/vue.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 496 B |
95
front/vite-project/src/components/HelloWorld.vue
Normal file
95
front/vite-project/src/components/HelloWorld.vue
Normal file
@ -0,0 +1,95 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import viteLogo from '../assets/vite.svg'
|
||||
import heroImg from '../assets/hero.png'
|
||||
import vueLogo from '../assets/vue.svg'
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section id="center">
|
||||
<div class="hero">
|
||||
<img :src="heroImg" class="base" width="170" height="179" alt="" />
|
||||
<img :src="vueLogo" class="framework" alt="Vue logo" />
|
||||
<img :src="viteLogo" class="vite" alt="Vite logo" />
|
||||
</div>
|
||||
<div>
|
||||
<h1>Get started</h1>
|
||||
<p>Edit <code>src/App.vue</code> and save to test <code>HMR</code></p>
|
||||
</div>
|
||||
<button type="button" class="counter" @click="count++">
|
||||
Count is {{ count }}
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<div class="ticks"></div>
|
||||
|
||||
<section id="next-steps">
|
||||
<div id="docs">
|
||||
<svg class="icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#documentation-icon"></use>
|
||||
</svg>
|
||||
<h2>Documentation</h2>
|
||||
<p>Your questions, answered</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://vite.dev/" target="_blank">
|
||||
<img class="logo" :src="viteLogo" alt="" />
|
||||
Explore Vite
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://vuejs.org/" target="_blank">
|
||||
<img class="button-icon" :src="vueLogo" alt="" />
|
||||
Learn more
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="social">
|
||||
<svg class="icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#social-icon"></use>
|
||||
</svg>
|
||||
<h2>Connect with us</h2>
|
||||
<p>Join the Vite community</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="https://github.com/vitejs/vite" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#github-icon"></use>
|
||||
</svg>
|
||||
GitHub
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://chat.vite.dev/" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#discord-icon"></use>
|
||||
</svg>
|
||||
Discord
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://x.com/vite_js" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#x-icon"></use>
|
||||
</svg>
|
||||
X.com
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="https://bsky.app/profile/vite.dev" target="_blank">
|
||||
<svg class="button-icon" role="presentation" aria-hidden="true">
|
||||
<use href="/icons.svg#bluesky-icon"></use>
|
||||
</svg>
|
||||
Bluesky
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="ticks"></div>
|
||||
<section id="spacer"></section>
|
||||
</template>
|
||||
7
front/vite-project/src/main.js
Normal file
7
front/vite-project/src/main.js
Normal file
@ -0,0 +1,7 @@
|
||||
import { createApp } from 'vue'
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
|
||||
createApp(App).use(ElementPlus).mount('#app')
|
||||
296
front/vite-project/src/style.css
Normal file
296
front/vite-project/src/style.css
Normal file
@ -0,0 +1,296 @@
|
||||
:root {
|
||||
--text: #6b6375;
|
||||
--text-h: #08060d;
|
||||
--bg: #fff;
|
||||
--border: #e5e4e7;
|
||||
--code-bg: #f4f3ec;
|
||||
--accent: #aa3bff;
|
||||
--accent-bg: rgba(170, 59, 255, 0.1);
|
||||
--accent-border: rgba(170, 59, 255, 0.5);
|
||||
--social-bg: rgba(244, 243, 236, 0.5);
|
||||
--shadow:
|
||||
rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
|
||||
|
||||
--sans: system-ui, 'Segoe UI', Roboto, sans-serif;
|
||||
--heading: system-ui, 'Segoe UI', Roboto, sans-serif;
|
||||
--mono: ui-monospace, Consolas, monospace;
|
||||
|
||||
font: 18px/145% var(--sans);
|
||||
letter-spacing: 0.18px;
|
||||
color-scheme: light dark;
|
||||
color: var(--text);
|
||||
background: var(--bg);
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--text: #9ca3af;
|
||||
--text-h: #f3f4f6;
|
||||
--bg: #16171d;
|
||||
--border: #2e303a;
|
||||
--code-bg: #1f2028;
|
||||
--accent: #c084fc;
|
||||
--accent-bg: rgba(192, 132, 252, 0.15);
|
||||
--accent-border: rgba(192, 132, 252, 0.5);
|
||||
--social-bg: rgba(47, 48, 58, 0.5);
|
||||
--shadow:
|
||||
rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
|
||||
}
|
||||
|
||||
#social .button-icon {
|
||||
filter: invert(1) brightness(2);
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
font-family: var(--heading);
|
||||
font-weight: 500;
|
||||
color: var(--text-h);
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 56px;
|
||||
letter-spacing: -1.68px;
|
||||
margin: 32px 0;
|
||||
@media (max-width: 1024px) {
|
||||
font-size: 36px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
}
|
||||
h2 {
|
||||
font-size: 24px;
|
||||
line-height: 118%;
|
||||
letter-spacing: -0.24px;
|
||||
margin: 0 0 8px;
|
||||
@media (max-width: 1024px) {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
code,
|
||||
.counter {
|
||||
font-family: var(--mono);
|
||||
display: inline-flex;
|
||||
border-radius: 4px;
|
||||
color: var(--text-h);
|
||||
}
|
||||
|
||||
code {
|
||||
font-size: 15px;
|
||||
line-height: 135%;
|
||||
padding: 4px 8px;
|
||||
background: var(--code-bg);
|
||||
}
|
||||
|
||||
.counter {
|
||||
font-size: 16px;
|
||||
padding: 5px 10px;
|
||||
border-radius: 5px;
|
||||
color: var(--accent);
|
||||
background: var(--accent-bg);
|
||||
border: 2px solid transparent;
|
||||
transition: border-color 0.3s;
|
||||
margin-bottom: 24px;
|
||||
|
||||
&:hover {
|
||||
border-color: var(--accent-border);
|
||||
}
|
||||
&:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.hero {
|
||||
position: relative;
|
||||
|
||||
.base,
|
||||
.framework,
|
||||
.vite {
|
||||
inset-inline: 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.base {
|
||||
width: 170px;
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.framework,
|
||||
.vite {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.framework {
|
||||
z-index: 1;
|
||||
top: 34px;
|
||||
height: 28px;
|
||||
transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg)
|
||||
scale(1.4);
|
||||
}
|
||||
|
||||
.vite {
|
||||
z-index: 0;
|
||||
top: 107px;
|
||||
height: 26px;
|
||||
width: auto;
|
||||
transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg)
|
||||
scale(0.8);
|
||||
}
|
||||
}
|
||||
|
||||
#app {
|
||||
width: 1126px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
border-inline: 1px solid var(--border);
|
||||
min-height: 100svh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#center {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 25px;
|
||||
place-content: center;
|
||||
place-items: center;
|
||||
flex-grow: 1;
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
padding: 32px 20px 24px;
|
||||
gap: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
#next-steps {
|
||||
display: flex;
|
||||
border-top: 1px solid var(--border);
|
||||
text-align: left;
|
||||
|
||||
& > div {
|
||||
flex: 1 1 0;
|
||||
padding: 32px;
|
||||
@media (max-width: 1024px) {
|
||||
padding: 24px 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-bottom: 16px;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
#docs {
|
||||
border-right: 1px solid var(--border);
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
border-right: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
}
|
||||
|
||||
#next-steps ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin: 32px 0 0;
|
||||
|
||||
.logo {
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
a {
|
||||
color: var(--text-h);
|
||||
font-size: 16px;
|
||||
border-radius: 6px;
|
||||
background: var(--social-bg);
|
||||
display: flex;
|
||||
padding: 6px 12px;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
text-decoration: none;
|
||||
transition: box-shadow 0.3s;
|
||||
|
||||
&:hover {
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
.button-icon {
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
margin-top: 20px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
|
||||
li {
|
||||
flex: 1 1 calc(50% - 8px);
|
||||
}
|
||||
|
||||
a {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#spacer {
|
||||
height: 88px;
|
||||
border-top: 1px solid var(--border);
|
||||
@media (max-width: 1024px) {
|
||||
height: 48px;
|
||||
}
|
||||
}
|
||||
|
||||
.ticks {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -4.5px;
|
||||
border: 5px solid transparent;
|
||||
}
|
||||
|
||||
&::before {
|
||||
left: 0;
|
||||
border-left-color: var(--border);
|
||||
}
|
||||
&::after {
|
||||
right: 0;
|
||||
border-right-color: var(--border);
|
||||
}
|
||||
}
|
||||
8
front/vite-project/vite.config.js
Normal file
8
front/vite-project/vite.config.js
Normal file
@ -0,0 +1,8 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
base: '/',
|
||||
plugins: [vue()],
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user