feat(xq0078): 新增金色湖畔小程序数据导出插件(1.0.4)
- 金贵微信端管理平台(vip6.wechat.goldenyun.cn)门票使用统计导出:接口登录 → 搜索接口取核销明细 → 调平台导出接口生成 xlsx - 核销时间日期段界面可选(默认昨天 00:00:00 ~ 今天 23:59:59);导出接口异常时按同一份数据本地生成同列序 xlsx 兜底
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# XQ0078 金色湖畔小程序数据导出
|
||||
|
||||
金贵微信端管理平台(`vip6.wechat.goldenyun.cn/chqhpwq.web`)「门票使用统计」数据导出插件。
|
||||
|
||||
## 功能
|
||||
|
||||
- 接口登录(门店 + 账号密码),无验证码、无 CSRF Token、无前端密码加密;
|
||||
- 核销时间在界面用日期段选择器选择(默认昨天 ~ 今天 = 昨天 00:00:00 ~ 今天 23:59:59);
|
||||
- 调平台搜索接口取核销明细 JSON,再调平台导出接口生成 xlsx;
|
||||
- 导出接口异常时,用同一份 JSON 本地生成同列序 xlsx(产物不丢)。
|
||||
|
||||
## 接口机制(逆向结论)
|
||||
|
||||
| 环节 | 说明 |
|
||||
|------|------|
|
||||
| 登录 | `POST /chqhpwq.web/login?returnurl=...`,字段 `VpnCode`(门店 GUID) / `VpnName` / `UserName` / `Password` / `Channel=wechat`;失败回渲染登录页并给出「帐号密码错误!」 |
|
||||
| 搜索 | `POST /chqhpwq.web/wechat/memberreport/ticketconsumelistreport`,body = 列表页 `frmList` 序列化(`Query.BeginTime/EndTime/...` + `Pager.*`),**返回 JSON 数组**(不是页面 HTML) |
|
||||
| 导出 | `POST /chqhpwq.web/wechat/export/downloadexcel`,只接受「文件名 + 一整段 `<table>` HTML」,**不接受查询条件**;两个隐藏域 name 每次页面加载都变(数字 ticks + GUID),需现场从列表页解析 |
|
||||
|
||||
明细字段:`TicketTypeName / TicketGroupId / TicketID / SellPrice / UseDateStr / UseBillid / UseName / UseVpnName`(核销账单号为空时按页面口径显示「人工核销」)。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```
|
||||
XQ0078 金色湖畔小程序数据导出/
|
||||
├── plugin.json # 元数据(id=xq0078)
|
||||
├── __init__.py # 入口:ScenePlugin 子类 + PLUGINS.append
|
||||
├── config/ # 平台常量、查询参数、日志钩子
|
||||
├── data/ # golden_login.py(登录)、golden_export.py(搜索/导出/兜底)
|
||||
├── logic/ # date_range.py(区间计算与时间格式归一化)
|
||||
├── ui-src/ # 前端源码(Vue 3 + Element Plus + Vite)
|
||||
├── ui/ # 前端构建产物(npm run build 生成)
|
||||
└── _pack.py # 打包:dist-plugin/xq0078_v<版本>.zip
|
||||
```
|
||||
|
||||
## 开发
|
||||
|
||||
```powershell
|
||||
# 前端构建(首次需 npm install)
|
||||
cd "plugins\XQ0001-0100\XQ0078 金色湖畔小程序数据导出\ui-src"
|
||||
npm install
|
||||
npm run build
|
||||
|
||||
# 打包
|
||||
cd d:\work\code\37duAutomation
|
||||
.\.venv\Scripts\python.exe "plugins\XQ0001-0100\XQ0078 金色湖畔小程序数据导出\_pack.py"
|
||||
```
|
||||
|
||||
发布走测试通道(`tools/agent_cli.py publish`),人工验证通过后由人执行 `plugin-status xq0078 --status published` 转正。
|
||||
|
||||
## 注意
|
||||
|
||||
- 账号密码错误时插件**不自动重试**(避免平台累计失败次数锁号);
|
||||
- 界面日期段只选 `yyyy-MM-dd`,插件自动补 `00:00:00` / `23:59:59` 并归一化为平台页面同款格式(接口层也兼容直接传完整时间)。
|
||||
@@ -0,0 +1,137 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""金色湖畔小程序数据导出(XQ0078)- webhost 场景插件
|
||||
|
||||
金贵微信端管理平台(vip6.wechat.goldenyun.cn/chqhpwq.web)门票使用统计导出:
|
||||
- 登录:接口登录(门店 + 账号密码),无验证码/无 CSRF/无密码加密;
|
||||
- 查询:核销时间默认「昨日 00:00:00 ~ 今日 23:59:59」,可自定义区间;
|
||||
走搜索接口 ticketconsumelistreport 取 JSON(不是页面 HTML);
|
||||
- 导出:平台导出接口只认「文件名 + 表格 HTML」,故先取 JSON → 拼表格 → 提交导出;
|
||||
导出接口异常时用同一份 JSON 本地生成同列序 xlsx,保证产物不丢。
|
||||
|
||||
个性化设计:
|
||||
- 账号密码经 fields 注入(plugin_configs 本机明文保存,下次免填);
|
||||
- 门店名留空 = 自动取登录页第一个门店;
|
||||
- 平台无验证码,每次执行现场登录,不依赖底座共享登录态(platform="")。
|
||||
"""
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
from webhost.backend.plugins.base import PLUGINS, ScenePlugin
|
||||
|
||||
from . import config
|
||||
from .data import golden_login, golden_export
|
||||
from .logic import date_range
|
||||
|
||||
|
||||
def _default_save_dir():
|
||||
return str(Path(config.get_desktop()) / f"金色湖畔小程序数据_{datetime.now():%Y%m%d}")
|
||||
|
||||
|
||||
class JinseHupanExportPlugin(ScenePlugin):
|
||||
id = "xq0078"
|
||||
name = "金色湖畔小程序数据导出"
|
||||
version = "1.0.4"
|
||||
description = ("金贵微信端管理平台门票使用统计接口化导出:接口登录 → 搜索接口取核销明细 → "
|
||||
"平台导出接口生成 xlsx;核销时间默认昨日 00:00:00 ~ 今日 23:59:59")
|
||||
platform = "" # 平台自带登录页(无验证码),插件内接口登录,不用底座共享登录态
|
||||
uses_month = False
|
||||
capabilities = ["xq0078"]
|
||||
permissions = {"platforms": []}
|
||||
# 与 plugin.json.fields 一致(ui=true 前端自渲染,此处作为参数契约文档)
|
||||
fields = {
|
||||
"date_from": {"type": "string", "format": "date", "title": "开始日期", "default": "",
|
||||
"description": "yyyy-MM-dd;留空=昨天"},
|
||||
"date_to": {"type": "string", "format": "date", "title": "结束日期", "default": "",
|
||||
"description": "yyyy-MM-dd;留空=与开始日期同一天"},
|
||||
"vpn_name": {"type": "string", "title": "门店", "default": config.DEFAULT_VPN_NAME},
|
||||
"jshp_username": {"type": "string", "title": "登录账号", "default": ""},
|
||||
"jshp_password": {"type": "string", "title": "登录密码", "default": ""},
|
||||
"save_dir": {"type": "string", "title": "保存目录", "default": ""},
|
||||
}
|
||||
|
||||
def run(self, fields, ctx) -> dict:
|
||||
fields = fields or {}
|
||||
config.set_log(ctx.log)
|
||||
|
||||
# ---------- 解析参数 ----------
|
||||
date_from = str(fields.get("date_from") or "").strip()
|
||||
date_to = str(fields.get("date_to") or "").strip()
|
||||
username = str(fields.get("jshp_username") or "").strip()
|
||||
password = str(fields.get("jshp_password") or "").strip()
|
||||
vpn_name = str(fields.get("vpn_name") or "").strip()
|
||||
save_dir = str(fields.get("save_dir") or "").strip().strip('"') or _default_save_dir()
|
||||
|
||||
if not username or not password:
|
||||
raise RuntimeError("登录账号/密码缺失:请在插件界面填写并保存配置后重试")
|
||||
try:
|
||||
begin, end = date_range.build_range(date_from, date_to)
|
||||
except ValueError as e:
|
||||
raise RuntimeError(f"核销时间区间不正确:{e}")
|
||||
|
||||
ctx.log(f"核销时间:{begin} ~ {end}")
|
||||
|
||||
# ---------- 登录 ----------
|
||||
ctx.progress(5)
|
||||
ctx.log("开始登录金贵微信端管理平台…")
|
||||
session = golden_login.login(username, password, vpn_name)
|
||||
ctx.progress(15)
|
||||
|
||||
# ---------- 列表页(取导出表单动态字段名) ----------
|
||||
html = golden_export.open_list_page(session)
|
||||
export_fields = golden_export.parse_export_fields(html)
|
||||
ctx.progress(25)
|
||||
|
||||
# ---------- 搜索接口取明细 ----------
|
||||
ctx.log("调用搜索接口获取核销明细…")
|
||||
rows = golden_export.fetch_all_rows(session, begin, end)
|
||||
ctx.progress(85)
|
||||
if rows:
|
||||
ctx.log(f"查询到 {len(rows)} 条核销明细")
|
||||
else:
|
||||
ctx.log("该时间范围内没有核销明细,将导出空表", "WARN")
|
||||
|
||||
# ---------- 导出 ----------
|
||||
ctx.log("调用平台导出接口生成 Excel…")
|
||||
stamp = date_range.file_stamp(begin, end)
|
||||
filename = f"{config.EXPORT_TITLE}_{stamp}.xlsx"
|
||||
out_dir = Path(save_dir)
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
out_path = out_dir / filename
|
||||
|
||||
result = golden_export.export_via_server(session, export_fields, rows)
|
||||
kind = result.get("kind")
|
||||
if kind == "xlsx":
|
||||
out_path.write_bytes(result["content"])
|
||||
source = "平台导出接口(xlsx)"
|
||||
elif kind == "html_excel":
|
||||
# 平台导出的是 HTML 伪装 Excel(UTF-16 的 <table>),数据与搜索接口一致;
|
||||
# 统一用同一份数据生成为标准 xlsx,避免 .xls 扩展名格式不符的提示
|
||||
golden_export.write_xlsx_local(rows, out_path)
|
||||
source = "平台导出接口数据 + 本地标准 xlsx"
|
||||
else:
|
||||
ctx.log("平台导出接口未返回可识别文件,改用本地按同一份数据生成", "WARN")
|
||||
golden_export.write_xlsx_local(rows, out_path)
|
||||
source = "本地兜底生成"
|
||||
ctx.progress(100)
|
||||
|
||||
return {
|
||||
"summary": f"门票使用统计导出完成:{len(rows)} 条 → {out_path}({source})",
|
||||
"rows": rows,
|
||||
"detail": {
|
||||
"count": len(rows),
|
||||
"begin": begin,
|
||||
"end": end,
|
||||
"file": str(out_path),
|
||||
"source": source,
|
||||
},
|
||||
"path": str(out_path),
|
||||
"notes": [
|
||||
f"核销时间:{begin} ~ {end}",
|
||||
f"明细条数:{len(rows)}",
|
||||
f"导出方式:{source}",
|
||||
f"文件:{out_path}",
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
PLUGINS.append(JinseHupanExportPlugin())
|
||||
@@ -0,0 +1,47 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""发布打包辅助(开发工具,`_` 前缀运行时不会被插件扫描加载)。
|
||||
|
||||
把本插件压成 dist-plugin/xq0078_v<版本>.zip,
|
||||
包根布局:plugin.json / 各 .py / config / data / logic / ui 直接位于 zip 根。
|
||||
排除项:ui-src、__pycache__、debug、.sessions、本脚本、*.pyc。
|
||||
|
||||
用法(仓库根下执行):
|
||||
.venv\\Scripts\\python.exe "plugins\\XQ0001-0100\\XQ0078 金色湖畔小程序数据导出\\_pack.py"
|
||||
随后发布(见 docs/插件/发版规范.md,测试通道 → 人工验证 → 转正):
|
||||
.venv\\Scripts\\python.exe tools\\agent_cli.py publish \\
|
||||
dist-plugin/xq0078_v1.0.0.zip --id xq0078 --version 1.0.0
|
||||
"""
|
||||
import json
|
||||
import sys
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
|
||||
_HERE = Path(__file__).resolve().parent
|
||||
# 仓库根 = plugins/XQ0001-0100/<插件目录>/ 的 parents[2],统一出包位置
|
||||
_OUT_DIR = _HERE.parents[2] / "dist-plugin"
|
||||
_EXCLUDE_DIRS = {"ui-src", "__pycache__", "debug", ".sessions"}
|
||||
_EXCLUDE_FILES = {"_pack.py"}
|
||||
|
||||
|
||||
def main():
|
||||
manifest = json.loads((_HERE / "plugin.json").read_text(encoding="utf-8"))
|
||||
pid, ver = manifest["id"], manifest["version"]
|
||||
if manifest.get("ui") and not (_HERE / "ui" / "index.html").is_file():
|
||||
print("插件声明 ui=true 但缺少 ui/index.html:请先在 ui-src 下 npm run build")
|
||||
return 1
|
||||
|
||||
_OUT_DIR.mkdir(exist_ok=True)
|
||||
out = _OUT_DIR / f"{pid}_v{ver}.zip"
|
||||
with zipfile.ZipFile(out, "w", zipfile.ZIP_DEFLATED) as zf:
|
||||
for p in sorted(_HERE.rglob("*")):
|
||||
rel = p.relative_to(_HERE)
|
||||
if set(rel.parts) & _EXCLUDE_DIRS or p.name in _EXCLUDE_FILES or p.suffix == ".pyc":
|
||||
continue
|
||||
if p.is_file():
|
||||
zf.write(p, str(rel))
|
||||
print(f"已打包: {out}({out.stat().st_size / 1024:.0f} KB)")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,97 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""xq0078 金色湖畔小程序数据导出 插件 - 配置常量与全局钩子。
|
||||
|
||||
插件自包含:本包只依赖 Python 标准库 / 第三方库 / 底座注入的 RunContext。
|
||||
业务模块统一经 config.log() 输出日志(转发到 ctx.log,无 ctx 时回落到 print)。
|
||||
"""
|
||||
import os
|
||||
|
||||
# ==================== 金贵微信端管理平台 ====================
|
||||
# 平台:金贵 GoldenSoft 微信端管理(ASP.NET MVC,服务端渲染 + Cookie 会话)
|
||||
BASE_URL = 'http://vip6.wechat.goldenyun.cn'
|
||||
APP_PATH = '/chqhpwq.web'
|
||||
|
||||
LOGIN_PATH = '/login'
|
||||
LIST_PATH = '/wechat/memberreport/ticketconsumelist' # 门票使用统计页(表单 + 导出按钮)
|
||||
SEARCH_PATH = '/wechat/memberreport/ticketconsumelistreport' # 搜索接口(返回 JSON 数组)
|
||||
EXPORT_PATH = '/wechat/export/downloadexcel' # 导出接口(收表格 HTML,返回 xlsx)
|
||||
|
||||
CHANNEL_WECHAT = 'wechat' # 登录渠道:wechat=微信端 / pad=平板端
|
||||
DEFAULT_VPN_NAME = '金色湖畔石桥铺会馆'
|
||||
|
||||
# ==================== 查询参数 ====================
|
||||
# 搜索接口接收 frmList 序列化的 Query.* + Pager.*,票种/消费码/账单号/核销人默认留空
|
||||
PAGE_SIZE = 1000 # 单页条数;接口按页返回时用于翻页拉全量
|
||||
MAX_PAGES = 100 # 翻页上限保护
|
||||
|
||||
# 核销时间格式:与服务端页面 value 一致(2026/11/4 0:00:00,小时不补零、分秒补零)
|
||||
DATETIME_FMT = '{y}/{m}/{d} {h}:{mi:02d}:{s:02d}'
|
||||
|
||||
# 日期段留空时按执行日推算:昨日 00:00:00 ~ 今日 23:59:59
|
||||
|
||||
# ==================== 导出行列(与页面表格列序一致) ====================
|
||||
EXPORT_TITLE = '门票使用统计'
|
||||
COLUMNS = ['票种', '消费码', '票号', '面值', '核销时间', '核销账单号', '核销人', '核销门店']
|
||||
|
||||
# 搜索接口 JSON 字段 → 导出列
|
||||
ROW_KEYS = ['TicketTypeName', 'TicketGroupId', 'TicketID', 'SellPrice',
|
||||
'UseDateStr', 'UseBillid', 'UseName', 'UseVpnName']
|
||||
EMPTY_BILL_TEXT = '人工核销' # 核销账单号为空时页面显示的处理方式
|
||||
|
||||
TIMEOUT = 30 # 单请求超时(秒)
|
||||
SEARCH_MAX_RETRY = 3 # 搜索接口重试次数(仅网络异常/5xx,不含登录)
|
||||
|
||||
# ==================== 会话落盘(跨 run 复用登录,减少登录次数) ====================
|
||||
def get_session_file():
|
||||
base = os.environ.get('LOCALAPPDATA') or os.path.expanduser('~')
|
||||
d = os.path.join(base, '37duAutomation', 'sessions')
|
||||
os.makedirs(d, exist_ok=True)
|
||||
return os.path.join(d, 'goldenyun_xq0078.json')
|
||||
|
||||
|
||||
# ==================== 默认保存目录 ====================
|
||||
_DESKTOP = os.path.join(os.path.expanduser('~'), 'Desktop')
|
||||
|
||||
|
||||
def get_desktop():
|
||||
return _DESKTOP
|
||||
|
||||
|
||||
# ==================== 全局钩子(run() 启动时注入) ====================
|
||||
_log = None
|
||||
|
||||
|
||||
def set_log(fn):
|
||||
"""注入 ctx.log(RunContext.log),各模块经 log()/logger 输出。"""
|
||||
global _log
|
||||
_log = fn
|
||||
|
||||
|
||||
def log(msg, level="INFO"):
|
||||
if _log:
|
||||
_log(str(msg), level)
|
||||
else:
|
||||
print(f"[{level}] {msg}")
|
||||
|
||||
|
||||
class _ModuleLogger:
|
||||
"""模块级 logger 适配:统一转发到 config.log。"""
|
||||
|
||||
@staticmethod
|
||||
def debug(msg, *args):
|
||||
log(msg % args if args else msg, "DEBUG")
|
||||
|
||||
@staticmethod
|
||||
def info(msg, *args):
|
||||
log(msg % args if args else msg, "INFO")
|
||||
|
||||
@staticmethod
|
||||
def warning(msg, *args):
|
||||
log(msg % args if args else msg, "WARN")
|
||||
|
||||
@staticmethod
|
||||
def error(msg, *args):
|
||||
log(msg % args if args else msg, "ERROR")
|
||||
|
||||
|
||||
logger = _ModuleLogger()
|
||||
@@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""数据层:平台接口访问(登录 / 搜索 / 导出)。"""
|
||||
@@ -0,0 +1,240 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""金贵微信端管理平台 - 门票使用统计(票券消费明细)查询与导出。
|
||||
|
||||
接口机制(从列表页 JS 逆向确认):
|
||||
1) 搜索接口 POST /wechat/memberreport/ticketconsumelistreport
|
||||
body = 列表页 frmList 序列化(Query.BeginTime/EndTime/... + Pager.*),返回 JSON 数组,
|
||||
元素字段:TicketTypeName / TicketGroupId / TicketID / SellPrice / UseDateStr /
|
||||
UseBillid / UseName / UseVpnName。
|
||||
2) 导出接口 POST /wechat/export/downloadexcel
|
||||
它不接受查询条件,只接受「文件名 + 一整段 <table> HTML」;页面是前端把搜索 JSON
|
||||
拼成表格塞进隐藏域再提交。两个隐藏域 name 每次页面加载都变(数字 ticks + GUID),
|
||||
必须现场从列表页解析。
|
||||
"""
|
||||
import re
|
||||
import time
|
||||
|
||||
import requests
|
||||
|
||||
from .. import config
|
||||
|
||||
|
||||
# ---------------------------- 列表页 / 导出表单字段 ----------------------------
|
||||
|
||||
def open_list_page(session):
|
||||
url = f"{config.BASE_URL}{config.APP_PATH}{config.LIST_PATH}"
|
||||
config.logger.info('打开门票使用统计页: %s', url)
|
||||
resp = session.get(url, timeout=config.TIMEOUT)
|
||||
resp.encoding = 'utf-8'
|
||||
if config.LOGIN_PATH in resp.url and 'id="Password"' in resp.text:
|
||||
raise RuntimeError('列表页被重定向回登录页:会话已失效,请重新执行')
|
||||
resp.raise_for_status()
|
||||
return resp.text
|
||||
|
||||
|
||||
def parse_export_fields(html):
|
||||
"""解析 exportForm 两个动态隐藏域 name:纯数字=文件名,GUID 形态=表格 HTML。"""
|
||||
start = html.find('id="exportForm"')
|
||||
if start == -1:
|
||||
raise RuntimeError('列表页未找到 exportForm,无法确定导出字段名(平台页面可能改版)')
|
||||
end = html.find('</form>', start)
|
||||
segment = html[start:end if end != -1 else len(html)]
|
||||
|
||||
names = re.findall(r'<input\s+name="([^"]+)"\s+type="hidden"', segment)
|
||||
if len(names) < 2:
|
||||
names = re.findall(r'name="([^"]+)"[^>]*type="hidden"', segment)
|
||||
digits = [n for n in names if n.isdigit() and 10 <= len(n) <= 20]
|
||||
guids = [n for n in names if n.count('-') >= 2]
|
||||
if not digits or not guids:
|
||||
raise RuntimeError(f'导出表单字段名解析失败:{names}')
|
||||
config.logger.info('导出表单字段名:文件名=%s / 表格=%s', digits[0], guids[0])
|
||||
return {'filename': digits[0], 'content': guids[0]}
|
||||
|
||||
|
||||
# ---------------------------- 搜索 ----------------------------
|
||||
|
||||
def build_query(begin, end, page_index=0):
|
||||
return {
|
||||
'Query.BeginTime': begin,
|
||||
'Query.EndTime': end,
|
||||
'Query.TicketGroupId': '',
|
||||
'Query.UseBillid': '',
|
||||
'Query.UseName': '',
|
||||
'Query.UseVpnCode': '',
|
||||
'Query.TypeCode': '',
|
||||
'Pager.TotalAmount': '0',
|
||||
'Pager.PageSize': str(config.PAGE_SIZE),
|
||||
'Pager.PageIndex': str(page_index),
|
||||
}
|
||||
|
||||
|
||||
def _post_search(session, query):
|
||||
url = f"{config.BASE_URL}{config.APP_PATH}{config.SEARCH_PATH}"
|
||||
headers = {
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
'Referer': f"{config.BASE_URL}{config.APP_PATH}{config.LIST_PATH}",
|
||||
}
|
||||
resp = session.post(url, data=query, headers=headers, timeout=config.TIMEOUT)
|
||||
resp.encoding = 'utf-8'
|
||||
if resp.status_code >= 500:
|
||||
raise requests.RequestException(f'搜索接口 HTTP {resp.status_code}')
|
||||
if resp.status_code != 200:
|
||||
raise RuntimeError(f'搜索接口 HTTP {resp.status_code}:{resp.text[:200]}')
|
||||
|
||||
body = (resp.text or '').strip()
|
||||
if not body:
|
||||
return []
|
||||
if body.startswith('<'):
|
||||
raise RuntimeError(f'搜索接口返回 HTML 而非 JSON(可能会话失效):{body[:200]}')
|
||||
try:
|
||||
data = resp.json()
|
||||
except ValueError:
|
||||
raise RuntimeError(f'搜索接口返回无法解析:{body[:200]}')
|
||||
if isinstance(data, dict):
|
||||
for key in ('Data', 'data', 'Rows', 'rows', 'Items', 'items'):
|
||||
if isinstance(data.get(key), list):
|
||||
data = data[key]
|
||||
break
|
||||
return data if isinstance(data, list) else []
|
||||
|
||||
|
||||
def post_search(session, query):
|
||||
"""带重试的搜索调用(仅网络异常/5xx 重试,避免无意义重放)。"""
|
||||
last = None
|
||||
for attempt in range(1, config.SEARCH_MAX_RETRY + 1):
|
||||
try:
|
||||
return _post_search(session, query)
|
||||
except requests.RequestException as e:
|
||||
last = e
|
||||
config.logger.warning('搜索第 %s/%s 次失败:%s', attempt, config.SEARCH_MAX_RETRY, e)
|
||||
time.sleep(2)
|
||||
raise RuntimeError(f'搜索接口连续 {config.SEARCH_MAX_RETRY} 次失败:{last}')
|
||||
|
||||
|
||||
def fetch_all_rows(session, begin, end):
|
||||
"""按页拉全量并去重(接口若忽略分页,第一次即返回全部)。"""
|
||||
rows, seen, page = [], set(), 0
|
||||
while page < config.MAX_PAGES:
|
||||
batch = post_search(session, build_query(begin, end, page))
|
||||
config.logger.info('第 %s 页返回 %s 条', page + 1, len(batch))
|
||||
if not batch:
|
||||
break
|
||||
new_count = 0
|
||||
for row in batch:
|
||||
key = (str(row.get('TicketID')), str(row.get('TicketGroupId')), str(row.get('UseDateStr')))
|
||||
if key in seen:
|
||||
continue
|
||||
seen.add(key)
|
||||
rows.append(row)
|
||||
new_count += 1
|
||||
if new_count == 0 or len(batch) < config.PAGE_SIZE:
|
||||
break
|
||||
page += 1
|
||||
config.logger.info('去重后合计 %s 条', len(rows))
|
||||
return rows
|
||||
|
||||
|
||||
# ---------------------------- 导出 ----------------------------
|
||||
|
||||
def _price(value):
|
||||
try:
|
||||
return f"{float(value or 0):.2f}"
|
||||
except (TypeError, ValueError):
|
||||
return '0.00'
|
||||
|
||||
|
||||
def rows_to_table_html(rows):
|
||||
"""拼成与页面完全一致结构的表格 HTML(导出接口只认这段 HTML)。"""
|
||||
head = ('<table class="table mytable extend table-bordered single-selected new-table-header-on" '
|
||||
'id="detail-List"><thead> <tr>'
|
||||
+ ''.join(f'<th>{c}</th>' for c in config.COLUMNS)
|
||||
+ '</tr></thead><tbody>')
|
||||
body = []
|
||||
for row in rows:
|
||||
body.append(
|
||||
'<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>'.format(
|
||||
row.get('TicketTypeName') or '',
|
||||
row.get('TicketGroupId') or '',
|
||||
row.get('TicketID') or '',
|
||||
_price(row.get('SellPrice')),
|
||||
row.get('UseDateStr') or '',
|
||||
row.get('UseBillid') or config.EMPTY_BILL_TEXT,
|
||||
row.get('UseName') or '',
|
||||
row.get('UseVpnName') or '',
|
||||
))
|
||||
return head + ''.join(body) + '</tbody></table>'
|
||||
|
||||
|
||||
def _decode_body(resp):
|
||||
"""按 BOM 解码响应体(平台用 Encoding.Unicode 输出 HTML 表格,即 UTF-16LE)。"""
|
||||
raw = resp.content or b''
|
||||
if raw[:2] == b'\xff\xfe':
|
||||
return raw[2:].decode('utf-16-le', 'ignore')
|
||||
if raw[:2] == b'\xfe\xff':
|
||||
return raw[2:].decode('utf-16-be', 'ignore')
|
||||
return raw.decode(resp.encoding or 'utf-8', 'ignore')
|
||||
|
||||
|
||||
def export_via_server(session, fields, rows):
|
||||
"""调服务端导出接口。
|
||||
|
||||
返回 dict:
|
||||
{'kind': 'xlsx', 'content': bytes} 平台返回真 xlsx(PK 文件头)
|
||||
{'kind': 'html_excel', 'text': str} 平台返回 HTML 伪装 Excel(UTF-16 的 <table>…)
|
||||
{'kind': 'none', 'text': str} 未拿到可识别内容(调用方走本地兜底)
|
||||
"""
|
||||
url = f"{config.BASE_URL}{config.APP_PATH}{config.EXPORT_PATH}"
|
||||
payload = {
|
||||
fields['filename']: config.EXPORT_TITLE,
|
||||
fields['content']: rows_to_table_html(rows),
|
||||
}
|
||||
headers = {
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
'Referer': f"{config.BASE_URL}{config.APP_PATH}{config.LIST_PATH}",
|
||||
}
|
||||
config.logger.info('调用导出接口(%s 条)…', len(rows))
|
||||
resp = session.post(url, data=payload, headers=headers, timeout=config.TIMEOUT)
|
||||
config.logger.info('导出响应:状态=%s Content-Type=%s Content-Disposition=%s 长度=%s 文件头=%r',
|
||||
resp.status_code, resp.headers.get('Content-Type'),
|
||||
resp.headers.get('Content-Disposition'),
|
||||
len(resp.content), resp.content[:4])
|
||||
|
||||
if resp.status_code == 200 and resp.content[:2] == b'PK':
|
||||
return {'kind': 'xlsx', 'content': resp.content}
|
||||
|
||||
text = _decode_body(resp)
|
||||
if resp.status_code == 200 and '<table' in text.lower():
|
||||
# 平台「导出」= 把表格 HTML 直接吐回(Excel 能识别但不是标准工作簿,
|
||||
# 用 .xls 扩展名打开还会提示格式不符);数据本身与搜索接口完全一致
|
||||
config.logger.info('平台导出接口返回 HTML 版 Excel(%.1f KB),数据可用',
|
||||
len(resp.content) / 1024.0)
|
||||
return {'kind': 'html_excel', 'text': text}
|
||||
|
||||
config.logger.warning('导出接口未返回可识别文件,响应预览:%s',
|
||||
text[:200].replace('\n', ' '))
|
||||
return {'kind': 'none', 'text': text}
|
||||
|
||||
|
||||
def write_xlsx_local(rows, path):
|
||||
"""兜底:按搜索接口 JSON 直接用 openpyxl 生成同列序的 xlsx。"""
|
||||
from openpyxl import Workbook
|
||||
|
||||
wb = Workbook()
|
||||
ws = wb.active
|
||||
ws.title = config.EXPORT_TITLE[:31]
|
||||
ws.append(config.COLUMNS)
|
||||
for row in rows:
|
||||
ws.append([
|
||||
row.get('TicketTypeName') or '',
|
||||
row.get('TicketGroupId') or '',
|
||||
row.get('TicketID') or '',
|
||||
float(_price(row.get('SellPrice'))),
|
||||
row.get('UseDateStr') or '',
|
||||
row.get('UseBillid') or config.EMPTY_BILL_TEXT,
|
||||
row.get('UseName') or '',
|
||||
row.get('UseVpnName') or '',
|
||||
])
|
||||
for letter, width in zip('ABCDEFGH', (46, 20, 18, 10, 20, 20, 12, 22)):
|
||||
ws.column_dimensions[letter].width = width
|
||||
wb.save(path)
|
||||
return path
|
||||
@@ -0,0 +1,119 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""金贵微信端管理平台登录(接口登录,无需浏览器)。
|
||||
|
||||
登录页为传统 ASP.NET MVC 表单:
|
||||
POST /chqhpwq.web/login?returnurl=<目标页>
|
||||
表单字段:VpnCode(门店 GUID) / VpnName / UserName / Password / Channel
|
||||
无验证码、无 CSRF Token、无前端密码加密;失败时服务端回渲染登录页并在
|
||||
validation-summary-errors 里给出「帐号密码错误!」。
|
||||
"""
|
||||
import re
|
||||
|
||||
import requests
|
||||
|
||||
from .. import config
|
||||
|
||||
_ERROR_HINTS = ('帐号密码错误', '账号密码错误', '密码错误', '已被锁定', '锁定', '验证码', '无权')
|
||||
|
||||
|
||||
def new_session():
|
||||
session = requests.Session()
|
||||
session.headers.update({
|
||||
'User-Agent': ('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 '
|
||||
'(KHTML, like Gecko) Chrome/120.0 Safari/537.36'),
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||
'Accept-Language': 'zh-CN,zh;q=0.9',
|
||||
})
|
||||
return session
|
||||
|
||||
|
||||
def fetch_login_page(session):
|
||||
url = f"{config.BASE_URL}{config.APP_PATH}{config.LOGIN_PATH}"
|
||||
config.logger.info('获取登录页: %s', url)
|
||||
resp = session.get(url, timeout=config.TIMEOUT)
|
||||
resp.raise_for_status()
|
||||
resp.encoding = 'utf-8'
|
||||
return resp.text
|
||||
|
||||
|
||||
def parse_vpn_list(html):
|
||||
"""解析门店列表:<li data-id="GUID" data-name="门店名">门店名</li>"""
|
||||
block = html
|
||||
start = html.find('class="vpn-list"')
|
||||
if start != -1:
|
||||
end = html.find('</ul>', start)
|
||||
block = html[start:end if end != -1 else len(html)]
|
||||
|
||||
vpns = []
|
||||
for match in re.finditer(r'<li([^>]*)>([^<]*)</li>', block):
|
||||
code = re.search(r'data-id="([^"]+)"', match.group(1))
|
||||
if not code:
|
||||
continue
|
||||
name = re.search(r'data-name="([^"]*)"', match.group(1))
|
||||
vpns.append({'code': code.group(1), 'name': (name.group(1) if name else match.group(2)).strip()})
|
||||
return vpns
|
||||
|
||||
|
||||
def pick_vpn(vpns, want_name=''):
|
||||
"""按门店名匹配,未命中则取登录页第一个门店。"""
|
||||
want = str(want_name or '').strip()
|
||||
if want:
|
||||
for vpn in vpns:
|
||||
if vpn['name'] == want:
|
||||
return vpn
|
||||
for vpn in vpns:
|
||||
if want in vpn['name'] or vpn['name'] in want:
|
||||
return vpn
|
||||
config.logger.warning('未匹配到门店「%s」,回退登录页第一个门店', want)
|
||||
if not vpns:
|
||||
raise RuntimeError('登录页未解析到门店列表,无法选择门店登录')
|
||||
return vpns[0]
|
||||
|
||||
|
||||
def _extract_error(html):
|
||||
for match in re.finditer(r'validation-summary-errors[^>]*>\s*<ul>(.*?)</ul>', html, re.S):
|
||||
items = [re.sub(r'<[^>]+>', '', li).strip()
|
||||
for li in re.findall(r'<li[^>]*>(.*?)</li>', match.group(1), re.S)]
|
||||
items = [i for i in items if i]
|
||||
if items:
|
||||
return ' / '.join(items)
|
||||
for hint in _ERROR_HINTS:
|
||||
if hint in html:
|
||||
return f'页面出现关键字「{hint}」'
|
||||
return ''
|
||||
|
||||
|
||||
def login(username, password, vpn_name=''):
|
||||
"""返回已认证的 requests.Session;失败抛 RuntimeError(凭据错误不重试,避免锁号)。"""
|
||||
username = str(username or '').strip()
|
||||
password = str(password or '').strip() # 防误存首尾空格导致平台判密码错误
|
||||
if not username or not password:
|
||||
raise RuntimeError('登录账号或密码为空:请在插件界面填写并保存配置')
|
||||
|
||||
session = new_session()
|
||||
html = fetch_login_page(session)
|
||||
vpn = pick_vpn(parse_vpn_list(html), vpn_name)
|
||||
config.logger.info('登录门店:%s(%s)', vpn['name'], vpn['code'])
|
||||
|
||||
from urllib.parse import quote
|
||||
return_url = quote(config.APP_PATH + config.LIST_PATH, safe='')
|
||||
url = f"{config.BASE_URL}{config.APP_PATH}{config.LOGIN_PATH}?returnurl={return_url}"
|
||||
payload = {
|
||||
'VpnCode': vpn['code'],
|
||||
'VpnName': vpn['name'],
|
||||
'UserName': username,
|
||||
'Password': password,
|
||||
'Channel': config.CHANNEL_WECHAT,
|
||||
}
|
||||
resp = session.post(url, data=payload, timeout=config.TIMEOUT, allow_redirects=True)
|
||||
resp.encoding = 'utf-8'
|
||||
config.logger.info('登录响应:状态=%s 最终URL=%s', resp.status_code, resp.url)
|
||||
|
||||
error = _extract_error(resp.text)
|
||||
if error:
|
||||
hint = '(请检查账号密码首尾空格后重试)' if '密码' in error else ''
|
||||
raise RuntimeError(f'登录失败:{error}{hint}。为免触发平台失败计数锁定,本次不重试')
|
||||
if config.LOGIN_PATH in resp.url and 'id="Password"' in resp.text:
|
||||
raise RuntimeError('登录失败:仍停留在登录页,请确认账号密码与门店是否正确')
|
||||
config.logger.info('登录成功,Cookie=%s', ', '.join(session.cookies.keys()) or '无')
|
||||
return session
|
||||
@@ -0,0 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""逻辑层:查询区间计算(时间格式归一化 / 默认区间推算)。"""
|
||||
@@ -0,0 +1,80 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""核销时间区间计算:默认「昨日 00:00:00 ~ 今日 23:59:59」,也支持指定日期段。
|
||||
|
||||
前端日期段选择器只给 yyyy-MM-dd(与本项目其它插件一致),时间部分由这里补:
|
||||
开始补 00:00:00、结束补 23:59:59;也兼容直接传完整时间(2026/11/4 8:30:00)。
|
||||
服务端页面 datetime 输入框原值是 `2026/11/5 0:00:00` 这种不补零格式,统一归一化成同款。
|
||||
"""
|
||||
import re
|
||||
from datetime import date, datetime, timedelta
|
||||
|
||||
from .. import config
|
||||
|
||||
|
||||
def _fmt(y, m, d, h=0, mi=0, s=0):
|
||||
return config.DATETIME_FMT.format(y=y, m=m, d=d, h=h, mi=mi, s=s)
|
||||
|
||||
|
||||
def normalize(value, default_time):
|
||||
"""把 yyyy-MM-dd / yyyy/M/d H:mm:ss 等输入归一化成服务端格式。
|
||||
|
||||
只给日期时按 default_time("00:00:00" / "23:59:59")补时间。
|
||||
"""
|
||||
text = str(value or '').strip()
|
||||
if not text:
|
||||
raise ValueError('时间为空')
|
||||
nums = re.findall(r'\d+', text)
|
||||
if len(nums) < 3:
|
||||
raise ValueError(f'无法识别的时间:{text!r},请用 yyyy-MM-dd 格式')
|
||||
y, m, d = int(nums[0]), int(nums[1]), int(nums[2])
|
||||
if len(nums) >= 5:
|
||||
h, mi = int(nums[3]), int(nums[4])
|
||||
s = int(nums[5]) if len(nums) >= 6 else 0
|
||||
else:
|
||||
h, mi, s = (int(x) for x in default_time.split(':'))
|
||||
datetime(y, m, d, h, mi, s) # 合法性校验(非法日期直接抛错)
|
||||
return _fmt(y, m, d, h, mi, s)
|
||||
|
||||
|
||||
def build_range(date_from='', date_to=''):
|
||||
"""返回 (begin, end) 服务端格式字符串。
|
||||
|
||||
- 都留空:昨天 00:00:00 ~ 今天 23:59:59(按执行日推算,定时任务无需固定日期)
|
||||
- 只给开始:结束 = 开始(单日)
|
||||
- 都给了:yyyy-MM-dd 自动补 00:00:00 / 23:59:59
|
||||
"""
|
||||
df = str(date_from or '').strip()
|
||||
dt = str(date_to or '').strip()
|
||||
if not df and not dt:
|
||||
today = date.today()
|
||||
yesterday = today - timedelta(days=1)
|
||||
begin = _fmt(yesterday.year, yesterday.month, yesterday.day, 0, 0, 0)
|
||||
end = _fmt(today.year, today.month, today.day, 23, 59, 59)
|
||||
else:
|
||||
if not df:
|
||||
df = dt
|
||||
if not dt:
|
||||
dt = df
|
||||
begin = normalize(df, '00:00:00')
|
||||
end = normalize(dt, '23:59:59')
|
||||
|
||||
if _parse(end) < _parse(begin):
|
||||
raise ValueError(f'结束日期 {dt or end} 早于开始日期 {df or begin}')
|
||||
return begin, end
|
||||
|
||||
|
||||
def _parse(text):
|
||||
nums = [int(x) for x in re.findall(r'\d+', text)]
|
||||
return datetime(nums[0], nums[1], nums[2], nums[3], nums[4], nums[5])
|
||||
|
||||
|
||||
def file_stamp(begin, end):
|
||||
"""文件名用日期区间:20261104-20261105"""
|
||||
def one(text):
|
||||
nums = re.findall(r'\d+', text)
|
||||
return f"{int(nums[0]):04d}{int(nums[1]):02d}{int(nums[2]):02d}"
|
||||
|
||||
try:
|
||||
return f"{one(begin)}-{one(end)}"
|
||||
except Exception:
|
||||
return f"{date.today():%Y%m%d}"
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"schema_version": 1,
|
||||
"id": "xq0078",
|
||||
"name": "金色湖畔小程序数据导出",
|
||||
"version": "1.0.4",
|
||||
"description": "金贵微信端管理平台(vip6.wechat.goldenyun.cn/chqhpwq.web)门票使用统计接口化导出:接口登录 → 搜索接口取核销明细 JSON → 调平台导出接口生成 xlsx;核销时间日期段可在界面选择(默认昨天 00:00:00 ~ 今天 23:59:59);导出接口异常时自动按同一份数据本地生成同列序 xlsx。",
|
||||
"category": "报表",
|
||||
"icon": "",
|
||||
"platform": "",
|
||||
"uses_month": false,
|
||||
"ui": true,
|
||||
"capabilities": [
|
||||
"xq0078"
|
||||
],
|
||||
"permissions": {
|
||||
"platforms": []
|
||||
},
|
||||
"fields": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"date_from": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"title": "开始日期",
|
||||
"default": "",
|
||||
"description": "yyyy-MM-dd;留空=昨天(核销时间从 00:00:00 起)"
|
||||
},
|
||||
"date_to": {
|
||||
"type": "string",
|
||||
"format": "date",
|
||||
"title": "结束日期",
|
||||
"default": "",
|
||||
"description": "yyyy-MM-dd;留空=与开始日期同一天(核销时间到 23:59:59 止)"
|
||||
},
|
||||
"vpn_name": {
|
||||
"type": "string",
|
||||
"title": "门店",
|
||||
"default": "金色湖畔石桥铺会馆",
|
||||
"description": "登录页可选门店名称;留空=自动取登录页第一个门店"
|
||||
},
|
||||
"jshp_username": {
|
||||
"type": "string",
|
||||
"title": "登录账号",
|
||||
"default": "",
|
||||
"description": "金贵微信端管理平台账号(保存在本机,下次免填)"
|
||||
},
|
||||
"jshp_password": {
|
||||
"type": "string",
|
||||
"title": "登录密码",
|
||||
"default": "",
|
||||
"format": "password",
|
||||
"description": "仅保存在本机(%LOCALAPPDATA%\\37duAutomation\\plugin_configs),下次免填"
|
||||
},
|
||||
"save_dir": {
|
||||
"type": "string",
|
||||
"title": "保存目录",
|
||||
"default": "",
|
||||
"description": "留空=桌面/金色湖畔小程序数据_YYYYMMDD;文件名为 门票使用统计_起止日期.xlsx"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"jshp_username",
|
||||
"jshp_password"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
requests>=2.31.0
|
||||
openpyxl>=3.1.0
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>金色湖畔小程序数据导出</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "xq0078-ui",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.2",
|
||||
"element-plus": "^2.14.5",
|
||||
"vue": "^3.5.13"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"vite": "^5.4.11"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<!-- 方案工具条:整组靠右(已保存时间 → 方案下拉 → 存为方案 → 删除) -->
|
||||
<div class="toolbar">
|
||||
<span class="spacer" />
|
||||
<span class="saved" :class="{ 'is-idle': !lastSavedAt }">
|
||||
<i />{{ lastSavedAt ? '已保存 ' + lastSavedAt : '尚未保存' }}
|
||||
</span>
|
||||
<el-select v-model="schemeSel" class="scheme-sel" size="small" :disabled="running"
|
||||
placeholder="当前配置(自动保存)" @change="onSchemeChange">
|
||||
<el-option v-for="o in schemeOptions" :key="o.value" :label="o.label" :value="o.value" />
|
||||
</el-select>
|
||||
<el-button size="small" :disabled="running" @click="saveSchemeAs">存为方案</el-button>
|
||||
<el-button size="small" text type="danger" :disabled="running || !schemeSel"
|
||||
@click="removeScheme">删除</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 内联提示:未登录 / 本次动作短提示(执行结果横幅与进度由壳子统一展示) -->
|
||||
<div v-if="needLogin" class="notice is-warn">
|
||||
<span class="n-ico">!</span><span>未登录:请先在壳子登录统一账户,再刷新本界面</span>
|
||||
</div>
|
||||
<div v-else-if="notice" class="notice" :class="'is-' + notice.type">
|
||||
<span class="n-ico">{{ notice.type === 'ok' ? '✓' : (notice.type === 'error' ? '✕' : '!') }}</span>
|
||||
<span>{{ notice.text }}</span>
|
||||
</div>
|
||||
|
||||
<!-- 01 登录账号(第一步:先能登进去) -->
|
||||
<section class="sec">
|
||||
<div class="sec-head">
|
||||
<span class="sec-badge">01</span>
|
||||
<span class="sec-name">登录账号</span>
|
||||
<span class="sec-line" />
|
||||
</div>
|
||||
<div class="sec-body">
|
||||
<el-form label-position="top">
|
||||
<div class="grid">
|
||||
<el-form-item label="门店">
|
||||
<el-input v-model="form.vpn_name" placeholder="留空 = 登录页第一个门店" :disabled="running" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="登录账号">
|
||||
<el-input v-model="form.jshp_username" placeholder="金贵微信端管理平台账号" :disabled="running" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="登录密码">
|
||||
<el-input v-model="form.jshp_password" type="password" show-password
|
||||
placeholder="仅保存在本机,下次免填" :disabled="running" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="tip">平台为门店 + 账号密码登录,无验证码;密码明文保存在本机配置(%LOCALAPPDATA%\37duAutomation\plugin_configs),下次免填。</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 02 查询范围:日期段 + 保存目录同一行(与其它导出插件一致) -->
|
||||
<section class="sec">
|
||||
<div class="sec-head">
|
||||
<span class="sec-badge">02</span>
|
||||
<span class="sec-name">查询范围</span>
|
||||
<span class="sec-line" />
|
||||
</div>
|
||||
<div class="sec-body">
|
||||
<el-form label-position="top">
|
||||
<div class="grid range-grid">
|
||||
<el-form-item label="核销日期段">
|
||||
<el-date-picker v-model="dateRange" type="daterange" unlink-panels
|
||||
value-format="YYYY-MM-DD" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"
|
||||
:disabled="running" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="保存目录">
|
||||
<div class="dir-ctrl">
|
||||
<el-input v-model="form.save_dir" class="dir-input" :disabled="running" clearable
|
||||
placeholder="留空 = 桌面/金色湖畔小程序数据_今天日期" />
|
||||
<el-button class="dir-btn" :disabled="running || picking" :loading="picking"
|
||||
@click="pickDir">选择</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="tip">
|
||||
<b>{{ rangeText }}</b><br />
|
||||
文件名:门票使用统计_起止日期.xlsx,列序与平台导出完全一致(票种/消费码/票号/面值/核销时间/核销账单号/核销人/核销门店)。
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 流程说明:大段说明收进折叠区 -->
|
||||
<details class="help">
|
||||
<summary>
|
||||
<span>导出说明</span>
|
||||
<span class="h-arrow">▾</span>
|
||||
</summary>
|
||||
<div class="help-body">
|
||||
<div class="hb-line"><b>① 登录</b>:门店 + 账号密码接口登录,无验证码;账号密码错误时不会自动重试,避免平台累计失败次数锁号。</div>
|
||||
<div class="hb-line"><b>② 核销时间</b>:默认昨天 ~ 今天(昨天 00:00:00 ~ 今天 23:59:59),按执行日推算,定时任务无需固定日期;也可直接选日期段补导历史数据。</div>
|
||||
<div class="hb-line"><b>③ 取数方式</b>:平台搜索接口返回的是 <b>JSON 明细</b>(不是页面 HTML),插件直接调接口拿全量数据,不打开浏览器。</div>
|
||||
<div class="hb-line"><b>④ 导出方式</b>:平台导出接口只接受「文件名 + 表格 HTML」,故插件先取 JSON 再拼表格提交;若导出接口异常,自动用同一份数据本地生成同列序 xlsx,产物不丢。</div>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<!-- 操作区 -->
|
||||
<div class="actions">
|
||||
<el-button type="primary" class="btn-run" :loading="running" @click="run()">
|
||||
{{ running ? '执行中 ' + progress + '%' : '一键执行' }}
|
||||
</el-button>
|
||||
<el-button v-if="running" type="danger" plain :loading="stopping" @click="forceStop">强制停止</el-button>
|
||||
<span class="spacer" />
|
||||
<el-button :disabled="running" @click="restoreLastFields">恢复上次参数</el-button>
|
||||
<el-button :disabled="running" @click="saveNow(true)">保存配置</el-button>
|
||||
<el-button text :disabled="running" @click="resetDefaults">恢复默认</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 运行态:进度与日志由壳子展示 -->
|
||||
<div v-if="running" class="runline">
|
||||
<span class="pulse" />
|
||||
<span>正在执行,日志与进度实时显示在工作台下方「运行日志」区</span>
|
||||
<span class="pct">{{ progress }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { usePluginUI } from './usePluginUI'
|
||||
|
||||
const DEFAULT_VPN = '金色湖畔石桥铺会馆'
|
||||
|
||||
// 日期工具:默认「昨天 ~ 今天」
|
||||
const fmtDate = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`
|
||||
const dayOffset = (n) => {
|
||||
const d = new Date()
|
||||
d.setDate(d.getDate() + n)
|
||||
return fmtDate(d)
|
||||
}
|
||||
|
||||
// DEFAULTS 与 plugin.json.fields 的 default 对应(日期留空 = 后端默认昨天~今天)
|
||||
const DEFAULTS = () => ({
|
||||
date_from: dayOffset(-1),
|
||||
date_to: dayOffset(0),
|
||||
vpn_name: DEFAULT_VPN,
|
||||
jshp_username: '',
|
||||
jshp_password: '',
|
||||
save_dir: '',
|
||||
})
|
||||
|
||||
const {
|
||||
form, needLogin, notice, lastSavedAt, running, progress, stopping,
|
||||
saveNow, resetDefaults, restoreLastFields,
|
||||
schemeSel, schemeOptions, onSchemeChange, saveSchemeAs, removeScheme,
|
||||
run, forceStop,
|
||||
} = usePluginUI({
|
||||
defaults: DEFAULTS,
|
||||
validate() {
|
||||
if (form.date_from && form.date_to && form.date_to < form.date_from) {
|
||||
ElMessage.warning('结束日期不能早于开始日期')
|
||||
return false
|
||||
}
|
||||
if (!form.jshp_username.trim()) {
|
||||
ElMessage.warning('请先填写登录账号')
|
||||
return false
|
||||
}
|
||||
if (!form.jshp_password) {
|
||||
ElMessage.warning('请填写登录密码')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
buildPayload(f) {
|
||||
return {
|
||||
date_from: (f.date_from || '').trim(),
|
||||
date_to: (f.date_to || '').trim(),
|
||||
vpn_name: (f.vpn_name || '').trim(),
|
||||
jshp_username: (f.jshp_username || '').trim(),
|
||||
jshp_password: (f.jshp_password || '').trim(), // 防误存首尾空格导致平台判密码错误
|
||||
save_dir: (f.save_dir || '').trim(),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
// 日期段选择器 <-> form 两个字段互转
|
||||
const dateRange = computed({
|
||||
get: () => (form.date_from ? [form.date_from, form.date_to || form.date_from] : []),
|
||||
set: (v) => {
|
||||
form.date_from = v && v[0] ? v[0] : ''
|
||||
form.date_to = v && v[1] ? v[1] : ''
|
||||
},
|
||||
})
|
||||
|
||||
// 实际查询区间提示(带时分秒,避免与页面口径混淆)
|
||||
const rangeText = computed(() => {
|
||||
if (!form.date_from) {
|
||||
return `查询区间:默认昨天 ~ 今天(${dayOffset(-1)} 00:00:00 ~ ${dayOffset(0)} 23:59:59)`
|
||||
}
|
||||
const b = form.date_from
|
||||
const e = form.date_to || form.date_from
|
||||
const days = Math.round((new Date(e) - new Date(b)) / 86400000) + 1
|
||||
return `查询区间:${b} 00:00:00 ~ ${e} 23:59:59(${days > 0 ? days : 1} 天)`
|
||||
})
|
||||
|
||||
// 调用壳子本机接口打开原生「选择文件夹」对话框(壳子 /api/dialog/directory,仅返回路径)
|
||||
const picking = ref(false)
|
||||
async function pickDir() {
|
||||
picking.value = true
|
||||
try {
|
||||
const r = await fetch('/api/dialog/directory', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ title: '选择保存目录', current: form.save_dir || '' }),
|
||||
})
|
||||
const d = await r.json().catch(() => ({}))
|
||||
if (!r.ok) throw new Error(d.detail || d.error || ('HTTP ' + r.status))
|
||||
if (d.path) form.save_dir = d.path
|
||||
} catch (e) {
|
||||
ElMessage.warning('打开文件夹选择失败:' + e.message)
|
||||
} finally {
|
||||
picking.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 插件差异样式:只用壳子 token,不写字面色值;左右内边距由壳子提供 */
|
||||
|
||||
/* ---------- 查询范围:日期段 / 保存目录 同一行(日期列更宽) ---------- */
|
||||
.range-grid { grid-template-columns: minmax(300px, 1.6fr) minmax(260px, 1fr); }
|
||||
@media (max-width: 760px) {
|
||||
.range-grid { grid-template-columns: 1fr; }
|
||||
}
|
||||
|
||||
/* ---------- 保存目录:输入框 + 选择按钮(同一行两列) ---------- */
|
||||
.dir-ctrl { display: flex; align-items: center; gap: var(--space-2); width: 100%; }
|
||||
.dir-ctrl .dir-input { flex: 1 1 auto; min-width: 0; }
|
||||
.dir-ctrl .dir-btn { flex: 0 0 auto; }
|
||||
</style>
|
||||
@@ -0,0 +1,2 @@
|
||||
// 插件身份声明(API 实现收敛在 usePluginUI.js 公共 kit,各插件 ui-src 只需声明自己的 id)
|
||||
export const PLUGIN_ID = 'xq0078'
|
||||
@@ -0,0 +1,9 @@
|
||||
import { createApp } from 'vue'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
||||
// 注意顺序:style.css 必须在 element-plus 之后引入,才能覆盖 --el-* 变量映射到壳子 token
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).use(ElementPlus, { locale: zhCn }).mount('#app')
|
||||
@@ -0,0 +1,431 @@
|
||||
/* ============================================================
|
||||
插件 UI 基础样式(规范 v3 · 对齐壳子「白底面板 + 描边卡」)
|
||||
- token 与壳子 frontend/src/style.css 同源(权威源 design-app/styles.css)
|
||||
- Element Plus 变量映射到壳子 token
|
||||
- 版式类:page / toolbar / notice / sec / grid / tip / actions / badge / table
|
||||
规则:插件内只用 var(--xxx),不写字面色值;左右内边距由壳子提供,不要重复加
|
||||
============================================================ */
|
||||
|
||||
:root {
|
||||
/* 底色与卡面 */
|
||||
--canvas: #F2F4F8;
|
||||
--surface: #FFFFFF;
|
||||
--field: #F5F6FA;
|
||||
--subtle: #F7F8FC;
|
||||
|
||||
/* 描边 */
|
||||
--line: #E8EAF1;
|
||||
--line-soft: #F0F2F7;
|
||||
--line-btn: #E3E6EF;
|
||||
|
||||
/* 文字五阶 */
|
||||
--t1: #12141B;
|
||||
--t2: #3C4250;
|
||||
--t3: #6E7686;
|
||||
--t4: #A3AAB8;
|
||||
--t5: #C6CBD6;
|
||||
|
||||
/* 主色(靛蓝) */
|
||||
--brand: #4F5AE8;
|
||||
--brand-ink: #3D47D4;
|
||||
--brand-soft: #EEF0FE;
|
||||
--brand-track: #DDE1F8;
|
||||
--brand-hover: #4550E0;
|
||||
|
||||
/* 语义色 */
|
||||
--good: #0E9F76; --good-ink: #0B8A66; --good-soft: #EBF7F2; --good-line: #D3EDE3;
|
||||
--warn: #D98218; --warn-ink: #B4700F; --warn-soft: #FDF3E4; --warn-line: rgba(217, 130, 24, .28);
|
||||
--danger: #E5484D; --danger-ink: #CC3B40; --danger-soft: #FDEDED; --danger-line: #F6D7D8;
|
||||
|
||||
/* 圆角 */
|
||||
--r-row: 8px;
|
||||
--r-field: 9px;
|
||||
--r-btn: 10px;
|
||||
--r-sub: 12px;
|
||||
--r-card: 14px;
|
||||
--r-pill: 999px;
|
||||
|
||||
/* 阴影(插件内基本不用,保持与壳子同值) */
|
||||
--sh-card: 0 2px 8px rgba(18, 20, 31, .05);
|
||||
--sh-float: 0 8px 24px rgba(18, 20, 31, .10);
|
||||
--sh-brand: 0 4px 12px rgba(79, 89, 232, .28);
|
||||
--sh-brand-sm: 0 2px 8px rgba(79, 89, 232, .24);
|
||||
|
||||
/* 字体 */
|
||||
--f-cn: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
|
||||
--f-num: "Inter", "SF Pro Display", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
||||
--f-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
|
||||
|
||||
/* 间距 */
|
||||
--space-1: 4px;
|
||||
--space-1-5: 6px;
|
||||
--space-2: 8px;
|
||||
--space-2-5: 10px;
|
||||
--space-3: 12px;
|
||||
--space-4: 16px;
|
||||
--space-5: 20px;
|
||||
--space-6: 28px;
|
||||
|
||||
--dur: .15s;
|
||||
--ease: cubic-bezier(.22, 1, .36, 1);
|
||||
}
|
||||
|
||||
/* ---------- Element Plus → 壳子 token ---------- */
|
||||
:root {
|
||||
--el-color-primary: var(--brand);
|
||||
--el-color-primary-light-3: #7A83EE;
|
||||
--el-color-primary-light-5: #A6ACF4;
|
||||
--el-color-primary-light-7: #C9CDF9;
|
||||
--el-color-primary-light-8: #DDE0FB;
|
||||
--el-color-primary-light-9: var(--brand-soft);
|
||||
--el-color-primary-dark-2: var(--brand-ink);
|
||||
|
||||
--el-color-success: var(--good);
|
||||
--el-color-success-light-9: var(--good-soft);
|
||||
--el-color-warning: var(--warn);
|
||||
--el-color-warning-light-9: var(--warn-soft);
|
||||
--el-color-danger: var(--danger);
|
||||
--el-color-danger-light-9: var(--danger-soft);
|
||||
--el-color-error: var(--danger);
|
||||
|
||||
--el-text-color-primary: var(--t1);
|
||||
--el-text-color-regular: var(--t2);
|
||||
--el-text-color-secondary: var(--t3);
|
||||
--el-text-color-placeholder: var(--t4);
|
||||
|
||||
--el-border-color: var(--line);
|
||||
--el-border-color-light: var(--line);
|
||||
--el-border-color-lighter: var(--line-soft);
|
||||
--el-border-color-extra-light: var(--line-soft);
|
||||
--el-fill-color-blank: var(--surface);
|
||||
--el-fill-color-light: var(--field);
|
||||
--el-bg-color: var(--surface);
|
||||
|
||||
--el-border-radius-base: var(--r-field);
|
||||
--el-border-radius-small: var(--r-field);
|
||||
--el-font-family: var(--f-cn);
|
||||
--el-font-size-base: 12.5px;
|
||||
--el-box-shadow-light: var(--sh-card);
|
||||
}
|
||||
|
||||
/* ---------- 基础重置 ---------- */
|
||||
* { box-sizing: border-box; }
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: var(--surface);
|
||||
color: var(--t1);
|
||||
font-family: var(--f-cn);
|
||||
font-size: 12.5px;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
#app { padding: 0; }
|
||||
|
||||
/* ---------- 页面:只排垂直节奏(左右 24px 由壳子给) ---------- */
|
||||
.page {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-4);
|
||||
padding: 2px 0 20px;
|
||||
}
|
||||
|
||||
/* ---------- 工具条:方案下拉 + 存为方案 + 删除 + 已保存胶囊 ---------- */
|
||||
.toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
flex-wrap: wrap;
|
||||
min-height: 32px;
|
||||
}
|
||||
.toolbar .spacer { flex: 1; }
|
||||
.scheme-sel { width: 200px; }
|
||||
|
||||
.saved {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
height: 22px;
|
||||
padding: 0 9px;
|
||||
border-radius: var(--r-pill);
|
||||
background: var(--good-soft);
|
||||
border: 1px solid var(--good-line);
|
||||
color: var(--good-ink);
|
||||
font: 500 11px/1 var(--f-cn);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.saved i { width: 5px; height: 5px; border-radius: 50%; background: var(--good); }
|
||||
.saved.is-idle { background: var(--field); border-color: var(--line); color: var(--t4); }
|
||||
.saved.is-idle i { background: var(--t5); }
|
||||
|
||||
/* ---------- 提示条(替代顶部大横幅) ---------- */
|
||||
.notice {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-2);
|
||||
padding: 9px 12px;
|
||||
border-radius: var(--r-sub);
|
||||
border: 1px solid var(--line);
|
||||
background: var(--subtle);
|
||||
font: 400 12px/18px var(--f-cn);
|
||||
color: var(--t2);
|
||||
}
|
||||
.notice .n-ico { flex: 0 0 auto; font-weight: 700; }
|
||||
.notice.is-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn-ink); }
|
||||
.notice.is-error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger-ink); }
|
||||
.notice.is-ok { background: var(--good-soft); border-color: var(--good-line); color: var(--good-ink); }
|
||||
|
||||
/* ---------- 分区卡:与壳子列表卡/表格卡同一套 ---------- */
|
||||
.sec {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-sub);
|
||||
overflow: hidden;
|
||||
}
|
||||
.sec-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
padding: 10px 14px;
|
||||
background: var(--subtle);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.sec-badge {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 6px;
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
font: 600 10.5px/1 var(--f-num);
|
||||
color: var(--brand-ink);
|
||||
background: var(--brand-soft);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.sec-name { font: 600 13px/18px var(--f-cn); color: var(--t1); white-space: nowrap; }
|
||||
.sec-line { flex: 1; height: 1px; background: var(--line-soft); }
|
||||
.sec-body { padding: 14px 14px 6px; }
|
||||
|
||||
/* ---------- 栅格与表单 ---------- */
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 0 16px;
|
||||
}
|
||||
.grid-switch { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
|
||||
/* 日期行紧跟在开关行后,补一点呼吸 */
|
||||
.grid-date { margin-top: 4px; }
|
||||
.grid .el-form-item { margin-bottom: 12px; }
|
||||
.grid .el-form-item__label {
|
||||
padding-bottom: 6px !important;
|
||||
font-weight: 500;
|
||||
color: var(--t2);
|
||||
}
|
||||
.grid .el-input,
|
||||
.grid .el-select,
|
||||
.grid .el-date-editor,
|
||||
.grid .el-input-number { width: 100% !important; }
|
||||
|
||||
/* ---------- 说明文字 ---------- */
|
||||
.tip {
|
||||
margin-top: var(--space-2);
|
||||
font: 400 11.5px/1.65 var(--f-cn);
|
||||
color: var(--t3);
|
||||
}
|
||||
.tip b { color: var(--t2); font-weight: 600; }
|
||||
|
||||
/* ---------- 执行摘要(操作区上方一行低调说明) ---------- */
|
||||
.plan { display: flex; align-items: baseline; gap: var(--space-2); font-size: 11.5px; line-height: 1.6; color: var(--t3); }
|
||||
.plan .p-tag { flex: 0 0 auto; font-weight: 600; color: var(--brand-ink); }
|
||||
.plan .p-text { min-width: 0; }
|
||||
.plan.is-empty .p-text { color: var(--warn); }
|
||||
|
||||
/* ---------- 操作区 ---------- */
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
flex-wrap: wrap;
|
||||
padding-top: 14px;
|
||||
border-top: 1px solid var(--line-soft);
|
||||
}
|
||||
.actions .spacer { flex: 1; }
|
||||
.btn-run {
|
||||
min-width: 150px;
|
||||
height: 34px;
|
||||
border: none;
|
||||
border-radius: var(--r-btn);
|
||||
background: var(--brand);
|
||||
color: #fff;
|
||||
font: 600 12.5px/18px var(--f-cn);
|
||||
letter-spacing: 1px;
|
||||
box-shadow: var(--sh-brand);
|
||||
transition: background var(--dur), box-shadow var(--dur), transform .06s;
|
||||
}
|
||||
.btn-run:hover { background: var(--brand-hover); }
|
||||
.btn-run:active { transform: translateY(1px); box-shadow: var(--sh-brand-sm); }
|
||||
.btn-run.is-loading { pointer-events: none; }
|
||||
|
||||
/* ---------- 状态胶囊(与壳子表格状态列同款) ---------- */
|
||||
.badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
height: 22px;
|
||||
padding: 0 9px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 6px;
|
||||
font: 500 11px/1 var(--f-cn);
|
||||
white-space: nowrap;
|
||||
}
|
||||
.badge i { width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0; }
|
||||
.badge.ok { color: var(--good-ink); background: var(--good-soft); border-color: var(--good-line); }
|
||||
.badge.ok i { background: var(--good); }
|
||||
.badge.warn { color: var(--warn-ink); background: var(--warn-soft); border-color: var(--warn-line); }
|
||||
.badge.warn i { background: var(--warn); }
|
||||
.badge.bad { color: var(--danger-ink); background: var(--danger-soft); border-color: var(--danger-line); }
|
||||
.badge.bad i { background: var(--danger); }
|
||||
.badge.idle { color: var(--t3); background: var(--field); border-color: var(--line); }
|
||||
.badge.idle i { background: var(--t5); }
|
||||
|
||||
/* ---------- 表格(插件内需要列表时用;与壳子表格同口径) ---------- */
|
||||
.table-card {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-sub);
|
||||
overflow: hidden;
|
||||
}
|
||||
.table-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-3);
|
||||
padding: 12px 16px;
|
||||
background: var(--subtle);
|
||||
border-bottom: 1px solid var(--line);
|
||||
font: 600 13.5px/20px var(--f-cn);
|
||||
color: var(--t1);
|
||||
}
|
||||
.table { width: 100%; border-collapse: collapse; table-layout: fixed; }
|
||||
.table th {
|
||||
padding: 10px 16px;
|
||||
text-align: center;
|
||||
font: 500 11px/16px var(--f-cn);
|
||||
color: var(--t3);
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
.table td {
|
||||
padding: 10px 16px;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid var(--line-soft);
|
||||
font: 400 12px/18px var(--f-cn);
|
||||
color: var(--t2);
|
||||
}
|
||||
.table tr:last-child td { border-bottom: 0; }
|
||||
.table tbody tr { transition: background var(--dur); }
|
||||
.table tbody tr:hover { background: var(--field); }
|
||||
.table td.is-name { text-align: left; font-weight: 600; color: var(--t1); }
|
||||
.table th.is-name { text-align: left; }
|
||||
|
||||
/* ---------- 运行态一行文字(进度由壳子 RunIndicator 展示) ---------- */
|
||||
.runline { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--t3); }
|
||||
.runline .pct { font: 600 12px/1 var(--f-num); color: var(--brand-ink); font-variant-numeric: tabular-nums; }
|
||||
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.4s ease-out infinite; }
|
||||
@keyframes pulse {
|
||||
0% { box-shadow: 0 0 0 0 var(--brand-soft); }
|
||||
70% { box-shadow: 0 0 0 7px transparent; }
|
||||
100% { box-shadow: 0 0 0 0 transparent; }
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
v3.1 扩展:步骤卡 / 行式设置项 / 折叠说明
|
||||
- 适用于「互斥步骤」「开关+联动下拉」「大段流程说明」
|
||||
- 仍然只用 token,不写字面色值
|
||||
============================================================ */
|
||||
|
||||
/* ---------- 步骤卡(互斥单选,≤4 项) ---------- */
|
||||
.step-cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: var(--space-2-5);
|
||||
}
|
||||
.step-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
padding: 11px 32px 11px 13px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-sub);
|
||||
cursor: pointer;
|
||||
transition: border-color var(--dur), background var(--dur), box-shadow var(--dur);
|
||||
}
|
||||
.step-card:hover { border-color: var(--brand-track); background: var(--subtle); }
|
||||
.step-card.on {
|
||||
border-color: var(--brand);
|
||||
background: var(--brand-soft);
|
||||
box-shadow: inset 0 0 0 1px var(--brand-soft);
|
||||
}
|
||||
.step-card .sc-title { font: 600 13px/18px var(--f-cn); color: var(--t1); }
|
||||
.step-card.on .sc-title { color: var(--brand-ink); }
|
||||
.step-card .sc-desc { font: 400 11.5px/1.6 var(--f-cn); color: var(--t3); }
|
||||
.step-card .sc-check {
|
||||
position: absolute; top: 10px; right: 10px;
|
||||
width: 16px; height: 16px; color: var(--brand);
|
||||
}
|
||||
.step-cards.is-disabled .step-card { opacity: .55; pointer-events: none; }
|
||||
.sr-only {
|
||||
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
|
||||
overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
|
||||
}
|
||||
|
||||
/* ---------- 行式设置项(标题+说明在左,控件在右) ---------- */
|
||||
.rows {
|
||||
display: flex; flex-direction: column; gap: var(--space-2);
|
||||
padding: var(--space-2);
|
||||
background: var(--subtle);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-sub);
|
||||
}
|
||||
.row {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
gap: var(--space-4);
|
||||
padding: 9px 12px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line-soft);
|
||||
border-radius: var(--r-field);
|
||||
}
|
||||
.row .r-main { min-width: 0; }
|
||||
.row .r-title { font: 500 12.5px/18px var(--f-cn); color: var(--t1); }
|
||||
.row .r-desc { margin-top: 1px; font: 400 11.5px/1.6 var(--f-cn); color: var(--t3); }
|
||||
.row .r-ctrl { flex: 0 0 auto; }
|
||||
.row.is-hidden { display: none; }
|
||||
|
||||
/* ---------- 折叠说明(流程说明气泡卡片) ---------- */
|
||||
.help {
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--r-sub);
|
||||
overflow: hidden;
|
||||
}
|
||||
.help > summary {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
gap: var(--space-2); padding: 10px 14px;
|
||||
background: var(--subtle);
|
||||
font: 600 12.5px/18px var(--f-cn); color: var(--t2);
|
||||
cursor: pointer; list-style: none;
|
||||
}
|
||||
.help > summary::-webkit-details-marker { display: none; }
|
||||
.help[open] > summary { border-bottom: 1px solid var(--line); }
|
||||
.help .h-arrow { color: var(--t4); transition: transform var(--dur); font-size: 11px; }
|
||||
.help[open] .h-arrow { transform: rotate(180deg); }
|
||||
.help-body {
|
||||
padding: 12px 14px;
|
||||
font: 400 12px/1.8 var(--f-cn); color: var(--t3);
|
||||
}
|
||||
.help-body b { color: var(--t2); font-weight: 600; }
|
||||
.help-body .hb-line + .hb-line { margin-top: 6px; }
|
||||
@@ -0,0 +1,356 @@
|
||||
// 插件 UI 公共 kit v2(vendored 进各插件 ui-src,构建期内联,运行零外部依赖)。
|
||||
//
|
||||
// 与 v1 的差异(适配当前壳子):
|
||||
// 1. 新增 restoreLastFields():调 /api/plugins/<id>/last-fields 恢复上次执行参数(password 不落盘);
|
||||
// 2. 顶部大横幅 → 内联 notice:执行结果横幅、插件名/版本、运行 Indicator 已由壳子
|
||||
// (PageHead + 结果横幅 + RunIndicator)统一渲染,插件内不再重复;
|
||||
// 3. startRun 的 409 单独识别:壳子在 iframe fetch 上包了「入队确认」,用户取消会返回 409,
|
||||
// 不能再当成普通失败提示。
|
||||
//
|
||||
// 保留能力:本机当前配置(加载/防抖自动保存/恢复默认)、多配置方案(供定时任务按 config_id 引用)、
|
||||
// 执行状态机(执行/强停/WS 进度 + 轮询兜底/未登录重试)。
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { PLUGIN_ID } from './api'
|
||||
|
||||
async function j(url, opts) {
|
||||
const res = await fetch(url, opts)
|
||||
if (res.status === 401) {
|
||||
throw Object.assign(new Error('未登录:请先在壳子登录统一账户再打开本界面'), { code: 401 })
|
||||
}
|
||||
if (!res.ok) {
|
||||
let msg = `HTTP ${res.status}`
|
||||
try {
|
||||
msg = (await res.json()).detail || msg
|
||||
} catch (_) { /* 保留默认 */ }
|
||||
throw Object.assign(new Error(msg), { code: res.status, status: res.status })
|
||||
}
|
||||
return res.json()
|
||||
}
|
||||
|
||||
// ---- 后端 API(同源,统一账户会话 cookie 自动携带)----
|
||||
const loadConfig = () => j(`/api/plugin-config/${PLUGIN_ID}`)
|
||||
const saveConfig = (data) => j(`/api/plugin-config/${PLUGIN_ID}`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
const loadLastFields = () => j(`/api/plugins/${PLUGIN_ID}/last-fields`)
|
||||
const listSchemes = () => j(`/api/plugin-configs?plugin_id=${encodeURIComponent(PLUGIN_ID)}`)
|
||||
const saveScheme = (name, fields) => j('/api/plugin-configs', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ plugin_id: PLUGIN_ID, name, fields }),
|
||||
})
|
||||
const deleteScheme = (cfgId) =>
|
||||
j(`/api/plugin-configs/${encodeURIComponent(PLUGIN_ID)}/${encodeURIComponent(cfgId)}`, { method: 'DELETE' })
|
||||
const startRun = (fields) => j('/api/runs', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ plugin_id: PLUGIN_ID, fields }),
|
||||
})
|
||||
const getRun = (runId) => j(`/api/runs/${runId}`)
|
||||
const stopRun = (runId) => j(`/api/runs/${runId}/stop`, { method: 'POST' })
|
||||
|
||||
function connectWS(onEvent) {
|
||||
const ws = new WebSocket((location.protocol === 'https:' ? 'wss://' : 'ws://')
|
||||
+ location.host + '/ws')
|
||||
ws.onmessage = (e) => { try { onEvent(JSON.parse(e.data)) } catch (_) { /* 忽略脏帧 */ } }
|
||||
return ws
|
||||
}
|
||||
|
||||
// ---- 工具 ----
|
||||
const clone = (o) => JSON.parse(JSON.stringify(o))
|
||||
|
||||
// 本机配置的「上次保存时间」:后端只存字段、不返回时间戳,
|
||||
// 这里用 localStorage 记住,刷新后仍能显示(取不到时静默)。
|
||||
const SAVED_AT_KEY = `plugin:${PLUGIN_ID}:lastSavedAt`
|
||||
function readSavedAt() {
|
||||
try { return localStorage.getItem(SAVED_AT_KEY) || '' } catch (_) { return '' }
|
||||
}
|
||||
function writeSavedAt(v) {
|
||||
try { localStorage.setItem(SAVED_AT_KEY, v) } catch (_) { /* 存储不可用时只保留内存态 */ }
|
||||
}
|
||||
|
||||
// 保存字段合并规则:标量空值(''/null/undefined)不覆盖;数组照原样应用
|
||||
// (空数组可能是有意配置,如「留空=不筛选」)
|
||||
function mergeSaved(form, saved) {
|
||||
Object.keys(form).forEach((k) => {
|
||||
const v = saved ? saved[k] : undefined
|
||||
if (v === undefined || v === null || v === '') return
|
||||
form[k] = Array.isArray(v) ? [...v] : v
|
||||
})
|
||||
}
|
||||
|
||||
export function usePluginUI(opts = {}) {
|
||||
const { defaults, validate, buildPayload } = opts
|
||||
|
||||
const form = reactive(defaults ? defaults() : {})
|
||||
const loaded = ref(false)
|
||||
const needLogin = ref(false)
|
||||
const notice = ref(null) // { type: 'warn'|'error'|'ok', text }
|
||||
const lastSavedAt = ref(readSavedAt())
|
||||
const running = ref(false)
|
||||
const progress = ref(0)
|
||||
const stopping = ref(false)
|
||||
|
||||
let ws = null
|
||||
let runId = ''
|
||||
let pollTimer = null
|
||||
let saveTimer = null
|
||||
|
||||
// 传空 type 视为清除横幅(不能留 {type:null},否则会渲染成只有"!"的空横幅)
|
||||
const notify = (type, text) => { notice.value = type ? { type, text } : null }
|
||||
|
||||
// ---------- 当前配置:加载 / 防抖自动保存 ----------
|
||||
// 登录由壳子统一处理(打开界面时会话必然就绪),这里读取失败一律静默回退默认值,
|
||||
// 不弹任何提示;真到执行时才发现会话问题,再明确告知。
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const saved = await loadConfig()
|
||||
mergeSaved(form, saved)
|
||||
} catch (e) {
|
||||
if (e.code === 401) needLogin.value = true
|
||||
}
|
||||
loaded.value = true
|
||||
refreshSchemes()
|
||||
})
|
||||
|
||||
watch(form, () => {
|
||||
if (!loaded.value || running.value) return
|
||||
clearTimeout(saveTimer)
|
||||
saveTimer = setTimeout(() => saveNow(false), 800)
|
||||
}, { deep: true })
|
||||
|
||||
async function saveNow(explicit) {
|
||||
try {
|
||||
await saveConfig(clone(form))
|
||||
lastSavedAt.value = new Date().toLocaleTimeString('zh-CN', { hour12: false })
|
||||
writeSavedAt(lastSavedAt.value)
|
||||
if (explicit) ElMessage.success('配置已保存到本机')
|
||||
} catch (e) {
|
||||
if (e.code === 401) needLogin.value = true
|
||||
else ElMessage.error('配置保存失败:' + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
function resetDefaults() {
|
||||
Object.assign(form, defaults ? defaults(form) : {})
|
||||
notify(null)
|
||||
ElMessage.info('已恢复默认配置')
|
||||
}
|
||||
|
||||
// 恢复上次执行参数(壳子记录,password 类字段不落盘)
|
||||
async function restoreLastFields() {
|
||||
try {
|
||||
const r = await loadLastFields()
|
||||
const fields = r.fields || {}
|
||||
if (!Object.keys(fields).length) {
|
||||
ElMessage.info('暂无上次执行参数')
|
||||
return
|
||||
}
|
||||
mergeSaved(form, fields)
|
||||
ElMessage.success('已恢复上次执行参数' + (r.at ? `(${r.at})` : ''))
|
||||
} catch (e) {
|
||||
if (e.code === 401) needLogin.value = true
|
||||
else ElMessage.error('恢复上次参数失败:' + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 多配置方案 ----------
|
||||
const schemes = ref([])
|
||||
const schemeSel = ref('')
|
||||
const schemeOptions = computed(() => [
|
||||
{ value: '', label: '当前配置(自动保存)' },
|
||||
...schemes.value.map((s) => ({ value: s.id, label: s.name })),
|
||||
])
|
||||
|
||||
async function refreshSchemes() {
|
||||
try {
|
||||
const r = await listSchemes()
|
||||
schemes.value = r.configs || []
|
||||
} catch (_) { /* 方案是辅助能力,失败静默 */ }
|
||||
}
|
||||
|
||||
function onSchemeChange(id) {
|
||||
if (!id) return
|
||||
const s = schemes.value.find((x) => x.id === id)
|
||||
if (!s) return
|
||||
mergeSaved(form, s.fields)
|
||||
ElMessage.success(`已应用方案「${s.name}」`)
|
||||
}
|
||||
|
||||
async function saveSchemeAs() {
|
||||
const cur = schemes.value.find((x) => x.id === schemeSel.value)
|
||||
let name = ''
|
||||
try {
|
||||
({ value: name } = await ElMessageBox.prompt(
|
||||
'方案保存到本机(同名覆盖,密码明文保存,每套方案可绑定不同账号),供「定时任务」引用:到点自动取该方案的最新参数执行。',
|
||||
'存为配置方案',
|
||||
{
|
||||
inputValue: cur ? cur.name : '',
|
||||
confirmButtonText: '保存方案',
|
||||
cancelButtonText: '取消',
|
||||
inputPattern: /\S/,
|
||||
inputErrorMessage: '请输入方案名称',
|
||||
},
|
||||
))
|
||||
} catch (_) {
|
||||
return
|
||||
}
|
||||
name = String(name).trim()
|
||||
if (!name) return
|
||||
const dup = schemes.value.find((x) => x.name === name)
|
||||
if (dup) {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`已存在同名方案「${dup.name}」,保存将覆盖它的参数(多套不同配置请用不同名称)。`,
|
||||
'覆盖已有方案',
|
||||
{ type: 'warning', confirmButtonText: '覆盖保存', cancelButtonText: '取消' },
|
||||
)
|
||||
} catch (_) {
|
||||
return
|
||||
}
|
||||
}
|
||||
try {
|
||||
const r = await saveScheme(name, clone(form))
|
||||
await refreshSchemes()
|
||||
schemeSel.value = r.config ? r.config.id : ''
|
||||
ElMessage.success(`方案「${name}」已保存`)
|
||||
} catch (e) {
|
||||
if (e.code === 401) needLogin.value = true
|
||||
else ElMessage.error('方案保存失败:' + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
async function removeScheme() {
|
||||
const s = schemes.value.find((x) => x.id === schemeSel.value)
|
||||
if (!s) return
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`删除配置方案「${s.name}」?引用它的定时任务到点会跳过触发并提示重选。`,
|
||||
'删除方案',
|
||||
{ type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消' },
|
||||
)
|
||||
} catch (_) {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await deleteScheme(s.id)
|
||||
schemeSel.value = ''
|
||||
await refreshSchemes()
|
||||
ElMessage.success('方案已删除')
|
||||
} catch (e) {
|
||||
ElMessage.error('方案删除失败:' + e.message)
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 执行 ----------
|
||||
// action: download(只下载)/ reconcile(只核对);不传则用 payload 里的 action
|
||||
async function run(action) {
|
||||
if (running.value) return
|
||||
if (needLogin.value) {
|
||||
try {
|
||||
await loadConfig()
|
||||
needLogin.value = false
|
||||
} catch (_) {
|
||||
notify('error', '登录态未就绪,请稍后重试')
|
||||
return
|
||||
}
|
||||
}
|
||||
if (validate && !validate(action)) return
|
||||
await saveNow(false)
|
||||
notify(null)
|
||||
running.value = true
|
||||
progress.value = 0
|
||||
try {
|
||||
const payload = buildPayload ? buildPayload(form) : clone(form)
|
||||
if (action) payload.action = action
|
||||
const r = await startRun(payload)
|
||||
runId = r.run_id
|
||||
connect()
|
||||
startPolling()
|
||||
} catch (e) {
|
||||
running.value = false
|
||||
stopPolling()
|
||||
if (e.code === 401) {
|
||||
needLogin.value = true
|
||||
notify('error', '登录态未就绪,本次没有启动,请稍后重试')
|
||||
} else if (e.code === 409) {
|
||||
// 壳子「入队确认」里用户点了取消
|
||||
notify('warn', '已取消加入执行队列,本次没有启动')
|
||||
} else {
|
||||
notify('error', '启动执行失败:' + e.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function forceStop() {
|
||||
if (!runId || stopping.value) return
|
||||
stopping.value = true
|
||||
try {
|
||||
await stopRun(runId)
|
||||
ElMessage.warning('已发出强制停止指令,正在终止执行进程…')
|
||||
} catch (e) {
|
||||
ElMessage.error('停止失败:' + e.message)
|
||||
} finally {
|
||||
stopping.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function connect() {
|
||||
if (ws && ws.readyState <= 1) return
|
||||
ws = connectWS((ev) => {
|
||||
if (ev.run_id && ev.run_id !== runId) return
|
||||
if (ev.t === 'progress') progress.value = Math.max(progress.value, ev.pct || 0)
|
||||
// 用户强制停止 / 排队取消 / 排队超时 → 「已取消」,不显示成「执行失败」
|
||||
else if (ev.t === 'run_done') ev.ok ? finished() : (ev.status === 'cancelled' ? cancelled(ev.error) : failed(ev.error || '执行失败'))
|
||||
})
|
||||
ws.onclose = () => { ws = null }
|
||||
}
|
||||
|
||||
function startPolling() {
|
||||
stopPolling()
|
||||
pollTimer = setInterval(async () => {
|
||||
if (!runId) return
|
||||
try {
|
||||
const r = await getRun(runId)
|
||||
if (r.status === 'done') finished(r.result?.summary)
|
||||
else if (r.status === 'cancelled') cancelled(r.error)
|
||||
else if (r.status === 'error') failed(r.error || '执行失败')
|
||||
} catch (_) { /* 下轮再试 */ }
|
||||
}, 5000)
|
||||
}
|
||||
|
||||
function stopPolling() {
|
||||
if (pollTimer) { clearInterval(pollTimer); pollTimer = null }
|
||||
}
|
||||
|
||||
function finished(summary) {
|
||||
stopPolling()
|
||||
running.value = false
|
||||
progress.value = 100
|
||||
// 结果横幅由壳子统一展示,插件内仅在需要时给一句简短结论
|
||||
if (summary) notify('ok', summary)
|
||||
}
|
||||
|
||||
// 用户主动停止 / 排队取消 / 排队超时:不算失败,给中性的「已取消」提示
|
||||
function cancelled(err) {
|
||||
stopPolling()
|
||||
running.value = false
|
||||
notify('warn', '任务已取消:' + (err || '用户已停止'))
|
||||
}
|
||||
|
||||
function failed(err) {
|
||||
stopPolling()
|
||||
running.value = false
|
||||
notify('error', '执行失败:' + err)
|
||||
}
|
||||
|
||||
return {
|
||||
form, loaded, needLogin, notice, lastSavedAt, running, progress, stopping,
|
||||
saveNow, resetDefaults, restoreLastFields,
|
||||
schemes, schemeSel, schemeOptions, onSchemeChange, saveSchemeAs, removeScheme,
|
||||
run, forceStop,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// 插件 UI 由壳子后端托管在 /pui/xq0078/ 下,
|
||||
// 构建产物直接输出到插件包 ui/ 目录(随插件 zip 发布,壳子零改动)。
|
||||
// dev 模式经代理访问本机壳子后端,便于联调。
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
base: '/pui/xq0078/',
|
||||
build: {
|
||||
outDir: '../ui',
|
||||
emptyOutDir: true,
|
||||
},
|
||||
server: {
|
||||
port: 5184, // 按插件错开:xq0002=5180、xq0047=5181、xq0041=5182、xq0045_xq0046=5183
|
||||
proxy: {
|
||||
'/api': 'http://127.0.0.1:8799',
|
||||
'/ws': { target: 'ws://127.0.0.1:8799', ws: true },
|
||||
},
|
||||
},
|
||||
})
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>金色湖畔小程序数据导出</title>
|
||||
<script type="module" crossorigin src="/pui/xq0078/assets/index-D7Nfer-u.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/pui/xq0078/assets/index-BH3-PIMO.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>␍
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user