Compare commits
196
Commits
174fbb54c5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e7ccc1ba4 | ||
|
|
ec5dfcd82f | ||
|
|
7a59c65252 | ||
|
|
5d3358d844 | ||
|
|
eceddb5f7d | ||
|
|
376827ea97 | ||
|
|
024ecddfed | ||
|
|
51d5b8a2a1 | ||
|
|
374de05059 | ||
|
|
ee65fc7fd2 | ||
|
|
a254cbd3e9 | ||
|
|
f3dd1ec3b1 | ||
|
|
7fe26d3fff | ||
|
|
30ceab4615 | ||
|
|
d391b0fd00 | ||
|
|
304c59c8f3 | ||
|
|
b497eb4a59 | ||
|
|
561378312f | ||
|
|
a061ec86ce | ||
|
|
49f1212e33 | ||
|
|
a5386f72c6 | ||
|
|
ec582ac9f9 | ||
|
|
4f9347b6aa | ||
|
|
305896796c | ||
|
|
5afa7ab9df | ||
|
|
c2733017fd | ||
|
|
44a03fd5f4 | ||
|
|
beb898b1ab | ||
|
|
330df53195 | ||
|
|
8bb4b98fc9 | ||
|
|
4cd296c066 | ||
|
|
f97fd72bd0 | ||
|
|
ac84e991d1 | ||
|
|
0e4e4670dd | ||
|
|
c5bdbc0457 | ||
|
|
3e48fdf61e | ||
|
|
1970db0b56 | ||
|
|
5f31c58df2 | ||
|
|
4a119358ca | ||
|
|
6928127bfa | ||
|
|
7885f42cff | ||
|
|
7c33482be7 | ||
|
|
7bdf7cf018 | ||
|
|
384d2b7aa0 | ||
|
|
4868de2cda | ||
|
|
9e8913ea0a | ||
|
|
f5e9420266 | ||
|
|
79909f449e | ||
|
|
d07cffe99e | ||
|
|
2c7262770b | ||
|
|
fac4a714e0 | ||
|
|
7a8279f8e7 | ||
|
|
fbb53c6890 | ||
|
|
7faa2d53d8 | ||
|
|
b124795d84 | ||
|
|
f53cdd4dc8 | ||
|
|
4c562428b4 | ||
|
|
ef7b5939ba | ||
|
|
6bcfbfb252 | ||
|
|
1dfcc38a83 | ||
|
|
8e74b60570 | ||
|
|
3ce5bfc20c | ||
|
|
b56b9bbe37 | ||
|
|
ed38dec314 | ||
|
|
3595935475 | ||
|
|
e6d9ff49a2 | ||
|
|
55423403a6 | ||
|
|
8c4aabb9a4 | ||
|
|
dcd306b428 | ||
|
|
bcba0f598a | ||
|
|
b1c3d86e44 | ||
|
|
6db34646ed | ||
|
|
6f29e3d865 | ||
|
|
7d78a33a9d | ||
|
|
6d01e7489a | ||
|
|
09b1e535e4 | ||
|
|
00ae62f62b | ||
|
|
41366e7fc4 | ||
|
|
d40906b4a3 | ||
|
|
8ad5ef9aff | ||
|
|
ba32e0ef9c | ||
|
|
02246c7ec8 | ||
|
|
6c3c0f7c6d | ||
|
|
451b04160b | ||
|
|
0007e78bfe | ||
|
|
f6fde18857 | ||
|
|
f14e6bd88d | ||
|
|
93e83e1835 | ||
|
|
3c07ef7a8d | ||
|
|
f80ca1e27d | ||
|
|
1549d5b25d | ||
|
|
030baa511e | ||
|
|
e30de6562c | ||
|
|
39aed0d430 | ||
|
|
427968a721 | ||
|
|
42cc64106d | ||
|
|
35bb96e82f | ||
|
|
5b16bc6e15 | ||
|
|
4e62b325d2 | ||
|
|
5c6b422866 | ||
|
|
1c95f94bca | ||
|
|
324bcfdadc | ||
|
|
df12f51199 | ||
|
|
4740078135 | ||
|
|
9c70d7929a | ||
|
|
869d437485 | ||
|
|
9805a371d8 | ||
|
|
d98f8d7975 | ||
|
|
1d6bc8f7cc | ||
|
|
b25ebc5fff | ||
|
|
1273a0138e | ||
|
|
4f6e17ba5e | ||
|
|
92a3c2b8c7 | ||
|
|
dc6dbc05d8 | ||
|
|
4083613dbe | ||
|
|
ed526709c8 | ||
|
|
b9000e1b93 | ||
|
|
54cc5301c3 | ||
|
|
d86a85e6a6 | ||
|
|
48e54dc115 | ||
|
|
b32b56f8bc | ||
|
|
8c553c7221 | ||
|
|
7b65b3c6d8 | ||
|
|
a9709377bb | ||
|
|
d7616b193e | ||
|
|
09f3a94cea | ||
|
|
7f1a0dbeb4 | ||
|
|
264015b7e9 | ||
|
|
b45fd161f0 | ||
|
|
b2811cc248 | ||
|
|
80aecab586 | ||
|
|
59ddf677b6 | ||
|
|
32ac2112b0 | ||
|
|
f9b7997ec2 | ||
|
|
bc26d62602 | ||
|
|
5732be847e | ||
|
|
a6776ffe0a | ||
|
|
1cd19434d1 | ||
|
|
f208424a26 | ||
|
|
479b324f95 | ||
|
|
1902ba1e87 | ||
|
|
fe3ef82718 | ||
|
|
6195508481 | ||
|
|
8f1bbf2411 | ||
|
|
117da19f16 | ||
|
|
1be52d75a0 | ||
|
|
18951b01d6 | ||
|
|
aa692f3c9f | ||
|
|
05c7ade3f5 | ||
|
|
7650c3537a | ||
|
|
a579a5b00a | ||
|
|
ea80cd96cc | ||
|
|
fc04bf65e6 | ||
|
|
4ea00f1322 | ||
|
|
4cdde50695 | ||
|
|
542daca457 | ||
|
|
4c13ef478c | ||
|
|
985f18c750 | ||
|
|
fd034ff055 | ||
|
|
17515cf9c5 | ||
|
|
8aa116ec43 | ||
|
|
b520d29368 | ||
|
|
f019760297 | ||
|
|
9b27508a5b | ||
|
|
1c501ff713 | ||
|
|
8e9d3a7e49 | ||
|
|
1df2822f01 | ||
|
|
b340b77d5a | ||
|
|
c3328e7279 | ||
|
|
d9d1122e9c | ||
|
|
7e86f2a821 | ||
|
|
b7a910b758 | ||
|
|
54ea83b262 | ||
|
|
794d981260 | ||
|
|
52749bf232 | ||
|
|
72e55d95fd | ||
|
|
293e1121c5 | ||
|
|
5d83a81b31 | ||
|
|
cfe806728d | ||
|
|
c152e00501 | ||
|
|
6ded62df92 | ||
|
|
9fbfab54c2 | ||
|
|
5dd7d14334 | ||
|
|
fcec5b996f | ||
|
|
ed1487d505 | ||
|
|
57ff405691 | ||
|
|
74021d26bb | ||
|
|
6da08d9d4f | ||
|
|
32172582ff | ||
|
|
7d61de70e3 | ||
|
|
fa89f43ac9 | ||
|
|
3179754670 | ||
|
|
116b6b2223 | ||
|
|
8843ae4261 | ||
|
|
135fb4eaa4 | ||
|
|
8d871c0828 |
No files matched your search
+8
-4
@@ -7,7 +7,7 @@
|
||||
/.workbuddy/
|
||||
|
||||
# Project planning, internal docs, and local-only development files
|
||||
/.aksrt-chrome-profile/
|
||||
/.jio-chrome-profile/
|
||||
/.specs/
|
||||
/docs/
|
||||
|
||||
@@ -23,13 +23,17 @@ assets/css/routes/docs/*
|
||||
!assets/css/routes/docs/toolbar-search-enhancements.css
|
||||
|
||||
# Frontend build output and installed dependencies.
|
||||
# assets/admin/build is deploy-only: build it on the target with
|
||||
# assets/admin/build and assets/creator-studio/build are deploy-only:
|
||||
# build them on the target with
|
||||
# cd assets/admin && npm ci && npm run build
|
||||
# cd assets/creator-studio && npm ci && npm run build
|
||||
/assets/admin/node_modules/
|
||||
/assets/admin/build/*
|
||||
!/assets/admin/build/.gitkeep
|
||||
/assets/admin/build/
|
||||
assets/admin/.vite-temp/
|
||||
|
||||
/assets/creator-studio/node_modules/
|
||||
/assets/creator-studio/build/
|
||||
|
||||
# PHP installed dependencies
|
||||
/vendor/*
|
||||
!/vendor/.gitkeep
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
/**
|
||||
* 404 template.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
get_header();
|
||||
|
||||
$search_placeholder = function_exists('aksrt_get_search_placeholder') ? aksrt_get_search_placeholder() : __('开启精彩搜索', 'aksrt');
|
||||
$hot_keywords = function_exists('aksrt_get_search_hot_keywords') ? aksrt_get_search_hot_keywords() : [];
|
||||
$search_placeholder = function_exists('jio_get_search_placeholder') ? jio_get_search_placeholder() : __('开启精彩搜索', 'jio');
|
||||
$hot_keywords = function_exists('jio_get_search_hot_keywords') ? jio_get_search_hot_keywords() : [];
|
||||
|
||||
$hot_query = new WP_Query([
|
||||
'post_type' => 'post',
|
||||
@@ -39,33 +39,33 @@ $top_cats = get_terms([
|
||||
<i class="fa fas fa-compass"></i>
|
||||
</p>
|
||||
<p class="error-hero__code" id="error-title">404</p>
|
||||
<h1 class="error-hero__title"><?php esc_html_e('页面未找到', 'aksrt'); ?></h1>
|
||||
<h1 class="error-hero__title"><?php esc_html_e('页面未找到', 'jio'); ?></h1>
|
||||
<p class="error-hero__desc">
|
||||
<?php esc_html_e('你访问的页面不存在或已被删除。试试搜索,或者从下方常用入口继续浏览。', 'aksrt'); ?>
|
||||
<?php esc_html_e('你访问的页面不存在或已被删除。试试搜索,或者从下方常用入口继续浏览。', 'jio'); ?>
|
||||
</p>
|
||||
</div>
|
||||
<?php if (function_exists('aksrt_render_admin_quick_link')) { aksrt_render_admin_quick_link('page-display/other', __('404 页设置', 'aksrt')); } ?>
|
||||
<?php if (function_exists('jio_render_admin_quick_link')) { jio_render_admin_quick_link('page-display/other', __('404 页设置', 'jio')); } ?>
|
||||
</div>
|
||||
|
||||
<form role="search" method="get" class="error-hero__search" action="<?php echo esc_url(home_url('/')); ?>">
|
||||
<span class="error-hero__search-icon" aria-hidden="true">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
|
||||
</span>
|
||||
<label class="screen-reader-text" for="error-search-input"><?php esc_html_e('搜索', 'aksrt'); ?></label>
|
||||
<label class="screen-reader-text" for="error-search-input"><?php esc_html_e('搜索', 'jio'); ?></label>
|
||||
<input type="search" id="error-search-input" name="s" placeholder="<?php echo esc_attr($search_placeholder); ?>" autocomplete="off">
|
||||
<button type="submit" class="btn-primary btn-sm"><?php esc_html_e('搜索', 'aksrt'); ?></button>
|
||||
<button type="submit" class="btn-primary btn-sm"><?php esc_html_e('搜索', 'jio'); ?></button>
|
||||
</form>
|
||||
<?php aksrt_render_search_hot_keywords($hot_keywords, 'aksrt-search-hot-keywords'); ?>
|
||||
<?php jio_render_search_hot_keywords($hot_keywords, 'jio-search-hot-keywords'); ?>
|
||||
|
||||
<div class="error-hero__actions">
|
||||
<a href="<?php echo esc_url(home_url('/')); ?>" class="btn-primary"><?php esc_html_e('返回首页', 'aksrt'); ?></a>
|
||||
<a href="javascript:history.back()" class="btn-outline"><?php esc_html_e('返回上一页', 'aksrt'); ?></a>
|
||||
<a href="<?php echo esc_url(home_url('/')); ?>" class="btn-primary"><?php esc_html_e('返回首页', 'jio'); ?></a>
|
||||
<a href="javascript:history.back()" class="btn-outline"><?php esc_html_e('返回上一页', 'jio'); ?></a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php if (!empty($top_cats) && !is_wp_error($top_cats)) : ?>
|
||||
<section class="error-section" aria-label="<?php esc_attr_e('热门分类', 'aksrt'); ?>">
|
||||
<h2 class="error-section__title"><?php esc_html_e('热门分类', 'aksrt'); ?></h2>
|
||||
<section class="error-section" aria-label="<?php esc_attr_e('热门分类', 'jio'); ?>">
|
||||
<h2 class="error-section__title"><?php esc_html_e('热门分类', 'jio'); ?></h2>
|
||||
<div class="error-section__chips">
|
||||
<?php foreach ($top_cats as $cat) : ?>
|
||||
<a class="error-section__chip" href="<?php echo esc_url(get_category_link($cat->term_id)); ?>">
|
||||
@@ -78,8 +78,8 @@ $top_cats = get_terms([
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($hot_query->have_posts()) : ?>
|
||||
<section class="error-section" aria-label="<?php esc_attr_e('热门内容', 'aksrt'); ?>">
|
||||
<h2 class="error-section__title"><?php esc_html_e('热门内容', 'aksrt'); ?></h2>
|
||||
<section class="error-section" aria-label="<?php esc_attr_e('热门内容', 'jio'); ?>">
|
||||
<h2 class="error-section__title"><?php esc_html_e('热门内容', 'jio'); ?></h2>
|
||||
<ul class="error-section__list">
|
||||
<?php while ($hot_query->have_posts()) : $hot_query->the_post(); ?>
|
||||
<li>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# AKSRT WordPress Theme
|
||||
# Jio WordPress Theme
|
||||
|
||||
> **版本**: 3.4.0-dev | **架构**: 原生 PHP + WordPress (非 headless)
|
||||
> **要求**: WordPress >= 6.4 | PHP >= 8.1
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
## 项目概述
|
||||
|
||||
AKSRT 是一款现代化的 WordPress 主题,采用**原生 WordPress 主题架构**开发(PHP + HTML + CSS + JavaScript),不依赖 REST API 进行前端渲染。
|
||||
Jio 是一款现代化的 WordPress 主题,采用**原生 WordPress 主题架构**开发(PHP + HTML + CSS + JavaScript),不依赖 REST API 进行前端渲染。
|
||||
|
||||
### 核心特性
|
||||
|
||||
@@ -22,14 +22,14 @@ AKSRT 是一款现代化的 WordPress 主题,采用**原生 WordPress 主题
|
||||
## 文件结构
|
||||
|
||||
```
|
||||
AKSRT-theme/
|
||||
Jio/
|
||||
├── functions.php # 入口:常量 + Composer autoload + bootstrap + 单例 init
|
||||
├── style.css # WordPress 主题声明头
|
||||
├── composer.json # 第三方依赖 + 主题 PSR-4(AKSRT\ → src/)
|
||||
├── composer.json # 第三方依赖 + 主题 PSR-4(Jio\ → src/)
|
||||
│
|
||||
├── *.php # WP 核心模板保留根目录
|
||||
│
|
||||
├── src/ # Composer PSR-4 类型根(namespace AKSRT\)
|
||||
├── src/ # Composer PSR-4 类型根(namespace Jio\)
|
||||
│ ├── Admin/ # SPA 编排 + 域控制器 + Schema + Native ops
|
||||
│ ├── Auth/ # 登录 / OAuth / 审核 / 邮箱
|
||||
│ ├── Content/ # 下载 token / 付费内容 / VIP / 可见性
|
||||
@@ -89,7 +89,7 @@ AKSRT-theme/
|
||||
|
||||
## 安装方式
|
||||
|
||||
主题类型(`AKSRT\…`)通过 Composer PSR-4 从 `src/` 自动加载;`vendor/` 不进 Git。**部署或更新主题后必须在主题根目录生成 autoload**,否则会出现 `Class "AKSRT\Core\DomainModel" not found` 等致命错误。
|
||||
主题类型(`Jio\…`)通过 Composer PSR-4 从 `src/` 自动加载;`vendor/` 不进 Git。**部署或更新主题后必须在主题根目录生成 autoload**,否则会出现 `Class "Jio\Core\DomainModel" not found` 等致命错误。
|
||||
|
||||
### 前置:Composer(必做)
|
||||
|
||||
@@ -106,16 +106,16 @@ composer dump-autoload -o
|
||||
确认:
|
||||
|
||||
```bash
|
||||
php -r "require 'vendor/autoload.php'; echo class_exists('AKSRT\\\\Core\\\\DomainModel') ? \"ok\\n\" : \"missing\\n\";"
|
||||
php -r "require 'vendor/autoload.php'; echo class_exists('Jio\\\\Core\\\\DomainModel') ? \"ok\\n\" : \"missing\\n\";"
|
||||
```
|
||||
|
||||
应输出 `ok`。若 PHP 开启了 OPcache,重载 php-fpm / 重启 PHP 后再访问站点。
|
||||
|
||||
### 方式一:直接上传(推荐)
|
||||
|
||||
1. 将整个 `AKSRT-theme` 文件夹上传到 `wp-content/themes/`
|
||||
1. 将整个 `Jio` 文件夹上传到 `wp-content/themes/`
|
||||
2. 在服务器主题目录执行上一节的 `composer install`(若打包时已带上完整 `vendor/` 且已 `dump-autoload`,可跳过)
|
||||
3. WordPress 后台 → **外观** → **主题** → 找到 **AKSRT** → **激活**
|
||||
3. WordPress 后台 → **外观** → **主题** → 找到 **Jio** → **激活**
|
||||
|
||||
### 方式二:ZIP 打包上传
|
||||
|
||||
@@ -126,7 +126,7 @@ php -r "require 'vendor/autoload.php'; echo class_exists('AKSRT\\\\Core\\\\Domai
|
||||
SSH 进入主题目录后:
|
||||
|
||||
```bash
|
||||
cd /path/to/wp-content/themes/AKsrt-theme # 以实际路径为准
|
||||
cd /path/to/wp-content/themes/Jio # 以实际路径为准
|
||||
composer install --no-dev --optimize-autoloader
|
||||
# 或仅刷新映射:composer dump-autoload -o
|
||||
# 可选:reload php-fpm / 清 OPcache
|
||||
@@ -150,9 +150,9 @@ composer install --no-dev --optimize-autoloader
|
||||
|
||||
### 2. 后台配置路径
|
||||
|
||||
WordPress 后台左侧 **Admin Bar** → ⚡ **AKSRT 主题设置**
|
||||
WordPress 后台左侧 **Admin Bar** → ⚡ **Jio 主题设置**
|
||||
|
||||
或直接访问:`/wp-admin/admin.php?page=aksrt-settings`
|
||||
或直接访问:`/wp-admin/admin.php?page=jio-settings`
|
||||
|
||||
### 3. 当前后台域
|
||||
|
||||
@@ -167,13 +167,13 @@ WordPress 后台左侧 **Admin Bar** → ⚡ **AKSRT 主题设置**
|
||||
### 4. 推广、邀请与佣金(用户中心 → 收益)
|
||||
|
||||
- **推广链接**:用户中心「收益」页展示带 `?ref=` 的推广链接、二维码(可下载 PNG)与推广海报(按「推广返佣」设置中的海报文案生成)。归因模式(首触/末触)在「支付&付费 → 推广返佣 → 推广归因模式」配置。
|
||||
- **一次性邀请码**:后台「用户 → 邀请码管理」三视图运营页——列表(状态筛选/搜索/批量删除/排序/分页/点击复制)、添加(系统自动生成:数量/标识/四类奖励[经验值、积分、余额、VIP]/高级选项自定义位数;或 Zibll 兼容文本导入:一行一码 `邀请码 奖励 标识`,奖励参数串 `points=20&balance=30&vip=1&vip_time=5&level_integral=100`,分隔符可自定义)、导出(状态筛选 + 文本文档[可回流导入]/Excel表格 双格式)。注册门控模式在「用户&互动 → 登录注册 → 邀请码注册」。消费为原子操作,并发注册不会超发;开启注册验证时奖励延迟到邮箱验证后发放。
|
||||
- **一次性邀请码**:后台「用户 → 邀请码管理」三视图运营页——列表(状态筛选/搜索/批量删除/排序/分页/点击复制)、添加(系统自动生成:数量/标识/四类奖励[经验值、积分、余额、VIP]/高级选项自定义位数;或行格式文本导入:一行一码 `邀请码 奖励 标识`,奖励参数串 `points=20&balance=30&vip=1&vip_time=5&level_integral=100`,分隔符可自定义)、导出(状态筛选 + 文本文档[可回流导入]/Excel表格 双格式)。注册门控模式在「用户&互动 → 登录注册 → 邀请码注册」。消费为原子操作,并发注册不会超发;开启注册验证时奖励延迟到邮箱验证后发放。
|
||||
- **佣金**:订单支付成功后按推广者等级分档比例记录到佣金账本,经「结算观察期」后自动结算入钱包,支持提现与退款联动回滚。「推广码禁用后停止返佣」开关默认关闭。
|
||||
|
||||
### 5. 部署注意事项
|
||||
|
||||
- **佣金结算时效**:结算依赖小时级 wp-cron,并有收益页访问触发的懒结算兜底。高流量站点建议禁用 `WP_CRON_LOCK` 场景下的默认 WP-Cron,改用系统 crontab 定时请求 `wp-cron.php`,保证结算与过期任务准时执行。
|
||||
- **反代 / CDN 与 IP 风控**:主题默认按 Cloudflare → 通用代理头顺序识别真实 IP。若需收紧伪造风险,添加 `add_filter('aksrt_trusted_proxies', fn() => ['10.0.0.0/8', '173.245.48.0/20'])`(填入你的代理/CDN 网段);名单非空时仅当 `REMOTE_ADDR` 命中名单才采纳转发头,否则直接使用 `REMOTE_ADDR`(推广奖励的 IP 日上限、验证码等均依赖该函数)。
|
||||
- **反代 / CDN 与 IP 风控**:主题默认按 Cloudflare → 通用代理头顺序识别真实 IP。若需收紧伪造风险,添加 `add_filter('jio_trusted_proxies', fn() => ['10.0.0.0/8', '173.245.48.0/20'])`(填入你的代理/CDN 网段);名单非空时仅当 `REMOTE_ADDR` 命中名单才采纳转发头,否则直接使用 `REMOTE_ADDR`(推广奖励的 IP 日上限、验证码等均依赖该函数)。
|
||||
|
||||
---
|
||||
|
||||
@@ -181,20 +181,20 @@ WordPress 后台左侧 **Admin Bar** → ⚡ **AKSRT 主题设置**
|
||||
|
||||
### Settings Facade 分层
|
||||
|
||||
- `AKSRT_Settings` 仍是主题设置的**唯一静态 facade**,外部调用方式保持 `AKSRT_Settings::*`
|
||||
- `JIO_Settings` 仍是主题设置的**唯一静态 facade**,外部调用方式保持 `JIO_Settings::*`
|
||||
- 具体运行时 getter 已按领域拆分到 `inc/classes/settings/`,例如:
|
||||
- `class-aksrt-settings-theme-search.php`
|
||||
- `class-aksrt-settings-post-display.php`
|
||||
- `class-aksrt-settings-home-cms.php`
|
||||
- `class-aksrt-settings-user-runtime.php`
|
||||
- `class-aksrt-settings-integration.php`
|
||||
- `class-aksrt-settings-display-runtime.php`
|
||||
- `class-aksrt-settings-extension-runtime.php`
|
||||
- `class-aksrt-settings-credits-runtime.php`
|
||||
- `class-aksrt-settings-category-runtime.php`
|
||||
- `class-aksrt-settings-capabilities.php`
|
||||
- `inc/bootstrap.php` 会先加载 `settings/class-aksrt-settings.php`,再按领域加载这些 delegate 类
|
||||
- 新增设置运行时逻辑时,优先放入对应 settings 子类;仅把聚合输出、统一入口和跨域装配保留在 `AKSRT_Settings`
|
||||
- `class-jio-settings-theme-search.php`
|
||||
- `class-jio-settings-post-display.php`
|
||||
- `class-jio-settings-home-cms.php`
|
||||
- `class-jio-settings-user-runtime.php`
|
||||
- `class-jio-settings-integration.php`
|
||||
- `class-jio-settings-display-runtime.php`
|
||||
- `class-jio-settings-extension-runtime.php`
|
||||
- `class-jio-settings-credits-runtime.php`
|
||||
- `class-jio-settings-category-runtime.php`
|
||||
- `class-jio-settings-capabilities.php`
|
||||
- `inc/bootstrap.php` 会先加载 `settings/class-jio-settings.php`,再按领域加载这些 delegate 类
|
||||
- 新增设置运行时逻辑时,优先放入对应 settings 子类;仅把聚合输出、统一入口和跨域装配保留在 `JIO_Settings`
|
||||
|
||||
### 添加新辅助函数
|
||||
|
||||
@@ -202,14 +202,14 @@ WordPress 后台左侧 **Admin Bar** → ⚡ **AKSRT 主题设置**
|
||||
|
||||
### 添加新页面模板
|
||||
|
||||
将 `page-{name}.php` 放入 `templates/pages/`,并在 `class-aksrt-templates.php` 中注册。
|
||||
将 `page-{name}.php` 放入 `templates/pages/`,并在 `class-jio-templates.php` 中注册。
|
||||
|
||||
### CSS 组织规范
|
||||
|
||||
| 目录 | 用途 | 加载场景 |
|
||||
|------|------|---------|
|
||||
| `css/frontend/` | 前端公共样式 | 所有前台页面 |
|
||||
| `css/admin/` | 后台管理样式 | 仅 AKSRT 设置页面 |
|
||||
| `css/admin/` | 后台管理样式 | 仅 Jio 设置页面 |
|
||||
| `css/shared/` | 共用组件样式 | 前后端按需加载(如验证码) |
|
||||
|
||||
---
|
||||
|
||||
+26
-26
@@ -2,9 +2,9 @@
|
||||
/**
|
||||
* Resource Archive Template
|
||||
*
|
||||
* Virtual list at /resources/ — ordinary posts marked with _aksrt_is_resource.
|
||||
* Virtual list at /resources/ — ordinary posts marked with _jio_is_resource.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -25,18 +25,18 @@ if (!in_array($current_price, ['all', 'free', 'paid'], true)) {
|
||||
$price_min = isset($_GET['price_min']) && $_GET['price_min'] !== '' ? (float) $_GET['price_min'] : '';
|
||||
$price_max = isset($_GET['price_max']) && $_GET['price_max'] !== '' ? (float) $_GET['price_max'] : '';
|
||||
|
||||
$archive_url = function_exists('aksrt_resource_archive_url') ? aksrt_resource_archive_url() : home_url('/resources/');
|
||||
$archive_url = function_exists('jio_resource_archive_url') ? jio_resource_archive_url() : home_url('/resources/');
|
||||
|
||||
$sort_options = [
|
||||
'date' => __('最新', 'aksrt'),
|
||||
'downloads' => __('热门下载', 'aksrt'),
|
||||
'views' => __('阅读最多', 'aksrt'),
|
||||
'date' => __('最新', 'jio'),
|
||||
'downloads' => __('热门下载', 'jio'),
|
||||
'views' => __('阅读最多', 'jio'),
|
||||
];
|
||||
|
||||
$price_options = [
|
||||
'all' => __('全部', 'aksrt'),
|
||||
'free' => __('免费', 'aksrt'),
|
||||
'paid' => __('付费', 'aksrt'),
|
||||
'all' => __('全部', 'jio'),
|
||||
'free' => __('免费', 'jio'),
|
||||
'paid' => __('付费', 'jio'),
|
||||
];
|
||||
|
||||
$preserve = [];
|
||||
@@ -59,18 +59,18 @@ $has_filter = $current_orderby !== 'date' || $current_price !== 'all' || $price_
|
||||
<main id="main-content" class="site-main container" tabindex="-1">
|
||||
<header class="resource-archive-header page-cover">
|
||||
<div class="container">
|
||||
<?php if (function_exists('aksrt_breadcrumbs')) : ?>
|
||||
<nav class="resource-archive-header__breadcrumbs" aria-label="<?php esc_attr_e('面包屑', 'aksrt'); ?>">
|
||||
<?php aksrt_breadcrumbs(); ?>
|
||||
<?php if (function_exists('jio_breadcrumbs')) : ?>
|
||||
<nav class="resource-archive-header__breadcrumbs" aria-label="<?php esc_attr_e('面包屑', 'jio'); ?>">
|
||||
<?php jio_breadcrumbs(); ?>
|
||||
</nav>
|
||||
<?php endif; ?>
|
||||
|
||||
<h1 class="resource-archive-header__title"><?php esc_html_e('资源', 'aksrt'); ?></h1>
|
||||
<h1 class="resource-archive-header__title"><?php esc_html_e('资源', 'jio'); ?></h1>
|
||||
<p class="resource-archive-header__sub">
|
||||
<?php
|
||||
global $wp_query;
|
||||
/* translators: %s: resource count */
|
||||
printf(esc_html__('共 %s 个资源', 'aksrt'), esc_html(number_format_i18n((int) $wp_query->found_posts)));
|
||||
printf(esc_html__('共 %s 个资源', 'jio'), esc_html(number_format_i18n((int) $wp_query->found_posts)));
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
@@ -79,9 +79,9 @@ $has_filter = $current_orderby !== 'date' || $current_price !== 'all' || $price_
|
||||
<div class="content-wrap">
|
||||
<div class="content-layout content-layout--no-sidebar">
|
||||
<div class="content-layout__primary resource-archive">
|
||||
<nav class="resource-archive__toolbar" aria-label="<?php esc_attr_e('筛选', 'aksrt'); ?>">
|
||||
<nav class="resource-archive__toolbar" aria-label="<?php esc_attr_e('筛选', 'jio'); ?>">
|
||||
<div class="resource-archive__filter-group">
|
||||
<span class="resource-archive__filter-label"><?php esc_html_e('排序', 'aksrt'); ?></span>
|
||||
<span class="resource-archive__filter-label"><?php esc_html_e('排序', 'jio'); ?></span>
|
||||
<ul class="resource-archive__sort">
|
||||
<?php foreach ($sort_options as $key => $label) :
|
||||
$args = $preserve;
|
||||
@@ -105,7 +105,7 @@ $has_filter = $current_orderby !== 'date' || $current_price !== 'all' || $price_
|
||||
</div>
|
||||
|
||||
<div class="resource-archive__filter-group">
|
||||
<span class="resource-archive__filter-label"><?php esc_html_e('价格', 'aksrt'); ?></span>
|
||||
<span class="resource-archive__filter-label"><?php esc_html_e('价格', 'jio'); ?></span>
|
||||
<ul class="resource-archive__sort">
|
||||
<?php foreach ($price_options as $key => $label) :
|
||||
$args = $preserve;
|
||||
@@ -139,43 +139,43 @@ $has_filter = $current_orderby !== 'date' || $current_price !== 'all' || $price_
|
||||
}
|
||||
?>
|
||||
<label class="resource-archive__price-input">
|
||||
<span><?php esc_html_e('最低', 'aksrt'); ?></span>
|
||||
<span><?php esc_html_e('最低', 'jio'); ?></span>
|
||||
<input type="number" name="price_min" min="0" step="1" value="<?php echo esc_attr((string) $price_min); ?>">
|
||||
</label>
|
||||
<span class="resource-archive__price-sep">—</span>
|
||||
<label class="resource-archive__price-input">
|
||||
<span><?php esc_html_e('最高', 'aksrt'); ?></span>
|
||||
<span><?php esc_html_e('最高', 'jio'); ?></span>
|
||||
<input type="number" name="price_max" min="0" step="1" value="<?php echo esc_attr((string) $price_max); ?>">
|
||||
</label>
|
||||
<button type="submit" class="btn-primary btn-sm"><?php esc_html_e('应用', 'aksrt'); ?></button>
|
||||
<button type="submit" class="btn-primary btn-sm"><?php esc_html_e('应用', 'jio'); ?></button>
|
||||
</form>
|
||||
|
||||
<?php if ($has_filter) : ?>
|
||||
<a class="resource-archive__reset" href="<?php echo esc_url($archive_url); ?>">
|
||||
<i class="fa fas fa-times-circle" aria-hidden="true"></i>
|
||||
<?php esc_html_e('清除筛选', 'aksrt'); ?>
|
||||
<?php esc_html_e('清除筛选', 'jio'); ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</nav>
|
||||
|
||||
<?php if (have_posts()) : ?>
|
||||
<?php
|
||||
$render_config = aksrt_resolve_post_list_render_config([
|
||||
$render_config = jio_resolve_post_list_render_config([
|
||||
'context' => 'archive',
|
||||
'overrides' => ['type' => 'card'],
|
||||
]);
|
||||
|
||||
aksrt_render_post_list(array_merge($render_config, ['wrapper_class' => 'content-stream__list']));
|
||||
aksrt_render_pagination(null, [
|
||||
jio_render_post_list(array_merge($render_config, ['wrapper_class' => 'content-stream__list']));
|
||||
jio_render_pagination(null, [
|
||||
'query_context' => 'archive',
|
||||
'render_config' => $render_config,
|
||||
]);
|
||||
?>
|
||||
<?php else : ?>
|
||||
<div class="no-results">
|
||||
<p><?php esc_html_e('暂无资源。', 'aksrt'); ?></p>
|
||||
<p><?php esc_html_e('暂无资源。', 'jio'); ?></p>
|
||||
<?php if ($has_filter) : ?>
|
||||
<p><a class="btn-outline btn-sm" href="<?php echo esc_url($archive_url); ?>"><?php esc_html_e('清除筛选条件', 'aksrt'); ?></a></p>
|
||||
<p><a class="btn-outline btn-sm" href="<?php echo esc_url($archive_url); ?>"><?php esc_html_e('清除筛选条件', 'jio'); ?></a></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
+19
-19
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Generic archive template.
|
||||
*
|
||||
* @package AKSRT
|
||||
* @package Jio
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
@@ -11,31 +11,31 @@ get_header();
|
||||
|
||||
global $wp_query;
|
||||
|
||||
$render_config = function_exists('aksrt_archive_get_render_config')
|
||||
? aksrt_archive_get_render_config(['context' => 'archive'])
|
||||
$render_config = function_exists('jio_archive_get_render_config')
|
||||
? jio_archive_get_render_config(['context' => 'archive'])
|
||||
: ['context' => 'archive', 'mode' => 'list'];
|
||||
$has_sidebar = function_exists('aksrt_archive_has_sidebar')
|
||||
? aksrt_archive_has_sidebar()
|
||||
: (function_exists('aksrt_is_show_sidebar') ? aksrt_is_show_sidebar() : false);
|
||||
$has_sidebar = function_exists('jio_archive_has_sidebar')
|
||||
? jio_archive_has_sidebar()
|
||||
: (function_exists('jio_is_show_sidebar') ? jio_is_show_sidebar() : false);
|
||||
|
||||
$archive_description = trim(wp_strip_all_tags((string) get_the_archive_description()));
|
||||
$archive_summary = '';
|
||||
if (is_author()) {
|
||||
$author = get_queried_object();
|
||||
if ($author instanceof WP_User) {
|
||||
$archive_summary = sprintf(__('作者:%s', 'aksrt'), $author->display_name);
|
||||
$archive_summary = sprintf(__('作者:%s', 'jio'), $author->display_name);
|
||||
}
|
||||
} elseif ($archive_description !== '') {
|
||||
$archive_summary = $archive_description;
|
||||
} elseif (isset($wp_query->found_posts)) {
|
||||
$archive_summary = sprintf(
|
||||
esc_html(_n('共 %d 篇内容', '共 %d 篇内容', (int) $wp_query->found_posts, 'aksrt')),
|
||||
esc_html(_n('共 %d 篇内容', '共 %d 篇内容', (int) $wp_query->found_posts, 'jio')),
|
||||
(int) $wp_query->found_posts
|
||||
);
|
||||
}
|
||||
|
||||
if (function_exists('aksrt_archive_open_shell')) {
|
||||
aksrt_archive_open_shell([
|
||||
if (function_exists('jio_archive_open_shell')) {
|
||||
jio_archive_open_shell([
|
||||
'main_class' => 'site-main container',
|
||||
'has_sidebar' => $has_sidebar,
|
||||
'page_kind' => 'archive',
|
||||
@@ -45,16 +45,16 @@ if (function_exists('aksrt_archive_open_shell')) {
|
||||
}
|
||||
?>
|
||||
<div class="content-main content-main--archive">
|
||||
<?php if (function_exists('aksrt_breadcrumbs')) { aksrt_breadcrumbs(); } ?>
|
||||
<?php if (function_exists('jio_breadcrumbs')) { jio_breadcrumbs(); } ?>
|
||||
|
||||
<?php
|
||||
ob_start();
|
||||
if (function_exists('aksrt_render_admin_quick_link')) {
|
||||
aksrt_render_admin_quick_link('post-list/list', __('列表样式设置', 'aksrt'));
|
||||
if (function_exists('jio_render_admin_quick_link')) {
|
||||
jio_render_admin_quick_link('post-list/list', __('列表样式设置', 'jio'));
|
||||
}
|
||||
$admin_link = trim((string) ob_get_clean());
|
||||
get_template_part('templates/parts/page-header', null, [
|
||||
'eyebrow' => __('内容归档', 'aksrt'),
|
||||
'eyebrow' => __('内容归档', 'jio'),
|
||||
'title' => get_the_archive_title(),
|
||||
'desc' => $archive_summary,
|
||||
'extra' => $admin_link,
|
||||
@@ -62,19 +62,19 @@ if (function_exists('aksrt_archive_open_shell')) {
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (function_exists('aksrt_archive_render_stream')) {
|
||||
aksrt_archive_render_stream(null, $render_config, [
|
||||
if (function_exists('jio_archive_render_stream')) {
|
||||
jio_archive_render_stream(null, $render_config, [
|
||||
'page_kind' => 'archive',
|
||||
'query_context' => 'archive',
|
||||
'stream_class' => 'content-stream--archive',
|
||||
'empty_text' => __('暂无文章', 'aksrt'),
|
||||
'empty_text' => __('暂无文章', 'jio'),
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if (function_exists('aksrt_archive_close_shell')) {
|
||||
aksrt_archive_close_shell(['has_sidebar' => $has_sidebar]);
|
||||
if (function_exists('jio_archive_close_shell')) {
|
||||
jio_archive_close_shell(['has_sidebar' => $has_sidebar]);
|
||||
} else {
|
||||
echo '</div></div>';
|
||||
if ($has_sidebar) { get_sidebar(); }
|
||||
|
||||
@@ -104,7 +104,7 @@ const COMPONENT_STYLES = [
|
||||
]
|
||||
|
||||
async function extractStyles() {
|
||||
console.log('\n[AKSRT] 开始提取 NaiveUI 组件样式...\n')
|
||||
console.log('\n[Jio] 开始提取 NaiveUI 组件样式...\n')
|
||||
|
||||
const allCss = []
|
||||
let successCount = 0
|
||||
@@ -137,9 +137,9 @@ async function extractStyles() {
|
||||
// 静默跳过的后果是组件样式整体缺失(取色器曾因此没有尺寸和边框,糊成一团),
|
||||
// 而页面不报错,只能靠肉眼发现。
|
||||
if (code === 'ERR_MODULE_NOT_FOUND' || code === 'MODULE_NOT_FOUND') {
|
||||
console.error(`[AKSRT] 样式路径不存在,已跳过: ${componentPath}`)
|
||||
console.error(`[Jio] 样式路径不存在,已跳过: ${componentPath}`)
|
||||
} else {
|
||||
console.error(`[AKSRT] 样式提取异常,已跳过: ${componentPath}: ${err && err.message}`)
|
||||
console.error(`[Jio] 样式提取异常,已跳过: ${componentPath}: ${err && err.message}`)
|
||||
}
|
||||
failCount++
|
||||
}
|
||||
@@ -148,7 +148,7 @@ async function extractStyles() {
|
||||
const cssOutput = allCss.join('\n\n')
|
||||
|
||||
if (!cssOutput.trim()) {
|
||||
console.warn('[AKSRT] 警告:未提取到任何 NaiveUI 样式!')
|
||||
console.warn('[Jio] 警告:未提取到任何 NaiveUI 样式!')
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ ${cssOutput}`
|
||||
|
||||
await writeFile(cssFile, fullContent, 'utf-8')
|
||||
|
||||
console.log(`[AKSRT] NaiveUI 样式提取完成:`)
|
||||
console.log(`[Jio] NaiveUI 样式提取完成:`)
|
||||
console.log(` 成功: ${successCount} 个组件`)
|
||||
console.log(` 跳过: ${failCount} 个组件`)
|
||||
console.log(` 输出: ${cssFile}`)
|
||||
@@ -176,6 +176,6 @@ ${cssOutput}`
|
||||
|
||||
// 执行
|
||||
extractStyles().catch((err) => {
|
||||
console.error('[AKSRT] 样式提取失败:', err)
|
||||
console.error('[Jio] 样式提取失败:', err)
|
||||
process.exit(1)
|
||||
})
|
||||
@@ -3,10 +3,10 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>AKSRT 主题设置</title>
|
||||
<title>Jio 主题设置</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="aksrt-admin-app"></div>
|
||||
<div id="jio-admin-app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Generated
+121
-94
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "aksrt-admin",
|
||||
"name": "jio-admin",
|
||||
"version": "1.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "aksrt-admin",
|
||||
"name": "jio-admin",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@codemirror/lang-css": "^6.3.1",
|
||||
@@ -21,35 +21,36 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.1.0",
|
||||
"echarts": "^6.1.0",
|
||||
"esbuild": "^0.25.12",
|
||||
"vite": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
|
||||
"integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
|
||||
"version": "7.29.11",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.11.tgz",
|
||||
"integrity": "sha512-snZbO7MEDOof+hvNa97EjEY7qD7h2kwvQr5AJC3ZhQudKW5dnej6k3kP9NQV88hJwaS8vDqRLFo9rivLEhle2g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.28.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
|
||||
"integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
|
||||
"version": "7.29.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
|
||||
"integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.29.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz",
|
||||
"integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==",
|
||||
"version": "7.29.12",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.12.tgz",
|
||||
"integrity": "sha512-WJ7JBp/Q4+z/ImydtI7jS6NVco5++632ExBemSX+Ysb+G1lCwQ5BVo3SY+jGGOcZXI4ZccbZSUSJLNBW6eEpJg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.0"
|
||||
"@babel/types": "^7.29.11"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
@@ -59,13 +60,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
|
||||
"integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
|
||||
"version": "7.29.11",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.11.tgz",
|
||||
"integrity": "sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.27.1",
|
||||
"@babel/helper-validator-identifier": "^7.28.5"
|
||||
"@babel/helper-string-parser": "^7.29.11",
|
||||
"@babel/helper-validator-identifier": "^7.29.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -676,9 +677,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.5.5",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
|
||||
"integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
|
||||
"integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@juggle/resize-observer": {
|
||||
@@ -1137,53 +1138,53 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.33.tgz",
|
||||
"integrity": "sha512-3PZLQwFw4Za3TC8t0FvTy3wI16Kt+pmwcgNZca4Pj9iWL2E72a/gZlpBtAJvEdDMdCxdG/qq0C7PN0bsJuv0Rw==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.44.tgz",
|
||||
"integrity": "sha512-k34nCytbK8PQ1gR2mGROYOw6Pnv/mumqIdrZ3x2tbyXZDWm7ViKGLTfdB+DRrWqEQsLgGJvn0WN9jBif5zCTLQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.2",
|
||||
"@vue/shared": "3.5.33",
|
||||
"@babel/parser": "^7.29.9",
|
||||
"@vue/shared": "3.5.44",
|
||||
"entities": "^7.0.1",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.2.1"
|
||||
"source-map-js": "^1.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-dom": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.33.tgz",
|
||||
"integrity": "sha512-PXq0yrfCLzzL07rbXO4awtXY1Z06LG2eu6Adg3RJFa/j3Cii217XxxLXG22N330gw7GmALCY0Z8RgXEviwgpjA==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.44.tgz",
|
||||
"integrity": "sha512-W5AoBFWdw1lQAKiHowkfgFKFab82oSRT6sGsPfw/q1GRjsy/ZJFLHGhJyBRIFN9APLTUduDH9U2JAiPOIyKuYg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.5.33",
|
||||
"@vue/shared": "3.5.33"
|
||||
"@vue/compiler-core": "3.5.44",
|
||||
"@vue/shared": "3.5.44"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-sfc": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.33.tgz",
|
||||
"integrity": "sha512-UTUvRO9cY+rROrx/pvN9P5Z7FgA6QGfokUCfhQE4EnmUj3rVnK+CHI0LsEO1pg+I7//iRYMUfcNcCPe7tg0CoA==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.44.tgz",
|
||||
"integrity": "sha512-dzHmQ4jXTpdr5FjIQUeykVakN/uzqFbUo9/C5ikBFg3a3PeM6uRxeczx1ZbXBML0/zJstEh3ygYipzR5Z7b2Pw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.2",
|
||||
"@vue/compiler-core": "3.5.33",
|
||||
"@vue/compiler-dom": "3.5.33",
|
||||
"@vue/compiler-ssr": "3.5.33",
|
||||
"@vue/shared": "3.5.33",
|
||||
"@babel/parser": "^7.29.9",
|
||||
"@vue/compiler-core": "3.5.44",
|
||||
"@vue/compiler-dom": "3.5.44",
|
||||
"@vue/compiler-ssr": "3.5.44",
|
||||
"@vue/shared": "3.5.44",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.30.21",
|
||||
"postcss": "^8.5.10",
|
||||
"source-map-js": "^1.2.1"
|
||||
"postcss": "^8.5.29",
|
||||
"source-map-js": "^1.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-ssr": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.33.tgz",
|
||||
"integrity": "sha512-IErjYdnj1qIupG5xxiVIYiiRvDhGWV4zuh/RCrwfYpuL+HWQzeU6lCk/nF9r7olWMnjKxCAkOctT2qFWFkzb1A==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.44.tgz",
|
||||
"integrity": "sha512-xr5gb1JVHlfXJwSlRz1FeP6uxoazdzHuMTVLE7up+4Vrqxk219CvxLPxD9NXBt47yvZW7+p4DXfyp4O1fkByIA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.33",
|
||||
"@vue/shared": "3.5.33"
|
||||
"@vue/compiler-dom": "3.5.44",
|
||||
"@vue/shared": "3.5.44"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/devtools-api": {
|
||||
@@ -1193,53 +1194,51 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@vue/reactivity": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.33.tgz",
|
||||
"integrity": "sha512-p8UfIqyIhb0rYGlSgSBV+lPhF2iUSBcRy7enhTmPqKWadHy9kcOFYF1AejYBP9P+avnd3OBbD49DU4pLWX/94A==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.44.tgz",
|
||||
"integrity": "sha512-u+QJdKeBBEADkPdevsL+6E12QlYVfBD8Zcw5qjDQKtamI6l14KyqazJMobhCKelhWN5zpyKUiEDoTyHE93cqWw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.33"
|
||||
"@vue/shared": "3.5.44"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-core": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.33.tgz",
|
||||
"integrity": "sha512-UpFF45RI9//a7rvq7RdOQblb4tup7hHG9QsmIrxkFQLzQ7R8/iNQ5LE15NhLZ1/WcHMU2b47u6P33CPUelHyIQ==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.44.tgz",
|
||||
"integrity": "sha512-uEa/ndwjhrrhnOfb2p+sZy6zeoamJOISqaLSJGk/8R6nABT1ZldpzcJoPzKj+zHVomVBPcmQYyC2r4LtvDV6CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.33",
|
||||
"@vue/shared": "3.5.33"
|
||||
"@vue/reactivity": "3.5.44",
|
||||
"@vue/shared": "3.5.44"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-dom": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.33.tgz",
|
||||
"integrity": "sha512-IOxMsAOwquhfITgmOgaPYl7/j8gKUxUFoflRc+u4LxyD3+783xne8vNta1PONVCvCV9A0w7hkyEepINDqfO0tw==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.44.tgz",
|
||||
"integrity": "sha512-3fc4ARcXVhVBaJ3ujWiNZJARD6pkyRcwG+ZYhMzjKtKUp7MAY0HLwr7r3Smep3Li6ZaWT6ewdmx8XqdaD5oNZg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.33",
|
||||
"@vue/runtime-core": "3.5.33",
|
||||
"@vue/shared": "3.5.33",
|
||||
"@vue/reactivity": "3.5.44",
|
||||
"@vue/runtime-core": "3.5.44",
|
||||
"@vue/shared": "3.5.44",
|
||||
"csstype": "^3.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/server-renderer": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.33.tgz",
|
||||
"integrity": "sha512-0xylq/8/h44lVG0pZFknv1XIdEgymq2E9n59uTWJBG+dIgiT0TMCSsxrN7nO16Z0MU0MPjFcguBbZV8Itk52Hw==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.44.tgz",
|
||||
"integrity": "sha512-R4S1UoH4h5Frrauv8Z5XE5TxV9oBiUSgWIC4TyVK1FK+RocRnOLwFA5Xcmo2011RlgJp+AbZCnw6afrhlgRuUQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-ssr": "3.5.33",
|
||||
"@vue/shared": "3.5.33"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "3.5.33"
|
||||
"@vue/compiler-ssr": "3.5.44",
|
||||
"@vue/runtime-dom": "3.5.44",
|
||||
"@vue/shared": "3.5.44"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/shared": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.33.tgz",
|
||||
"integrity": "sha512-5vR2QIlmaLG77Ygd4pMP6+SGQ5yox9VhtnbDWTy9DzMzdmeLxZ1QqxrywEZ9sa1AVubfIJyaCG3ytyWU81ufcQ==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.44.tgz",
|
||||
"integrity": "sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/async-validator": {
|
||||
@@ -1310,6 +1309,17 @@
|
||||
"date-fns": "^3.0.0 || ^4.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/echarts": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/echarts/-/echarts-6.1.0.tgz",
|
||||
"integrity": "sha512-q0yaFPggC9FUdsWH4blavRWFmxdrIodbkoKNAjJudAI6CA9gNPxHtV2RcZNEepZVlk4yvBYkOkbk6HIVpIyHZA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "2.3.0",
|
||||
"zrender": "6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",
|
||||
@@ -1472,9 +1482,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.12",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz",
|
||||
"integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==",
|
||||
"version": "3.3.20",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
||||
"integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
@@ -1531,9 +1541,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.13",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.13.tgz",
|
||||
"integrity": "sha512-qif0+jGGZoLWdHey3UFHHWP0H7Gbmsk8T5VEqyYFbWqPr1XqvLGBbk/sl8V5exGmcYJklJOhOQq1pV9IcsiFag==",
|
||||
"version": "8.5.32",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz",
|
||||
"integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -1550,9 +1560,9 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.11",
|
||||
"nanoid": "^3.3.20",
|
||||
"picocolors": "^1.1.1",
|
||||
"source-map-js": "^1.2.1"
|
||||
"source-map-js": "^1.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
@@ -1616,9 +1626,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",
|
||||
"integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
@@ -1653,6 +1663,13 @@
|
||||
"integrity": "sha512-M8RGFoKtZ8dF+iwJfAJTOH/SM4KluKOKRJpjCMhI8bG3qB74zrFoArKZ62ll0Fr3mqkMJiQOmWYkdYgDeITYQg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
||||
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
|
||||
"dev": true,
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/vdirs": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/vdirs/-/vdirs-0.1.8.tgz",
|
||||
@@ -1666,9 +1683,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "6.4.2",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-6.4.2.tgz",
|
||||
"integrity": "sha512-2N/55r4JDJ4gdrCvGgINMy+HH3iRpNIz8K6SFwVsA+JbQScLiC+clmAxBgwiSPgcG9U15QmvqCGWzMbqda5zGQ==",
|
||||
"version": "6.4.5",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-6.4.5.tgz",
|
||||
"integrity": "sha512-4enwjFfi4IwtEh0w+jPzpLVOFQiPHmmzPxcHXQOyEur47o6u0jE573DmGpjA+7irXoMLYRZD5ZaFUEneS3abPg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1753,16 +1770,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vue": {
|
||||
"version": "3.5.33",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.33.tgz",
|
||||
"integrity": "sha512-1AgChhx5w3ALgT4oK3acm2Es/7jyZhWSVUfs3rOBlGQC0rjEDkS7G4lWlJJGGNQD+BV3reCwbQrOe1mPNwKHBQ==",
|
||||
"version": "3.5.44",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.44.tgz",
|
||||
"integrity": "sha512-dvvmaOCG7lAMkJTPqPwWeGMsPS6DIsFsfZDUgBp9V6mHf9b3+/wyVwYR4Es+WV6uJC0FKRxp81Obcq0ZwUcGFQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.33",
|
||||
"@vue/compiler-sfc": "3.5.33",
|
||||
"@vue/runtime-dom": "3.5.33",
|
||||
"@vue/server-renderer": "3.5.33",
|
||||
"@vue/shared": "3.5.33"
|
||||
"@vue/compiler-dom": "3.5.44",
|
||||
"@vue/compiler-sfc": "3.5.44",
|
||||
"@vue/runtime-dom": "3.5.44",
|
||||
"@vue/server-renderer": "3.5.44",
|
||||
"@vue/shared": "3.5.44"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*"
|
||||
@@ -1849,6 +1866,16 @@
|
||||
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz",
|
||||
"integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/zrender": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/zrender/-/zrender-6.1.0.tgz",
|
||||
"integrity": "sha512-oEGMDB6pOP2S6OwRR4PdVv610zrjnA3Bh+JnSG12fYJlBKjtNAoEb5fSUoCOOINlH96I2fU38/A2UpRKs67xYQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"tslib": "2.3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
{"name":"aksrt-admin","version":"1.0.0","private":true,"type":"module","scripts":{"dev":"vite","build":"vite build && node extract-naive-styles.mjs","build:public":"node ../../tools/build-public-assets.mjs","preview":"vite preview"},"dependencies":{"@codemirror/lang-css":"^6.3.1","@codemirror/lang-html":"^6.4.11","@codemirror/lang-javascript":"^6.2.5","@codemirror/theme-one-dark":"^6.1.3","codemirror":"^6.0.2","naive-ui":"^2.40.0","pinia":"^2.2.0","vue":"^3.5.0","vue-router":"^4.4.0","vuedraggable":"^4.1.0"},"devDependencies":{"@vitejs/plugin-vue":"^5.1.0","esbuild":"^0.25.12","vite":"^6.0.0"}}
|
||||
{"name":"jio-admin","version":"1.0.0","private":true,"type":"module","scripts":{"dev":"vite","build":"vite build && node extract-naive-styles.mjs","build:public":"node ../../tools/build-public-assets.mjs","build:pay-charts":"node ../../tools/build-pay-charts.mjs","preview":"vite preview"},"dependencies":{"@codemirror/lang-css":"^6.3.1","@codemirror/lang-html":"^6.4.11","@codemirror/lang-javascript":"^6.2.5","@codemirror/theme-one-dark":"^6.1.3","codemirror":"^6.0.2","naive-ui":"^2.40.0","pinia":"^2.2.0","vue":"^3.5.0","vue-router":"^4.4.0","vuedraggable":"^4.1.0"},"devDependencies":{"@vitejs/plugin-vue":"^5.1.0","echarts":"^6.1.0","esbuild":"^0.25.12","vite":"^6.0.0"},"allowScripts":{"esbuild@0.25.12":true,"vue-demi@0.14.10":true}}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
+45
-45
@@ -6,9 +6,9 @@
|
||||
<n-message-provider>
|
||||
<n-dialog-provider>
|
||||
<n-notification-provider>
|
||||
<n-layout v-if="!isMobile" class="aksrt-admin-layout" has-sider>
|
||||
<n-layout v-if="!isMobile" class="jio-admin-layout" has-sider>
|
||||
<n-layout-sider
|
||||
class="aksrt-admin-sider"
|
||||
class="jio-admin-sider"
|
||||
bordered
|
||||
collapse-mode="width"
|
||||
:collapsed-width="64"
|
||||
@@ -19,16 +19,16 @@
|
||||
@collapse="collapsed = true"
|
||||
@expand="collapsed = false"
|
||||
>
|
||||
<div class="aksrt-logo">
|
||||
<div class="jio-logo">
|
||||
<span class="logo-icon">AK</span>
|
||||
<span v-if="!collapsed" class="aksrt-logo__copy">
|
||||
<span class="logo-text">AKSRT</span>
|
||||
<span class="aksrt-logo__version">v{{ themeVersion }}</span>
|
||||
<span v-if="!collapsed" class="jio-logo__copy">
|
||||
<span class="logo-text">Jio</span>
|
||||
<span class="jio-logo__version">v{{ themeVersion }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<n-menu
|
||||
class="aksrt-admin-menu"
|
||||
class="jio-admin-menu"
|
||||
:value="activeMenuKey"
|
||||
:collapsed="collapsed"
|
||||
:collapsed-width="64"
|
||||
@@ -37,39 +37,39 @@
|
||||
/>
|
||||
</n-layout-sider>
|
||||
|
||||
<n-layout :native-scrollbar="false" class="aksrt-admin-content">
|
||||
<div class="aksrt-admin-content__inner">
|
||||
<n-layout :native-scrollbar="false" class="jio-admin-content">
|
||||
<div class="jio-admin-content__inner">
|
||||
<router-view v-slot="{ Component }">
|
||||
<transition name="fade-slide" mode="out-in">
|
||||
<div class="aksrt-page-wrapper" :key="route.fullPath">
|
||||
<div class="jio-page-wrapper" :key="route.fullPath">
|
||||
<component :is="Component" />
|
||||
</div>
|
||||
</transition>
|
||||
</router-view>
|
||||
|
||||
<div v-if="pageError" class="aksrt-error-fallback">
|
||||
<p class="aksrt-error-title">页面渲染异常</p>
|
||||
<p class="aksrt-error-msg">{{ pageError }}</p>
|
||||
<div v-if="pageError" class="jio-error-fallback">
|
||||
<p class="jio-error-title">页面渲染异常</p>
|
||||
<p class="jio-error-msg">{{ pageError }}</p>
|
||||
<n-button size="small" @click="pageError = null">重试</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</n-layout>
|
||||
</n-layout>
|
||||
|
||||
<div v-else class="aksrt-admin-mobile">
|
||||
<div v-else class="jio-admin-mobile">
|
||||
<MobileTopBar :title="currentPageTitle" @toggle="drawerActive = true" />
|
||||
|
||||
<n-drawer v-model:show="drawerActive" placement="left" :width="280">
|
||||
<n-drawer-content :native-scrollbar="false" body-content-style="padding:0;">
|
||||
<div class="aksrt-logo aksrt-logo--drawer">
|
||||
<div class="jio-logo jio-logo--drawer">
|
||||
<span class="logo-icon">AK</span>
|
||||
<span class="aksrt-logo__copy">
|
||||
<span class="logo-text">AKSRT</span>
|
||||
<span class="aksrt-logo__version">v{{ themeVersion }}</span>
|
||||
<span class="jio-logo__copy">
|
||||
<span class="logo-text">Jio</span>
|
||||
<span class="jio-logo__version">v{{ themeVersion }}</span>
|
||||
</span>
|
||||
</div>
|
||||
<n-menu
|
||||
class="aksrt-admin-menu"
|
||||
class="jio-admin-menu"
|
||||
:value="activeMenuKey"
|
||||
:options="menuOptions"
|
||||
@update:value="handleMenuClick"
|
||||
@@ -77,18 +77,18 @@
|
||||
</n-drawer-content>
|
||||
</n-drawer>
|
||||
|
||||
<div class="aksrt-admin-mobile__body">
|
||||
<div class="jio-admin-mobile__body">
|
||||
<router-view v-slot="{ Component }">
|
||||
<transition name="fade-slide" mode="out-in">
|
||||
<div class="aksrt-page-wrapper" :key="route.fullPath">
|
||||
<div class="jio-page-wrapper" :key="route.fullPath">
|
||||
<component :is="Component" />
|
||||
</div>
|
||||
</transition>
|
||||
</router-view>
|
||||
|
||||
<div v-if="pageError" class="aksrt-error-fallback">
|
||||
<p class="aksrt-error-title">页面渲染异常</p>
|
||||
<p class="aksrt-error-msg">{{ pageError }}</p>
|
||||
<div v-if="pageError" class="jio-error-fallback">
|
||||
<p class="jio-error-title">页面渲染异常</p>
|
||||
<p class="jio-error-msg">{{ pageError }}</p>
|
||||
<n-button size="small" @click="pageError = null">重试</n-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -113,7 +113,7 @@ const collapsed = ref(false)
|
||||
const pageError = ref(null)
|
||||
const isMobile = ref(false)
|
||||
const drawerActive = ref(false)
|
||||
const themeVersion = window.aksrtAdminData?.themeVersion || window.aksrtAdminData?.version || '9.0'
|
||||
const themeVersion = window.jioAdminData?.themeVersion || window.jioAdminData?.version || '9.0'
|
||||
const MOBILE_BREAKPOINT = 960
|
||||
|
||||
const adminThemeOverrides = {
|
||||
@@ -184,7 +184,7 @@ onBeforeUnmount(() => {
|
||||
provide('collapsed', collapsed)
|
||||
|
||||
onErrorCaptured((err) => {
|
||||
console.error('[AKSRT] 组件渲染错误:', err)
|
||||
console.error('[Jio] 组件渲染错误:', err)
|
||||
pageError.value = err?.message || String(err)
|
||||
return false
|
||||
})
|
||||
@@ -224,7 +224,7 @@ const menuOptions = ADMIN_SECTIONS.filter((section) => !section.hidden).map((sec
|
||||
children: section.children.map((child) => ({
|
||||
label: child.secondaryEntry ? `${child.label} · 次级` : child.label,
|
||||
key: child.key,
|
||||
props: child.secondaryEntry ? { class: 'aksrt-menu-item--secondary' } : undefined,
|
||||
props: child.secondaryEntry ? { class: 'jio-menu-item--secondary' } : undefined,
|
||||
})),
|
||||
}
|
||||
})
|
||||
@@ -254,7 +254,7 @@ const activeMenuKey = computed(() => {
|
||||
return ADMIN_SECTIONS[0]?.children?.[0]?.key || 'global-common'
|
||||
})
|
||||
|
||||
const currentPageTitle = computed(() => route.meta?.title || 'AKSRT')
|
||||
const currentPageTitle = computed(() => route.meta?.title || 'Jio')
|
||||
|
||||
function handleMenuClick(key) {
|
||||
if (keyToPath[key]) {
|
||||
@@ -267,17 +267,17 @@ function handleMenuClick(key) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-logo {
|
||||
.jio-logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
height: 64px;
|
||||
gap: 11px;
|
||||
padding: 0 18px;
|
||||
border-bottom: 1px solid var(--aksrt-color-border);
|
||||
border-bottom: 1px solid var(--jio-color-border);
|
||||
}
|
||||
|
||||
.aksrt-logo--drawer {
|
||||
.jio-logo--drawer {
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
@@ -289,14 +289,14 @@ function handleMenuClick(key) {
|
||||
height: 28px;
|
||||
flex: 0 0 28px;
|
||||
border-radius: 7px;
|
||||
background: var(--aksrt-color-primary);
|
||||
background: var(--jio-color-primary);
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
.aksrt-logo__copy {
|
||||
.jio-logo__copy {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 7px;
|
||||
@@ -306,56 +306,56 @@ function handleMenuClick(key) {
|
||||
.logo-text {
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
letter-spacing: .08em;
|
||||
}
|
||||
|
||||
.aksrt-logo__version {
|
||||
color: var(--aksrt-color-muted);
|
||||
.jio-logo__version {
|
||||
color: var(--jio-color-muted);
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 10px;
|
||||
letter-spacing: .02em;
|
||||
}
|
||||
|
||||
.aksrt-admin-content__inner {
|
||||
.jio-admin-content__inner {
|
||||
width: 100%;
|
||||
max-width: 1236px;
|
||||
margin: 0 auto;
|
||||
padding: 26px 28px 42px;
|
||||
}
|
||||
|
||||
.aksrt-admin-mobile {
|
||||
background: var(--aksrt-color-canvas);
|
||||
.jio-admin-mobile {
|
||||
background: var(--jio-color-canvas);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.aksrt-admin-mobile__body {
|
||||
.jio-admin-mobile__body {
|
||||
padding: 14px 12px 32px;
|
||||
}
|
||||
|
||||
.aksrt-page-wrapper {
|
||||
.jio-page-wrapper {
|
||||
min-height: calc(100vh - 120px);
|
||||
}
|
||||
|
||||
.aksrt-error-fallback {
|
||||
.jio-error-fallback {
|
||||
padding: 48px 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.aksrt-error-title {
|
||||
.jio-error-title {
|
||||
margin: 0 0 10px;
|
||||
font-size: 16px;
|
||||
color: #d03050;
|
||||
}
|
||||
|
||||
.aksrt-error-msg {
|
||||
.jio-error-msg {
|
||||
margin: 0 0 16px;
|
||||
font-size: 13px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.aksrt-admin-content__inner {
|
||||
.jio-admin-content__inner {
|
||||
padding: 22px 20px 38px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
* AKSRT Admin API Client
|
||||
* Jio Admin API Client
|
||||
*
|
||||
* Communicates with the WordPress REST API at /wp-json/aksrt/v1
|
||||
* (or index.php?rest_route=/aksrt/v1 when pretty permalinks are off).
|
||||
* Communicates with the WordPress REST API at /wp-json/jio/v1
|
||||
* (or index.php?rest_route=/jio/v1 when pretty permalinks are off).
|
||||
* Methods are organized into domain modules while the client keeps the shared
|
||||
* request pipeline and schema-domain normalization contract.
|
||||
*/
|
||||
|
||||
import { apiMethods } from './modules/index.js'
|
||||
|
||||
const API_ROOT = window.aksrtAdminData?.apiUrl || '/wp-json/aksrt/v1'
|
||||
const NONCE = window.aksrtAdminData?.nonce || ''
|
||||
const API_ROOT = window.jioAdminData?.apiUrl || '/wp-json/jio/v1'
|
||||
const NONCE = window.jioAdminData?.nonce || ''
|
||||
|
||||
function createIdempotencyKey() {
|
||||
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {
|
||||
@@ -34,11 +34,11 @@ function normalizeDomainKey(domain) {
|
||||
/**
|
||||
* Join REST base + endpoint correctly for both pretty and plain permalinks.
|
||||
*
|
||||
* Pretty: https://site/wp-json/aksrt/v1 + /settings/schema/global/common
|
||||
* → https://site/wp-json/aksrt/v1/settings/schema/global/common
|
||||
* Pretty: https://site/wp-json/jio/v1 + /settings/schema/global/common
|
||||
* → https://site/wp-json/jio/v1/settings/schema/global/common
|
||||
*
|
||||
* Plain: https://site/index.php?rest_route=/aksrt/v1 + /settings/schema/global/common
|
||||
* → https://site/index.php?rest_route=/aksrt/v1/settings/schema/global/common
|
||||
* Plain: https://site/index.php?rest_route=/jio/v1 + /settings/schema/global/common
|
||||
* → https://site/index.php?rest_route=/jio/v1/settings/schema/global/common
|
||||
*
|
||||
* @param {string} baseUrl
|
||||
* @param {string} endpoint path starting with /, may include ?query
|
||||
@@ -56,7 +56,7 @@ function joinRestUrl(baseUrl, endpoint) {
|
||||
path = '/' + path
|
||||
}
|
||||
|
||||
const base = String(baseUrl || '').trim() || '/wp-json/aksrt/v1'
|
||||
const base = String(baseUrl || '').trim() || '/wp-json/jio/v1'
|
||||
|
||||
// Plain permalinks: rest_route query mode
|
||||
if (base.includes('rest_route=')) {
|
||||
@@ -68,11 +68,11 @@ function joinRestUrl(baseUrl, endpoint) {
|
||||
return base.replace(/\/?$/, '') + path + (extraQuery ? (base.includes('?') ? '&' : '?') + extraQuery : '')
|
||||
}
|
||||
|
||||
const baseRoute = (u.searchParams.get('rest_route') || '/aksrt/v1').replace(/\/$/, '') || '/aksrt/v1'
|
||||
const baseRoute = (u.searchParams.get('rest_route') || '/jio/v1').replace(/\/$/, '') || '/jio/v1'
|
||||
let fullRoute
|
||||
if (path === '/') {
|
||||
fullRoute = baseRoute
|
||||
} else if (path.startsWith('/aksrt/')) {
|
||||
} else if (path.startsWith('/jio/')) {
|
||||
fullRoute = path
|
||||
} else {
|
||||
fullRoute = baseRoute + path
|
||||
@@ -110,7 +110,7 @@ class ApiClient {
|
||||
async request(endpointOrConfig, options = {}) {
|
||||
// Dual-signature support:
|
||||
// request('/users/1/restrictions')
|
||||
// request({ url: '/aksrt/v1/users/1/restrictions', method: 'GET' })
|
||||
// request({ url: '/jio/v1/users/1/restrictions', method: 'GET' })
|
||||
let endpoint, method, headers, params, body, rest
|
||||
|
||||
if (typeof endpointOrConfig === 'object' && endpointOrConfig !== null) {
|
||||
@@ -134,10 +134,10 @@ class ApiClient {
|
||||
delete rest.data; delete rest.headers
|
||||
}
|
||||
|
||||
if (endpoint.startsWith('/wp-json/aksrt/v1')) {
|
||||
endpoint = endpoint.replace('/wp-json/aksrt/v1', '') || '/'
|
||||
} else if (endpoint.startsWith('/aksrt/v1')) {
|
||||
endpoint = endpoint.replace('/aksrt/v1', '') || '/'
|
||||
if (endpoint.startsWith('/wp-json/jio/v1')) {
|
||||
endpoint = endpoint.replace('/wp-json/jio/v1', '') || '/'
|
||||
} else if (endpoint.startsWith('/jio/v1')) {
|
||||
endpoint = endpoint.replace('/jio/v1', '') || '/'
|
||||
}
|
||||
|
||||
let url = joinRestUrl(this.baseUrl, endpoint)
|
||||
|
||||
@@ -12,11 +12,6 @@ export const globalApiMethods = {
|
||||
getFloatingButtons() { return this.request('/settings/floating-buttons') },
|
||||
saveFloatingButtons(data) { return this.request('/settings/floating-buttons', { method: 'POST', body: JSON.stringify(data) }) },
|
||||
|
||||
getFriendLinks() { return this.request('/friend-links') },
|
||||
addFriendLink(data) { return this.request('/friend-links', { method: 'POST', body: JSON.stringify(data) }) },
|
||||
deleteFriendLink(id) { return this.request(`/friend-links/${id}`, { method: 'DELETE' }) },
|
||||
reorderFriendLinks(ids) { return this.request('/friend-links/reorder', { method: 'POST', body: JSON.stringify({ ids }) }) },
|
||||
|
||||
getCmsFeatures() { return this.request('/settings/cms-features') },
|
||||
saveCmsFeatures(cms_features) { return this.request('/settings/cms-features', { method: 'POST', body: JSON.stringify({ cms_features }) }) },
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* 工单管理端 REST(命名空间 aksrt/v1/admin)。
|
||||
* 工单管理端 REST(命名空间 jio/v1/admin)。
|
||||
*
|
||||
* TicketRestAdmin 把三块字典 CRUD(工单状态 / 部门 / 预设回复)挂在
|
||||
* aksrt/v1/admin 下,全部要求 manage_options。api 客户端的 baseUrl 只到
|
||||
* aksrt/v1,因此这里必须用 /aksrt/ 全路径形式(joinRestUrl 的
|
||||
* startsWith('/aksrt/') 分支会原样拼接,不再追加 base 前缀)。
|
||||
* jio/v1/admin 下,全部要求 manage_options。api 客户端的 baseUrl 只到
|
||||
* jio/v1,因此这里必须用 /jio/ 全路径形式(joinRestUrl 的
|
||||
* startsWith('/jio/') 分支会原样拼接,不再追加 base 前缀)。
|
||||
*/
|
||||
|
||||
const ADMIN = '/aksrt/v1/admin/tickets'
|
||||
const ADMIN = '/jio/v1/admin/tickets'
|
||||
|
||||
export const ticketsApiMethods = {
|
||||
/* ---------------- 工单状态 ---------------- */
|
||||
|
||||
@@ -27,8 +27,4 @@ export const usersApiMethods = {
|
||||
adjustUserCredits(id, asset, delta, remark) {
|
||||
return this.request(`/assets/accounts/${id}/adjust`, { method: 'POST', body: JSON.stringify({ asset, delta, remark }) })
|
||||
},
|
||||
getCreditLog(params = {}) {
|
||||
const qs = new URLSearchParams(params).toString()
|
||||
return this.request('/assets/transactions' + (qs ? `?${qs}` : ''))
|
||||
},
|
||||
}
|
||||
@@ -1,35 +1,35 @@
|
||||
<template>
|
||||
<div class="aksrt-deferred-page">
|
||||
<div class="aksrt-deferred-page__icon">
|
||||
<div class="jio-deferred-page">
|
||||
<div class="jio-deferred-page__icon">
|
||||
<FaIcon :icon="resolvedIcon" :size="48" />
|
||||
</div>
|
||||
<h2 class="aksrt-deferred-page__title">{{ resolvedTitle }}</h2>
|
||||
<p class="aksrt-deferred-page__desc">{{ resolvedDesc }}</p>
|
||||
<div class="aksrt-deferred-page__meta">
|
||||
<h2 class="jio-deferred-page__title">{{ resolvedTitle }}</h2>
|
||||
<p class="jio-deferred-page__desc">{{ resolvedDesc }}</p>
|
||||
<div class="jio-deferred-page__meta">
|
||||
<n-tag size="small" type="info">{{ resolvedStatus }}</n-tag>
|
||||
<n-tag v-if="resolvedPhase" size="small" type="warning">Phase {{ resolvedPhase }}</n-tag>
|
||||
</div>
|
||||
<div v-if="resolvedDependsOn.length" class="aksrt-deferred-page__depends">
|
||||
<span class="aksrt-deferred-page__label">依赖</span>
|
||||
<div class="aksrt-deferred-page__depends-list">
|
||||
<div v-if="resolvedDependsOn.length" class="jio-deferred-page__depends">
|
||||
<span class="jio-deferred-page__label">依赖</span>
|
||||
<div class="jio-deferred-page__depends-list">
|
||||
<n-tag v-for="item in resolvedDependsOn" :key="item" size="small" type="default">{{ item }}</n-tag>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="resolvedReason" class="aksrt-deferred-page__reason">
|
||||
<span class="aksrt-deferred-page__label">原因</span>
|
||||
<div v-if="resolvedReason" class="jio-deferred-page__reason">
|
||||
<span class="jio-deferred-page__label">原因</span>
|
||||
<p>{{ resolvedReason }}</p>
|
||||
</div>
|
||||
<div v-if="resolvedFeatures && resolvedFeatures.length" class="aksrt-deferred-page__features">
|
||||
<div v-if="resolvedFeatures && resolvedFeatures.length" class="jio-deferred-page__features">
|
||||
<div
|
||||
v-for="(feat, i) in resolvedFeatures"
|
||||
:key="i"
|
||||
class="aksrt-deferred-page__feature"
|
||||
class="jio-deferred-page__feature"
|
||||
>
|
||||
<FaIcon icon="fa fas fa-check-circle" :size="14" />
|
||||
<span>{{ feat }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aksrt-deferred-page__badge">
|
||||
<div class="jio-deferred-page__badge">
|
||||
<n-tag type="info" size="small">即将推出</n-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,7 +78,7 @@ const resolvedFeatures = computed(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-deferred-page {
|
||||
.jio-deferred-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -88,75 +88,75 @@ const resolvedFeatures = computed(() => {
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__icon {
|
||||
color: var(--aksrt-color-border-strong);
|
||||
.jio-deferred-page__icon {
|
||||
color: var(--jio-color-border-strong);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__title {
|
||||
.jio-deferred-page__title {
|
||||
margin: 0 0 10px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__desc {
|
||||
.jio-deferred-page__desc {
|
||||
margin: 0 0 20px;
|
||||
font-size: 14px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
max-width: 400px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__meta {
|
||||
.jio-deferred-page__meta {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__depends,
|
||||
.aksrt-deferred-page__reason {
|
||||
.jio-deferred-page__depends,
|
||||
.jio-deferred-page__reason {
|
||||
width: min(520px, 100%);
|
||||
margin-bottom: 18px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__label {
|
||||
.jio-deferred-page__label {
|
||||
display: inline-block;
|
||||
margin-bottom: 8px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text-secondary);
|
||||
color: var(--jio-color-text-secondary);
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__depends-list {
|
||||
.jio-deferred-page__depends-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__reason p {
|
||||
.jio-deferred-page__reason p {
|
||||
margin: 0;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__features {
|
||||
.jio-deferred-page__features {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__feature {
|
||||
.jio-deferred-page__feature {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
}
|
||||
|
||||
.aksrt-deferred-page__feature :deep(i) {
|
||||
.jio-deferred-page__feature :deep(i) {
|
||||
color: #52c41a;
|
||||
}
|
||||
</style>
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="aksrt-empty-state">
|
||||
<div class="aksrt-empty-state__icon">
|
||||
<div class="jio-empty-state">
|
||||
<div class="jio-empty-state__icon">
|
||||
<i :class="icon" style="font-size: 48px;"></i>
|
||||
</div>
|
||||
<h3 class="aksrt-empty-state__title">{{ title }}</h3>
|
||||
<p class="aksrt-empty-state__desc">{{ desc }}</p>
|
||||
<h3 class="jio-empty-state__title">{{ title }}</h3>
|
||||
<p class="jio-empty-state__desc">{{ desc }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -17,7 +17,7 @@ defineProps({
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-empty-state {
|
||||
.jio-empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -26,22 +26,22 @@ defineProps({
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.aksrt-empty-state__icon {
|
||||
.jio-empty-state__icon {
|
||||
margin-bottom: 20px;
|
||||
color: var(--aksrt-color-border-strong);
|
||||
color: var(--jio-color-border-strong);
|
||||
}
|
||||
|
||||
.aksrt-empty-state__title {
|
||||
.jio-empty-state__title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
}
|
||||
|
||||
.aksrt-empty-state__desc {
|
||||
.jio-empty-state__desc {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
max-width: 360px;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<header class="aksrt-mobile-topbar">
|
||||
<header class="jio-mobile-topbar">
|
||||
<button
|
||||
class="aksrt-mobile-topbar__menu"
|
||||
class="jio-mobile-topbar__menu"
|
||||
type="button"
|
||||
aria-label="打开菜单"
|
||||
@click="$emit('toggle')"
|
||||
@@ -13,35 +13,35 @@
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div class="aksrt-mobile-topbar__title">{{ title }}</div>
|
||||
<div class="jio-mobile-topbar__title">{{ title }}</div>
|
||||
|
||||
<div class="aksrt-mobile-topbar__brand">AK</div>
|
||||
<div class="jio-mobile-topbar__brand">AK</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
defineProps({
|
||||
title: { type: String, default: 'AKSRT' },
|
||||
title: { type: String, default: 'Jio' },
|
||||
})
|
||||
|
||||
defineEmits(['toggle'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-mobile-topbar {
|
||||
.jio-mobile-topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
height: 48px;
|
||||
padding: 0 14px;
|
||||
background: var(--aksrt-color-surface);
|
||||
border-bottom: 1px solid var(--aksrt-color-border);
|
||||
background: var(--jio-color-surface);
|
||||
border-bottom: 1px solid var(--jio-color-border);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.aksrt-mobile-topbar__menu {
|
||||
.jio-mobile-topbar__menu {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -50,26 +50,26 @@ defineEmits(['toggle'])
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: transparent;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
cursor: pointer;
|
||||
margin-left: -6px;
|
||||
}
|
||||
|
||||
.aksrt-mobile-topbar__menu:hover {
|
||||
background: var(--aksrt-color-primary-soft);
|
||||
.jio-mobile-topbar__menu:hover {
|
||||
background: var(--jio-color-primary-soft);
|
||||
}
|
||||
|
||||
.aksrt-mobile-topbar__title {
|
||||
.jio-mobile-topbar__title {
|
||||
flex: 1 1 auto;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.aksrt-mobile-topbar__brand {
|
||||
.jio-mobile-topbar__brand {
|
||||
flex: 0 0 auto;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -77,7 +77,7 @@ defineEmits(['toggle'])
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 8px;
|
||||
background: var(--aksrt-color-primary);
|
||||
background: var(--jio-color-primary);
|
||||
color: #fff;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<header class="aksrt-page-header">
|
||||
<div class="aksrt-page-header__main">
|
||||
<h2 class="aksrt-page-header__title">{{ title }}</h2>
|
||||
<p v-if="desc" class="aksrt-page-header__desc">
|
||||
<header class="jio-page-header">
|
||||
<div class="jio-page-header__main">
|
||||
<h2 class="jio-page-header__title">{{ title }}</h2>
|
||||
<p v-if="desc" class="jio-page-header__desc">
|
||||
<slot name="desc">{{ desc }}</slot>
|
||||
</p>
|
||||
<div v-else-if="$slots.desc" class="aksrt-page-header__desc">
|
||||
<div v-else-if="$slots.desc" class="jio-page-header__desc">
|
||||
<slot name="desc" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="$slots.actions" class="aksrt-page-header__actions">
|
||||
<div v-if="$slots.actions" class="jio-page-header__actions">
|
||||
<slot name="actions" />
|
||||
</div>
|
||||
</header>
|
||||
@@ -23,7 +23,7 @@ defineProps({
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-page-header {
|
||||
.jio-page-header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
@@ -32,28 +32,28 @@ defineProps({
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.aksrt-page-header__main {
|
||||
.jio-page-header__main {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.aksrt-page-header__title {
|
||||
.jio-page-header__title {
|
||||
margin: 0 0 6px;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.aksrt-page-header__desc {
|
||||
.jio-page-header__desc {
|
||||
margin: 0;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
font-size: 13px;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
.aksrt-page-header__actions {
|
||||
.jio-page-header__actions {
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -61,20 +61,20 @@ defineProps({
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.aksrt-page-header {
|
||||
.jio-page-header {
|
||||
margin-bottom: 14px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aksrt-page-header__title {
|
||||
.jio-page-header__title {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.aksrt-page-header__desc {
|
||||
.jio-page-header__desc {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-page-header__actions {
|
||||
.jio-page-header__actions {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,9 @@
|
||||
<n-form-item label="AccessKey Secret">
|
||||
<n-input
|
||||
v-model:value="model.access_key_secret"
|
||||
type="password"
|
||||
type="text"
|
||||
show-password-on="click"
|
||||
class="jio-secret-input"
|
||||
autocomplete="new-password"
|
||||
placeholder="阿里云 RAM 用户 AccessKey Secret"
|
||||
@update:value="onSecretInput('access_key_secret', $event)"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<n-input v-model:value="model.site_key" placeholder="Cloudflare Turnstile Site Key" autocomplete="off" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Secret Key">
|
||||
<n-input v-model:value="model.secret_key" type="password" show-password-on="click" autocomplete="new-password" @update:value="onSecretInput('secret_key', $event)" />
|
||||
<n-input v-model:value="model.secret_key" type="text" show-password-on="click" class="jio-secret-input" autocomplete="new-password" @update:value="onSecretInput('secret_key', $event)" />
|
||||
<n-button v-if="model.secret_key === '***'" size="tiny" type="error" ghost style="margin-left:8px" @click="clearSecret('secret_key')">清除</n-button>
|
||||
</n-form-item>
|
||||
<n-form-item label="主题">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<n-input v-model:value="model.captcha_id" placeholder="极验 GeeTest CaptchaID" autocomplete="off" />
|
||||
</n-form-item>
|
||||
<n-form-item label="Captcha Key">
|
||||
<n-input v-model:value="model.captcha_key" type="password" show-password-on="click" autocomplete="new-password" @update:value="onSecretInput('captcha_key', $event)" />
|
||||
<n-input v-model:value="model.captcha_key" type="text" show-password-on="click" class="jio-secret-input" autocomplete="new-password" @update:value="onSecretInput('captcha_key', $event)" />
|
||||
<n-button v-if="model.captcha_key === '***'" size="tiny" type="error" ghost style="margin-left:8px" @click="clearSecret('captcha_key')">清除</n-button>
|
||||
</n-form-item>
|
||||
<n-tag v-if="isConfigured" type="success" size="small">✓ 已完整配置</n-tag>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<n-input v-model:value="model.secret_id" placeholder="腾讯云 API SecretId" autocomplete="off" />
|
||||
</n-form-item>
|
||||
<n-form-item label="SecretKey">
|
||||
<n-input v-model:value="model.secret_key" type="password" placeholder="腾讯云 API SecretKey" autocomplete="new-password" show-password-on="click" @update:value="onSecretInput('secret_key', $event)" />
|
||||
<n-input v-model:value="model.secret_key" type="text" class="jio-secret-input" placeholder="腾讯云 API SecretKey" autocomplete="off" @update:value="onSecretInput('secret_key', $event)" />
|
||||
<n-button v-if="model.secret_key === '***'" size="tiny" type="error" ghost style="margin-left:8px" @click="clearSecret('secret_key')">清除</n-button>
|
||||
</n-form-item>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<n-input v-model:value="model.app_id" placeholder="从验证码控制台获取 CaptchaAppId" autocomplete="off" />
|
||||
</n-form-item>
|
||||
<n-form-item label="AppSecretKey">
|
||||
<n-input v-model:value="model.app_secret_key" type="password" placeholder="从验证码控制台获取 AppSecretKey" autocomplete="new-password" show-password-on="click" @update:value="onSecretInput('app_secret_key', $event)" />
|
||||
<n-input v-model:value="model.app_secret_key" type="text" class="jio-secret-input" placeholder="从验证码控制台获取 AppSecretKey" autocomplete="off" @update:value="onSecretInput('app_secret_key', $event)" />
|
||||
<n-button v-if="model.app_secret_key === '***'" size="tiny" type="error" ghost style="margin-left:8px" @click="clearSecret('app_secret_key')">清除</n-button>
|
||||
<template #feedback>请从「验证管理 → 基础配置」完整复制,注意区分 I/l/1/O/0</template>
|
||||
</n-form-item>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<n-form label-placement="left" label-width="110" class="aksrt-form float-common-fields">
|
||||
<n-form label-placement="left" label-width="110" class="jio-form float-common-fields">
|
||||
<n-form-item label="PC端显示" :show-feedback="false">
|
||||
<n-switch :value="!!modelValue.pc_s" @update:value="update('pc_s', $event)" />
|
||||
</n-form-item>
|
||||
@@ -10,22 +10,20 @@
|
||||
<div class="float-common-fields__colors">
|
||||
<div class="float-common-fields__color">
|
||||
<span>自定义图标颜色</span>
|
||||
<n-color-picker
|
||||
:value="modelValue.color?.color || null"
|
||||
:show-alpha="true"
|
||||
:modes="['hex', 'rgb']"
|
||||
<JioColorPicker
|
||||
:model-value="modelValue.color?.color || ''"
|
||||
alpha
|
||||
clearable
|
||||
@update:value="updateColor('color', $event)"
|
||||
@update:model-value="updateColor('color', $event)"
|
||||
/>
|
||||
</div>
|
||||
<div class="float-common-fields__color">
|
||||
<span>自定义背景颜色</span>
|
||||
<n-color-picker
|
||||
:value="modelValue.color?.bg || null"
|
||||
:show-alpha="true"
|
||||
:modes="['hex', 'rgb']"
|
||||
<JioColorPicker
|
||||
:model-value="modelValue.color?.bg || ''"
|
||||
alpha
|
||||
clearable
|
||||
@update:value="updateColor('bg', $event)"
|
||||
@update:model-value="updateColor('bg', $event)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -35,6 +33,8 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import JioColorPicker from '@/components/form/JioColorPicker.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Object, required: true },
|
||||
})
|
||||
|
||||
@@ -1,23 +1,29 @@
|
||||
<template>
|
||||
<div class="float-btn-panel">
|
||||
<div class="float-btn-panel__head" @click="expanded = !expanded">
|
||||
<button type="button" class="float-btn-panel__handle" aria-label="拖拽排序" @click.stop>
|
||||
<i class="fa fas fa-arrows-alt-v" />
|
||||
</button>
|
||||
<strong class="float-btn-panel__title">{{ meta.title }}</strong>
|
||||
<template v-if="modelValue.type !== 'more'">
|
||||
<n-tag v-if="modelValue.pc_s" size="small" type="info" :bordered="false">PC</n-tag>
|
||||
<n-tag v-if="modelValue.m_s" size="small" type="warning" :bordered="false">移动</n-tag>
|
||||
<n-tag v-if="!modelValue.pc_s && !modelValue.m_s" size="small" :bordered="false">未显示</n-tag>
|
||||
</template>
|
||||
<n-tag v-else size="small" :bordered="false">{{ modelValue.buttons.length }} 个</n-tag>
|
||||
<span v-if="meta.warn" class="float-btn-panel__warn">
|
||||
<i class="fa fas fa-info-circle" /> {{ meta.warn }}
|
||||
</span>
|
||||
<i class="fa fas float-btn-panel__arrow" :class="expanded ? 'fa-angle-up' : 'fa-angle-down'" />
|
||||
<div class="jio-sortable__head" v-bind="headAttrs">
|
||||
<JioSortHandle @click.stop />
|
||||
<div class="jio-sortable__main">
|
||||
<div class="jio-sortable__title-row">
|
||||
<span class="jio-sortable__title">{{ meta.title }}</span>
|
||||
<template v-if="modelValue.type !== 'more'">
|
||||
<n-tag v-if="modelValue.pc_s" size="small" type="info" :bordered="false">PC</n-tag>
|
||||
<n-tag v-if="modelValue.m_s" size="small" type="warning" :bordered="false">移动</n-tag>
|
||||
<n-tag v-if="!modelValue.pc_s && !modelValue.m_s" size="small" :bordered="false">未显示</n-tag>
|
||||
</template>
|
||||
<n-tag v-else size="small" :bordered="false">{{ modelValue.buttons.length }} 个</n-tag>
|
||||
</div>
|
||||
<span v-if="meta.warn" class="jio-sortable__desc float-btn-panel__warn">
|
||||
<i class="fa fas fa-info-circle" aria-hidden="true" /> {{ meta.warn }}
|
||||
</span>
|
||||
</div>
|
||||
<i
|
||||
class="fa fas jio-sortable__toggle"
|
||||
:class="expanded ? 'fa-chevron-down' : 'fa-chevron-right'"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-show="expanded" class="float-btn-panel__body">
|
||||
<div v-show="expanded" class="jio-sortable__body">
|
||||
<div class="float-btn-panel__subtitle">{{ meta.panel }}</div>
|
||||
|
||||
<FloatMoreButtonsEditor
|
||||
@@ -29,7 +35,7 @@
|
||||
<template v-else>
|
||||
<FloatBtnCommonFields :model-value="modelValue" @update:model-value="emit('update:modelValue', $event)" />
|
||||
|
||||
<n-form label-placement="left" label-width="110" class="aksrt-form float-btn-panel__extra">
|
||||
<n-form label-placement="left" label-width="110" class="jio-form float-btn-panel__extra">
|
||||
<n-form-item v-if="modelValue.type === 'qrcode'" label="一句话简介">
|
||||
<n-input :value="modelValue.desc" @update:value="patch({ desc: $event })" />
|
||||
</n-form-item>
|
||||
@@ -43,7 +49,7 @@
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item v-if="modelValue.type === 'service_wechat'" label="微信二维码">
|
||||
<AksMediaField
|
||||
<JioMediaField
|
||||
:model-value="modelValue.wechat_img"
|
||||
placeholder="选择二维码图片"
|
||||
@update:model-value="patch({ wechat_img: $event })"
|
||||
@@ -56,9 +62,12 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 悬浮按钮排序列表中的单个卡片;外层 .jio-sortable__item 由 FloatingButtonsSettings 提供。 */
|
||||
import { computed, ref } from 'vue'
|
||||
import FaIconPicker from '@/components/form/FaIconPicker.vue'
|
||||
import AksMediaField from '@/components/form/AksMediaField.vue'
|
||||
import JioMediaField from '@/components/form/JioMediaField.vue'
|
||||
import JioSortHandle from '@/components/form/JioSortHandle.vue'
|
||||
import { collapseHeadAttrs } from '@/components/form/useCollapsibleItems.js'
|
||||
import FloatBtnCommonFields from './FloatBtnCommonFields.vue'
|
||||
import FloatMoreButtonsEditor from './FloatMoreButtonsEditor.vue'
|
||||
import { FLOAT_BTN_META } from './floating-defaults.js'
|
||||
@@ -69,6 +78,7 @@ const props = defineProps({
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const expanded = ref(false)
|
||||
const headAttrs = computed(() => collapseHeadAttrs(expanded.value, () => { expanded.value = !expanded.value }))
|
||||
const meta = computed(() => FLOAT_BTN_META[props.modelValue.type] || { title: props.modelValue.type, panel: '' })
|
||||
|
||||
const addIcon = computed({
|
||||
@@ -82,76 +92,18 @@ function patch(partial) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.float-btn-panel {
|
||||
border: 1px solid var(--n-border-color, rgba(0, 0, 0, 0.09));
|
||||
border-radius: 8px;
|
||||
background: var(--n-card-color, #fff);
|
||||
}
|
||||
|
||||
.float-btn-panel__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 10px 14px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.float-btn-panel__handle {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: var(--n-text-color-3, #999);
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.float-btn-panel__handle:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.float-btn-panel__title {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.float-btn-panel__arrow {
|
||||
margin-left: auto;
|
||||
color: var(--n-text-color-3, #999);
|
||||
}
|
||||
|
||||
.float-btn-panel__warn {
|
||||
font-size: 12px;
|
||||
color: #f0a020;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.float-btn-panel__body {
|
||||
padding: 12px 16px 16px;
|
||||
border-top: 1px solid var(--n-border-color, rgba(0, 0, 0, 0.09));
|
||||
color: var(--jio-color-warning, #D97706);
|
||||
}
|
||||
|
||||
.float-btn-panel__subtitle {
|
||||
font-weight: 600;
|
||||
font-size: 13px;
|
||||
margin-bottom: 12px;
|
||||
color: var(--jio-color-text);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.float-btn-panel__extra {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.float-btn-panel__block {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.float-btn-panel__desc {
|
||||
font-size: 12px;
|
||||
color: var(--n-text-color-3, #999);
|
||||
}
|
||||
</style>
|
||||
@@ -24,7 +24,7 @@
|
||||
</n-button>
|
||||
</template>
|
||||
|
||||
<n-form label-placement="left" label-width="110" class="aksrt-form">
|
||||
<n-form label-placement="left" label-width="110" class="jio-form">
|
||||
<n-form-item label="按钮简介">
|
||||
<n-input :value="btn.desc" @update:value="patch(index, { desc: $event })" />
|
||||
</n-form-item>
|
||||
|
||||
@@ -16,32 +16,21 @@ export const FLOAT_BTN_META = {
|
||||
more: { title: '更多按钮', panel: '添加更多自定义按钮' },
|
||||
}
|
||||
|
||||
const themeUri = (window.aksrtAdminData?.themeUri || '').replace(/\/$/, '')
|
||||
|
||||
/** 「更多按钮」出厂默认项(对齐参考主题 float_btn.more 默认值)。 */
|
||||
/** 「更多按钮」出厂默认项:不预设任何第三方指向,只给一个图标按钮。 */
|
||||
export function giftMoreButton() {
|
||||
return {
|
||||
desc: '本站同款主题模板',
|
||||
icon: 'zibsvg-gift-color',
|
||||
desc: '',
|
||||
icon: 'jiosvg-gift-color',
|
||||
link: { url: '', target: '' },
|
||||
hover: `<a href="https://www.zibll.com/" target="_blank">
|
||||
<div class="flex c-red">
|
||||
<img class="flex0" alt="zibll子比主题" src="${themeUri}/assets/img/logo.png" height="30">
|
||||
<div class="flex1 ml10">
|
||||
<dt>本站同款主题模板</dt>
|
||||
<div class="px12 mt10 muted-color">zibll子比主题是一款漂亮优雅的网站主题模板,功能强大,配置简单。</div>
|
||||
<div class="but mt10 p2-10 c-blue btn-block px12">查看详情</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>`,
|
||||
hover_width: 240,
|
||||
hover: '',
|
||||
hover_width: 200,
|
||||
pc_s: true,
|
||||
m_s: true,
|
||||
color: { color: '', bg: 'rgba(255, 111, 6, 0.2)' },
|
||||
}
|
||||
}
|
||||
|
||||
/** 「添加按钮」新增项默认值(参考主题 group 字段默认值)。 */
|
||||
/** 「添加按钮」新增项默认值。 */
|
||||
export function defaultMoreButton() {
|
||||
return {
|
||||
desc: '',
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
<template>
|
||||
<div class="aksrt-array-table">
|
||||
<n-data-table
|
||||
:columns="tableColumns"
|
||||
:data="modelValue || []"
|
||||
:bordered="false"
|
||||
size="small"
|
||||
max-height="400"
|
||||
/>
|
||||
|
||||
<n-button
|
||||
size="small"
|
||||
dashed
|
||||
block
|
||||
class="aksrt-array-table__add"
|
||||
@click="addItem"
|
||||
>
|
||||
<FaIcon icon="fa fas fa-plus" :size="12" />
|
||||
{{ addText || '添加行' }}
|
||||
</n-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* AksArrayTable — table-style editor for array data.
|
||||
* Renders rows in a data table with inline editing.
|
||||
*/
|
||||
import { computed, h } from 'vue'
|
||||
import { NInput, NSwitch, NButton, NSelect, NInputNumber } from 'naive-ui'
|
||||
import FaIcon from './FaIcon.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Array, default: () => [] },
|
||||
/** Column definitions: [{ key, label, type?, options?, width? }] */
|
||||
columns: { type: Array, required: true },
|
||||
defaults: { type: Object, default: () => ({}) },
|
||||
addText: { type: String, default: '' },
|
||||
maxRows: { type: Number, default: Infinity },
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
function updateCell(rowIndex, key, value) {
|
||||
const list = [...(props.modelValue || [])]
|
||||
list[rowIndex] = { ...list[rowIndex], [key]: value }
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
function removeItem(index) {
|
||||
const list = (props.modelValue || []).filter((_, i) => i !== index)
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
function addItem() {
|
||||
if ((props.modelValue || []).length >= props.maxRows) return
|
||||
const item = {}
|
||||
for (const col of props.columns) {
|
||||
item[col.key] = col.default ?? (col.type === 'switch' ? false : '')
|
||||
}
|
||||
emit('update:modelValue', [...(props.modelValue || []), { ...item, ...props.defaults }])
|
||||
}
|
||||
|
||||
function moveUp(index) {
|
||||
if (index <= 0) return
|
||||
const list = [...(props.modelValue || [])]
|
||||
;[list[index - 1], list[index]] = [list[index], list[index - 1]]
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
function moveDown(index) {
|
||||
const list = [...(props.modelValue || [])]
|
||||
if (index >= list.length - 1) return
|
||||
;[list[index], list[index + 1]] = [list[index + 1], list[index]]
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
const tableColumns = computed(() => {
|
||||
const cols = props.columns.map(col => ({
|
||||
title: col.label,
|
||||
key: col.key,
|
||||
width: col.width || 150,
|
||||
render(row, rowIndex) {
|
||||
const val = row[col.key]
|
||||
const update = (v) => updateCell(rowIndex, col.key, v)
|
||||
|
||||
if (col.type === 'switch') {
|
||||
return h(NSwitch, { value: val, size: 'small', 'onUpdate:value': update })
|
||||
}
|
||||
if (col.type === 'select') {
|
||||
return h(NSelect, { value: val, options: col.options || [], size: 'small', 'onUpdate:value': update })
|
||||
}
|
||||
if (col.type === 'number') {
|
||||
return h(NInputNumber, { value: val, size: 'small', style: 'width:100%', 'onUpdate:value': update })
|
||||
}
|
||||
return h(NInput, { value: val, size: 'small', 'onUpdate:value': update })
|
||||
},
|
||||
}))
|
||||
|
||||
// Add actions column
|
||||
cols.push({
|
||||
title: '操作',
|
||||
key: '_actions',
|
||||
width: 100,
|
||||
render(row, rowIndex) {
|
||||
return h('div', { style: 'display:flex;gap:2px' }, [
|
||||
rowIndex > 0 ? h(NButton, { size: 'tiny', quaternary: true, onClick: () => moveUp(rowIndex) }, {
|
||||
default: () => h(FaIcon, { icon: 'fa fas fa-arrow-up', size: 12 }),
|
||||
}) : null,
|
||||
rowIndex < (props.modelValue?.length || 0) - 1 ? h(NButton, { size: 'tiny', quaternary: true, onClick: () => moveDown(rowIndex) }, {
|
||||
default: () => h(FaIcon, { icon: 'fa fas fa-arrow-down', size: 12 }),
|
||||
}) : null,
|
||||
h(NButton, { size: 'tiny', quaternary: true, type: 'error', onClick: () => removeItem(rowIndex) }, {
|
||||
default: () => h(FaIcon, { icon: 'fa fas fa-trash-alt', size: 12 }),
|
||||
}),
|
||||
])
|
||||
},
|
||||
})
|
||||
|
||||
return cols
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-array-table__add {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,185 +0,0 @@
|
||||
<template>
|
||||
<div class="aksrt-repeater">
|
||||
<div v-if="modelValue && modelValue.length" class="aksrt-repeater__list">
|
||||
<div
|
||||
v-for="(item, index) in modelValue"
|
||||
:key="index"
|
||||
class="aksrt-repeater__item"
|
||||
>
|
||||
<div class="aksrt-repeater__item-header">
|
||||
<span class="aksrt-repeater__item-index">#{{ index + 1 }}</span>
|
||||
<div class="aksrt-repeater__item-actions">
|
||||
<n-button
|
||||
v-if="index > 0"
|
||||
size="tiny"
|
||||
quaternary
|
||||
@click="moveUp(index)"
|
||||
>
|
||||
<FaIcon icon="fa fas fa-arrow-up" :size="12" />
|
||||
</n-button>
|
||||
<n-button
|
||||
v-if="index < modelValue.length - 1"
|
||||
size="tiny"
|
||||
quaternary
|
||||
@click="moveDown(index)"
|
||||
>
|
||||
<FaIcon icon="fa fas fa-arrow-down" :size="12" />
|
||||
</n-button>
|
||||
<n-button
|
||||
size="tiny"
|
||||
quaternary
|
||||
type="error"
|
||||
@click="removeItem(index)"
|
||||
>
|
||||
<FaIcon icon="fa fas fa-trash-alt" :size="12" />
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-repeater__item-fields">
|
||||
<AksField
|
||||
v-for="field in fields"
|
||||
:key="field.key"
|
||||
:schema="field"
|
||||
:model-value="item[field.key]"
|
||||
@update:model-value="updateField(index, field.key, $event)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="aksrt-repeater__empty">
|
||||
<FaIcon icon="fa fas fa-inbox" :size="20" />
|
||||
<span>{{ emptyText || '暂无数据' }}</span>
|
||||
</div>
|
||||
|
||||
<n-button
|
||||
size="small"
|
||||
dashed
|
||||
block
|
||||
class="aksrt-repeater__add"
|
||||
@click="addItem"
|
||||
>
|
||||
<FaIcon icon="fa fas fa-plus" :size="12" />
|
||||
{{ addText || '添加项目' }}
|
||||
</n-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* AksRepeaterField — dynamic add/remove rows of structured data.
|
||||
* Each row renders fields based on the provided field schemas.
|
||||
*/
|
||||
import AksField from './AksField.vue'
|
||||
import FaIcon from './FaIcon.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Array, default: () => [] },
|
||||
/** Array of field schemas for each row */
|
||||
fields: { type: Array, required: true },
|
||||
/** Default value for a new item */
|
||||
defaults: { type: Object, default: () => ({}) },
|
||||
emptyText: { type: String, default: '' },
|
||||
addText: { type: String, default: '' },
|
||||
maxItems: { type: Number, default: Infinity },
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
function createItem() {
|
||||
const item = {}
|
||||
for (const field of props.fields) {
|
||||
item[field.key] = field.default ?? (field.type === 'switch' ? false : '')
|
||||
}
|
||||
return { ...item, ...props.defaults }
|
||||
}
|
||||
|
||||
function addItem() {
|
||||
if (props.modelValue.length >= props.maxItems) return
|
||||
const list = [...props.modelValue, createItem()]
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
function removeItem(index) {
|
||||
const list = props.modelValue.filter((_, i) => i !== index)
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
function moveUp(index) {
|
||||
if (index <= 0) return
|
||||
const list = [...props.modelValue]
|
||||
;[list[index - 1], list[index]] = [list[index], list[index - 1]]
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
function moveDown(index) {
|
||||
if (index >= props.modelValue.length - 1) return
|
||||
const list = [...props.modelValue]
|
||||
;[list[index], list[index + 1]] = [list[index + 1], list[index]]
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
|
||||
function updateField(index, key, value) {
|
||||
const list = [...props.modelValue]
|
||||
list[index] = { ...list[index], [key]: value }
|
||||
emit('update:modelValue', list)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-repeater__list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.aksrt-repeater__item {
|
||||
border: 1px solid var(--aksrt-color-border);
|
||||
border-radius: 8px;
|
||||
padding: 12px;
|
||||
background: var(--aksrt-color-canvas);
|
||||
}
|
||||
|
||||
.aksrt-repeater__item-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.aksrt-repeater__item-index {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-primary);
|
||||
background: var(--aksrt-color-primary-soft);
|
||||
padding: 2px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.aksrt-repeater__item-actions {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.aksrt-repeater__item-fields {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.aksrt-repeater__empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 24px;
|
||||
color: var(--aksrt-color-border-strong);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.aksrt-repeater__add {
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,112 +0,0 @@
|
||||
<template>
|
||||
<div class="aksrt-sorter">
|
||||
<div class="aksrt-sorter__column">
|
||||
<div class="aksrt-sorter__title">
|
||||
<span>已启用</span>
|
||||
<n-tag size="small" type="success" :bordered="false">{{ columns.enabled.length }}</n-tag>
|
||||
</div>
|
||||
<draggable
|
||||
v-model="columns.enabled"
|
||||
item-key="value"
|
||||
group="aksrt-sorter"
|
||||
handle=".aksrt-sorter__handle"
|
||||
ghost-class="aksrt-sorter__ghost"
|
||||
animation="180"
|
||||
class="aksrt-sorter__list"
|
||||
@change="commit"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
<div class="aksrt-sorter__item">
|
||||
<i class="fa fas fa-grip-vertical aksrt-sorter__handle" aria-hidden="true"></i>
|
||||
<i v-if="element.icon" :class="element.icon" aria-hidden="true"></i>
|
||||
<span>{{ element.label }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<n-empty v-if="columns.enabled.length === 0" size="small" description="暂无启用项" />
|
||||
</div>
|
||||
|
||||
<div class="aksrt-sorter__column aksrt-sorter__column--disabled">
|
||||
<div class="aksrt-sorter__title">
|
||||
<span>未启用</span>
|
||||
<n-tag size="small" :bordered="false">{{ columns.disabled.length }}</n-tag>
|
||||
</div>
|
||||
<draggable
|
||||
v-model="columns.disabled"
|
||||
item-key="value"
|
||||
group="aksrt-sorter"
|
||||
handle=".aksrt-sorter__handle"
|
||||
ghost-class="aksrt-sorter__ghost"
|
||||
animation="180"
|
||||
class="aksrt-sorter__list"
|
||||
@change="commit"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
<div class="aksrt-sorter__item">
|
||||
<i class="fa fas fa-grip-vertical aksrt-sorter__handle" aria-hidden="true"></i>
|
||||
<i v-if="element.icon" :class="element.icon" aria-hidden="true"></i>
|
||||
<span>{{ element.label }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<n-empty v-if="columns.disabled.length === 0" size="small" description="暂无未启用项" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, watch } from 'vue'
|
||||
import draggable from 'vuedraggable'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Object, default: () => ({}) },
|
||||
options: { type: Array, default: () => [] },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const columns = reactive({ enabled: [], disabled: [] })
|
||||
let syncing = false
|
||||
|
||||
function keysOf(value) {
|
||||
if (Array.isArray(value)) return value.map(String)
|
||||
return value && typeof value === 'object' ? Object.keys(value) : []
|
||||
}
|
||||
|
||||
function syncColumns() {
|
||||
syncing = true
|
||||
const byKey = new Map(props.options.map(option => [String(option.value), option]))
|
||||
const used = new Set()
|
||||
const normalize = keys => keys.filter(key => byKey.has(key) && !used.has(key)).map(key => {
|
||||
used.add(key)
|
||||
return byKey.get(key)
|
||||
})
|
||||
columns.enabled = normalize(keysOf(props.modelValue?.enabled))
|
||||
columns.disabled = normalize(keysOf(props.modelValue?.disabled))
|
||||
for (const option of props.options) {
|
||||
if (!used.has(String(option.value))) columns.disabled.push(option)
|
||||
}
|
||||
syncing = false
|
||||
}
|
||||
|
||||
function commit() {
|
||||
if (syncing) return
|
||||
const toMap = items => Object.fromEntries(items.map(item => [String(item.value), String(item.label)]))
|
||||
emit('update:modelValue', {
|
||||
enabled: toMap(columns.enabled),
|
||||
disabled: toMap(columns.disabled),
|
||||
})
|
||||
}
|
||||
|
||||
watch(() => [props.modelValue, props.options], syncColumns, { immediate: true, deep: true })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-sorter { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
|
||||
.aksrt-sorter__column { min-height:210px; padding:12px; border:1px solid var(--aksrt-color-border); border-radius:6px; background:var(--aksrt-color-surface); }
|
||||
.aksrt-sorter__column--disabled { background:var(--aksrt-color-canvas); }
|
||||
.aksrt-sorter__title { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; font-weight:600; }
|
||||
.aksrt-sorter__list { display:grid; gap:7px; min-height:44px; }
|
||||
.aksrt-sorter__item { display:flex; align-items:center; gap:9px; min-height:38px; padding:7px 10px; border:1px solid var(--aksrt-color-border); border-radius:4px; background:var(--aksrt-color-surface); }
|
||||
.aksrt-sorter__handle { color:var(--aksrt-color-text-tertiary); cursor:grab; }
|
||||
.aksrt-sorter__ghost { opacity:.45; border-color:var(--aksrt-color-primary); }
|
||||
@media (max-width:720px) { .aksrt-sorter { grid-template-columns:1fr; } }
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-fa-icon-picker">
|
||||
<div class="jio-fa-icon-picker">
|
||||
<n-popover v-model:show="popoverShow" trigger="click" placement="bottom-start" :width="460" :style="{ padding: 0 }">
|
||||
<template #trigger>
|
||||
<n-input
|
||||
@@ -19,8 +19,8 @@
|
||||
</n-input>
|
||||
</template>
|
||||
|
||||
<div class="aksrt-icon-picker__panel" @click="onPanelClick">
|
||||
<div class="aksrt-icon-picker__search">
|
||||
<div class="jio-icon-picker__panel" @click="onPanelClick">
|
||||
<div class="jio-icon-picker__search">
|
||||
<n-input v-model:value="search" placeholder="搜索图标..." size="small" clearable>
|
||||
<template #prefix>
|
||||
<FaIcon icon="fa fas fa-search" :size="12" />
|
||||
@@ -28,12 +28,12 @@
|
||||
</n-input>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-icon-picker__tabs">
|
||||
<div class="jio-icon-picker__tabs">
|
||||
<button
|
||||
v-for="tab in tabs"
|
||||
:key="tab.id"
|
||||
type="button"
|
||||
class="aksrt-icon-picker__tab"
|
||||
class="jio-icon-picker__tab"
|
||||
:class="{ 'is-active': activeTab === tab.id }"
|
||||
@click="activeTab = tab.id"
|
||||
>
|
||||
@@ -42,23 +42,23 @@
|
||||
</div>
|
||||
|
||||
<!-- Custom SVG tab -->
|
||||
<div v-if="activeTab === 'custom'" class="aksrt-icon-picker__custom">
|
||||
<div v-if="activeTab === 'custom'" class="jio-icon-picker__custom">
|
||||
<n-input v-model:value="customCode" type="textarea" placeholder='<svg viewBox="0 0 1024 1024"><path d="…"></path></svg>' :rows="4" />
|
||||
<div class="aksrt-icon-picker__custom-actions">
|
||||
<span class="aksrt-icon-picker__custom-preview" v-html="customPreview"></span>
|
||||
<div class="jio-icon-picker__custom-actions">
|
||||
<span class="jio-icon-picker__custom-preview" v-html="customPreview"></span>
|
||||
<n-button size="small" type="primary" :disabled="!customPreview" @click="insertCustom">
|
||||
确认插入
|
||||
</n-button>
|
||||
</div>
|
||||
<div
|
||||
v-if="sessionCustom.length"
|
||||
class="aksrt-icon-picker__grid aksrt-icon-picker__grid--session"
|
||||
data-aksrt-icon-grid="custom"
|
||||
class="jio-icon-picker__grid jio-icon-picker__grid--session"
|
||||
data-jio-icon-grid="custom"
|
||||
>
|
||||
<div
|
||||
v-for="(svg, i) in sessionCustom"
|
||||
:key="i"
|
||||
class="aksrt-icon-picker__item"
|
||||
class="jio-icon-picker__item"
|
||||
:class="{ 'is-active': modelValue === `customsvg-${svg}` }"
|
||||
title="customsvg"
|
||||
:data-icon="`customsvg-${svg}`"
|
||||
@@ -68,11 +68,11 @@
|
||||
</div>
|
||||
|
||||
<!-- Catalog tab -->
|
||||
<div v-else class="aksrt-icon-picker__grid" data-aksrt-icon-grid="catalog">
|
||||
<div v-else class="jio-icon-picker__grid" data-jio-icon-grid="catalog">
|
||||
<div
|
||||
v-for="icon in filteredIcons"
|
||||
:key="icon"
|
||||
class="aksrt-icon-picker__item"
|
||||
class="jio-icon-picker__item"
|
||||
:class="{ 'is-active': modelValue === composeIconValue(activeGroup, icon) }"
|
||||
:title="icon"
|
||||
:data-icon="composeIconValue(activeGroup, icon)"
|
||||
@@ -80,11 +80,11 @@
|
||||
<i v-if="activeGroup.type === 'fa'" :class="[activeTab, 'fa-' + icon]"></i>
|
||||
<span
|
||||
v-else
|
||||
class="aksrt-icon-picker__preview-svg"
|
||||
v-html="zibsvgMarkup(`zibsvg-${icon}`)"
|
||||
class="jio-icon-picker__preview-svg"
|
||||
v-html="jiosvgMarkup(`jiosvg-${icon}`)"
|
||||
></span>
|
||||
</div>
|
||||
<div v-if="filteredIcons.length === 0" class="aksrt-icon-picker__empty">
|
||||
<div v-if="filteredIcons.length === 0" class="jio-icon-picker__empty">
|
||||
未找到匹配图标
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,7 +96,7 @@
|
||||
<script setup>
|
||||
/**
|
||||
* FaIconPicker — universal icon picker backed by the server catalog
|
||||
* (GET /aksrt/v1/icons/catalog): full FA5 free set, the theme's built-in
|
||||
* (GET /jio/v1/icons/catalog): full FA5 free set, the theme's built-in
|
||||
* SVG sprite keys and inline custom SVG values.
|
||||
*/
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
@@ -105,7 +105,7 @@ import IconValue from './IconValue.vue'
|
||||
import api from '@/api/index.js'
|
||||
import {
|
||||
cleanSvg,
|
||||
zibsvgMarkup,
|
||||
jiosvgMarkup,
|
||||
composeIconValue,
|
||||
} from '@/utils/icons.js'
|
||||
|
||||
@@ -120,7 +120,7 @@ const FALLBACK_TABS = [
|
||||
{ id: 'fas', title: 'Solid', type: 'fa', icons: [] },
|
||||
{ id: 'far', title: 'Regular', type: 'fa', icons: [] },
|
||||
{ id: 'fab', title: 'Brands', type: 'fa', icons: [] },
|
||||
{ id: 'zibsvg', title: '内置 SVG', type: 'svg', icons: [] },
|
||||
{ id: 'jiosvg', title: '内置 SVG', type: 'svg', icons: [] },
|
||||
{ id: 'custom', title: '自定义', type: 'custom', icons: [] },
|
||||
]
|
||||
|
||||
@@ -176,53 +176,53 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-icon-picker__panel {
|
||||
/* The popover teleports to <body>, outside #aksrt-admin-app where the
|
||||
.jio-icon-picker__panel {
|
||||
/* The popover teleports to <body>, outside #jio-admin-app where the
|
||||
palette is declared — re-declare every token the panel consumes. */
|
||||
--aksrt-color-primary: #18A058;
|
||||
--aksrt-color-primary-hover: #36AD6A;
|
||||
--aksrt-color-primary-soft: rgba(24, 160, 88, 0.12);
|
||||
--aksrt-color-text-secondary: #465149;
|
||||
--aksrt-color-muted: #6F7A72;
|
||||
--aksrt-color-border: #E2E8E3;
|
||||
--jio-color-primary: #18A058;
|
||||
--jio-color-primary-hover: #36AD6A;
|
||||
--jio-color-primary-soft: rgba(24, 160, 88, 0.12);
|
||||
--jio-color-text-secondary: #465149;
|
||||
--jio-color-muted: #6F7A72;
|
||||
--jio-color-border: #E2E8E3;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__search {
|
||||
.jio-icon-picker__search {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__tabs {
|
||||
.jio-icon-picker__tabs {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__tab {
|
||||
.jio-icon-picker__tab {
|
||||
padding: 3px 10px;
|
||||
font-size: 13px;
|
||||
line-height: 20px;
|
||||
border: 1px solid var(--aksrt-color-border);
|
||||
border: 1px solid var(--jio-color-border);
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: var(--aksrt-color-text-secondary);
|
||||
color: var(--jio-color-text-secondary);
|
||||
cursor: pointer;
|
||||
transition: all 0.15s;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__tab:hover {
|
||||
border-color: var(--aksrt-color-primary);
|
||||
color: var(--aksrt-color-primary);
|
||||
.jio-icon-picker__tab:hover {
|
||||
border-color: var(--jio-color-primary);
|
||||
color: var(--jio-color-primary);
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__tab.is-active {
|
||||
border-color: var(--aksrt-color-primary);
|
||||
background: var(--aksrt-color-primary);
|
||||
.jio-icon-picker__tab.is-active {
|
||||
border-color: var(--jio-color-primary);
|
||||
background: var(--jio-color-primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__grid {
|
||||
.jio-icon-picker__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(8, 1fr);
|
||||
gap: 4px;
|
||||
@@ -230,7 +230,7 @@ onMounted(async () => {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__item {
|
||||
.jio-icon-picker__item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -239,60 +239,60 @@ onMounted(async () => {
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
color: var(--aksrt-color-text-secondary);
|
||||
color: var(--jio-color-text-secondary);
|
||||
transition: all 0.15s;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__item:hover {
|
||||
background: var(--aksrt-color-primary-soft);
|
||||
color: var(--aksrt-color-primary);
|
||||
.jio-icon-picker__item:hover {
|
||||
background: var(--jio-color-primary-soft);
|
||||
color: var(--jio-color-primary);
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__item.is-active {
|
||||
background: var(--aksrt-color-primary);
|
||||
.jio-icon-picker__item.is-active {
|
||||
background: var(--jio-color-primary);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__item :deep(svg),
|
||||
.aksrt-icon-picker__preview-svg :deep(svg),
|
||||
.aksrt-icon-picker__preview-svg svg {
|
||||
.jio-icon-picker__item :deep(svg),
|
||||
.jio-icon-picker__preview-svg :deep(svg),
|
||||
.jio-icon-picker__preview-svg svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__preview-svg {
|
||||
.jio-icon-picker__preview-svg {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__empty {
|
||||
.jio-icon-picker__empty {
|
||||
grid-column: 1 / -1;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__custom-actions {
|
||||
.jio-icon-picker__custom-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__custom-preview {
|
||||
.jio-icon-picker__custom-preview {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px dashed var(--aksrt-color-muted);
|
||||
border: 1px dashed var(--jio-color-muted);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.aksrt-icon-picker__grid--session {
|
||||
.jio-icon-picker__grid--session {
|
||||
margin-top: 10px;
|
||||
padding-top: 8px;
|
||||
border-top: 1px solid var(--aksrt-color-muted);
|
||||
border-top: 1px solid var(--jio-color-muted);
|
||||
}
|
||||
</style>
|
||||
@@ -3,25 +3,25 @@
|
||||
<i v-if="isFaValue(value)" :class="faClass" aria-hidden="true"></i>
|
||||
<!-- Built-in sprite value -->
|
||||
<span
|
||||
v-else-if="isZibsvgValue(value)"
|
||||
class="aksrt-icon-value__svg"
|
||||
v-html="zibsvgMarkup(value)"
|
||||
v-else-if="isJiosvgValue(value)"
|
||||
class="jio-icon-value__svg"
|
||||
v-html="jiosvgMarkup(value)"
|
||||
></span>
|
||||
<!-- Inline custom SVG value -->
|
||||
<span
|
||||
v-else-if="isCustomSvgValue(value)"
|
||||
class="aksrt-icon-value__svg"
|
||||
class="jio-icon-value__svg"
|
||||
v-html="cleanSvg(value.slice(10))"
|
||||
></span>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* IconValue — renders any icon-picker value ("fa fas fa-star", "zibsvg-key",
|
||||
* IconValue — renders any icon-picker value ("fa fas fa-star", "jiosvg-key",
|
||||
* "customsvg-<svg>") as inline preview markup.
|
||||
*/
|
||||
import { computed } from 'vue'
|
||||
import { cleanSvg, isFaValue, isZibsvgValue, isCustomSvgValue, zibsvgMarkup } from '@/utils/icons.js'
|
||||
import { cleanSvg, isFaValue, isJiosvgValue, isCustomSvgValue, jiosvgMarkup } from '@/utils/icons.js'
|
||||
|
||||
const props = defineProps({
|
||||
value: { type: String, default: '' },
|
||||
@@ -35,12 +35,12 @@ const faClass = computed(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-icon-value__svg {
|
||||
.jio-icon-value__svg {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.aksrt-icon-value__svg :deep(svg),
|
||||
.aksrt-icon-value__svg svg {
|
||||
.jio-icon-value__svg :deep(svg),
|
||||
.jio-icon-value__svg svg {
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
fill: currentColor;
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div ref="editorRef" class="aks-code-editor" :class="{ 'is-disabled': disabled }" />
|
||||
<div ref="editorRef" class="jio-code-editor" :class="{ 'is-disabled': disabled }" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@@ -86,19 +86,19 @@ onBeforeUnmount(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aks-code-editor {
|
||||
.jio-code-editor {
|
||||
border: 1px solid var(--n-border-color, #e0e0e6);
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
min-height: calc(var(--rows, 8) * 22px);
|
||||
}
|
||||
.aks-code-editor :deep(.cm-editor) {
|
||||
.jio-code-editor :deep(.cm-editor) {
|
||||
font-size: 13px;
|
||||
}
|
||||
.aks-code-editor :deep(.cm-editor.cm-focused) {
|
||||
.jio-code-editor :deep(.cm-editor.cm-focused) {
|
||||
outline: none;
|
||||
}
|
||||
.aks-code-editor.is-disabled {
|
||||
.jio-code-editor.is-disabled {
|
||||
opacity: 0.6;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<n-color-picker
|
||||
:value="pickerValue"
|
||||
:modes="modes"
|
||||
:show-alpha="alpha"
|
||||
:swatches="swatches"
|
||||
:actions="clearable ? ['clear'] : undefined"
|
||||
:disabled="disabled"
|
||||
@update:value="onUpdate"
|
||||
>
|
||||
<template v-if="$slots.trigger" #trigger="slotProps">
|
||||
<slot name="trigger" v-bind="slotProps" />
|
||||
</template>
|
||||
</n-color-picker>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* 后台唯一取色器:所有颜色字段都经由此组件,输出与
|
||||
* PHP `Jio\Core\Color::sanitize($value, $allow_alpha)` 同一规则的规范值。
|
||||
* 清空 / 非法值统一回传空串。
|
||||
*/
|
||||
import { computed } from 'vue'
|
||||
import { normalizeColor } from '@/utils/color.js'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: String, default: '' },
|
||||
alpha: { type: Boolean, default: false },
|
||||
clearable: { type: Boolean, default: false },
|
||||
swatches: { type: Array, default: undefined },
|
||||
disabled: { type: Boolean, default: false },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const modes = computed(() => (props.alpha ? ['hex', 'rgb'] : ['hex']))
|
||||
const pickerValue = computed(() => normalizeColor(props.modelValue, props.alpha) || null)
|
||||
|
||||
function onUpdate(value) {
|
||||
emit('update:modelValue', normalizeColor(value, props.alpha))
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<!-- Between number (min/max pair) -->
|
||||
<div class="jio-composite jio-composite--between">
|
||||
<n-input-number
|
||||
:value="betweenValue('min')"
|
||||
:min="schema.min"
|
||||
:max="schema.max"
|
||||
:step="schema.step || 1"
|
||||
:placeholder="schema.minPlaceholder || '最小'"
|
||||
:disabled="schema.disabled"
|
||||
style="flex: 1"
|
||||
@update:value="update('min', $event)"
|
||||
/>
|
||||
<span class="jio-composite__sep">—</span>
|
||||
<n-input-number
|
||||
:value="betweenValue('max')"
|
||||
:min="schema.min"
|
||||
:max="schema.max"
|
||||
:step="schema.step || 1"
|
||||
:placeholder="schema.maxPlaceholder || '最大'"
|
||||
:disabled="schema.disabled"
|
||||
style="flex: 1"
|
||||
@update:value="update('max', $event)"
|
||||
/>
|
||||
<span v-if="schema.unit" class="jio-composite__unit">{{ schema.unit }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 对象型复合字段:between_number(min / max 数值区间)。 */
|
||||
import { computed } from 'vue'
|
||||
|
||||
const props = defineProps({
|
||||
schema: { type: Object, required: true },
|
||||
modelValue: { default: null },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const current = computed(() => (
|
||||
props.modelValue && typeof props.modelValue === 'object' && !Array.isArray(props.modelValue)
|
||||
? props.modelValue
|
||||
: {}
|
||||
))
|
||||
|
||||
function update(part, value) {
|
||||
emit('update:modelValue', { ...current.value, [part]: value })
|
||||
}
|
||||
|
||||
function betweenValue(part) {
|
||||
return current.value[part] !== undefined ? current.value[part] : (props.schema.default?.[part] ?? 0)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.jio-composite {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.jio-composite--between {
|
||||
max-width: 360px;
|
||||
}
|
||||
|
||||
.jio-composite__sep {
|
||||
color: var(--jio-color-border-strong);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.jio-composite__unit {
|
||||
color: var(--jio-color-muted);
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large.
Load diff
+44
-45
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<div class="aksrt-field-group" :class="{ 'is-collapsible': collapsible, 'is-collapsed': collapsible && collapsed }">
|
||||
<div class="jio-field-group" :class="{ 'is-collapsible': collapsible, 'is-collapsed': collapsible && collapsed }">
|
||||
<div
|
||||
v-if="title"
|
||||
class="aksrt-field-group__header"
|
||||
class="jio-field-group__header"
|
||||
:class="{ 'is-clickable': collapsible }"
|
||||
@click="collapsible ? toggleCollapse() : undefined"
|
||||
>
|
||||
<div class="aksrt-field-group__header-left">
|
||||
<FaIcon v-if="icon" :icon="icon" :size="16" class="aksrt-field-group__icon" />
|
||||
<div class="jio-field-group__header-left">
|
||||
<FaIcon v-if="icon" :icon="icon" :size="16" class="jio-field-group__icon" />
|
||||
<div>
|
||||
<h3 class="aksrt-field-group__title">{{ title }}</h3>
|
||||
<p v-if="description" class="aksrt-field-group__desc">{{ description }}</p>
|
||||
<h3 class="jio-field-group__title">{{ title }}</h3>
|
||||
<p v-if="description" class="jio-field-group__desc">{{ description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aksrt-field-group__header-right">
|
||||
<div v-if="$slots.actions" class="aksrt-field-group__actions" @click.stop>
|
||||
<div class="jio-field-group__header-right">
|
||||
<div v-if="$slots.actions" class="jio-field-group__actions" @click.stop>
|
||||
<slot name="actions" />
|
||||
</div>
|
||||
<button
|
||||
v-if="collapsible"
|
||||
type="button"
|
||||
class="aksrt-field-group__collapse-btn"
|
||||
class="jio-field-group__collapse-btn"
|
||||
:aria-expanded="(!collapsed).toString()"
|
||||
:title="collapsed ? '展开配置' : '收起配置'"
|
||||
@click.stop="toggleCollapse"
|
||||
@@ -34,8 +34,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<transition name="aksrt-collapse">
|
||||
<div v-show="!collapsed" class="aksrt-field-group__body">
|
||||
<transition name="jio-collapse">
|
||||
<div v-show="!collapsed" class="jio-field-group__body">
|
||||
<slot />
|
||||
</div>
|
||||
</transition>
|
||||
@@ -44,11 +44,10 @@
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* AksFieldGroup — card-style container for grouping related form fields.
|
||||
* JioFieldGroup — card-style container for grouping related form fields.
|
||||
* Supports collapsible sections, icon headers, and description text.
|
||||
*
|
||||
* defaultCollapsed only seeds initial state. Parent should remount the group
|
||||
* (e.g. via :key when a channel turns on) if it wants to force expand again.
|
||||
* defaultCollapsed only seeds the initial state; afterwards the user toggles freely.
|
||||
*/
|
||||
import { ref } from 'vue'
|
||||
import FaIcon from './FaIcon.vue'
|
||||
@@ -70,16 +69,16 @@ function toggleCollapse() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-field-group {
|
||||
.jio-field-group {
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid var(--aksrt-color-border);
|
||||
border: 1px solid var(--jio-color-border);
|
||||
border-radius: 12px;
|
||||
background: var(--aksrt-color-surface);
|
||||
box-shadow: var(--aksrt-shadow-card);
|
||||
background: var(--jio-color-surface);
|
||||
box-shadow: var(--jio-shadow-card);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.aksrt-field-group__header {
|
||||
.jio-field-group__header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
@@ -87,66 +86,66 @@ function toggleCollapse() {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-field-group__header.is-clickable {
|
||||
.jio-field-group__header.is-clickable {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.aksrt-field-group__header.is-clickable:hover .aksrt-field-group__title {
|
||||
color: var(--aksrt-color-primary);
|
||||
.jio-field-group__header.is-clickable:hover .jio-field-group__title {
|
||||
color: var(--jio-color-primary);
|
||||
}
|
||||
|
||||
.aksrt-field-group.is-collapsed .aksrt-field-group__header {
|
||||
.jio-field-group.is-collapsed .jio-field-group__header {
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
|
||||
.aksrt-field-group__header-left {
|
||||
.jio-field-group__header-left {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 10px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.aksrt-field-group__header-right {
|
||||
.jio-field-group__header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.aksrt-field-group__icon {
|
||||
color: var(--aksrt-color-primary);
|
||||
.jio-field-group__icon {
|
||||
color: var(--jio-color-primary);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.aksrt-field-group__title {
|
||||
.jio-field-group__title {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
transition: color 0.15s;
|
||||
}
|
||||
|
||||
.aksrt-field-group__desc {
|
||||
.jio-field-group__desc {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.aksrt-field-group__actions {
|
||||
.jio-field-group__actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.aksrt-field-group__collapse-btn {
|
||||
.jio-field-group__collapse-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
border: 1px solid var(--aksrt-color-border);
|
||||
background: var(--aksrt-color-canvas);
|
||||
color: var(--aksrt-color-text-secondary);
|
||||
border: 1px solid var(--jio-color-border);
|
||||
background: var(--jio-color-canvas);
|
||||
color: var(--jio-color-text-secondary);
|
||||
border-radius: 999px;
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
@@ -154,25 +153,25 @@ function toggleCollapse() {
|
||||
transition: color 0.15s, border-color 0.15s, background 0.15s;
|
||||
}
|
||||
|
||||
.aksrt-field-group__collapse-btn:hover {
|
||||
color: var(--aksrt-color-primary);
|
||||
border-color: var(--aksrt-color-primary);
|
||||
background: var(--aksrt-color-primary-soft);
|
||||
.jio-field-group__collapse-btn:hover {
|
||||
color: var(--jio-color-primary);
|
||||
border-color: var(--jio-color-primary);
|
||||
background: var(--jio-color-primary-soft);
|
||||
}
|
||||
|
||||
.aksrt-field-group__body {
|
||||
.jio-field-group__body {
|
||||
padding: 16px 20px 20px;
|
||||
}
|
||||
|
||||
/* Collapse transition */
|
||||
.aksrt-collapse-enter-active,
|
||||
.aksrt-collapse-leave-active {
|
||||
.jio-collapse-enter-active,
|
||||
.jio-collapse-leave-active {
|
||||
transition: all 0.2s ease;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.aksrt-collapse-enter-from,
|
||||
.aksrt-collapse-leave-to {
|
||||
.jio-collapse-enter-from,
|
||||
.jio-collapse-leave-to {
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
padding-top: 0;
|
||||
+55
-54
@@ -1,20 +1,22 @@
|
||||
<template>
|
||||
<div class="aksrt-form-renderer">
|
||||
<div class="jio-form-renderer">
|
||||
<!-- Page header with title and description -->
|
||||
<div v-if="title" class="aksrt-form-renderer__header">
|
||||
<div class="aksrt-form-renderer__header-left">
|
||||
<FaIcon v-if="icon" :icon="icon" :size="22" class="aksrt-form-renderer__header-icon" />
|
||||
<div v-if="title" class="jio-form-renderer__header">
|
||||
<div class="jio-form-renderer__header-left">
|
||||
<FaIcon v-if="icon" :icon="icon" :size="22" class="jio-form-renderer__header-icon" />
|
||||
<div>
|
||||
<h1 class="aksrt-form-renderer__title">{{ title }}</h1>
|
||||
<p v-if="description" class="aksrt-form-renderer__desc">{{ description }}</p>
|
||||
<h1 class="jio-form-renderer__title">{{ title }}</h1>
|
||||
<p v-if="description" class="jio-form-renderer__desc">{{ description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="showSearch" class="aksrt-form-renderer__search">
|
||||
<div v-if="showSearch" class="jio-form-renderer__search">
|
||||
<n-input
|
||||
v-model:value="searchQuery"
|
||||
placeholder="搜索设置项..."
|
||||
size="small"
|
||||
clearable
|
||||
name="jio-settings-search"
|
||||
:input-props="searchInputProps"
|
||||
>
|
||||
<template #prefix>
|
||||
<FaIcon icon="fa fas fa-search" :size="12" />
|
||||
@@ -24,7 +26,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Loading state -->
|
||||
<div v-if="loading" class="aksrt-form-renderer__loading">
|
||||
<div v-if="loading" class="jio-form-renderer__loading">
|
||||
<n-spin size="medium" />
|
||||
<span>加载中...</span>
|
||||
</div>
|
||||
@@ -45,7 +47,7 @@
|
||||
<!-- Form content -->
|
||||
<template v-else-if="schema && schema.length">
|
||||
<template v-for="group in filteredSchema" :key="groupKey(group)">
|
||||
<AksFieldGroup
|
||||
<JioFieldGroup
|
||||
v-if="isGroupVisible(group)"
|
||||
:title="group.title"
|
||||
:description="group.description"
|
||||
@@ -59,7 +61,7 @@
|
||||
<!-- Tabbed: renders tabs whose sub-fields are flat top-level keys -->
|
||||
<div
|
||||
v-if="field.type === 'tabbed' && (field.tabs || []).length"
|
||||
class="aksrt-form-renderer__tabbed"
|
||||
class="jio-form-renderer__tabbed"
|
||||
>
|
||||
<n-tabs type="line" animated>
|
||||
<n-tab-pane
|
||||
@@ -69,7 +71,7 @@
|
||||
:tab="tabName(tab)"
|
||||
>
|
||||
<template v-for="sub in (tab.fields || [])" :key="sub.key">
|
||||
<AksField
|
||||
<JioField
|
||||
v-if="isFieldVisible(sub)"
|
||||
:schema="sub"
|
||||
:model-value="getFieldValue(sub.key)"
|
||||
@@ -82,7 +84,7 @@
|
||||
</n-tab-pane>
|
||||
</n-tabs>
|
||||
</div>
|
||||
<AksSorterField
|
||||
<JioSorterField
|
||||
v-else-if="field.type === 'custom' && field.renderer === 'sorter'"
|
||||
:model-value="getFieldValue(field.key) || {}"
|
||||
:options="field.options || []"
|
||||
@@ -93,7 +95,7 @@
|
||||
:name="`field-${field.key}`"
|
||||
v-bind="{ field, value: getFieldValue(field.key), setValue: (value) => setFieldValue(field.key, value), formData }"
|
||||
>
|
||||
<AksField
|
||||
<JioField
|
||||
:schema="field"
|
||||
:model-value="getFieldValue(field.key)"
|
||||
:form-data="formData"
|
||||
@@ -102,7 +104,7 @@
|
||||
@action="emit('field-action', $event)"
|
||||
/>
|
||||
</slot>
|
||||
<AksField
|
||||
<JioField
|
||||
v-else
|
||||
:schema="field"
|
||||
:model-value="getFieldValue(field.key)"
|
||||
@@ -117,24 +119,24 @@
|
||||
|
||||
<!-- Custom group content slot -->
|
||||
<slot :name="`group-${group.key}`" v-bind="{ group, formData }" />
|
||||
</AksFieldGroup>
|
||||
</JioFieldGroup>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<!-- Empty state -->
|
||||
<div v-else class="aksrt-form-renderer__empty">
|
||||
<div v-else class="jio-form-renderer__empty">
|
||||
<FaIcon icon="fa fas fa-cog" :size="32" />
|
||||
<p>暂无配置项</p>
|
||||
</div>
|
||||
|
||||
<!-- Sticky save bar -->
|
||||
<AksSaveBar :dirty="dirty" :saving="saving" @save="$emit('save')" @reload="$emit('reload')" />
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="$emit('save')" @reload="$emit('reload')" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* AksFormRenderer — the core schema-driven form engine.
|
||||
* JioFormRenderer — the core schema-driven form engine.
|
||||
*
|
||||
* Takes a schema definition (array of field groups) and a reactive form data object,
|
||||
* and renders a complete settings page with:
|
||||
@@ -146,10 +148,10 @@
|
||||
*/
|
||||
import { ref, computed, useSlots } from 'vue'
|
||||
import FaIcon from './FaIcon.vue'
|
||||
import AksSaveBar from './AksSaveBar.vue'
|
||||
import AksFieldGroup from './AksFieldGroup.vue'
|
||||
import AksField from './AksField.vue'
|
||||
import AksSorterField from './AksSorterField.vue'
|
||||
import JioSaveBar from './JioSaveBar.vue'
|
||||
import JioFieldGroup from './JioFieldGroup.vue'
|
||||
import JioField from './JioField.vue'
|
||||
import JioSorterField from './JioSorterField.vue'
|
||||
|
||||
const props = defineProps({
|
||||
/** Page title */
|
||||
@@ -185,6 +187,18 @@ const slots = useSlots()
|
||||
|
||||
const searchQuery = ref('')
|
||||
|
||||
// 同一页面上存在大量 type="password" 的凭证字段,Chrome 会把整页当成登录
|
||||
// 表单,并把保存的账号灌进第一个文本框(也就是这个搜索框)。改名成搜索语义,
|
||||
// 并显式关掉各类自动填充,才能让浏览器不再识别它。
|
||||
const searchInputProps = {
|
||||
autocomplete: 'off',
|
||||
autocorrect: 'off',
|
||||
autocapitalize: 'off',
|
||||
spellcheck: 'false',
|
||||
'data-lpignore': 'true',
|
||||
'data-1p-ignore': 'true',
|
||||
}
|
||||
|
||||
/** Evaluate dependsOn rule against current form data */
|
||||
function matchDependsOn(dependsOn) {
|
||||
if (!dependsOn) return true
|
||||
@@ -248,26 +262,13 @@ function isGroupVisible(group) {
|
||||
return matchDependsOn(group.dependsOn)
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapse preference for a group.
|
||||
* - expandWhen: form key; when truthy, start expanded (channel just enabled → open form)
|
||||
* - defaultCollapsed: static default
|
||||
*/
|
||||
/** 可折叠分组的初始状态:defaultCollapsed 为真时默认收起。 */
|
||||
function resolveGroupCollapsed(group) {
|
||||
if (group.expandWhen) {
|
||||
const on = !!props.formData?.[group.expandWhen]
|
||||
return !on
|
||||
}
|
||||
return !!group.defaultCollapsed
|
||||
}
|
||||
|
||||
/** Stable key; remount when expandWhen flips so newly enabled channels open expanded. */
|
||||
function groupKey(group) {
|
||||
const base = group.key || group.title || 'group'
|
||||
if (group.expandWhen) {
|
||||
return `${base}:${props.formData?.[group.expandWhen] ? 'on' : 'off'}`
|
||||
}
|
||||
return base
|
||||
return group.key || group.title || 'group'
|
||||
}
|
||||
|
||||
/** Get field value from formData */
|
||||
@@ -321,7 +322,7 @@ const filteredSchema = computed(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-form-renderer__header {
|
||||
.jio-form-renderer__header {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
@@ -330,73 +331,73 @@ const filteredSchema = computed(() => {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__header-left {
|
||||
.jio-form-renderer__header-left {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__header-icon {
|
||||
color: var(--aksrt-color-primary);
|
||||
.jio-form-renderer__header-icon {
|
||||
color: var(--jio-color-primary);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__title {
|
||||
.jio-form-renderer__title {
|
||||
margin: 0;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__desc {
|
||||
.jio-form-renderer__desc {
|
||||
margin: 4px 0 0;
|
||||
font-size: 13px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__tabbed {
|
||||
.jio-form-renderer__tabbed {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__search {
|
||||
.jio-form-renderer__search {
|
||||
min-width: 200px;
|
||||
max-width: 280px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__loading {
|
||||
.jio-form-renderer__loading {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 60px 0;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__empty {
|
||||
.jio-form-renderer__empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 60px 0;
|
||||
color: var(--aksrt-color-border-strong);
|
||||
color: var(--jio-color-border-strong);
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__empty p {
|
||||
.jio-form-renderer__empty p {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* Mobile */
|
||||
@media (max-width: 768px) {
|
||||
.aksrt-form-renderer__header {
|
||||
.jio-form-renderer__header {
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__search {
|
||||
.jio-form-renderer__search {
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
+49
-40
@@ -1,23 +1,23 @@
|
||||
<template>
|
||||
<div class="aksrt-gallery-field">
|
||||
<div v-if="attachmentIds.length" class="aksrt-gallery-field__grid">
|
||||
<div class="jio-gallery-field">
|
||||
<div v-if="attachmentIds.length" class="jio-gallery-field__grid">
|
||||
<article
|
||||
v-for="(attachmentId, index) in attachmentIds"
|
||||
:key="attachmentId"
|
||||
class="aksrt-gallery-field__item"
|
||||
class="jio-gallery-field__item"
|
||||
>
|
||||
<img
|
||||
v-if="previews[attachmentId]?.url"
|
||||
:src="previews[attachmentId].url"
|
||||
:alt="previews[attachmentId].alt || `附件 ${attachmentId}`"
|
||||
class="aksrt-gallery-field__image"
|
||||
class="jio-gallery-field__image"
|
||||
/>
|
||||
<div v-else class="aksrt-gallery-field__placeholder">
|
||||
<div v-else class="jio-gallery-field__placeholder">
|
||||
<FaIcon icon="fa fas fa-image" :size="22" />
|
||||
<span>#{{ attachmentId }}</span>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-gallery-field__actions">
|
||||
<div class="jio-gallery-field__actions">
|
||||
<n-button
|
||||
size="tiny"
|
||||
quaternary
|
||||
@@ -49,12 +49,12 @@
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div v-else class="aksrt-gallery-field__empty">
|
||||
<div v-else class="jio-gallery-field__empty">
|
||||
<FaIcon icon="fa fas fa-images" :size="28" />
|
||||
<span>尚未选择图片</span>
|
||||
</div>
|
||||
|
||||
<div class="aksrt-gallery-field__buttons">
|
||||
<div class="jio-gallery-field__buttons">
|
||||
<n-button type="primary" secondary @click="openMediaLibrary">
|
||||
<FaIcon icon="fa fas fa-plus" />
|
||||
{{ attachmentIds.length ? '编辑图片' : '选择图片' }}
|
||||
@@ -64,7 +64,7 @@
|
||||
</n-button>
|
||||
</div>
|
||||
|
||||
<p v-if="mediaError" class="aksrt-gallery-field__error">{{ mediaError }}</p>
|
||||
<p v-if="mediaError" class="jio-gallery-field__error">{{ mediaError }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -124,7 +124,7 @@ async function hydratePreviews() {
|
||||
|
||||
const sizes = attachment.get('sizes') || {}
|
||||
return [attachmentId, {
|
||||
url: sizes.thumbnail?.url || sizes.medium?.url || attachment.get('url') || '',
|
||||
url: sizes.medium?.url || attachment.get('url') || '',
|
||||
alt: attachment.get('alt') || attachment.get('title') || '',
|
||||
}]
|
||||
}))
|
||||
@@ -172,61 +172,70 @@ watch(attachmentIds, hydratePreviews, { immediate: true })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-gallery-field__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aksrt-gallery-field__item {
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--aksrt-color-border);
|
||||
border-radius: 8px;
|
||||
background: var(--aksrt-color-canvas);
|
||||
}
|
||||
|
||||
.aksrt-gallery-field__image,
|
||||
.aksrt-gallery-field__placeholder {
|
||||
.jio-gallery-field__grid {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
aspect-ratio: 4 / 3;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.jio-gallery-field__item {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
max-width: 100%;
|
||||
padding: 4px 4px 0;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--jio-color-border);
|
||||
border-radius: 8px;
|
||||
background: var(--jio-color-canvas);
|
||||
}
|
||||
|
||||
.jio-gallery-field__image {
|
||||
display: block;
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
max-height: 90px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.jio-gallery-field__placeholder {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.aksrt-gallery-field__placeholder {
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
}
|
||||
|
||||
.aksrt-gallery-field__actions {
|
||||
.jio-gallery-field__actions {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 4px;
|
||||
border-top: 1px solid var(--aksrt-color-border);
|
||||
border-top: 1px solid var(--jio-color-border);
|
||||
}
|
||||
|
||||
.aksrt-gallery-field__empty {
|
||||
.jio-gallery-field__empty {
|
||||
display: flex;
|
||||
min-height: 116px;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
border: 1px dashed var(--aksrt-color-border-strong);
|
||||
border: 1px dashed var(--jio-color-border-strong);
|
||||
border-radius: 8px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
}
|
||||
|
||||
.aksrt-gallery-field__buttons {
|
||||
.jio-gallery-field__buttons {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.aksrt-gallery-field__error {
|
||||
.jio-gallery-field__error {
|
||||
margin: 8px 0 0;
|
||||
color: #d03050;
|
||||
font-size: 12px;
|
||||
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<div class="jio-image-select" role="radiogroup">
|
||||
<button
|
||||
v-for="opt in options"
|
||||
:key="opt.value"
|
||||
type="button"
|
||||
role="radio"
|
||||
class="jio-image-select__item"
|
||||
:class="{ 'is-active': modelValue === opt.value }"
|
||||
:aria-checked="modelValue === opt.value"
|
||||
:disabled="disabled"
|
||||
@click="emit('update:modelValue', opt.value)"
|
||||
>
|
||||
<img v-if="opt.image" :src="opt.image" :alt="opt.label" class="jio-image-select__img" :style="imgStyle(opt)" />
|
||||
<span v-else class="jio-image-select__placeholder" :style="imgStyle(opt)">
|
||||
<FaIcon :icon="opt.icon || 'fa fas fa-image'" :size="20" />
|
||||
</span>
|
||||
<span class="jio-image-select__label">{{ opt.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** image_select:带预览图的单选。 */
|
||||
import FaIcon from './FaIcon.vue'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { default: null },
|
||||
options: { type: Array, default: () => [] },
|
||||
disabled: { type: Boolean, default: false },
|
||||
// Preview width in px. Layout strips (header/footer) are very wide and only
|
||||
// need enough width to be legible; near-square previews want more room.
|
||||
previewWidth: { type: [Number, String], default: 140 },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
// An option may override the group width via its own `width`.
|
||||
function imgStyle(opt) {
|
||||
const width = opt && opt.width ? opt.width : props.previewWidth
|
||||
return { '--jio-image-select-max': typeof width === 'number' ? `${width}px` : width }
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.jio-image-select {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.jio-image-select__item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
min-width: 80px;
|
||||
padding: 8px;
|
||||
border: 2px solid var(--jio-color-border);
|
||||
border-radius: 8px;
|
||||
background: var(--jio-color-surface);
|
||||
cursor: pointer;
|
||||
transition: border-color .15s ease, background-color .15s ease;
|
||||
}
|
||||
|
||||
.jio-image-select__item:hover,
|
||||
.jio-image-select__item:focus-visible {
|
||||
outline: none;
|
||||
border-color: var(--jio-color-primary);
|
||||
}
|
||||
|
||||
.jio-image-select__item.is-active {
|
||||
border-color: var(--jio-color-primary);
|
||||
background: var(--jio-color-primary-soft);
|
||||
}
|
||||
|
||||
.jio-image-select__item:disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.jio-image-select__img {
|
||||
display: block;
|
||||
/* Preview images are wide layout strips (header 597x57, footer 800x190, slide
|
||||
align 200x101), so let them keep their own aspect ratio inside the card.
|
||||
A fixed square box with object-fit:cover crops the layout to an
|
||||
unrecognisable sliver — the width is capped instead and the height follows. */
|
||||
width: 100%;
|
||||
max-width: var(--jio-image-select-max, 140px);
|
||||
height: auto;
|
||||
border-radius: 4px;
|
||||
background: var(--jio-color-canvas);
|
||||
}
|
||||
|
||||
.jio-image-select__placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: var(--jio-image-select-max, 140px);
|
||||
height: 60px;
|
||||
border-radius: 4px;
|
||||
background: var(--jio-color-canvas);
|
||||
color: var(--jio-color-border-strong);
|
||||
}
|
||||
|
||||
.jio-image-select__label {
|
||||
color: var(--jio-color-text-secondary);
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.jio-image-select__item {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
+43
-34
@@ -1,27 +1,27 @@
|
||||
<template>
|
||||
<div class="aksrt-media-field">
|
||||
<div v-if="modelValue" class="aksrt-media-field__preview">
|
||||
<div class="jio-media-field">
|
||||
<div v-if="modelValue" class="jio-media-field__preview">
|
||||
<img
|
||||
v-if="isImage"
|
||||
:src="modelValue"
|
||||
:alt="placeholder"
|
||||
class="aksrt-media-field__image"
|
||||
class="jio-media-field__image"
|
||||
/>
|
||||
<div v-else class="aksrt-media-field__file">
|
||||
<div v-else class="jio-media-field__file">
|
||||
<FaIcon icon="fa fas fa-file" :size="24" />
|
||||
<span class="aksrt-media-field__filename">{{ fileName }}</span>
|
||||
<span class="jio-media-field__filename">{{ fileName }}</span>
|
||||
</div>
|
||||
<div class="aksrt-media-field__overlay">
|
||||
<n-button size="tiny" quaternary @click="openMediaLibrary">
|
||||
<FaIcon icon="fa fas fa-exchange-alt" /> 更换
|
||||
<div class="jio-media-field__overlay">
|
||||
<n-button size="tiny" secondary circle title="更换" @click="openMediaLibrary">
|
||||
<FaIcon icon="fa fas fa-exchange-alt" />
|
||||
</n-button>
|
||||
<n-button size="tiny" quaternary type="error" @click="clearMedia">
|
||||
<FaIcon icon="fa fas fa-trash-alt" /> 移除
|
||||
<n-button size="tiny" secondary circle type="error" title="移除" @click="clearMedia">
|
||||
<FaIcon icon="fa fas fa-trash-alt" />
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else class="aksrt-media-field__empty" @click="openMediaLibrary">
|
||||
<div v-else class="jio-media-field__empty" @click="openMediaLibrary">
|
||||
<FaIcon icon="fa fas fa-cloud-upload-alt" :size="28" />
|
||||
<span>{{ placeholder }}</span>
|
||||
</div>
|
||||
@@ -30,7 +30,7 @@
|
||||
:value="modelValue"
|
||||
:placeholder="'或直接输入 URL'"
|
||||
size="small"
|
||||
class="aksrt-media-field__url"
|
||||
class="jio-media-field__url"
|
||||
@update:value="emit('update:modelValue', $event)"
|
||||
/>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* AksMediaField — image/file selector with preview.
|
||||
* JioMediaField — image/file selector with preview.
|
||||
*
|
||||
* In the WordPress admin context, this can open the WP Media Library.
|
||||
* For now, it supports direct URL input with preview.
|
||||
@@ -95,73 +95,82 @@ function clearMedia() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-media-field__preview {
|
||||
.jio-media-field__preview {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
max-width: 100%;
|
||||
min-width: 72px;
|
||||
min-height: 44px;
|
||||
padding: 4px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--aksrt-color-border);
|
||||
border: 1px solid var(--jio-color-border);
|
||||
background: var(--jio-color-canvas);
|
||||
margin-bottom: 8px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.aksrt-media-field__image {
|
||||
.jio-media-field__image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 200px;
|
||||
object-fit: cover;
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
max-height: 120px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.aksrt-media-field__file {
|
||||
.jio-media-field__file {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 16px;
|
||||
background: var(--aksrt-color-canvas);
|
||||
background: var(--jio-color-canvas);
|
||||
}
|
||||
|
||||
.aksrt-media-field__filename {
|
||||
.jio-media-field__filename {
|
||||
font-size: 13px;
|
||||
color: var(--aksrt-color-text-secondary);
|
||||
color: var(--jio-color-text-secondary);
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.aksrt-media-field__overlay {
|
||||
.jio-media-field__overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
padding: 6px;
|
||||
padding: 4px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.aksrt-media-field__preview:hover .aksrt-media-field__overlay {
|
||||
.jio-media-field__preview:hover .jio-media-field__overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.aksrt-media-field__empty {
|
||||
.jio-media-field__empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
padding: 32px;
|
||||
border: 2px dashed var(--aksrt-color-border-strong);
|
||||
border: 2px dashed var(--jio-color-border-strong);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
font-size: 13px;
|
||||
transition: all 0.2s;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.aksrt-media-field__empty:hover {
|
||||
border-color: var(--aksrt-color-primary);
|
||||
color: var(--aksrt-color-primary);
|
||||
background: var(--aksrt-color-primary-soft);
|
||||
.jio-media-field__empty:hover {
|
||||
border-color: var(--jio-color-primary);
|
||||
color: var(--jio-color-primary);
|
||||
background: var(--jio-color-primary-soft);
|
||||
}
|
||||
|
||||
.aksrt-media-field__url {
|
||||
.jio-media-field__url {
|
||||
margin-top: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,183 @@
|
||||
<template>
|
||||
<div class="jio-repeater-list">
|
||||
<draggable
|
||||
v-if="rows.length"
|
||||
v-model="rows"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
:item-key="rowKey"
|
||||
:disabled="schema.disabled"
|
||||
class="jio-sortable"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head">
|
||||
<JioSortHandle />
|
||||
<span class="jio-sortable__icon" :class="preview(element).iconClass">
|
||||
<span v-if="preview(element).customIcon" class="jio-repeater-list__icon-html" v-html="preview(element).customIcon" />
|
||||
<i v-else-if="preview(element).icon" :class="preview(element).icon" aria-hidden="true" />
|
||||
<FaIcon v-else icon="fa fas fa-star" :size="16" />
|
||||
</span>
|
||||
<div class="jio-sortable__main">
|
||||
<span class="jio-sortable__title">{{ preview(element).title }}</span>
|
||||
<span class="jio-sortable__desc">{{ preview(element).desc }}</span>
|
||||
</div>
|
||||
<div class="jio-sortable__actions">
|
||||
<n-button size="tiny" quaternary type="primary" :disabled="schema.disabled" @click="openModal(index)">
|
||||
<template #icon><FaIcon icon="fa fas fa-edit" :size="12" /></template>
|
||||
编辑
|
||||
</n-button>
|
||||
<n-button size="tiny" quaternary type="error" :disabled="schema.disabled || reachedMinimum" @click="remove(index)">
|
||||
<template #icon><FaIcon icon="fa fas fa-trash-alt" :size="12" /></template>
|
||||
删除
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<div v-else class="jio-sortable__empty">
|
||||
<FaIcon icon="fa fas fa-inbox" :size="18" />
|
||||
<span>{{ schema.emptyText || '暂无数据' }}</span>
|
||||
</div>
|
||||
|
||||
<n-button size="small" dashed block :disabled="schema.disabled || reachedMaximum" @click="openModal(-1)">
|
||||
<template #icon><FaIcon icon="fa fas fa-plus" :size="12" /></template>
|
||||
{{ schema.button_title || schema.addText || '添加一项' }}
|
||||
</n-button>
|
||||
|
||||
<n-modal
|
||||
v-model:show="modalShow"
|
||||
:mask-closable="false"
|
||||
preset="card"
|
||||
:title="editingIndex >= 0 ? (schema.editText || '编辑项目') : (schema.addText || '添加项目')"
|
||||
class="jio-modal-card"
|
||||
style="max-width: 640px; width: 92vw;"
|
||||
>
|
||||
<div class="jio-repeater-list__modal-fields">
|
||||
<JioField
|
||||
v-for="field in draftFields"
|
||||
:key="field.key"
|
||||
:schema="field"
|
||||
:model-value="draft[field.key]"
|
||||
:form-data="formData"
|
||||
@update:model-value="draft = { ...draft, [field.key]: $event }"
|
||||
/>
|
||||
</div>
|
||||
<div class="jio-modal-footer">
|
||||
<n-button @click="closeModal">取消</n-button>
|
||||
<n-button type="primary" @click="confirmModal">确定</n-button>
|
||||
</div>
|
||||
</n-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** repeater / group 的 list-modal 形态:可拖拽卡片列表 + 弹窗编辑单行。 */
|
||||
import { computed, ref } from 'vue'
|
||||
import draggable from 'vuedraggable'
|
||||
import FaIcon from './FaIcon.vue'
|
||||
import JioField from './JioField.vue'
|
||||
import JioSortHandle from './JioSortHandle.vue'
|
||||
import { matchDependency } from './field-dependency.js'
|
||||
import { SORTABLE_LIST_ATTRS } from './sortable-options.js'
|
||||
import { createRepeaterRow, createRepeaterRowId, repeaterRowPreview } from './repeater-rows.js'
|
||||
|
||||
const props = defineProps({
|
||||
schema: { type: Object, required: true },
|
||||
modelValue: { default: null },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const rows = computed({
|
||||
get: () => (Array.isArray(props.modelValue) ? props.modelValue : []),
|
||||
set: (value) => emit('update:modelValue', Array.isArray(value) ? value : []),
|
||||
})
|
||||
const reachedMinimum = computed(() => rows.value.length <= Number(props.schema.min || 0))
|
||||
const reachedMaximum = computed(() => Number(props.schema.max || 0) > 0 && rows.value.length >= Number(props.schema.max))
|
||||
|
||||
const keys = new WeakMap()
|
||||
let keySeed = 0
|
||||
function rowKey(row) {
|
||||
if (!row || typeof row !== 'object') return String(row)
|
||||
if (row._id) return row._id
|
||||
if (!keys.has(row)) keys.set(row, `rpt_list_${++keySeed}`)
|
||||
return keys.get(row)
|
||||
}
|
||||
|
||||
function preview(row) {
|
||||
return repeaterRowPreview(row, props.schema.listPreview || {})
|
||||
}
|
||||
|
||||
function remove(index) {
|
||||
if (reachedMinimum.value) return
|
||||
const next = [...rows.value]
|
||||
next.splice(index, 1)
|
||||
emit('update:modelValue', next)
|
||||
}
|
||||
|
||||
const modalShow = ref(false)
|
||||
const editingIndex = ref(-1)
|
||||
const draft = ref({})
|
||||
const draftFields = computed(() => (props.schema.fields || []).filter(field => matchDependency(field.dependsOn, draft.value)))
|
||||
|
||||
function openModal(index) {
|
||||
if (props.schema.disabled) return
|
||||
if (index < 0 && reachedMaximum.value) return
|
||||
const base = createRepeaterRow(props.schema.fields)
|
||||
draft.value = index >= 0 ? { ...base, ...(rows.value[index] || {}) } : base
|
||||
editingIndex.value = index
|
||||
modalShow.value = true
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
modalShow.value = false
|
||||
editingIndex.value = -1
|
||||
draft.value = {}
|
||||
}
|
||||
|
||||
function confirmModal() {
|
||||
const next = [...rows.value]
|
||||
const row = { ...draft.value }
|
||||
if (!row._id) row._id = createRepeaterRowId()
|
||||
if (editingIndex.value >= 0 && editingIndex.value < next.length) {
|
||||
next[editingIndex.value] = row
|
||||
} else {
|
||||
next.push(row)
|
||||
}
|
||||
emit('update:modelValue', next)
|
||||
closeModal()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.jio-repeater-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.jio-repeater-list__icon-html {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.jio-repeater-list__icon-html :deep(svg),
|
||||
.jio-repeater-list__icon-html :deep(img) {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.jio-repeater-list__modal-fields {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
max-height: min(70vh, 560px);
|
||||
overflow: auto;
|
||||
padding-right: 2px;
|
||||
}
|
||||
</style>
|
||||
+16
-16
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div v-if="dirty" class="aksrt-form-renderer__save-bar">
|
||||
<div class="aksrt-form-renderer__save-bar__inner">
|
||||
<div class="aksrt-form-renderer__save-bar__info">
|
||||
<div v-if="dirty" class="jio-form-renderer__save-bar">
|
||||
<div class="jio-form-renderer__save-bar__inner">
|
||||
<div class="jio-form-renderer__save-bar__info">
|
||||
<FaIcon icon="fa fas fa-exclamation-circle" :size="14" />
|
||||
<span>您有未保存的更改</span>
|
||||
</div>
|
||||
<div class="aksrt-form-renderer__save-bar__actions">
|
||||
<div class="jio-form-renderer__save-bar__actions">
|
||||
<n-button size="small" :disabled="saving" @click="emit('reload')">放弃更改</n-button>
|
||||
<n-button
|
||||
size="small"
|
||||
@@ -23,8 +23,8 @@
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* AksSaveBar — the admin-wide sticky save bar (shown only when dirty).
|
||||
* Shared by AksFormRenderer (schema pages) and custom settings pages.
|
||||
* JioSaveBar — the admin-wide sticky save bar (shown only when dirty).
|
||||
* Shared by JioFormRenderer (schema pages) and custom settings pages.
|
||||
*/
|
||||
import FaIcon from './FaIcon.vue'
|
||||
|
||||
@@ -37,19 +37,19 @@ const emit = defineEmits(['save', 'reload'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-form-renderer__save-bar {
|
||||
.jio-form-renderer__save-bar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
background: var(--aksrt-color-surface);
|
||||
border-top: 1px solid var(--aksrt-color-border);
|
||||
box-shadow: var(--aksrt-shadow-floating);
|
||||
background: var(--jio-color-surface);
|
||||
border-top: 1px solid var(--jio-color-border);
|
||||
box-shadow: var(--jio-shadow-floating);
|
||||
animation: slideUp 0.2s ease;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__save-bar__inner {
|
||||
.jio-form-renderer__save-bar__inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
@@ -59,7 +59,7 @@ const emit = defineEmits(['save', 'reload'])
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__save-bar__info {
|
||||
.jio-form-renderer__save-bar__info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
@@ -67,7 +67,7 @@ const emit = defineEmits(['save', 'reload'])
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__save-bar__actions {
|
||||
.jio-form-renderer__save-bar__actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
@@ -84,17 +84,17 @@ const emit = defineEmits(['save', 'reload'])
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.aksrt-form-renderer__save-bar__inner {
|
||||
.jio-form-renderer__save-bar__inner {
|
||||
flex-direction: column;
|
||||
padding: 10px 14px;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__save-bar__actions {
|
||||
.jio-form-renderer__save-bar__actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.aksrt-form-renderer__save-bar__actions .n-button {
|
||||
.jio-form-renderer__save-bar__actions .n-button {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<div v-if="visible" class="jio-secret-clear">
|
||||
<n-button size="small" secondary :type="marked ? 'warning' : 'error'" @click="$emit('toggle')">
|
||||
{{ marked ? '取消清除' : '清除已配置密钥' }}
|
||||
</n-button>
|
||||
<span v-if="marked" class="jio-secret-clear__hint">保存后将删除此密钥</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/**
|
||||
* 已配置密钥的「清除 / 取消清除」操作,input 与 textarea 两种 secret 字段共用。
|
||||
*/
|
||||
defineProps({
|
||||
/** 当前存在已配置密钥('***')或已标记清除时显示 */
|
||||
visible: { type: Boolean, default: false },
|
||||
/** 是否已标记为保存时清除 */
|
||||
marked: { type: Boolean, default: false },
|
||||
})
|
||||
|
||||
defineEmits(['toggle'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.jio-secret-clear {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.jio-secret-clear__hint {
|
||||
color: var(--jio-color-warning, #d97706);
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,53 @@
|
||||
<template>
|
||||
<draggable
|
||||
v-model="values"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
:item-key="valueKey"
|
||||
:disabled="disabled"
|
||||
class="jio-sortable jio-sortable--compact jio-selected-order"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head">
|
||||
<JioSortHandle />
|
||||
<span class="jio-sortable__index">{{ index + 1 }}</span>
|
||||
<span class="jio-sortable__title">{{ labelOf(element) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 多选 + sortable 的已选值排序列表(select / async_select 下方)。 */
|
||||
import { computed } from 'vue'
|
||||
import draggable from 'vuedraggable'
|
||||
import JioSortHandle from './JioSortHandle.vue'
|
||||
import { SORTABLE_LIST_ATTRS } from './sortable-options.js'
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Array, required: true },
|
||||
options: { type: Array, default: () => [] },
|
||||
disabled: { type: Boolean, default: false },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
|
||||
const values = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (next) => emit('update:modelValue', next),
|
||||
})
|
||||
|
||||
function valueKey(value) {
|
||||
return String(value)
|
||||
}
|
||||
|
||||
function labelOf(value) {
|
||||
return props.options.find(option => option.value === value)?.label || String(value)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.jio-selected-order {
|
||||
margin-top: 8px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<button type="button" class="jio-sortable__handle" :title="label" :aria-label="label">
|
||||
<i class="fa fas fa-grip-vertical" aria-hidden="true"></i>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 拖拽排序手柄;SORTABLE_LIST_ATTRS.handle 指向它的类名。 */
|
||||
defineProps({
|
||||
label: { type: String, default: '拖拽排序' },
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,143 @@
|
||||
<template>
|
||||
<div class="jio-sorter">
|
||||
<div
|
||||
v-for="column in COLUMNS"
|
||||
:key="column.key"
|
||||
class="jio-sorter__column"
|
||||
:class="`jio-sorter__column--${column.key}`"
|
||||
>
|
||||
<div class="jio-sorter__title">
|
||||
<span>{{ column.title }}</span>
|
||||
<n-tag size="small" :type="column.tagType" :bordered="false">{{ columns[column.key].length }}</n-tag>
|
||||
</div>
|
||||
<draggable
|
||||
v-model="columns[column.key]"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
item-key="value"
|
||||
group="jio-sorter"
|
||||
class="jio-sortable jio-sortable--compact jio-sorter__list"
|
||||
@change="commit"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head">
|
||||
<JioSortHandle />
|
||||
<i v-if="element.icon" :class="element.icon" class="jio-sorter__icon" aria-hidden="true"></i>
|
||||
<span class="jio-sortable__title">{{ element.label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<div v-if="columns[column.key].length === 0" class="jio-sortable__empty jio-sorter__empty">
|
||||
{{ column.empty }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 启用 / 未启用两列拖拽排序器;样式见 styles/sortable-list.css。 */
|
||||
import { reactive, watch } from 'vue'
|
||||
import draggable from 'vuedraggable'
|
||||
import JioSortHandle from './JioSortHandle.vue'
|
||||
import { SORTABLE_LIST_ATTRS } from './sortable-options.js'
|
||||
|
||||
const COLUMNS = [
|
||||
{ key: 'enabled', title: '已启用', tagType: 'success', empty: '拖拽到此处启用' },
|
||||
{ key: 'disabled', title: '未启用', tagType: 'default', empty: '拖拽到此处停用' },
|
||||
]
|
||||
|
||||
const props = defineProps({
|
||||
modelValue: { type: Object, default: () => ({}) },
|
||||
options: { type: Array, default: () => [] },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const columns = reactive({ enabled: [], disabled: [] })
|
||||
let syncing = false
|
||||
|
||||
function keysOf(value) {
|
||||
if (Array.isArray(value)) return value.map(String)
|
||||
return value && typeof value === 'object' ? Object.keys(value) : []
|
||||
}
|
||||
|
||||
function syncColumns() {
|
||||
syncing = true
|
||||
const byKey = new Map(props.options.map(option => [String(option.value), option]))
|
||||
const used = new Set()
|
||||
const normalize = keys => keys.filter(key => byKey.has(key) && !used.has(key)).map(key => {
|
||||
used.add(key)
|
||||
return byKey.get(key)
|
||||
})
|
||||
columns.enabled = normalize(keysOf(props.modelValue?.enabled))
|
||||
columns.disabled = normalize(keysOf(props.modelValue?.disabled))
|
||||
for (const option of props.options) {
|
||||
if (!used.has(String(option.value))) columns.disabled.push(option)
|
||||
}
|
||||
syncing = false
|
||||
}
|
||||
|
||||
function commit() {
|
||||
if (syncing) return
|
||||
const toMap = items => Object.fromEntries(items.map(item => [String(item.value), String(item.label)]))
|
||||
emit('update:modelValue', {
|
||||
enabled: toMap(columns.enabled),
|
||||
disabled: toMap(columns.disabled),
|
||||
})
|
||||
}
|
||||
|
||||
watch(() => [props.modelValue, props.options], syncColumns, { immediate: true, deep: true })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.jio-sorter {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.jio-sorter__column {
|
||||
position: relative;
|
||||
min-height: 210px;
|
||||
padding: 12px;
|
||||
border: 1px solid var(--jio-color-border);
|
||||
border-radius: 8px;
|
||||
background: var(--jio-color-canvas);
|
||||
}
|
||||
|
||||
.jio-sorter__title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
color: var(--jio-color-text);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 空列也要留出可放置区域,拖拽目标不能塌成 0 高度。 */
|
||||
.jio-sorter__list {
|
||||
min-height: 44px;
|
||||
}
|
||||
|
||||
.jio-sorter__empty {
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
bottom: 12px;
|
||||
left: 12px;
|
||||
top: 46px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.jio-sorter__icon {
|
||||
flex: 0 0 auto;
|
||||
width: 16px;
|
||||
color: var(--jio-color-primary);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.jio-sorter {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* schema 字段的 dependsOn 规则求值。sourceValue 是规则引用的数据对象
|
||||
* (fieldset 值 / repeater 行 / 弹窗草稿)。
|
||||
*/
|
||||
export function matchDependency(rule, sourceValue) {
|
||||
if (!rule) return true
|
||||
const source = sourceValue && typeof sourceValue === 'object' ? sourceValue : {}
|
||||
if (rule.all) return rule.all.every(item => matchDependency(item, source))
|
||||
if (rule.any) return rule.any.some(item => matchDependency(item, source))
|
||||
const value = source[rule.key]
|
||||
if (rule.operator === 'truthy') return !!value
|
||||
if (rule.operator === 'falsy') return !value
|
||||
if (rule.operator === 'not_empty') return Array.isArray(value) ? value.length > 0 : value !== '' && value != null
|
||||
if (rule.operator === 'empty') return Array.isArray(value) ? value.length === 0 : value === '' || value == null
|
||||
if (rule.operator === 'eq') return value === rule.value
|
||||
if (rule.operator === 'neq') return value !== rule.value
|
||||
return rule.value === undefined || value === rule.value
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* repeater / group 行的纯函数:新行默认值、行 ID、listPreview 摘要与预览。
|
||||
* inline 与 list-modal 两种渲染共用。
|
||||
*/
|
||||
let rowIdCounter = 0
|
||||
|
||||
export function createRepeaterRowId() {
|
||||
return `rpt_${Date.now()}_${++rowIdCounter}`
|
||||
}
|
||||
|
||||
export function createRepeaterRow(fields) {
|
||||
const row = { _id: createRepeaterRowId() }
|
||||
for (const field of (Array.isArray(fields) ? fields : [])) {
|
||||
// UI-only chrome rows (notice / alert) are presentation only.
|
||||
if (field.ui_only) continue
|
||||
if (field.default !== undefined) {
|
||||
row[field.key] = field.default
|
||||
} else if (field.type === 'switch') {
|
||||
row[field.key] = false
|
||||
} else if (field.type === 'checkbox' || field.type === 'repeater') {
|
||||
row[field.key] = []
|
||||
} else {
|
||||
row[field.key] = ''
|
||||
}
|
||||
}
|
||||
return row
|
||||
}
|
||||
|
||||
/** time/unit 形态的时长摘要:0 视为永久,其余按 day/month 补单位。 */
|
||||
function rowDuration(row, cfg) {
|
||||
if (!cfg.descKey) return ''
|
||||
const raw = row[cfg.descKey]
|
||||
if (raw === '' || raw == null) return ''
|
||||
const amount = Number(raw)
|
||||
if (!Number.isFinite(amount)) return String(raw)
|
||||
if (amount <= 0) return '永久'
|
||||
if (!cfg.descUnitKey) return String(raw)
|
||||
const unit = String(row[cfg.descUnitKey] || '')
|
||||
if (unit === 'month') return `${amount} 个月`
|
||||
if (unit === 'day') return `${amount} 天`
|
||||
return String(raw)
|
||||
}
|
||||
|
||||
/** 未配置 titleKey 时,取首个值为非空字符串/数字的字段作为标题。 */
|
||||
function fallbackTitleKey(row, fields) {
|
||||
if (row.title != null && String(row.title).trim() !== '') return 'title'
|
||||
for (const field of (Array.isArray(fields) ? fields : [])) {
|
||||
if (field.ui_only) continue
|
||||
const value = row[field.key]
|
||||
if ((typeof value === 'string' && value.trim() !== '') || typeof value === 'number') return field.key
|
||||
}
|
||||
return 'title'
|
||||
}
|
||||
|
||||
/** 收起态标题行上的一行摘要,取自 listPreview 配置。 */
|
||||
export function repeaterRowSummary(row, cfg = {}, fields = []) {
|
||||
if (!row) return ''
|
||||
const title = String(row[cfg.titleKey || fallbackTitleKey(row, fields)] ?? '').trim()
|
||||
const prefix = String(cfg.prefix || '')
|
||||
if (title === '') return prefix
|
||||
const duration = rowDuration(row, cfg)
|
||||
return duration ? `${prefix}${title} · ${duration}` : `${prefix}${title}`
|
||||
}
|
||||
|
||||
/** list-modal 卡片预览:图标 / 自定义图标 HTML / 图标类 / 标题 / 描述。 */
|
||||
export function repeaterRowPreview(row, cfg = {}) {
|
||||
const read = (key) => String(row?.[key] || '').trim()
|
||||
const desc = read(cfg.descKey || 'desc') || read(cfg.urlKey || 'url')
|
||||
return {
|
||||
icon: read(cfg.iconKey || 'icon'),
|
||||
customIcon: read(cfg.customIconKey || 'custom_icon'),
|
||||
iconClass: read(cfg.iconClassKey || 'icon_class'),
|
||||
title: read(cfg.titleKey || 'title') || '未命名卡片',
|
||||
desc: desc || '暂无描述',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 所有后台 vuedraggable 列表共用的 Sortable 选项(v-bind 到 <draggable>)。
|
||||
* 配套样式见 src/styles/sortable-list.css,拖拽手柄统一用 JioSortHandle。
|
||||
*/
|
||||
const prefersReducedMotion = typeof window !== 'undefined'
|
||||
&& typeof window.matchMedia === 'function'
|
||||
&& window.matchMedia('(prefers-reduced-motion: reduce)').matches
|
||||
|
||||
export const SORTABLE_LIST_ATTRS = Object.freeze({
|
||||
handle: '.jio-sortable__handle',
|
||||
ghostClass: 'jio-sortable__ghost',
|
||||
chosenClass: 'jio-sortable__chosen',
|
||||
dragClass: 'jio-sortable__drag',
|
||||
animation: prefersReducedMotion ? 0 : 180,
|
||||
})
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* 可排序卡片列表的折叠状态:所有带展开区的卡片默认收起,点击行头展开/收起。
|
||||
*
|
||||
* 状态按行的稳定 key 记录(而不是下标),拖拽换位后每张卡片保持自己的开合状态。
|
||||
* 行头属性统一由 collapseHeadAttrs 生成:可点击、可键盘操作(Enter / Space)、
|
||||
* 带 aria-expanded,样式见 styles/sortable-list.css。
|
||||
*/
|
||||
import { ref } from 'vue'
|
||||
|
||||
export function collapseHeadAttrs(open, toggle) {
|
||||
return {
|
||||
class: 'is-clickable',
|
||||
role: 'button',
|
||||
tabindex: 0,
|
||||
'aria-expanded': open ? 'true' : 'false',
|
||||
onClick: toggle,
|
||||
onKeydown: (event) => {
|
||||
// 只响应行头本身的按键,行内按钮 / 输入框的 Enter、空格不触发折叠。
|
||||
if (event.target !== event.currentTarget) return
|
||||
if (event.key !== 'Enter' && event.key !== ' ') return
|
||||
event.preventDefault()
|
||||
toggle()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export function useCollapsibleItems() {
|
||||
const openKeys = ref(new Set())
|
||||
|
||||
function isOpen(key) {
|
||||
return openKeys.value.has(key)
|
||||
}
|
||||
|
||||
function toggle(key) {
|
||||
const next = new Set(openKeys.value)
|
||||
if (next.has(key)) next.delete(key)
|
||||
else next.add(key)
|
||||
openKeys.value = next
|
||||
}
|
||||
|
||||
function headAttrs(key) {
|
||||
return collapseHeadAttrs(isOpen(key), () => toggle(key))
|
||||
}
|
||||
|
||||
return { isOpen, toggle, headAttrs }
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
import { onMounted, ref } from 'vue'
|
||||
import api from '@/api'
|
||||
|
||||
/**
|
||||
* JioField 的远程选项加载:async_select / taxonomy_select / user_select / page_select。
|
||||
* 仅按 schema.type 在挂载时拉取对应数据源。
|
||||
*/
|
||||
export function useFieldRemoteOptions(props) {
|
||||
const asyncOptions = ref([])
|
||||
const asyncLoading = ref(false)
|
||||
const taxonomyOptions = ref([])
|
||||
const taxonomyLoading = ref(false)
|
||||
const userOptions = ref([])
|
||||
const userLoading = ref(false)
|
||||
const pageOptions = ref([])
|
||||
const pageLoading = ref(false)
|
||||
let asyncTimer = null
|
||||
let userTimer = null
|
||||
let pageTimer = null
|
||||
|
||||
async function loadAsyncOptions(query = '') {
|
||||
asyncLoading.value = true
|
||||
try {
|
||||
const selected = Array.isArray(props.modelValue) ? props.modelValue : (props.modelValue ? [props.modelValue] : [])
|
||||
const response = await api.searchPageDisplayOptions(props.schema.source, query, query ? [] : selected)
|
||||
asyncOptions.value = response?.data || []
|
||||
} catch (error) {
|
||||
asyncOptions.value = []
|
||||
} finally {
|
||||
asyncLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleAsyncSearch(query) {
|
||||
clearTimeout(asyncTimer)
|
||||
asyncTimer = setTimeout(() => loadAsyncOptions(query), 250)
|
||||
}
|
||||
|
||||
async function loadTaxonomyTerms() {
|
||||
if (!props.schema.taxonomy) return
|
||||
taxonomyLoading.value = true
|
||||
try {
|
||||
const res = await api.getCategories(props.schema.taxonomy || 'category')
|
||||
const items = res?.data || res || []
|
||||
taxonomyOptions.value = (Array.isArray(items) ? items : []).map(t => ({
|
||||
label: t.name + (t.count ? ' (' + t.count + ')' : ''),
|
||||
value: t.term_id,
|
||||
}))
|
||||
} catch (e) {
|
||||
console.warn('[JioField] taxonomy load failed:', e)
|
||||
taxonomyOptions.value = []
|
||||
} finally {
|
||||
taxonomyLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function loadUsers(query = '') {
|
||||
userLoading.value = true
|
||||
try {
|
||||
const res = await api.searchUsers(query, 20)
|
||||
const items = res?.data || res || []
|
||||
userOptions.value = (Array.isArray(items) ? items : []).map(u => ({
|
||||
label: u.display_name + ' (' + u.user_login + ')',
|
||||
value: u.id,
|
||||
}))
|
||||
} catch (e) {
|
||||
console.warn('[JioField] user load failed:', e)
|
||||
userOptions.value = []
|
||||
} finally {
|
||||
userLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleUserSearch(query) {
|
||||
clearTimeout(userTimer)
|
||||
userTimer = setTimeout(() => loadUsers(query || ''), 300)
|
||||
}
|
||||
|
||||
async function loadPages(query = '') {
|
||||
pageLoading.value = true
|
||||
try {
|
||||
const selected = props.modelValue ? [props.modelValue] : []
|
||||
const res = await api.searchPageDisplayOptions('pages', query, query ? [] : selected)
|
||||
const items = res?.data || res || []
|
||||
pageOptions.value = Array.isArray(items) ? items : []
|
||||
} catch (e) {
|
||||
console.warn('[JioField] page load failed:', e)
|
||||
pageOptions.value = []
|
||||
} finally {
|
||||
pageLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handlePageSearch(query) {
|
||||
clearTimeout(pageTimer)
|
||||
pageTimer = setTimeout(() => loadPages(query), 250)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const type = props.schema.type
|
||||
if (type === 'taxonomy_select') loadTaxonomyTerms()
|
||||
if (type === 'user_select') loadUsers()
|
||||
if (type === 'async_select') loadAsyncOptions()
|
||||
if (type === 'page_select') loadPages()
|
||||
})
|
||||
|
||||
return {
|
||||
asyncOptions,
|
||||
asyncLoading,
|
||||
handleAsyncSearch,
|
||||
taxonomyOptions,
|
||||
taxonomyLoading,
|
||||
userOptions,
|
||||
userLoading,
|
||||
handleUserSearch,
|
||||
pageOptions,
|
||||
pageLoading,
|
||||
handlePageSearch,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import { renderFaIcon, schemaPage } from './helpers'
|
||||
|
||||
export const forumSection = {
|
||||
key: 'forum',
|
||||
label: '社区论坛',
|
||||
icon: renderFaIcon('fa fas fa-comments'),
|
||||
route: '/forum',
|
||||
children: [
|
||||
schemaPage({
|
||||
key: 'forum-general',
|
||||
name: 'Forum_general',
|
||||
label: '全局设置',
|
||||
title: '全局设置',
|
||||
route: '/forum/general',
|
||||
canonicalDomain: 'forum',
|
||||
section: 'general',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'forum-home',
|
||||
name: 'Forum_home',
|
||||
label: '首页与列表',
|
||||
title: '首页与列表',
|
||||
route: '/forum/home',
|
||||
canonicalDomain: 'forum',
|
||||
section: 'home',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'forum-publishing',
|
||||
name: 'Forum_publishing',
|
||||
label: '发布与审核',
|
||||
title: '发布与审核',
|
||||
route: '/forum/publishing',
|
||||
canonicalDomain: 'forum',
|
||||
section: 'publishing',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'forum-access',
|
||||
name: 'Forum_access',
|
||||
label: '权限与版主',
|
||||
title: '权限与版主',
|
||||
route: '/forum/access',
|
||||
canonicalDomain: 'forum',
|
||||
section: 'access',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'forum-replies',
|
||||
name: 'Forum_replies',
|
||||
label: '回复与互动',
|
||||
title: '回复与互动',
|
||||
route: '/forum/replies',
|
||||
canonicalDomain: 'forum',
|
||||
section: 'replies',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'forum-payment',
|
||||
name: 'Forum_payment',
|
||||
label: '付费与积分',
|
||||
title: '付费与积分',
|
||||
route: '/forum/payment',
|
||||
canonicalDomain: 'forum',
|
||||
section: 'payment',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'forum-urls',
|
||||
name: 'Forum_urls',
|
||||
label: '链接设置',
|
||||
title: '链接设置',
|
||||
route: '/forum/urls',
|
||||
canonicalDomain: 'forum',
|
||||
section: 'urls',
|
||||
}),
|
||||
],
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export const globalSection = {
|
||||
label: '常用功能',
|
||||
route: '/global/common',
|
||||
title: '常用功能',
|
||||
desc: '评论、性能、头像源与备案等全局基础配置。',
|
||||
desc: '评论、性能、头像源等全局基础配置。',
|
||||
canonicalDomain: 'global',
|
||||
section: 'common',
|
||||
}),
|
||||
|
||||
@@ -8,6 +8,7 @@ import { extensionsSection } from './extensions'
|
||||
import { themeInfoSection } from './theme-info'
|
||||
import { docsSection } from './docs'
|
||||
import { toolsSection } from './tools'
|
||||
import { forumSection } from './forum'
|
||||
|
||||
const SECTION_DEFAULT_CHILDREN = {
|
||||
global: 'global-common',
|
||||
@@ -18,6 +19,7 @@ const SECTION_DEFAULT_CHILDREN = {
|
||||
payment: 'payment-knowledge',
|
||||
extensions: 'extensions-system',
|
||||
tools: 'tools-import-export',
|
||||
forum: 'forum-general',
|
||||
'theme-info': 'theme-info-dashboard',
|
||||
docs: 'docs-dashboard',
|
||||
}
|
||||
@@ -43,6 +45,7 @@ export const ADMIN_SECTIONS = [
|
||||
attachSectionDefaultRoute(permissionsSection),
|
||||
attachSectionDefaultRoute(usersSection),
|
||||
attachSectionDefaultRoute(paymentSection),
|
||||
attachSectionDefaultRoute(forumSection),
|
||||
attachSectionDefaultRoute(extensionsSection),
|
||||
attachSectionDefaultRoute(toolsSection),
|
||||
attachSectionDefaultRoute(themeInfoSection),
|
||||
|
||||
@@ -60,6 +60,15 @@ export const pageDisplaySection = {
|
||||
canonicalDomain: 'page_display',
|
||||
section: 'tag',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'page-display-topics',
|
||||
name: 'PageDisplayTopics',
|
||||
label: '专题页面',
|
||||
route: '/page-display/topics',
|
||||
title: '专题页面',
|
||||
canonicalDomain: 'page_display',
|
||||
section: 'topics',
|
||||
}),
|
||||
schemaPage({
|
||||
key: 'page-display-user-home',
|
||||
name: 'PageDisplayUserHome',
|
||||
|
||||
+12
-11
@@ -4,6 +4,7 @@ import NaiveUI from 'naive-ui'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import './style.css'
|
||||
import './styles/sortable-list.css'
|
||||
import { styleMountTarget } from './style-target'
|
||||
|
||||
const app = createApp(App)
|
||||
@@ -13,35 +14,35 @@ app.use(NaiveUI)
|
||||
|
||||
// 全局错误处理
|
||||
app.config.errorHandler = (err, vm, info) => {
|
||||
console.error('[AKSRT] 全局错误:', err, info)
|
||||
console.error('[Jio] 全局错误:', err, info)
|
||||
}
|
||||
|
||||
// 兜底:立即显示加载状态(防止白屏)
|
||||
function showFallback(el) {
|
||||
el.innerHTML = '<div style="padding:40px;text-align:center;color:#666;font-family:sans-serif;">'
|
||||
+ '<p style="font-size:18px;margin-bottom:8px;">AKSRT 正在加载...</p>'
|
||||
+ '<p style="font-size:18px;margin-bottom:8px;">Jio 正在加载...</p>'
|
||||
+ '<p style="font-size:13px;color:#999;">如果长时间停留在此页面,请按 F12 查看控制台错误</p>'
|
||||
+ '</div>'
|
||||
}
|
||||
showFallback(document.getElementById('aksrt-admin-app') || document.body.appendChild(
|
||||
Object.assign(document.createElement('div'), { id: 'aksrt-admin-app' })
|
||||
showFallback(document.getElementById('jio-admin-app') || document.body.appendChild(
|
||||
Object.assign(document.createElement('div'), { id: 'jio-admin-app' })
|
||||
))
|
||||
|
||||
/**
|
||||
* 获取或创建一个干净的挂载容器
|
||||
* 核心问题:WordPress 后台的 jQuery/脚本会在页面加载后持续操作 DOM,
|
||||
* 导致 PHP 输出的 <div id="aksrt-admin-app"> 可能被外部修改或其兄弟节点被移除,
|
||||
* 导致 PHP 输出的 <div id="jio-admin-app"> 可能被外部修改或其兄弟节点被移除,
|
||||
* Vue patch 时遍历到 null 节点 → nextSibling 报错。
|
||||
*
|
||||
* 解决方案:在挂载前一刻,动态创建一个全新的容器元素替换旧的,
|
||||
* 确保该节点及其父级在 Vue 接管前不被任何外部脚本污染。
|
||||
*/
|
||||
function getCleanContainer() {
|
||||
const existing = document.getElementById('aksrt-admin-app')
|
||||
const existing = document.getElementById('jio-admin-app')
|
||||
if (!existing) {
|
||||
// 极端情况:PHP 没有输出容器,手动创建
|
||||
const fresh = document.createElement('div')
|
||||
fresh.id = 'aksrt-admin-app'
|
||||
fresh.id = 'jio-admin-app'
|
||||
document.body.appendChild(fresh)
|
||||
return fresh
|
||||
}
|
||||
@@ -52,13 +53,13 @@ function getCleanContainer() {
|
||||
if (!parent) {
|
||||
// 旧容器已脱离文档树,重新创建
|
||||
const fresh = document.createElement('div')
|
||||
fresh.id = 'aksrt-admin-app'
|
||||
fresh.id = 'jio-admin-app'
|
||||
document.body.appendChild(fresh)
|
||||
return fresh
|
||||
}
|
||||
|
||||
const fresh = document.createElement('div')
|
||||
fresh.id = 'aksrt-admin-app'
|
||||
fresh.id = 'jio-admin-app'
|
||||
|
||||
// 将旧容器的位置信息转移给新容器(保留 fallback 内容)
|
||||
fresh.innerHTML = existing.innerHTML || ''
|
||||
@@ -90,12 +91,12 @@ router.isReady().then(() => {
|
||||
styleMountTarget.value = container
|
||||
app.mount(container)
|
||||
} catch (err) {
|
||||
console.error('[AKSRT] Vue 挂载失败:', err)
|
||||
console.error('[Jio] Vue 挂载失败:', err)
|
||||
showError(getCleanContainer(), err)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.error('[AKSRT] Router 初始化失败:', err)
|
||||
console.error('[Jio] Router 初始化失败:', err)
|
||||
})
|
||||
@@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<h2 class="aksrt-page-title">积分配置</h2>
|
||||
<p class="aksrt-page-desc">
|
||||
<div class="jio-page-container">
|
||||
<h2 class="jio-page-title">积分配置</h2>
|
||||
<p class="jio-page-desc">
|
||||
配置积分规则与发放策略。可自定义货币名称(如”金币”、”魔石”等)。用户余额与手工调整在 WordPress 原生”用户”菜单中管理。
|
||||
</p>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>主开关 + 基础设置</h3></div>
|
||||
<n-form :model="cfg" label-placement="left" label-width="200" class="aksrt-form">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>主开关 + 基础设置</h3></div>
|
||||
<n-form :model="cfg" label-placement="left" label-width="200" class="jio-form">
|
||||
<n-form-item label="启用积分系统">
|
||||
<n-switch v-model:value="cfg.enabled" />
|
||||
</n-form-item>
|
||||
<n-form-item label="自定义货币名称">
|
||||
<n-input v-model:value="cfg.currency_name" placeholder="积分" maxlength="20" />
|
||||
<template #feedback>
|
||||
<span class="aksrt-hint-text">自定义货币显示名称,如"金币"、"魔石"等。留空则使用默认名称"积分"。</span>
|
||||
<span class="jio-hint-text">自定义货币显示名称,如"金币"、"魔石"等。留空则使用默认名称"积分"。</span>
|
||||
</template>
|
||||
</n-form-item>
|
||||
<n-form-item label="注册赠送积分">
|
||||
@@ -23,36 +23,9 @@
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<n-card title="用户近期资产记录" class="aksrt-section-card">
|
||||
<n-space vertical :size="12">
|
||||
<n-space wrap>
|
||||
<n-input v-model:value="ledgerFilters.user_id" placeholder="用户 ID" clearable style="width: 130px" />
|
||||
<n-select v-model:value="ledgerFilters.asset" :options="assetOptions" placeholder="资产" style="width: 130px" />
|
||||
<n-input v-model:value="ledgerFilters.date_from" type="date" placeholder="开始日期" style="width: 160px" />
|
||||
<n-input v-model:value="ledgerFilters.date_to" type="date" placeholder="结束日期" style="width: 160px" />
|
||||
<n-button type="primary" :loading="ledgerLoading" @click="searchLedger">查询</n-button>
|
||||
<n-button @click="resetLedger">重置</n-button>
|
||||
</n-space>
|
||||
<n-data-table
|
||||
:columns="ledgerColumns"
|
||||
:data="ledgerRows"
|
||||
:loading="ledgerLoading"
|
||||
:row-key="row => row.id"
|
||||
:scroll-x="1100"
|
||||
size="small"
|
||||
/>
|
||||
<n-pagination
|
||||
v-model:page="ledgerPage"
|
||||
:page-count="ledgerPageCount"
|
||||
:page-size="10"
|
||||
@update:page="loadLedger"
|
||||
/>
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>每日签到</h3></div>
|
||||
<n-form :model="cfg.daily_signin" label-placement="left" label-width="200" class="aksrt-form">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>每日签到</h3></div>
|
||||
<n-form :model="cfg.daily_signin" label-placement="left" label-width="200" class="jio-form">
|
||||
<n-form-item label="启用">
|
||||
<n-switch v-model:value="cfg.daily_signin.enabled" />
|
||||
</n-form-item>
|
||||
@@ -67,15 +40,15 @@
|
||||
:autosize="{ minRows: 2 }"
|
||||
/>
|
||||
<template #feedback>
|
||||
<span class="aksrt-hint-text">连续 N 天时额外发放的积分。</span>
|
||||
<span class="jio-hint-text">连续 N 天时额外发放的积分。</span>
|
||||
</template>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>评论奖励</h3></div>
|
||||
<n-form :model="cfg.comment_reward" label-placement="left" label-width="200" class="aksrt-form">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>评论奖励</h3></div>
|
||||
<n-form :model="cfg.comment_reward" label-placement="left" label-width="200" class="jio-form">
|
||||
<n-form-item label="启用">
|
||||
<n-switch v-model:value="cfg.comment_reward.enabled" />
|
||||
</n-form-item>
|
||||
@@ -94,9 +67,9 @@
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>Ref 推广奖励</h3></div>
|
||||
<n-form :model="cfg.referral_reward" label-placement="left" label-width="200" class="aksrt-form">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>Ref 推广奖励</h3></div>
|
||||
<n-form :model="cfg.referral_reward" label-placement="left" label-width="200" class="jio-form">
|
||||
<n-form-item label="启用">
|
||||
<n-switch v-model:value="cfg.referral_reward.enabled" />
|
||||
</n-form-item>
|
||||
@@ -118,142 +91,88 @@
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>下载消费(参考)</h3></div>
|
||||
<n-form :model="cfg" label-placement="left" label-width="200" class="aksrt-form">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>下载消费(参考)</h3></div>
|
||||
<n-form :model="cfg" label-placement="left" label-width="200" class="jio-form">
|
||||
<n-form-item :label="`默认积分价参考(${cfg.currency_name || '积分'})`">
|
||||
<n-input-number v-model:value="cfg.download_default_cost" :min="0" :max="100000" />
|
||||
<template #feedback>
|
||||
<span class="aksrt-hint-text">实际价格以文章「付费内容设置」的积分价或现金价为准;下载解锁走收银台订单,不按次扣费。</span>
|
||||
<span class="jio-hint-text">实际价格以文章「付费内容设置」的积分价或现金价为准;下载解锁走收银台订单,不按次扣费。</span>
|
||||
</template>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<div class="aksrt-form-footer">
|
||||
<n-button type="primary" :loading="saving" @click="saveCfg">保存配置</n-button>
|
||||
</div>
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="saveCfg" @reload="loadCfg" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { computed, ref, reactive, onMounted } from 'vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import api from '@/api'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
// ---------- 配置 ----------
|
||||
const cfg = reactive({
|
||||
enabled: true,
|
||||
currency_name: '',
|
||||
register_bonus: 10,
|
||||
daily_signin: { enabled: true, base: 1, streak: { 3: 2, 7: 5, 30: 20 } },
|
||||
comment_reward: { enabled: true, amount: 1, daily_cap: 5, min_length: 10, on_approved: true },
|
||||
referral_reward: {
|
||||
function defaultCfg() {
|
||||
return {
|
||||
enabled: true,
|
||||
promoter_amount: 5,
|
||||
referred_amount: 2,
|
||||
level_points: 0,
|
||||
require_verify: true,
|
||||
ip_daily_cap: 3,
|
||||
},
|
||||
download_default_cost: 0,
|
||||
})
|
||||
const streakJson = ref('{}')
|
||||
const saving = ref(false)
|
||||
const ledgerLoading = ref(false)
|
||||
const ledgerRows = ref([])
|
||||
const ledgerPage = ref(1)
|
||||
const ledgerPageCount = ref(1)
|
||||
const ledgerFilters = reactive({
|
||||
user_id: '',
|
||||
asset: 'points',
|
||||
date_from: '',
|
||||
date_to: '',
|
||||
})
|
||||
const assetOptions = [
|
||||
{ label: '积分', value: 'points' },
|
||||
{ label: '余额', value: 'balance' },
|
||||
]
|
||||
const ledgerColumns = [
|
||||
{ title: '类型', key: 'reason', width: 150 },
|
||||
{ title: '订单号', key: 'ref_key', width: 200 },
|
||||
{ title: '变动 / 变动后', key: 'delta_label', width: 190 },
|
||||
{ title: '说明', key: 'remark', width: 240, ellipsis: { tooltip: true } },
|
||||
{ title: '时间', key: 'created_at', width: 170 },
|
||||
]
|
||||
|
||||
function formatAssetValue(asset, value) {
|
||||
const raw = Number(value ?? 0)
|
||||
if (!Number.isFinite(raw)) return asset === 'balance' ? '0.00' : '0'
|
||||
if (asset !== 'balance') return String(raw)
|
||||
const negative = raw < 0
|
||||
const digits = String(Math.abs(Math.trunc(raw))).padStart(3, '0')
|
||||
const whole = digits.slice(0, -2).replace(/^0+(?=\d)/, '')
|
||||
return (negative ? '-' : '') + whole + '.' + digits.slice(-2)
|
||||
}
|
||||
|
||||
async function loadLedger() {
|
||||
ledgerLoading.value = true
|
||||
try {
|
||||
if (!/^\d+$/.test(String(ledgerFilters.user_id).trim())) {
|
||||
message.warning('请输入用户 ID 后查询该用户近期记录')
|
||||
return
|
||||
}
|
||||
const params = { page: ledgerPage.value, per_page: 10 }
|
||||
Object.entries(ledgerFilters).forEach(([key, value]) => {
|
||||
if (value !== null && String(value).trim() !== '') params[key] = value
|
||||
})
|
||||
const response = await api.getCreditLog(params)
|
||||
const data = response?.data || response || {}
|
||||
ledgerRows.value = (data.items || []).map((row) => {
|
||||
const entries = Array.isArray(row.entries) ? row.entries : []
|
||||
const entry = entries[0] || {}
|
||||
return {
|
||||
...row,
|
||||
delta_label: `${formatAssetValue(entry.asset, entry.delta)} / ${formatAssetValue(entry.asset, entry.balance_after)}`,
|
||||
remark: row.remark || '—',
|
||||
}
|
||||
})
|
||||
ledgerPageCount.value = Math.max(1, Math.ceil(Number(data.total || 0) / Number(data.per_page || 10)))
|
||||
} catch (e) {
|
||||
message.error(e.message || '加载资产记录失败')
|
||||
} finally {
|
||||
ledgerLoading.value = false
|
||||
currency_name: '',
|
||||
register_bonus: 10,
|
||||
daily_signin: { enabled: true, base: 1, streak: { 3: 2, 7: 5, 30: 20 } },
|
||||
comment_reward: { enabled: true, amount: 1, daily_cap: 5, min_length: 10, on_approved: true },
|
||||
referral_reward: {
|
||||
enabled: true,
|
||||
promoter_amount: 5,
|
||||
referred_amount: 2,
|
||||
level_points: 0,
|
||||
require_verify: true,
|
||||
ip_daily_cap: 3,
|
||||
},
|
||||
download_default_cost: 0,
|
||||
}
|
||||
}
|
||||
|
||||
function searchLedger() {
|
||||
ledgerPage.value = 1
|
||||
loadLedger()
|
||||
}
|
||||
|
||||
function resetLedger() {
|
||||
Object.assign(ledgerFilters, { user_id: '', asset: 'points', date_from: '', date_to: '' })
|
||||
ledgerRows.value = []
|
||||
ledgerPage.value = 1
|
||||
ledgerPageCount.value = 1
|
||||
}
|
||||
const cfg = reactive(defaultCfg())
|
||||
const streakJson = ref('{}')
|
||||
const loading = ref(true)
|
||||
const saving = ref(false)
|
||||
const initial = ref('')
|
||||
const snapshot = computed(() => JSON.stringify({ cfg, streakJson: streakJson.value }))
|
||||
const dirty = computed(() => !loading.value && initial.value !== '' && snapshot.value !== initial.value)
|
||||
|
||||
async function loadCfg() {
|
||||
loading.value = true
|
||||
try {
|
||||
const response = await api.getCreditSettings()
|
||||
const data = response?.data || response || {}
|
||||
Object.assign(cfg, data)
|
||||
Object.assign(cfg, defaultCfg(), data)
|
||||
streakJson.value = JSON.stringify(cfg.daily_signin?.streak || {}, null, 0)
|
||||
initial.value = snapshot.value
|
||||
} catch (e) {
|
||||
message.error(e.message || '加载失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function saveCfg() {
|
||||
let streak
|
||||
try {
|
||||
streak = JSON.parse(streakJson.value || '{}')
|
||||
} catch (error) {
|
||||
message.error('连续奖励 JSON 格式错误')
|
||||
return
|
||||
}
|
||||
if (!streak || typeof streak !== 'object' || Array.isArray(streak)) {
|
||||
message.error('连续奖励必须是 JSON 对象')
|
||||
return
|
||||
}
|
||||
saving.value = true
|
||||
try {
|
||||
let streak = {}
|
||||
try { streak = JSON.parse(streakJson.value || '{}') } catch (_) { /* ignore */ }
|
||||
await api.saveCreditSettings({ ...cfg, daily_signin: { ...cfg.daily_signin, streak } })
|
||||
cfg.daily_signin.streak = streak
|
||||
await api.saveCreditSettings(cfg)
|
||||
initial.value = snapshot.value
|
||||
message.success('已保存')
|
||||
} catch (e) {
|
||||
message.error(e.message || '保存失败')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="aksrt-schema-page">
|
||||
<AksFormRenderer
|
||||
<div class="jio-schema-page">
|
||||
<JioFormRenderer
|
||||
:title="pageMeta.title"
|
||||
:description="pageMeta.description"
|
||||
:icon="pageMeta.icon"
|
||||
@@ -24,7 +24,7 @@
|
||||
v-model:value="captchaProviderTab"
|
||||
type="segment"
|
||||
animated
|
||||
class="aksrt-tabs aksrt-captcha-provider-tabs"
|
||||
class="jio-tabs jio-captcha-provider-tabs"
|
||||
>
|
||||
<n-tab-pane
|
||||
v-for="provider in captchaProviders"
|
||||
@@ -48,18 +48,18 @@
|
||||
#field-geoip_block_countries="{ value, setValue }"
|
||||
>
|
||||
<n-dynamic-tags :value="Array.isArray(value) ? value : []" @update:value="setValue" />
|
||||
<p class="aksrt-schema-page__field-hint">使用 ISO 国家代码,如 CN / US / RU。</p>
|
||||
<p class="jio-schema-page__field-hint">使用 ISO 国家代码,如 CN / US / RU。</p>
|
||||
</template>
|
||||
|
||||
<!-- Slot for custom group content (override per page if needed) -->
|
||||
<template v-for="(_, name) in $slots" #[name]="slotData">
|
||||
<slot :name="name" v-bind="slotData" />
|
||||
</template>
|
||||
</AksFormRenderer>
|
||||
</JioFormRenderer>
|
||||
|
||||
<div
|
||||
v-if="isPermissionsLogin && !loading"
|
||||
class="aksrt-schema-page__tool-actions"
|
||||
class="jio-schema-page__tool-actions"
|
||||
>
|
||||
<n-button
|
||||
:disabled="!formData?.enabled || !formData?.active_provider"
|
||||
@@ -80,7 +80,7 @@
|
||||
<n-spin />
|
||||
<p style="margin-top:10px;color:#999;">加载中...</p>
|
||||
</div>
|
||||
<div v-if="testResult && !testLoading" :style="{color: testResult.success ? 'var(--aksrt-color-primary)' : '#d03050', textAlign:'center', padding:'20px'}">
|
||||
<div v-if="testResult && !testLoading" :style="{color: testResult.success ? 'var(--jio-color-primary)' : '#d03050', textAlign:'center', padding:'20px'}">
|
||||
<p style="font-size:16px;margin:0;">{{ testResult.message }}</p>
|
||||
</div>
|
||||
<div v-if="!testLoading && !testResult" id="captcha-test-box" style="min-height:150px;"></div>
|
||||
@@ -95,7 +95,7 @@
|
||||
* SchemaPage — generic Schema-driven settings page.
|
||||
*
|
||||
* Reads the schema from the Vue-side schema registry, fetches/saves settings
|
||||
* via the API client, and renders using AksFormRenderer.
|
||||
* via the API client, and renders using JioFormRenderer.
|
||||
*
|
||||
* Usage (in router or parent):
|
||||
* <SchemaPage domain="global" section="logo" />
|
||||
@@ -106,7 +106,7 @@
|
||||
import { computed, watch, ref, nextTick, onBeforeUnmount } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import AksFormRenderer from '@/components/form/AksFormRenderer.vue'
|
||||
import JioFormRenderer from '@/components/form/JioFormRenderer.vue'
|
||||
import { useSectionForm } from '@/composables/useSectionForm'
|
||||
import { getSchema, normalizeSchemaDomain } from '@/schema/index.js'
|
||||
import api from '@/api/index.js'
|
||||
@@ -170,7 +170,7 @@ function resolveSectionFromPath(path) {
|
||||
|
||||
/** Load schema from the Vue-side registry */
|
||||
const pageMeta = computed(() => {
|
||||
const schema = (isEmailPage.value || resolvedDomain.value === 'page_display')
|
||||
const schema = (isEmailPage.value || ['page_display', 'forum'].includes(resolvedDomain.value))
|
||||
? serverSchema.value
|
||||
: getSchema(resolvedDomain.value, resolvedSection.value)
|
||||
if (schema && schema.groups && schema.groups.length > 0) {
|
||||
@@ -192,7 +192,7 @@ const pageMeta = computed(() => {
|
||||
|
||||
/** Default values from schema */
|
||||
const defaults = computed(() => {
|
||||
const schema = (isEmailPage.value || resolvedDomain.value === 'page_display')
|
||||
const schema = (isEmailPage.value || ['page_display', 'forum'].includes(resolvedDomain.value))
|
||||
? serverSchema.value
|
||||
: getSchema(resolvedDomain.value, resolvedSection.value)
|
||||
if (!schema) return {}
|
||||
@@ -221,7 +221,7 @@ const {
|
||||
const payload = { ...data }
|
||||
const clearSecrets = []
|
||||
Object.keys(payload).forEach((key) => {
|
||||
if (payload[key] === '__AKSRT_CLEAR_SECRET__') {
|
||||
if (payload[key] === '__JIO_CLEAR_SECRET__') {
|
||||
clearSecrets.push(key)
|
||||
delete payload[key]
|
||||
}
|
||||
@@ -417,7 +417,7 @@ function loadProviderSDK(provider, cfg) {
|
||||
sitekey: cfg.site_key,
|
||||
theme: cfg.theme || 'auto',
|
||||
size: cfg.size || 'normal',
|
||||
action: 'aksrt-admin-test',
|
||||
action: 'jio-admin-test',
|
||||
cdata: 'admin-captcha-test',
|
||||
callback: function(token) {
|
||||
submitCaptchaTest('cloudflare', { cf_turnstile_response: token })
|
||||
@@ -539,21 +539,21 @@ onBeforeUnmount(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-schema-page {
|
||||
.jio-schema-page {
|
||||
max-width: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.aksrt-schema-page__tool-actions {
|
||||
.jio-schema-page__tool-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.aksrt-schema-page__field-hint {
|
||||
.jio-schema-page__field-hint {
|
||||
margin: 8px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
}
|
||||
|
||||
.captcha-test-overlay {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container content-page">
|
||||
<div class="jio-page-container content-page">
|
||||
<PageHeader title="右侧悬浮按钮" desc="显示在页面右侧的悬浮按钮,支持排序及添加自定义按钮。" />
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
@@ -7,8 +7,8 @@
|
||||
<b>全局悬浮按钮:</b>显示在页面右侧的悬浮按钮,支持排序及添加自定义按钮
|
||||
</n-alert>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<n-form :model="form" label-placement="left" label-width="160" class="aksrt-form">
|
||||
<n-card class="jio-section-card">
|
||||
<n-form :model="form" label-placement="left" label-width="160" class="jio-form">
|
||||
<n-form-item label="按钮样式">
|
||||
<n-radio-group v-model:value="form.style">
|
||||
<n-space>
|
||||
@@ -51,11 +51,9 @@
|
||||
<div class="float-settings__desc">设置并排序需要显示的按钮</div>
|
||||
<draggable
|
||||
v-model="form.items"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
item-key="type"
|
||||
handle=".float-btn-panel__handle"
|
||||
ghost-class="float-settings__ghost"
|
||||
animation="180"
|
||||
class="float-settings__list"
|
||||
class="jio-sortable"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<FloatBtnItemPanel :model-value="element" @update:model-value="updateItem(index, $event)" />
|
||||
@@ -65,7 +63,7 @@
|
||||
</n-card>
|
||||
</n-spin>
|
||||
|
||||
<AksSaveBar :dirty="dirty" :saving="saving" @save="handleSave" @reload="loadSettings" />
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="handleSave" @reload="loadSettings" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -75,7 +73,8 @@ import { useMessage } from 'naive-ui'
|
||||
import draggable from 'vuedraggable'
|
||||
import api from '@/api'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import AksSaveBar from '@/components/form/AksSaveBar.vue'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
import { SORTABLE_LIST_ATTRS } from '@/components/form/sortable-options.js'
|
||||
import FloatBtnItemPanel from '@/components/floating/FloatBtnItemPanel.vue'
|
||||
import { defaultSettings, normalizeItems } from '@/components/floating/floating-defaults.js'
|
||||
|
||||
@@ -163,13 +162,13 @@ onMounted(loadSettings)
|
||||
|
||||
.float-settings__desc {
|
||||
font-size: 12px;
|
||||
color: var(--n-text-color-3, #999);
|
||||
color: var(--jio-color-muted, #6F7A72);
|
||||
}
|
||||
|
||||
.float-settings__label {
|
||||
margin-left: 12px;
|
||||
font-size: 13px;
|
||||
color: var(--n-text-color-3, #999);
|
||||
color: var(--jio-color-muted, #6F7A72);
|
||||
}
|
||||
|
||||
.float-settings__section {
|
||||
@@ -183,14 +182,4 @@ onMounted(loadSettings)
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.float-settings__list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.float-settings__ghost {
|
||||
opacity: 0.45;
|
||||
}
|
||||
</style>
|
||||
@@ -1,31 +1,27 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container content-page">
|
||||
<PageHeader title="底部Tab配置" desc="自定义移动端底部导航栏的按钮,支持排序、图标配置和返回顶部功能。">
|
||||
<template #actions>
|
||||
<n-button type="primary" :loading="saving" @click="handleSave">保存</n-button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
<div class="jio-page-container content-page">
|
||||
<PageHeader title="底部Tab配置" desc="自定义移动端底部导航栏的按钮,支持排序、图标配置和返回顶部功能。" />
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
<!-- 基础设置 -->
|
||||
<n-card class="aksrt-section-card">
|
||||
<n-card class="jio-section-card">
|
||||
<template #header>
|
||||
<div class="aksrt-card-header-row">
|
||||
<div class="aksrt-card-header-row__left">
|
||||
<div class="jio-card-header-row">
|
||||
<div class="jio-card-header-row__left">
|
||||
<span class="header-icon"><i class="fa fas fa-cog"></i></span>
|
||||
<strong class="aksrt-card-header-row__title">基础设置</strong>
|
||||
<strong class="jio-card-header-row__title">基础设置</strong>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<n-form :model="form" label-placement="left" label-width="140" class="aksrt-form">
|
||||
<n-form :model="form" label-placement="left" label-width="140" class="jio-form">
|
||||
<n-form-item label="启用底部Tab">
|
||||
<n-switch v-model:value="form.enabled" />
|
||||
<span class="aksrt-hint-text" style="margin-left: 12px;">移动端底部导航栏总开关</span>
|
||||
<span class="jio-hint-text" style="margin-left: 12px;">移动端底部导航栏总开关</span>
|
||||
</n-form-item>
|
||||
<n-form-item label="向下滚动隐藏">
|
||||
<n-switch v-model:value="form.scroll_down_hide" />
|
||||
<span class="aksrt-hint-text" style="margin-left: 12px;">页面向下滚动时隐藏,向上滚动时显示</span>
|
||||
<span class="jio-hint-text" style="margin-left: 12px;">页面向下滚动时隐藏,向上滚动时显示</span>
|
||||
</n-form-item>
|
||||
<n-form-item label="文章页专属Tab">
|
||||
<n-select
|
||||
@@ -36,18 +32,18 @@
|
||||
]"
|
||||
style="width: 240px;"
|
||||
/>
|
||||
<span class="aksrt-hint-text" style="margin-left: 12px;">文章详情页底部显示的Tab按钮类型</span>
|
||||
<span class="jio-hint-text" style="margin-left: 12px;">文章详情页底部显示的Tab按钮类型</span>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<!-- Tab按钮配置 -->
|
||||
<n-card class="aksrt-section-card">
|
||||
<n-card class="jio-section-card">
|
||||
<template #header>
|
||||
<div class="aksrt-card-header-row">
|
||||
<div class="aksrt-card-header-row__left">
|
||||
<div class="jio-card-header-row">
|
||||
<div class="jio-card-header-row__left">
|
||||
<span class="header-icon"><i class="fa fas fa-list-ul"></i></span>
|
||||
<strong class="aksrt-card-header-row__title">Tab按钮配置 ({{ form.items.length }})</strong>
|
||||
<strong class="jio-card-header-row__title">Tab按钮配置 ({{ form.items.length }})</strong>
|
||||
</div>
|
||||
<n-button type="primary" size="small" @click="addItem">
|
||||
<template #icon><i class="fa fas fa-plus"></i></template>
|
||||
@@ -61,64 +57,58 @@
|
||||
<draggable
|
||||
v-if="form.items.length"
|
||||
v-model="form.items"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
item-key="id"
|
||||
handle=".tabbar-sort__handle"
|
||||
ghost-class="tabbar-sort__ghost"
|
||||
animation="180"
|
||||
class="tabbar-sort"
|
||||
class="jio-sortable"
|
||||
@end="resetSortOrder"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<div class="tabbar-sort__item">
|
||||
<div class="tabbar-sort__main">
|
||||
<button type="button" class="tabbar-sort__handle" aria-label="拖拽排序">
|
||||
<i class="fa fas fa-bars"></i>
|
||||
</button>
|
||||
<span class="tabbar-sort__icon">
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head">
|
||||
<JioSortHandle />
|
||||
<span class="jio-sortable__icon">
|
||||
<IconValue v-if="element.icon" :value="element.icon" />
|
||||
</span>
|
||||
<div class="tabbar-sort__meta">
|
||||
<div class="tabbar-sort__title-row">
|
||||
<strong>{{ element.text || '按钮' }}</strong>
|
||||
<div class="jio-sortable__main">
|
||||
<div class="jio-sortable__title-row">
|
||||
<span class="jio-sortable__title">{{ element.text || '按钮' }}</span>
|
||||
<n-tag size="small" :bordered="false">{{ typeLabelMap[element.type] || element.type }}</n-tag>
|
||||
<n-tag v-if="element.badge" size="small" type="error" :bordered="false">徽标 {{ element.badge }}</n-tag>
|
||||
<n-tag v-if="element.type === 'home' && element.ontop" size="small" type="success" :bordered="false">返回顶部</n-tag>
|
||||
<n-tag size="small" :type="element.enabled ? 'success' : 'default'" :bordered="false">{{ element.enabled ? '启用' : '禁用' }}</n-tag>
|
||||
</div>
|
||||
<div class="tabbar-sort__desc">{{ getItemSummary(element) }}</div>
|
||||
<div class="jio-sortable__desc">{{ getItemSummary(element) }}</div>
|
||||
</div>
|
||||
<div class="jio-sortable__actions">
|
||||
<n-button size="tiny" quaternary type="primary" @click="editItem(index)">
|
||||
<template #icon><i class="fa fas fa-edit" style="font-size:12px;" /></template>
|
||||
编辑
|
||||
</n-button>
|
||||
<n-button size="tiny" quaternary type="error" @click="deleteItem(index)">
|
||||
<template #icon><i class="fa fas fa-trash-alt" style="font-size:12px;" /></template>
|
||||
删除
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tabbar-sort__actions">
|
||||
<n-button size="tiny" quaternary type="primary" @click="editItem(index)">
|
||||
<template #icon><i class="fa fas fa-edit" style="font-size:12px;" /></template>
|
||||
编辑
|
||||
</n-button>
|
||||
<n-button size="tiny" quaternary type="error" @click="deleteItem(index)">
|
||||
<template #icon><i class="fa fas fa-trash-alt" style="font-size:12px;" /></template>
|
||||
删除
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
<n-empty v-else description="暂无Tab按钮,请点击上方按钮添加" />
|
||||
</n-card>
|
||||
|
||||
<div class="aksrt-form-actions">
|
||||
<n-button type="primary" :loading="saving" @click="handleSave">保存底部Tab配置</n-button>
|
||||
</div>
|
||||
</n-spin>
|
||||
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="handleSave" @reload="loadSettings" />
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<n-modal
|
||||
v-model:show="showModal"
|
||||
:mask-closable="false"
|
||||
preset="card"
|
||||
:title="editingIndex >= 0 ? '编辑Tab按钮' : '添加Tab按钮'"
|
||||
class="aksrt-modal-card"
|
||||
class="jio-modal-card"
|
||||
style="max-width: 520px;"
|
||||
>
|
||||
<n-form :model="editingItem" label-placement="top" class="aksrt-form">
|
||||
<n-form :model="editingItem" label-placement="top" class="jio-form">
|
||||
<n-form-item label="按钮类型">
|
||||
<n-select
|
||||
v-model:value="editingItem.type"
|
||||
@@ -216,22 +206,21 @@
|
||||
<div v-if="editingItem.add_items.length" class="add-items-editor__list">
|
||||
<draggable
|
||||
v-model="editingItem.add_items"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
item-key="id"
|
||||
handle=".add-items-editor__drag"
|
||||
ghost-class="add-items-editor__ghost"
|
||||
animation="180"
|
||||
class="jio-sortable jio-sortable--compact"
|
||||
>
|
||||
<template #item="{ element, index: subIndex }">
|
||||
<div class="add-items-editor__row">
|
||||
<button type="button" class="add-items-editor__drag" aria-label="拖拽排序">
|
||||
<i class="fa fas fa-bars"></i>
|
||||
</button>
|
||||
<n-input v-model:value="element.label" placeholder="名称,例如:写文章" />
|
||||
<FaIconPicker v-model="element.icon" placeholder="选择图标" />
|
||||
<n-input v-model:value="element.url" placeholder="链接,例如:/wp-admin/post-new.php" />
|
||||
<n-button quaternary type="error" @click="removeAddItem(subIndex)">
|
||||
<template #icon><i class="fa fas fa-trash-alt" /></template>
|
||||
</n-button>
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head add-items-editor__row">
|
||||
<JioSortHandle />
|
||||
<n-input v-model:value="element.label" placeholder="名称,例如:写文章" />
|
||||
<FaIconPicker v-model="element.icon" placeholder="选择图标" />
|
||||
<n-input v-model:value="element.url" placeholder="链接,例如:/wp-admin/post-new.php" />
|
||||
<n-button quaternary type="error" aria-label="删除子项" @click="removeAddItem(subIndex)">
|
||||
<template #icon><i class="fa fas fa-trash-alt" /></template>
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
@@ -241,7 +230,7 @@
|
||||
|
||||
<n-form-item v-if="editingItem.type === 'home'" label="返回顶部功能">
|
||||
<n-switch v-model:value="editingItem.ontop" />
|
||||
<span class="aksrt-hint-text" style="margin-left: 12px;">页面滚动后切换为返回顶部按钮</span>
|
||||
<span class="jio-hint-text" style="margin-left: 12px;">页面滚动后切换为返回顶部按钮</span>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="启用状态">
|
||||
@@ -250,7 +239,7 @@
|
||||
</n-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="aksrt-modal-footer">
|
||||
<div class="jio-modal-footer">
|
||||
<n-button @click="showModal = false">取消</n-button>
|
||||
<n-button type="primary" @click="saveItem">保存</n-button>
|
||||
</div>
|
||||
@@ -265,8 +254,11 @@ import { NButton, NTag, useDialog, useMessage } from 'naive-ui'
|
||||
import draggable from 'vuedraggable'
|
||||
import api from '@/api'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
import FaIconPicker from '@/components/form/FaIconPicker.vue'
|
||||
import IconValue from '@/components/form/IconValue.vue'
|
||||
import JioSortHandle from '@/components/form/JioSortHandle.vue'
|
||||
import { SORTABLE_LIST_ATTRS } from '@/components/form/sortable-options.js'
|
||||
|
||||
const message = useMessage()
|
||||
const dialog = useDialog()
|
||||
@@ -283,6 +275,12 @@ const form = reactive({
|
||||
footer_tabbar_single: 'default',
|
||||
items: [],
|
||||
})
|
||||
const snapshot = ref('')
|
||||
const serialize = () => JSON.stringify(form)
|
||||
const dirty = computed(() => !loading.value && snapshot.value !== '' && serialize() !== snapshot.value)
|
||||
function markClean() {
|
||||
snapshot.value = serialize()
|
||||
}
|
||||
|
||||
const editingItem = reactive({
|
||||
id: '',
|
||||
@@ -555,6 +553,7 @@ async function loadSettings() {
|
||||
add_items: Array.isArray(item.add_items) ? item.add_items : [],
|
||||
sort_order: item.sort_order ?? idx,
|
||||
}))
|
||||
markClean()
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('[FooterTabbar] load failed:', e)
|
||||
@@ -584,6 +583,7 @@ async function handleSave() {
|
||||
}
|
||||
const res = await api.saveFooterTabbarSettings(payload)
|
||||
if (res.code === 'success') {
|
||||
markClean()
|
||||
message.success(res.message || '保存成功')
|
||||
} else {
|
||||
message.error(res.message || '保存失败')
|
||||
@@ -609,7 +609,7 @@ onMounted(loadSettings)
|
||||
}
|
||||
|
||||
.icon-preview-row a {
|
||||
color: var(--n-primary-color);
|
||||
color: var(--jio-color-primary, #18A058);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -618,18 +618,12 @@ onMounted(loadSettings)
|
||||
}
|
||||
|
||||
.muted-text {
|
||||
color: #999;
|
||||
color: var(--jio-color-muted, #6F7A72);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-modal-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.section-desc {
|
||||
color: var(--n-text-color-3);
|
||||
color: var(--jio-color-muted, #6F7A72);
|
||||
font-size: 13px;
|
||||
margin: 0 0 16px;
|
||||
}
|
||||
@@ -659,127 +653,19 @@ onMounted(loadSettings)
|
||||
|
||||
.add-items-editor__presets-label {
|
||||
font-size: 12px;
|
||||
color: var(--n-text-color-3, #999);
|
||||
}
|
||||
|
||||
.add-items-editor__list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
color: var(--jio-color-muted, #6F7A72);
|
||||
}
|
||||
|
||||
.add-items-editor__row {
|
||||
display: grid;
|
||||
grid-template-columns: 32px 1fr 1fr 1.2fr 40px;
|
||||
grid-template-columns: 28px 1fr 1fr 1.2fr 34px;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.add-items-editor__drag {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 0;
|
||||
border-radius: 10px;
|
||||
background: #f3f5f7;
|
||||
color: #6b7280;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.add-items-editor__ghost {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.tabbar-sort {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.tabbar-sort__item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding: 14px 16px;
|
||||
border: 1px solid var(--n-border-color);
|
||||
border-radius: 14px;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.tabbar-sort__main {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tabbar-sort__handle {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 0;
|
||||
border-radius: 10px;
|
||||
background: #f3f5f7;
|
||||
color: #6b7280;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.tabbar-sort__icon {
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 12px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(24, 160, 88, 0.12);
|
||||
color: var(--aksrt-color-primary);
|
||||
font-size: 18px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.tabbar-sort__meta {
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tabbar-sort__title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.tabbar-sort__desc {
|
||||
color: var(--n-text-color-3);
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.tabbar-sort__actions {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.tabbar-sort__ghost {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.tabbar-sort__item {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.tabbar-sort__actions {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.add-items-editor__row {
|
||||
grid-template-columns: 32px 1fr;
|
||||
grid-template-columns: 28px 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container content-page">
|
||||
<div class="jio-page-container content-page">
|
||||
<PageHeader title="通知管理" desc="管理通知内容开关、user 徽标统计口径和自动清理策略。">
|
||||
<template #actions>
|
||||
<n-space>
|
||||
@@ -10,7 +10,7 @@
|
||||
</PageHeader>
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
<n-card title="通知内容开关" class="aksrt-section-card">
|
||||
<n-card title="通知内容开关" class="jio-section-card">
|
||||
<n-form :model="settings" label-placement="left" label-width="180">
|
||||
<n-form-item label="评论回复通知">
|
||||
<n-switch v-model:value="settings.enabled_types.comment_reply" />
|
||||
@@ -35,21 +35,21 @@
|
||||
|
||||
<n-grid :cols="2" :x-gap="16" responsive="screen" item-responsive style="margin-top: 16px;">
|
||||
<n-grid-item span="24 l:10">
|
||||
<n-card title="user 徽标规则" class="aksrt-section-card">
|
||||
<n-card title="user 徽标规则" class="jio-section-card">
|
||||
<n-form :model="settings" label-placement="left" label-width="180">
|
||||
<n-form-item label="启用 user 动态徽标">
|
||||
<n-switch v-model:value="settings.user_badge_enabled" />
|
||||
</n-form-item>
|
||||
<n-form-item label="徽标包含状态提醒">
|
||||
<n-switch v-model:value="settings.badge_include_stateful" />
|
||||
<span class="aksrt-hint-text" style="margin-left: 12px;">未读持久化通知之外,叠加邮箱待验证、待审核评论等即时提醒</span>
|
||||
<span class="jio-hint-text" style="margin-left: 12px;">未读持久化通知之外,叠加邮箱待验证、待审核评论等即时提醒</span>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
</n-grid-item>
|
||||
|
||||
<n-grid-item span="24 l:14">
|
||||
<n-card title="通知清理策略" class="aksrt-section-card">
|
||||
<n-card title="通知清理策略" class="jio-section-card">
|
||||
<n-form :model="settings" label-placement="left" label-width="180">
|
||||
<n-form-item label="已读通知保留天数">
|
||||
<n-input-number v-model:value="settings.read_retention_days" :min="1" :max="365" style="width: 180px;" />
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader title="文档中心" desc="主题使用文档、开发指南、迁移说明和更新日志。" />
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<n-card title="常用操作" size="small" class="aksrt-docs__section">
|
||||
<n-card title="常用操作" size="small" class="jio-docs__section">
|
||||
<n-grid :cols="2" :x-gap="12" :y-gap="12">
|
||||
<n-grid-item>
|
||||
<div class="aksrt-docs__action">
|
||||
<div class="jio-docs__action">
|
||||
<FaIcon icon="fa fas fa-paint-brush" :size="16" />
|
||||
<div>
|
||||
<strong>全局设置</strong>
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<div class="aksrt-docs__action">
|
||||
<div class="jio-docs__action">
|
||||
<FaIcon icon="fa fas fa-home" :size="16" />
|
||||
<div>
|
||||
<strong>首页配置</strong>
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<div class="aksrt-docs__action">
|
||||
<div class="jio-docs__action">
|
||||
<FaIcon icon="fa fas fa-users" :size="16" />
|
||||
<div>
|
||||
<strong>用户管理</strong>
|
||||
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<div class="aksrt-docs__action">
|
||||
<div class="jio-docs__action">
|
||||
<FaIcon icon="fa fas fa-wrench" :size="16" />
|
||||
<div>
|
||||
<strong>工具</strong>
|
||||
@@ -49,30 +49,30 @@
|
||||
</n-card>
|
||||
|
||||
<!-- Reference Docs -->
|
||||
<div class="aksrt-docs__grid">
|
||||
<div class="jio-docs__grid">
|
||||
<n-card
|
||||
v-for="doc in docs"
|
||||
:key="doc.key"
|
||||
class="aksrt-docs__card"
|
||||
class="jio-docs__card"
|
||||
size="small"
|
||||
hoverable
|
||||
@click="openDoc(doc)"
|
||||
>
|
||||
<div class="aksrt-docs__card-inner">
|
||||
<div class="aksrt-docs__card-icon" :style="{ background: doc.color }">
|
||||
<div class="jio-docs__card-inner">
|
||||
<div class="jio-docs__card-icon" :style="{ background: doc.color }">
|
||||
<FaIcon :icon="doc.icon" :size="20" color="#fff" />
|
||||
</div>
|
||||
<div class="aksrt-docs__card-body">
|
||||
<h4 class="aksrt-docs__card-title">{{ doc.title }}</h4>
|
||||
<p class="aksrt-docs__card-desc">{{ doc.description }}</p>
|
||||
<div class="jio-docs__card-body">
|
||||
<h4 class="jio-docs__card-title">{{ doc.title }}</h4>
|
||||
<p class="jio-docs__card-desc">{{ doc.description }}</p>
|
||||
</div>
|
||||
<FaIcon icon="fa fas fa-external-link-alt" :size="12" class="aksrt-docs__card-arrow" />
|
||||
<FaIcon icon="fa fas fa-external-link-alt" :size="12" class="jio-docs__card-arrow" />
|
||||
</div>
|
||||
</n-card>
|
||||
</div>
|
||||
|
||||
<!-- Version Info -->
|
||||
<n-card title="当前版本" size="small" class="aksrt-docs__section">
|
||||
<n-card title="当前版本" size="small" class="jio-docs__section">
|
||||
<n-descriptions :column="2" bordered label-placement="left" size="small">
|
||||
<n-descriptions-item label="主题版本">
|
||||
<n-tag type="success" size="small">{{ themeVersion }}</n-tag>
|
||||
@@ -91,12 +91,12 @@ import PageHeader from '@/components/PageHeader.vue'
|
||||
import FaIcon from '@/components/form/FaIcon.vue'
|
||||
import api from '@/api/index.js'
|
||||
|
||||
const themeVersion = ref(window.aksrtAdminData?.themeVersion || '3.4.0-dev')
|
||||
const themeVersion = ref(window.jioAdminData?.themeVersion || '3.4.0-dev')
|
||||
const dbSchemaVersion = ref('—')
|
||||
|
||||
const docs = ref([
|
||||
{ key: 'admin-ia-map', title: '后台 IA 蓝图', description: '完整的后台信息架构映射,12 个顶级分区及子页面清单。', icon: 'fa fas fa-sitemap', color: 'var(--aksrt-color-primary)', file: 'admin-ia-map.md' },
|
||||
{ key: 'legacy-gap-matrix', title: '对标差异矩阵', description: 'AKSRT 当前 → 原主题参考 → AKSRT 目标三层对照表。', icon: 'fa fas fa-columns', color: '#722ed1', file: 'legacy-gap-matrix.md' },
|
||||
{ key: 'admin-ia-map', title: '后台 IA 蓝图', description: '完整的后台信息架构映射,12 个顶级分区及子页面清单。', icon: 'fa fas fa-sitemap', color: 'var(--jio-color-primary)', file: 'admin-ia-map.md' },
|
||||
{ key: 'legacy-gap-matrix', title: '对标差异矩阵', description: 'Jio 当前 → 原主题参考 → Jio 目标三层对照表。', icon: 'fa fas fa-columns', color: '#722ed1', file: 'legacy-gap-matrix.md' },
|
||||
{ key: 'frontend-page-matrix', title: '前端页面矩阵', description: '前端模板、CSS、JS 资产映射与覆盖范围。', icon: 'fa fas fa-desktop', color: '#13c2c2', file: 'frontend-page-matrix.md' },
|
||||
{ key: 'manual-acceptance-baseline', title: '验收基线', description: '每个 Phase 的人工验收标准和检查清单。', icon: 'fa fas fa-clipboard', color: '#52c41a', file: 'manual-acceptance-baseline.md' },
|
||||
{ key: 'feature-domain-map', title: '功能域地图', description: '业务域划分、依赖关系和模块边界说明。', icon: 'fa fas fa-map', color: '#fa8c16', file: 'feature-domain-map.md' },
|
||||
@@ -117,35 +117,35 @@ onMounted(async () => {
|
||||
|
||||
function openDoc(doc) {
|
||||
// Link to local docs directory (admin can open in new tab)
|
||||
const base = window.aksrtAdminData?.siteUrl || window.location.origin
|
||||
window.open(`${base}/wp-content/themes/AKSRT-theme/docs/${doc.file}`, '_blank')
|
||||
const base = window.jioAdminData?.siteUrl || window.location.origin
|
||||
window.open(`${base}/wp-content/themes/Jio/docs/${doc.file}`, '_blank')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-docs__grid {
|
||||
.jio-docs__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
|
||||
gap: 12px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.aksrt-docs__card {
|
||||
.jio-docs__card {
|
||||
cursor: pointer;
|
||||
transition: box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.aksrt-docs__card:hover {
|
||||
.jio-docs__card:hover {
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.aksrt-docs__card-inner {
|
||||
.jio-docs__card-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-docs__card-icon {
|
||||
.jio-docs__card-icon {
|
||||
flex-shrink: 0;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -155,38 +155,38 @@ function openDoc(doc) {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.aksrt-docs__card-body {
|
||||
.jio-docs__card-body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.aksrt-docs__card-title {
|
||||
.jio-docs__card-title {
|
||||
margin: 0 0 2px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
}
|
||||
|
||||
.aksrt-docs__card-desc {
|
||||
.jio-docs__card-desc {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
line-height: 1.5;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.aksrt-docs__card-arrow {
|
||||
.jio-docs__card-arrow {
|
||||
flex-shrink: 0;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.aksrt-docs__section {
|
||||
.jio-docs__section {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.aksrt-docs__action {
|
||||
.jio-docs__action {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: flex-start;
|
||||
@@ -195,31 +195,31 @@ function openDoc(doc) {
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.aksrt-docs__action i {
|
||||
color: var(--aksrt-color-primary);
|
||||
.jio-docs__action i {
|
||||
color: var(--jio-color-primary);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.aksrt-docs__action strong {
|
||||
.jio-docs__action strong {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
color: var(--aksrt-color-text);
|
||||
color: var(--jio-color-text);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.aksrt-docs__action p {
|
||||
.jio-docs__action p {
|
||||
margin: 0 0 4px;
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
}
|
||||
|
||||
.aksrt-docs__action a {
|
||||
.jio-docs__action a {
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-primary);
|
||||
color: var(--jio-color-primary);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.aksrt-docs__action a:hover {
|
||||
.jio-docs__action a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader :title="title" :desc="desc">
|
||||
<template #actions>
|
||||
<n-space v-if="links.length">
|
||||
@@ -10,7 +10,7 @@
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<n-card v-if="note" class="aksrt-section-card">
|
||||
<n-card v-if="note" class="jio-section-card">
|
||||
<n-alert type="info" :show-icon="false">
|
||||
{{ note }}
|
||||
</n-alert>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="基本权限 / 能力矩阵"
|
||||
desc="统一管理用户治理、投稿和评论的角色能力矩阵。"
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 240px;">
|
||||
<n-card class="aksrt-section-card" v-if="summary.cap_count">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card" v-if="summary.cap_count">
|
||||
<div class="jio-section-header">
|
||||
<h3>矩阵概览</h3>
|
||||
</div>
|
||||
<n-space>
|
||||
@@ -28,12 +28,12 @@
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card v-for="group in groups" :key="group.key" class="aksrt-section-card">
|
||||
<n-card v-for="group in groups" :key="group.key" class="jio-section-card">
|
||||
<template #header>
|
||||
<div class="aksrt-cap-matrix__header">
|
||||
<div class="jio-cap-matrix__header">
|
||||
<div>
|
||||
<h3 class="aksrt-cap-matrix__title">{{ group.title }}</h3>
|
||||
<p class="aksrt-cap-matrix__desc">共 {{ group.items.length }} 项能力</p>
|
||||
<h3 class="jio-cap-matrix__title">{{ group.title }}</h3>
|
||||
<p class="jio-cap-matrix__desc">共 {{ group.items.length }} 项能力</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -47,20 +47,19 @@
|
||||
:scroll-x="1200"
|
||||
/>
|
||||
</n-card>
|
||||
|
||||
<div class="aksrt-form-actions">
|
||||
<n-button type="primary" :loading="saving" @click="handleSave">保存能力矩阵</n-button>
|
||||
</div>
|
||||
</n-spin>
|
||||
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="handleSave" @reload="load" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { h, onMounted, reactive, ref } from 'vue'
|
||||
import { computed, h, onMounted, reactive, ref } from 'vue'
|
||||
import { NInputNumber, NSwitch, NTag } from 'naive-ui'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import api from '@/api'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
|
||||
const message = useMessage()
|
||||
const loading = ref(true)
|
||||
@@ -74,6 +73,7 @@ const summary = reactive({
|
||||
})
|
||||
const userCaps = reactive({})
|
||||
const defaultsSnapshot = ref({})
|
||||
const dirty = computed(() => !loading.value && JSON.stringify(userCaps) !== JSON.stringify(defaultsSnapshot.value))
|
||||
|
||||
onMounted(load)
|
||||
|
||||
@@ -117,7 +117,7 @@ function buildColumns(group) {
|
||||
key: 'label',
|
||||
fixed: 'left',
|
||||
width: 280,
|
||||
render: (row) => h('div', { class: 'aksrt-cap-matrix__cap' }, [
|
||||
render: (row) => h('div', { class: 'jio-cap-matrix__cap' }, [
|
||||
h('strong', row.label),
|
||||
h('code', row.cap_id),
|
||||
]),
|
||||
@@ -148,7 +148,7 @@ function buildColumns(group) {
|
||||
function renderCapCell(row, col) {
|
||||
const hidden = !(row.visible_columns || []).includes(col)
|
||||
if (hidden) {
|
||||
return h('span', { class: 'aksrt-cap-matrix__empty' }, '—')
|
||||
return h('span', { class: 'jio-cap-matrix__empty' }, '—')
|
||||
}
|
||||
|
||||
if (!userCaps[row.cap_id]) {
|
||||
@@ -186,18 +186,11 @@ function resetDefaults() {
|
||||
message.info('已恢复默认矩阵')
|
||||
}
|
||||
|
||||
function expandAll() {
|
||||
message.info('当前矩阵为平铺展示,无需展开')
|
||||
}
|
||||
|
||||
function collapseAll() {
|
||||
message.info('当前矩阵为平铺展示,无需折叠')
|
||||
}
|
||||
|
||||
async function handleSave() {
|
||||
saving.value = true
|
||||
try {
|
||||
await api.saveCapabilities(JSON.parse(JSON.stringify(userCaps)))
|
||||
const res = await api.saveCapabilities(JSON.parse(JSON.stringify(userCaps)))
|
||||
if (res?.data?.user_caps) replaceReactive(userCaps, res.data.user_caps)
|
||||
defaultsSnapshot.value = JSON.parse(JSON.stringify(userCaps))
|
||||
message.success('能力矩阵已保存')
|
||||
} catch (error) {
|
||||
@@ -209,42 +202,36 @@ async function handleSave() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-cap-matrix__header {
|
||||
.jio-cap-matrix__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.aksrt-cap-matrix__title {
|
||||
.jio-cap-matrix__title {
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.aksrt-cap-matrix__desc {
|
||||
.jio-cap-matrix__desc {
|
||||
margin: 4px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
}
|
||||
|
||||
.aksrt-cap-matrix__cap {
|
||||
.jio-cap-matrix__cap {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.aksrt-cap-matrix__cap code {
|
||||
.jio-cap-matrix__cap code {
|
||||
font-size: 11px;
|
||||
color: #667085;
|
||||
}
|
||||
|
||||
.aksrt-cap-matrix__empty {
|
||||
.jio-cap-matrix__empty {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.aksrt-form-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-top: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aks-native-ops-redirect">
|
||||
<div class="jio-native-ops-redirect">
|
||||
<h2>{{ title }}</h2>
|
||||
<p class="desc">
|
||||
此运营功能已迁移到 WordPress 原生后台侧栏(对齐 legacy)。正在跳转…
|
||||
@@ -21,7 +21,7 @@ const title = computed(() => route.meta?.title || '运营功能已迁移')
|
||||
const nativeUrl = computed(() => {
|
||||
const path = route.meta?.nativeAdminPath || ''
|
||||
if (!path) return ''
|
||||
const base = (window.aksrtAdminData?.adminUrl || '/wp-admin/').replace(/\/?$/, '/')
|
||||
const base = (window.jioAdminData?.adminUrl || '/wp-admin/').replace(/\/?$/, '/')
|
||||
return base + path.replace(/^\//, '')
|
||||
})
|
||||
|
||||
@@ -33,13 +33,13 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aks-native-ops-redirect {
|
||||
.jio-native-ops-redirect {
|
||||
max-width: 640px;
|
||||
margin: 48px auto;
|
||||
padding: 24px;
|
||||
background: var(--aks-surface, #fff);
|
||||
background: var(--jio-surface, #fff);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--aks-border, #e5e7eb);
|
||||
border: 1px solid var(--jio-border, #e5e7eb);
|
||||
}
|
||||
.desc {
|
||||
color: #646970;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="主题授权"
|
||||
desc="当前版本按产品决策不实现在线授权/撤销授权,仅保留主题信息与更新能力。"
|
||||
@@ -12,14 +12,14 @@
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<n-card class="jio-section-card">
|
||||
<n-alert type="info" title="按设计省略" :show-icon="true">
|
||||
本主题当前不实现 原主题风格的授权码校验、域名绑定、撤销授权、本地免授权等机制。
|
||||
`AKSRT_Update_Checker` 仅负责匿名版本检测与更新提示,不与授权系统耦合。
|
||||
`JIO_Update_Checker` 仅负责匿名版本检测与更新提示,不与授权系统耦合。
|
||||
</n-alert>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card" title="当前策略" size="small">
|
||||
<n-card class="jio-section-card" title="当前策略" size="small">
|
||||
<n-list bordered>
|
||||
<n-list-item>不提供授权码输入框或“立即授权”按钮</n-list-item>
|
||||
<n-list-item>不提供“已授权 / 未授权 / 本地免授权”三态逻辑</n-list-item>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader title="主题信息" desc="主题版本、运行环境、已启用模块和关键系统信息。" />
|
||||
|
||||
<div v-if="loading" class="aksrt-theme-info__loading">
|
||||
<div v-if="loading" class="jio-theme-info__loading">
|
||||
<n-spin size="medium" />
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<!-- Version Card -->
|
||||
<n-card class="aksrt-theme-info__card" title="版本信息" size="small">
|
||||
<n-card class="jio-theme-info__card" title="版本信息" size="small">
|
||||
<n-descriptions :column="2" bordered label-placement="left" size="small">
|
||||
<n-descriptions-item label="主题版本">
|
||||
<n-tag type="success" size="small">{{ info.themeVersion }}</n-tag>
|
||||
@@ -33,7 +33,7 @@
|
||||
</n-card>
|
||||
|
||||
<!-- Environment Card -->
|
||||
<n-card class="aksrt-theme-info__card" title="运行环境" size="small">
|
||||
<n-card class="jio-theme-info__card" title="运行环境" size="small">
|
||||
<n-descriptions :column="2" bordered label-placement="left" size="small">
|
||||
<n-descriptions-item label="站点地址">
|
||||
<n-text code>{{ info.siteUrl }}</n-text>
|
||||
@@ -61,14 +61,14 @@
|
||||
</n-card>
|
||||
|
||||
<!-- Modules Card -->
|
||||
<n-card class="aksrt-theme-info__card" title="已启用模块" size="small">
|
||||
<div class="aksrt-theme-info__modules">
|
||||
<n-card class="jio-theme-info__card" title="已启用模块" size="small">
|
||||
<div class="jio-theme-info__modules">
|
||||
<n-tag
|
||||
v-for="mod in info.modules"
|
||||
:key="mod.key"
|
||||
:type="mod.enabled ? 'success' : 'default'"
|
||||
size="small"
|
||||
class="aksrt-theme-info__module-tag"
|
||||
class="jio-theme-info__module-tag"
|
||||
>
|
||||
<FaIcon :icon="mod.enabled ? 'fa fas fa-check-circle' : 'fa fas fa-circle'" :size="10" />
|
||||
{{ mod.label }}
|
||||
@@ -80,7 +80,7 @@
|
||||
</n-card>
|
||||
|
||||
<!-- Data Tables Card -->
|
||||
<n-card class="aksrt-theme-info__card" title="数据表状态" size="small">
|
||||
<n-card class="jio-theme-info__card" title="数据表状态" size="small">
|
||||
<n-data-table
|
||||
:columns="tableColumns"
|
||||
:data="info.tables"
|
||||
@@ -91,25 +91,25 @@
|
||||
</n-card>
|
||||
|
||||
<!-- Docs Links Card -->
|
||||
<n-card class="aksrt-theme-info__card" title="快速入口" size="small">
|
||||
<div class="aksrt-theme-info__links">
|
||||
<router-link to="/docs" class="aksrt-theme-info__link">
|
||||
<n-card class="jio-theme-info__card" title="快速入口" size="small">
|
||||
<div class="jio-theme-info__links">
|
||||
<router-link to="/docs" class="jio-theme-info__link">
|
||||
<FaIcon icon="fa fas fa-book" :size="16" />
|
||||
<span>文档中心</span>
|
||||
</router-link>
|
||||
<router-link to="/tools/update" class="aksrt-theme-info__link">
|
||||
<router-link to="/tools/update" class="jio-theme-info__link">
|
||||
<FaIcon icon="fa fas fa-cloud-download-alt" :size="16" />
|
||||
<span>更新中心</span>
|
||||
</router-link>
|
||||
<router-link to="/tools/backup" class="aksrt-theme-info__link">
|
||||
<router-link to="/tools/backup" class="jio-theme-info__link">
|
||||
<FaIcon icon="fa fas fa-archive" :size="16" />
|
||||
<span>数据备份</span>
|
||||
</router-link>
|
||||
<router-link to="/tools/health" class="aksrt-theme-info__link">
|
||||
<router-link to="/tools/health" class="jio-theme-info__link">
|
||||
<FaIcon icon="fa fas fa-heartbeat" :size="16" />
|
||||
<span>健康检查</span>
|
||||
</router-link>
|
||||
<router-link to="/tools/import-export" class="aksrt-theme-info__link">
|
||||
<router-link to="/tools/import-export" class="jio-theme-info__link">
|
||||
<FaIcon icon="fa fas fa-exchange-alt" :size="16" />
|
||||
<span>导入导出</span>
|
||||
</router-link>
|
||||
@@ -173,13 +173,13 @@ onMounted(async () => {
|
||||
const data = res?.data || res || {}
|
||||
|
||||
info.value = {
|
||||
themeVersion: window.aksrtAdminData?.themeVersion || data.theme_version || '3.4.0-dev',
|
||||
themeVersion: window.jioAdminData?.themeVersion || data.theme_version || '3.4.0-dev',
|
||||
wpVersion: data.wp_version || '',
|
||||
phpVersion: data.php_version || '',
|
||||
dbSchemaVersion: data.db_schema_version || '',
|
||||
emailBackfillDone: !!data.email_backfill_done,
|
||||
siteUrl: data.site_url || window.aksrtAdminData?.siteUrl || '',
|
||||
apiUrl: data.api_url || window.aksrtAdminData?.apiUrl || '',
|
||||
siteUrl: data.site_url || window.jioAdminData?.siteUrl || '',
|
||||
apiUrl: data.api_url || window.jioAdminData?.apiUrl || '',
|
||||
themeDir: data.theme_dir || '',
|
||||
uploadDir: data.upload_dir || '',
|
||||
isMultisite: !!data.is_multisite,
|
||||
@@ -191,8 +191,8 @@ onMounted(async () => {
|
||||
console.error('[ThemeInfo] Failed to load health data:', err)
|
||||
// Fallback with minimal info
|
||||
info.value.themeVersion = '3.4.0-dev'
|
||||
info.value.siteUrl = window.aksrtAdminData?.siteUrl || ''
|
||||
info.value.apiUrl = window.aksrtAdminData?.apiUrl || ''
|
||||
info.value.siteUrl = window.jioAdminData?.siteUrl || ''
|
||||
info.value.apiUrl = window.jioAdminData?.apiUrl || ''
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@@ -218,35 +218,35 @@ function normalizeTables(raw) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-theme-info__loading {
|
||||
.jio-theme-info__loading {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding: 60px 0;
|
||||
}
|
||||
|
||||
.aksrt-theme-info__card {
|
||||
.jio-theme-info__card {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.aksrt-theme-info__modules {
|
||||
.jio-theme-info__modules {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.aksrt-theme-info__module-tag {
|
||||
.jio-theme-info__module-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.aksrt-theme-info__links {
|
||||
.jio-theme-info__links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-theme-info__link {
|
||||
.jio-theme-info__link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
@@ -259,7 +259,7 @@ function normalizeTables(raw) {
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.aksrt-theme-info__link:hover {
|
||||
.jio-theme-info__link:hover {
|
||||
background: #e8eaed;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="数据备份"
|
||||
desc="管理设置快照、创建手动备份,并执行恢复或删除。"
|
||||
@@ -12,8 +12,8 @@
|
||||
</PageHeader>
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>备份策略</h3>
|
||||
</div>
|
||||
<n-space vertical size="small" style="width: 100%;">
|
||||
@@ -26,19 +26,19 @@
|
||||
<n-tag round :type="backups.length ? 'success' : 'default'">现有快照:{{ backups.length }} 份</n-tag>
|
||||
</n-space>
|
||||
<n-space align="center" wrap>
|
||||
<span class="aksrt-backup__label">自动备份</span>
|
||||
<span class="jio-backup__label">自动备份</span>
|
||||
<n-switch v-model:value="settings.backup_auto" />
|
||||
<span class="aksrt-backup__label">频率</span>
|
||||
<span class="jio-backup__label">频率</span>
|
||||
<n-select v-model:value="settings.backup_frequency" :options="frequencyOptions" style="width: 140px;" />
|
||||
<span class="aksrt-backup__label">保留</span>
|
||||
<span class="jio-backup__label">保留</span>
|
||||
<n-input-number v-model:value="settings.backup_retain" :min="3" :max="20" style="width: 140px;" />
|
||||
<n-button type="primary" :loading="savingPolicy" @click="handleSavePolicy">保存策略</n-button>
|
||||
</n-space>
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>手动创建快照</h3>
|
||||
</div>
|
||||
<n-space vertical size="small" style="width: 100%;">
|
||||
@@ -50,8 +50,8 @@
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>快照列表</h3>
|
||||
</div>
|
||||
<n-empty v-if="!backups.length" description="暂无设置快照" />
|
||||
@@ -64,7 +64,7 @@
|
||||
:single-line="false"
|
||||
:scroll-x="900"
|
||||
/>
|
||||
<p class="aksrt-backup__hint">
|
||||
<p class="jio-backup__hint">
|
||||
恢复非当前网站 / 非当前版本的快照可能导致配置异常,恢复前请确认站点环境一致。
|
||||
</p>
|
||||
</n-card>
|
||||
@@ -264,14 +264,14 @@ async function handleDelete(row) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-backup__hint {
|
||||
.jio-backup__hint {
|
||||
margin: 12px 0 0;
|
||||
color: #667085;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.aksrt-backup__label {
|
||||
.jio-backup__label {
|
||||
color: #344054;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="健康检查"
|
||||
desc="集中查看运行环境、数据库表和系统诊断状态。"
|
||||
@@ -12,9 +12,9 @@
|
||||
</PageHeader>
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
<div class="aksrt-health-grid">
|
||||
<n-card v-for="check in checkItems" :key="check.key" class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<div class="jio-health-grid">
|
||||
<n-card v-for="check in checkItems" :key="check.key" class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>{{ check.label }}</h3>
|
||||
<n-tag round :type="statusToTag(check.status)">{{ check.status }}</n-tag>
|
||||
</div>
|
||||
@@ -76,7 +76,7 @@ onMounted(load)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-health-grid {
|
||||
.jio-health-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 16px;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="导入导出"
|
||||
desc="导出当前设置快照、执行 dry-run 导入校验,并支持按域重置到 schema 默认值。"
|
||||
@@ -12,8 +12,8 @@
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>导出与导入</h3>
|
||||
</div>
|
||||
<n-space style="margin-bottom: 16px;">
|
||||
@@ -27,13 +27,13 @@
|
||||
:autosize="{ minRows: 12, maxRows: 20 }"
|
||||
placeholder="导出的 JSON 会出现在这里,也可以直接粘贴导入。"
|
||||
/>
|
||||
<p class="aksrt-tools-hint">
|
||||
<p class="jio-tools-hint">
|
||||
正式导入前会自动创建一份“导入前自动快照”,与“数据备份”页的快照体系共用,便于回滚。
|
||||
</p>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>按域重置</h3>
|
||||
</div>
|
||||
<n-space align="center" wrap>
|
||||
@@ -41,14 +41,14 @@
|
||||
<n-button :loading="resetting" @click="handleReset">重置所选域</n-button>
|
||||
<n-button type="error" tertiary :loading="resettingAll" @click="handleResetAll">重置全部</n-button>
|
||||
</n-space>
|
||||
<p class="aksrt-tools-hint">仅支持重置 schema 托管的业务域。健康检查和迁移状态属于运维面板,不参与按域回滚。</p>
|
||||
<p class="jio-tools-hint">仅支持重置 schema 托管的业务域。健康检查和迁移状态属于运维面板,不参与按域回滚。</p>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>最近结果</h3>
|
||||
</div>
|
||||
<pre class="aksrt-tools-output">{{ resultText || '尚未执行操作。' }}</pre>
|
||||
<pre class="jio-tools-output">{{ resultText || '尚未执行操作。' }}</pre>
|
||||
</n-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -169,7 +169,7 @@ async function handleResetAll() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-tools-output {
|
||||
.jio-tools-output {
|
||||
margin: 0;
|
||||
padding: 14px;
|
||||
border-radius: 12px;
|
||||
@@ -181,7 +181,7 @@ async function handleResetAll() {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.aksrt-tools-hint {
|
||||
.jio-tools-hint {
|
||||
margin: 12px 0 0;
|
||||
color: #667085;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="更新中心"
|
||||
desc="查看版本状态、检测更新并浏览更新日志与教程入口。"
|
||||
@@ -13,8 +13,8 @@
|
||||
</PageHeader>
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 220px;">
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>版本状态</h3>
|
||||
</div>
|
||||
<n-space>
|
||||
@@ -26,8 +26,8 @@
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card" v-if="updateInfo.update_available">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card" v-if="updateInfo.update_available">
|
||||
<div class="jio-section-header">
|
||||
<h3>可用更新</h3>
|
||||
</div>
|
||||
<n-alert type="warning" style="margin-bottom: 12px;">
|
||||
@@ -39,18 +39,18 @@
|
||||
</n-button>
|
||||
<n-button @click="handleDismiss" :loading="dismissing">忽略此版本</n-button>
|
||||
</n-space>
|
||||
<div v-if="updateInfo.changelog" class="aksrt-update__changelog">
|
||||
<div v-if="updateInfo.changelog" class="jio-update__changelog">
|
||||
<h4>更新日志</h4>
|
||||
<pre>{{ updateInfo.changelog }}</pre>
|
||||
</div>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>常用教程入口</h3>
|
||||
</div>
|
||||
<div class="aksrt-update__grid">
|
||||
<a v-for="item in guides" :key="item.key" class="aksrt-update__guide" :href="item.url" target="_blank" rel="noreferrer">
|
||||
<div class="jio-update__grid">
|
||||
<a v-for="item in guides" :key="item.key" class="jio-update__guide" :href="item.url" target="_blank" rel="noreferrer">
|
||||
<strong>{{ item.title }}</strong>
|
||||
<span>{{ item.desc }}</span>
|
||||
</a>
|
||||
@@ -152,11 +152,11 @@ async function handleDismiss() {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-update__changelog {
|
||||
.jio-update__changelog {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.aksrt-update__changelog pre {
|
||||
.jio-update__changelog pre {
|
||||
margin: 8px 0 0;
|
||||
padding: 12px 14px;
|
||||
border-radius: 12px;
|
||||
@@ -168,30 +168,30 @@ async function handleDismiss() {
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.aksrt-update__grid {
|
||||
.jio-update__grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.aksrt-update__guide {
|
||||
.jio-update__guide {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
padding: 14px;
|
||||
border: 1px solid var(--aksrt-color-border);
|
||||
border: 1px solid var(--jio-color-border);
|
||||
border-radius: 12px;
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.aksrt-update__guide:hover {
|
||||
border-color: var(--aksrt-color-primary);
|
||||
.jio-update__guide:hover {
|
||||
border-color: var(--jio-color-primary);
|
||||
background: #f5faff;
|
||||
}
|
||||
|
||||
.aksrt-update__guide span {
|
||||
.jio-update__guide span {
|
||||
font-size: 12px;
|
||||
color: #667085;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<PageHeader
|
||||
title="用户徽章"
|
||||
desc="配置勋章分类、自动授予条件(get_type / get_val)与公开展示。路由 /users/badge,存储键 user_medal_*。"
|
||||
>
|
||||
<div class="jio-page-container">
|
||||
<PageHeader title="用户徽章" desc="配置勋章分类、自动授予条件与前台公开展示。">
|
||||
<template #actions>
|
||||
<n-space>
|
||||
<n-button quaternary @click="go('/users/notifications')">消息通知</n-button>
|
||||
@@ -13,106 +10,65 @@
|
||||
</PageHeader>
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<h3>当前摘要</h3>
|
||||
</div>
|
||||
<n-space>
|
||||
<n-tag round :type="form.user_medal_s ? 'success' : 'default'">
|
||||
徽章系统:{{ form.user_medal_s ? '已启用' : '已关闭' }}
|
||||
</n-tag>
|
||||
<n-tag round :type="form.user_medal_public_display ? 'info' : 'default'">
|
||||
公开展示:{{ form.user_medal_public_display ? '开启' : '关闭' }}
|
||||
</n-tag>
|
||||
<n-tag round type="info">最多显示:{{ form.user_medal_limit }} 枚</n-tag>
|
||||
<n-tag round type="info">分类:{{ form.user_medal_args.length }}</n-tag>
|
||||
<n-tag round type="info">条目:{{ itemCount }}</n-tag>
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>徽章展示</h3>
|
||||
</div>
|
||||
<n-form :model="form" label-placement="left" label-width="180" class="aksrt-form">
|
||||
<n-form :model="form" label-placement="left" label-width="180" class="jio-form">
|
||||
<n-form-item label="启用徽章/勋章系统">
|
||||
<n-switch v-model:value="form.user_medal_s" />
|
||||
</n-form-item>
|
||||
<n-form-item v-if="form.user_medal_s" label="公开页显示徽章">
|
||||
<n-switch v-model:value="form.user_medal_public_display" />
|
||||
</n-form-item>
|
||||
<n-form-item v-if="form.user_medal_s" label="最多显示数量">
|
||||
<n-input-number v-model:value="form.user_medal_limit" :min="1" :max="8" style="width: 180px;" />
|
||||
</n-form-item>
|
||||
<template v-if="form.user_medal_s">
|
||||
<n-form-item label="公开页显示徽章">
|
||||
<n-switch v-model:value="form.user_medal_public_display" />
|
||||
</n-form-item>
|
||||
<n-form-item label="最多显示数量">
|
||||
<n-input-number v-model:value="form.user_medal_limit" :min="1" :max="8" style="width: 180px;">
|
||||
<template #suffix>枚</template>
|
||||
</n-input-number>
|
||||
</n-form-item>
|
||||
</template>
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<n-card v-if="form.user_medal_s" class="aksrt-section-card">
|
||||
<div class="aksrt-section-header" style="display:flex;justify-content:space-between;align-items:center;">
|
||||
<h3>徽章明细(分类 → 条目)</h3>
|
||||
<n-button size="small" @click="addCategory">添加分类</n-button>
|
||||
<n-card v-if="form.user_medal_s" class="jio-section-card">
|
||||
<div class="jio-section-header users-badge__header">
|
||||
<h3>徽章明细</h3>
|
||||
<span class="users-badge__stats">{{ form.user_medal_args.length }} 个分类 · {{ itemCount }} 枚徽章</span>
|
||||
</div>
|
||||
<p class="users-badge__hint">
|
||||
拖动手柄调整分类与条目顺序,点击行头展开编辑。获取条件选择「仅手动授予」时不自动发放。
|
||||
</p>
|
||||
|
||||
<n-empty v-if="!form.user_medal_args.length" description="暂无分类,请添加" />
|
||||
|
||||
<div v-for="(cat, ci) in form.user_medal_args" :key="'cat-' + ci" class="medal-cat-block">
|
||||
<n-card size="small" embedded>
|
||||
<n-space vertical :size="12">
|
||||
<n-space align="center">
|
||||
<n-input v-model:value="cat.cat_name" placeholder="分类名称" style="width: 220px;" />
|
||||
<n-button size="small" @click="addItem(ci)">添加条目</n-button>
|
||||
<n-button size="small" quaternary type="error" @click="removeCategory(ci)">删除分类</n-button>
|
||||
</n-space>
|
||||
|
||||
<n-empty v-if="!(cat.items && cat.items.length)" description="该分类暂无条目" />
|
||||
|
||||
<div v-for="(item, ii) in cat.items || []" :key="'item-' + ci + '-' + ii" class="medal-item-row">
|
||||
<n-grid cols="1 s:2 m:3" :x-gap="12" :y-gap="8" responsive="screen">
|
||||
<n-grid-item>
|
||||
<n-input v-model:value="item.slug" placeholder="slug" />
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<n-input v-model:value="item.name" placeholder="名称" />
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<n-select v-model:value="item.get_type" :options="getTypeOptions" placeholder="获取条件" />
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<n-input-number
|
||||
v-model:value="item.get_val"
|
||||
:min="0"
|
||||
:disabled="item.get_type === 'manually_add'"
|
||||
placeholder="阈值"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<n-input v-model:value="item.icon" placeholder="图标 URL" />
|
||||
</n-grid-item>
|
||||
<n-grid-item>
|
||||
<n-input v-model:value="item.desc" placeholder="描述" />
|
||||
</n-grid-item>
|
||||
</n-grid>
|
||||
<div style="margin-top: 8px; text-align: right;">
|
||||
<n-button size="tiny" quaternary type="error" @click="removeItem(ci, ii)">删除条目</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</n-space>
|
||||
</n-card>
|
||||
<div v-if="!form.user_medal_args.length" class="jio-sortable__empty">
|
||||
<i class="fa fas fa-trophy" aria-hidden="true" />
|
||||
<span>暂无分类,请添加</span>
|
||||
</div>
|
||||
</n-card>
|
||||
<draggable
|
||||
v-else
|
||||
v-model="form.user_medal_args"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
:item-key="rowKey"
|
||||
class="jio-sortable"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<MedalCategoryCard
|
||||
:category="element"
|
||||
:index="index"
|
||||
:open="cats.isOpen(rowKey(element))"
|
||||
:head-attrs="cats.headAttrs(rowKey(element))"
|
||||
@remove="form.user_medal_args.splice(index, 1)"
|
||||
/>
|
||||
</template>
|
||||
</draggable>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<n-alert type="info" :show-icon="false">
|
||||
前台已授予徽章保存在用户 meta aksrt_user_badges;佩戴为 aksrt_wear_badge(slug)。
|
||||
字典来自 user_medal_args;运行时 AKSRT_User_Badges 读取 identity badge.dictionary 派生列表。
|
||||
</n-alert>
|
||||
<n-button class="users-badge__add" dashed block @click="addCategory">
|
||||
<i class="fa fas fa-plus" aria-hidden="true" /> 添加分类
|
||||
</n-button>
|
||||
</n-card>
|
||||
|
||||
<div class="aksrt-form-actions">
|
||||
<n-button type="primary" :loading="saving" @click="handleSave">保存配置</n-button>
|
||||
</div>
|
||||
</n-spin>
|
||||
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="handleSave" @reload="load" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -120,16 +76,22 @@
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import draggable from 'vuedraggable'
|
||||
import api from '@/api'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import { MEDAL_GET_TYPES, defaultMedalArgs } from '@/schema/sections/users/badge.js'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
import { SORTABLE_LIST_ATTRS } from '@/components/form/sortable-options.js'
|
||||
import { useCollapsibleItems } from '@/components/form/useCollapsibleItems.js'
|
||||
import { defaultMedalArgs } from '@/schema/sections/users/badge.js'
|
||||
import { emptyCategory, findInvalidItem, normalizeArgs, rowKey } from './partials/badge/badge-model.js'
|
||||
import MedalCategoryCard from './partials/badge/MedalCategoryCard.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const message = useMessage()
|
||||
const cats = useCollapsibleItems()
|
||||
|
||||
const loading = ref(true)
|
||||
const saving = ref(false)
|
||||
const getTypeOptions = MEDAL_GET_TYPES
|
||||
|
||||
const form = reactive({
|
||||
user_medal_s: false,
|
||||
@@ -138,82 +100,38 @@ const form = reactive({
|
||||
user_medal_args: defaultMedalArgs(),
|
||||
})
|
||||
|
||||
const itemCount = computed(() =>
|
||||
form.user_medal_args.reduce((n, c) => n + (Array.isArray(c.items) ? c.items.length : 0), 0),
|
||||
)
|
||||
// 与全局保存栏一致:仅在有未保存更改时显示。以最近一次加载/保存的快照为基准。
|
||||
const snapshot = ref('')
|
||||
const serialize = () => JSON.stringify(form)
|
||||
const dirty = computed(() => !loading.value && snapshot.value !== '' && serialize() !== snapshot.value)
|
||||
function markClean() {
|
||||
snapshot.value = serialize()
|
||||
}
|
||||
|
||||
const itemCount = computed(() => form.user_medal_args.reduce((n, c) => n + c.items.length, 0))
|
||||
|
||||
function go(path) {
|
||||
router.push(path)
|
||||
}
|
||||
|
||||
function extractData(response) {
|
||||
return response?.data ?? response ?? {}
|
||||
}
|
||||
|
||||
function emptyItem() {
|
||||
return {
|
||||
slug: '',
|
||||
name: '',
|
||||
desc: '',
|
||||
icon: '',
|
||||
get_type: 'manually_add',
|
||||
get_val: 0,
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeArgs(raw) {
|
||||
if (!Array.isArray(raw)) {
|
||||
return defaultMedalArgs()
|
||||
}
|
||||
return raw.map((cat) => ({
|
||||
cat_name: String(cat?.cat_name || cat?.name || '未命名').trim() || '未命名',
|
||||
items: Array.isArray(cat?.items)
|
||||
? cat.items.map((it) => ({
|
||||
slug: String(it?.slug || '').trim(),
|
||||
name: String(it?.name || '').trim(),
|
||||
desc: String(it?.desc || '').trim(),
|
||||
icon: String(it?.icon || it?.icon_url || '').trim(),
|
||||
get_type: String(it?.get_type || 'manually_add').trim() || 'manually_add',
|
||||
get_val: Math.max(0, Number(it?.get_val ?? 0) || 0),
|
||||
}))
|
||||
: [],
|
||||
}))
|
||||
}
|
||||
|
||||
function addCategory() {
|
||||
form.user_medal_args.push({ cat_name: '新分类', items: [emptyItem()] })
|
||||
form.user_medal_args.push(emptyCategory())
|
||||
cats.toggle(rowKey(form.user_medal_args[form.user_medal_args.length - 1]))
|
||||
}
|
||||
|
||||
function removeCategory(ci) {
|
||||
form.user_medal_args.splice(ci, 1)
|
||||
}
|
||||
|
||||
function addItem(ci) {
|
||||
if (!form.user_medal_args[ci].items) {
|
||||
form.user_medal_args[ci].items = []
|
||||
}
|
||||
form.user_medal_args[ci].items.push(emptyItem())
|
||||
}
|
||||
|
||||
function removeItem(ci, ii) {
|
||||
form.user_medal_args[ci].items.splice(ii, 1)
|
||||
function applySettings(data) {
|
||||
form.user_medal_s = !!data.user_medal_s
|
||||
form.user_medal_public_display = data.user_medal_public_display !== false
|
||||
form.user_medal_limit = Number(data.user_medal_limit ?? 3)
|
||||
form.user_medal_args = normalizeArgs(data.user_medal_args ?? null)
|
||||
}
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
const schemaRes = await api.getSchemaPage('users', 'badge')
|
||||
const schemaData = extractData(schemaRes)
|
||||
|
||||
form.user_medal_s = !!(schemaData.user_medal_s ?? schemaData.user_badge_enabled)
|
||||
form.user_medal_public_display =
|
||||
schemaData.user_medal_public_display !== undefined
|
||||
? schemaData.user_medal_public_display !== false
|
||||
: schemaData.user_badge_public_display !== false
|
||||
form.user_medal_limit = Number(
|
||||
schemaData.user_medal_limit ?? schemaData.user_badge_limit ?? 3,
|
||||
)
|
||||
form.user_medal_args = normalizeArgs(schemaData.user_medal_args ?? null)
|
||||
const res = await api.getSchemaPage('users', 'badge')
|
||||
applySettings(res?.data ?? res ?? {})
|
||||
markClean()
|
||||
} catch (error) {
|
||||
message.error(error.message || '加载用户徽章配置失败')
|
||||
} finally {
|
||||
@@ -222,18 +140,14 @@ async function load() {
|
||||
}
|
||||
|
||||
async function handleSave() {
|
||||
const args = normalizeArgs(form.user_medal_args)
|
||||
const invalid = form.user_medal_s ? findInvalidItem(args) : ''
|
||||
if (invalid) {
|
||||
message.error(invalid)
|
||||
return
|
||||
}
|
||||
saving.value = true
|
||||
try {
|
||||
const args = normalizeArgs(form.user_medal_args)
|
||||
for (const cat of args) {
|
||||
for (const it of cat.items) {
|
||||
if (!it.slug || !it.name || !it.get_type) {
|
||||
message.error('每个条目需要 slug、名称和获取条件')
|
||||
saving.value = false
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
await api.saveSchemaPage('users', 'badge', {
|
||||
user_medal_s: !!form.user_medal_s,
|
||||
user_medal_public_display: !!form.user_medal_public_display,
|
||||
@@ -241,6 +155,7 @@ async function handleSave() {
|
||||
user_medal_args: args,
|
||||
})
|
||||
form.user_medal_args = args
|
||||
markClean()
|
||||
message.success('用户徽章配置已保存')
|
||||
} catch (error) {
|
||||
message.error(error.message || '保存失败')
|
||||
@@ -253,13 +168,25 @@ onMounted(load)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.medal-cat-block {
|
||||
margin-bottom: 16px;
|
||||
.users-badge__header {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
}
|
||||
.medal-item-row {
|
||||
padding: 12px;
|
||||
border: 1px solid var(--n-border-color, #efeff5);
|
||||
border-radius: 8px;
|
||||
margin-bottom: 8px;
|
||||
|
||||
.users-badge__stats {
|
||||
color: var(--jio-color-muted, #6F7A72);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.users-badge__hint {
|
||||
margin: 0 0 12px;
|
||||
color: var(--jio-color-muted, #6F7A72);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.users-badge__add {
|
||||
margin-top: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="用户等级"
|
||||
desc="配置等级开关、最高等级、升级经验阈值与经验获取矩阵(对齐 legacy 用户等级 / 经验值)。"
|
||||
@@ -13,8 +13,8 @@
|
||||
</PageHeader>
|
||||
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 200px;">
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>当前摘要</h3></div>
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>当前摘要</h3></div>
|
||||
<n-space>
|
||||
<n-tag round :type="form.user_level_s ? 'success' : 'default'">
|
||||
等级系统:{{ form.user_level_s ? '已启用' : '已关闭' }}
|
||||
@@ -24,9 +24,9 @@
|
||||
</n-space>
|
||||
</n-card>
|
||||
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>等级显示</h3></div>
|
||||
<n-form :model="form" label-placement="left" label-width="180" class="aksrt-form">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>等级显示</h3></div>
|
||||
<n-form :model="form" label-placement="left" label-width="180" class="jio-form">
|
||||
<n-form-item label="启用用户等级">
|
||||
<n-switch v-model:value="form.user_level_s" />
|
||||
</n-form-item>
|
||||
@@ -42,17 +42,17 @@
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<n-card v-if="form.user_level_s" class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>升级所需经验(累计)</h3></div>
|
||||
<n-card v-if="form.user_level_s" class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>升级所需经验(累计)</h3></div>
|
||||
<n-alert type="info" :show-icon="false" style="margin-bottom: 12px;">
|
||||
Lv.1 通常为 0。数值为升到该级所需的累计经验。修改最高等级后会自动补齐/截断行。
|
||||
</n-alert>
|
||||
<n-data-table :columns="levelColumns" :data="levelRows" :bordered="false" size="small" />
|
||||
</n-card>
|
||||
|
||||
<n-card v-if="form.user_level_s" class="aksrt-section-card">
|
||||
<div class="aksrt-section-header"><h3>经验值得分</h3></div>
|
||||
<n-form :model="form" label-placement="left" label-width="180" class="aksrt-form">
|
||||
<n-card v-if="form.user_level_s" class="jio-section-card">
|
||||
<div class="jio-section-header"><h3>经验值得分</h3></div>
|
||||
<n-form :model="form" label-placement="left" label-width="180" class="jio-form">
|
||||
<n-form-item label="每日上限">
|
||||
<n-input-number v-model:value="form.user_integral_opt.day_max" :min="0" :max="10000" style="width: 180px;" />
|
||||
</n-form-item>
|
||||
@@ -70,11 +70,8 @@
|
||||
</n-grid>
|
||||
</div>
|
||||
</n-card>
|
||||
|
||||
<div class="aksrt-form-actions">
|
||||
<n-button type="primary" :loading="saving" @click="handleSave">保存配置</n-button>
|
||||
</div>
|
||||
</n-spin>
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="handleSave" @reload="load" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -84,6 +81,7 @@ import { useRouter } from 'vue-router'
|
||||
import { NInput, NInputNumber, useMessage } from 'naive-ui'
|
||||
import api from '@/api'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
import {
|
||||
INTEGRAL_CATALOG,
|
||||
defaultIntegralOpt,
|
||||
@@ -104,6 +102,13 @@ const form = reactive({
|
||||
user_level_notify: true,
|
||||
})
|
||||
|
||||
const snapshot = ref('')
|
||||
const serialize = () => JSON.stringify(form)
|
||||
const dirty = computed(() => !loading.value && snapshot.value !== '' && serialize() !== snapshot.value)
|
||||
function markClean() {
|
||||
snapshot.value = serialize()
|
||||
}
|
||||
|
||||
const integralGroups = computed(() => [...new Set(INTEGRAL_CATALOG.map((r) => r.group))])
|
||||
|
||||
const levelRows = computed(() => {
|
||||
@@ -140,7 +145,7 @@ const levelColumns = [
|
||||
h(NInput, {
|
||||
value: form.user_level_opt['icon_img_' + row.level] ?? '',
|
||||
size: 'small',
|
||||
placeholder: row.level <= 10 ? '留空使用主题内置图标' : '请输入图片 URL',
|
||||
placeholder: row.level <= 10 ? '默认使用主题自带等级图标' : '请输入图片 URL',
|
||||
onUpdateValue: (v) => {
|
||||
form.user_level_opt['icon_img_' + row.level] = v
|
||||
},
|
||||
@@ -245,6 +250,7 @@ async function load() {
|
||||
form.user_level_notify = d.user_level_notify !== false
|
||||
form.user_level_opt = normalizeLevelOpt(d.user_level_opt, form.user_level_max)
|
||||
form.user_integral_opt = normalizeIntegral(d.user_integral_opt)
|
||||
markClean()
|
||||
} catch (error) {
|
||||
message.error(error.message || '加载用户等级配置失败')
|
||||
} finally {
|
||||
@@ -270,6 +276,7 @@ async function handleSave() {
|
||||
user_level_opt: payload.user_level_opt,
|
||||
user_integral_opt: payload.user_integral_opt,
|
||||
})
|
||||
markClean()
|
||||
message.success('用户等级配置已保存')
|
||||
} catch (error) {
|
||||
message.error(error.message || '保存失败')
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader
|
||||
title="工单中心"
|
||||
desc="工单功能开关、提交公告与提交表单配置,以及部门、状态、预设回复三块字典维护。工单的日常处理在 WordPress 用户菜单的「工单管理」中完成。"
|
||||
@@ -11,7 +11,7 @@
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<n-tabs v-model:value="activeTab" type="segment" animated class="aksrt-ticket-tabs">
|
||||
<n-tabs v-model:value="activeTab" type="segment" animated class="jio-ticket-tabs">
|
||||
<n-tab-pane name="settings" tab="基础配置">
|
||||
<SchemaPage domain="users" section="ticket" />
|
||||
</n-tab-pane>
|
||||
@@ -57,13 +57,13 @@ watch(activeTab, (name) => {
|
||||
})
|
||||
|
||||
function openNativeList() {
|
||||
const base = (window.aksrtAdminData?.adminUrl || '/wp-admin/').replace(/\/?$/, '/')
|
||||
window.location.href = base + 'users.php?page=aksrt_tickets'
|
||||
const base = (window.jioAdminData?.adminUrl || '/wp-admin/').replace(/\/?$/, '/')
|
||||
window.location.href = base + 'users.php?page=jio_tickets'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-ticket-tabs {
|
||||
.jio-ticket-tabs {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<div class="jio-page-container">
|
||||
<PageHeader title="身份认证" desc="配置通用认证申请规则;申请审核和用户认证资料管理位于 WordPress 用户菜单。" />
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 240px">
|
||||
<n-card class="aksrt-section-card" title="认证申请设置">
|
||||
<n-card class="jio-section-card" title="认证申请设置">
|
||||
<n-form :model="form" label-placement="left" label-width="190">
|
||||
<n-form-item label="启用身份认证"><n-switch v-model:value="form.user_auth_s" /></n-form-item>
|
||||
<n-form-item label="允许用户前台申请"><n-switch v-model:value="form.user_auth_apply_s" :disabled="!form.user_auth_s" /></n-form-item>
|
||||
@@ -18,11 +18,8 @@
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
<div class="aksrt-form-actions">
|
||||
<n-button :disabled="!dirty || saving" @click="load">放弃更改</n-button>
|
||||
<n-button type="primary" :disabled="!dirty" :loading="saving" @click="save">保存设置</n-button>
|
||||
</div>
|
||||
</n-spin>
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="save" @reload="load" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -30,6 +27,7 @@
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
import api from '@/api'
|
||||
|
||||
const defaults = {
|
||||
@@ -45,7 +43,7 @@ const initial = ref('')
|
||||
const loading = ref(true)
|
||||
const saving = ref(false)
|
||||
const snapshot = computed(() => JSON.stringify(form))
|
||||
const dirty = computed(() => initial.value !== '' && snapshot.value !== initial.value)
|
||||
const dirty = computed(() => !loading.value && initial.value !== '' && snapshot.value !== initial.value)
|
||||
|
||||
function extractData(response) {
|
||||
return response?.data ?? response ?? {}
|
||||
|
||||
@@ -1,257 +1,195 @@
|
||||
<template>
|
||||
<div class="aksrt-page-container">
|
||||
<PageHeader title="微信模板消息" desc="配置微信公众号模板消息推送。" />
|
||||
<div class="jio-page-container">
|
||||
<PageHeader title="微信模板消息" desc="按通知事件配置公众号模板及参数。" />
|
||||
|
||||
<!-- 状态卡片 -->
|
||||
<div class="aksrt-wechat__status">
|
||||
<div class="aksrt-wechat__status-card">
|
||||
<div class="aksrt-wechat__status-icon" :class="status.configured ? 'aksrt-wechat__status-icon--ok' : 'aksrt-wechat__status-icon--warn'">
|
||||
<i :class="status.configured ? 'fa fas fa-check' : 'fa fas fa-exclamation'"></i>
|
||||
</div>
|
||||
<div class="aksrt-wechat__status-info">
|
||||
<div class="aksrt-wechat__status-label">配置状态</div>
|
||||
<div class="aksrt-wechat__status-value">{{ status.configured ? '已配置' : '未配置' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aksrt-wechat__status-card">
|
||||
<div class="aksrt-wechat__status-icon" :class="status.has_token ? 'aksrt-wechat__status-icon--ok' : 'aksrt-wechat__status-icon--warn'">
|
||||
<i :class="status.has_token ? 'fa fas fa-key' : 'fa fas fa-key'"></i>
|
||||
</div>
|
||||
<div class="aksrt-wechat__status-info">
|
||||
<div class="aksrt-wechat__status-label">Access Token</div>
|
||||
<div class="aksrt-wechat__status-value">{{ status.has_token ? '已获取' : '未获取' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aksrt-wechat__status-card">
|
||||
<div class="aksrt-wechat__status-icon" :class="status.has_template ? 'aksrt-wechat__status-icon--ok' : 'aksrt-wechat__status-icon--warn'">
|
||||
<i :class="status.has_template ? 'fa fas fa-file-alt' : 'fa fas fa-file-alt'"></i>
|
||||
</div>
|
||||
<div class="aksrt-wechat__status-info">
|
||||
<div class="aksrt-wechat__status-label">模板 ID</div>
|
||||
<div class="aksrt-wechat__status-value">{{ status.has_template ? '已配置' : '未配置' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aksrt-wechat__status-card">
|
||||
<div class="aksrt-wechat__status-icon aksrt-wechat__status-icon--info">
|
||||
<i class="fa fas fa-users"></i>
|
||||
</div>
|
||||
<div class="aksrt-wechat__status-info">
|
||||
<div class="aksrt-wechat__status-label">绑定用户</div>
|
||||
<div class="aksrt-wechat__status-value">{{ status.bound_users || 0 }} 人</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<n-spin :show="loading" style="width: 100%; min-height: 240px">
|
||||
<n-alert v-if="loadError" type="error" class="wechat-notice">
|
||||
{{ loadError }}
|
||||
<template #action><n-button size="small" @click="load">重试</n-button></template>
|
||||
</n-alert>
|
||||
<template v-else>
|
||||
<n-alert :type="oauthReady ? 'info' : 'warning'" class="wechat-notice">
|
||||
<div>模板消息依赖已启用的微信公众号登录服务号,以及公众号的模板消息权限。</div>
|
||||
<div>只有绑定并关注该公众号的用户才能收到通知。当前账号:{{ currentUserBound ? '已绑定' : '未绑定' }};已绑定用户:{{ boundUsers }} 人。</div>
|
||||
<template #action>
|
||||
<router-link to="/users/oauth">公众号登录设置</router-link>
|
||||
</template>
|
||||
</n-alert>
|
||||
|
||||
<!-- 配置表单 -->
|
||||
<div class="aksrt-wechat__form-card">
|
||||
<h3>基本配置</h3>
|
||||
<div class="aksrt-form-group">
|
||||
<label>
|
||||
<input type="checkbox" v-model="form.enabled"> 启用微信模板消息
|
||||
</label>
|
||||
</div>
|
||||
<div class="aksrt-form-group">
|
||||
<label>AppID</label>
|
||||
<input v-model="form.app_id" type="text" class="aksrt-input" placeholder="微信公众号 AppID">
|
||||
</div>
|
||||
<div class="aksrt-form-group">
|
||||
<label>AppSecret</label>
|
||||
<input v-model="form.app_secret" type="password" class="aksrt-input" placeholder="微信公众号 AppSecret">
|
||||
<p class="aksrt-form-hint">保存后不会回显完整密钥</p>
|
||||
</div>
|
||||
<div class="aksrt-form-group">
|
||||
<label>模板 ID</label>
|
||||
<input v-model="form.template_id" type="text" class="aksrt-input" placeholder="微信模板消息模板 ID">
|
||||
</div>
|
||||
<div class="aksrt-form-actions">
|
||||
<button class="aksrt-button aksrt-button--primary" :disabled="saving" @click="saveSettings">
|
||||
{{ saving ? '保存中...' : '保存设置' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<section class="wechat-section">
|
||||
<div class="wechat-section__head">
|
||||
<h3>消息推送</h3>
|
||||
<n-switch v-model:value="form.enabled" :disabled="loading" aria-label="启用微信模板消息" />
|
||||
</div>
|
||||
<p class="wechat-muted">通过微信公众号将网站通知推送给绑定用户。配置模板后保存,测试会发送到当前管理员账号。</p>
|
||||
</section>
|
||||
|
||||
<!-- 通知类型 -->
|
||||
<div class="aksrt-wechat__form-card">
|
||||
<h3>支持的通知类型</h3>
|
||||
<p class="aksrt-form-hint">以下事件类型可触发微信模板消息推送(需用户绑定微信且开启对应订阅):</p>
|
||||
<table class="aksrt-table aksrt-table--sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>事件类型</th>
|
||||
<th>说明</th>
|
||||
<th>状态</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="evt in eventTypes" :key="evt.key">
|
||||
<td><code>{{ evt.key }}</code></td>
|
||||
<td>{{ evt.desc }}</td>
|
||||
<td>
|
||||
<span class="aksrt-badge" :class="evt.ready ? 'aksrt-badge--success' : 'aksrt-badge--warning'">
|
||||
{{ evt.ready ? '可用' : '待接入' }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<section v-for="group in groups" :key="group.name" class="wechat-section">
|
||||
<h3>{{ group.name }}</h3>
|
||||
<div v-for="type in group.types" :key="type.key" class="wechat-template">
|
||||
<div class="wechat-template__head">
|
||||
<div>
|
||||
<strong>{{ type.label }}</strong>
|
||||
<span class="wechat-template__key">{{ type.key }}</span>
|
||||
</div>
|
||||
<n-switch v-model:value="form.templates[type.key].enabled" :disabled="!form.enabled" :aria-label="`启用${type.label}`" />
|
||||
</div>
|
||||
<div v-if="form.enabled && form.templates[type.key].enabled" class="wechat-template__body">
|
||||
<label class="wechat-field">
|
||||
<span>模板 ID</span>
|
||||
<n-input v-model:value="form.templates[type.key].id" placeholder="公众号模板消息 ID" maxlength="128" clearable />
|
||||
</label>
|
||||
<div class="wechat-field">
|
||||
<span>模板参数</span>
|
||||
<div class="wechat-params">
|
||||
<label v-for="field in type.fields" :key="field.key" class="wechat-param">
|
||||
<span>{{ field.label }} <code>{{ field.key }}</code></span>
|
||||
<n-input v-model:value="form.templates[type.key].keys[field.key]" :placeholder="`留空使用 keyword${field.index}`" maxlength="64" clearable />
|
||||
</label>
|
||||
</div>
|
||||
<small>填写公众号模板中的参数名,例如 thing1、time2;留空时依次使用 keyword1、keyword2。</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="wechat-section wechat-test">
|
||||
<h3>发送测试</h3>
|
||||
<p class="wechat-muted">先保存配置,再选择已启用的模板。测试消息会发送到当前管理员绑定的公众号账号。</p>
|
||||
<div class="wechat-test__controls">
|
||||
<n-select v-model:value="testType" :options="testOptions" placeholder="选择需要测试的模板" :disabled="!testOptions.length" />
|
||||
<n-button type="primary" :loading="testing" :disabled="dirty || !testType || !currentUserBound || !oauthReady || !form.enabled" @click="sendTest">发送测试</n-button>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
</n-spin>
|
||||
<JioSaveBar :dirty="dirty" :saving="saving" @save="save" @reload="load" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import PageHeader from '@/components/PageHeader.vue';
|
||||
import api from '@/api';
|
||||
<script setup>
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import PageHeader from '@/components/PageHeader.vue'
|
||||
import JioSaveBar from '@/components/form/JioSaveBar.vue'
|
||||
import api from '@/api'
|
||||
|
||||
export default {
|
||||
name: 'UsersWechatTemplate',
|
||||
components: { PageHeader },
|
||||
setup() {
|
||||
const status = ref({
|
||||
enabled: false,
|
||||
configured: false,
|
||||
has_token: false,
|
||||
has_template: false,
|
||||
bound_users: 0,
|
||||
});
|
||||
const message = useMessage()
|
||||
const loading = ref(true)
|
||||
const saving = ref(false)
|
||||
const testing = ref(false)
|
||||
const loadError = ref('')
|
||||
const oauthReady = ref(false)
|
||||
const currentUserBound = ref(false)
|
||||
const boundUsers = ref(0)
|
||||
const definitions = ref({})
|
||||
const form = reactive({ enabled: false, templates: {} })
|
||||
const initial = ref('')
|
||||
const testType = ref(null)
|
||||
const snapshot = computed(() => JSON.stringify(form))
|
||||
const dirty = computed(() => !loading.value && initial.value !== '' && initial.value !== snapshot.value)
|
||||
|
||||
const form = reactive({
|
||||
enabled: false,
|
||||
app_id: '',
|
||||
app_secret: '',
|
||||
template_id: '',
|
||||
});
|
||||
const groups = computed(() => {
|
||||
const grouped = new Map()
|
||||
for (const [key, definition] of Object.entries(definitions.value)) {
|
||||
const name = definition.group || '其他'
|
||||
if (!grouped.has(name)) grouped.set(name, [])
|
||||
grouped.get(name).push({
|
||||
key,
|
||||
label: definition.label,
|
||||
fields: Object.entries(definition.fields || {}).map(([fieldKey, label], index) => ({ key: fieldKey, label, index: index + 1 })),
|
||||
})
|
||||
}
|
||||
return Array.from(grouped, ([name, types]) => ({ name, types }))
|
||||
})
|
||||
|
||||
const saving = ref(false);
|
||||
const testOptions = computed(() => Object.entries(definitions.value)
|
||||
.filter(([key]) => form.templates[key]?.enabled && form.templates[key]?.id)
|
||||
.map(([key, definition]) => ({ label: definition.label, value: key })))
|
||||
|
||||
// Event type definitions — readiness driven by backend allowed_types
|
||||
const eventTypeDefs = [
|
||||
{ key: 'comment_reply', desc: '评论回复通知' },
|
||||
{ key: 'system_notice', desc: '系统公告通知' },
|
||||
{ key: 'order_paid', desc: '订单支付通知' },
|
||||
{ key: 'credits_change', desc: '积分变动通知' },
|
||||
];
|
||||
|
||||
const allowedTypes = ref([]);
|
||||
|
||||
const eventTypes = computed(() =>
|
||||
eventTypeDefs.map(et => ({
|
||||
...et,
|
||||
ready: allowedTypes.value.length === 0 || allowedTypes.value.includes(et.key),
|
||||
}))
|
||||
);
|
||||
|
||||
async function loadStatus() {
|
||||
try {
|
||||
const json = await api.request('/wechat/status');
|
||||
if (json.success) {
|
||||
status.value = json.data;
|
||||
form.enabled = json.data.enabled || false;
|
||||
form.app_id = json.data.appid || '';
|
||||
form.app_secret = json.data.app_secret === '***' ? '' : '';
|
||||
form.template_id = json.data.template_id || '';
|
||||
// Use backend allowed_types for readiness (empty = all allowed)
|
||||
allowedTypes.value = json.data.allowed_types || [];
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Load WeChat status failed:', e);
|
||||
}
|
||||
async function load() {
|
||||
loading.value = true
|
||||
loadError.value = ''
|
||||
try {
|
||||
const response = await api.request('/wechat/status')
|
||||
const data = response.data || {}
|
||||
definitions.value = data.types || {}
|
||||
form.enabled = Boolean(data.config?.enabled)
|
||||
form.templates = structuredClone(data.config?.templates || {})
|
||||
oauthReady.value = Boolean(data.oauth_ready)
|
||||
currentUserBound.value = Boolean(data.current_user_bound)
|
||||
boundUsers.value = Number(data.bound_users || 0)
|
||||
if (!testOptions.value.some(option => option.value === testType.value)) {
|
||||
testType.value = testOptions.value[0]?.value || null
|
||||
}
|
||||
initial.value = snapshot.value
|
||||
} catch (error) {
|
||||
loadError.value = error.message || '加载微信模板消息设置失败'
|
||||
message.error(loadError.value)
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function saveSettings() {
|
||||
saving.value = true;
|
||||
try {
|
||||
const payload = { ...form };
|
||||
// 如果密码为空且状态显示已配置,发送掩码保留原值
|
||||
if (!payload.app_secret && status.value.configured) {
|
||||
payload.app_secret = '***';
|
||||
}
|
||||
const json = await api.request('/wechat/settings', {
|
||||
method: 'POST',
|
||||
data: payload,
|
||||
});
|
||||
if (json.success) {
|
||||
alert('设置已保存');
|
||||
loadStatus();
|
||||
} else {
|
||||
alert(json.message || '保存失败');
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Save failed:', e);
|
||||
alert('保存失败: ' + (e.message || '未知错误'));
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
async function save() {
|
||||
saving.value = true
|
||||
try {
|
||||
const response = await api.request('/wechat/settings', { method: 'POST', data: JSON.parse(snapshot.value) })
|
||||
const config = response.data || {}
|
||||
form.enabled = Boolean(config.enabled)
|
||||
form.templates = structuredClone(config.templates || {})
|
||||
if (!testOptions.value.some(option => option.value === testType.value)) {
|
||||
testType.value = testOptions.value[0]?.value || null
|
||||
}
|
||||
initial.value = snapshot.value
|
||||
message.success('微信模板消息设置已保存')
|
||||
} catch (error) {
|
||||
message.error(error.message || '保存失败')
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => loadStatus());
|
||||
async function sendTest() {
|
||||
testing.value = true
|
||||
try {
|
||||
await api.request('/wechat/test', { method: 'POST', data: { type: testType.value } })
|
||||
message.success('测试消息已发送')
|
||||
} catch (error) {
|
||||
message.error(error.message || '测试发送失败')
|
||||
} finally {
|
||||
testing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
return { status, form, saving, eventTypes, saveSettings };
|
||||
},
|
||||
};
|
||||
onMounted(load)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-wechat__status {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 16px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.aksrt-wechat__status-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e8e8e8;
|
||||
}
|
||||
.aksrt-wechat__status-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
.aksrt-wechat__status-icon--ok {
|
||||
background: #d4edda;
|
||||
color: #155724;
|
||||
}
|
||||
.aksrt-wechat__status-icon--warn {
|
||||
background: #fff3cd;
|
||||
color: #856404;
|
||||
}
|
||||
.aksrt-wechat__status-icon--info {
|
||||
background: #d1ecf1;
|
||||
color: #0c5460;
|
||||
}
|
||||
.aksrt-wechat__status-value {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: var(--aksrt-color-text);
|
||||
}
|
||||
.aksrt-wechat__status-label {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
}
|
||||
.aksrt-wechat__form-card {
|
||||
background: #fff;
|
||||
border: 1px solid #e8e8e8;
|
||||
border-radius: 8px;
|
||||
padding: 24px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.aksrt-wechat__form-card h3 {
|
||||
margin: 0 0 16px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.aksrt-form-hint {
|
||||
font-size: 12px;
|
||||
color: #888;
|
||||
margin-top: 4px;
|
||||
.wechat-notice { margin-bottom: 20px; }
|
||||
.wechat-section { border-top: 1px solid #e6e9ed; padding: 20px 0; }
|
||||
.wechat-section h3 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
|
||||
.wechat-section__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
|
||||
.wechat-section__head h3 { margin: 0; }
|
||||
.wechat-muted { margin: 8px 0 0; color: #64707d; font-size: 13px; line-height: 1.6; }
|
||||
.wechat-template { border-bottom: 1px solid #edf0f2; padding: 14px 0; }
|
||||
.wechat-template:last-child { border-bottom: 0; }
|
||||
.wechat-template__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; }
|
||||
.wechat-template__head strong { font-size: 14px; font-weight: 600; }
|
||||
.wechat-template__key { display: block; color: #7b8590; font-size: 11px; margin-top: 3px; }
|
||||
.wechat-template__body { display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: 24px; padding: 16px 0 4px; }
|
||||
.wechat-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; font-size: 13px; }
|
||||
.wechat-field > span { font-weight: 600; }
|
||||
.wechat-field small { color: #64707d; line-height: 1.5; }
|
||||
.wechat-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
|
||||
.wechat-param { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
|
||||
.wechat-param span { color: #4c5966; font-size: 12px; }
|
||||
.wechat-param code { color: #7b8590; font-size: 11px; }
|
||||
.wechat-test__controls { display: flex; gap: 10px; margin-top: 14px; max-width: 520px; }
|
||||
.wechat-test__controls :deep(.n-select) { flex: 1; min-width: 0; }
|
||||
@media (max-width: 780px) {
|
||||
.wechat-template__body { grid-template-columns: 1fr; gap: 16px; }
|
||||
.wechat-test__controls { flex-wrap: wrap; }
|
||||
.wechat-test__controls :deep(.n-select) { flex-basis: 100%; }
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head" v-bind="headAttrs">
|
||||
<JioSortHandle @click.stop />
|
||||
<span class="jio-sortable__index">{{ index + 1 }}</span>
|
||||
<div class="jio-sortable__main">
|
||||
<div class="jio-sortable__title-row">
|
||||
<span class="jio-sortable__title">{{ category.cat_name || '未命名分类' }}</span>
|
||||
<n-tag size="small" :bordered="false">{{ category.items.length }} 枚</n-tag>
|
||||
</div>
|
||||
<span class="jio-sortable__desc">{{ previewNames || '该分类暂无条目' }}</span>
|
||||
</div>
|
||||
<div class="jio-sortable__actions">
|
||||
<n-popconfirm @positive-click="emit('remove')">
|
||||
<template #trigger>
|
||||
<n-button size="tiny" quaternary type="error" title="删除分类" @click.stop>
|
||||
<i class="fa fas fa-trash-alt" aria-hidden="true" />
|
||||
</n-button>
|
||||
</template>
|
||||
删除分类「{{ category.cat_name || '未命名分类' }}」及其全部条目?
|
||||
</n-popconfirm>
|
||||
</div>
|
||||
<i class="fa fas jio-sortable__toggle" :class="open ? 'fa-chevron-down' : 'fa-chevron-right'" aria-hidden="true" />
|
||||
</div>
|
||||
|
||||
<div v-if="open" class="jio-sortable__body">
|
||||
<n-form label-placement="left" label-width="96" class="jio-form">
|
||||
<n-form-item label="分类名称">
|
||||
<n-input v-model:value="category.cat_name" placeholder="如:成长" style="max-width: 320px;" />
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
|
||||
<div v-if="!category.items.length" class="jio-sortable__empty">
|
||||
<i class="fa fas fa-medal" aria-hidden="true" />
|
||||
<span>该分类暂无条目</span>
|
||||
</div>
|
||||
<draggable
|
||||
v-else
|
||||
v-model="category.items"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
:item-key="rowKey"
|
||||
class="jio-sortable jio-sortable--compact"
|
||||
>
|
||||
<template #item="{ element, index: ii }">
|
||||
<MedalItemCard
|
||||
:item="element"
|
||||
:open="items.isOpen(rowKey(element))"
|
||||
:head-attrs="items.headAttrs(rowKey(element))"
|
||||
@remove="category.items.splice(ii, 1)"
|
||||
/>
|
||||
</template>
|
||||
</draggable>
|
||||
|
||||
<n-button class="medal-category-card__add" size="small" dashed block @click="addItem">
|
||||
<i class="fa fas fa-plus" aria-hidden="true" /> 添加条目
|
||||
</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 徽章分类卡片:行头显示条目数与名称预览,展开后编辑分类名并拖拽排序条目。 */
|
||||
import { computed } from 'vue'
|
||||
import draggable from 'vuedraggable'
|
||||
import JioSortHandle from '@/components/form/JioSortHandle.vue'
|
||||
import { SORTABLE_LIST_ATTRS } from '@/components/form/sortable-options.js'
|
||||
import { useCollapsibleItems } from '@/components/form/useCollapsibleItems.js'
|
||||
import { emptyItem, rowKey } from './badge-model.js'
|
||||
import MedalItemCard from './MedalItemCard.vue'
|
||||
|
||||
const props = defineProps({
|
||||
category: { type: Object, required: true },
|
||||
index: { type: Number, required: true },
|
||||
open: { type: Boolean, default: false },
|
||||
headAttrs: { type: Object, required: true },
|
||||
})
|
||||
const emit = defineEmits(['remove'])
|
||||
|
||||
const items = useCollapsibleItems()
|
||||
|
||||
const previewNames = computed(() =>
|
||||
props.category.items.map((it) => it.name || it.slug).filter(Boolean).slice(0, 4).join('、'),
|
||||
)
|
||||
|
||||
function addItem() {
|
||||
const item = emptyItem()
|
||||
props.category.items.push(item)
|
||||
// 新条目直接展开,方便立即填写。
|
||||
items.toggle(rowKey(props.category.items[props.category.items.length - 1]))
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.medal-category-card__add {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="medal-icon-picker">
|
||||
<div class="medal-icon-picker__presets" role="listbox" aria-label="预设勋章图标">
|
||||
<button
|
||||
v-for="(src, i) in MEDAL_PRESET_ICONS"
|
||||
:key="src"
|
||||
type="button"
|
||||
role="option"
|
||||
class="medal-icon-picker__preset"
|
||||
:class="{ 'is-active': src === modelValue }"
|
||||
:aria-selected="src === modelValue ? 'true' : 'false'"
|
||||
:title="`预设图标 ${i + 1}`"
|
||||
@click="emit('update:modelValue', src)"
|
||||
>
|
||||
<img :src="src" :alt="`预设图标 ${i + 1}`" />
|
||||
</button>
|
||||
</div>
|
||||
<JioMediaField
|
||||
:model-value="modelValue"
|
||||
placeholder="或从媒体库选择自定义图标"
|
||||
@update:model-value="emit('update:modelValue', $event)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 勋章图标选择:主题预设 SVG 一键选用,或走媒体库 / 直接填 URL。 */
|
||||
import JioMediaField from '@/components/form/JioMediaField.vue'
|
||||
import { MEDAL_PRESET_ICONS } from '@/schema/sections/users/badge.js'
|
||||
|
||||
defineProps({
|
||||
modelValue: { type: String, default: '' },
|
||||
})
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.medal-icon-picker {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.medal-icon-picker__presets {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
|
||||
gap: 6px;
|
||||
max-width: 520px;
|
||||
}
|
||||
|
||||
.medal-icon-picker__preset {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 36px;
|
||||
padding: 0;
|
||||
border: 1px solid var(--jio-color-border, #E2E8E3);
|
||||
border-radius: 8px;
|
||||
background: var(--jio-color-surface, #fff);
|
||||
cursor: pointer;
|
||||
transition: border-color .15s ease, background-color .15s ease;
|
||||
}
|
||||
|
||||
.medal-icon-picker__preset img {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.medal-icon-picker__preset:hover,
|
||||
.medal-icon-picker__preset:focus-visible {
|
||||
border-color: var(--jio-color-primary, #18A058);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.medal-icon-picker__preset.is-active {
|
||||
border-color: var(--jio-color-primary, #18A058);
|
||||
background: var(--jio-color-primary-soft, #EAF7EF);
|
||||
box-shadow: 0 0 0 1px var(--jio-color-primary, #18A058);
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head" v-bind="headAttrs">
|
||||
<JioSortHandle @click.stop />
|
||||
<span class="jio-sortable__icon">
|
||||
<img v-if="item.icon" :src="item.icon" alt="" />
|
||||
<i v-else class="fa fas fa-medal" aria-hidden="true" />
|
||||
</span>
|
||||
<div class="jio-sortable__main">
|
||||
<div class="jio-sortable__title-row">
|
||||
<span class="jio-sortable__title">{{ item.name || '未命名徽章' }}</span>
|
||||
<n-tag size="small" :bordered="false" :type="item.get_type === 'manually_add' ? 'default' : 'info'">
|
||||
{{ conditionSummary(item) }}
|
||||
</n-tag>
|
||||
<n-tag v-if="!item.slug" size="small" type="warning" :bordered="false">缺少 slug</n-tag>
|
||||
</div>
|
||||
<span class="jio-sortable__desc">{{ item.slug || '—' }}{{ item.desc ? ` · ${item.desc}` : '' }}</span>
|
||||
</div>
|
||||
<div class="jio-sortable__actions">
|
||||
<n-button size="tiny" quaternary type="error" title="删除条目" @click.stop="emit('remove')">
|
||||
<i class="fa fas fa-trash-alt" aria-hidden="true" />
|
||||
</n-button>
|
||||
</div>
|
||||
<i class="fa fas jio-sortable__toggle" :class="open ? 'fa-chevron-down' : 'fa-chevron-right'" aria-hidden="true" />
|
||||
</div>
|
||||
|
||||
<div v-if="open" class="jio-sortable__body">
|
||||
<n-form label-placement="left" label-width="96" class="jio-form medal-item-card__form">
|
||||
<n-grid cols="1 m:2" :x-gap="16" responsive="screen">
|
||||
<n-form-item-gi label="名称">
|
||||
<n-input v-model:value="item.name" placeholder="如:签到达人" />
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi label="slug">
|
||||
<n-input v-model:value="item.slug" placeholder="唯一标识,如 checkin-30" />
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi label="获取条件">
|
||||
<n-select v-model:value="item.get_type" :options="MEDAL_GET_TYPES" />
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi label="达成阈值">
|
||||
<n-input-number
|
||||
v-model:value="item.get_val"
|
||||
:min="0"
|
||||
:disabled="item.get_type === 'manually_add'"
|
||||
:placeholder="item.get_type === 'manually_add' ? '手动授予无需阈值' : '达到该数值自动授予'"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi :span="2" label="描述">
|
||||
<n-input v-model:value="item.desc" placeholder="前台展示的获取说明" />
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi :span="2" label="图标">
|
||||
<MedalIconPicker v-model="item.icon" />
|
||||
</n-form-item-gi>
|
||||
</n-grid>
|
||||
</n-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
/** 徽章条目卡片:行头摘要(图标 / 名称 / 条件),展开后编辑字段。条目对象由父级直接持有并原地修改。 */
|
||||
import JioSortHandle from '@/components/form/JioSortHandle.vue'
|
||||
import { MEDAL_GET_TYPES } from '@/schema/sections/users/badge.js'
|
||||
import { conditionSummary } from './badge-model.js'
|
||||
import MedalIconPicker from './MedalIconPicker.vue'
|
||||
|
||||
defineProps({
|
||||
item: { type: Object, required: true },
|
||||
open: { type: Boolean, default: false },
|
||||
headAttrs: { type: Object, required: true },
|
||||
})
|
||||
const emit = defineEmits(['remove'])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.medal-item-card__form :deep(.n-form-item) {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 用户徽章编辑页的数据模型:空条目、规范化与拖拽用的稳定行 key。
|
||||
*/
|
||||
import { MEDAL_GET_TYPES, defaultMedalArgs } from '@/schema/sections/users/badge.js'
|
||||
|
||||
const GET_TYPE_LABELS = Object.fromEntries(MEDAL_GET_TYPES.map((t) => [t.value, t.label]))
|
||||
|
||||
export function getTypeLabel(type) {
|
||||
return GET_TYPE_LABELS[type] || '未设置条件'
|
||||
}
|
||||
|
||||
export function conditionSummary(item) {
|
||||
if (!item.get_type) return '未设置条件'
|
||||
if (item.get_type === 'manually_add') return getTypeLabel(item.get_type)
|
||||
return `${getTypeLabel(item.get_type)} ≥ ${Number(item.get_val || 0)}`
|
||||
}
|
||||
|
||||
export function emptyItem() {
|
||||
return { slug: '', name: '', desc: '', icon: '', get_type: 'manually_add', get_val: 0 }
|
||||
}
|
||||
|
||||
export function emptyCategory() {
|
||||
return { cat_name: '新分类', items: [emptyItem()] }
|
||||
}
|
||||
|
||||
export function normalizeArgs(raw) {
|
||||
if (!Array.isArray(raw)) return defaultMedalArgs()
|
||||
return raw.map((cat) => ({
|
||||
cat_name: String(cat?.cat_name || '').trim() || '未命名',
|
||||
items: Array.isArray(cat?.items)
|
||||
? cat.items.map((it) => ({
|
||||
slug: String(it?.slug || '').trim(),
|
||||
name: String(it?.name || '').trim(),
|
||||
desc: String(it?.desc || '').trim(),
|
||||
icon: String(it?.icon || '').trim(),
|
||||
get_type: String(it?.get_type || 'manually_add').trim() || 'manually_add',
|
||||
get_val: Math.max(0, Number(it?.get_val ?? 0) || 0),
|
||||
}))
|
||||
: [],
|
||||
}))
|
||||
}
|
||||
|
||||
/** 首个不完整条目的位置描述;全部完整时返回空字符串。 */
|
||||
export function findInvalidItem(args) {
|
||||
const slugs = new Set()
|
||||
for (const cat of args) {
|
||||
for (const it of cat.items) {
|
||||
const where = `「${cat.cat_name}」中的条目「${it.name || it.slug || '未命名'}」`
|
||||
if (!it.slug || !it.name || !it.get_type) return `${where}缺少 slug、名称或获取条件`
|
||||
if (slugs.has(it.slug)) return `${where}的 slug「${it.slug}」重复`
|
||||
slugs.add(it.slug)
|
||||
}
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
// 对象 → 稳定 key:拖拽换位后展开状态与 DOM 跟随对象本身。
|
||||
const rowKeys = new WeakMap()
|
||||
let rowSeq = 0
|
||||
export function rowKey(obj) {
|
||||
if (!rowKeys.has(obj)) rowKeys.set(obj, `row-${++rowSeq}`)
|
||||
return rowKeys.get(obj)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>预设回复</h3>
|
||||
<n-space>
|
||||
<n-button size="small" :disabled="saving || !reorderable" :loading="savingOrder" @click="saveOrder">
|
||||
@@ -19,20 +19,23 @@
|
||||
<draggable
|
||||
v-else
|
||||
v-model="rows"
|
||||
v-bind="SORTABLE_LIST_ATTRS"
|
||||
item-key="id"
|
||||
handle=".aksrt-ticket-prereply__handle"
|
||||
:animation="160"
|
||||
class="aksrt-ticket-prereply"
|
||||
class="jio-sortable"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<div class="aksrt-ticket-prereply__row">
|
||||
<span class="aksrt-ticket-prereply__handle" title="拖动排序">⋮⋮</span>
|
||||
<span class="aksrt-ticket-prereply__index">{{ index + 1 }}</span>
|
||||
<span class="aksrt-ticket-prereply__content">{{ element.content }}</span>
|
||||
<n-space size="small">
|
||||
<n-button size="tiny" type="primary" quaternary @click="openEdit(element)">编辑</n-button>
|
||||
<n-button size="tiny" type="error" quaternary @click="handleDelete(element)">删除</n-button>
|
||||
</n-space>
|
||||
<div class="jio-sortable__item">
|
||||
<div class="jio-sortable__head">
|
||||
<JioSortHandle />
|
||||
<span class="jio-sortable__index">{{ index + 1 }}</span>
|
||||
<div class="jio-sortable__main">
|
||||
<span class="jio-ticket-prereply__content">{{ element.content }}</span>
|
||||
</div>
|
||||
<div class="jio-sortable__actions">
|
||||
<n-button size="tiny" type="primary" quaternary @click="openEdit(element)">编辑</n-button>
|
||||
<n-button size="tiny" type="error" quaternary @click="handleDelete(element)">删除</n-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</draggable>
|
||||
@@ -71,6 +74,8 @@ import { computed, onMounted, ref } from 'vue'
|
||||
import { NButton, NSpace, useDialog, useMessage } from 'naive-ui'
|
||||
import draggable from 'vuedraggable'
|
||||
import api from '@/api'
|
||||
import JioSortHandle from '@/components/form/JioSortHandle.vue'
|
||||
import { SORTABLE_LIST_ATTRS } from '@/components/form/sortable-options.js'
|
||||
|
||||
const message = useMessage()
|
||||
const dialog = useDialog()
|
||||
@@ -188,38 +193,11 @@ defineExpose({ reload: load })
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.aksrt-ticket-prereply {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.aksrt-ticket-prereply__row {
|
||||
display: grid;
|
||||
grid-template-columns: 20px 28px 1fr auto;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 10px 12px;
|
||||
border: 1px var(--n-border-color, #efeff5) solid;
|
||||
border-radius: 8px;
|
||||
background: var(--n-color, #fff);
|
||||
}
|
||||
|
||||
.aksrt-ticket-prereply__handle {
|
||||
color: var(--aksrt-color-muted);
|
||||
cursor: grab;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.aksrt-ticket-prereply__index {
|
||||
color: var(--aksrt-color-muted);
|
||||
font-size: 12px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.aksrt-ticket-prereply__content {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
.jio-ticket-prereply__content {
|
||||
color: var(--jio-color-text, #1F2923);
|
||||
font-size: 13px;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<n-card class="aksrt-section-card aksrt-ticket-status-panel">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card jio-ticket-status-panel">
|
||||
<div class="jio-section-header">
|
||||
<h3>工单状态</h3>
|
||||
<n-button size="small" type="primary" :disabled="saving" @click="openCreate">新增状态</n-button>
|
||||
</div>
|
||||
@@ -24,13 +24,13 @@
|
||||
v-model:show="visible"
|
||||
:title="editing ? '编辑状态' : '新增状态'"
|
||||
preset="card"
|
||||
class="aksrt-status-modal"
|
||||
class="jio-status-modal"
|
||||
style="width: 460px; max-width: 92vw;"
|
||||
:mask-closable="false"
|
||||
>
|
||||
<div class="aksrt-status-preview" aria-live="polite">
|
||||
<span class="aksrt-status-preview__label">预览</span>
|
||||
<span class="aksrt-ticket-badge" :style="{ '--aksrt-ticket-color': previewColor }">
|
||||
<div class="jio-status-preview" aria-live="polite">
|
||||
<span class="jio-status-preview__label">预览</span>
|
||||
<span class="jio-ticket-badge" :style="{ '--jio-ticket-color': previewColor }">
|
||||
{{ form.name.trim() || '状态名称' }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -39,15 +39,31 @@
|
||||
<n-form-item label="状态名称" path="name">
|
||||
<n-input v-model:value="form.name" placeholder="如:处理中" maxlength="60" show-count />
|
||||
</n-form-item>
|
||||
<n-form-item label="标识" path="status_key">
|
||||
<div class="jio-status-key">
|
||||
<n-input
|
||||
v-model:value="form.status_key"
|
||||
class="jio-status-key__input"
|
||||
:placeholder="editing ? '' : '留空则按名称自动生成'"
|
||||
maxlength="24"
|
||||
show-count
|
||||
:input-props="{ autocomplete: 'off', spellcheck: false }"
|
||||
@blur="form.status_key = normalizeKey(form.status_key)"
|
||||
/>
|
||||
<span class="jio-ticket-status__hint">
|
||||
小写字母开头,仅含小写字母、数字与下划线(2–24 位)。修改后,使用该状态的工单会同步改为新标识。
|
||||
</span>
|
||||
</div>
|
||||
</n-form-item>
|
||||
<n-form-item label="状态颜色" path="color">
|
||||
<div class="aksrt-status-color">
|
||||
<div class="aksrt-status-color__swatches" role="radiogroup" aria-label="状态颜色">
|
||||
<div class="jio-status-color">
|
||||
<div class="jio-status-color__swatches" role="radiogroup" aria-label="状态颜色">
|
||||
<button
|
||||
v-for="swatch in SWATCHES"
|
||||
:key="swatch"
|
||||
type="button"
|
||||
role="radio"
|
||||
class="aksrt-status-color__swatch"
|
||||
class="jio-status-color__swatch"
|
||||
:class="{ 'is-active': currentHex === swatch }"
|
||||
:style="{ '--swatch': swatch }"
|
||||
:aria-checked="currentHex === swatch"
|
||||
@@ -56,18 +72,16 @@
|
||||
@click="form.color = swatch"
|
||||
/>
|
||||
<!-- 自定义色:未选中时显示色环,选中后显示当前色并带选中环。 -->
|
||||
<n-color-picker
|
||||
:value="previewColor"
|
||||
:modes="['hex']"
|
||||
:show-alpha="false"
|
||||
@update:value="setColor"
|
||||
<JioColorPicker
|
||||
:model-value="previewColor"
|
||||
@update:model-value="setColor"
|
||||
>
|
||||
<template #trigger="{ onClick, ref: setTriggerRef }">
|
||||
<button
|
||||
:ref="setTriggerRef"
|
||||
type="button"
|
||||
role="radio"
|
||||
class="aksrt-status-color__swatch aksrt-status-color__swatch--custom"
|
||||
class="jio-status-color__swatch jio-status-color__swatch--custom"
|
||||
:class="{ 'is-active': isCustomColor }"
|
||||
:style="{ '--swatch': previewColor }"
|
||||
:aria-checked="isCustomColor"
|
||||
@@ -76,25 +90,25 @@
|
||||
@click="onClick"
|
||||
/>
|
||||
</template>
|
||||
</n-color-picker>
|
||||
</JioColorPicker>
|
||||
</div>
|
||||
<n-input
|
||||
v-model:value="form.color"
|
||||
class="aksrt-status-color__hex"
|
||||
class="jio-status-color__hex"
|
||||
maxlength="7"
|
||||
placeholder="#6b7280"
|
||||
@blur="form.color = toHex(form.color) || form.color.trim()"
|
||||
>
|
||||
<template #prefix>
|
||||
<i class="aksrt-status-color__chip" :style="{ background: previewColor }" />
|
||||
<i class="jio-status-color__chip" :style="{ background: previewColor }" />
|
||||
</template>
|
||||
</n-input>
|
||||
</div>
|
||||
</n-form-item>
|
||||
<n-form-item label="完结状态" path="is_closed" :show-feedback="false">
|
||||
<div class="aksrt-status-closed">
|
||||
<div class="jio-status-closed">
|
||||
<n-switch v-model:value="form.is_closed" />
|
||||
<span class="aksrt-ticket-status__hint">开启后该状态视为终态,工单不可再流转</span>
|
||||
<span class="jio-ticket-status__hint">开启后该状态视为终态,工单不可再流转</span>
|
||||
</div>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
@@ -112,6 +126,8 @@
|
||||
import { computed, h, onMounted, ref } from 'vue'
|
||||
import { NButton, NSpace, useDialog, useMessage } from 'naive-ui'
|
||||
import api from '@/api'
|
||||
import JioColorPicker from '@/components/form/JioColorPicker.vue'
|
||||
import { toHex } from '@/utils/color.js'
|
||||
|
||||
const message = useMessage()
|
||||
const dialog = useDialog()
|
||||
@@ -130,18 +146,14 @@ const editing = ref(null)
|
||||
const rows = ref([])
|
||||
|
||||
const DEFAULT_COLOR = '#6b7280'
|
||||
const HEX_RE = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i
|
||||
|
||||
const form = ref({ name: '', color: DEFAULT_COLOR, is_closed: false })
|
||||
/** 与 TicketStatusService::KEY_PATTERN 保持一致。 */
|
||||
const KEY_RE = /^[a-z][a-z0-9_]{1,23}$/
|
||||
|
||||
/**
|
||||
* 归一化为 TicketStatusService::sanitize_color() 接受的小写 #rgb / #rrggbb;
|
||||
* 允许省略 #。非法值返回空串。
|
||||
*/
|
||||
function toHex(value) {
|
||||
let hex = String(value || '').trim().toLowerCase()
|
||||
if (hex && !hex.startsWith('#')) hex = `#${hex}`
|
||||
return HEX_RE.test(hex) ? hex : ''
|
||||
const form = ref({ name: '', status_key: '', color: DEFAULT_COLOR, is_closed: false })
|
||||
|
||||
function normalizeKey(value) {
|
||||
return String(value || '').trim().toLowerCase()
|
||||
}
|
||||
|
||||
const rules = {
|
||||
@@ -149,6 +161,26 @@ const rules = {
|
||||
{ required: true, message: '请填写状态名称', trigger: 'blur' },
|
||||
{ max: 60, message: '状态名称不能超过 60 字', trigger: 'blur' },
|
||||
],
|
||||
status_key: [
|
||||
{
|
||||
// 新增时可留空(后端按名称生成);编辑时必须填写。
|
||||
validator: (_rule, value) => {
|
||||
const key = normalizeKey(value)
|
||||
if (key === '') return !editing.value
|
||||
return KEY_RE.test(key)
|
||||
},
|
||||
message: '标识需以小写字母开头,仅含小写字母、数字与下划线,长度 2–24 位',
|
||||
trigger: ['blur', 'input'],
|
||||
},
|
||||
{
|
||||
validator: (_rule, value) => {
|
||||
const key = normalizeKey(value)
|
||||
return key === '' || !rows.value.some((row) => row.status_key === key && row.id !== editing.value?.id)
|
||||
},
|
||||
message: '该标识已被其他状态使用',
|
||||
trigger: ['blur', 'input'],
|
||||
},
|
||||
],
|
||||
color: [
|
||||
{
|
||||
validator: (_rule, value) => toHex(value) !== '',
|
||||
@@ -162,10 +194,7 @@ const currentHex = computed(() => toHex(form.value.color))
|
||||
const previewColor = computed(() => currentHex.value || DEFAULT_COLOR)
|
||||
const isCustomColor = computed(() => currentHex.value !== '' && !SWATCHES.includes(currentHex.value))
|
||||
|
||||
/**
|
||||
* 取色器已关闭 alpha(默认开启时回传 #rrggbbaa,会被后端回落成灰色),
|
||||
* 这里仍只接受合法十六进制,其余忽略。
|
||||
*/
|
||||
/** JioColorPicker 已归一化为 hex;清空(空串)时保留当前色。 */
|
||||
function setColor(value) {
|
||||
const hex = toHex(value)
|
||||
if (hex) form.value.color = hex
|
||||
@@ -179,15 +208,15 @@ const columns = computed(() => [
|
||||
minWidth: 160,
|
||||
// 注意:原生元素用 h('span', ...) 时,文本必须作为 children 直接传入;
|
||||
// 写成 () => row.name 的插槽函数对原生元素不生效,单元格会是空的。
|
||||
render: (row) => h('span', { class: 'aksrt-ticket-badge', style: { '--aksrt-ticket-color': row.color } }, row.name),
|
||||
render: (row) => h('span', { class: 'jio-ticket-badge', style: { '--jio-ticket-color': row.color } }, row.name),
|
||||
},
|
||||
{
|
||||
title: '颜色',
|
||||
key: 'color',
|
||||
width: 140,
|
||||
render: (row) => h('span', { class: 'aksrt-ticket-color-cell' }, [
|
||||
h('i', { class: 'aksrt-ticket-color-dot', style: { background: row.color } }),
|
||||
h('span', { class: 'aksrt-ticket-color-value' }, row.color),
|
||||
render: (row) => h('span', { class: 'jio-ticket-color-cell' }, [
|
||||
h('i', { class: 'jio-ticket-color-dot', style: { background: row.color } }),
|
||||
h('span', { class: 'jio-ticket-color-value' }, row.color),
|
||||
]),
|
||||
},
|
||||
{
|
||||
@@ -206,7 +235,7 @@ const columns = computed(() => [
|
||||
title: '标识',
|
||||
key: 'status_key',
|
||||
minWidth: 140,
|
||||
render: (row) => h('span', { class: 'aksrt-ticket-key' }, row.status_key),
|
||||
render: (row) => h('span', { class: 'jio-ticket-key' }, row.status_key),
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -245,7 +274,7 @@ async function load() {
|
||||
|
||||
function openCreate() {
|
||||
editing.value = null
|
||||
form.value = { name: '', color: DEFAULT_COLOR, is_closed: false }
|
||||
form.value = { name: '', status_key: '', color: DEFAULT_COLOR, is_closed: false }
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
@@ -253,6 +282,7 @@ function openEdit(row) {
|
||||
editing.value = row
|
||||
form.value = {
|
||||
name: String(row.name || ''),
|
||||
status_key: String(row.status_key || ''),
|
||||
color: toHex(row.color) || DEFAULT_COLOR,
|
||||
is_closed: !!row.is_closed,
|
||||
}
|
||||
@@ -269,6 +299,7 @@ async function handleSubmit() {
|
||||
try {
|
||||
const payload = {
|
||||
name: form.value.name.trim(),
|
||||
status_key: normalizeKey(form.value.status_key),
|
||||
color: currentHex.value,
|
||||
is_closed: form.value.is_closed ? 1 : 0,
|
||||
}
|
||||
@@ -317,13 +348,13 @@ defineExpose({ reload: load })
|
||||
(此前色块 <i> 因此没有尺寸,颜色列只剩色值文本。)
|
||||
-->
|
||||
<style>
|
||||
.aksrt-ticket-status-panel .aksrt-ticket-color-cell {
|
||||
.jio-ticket-status-panel .jio-ticket-color-cell {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.aksrt-ticket-status-panel .aksrt-ticket-color-dot {
|
||||
.jio-ticket-status-panel .jio-ticket-color-dot {
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
@@ -332,21 +363,21 @@ defineExpose({ reload: load })
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.aksrt-ticket-status-panel .aksrt-ticket-color-value,
|
||||
.aksrt-ticket-status-panel .aksrt-ticket-key {
|
||||
.jio-ticket-status-panel .jio-ticket-color-value,
|
||||
.jio-ticket-status-panel .jio-ticket-key {
|
||||
font-family: var(--n-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
||||
font-size: 12px;
|
||||
color: var(--aksrt-color-muted);
|
||||
color: var(--jio-color-muted);
|
||||
}
|
||||
|
||||
/* 徽章与前台 assets/css/routes/tickets.css 的 .aksrt-ticket-badge 同构;表格与弹窗预览共用。 */
|
||||
.aksrt-ticket-status-panel .aksrt-ticket-badge,
|
||||
.aksrt-status-modal .aksrt-ticket-badge {
|
||||
/* 徽章与前台 assets/css/routes/tickets.css 的 .jio-ticket-badge 同构;表格与弹窗预览共用。 */
|
||||
.jio-ticket-status-panel .jio-ticket-badge,
|
||||
.jio-status-modal .jio-ticket-badge {
|
||||
display: inline-block;
|
||||
padding: 2px 10px;
|
||||
border-radius: 999px;
|
||||
background: color-mix(in srgb, var(--aksrt-ticket-color, #6b7280) 16%, transparent);
|
||||
color: var(--aksrt-ticket-color, #6b7280);
|
||||
background: color-mix(in srgb, var(--jio-ticket-color, #6b7280) 16%, transparent);
|
||||
color: var(--jio-ticket-color, #6b7280);
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
line-height: 1.6;
|
||||
@@ -356,24 +387,24 @@ defineExpose({ reload: load })
|
||||
|
||||
<style scoped>
|
||||
/* —— 弹窗:顶部实时预览 —— */
|
||||
.aksrt-status-preview {
|
||||
.jio-status-preview {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 18px;
|
||||
padding: 14px 16px;
|
||||
border: 1px dashed var(--aksrt-color-border);
|
||||
border: 1px dashed var(--jio-color-border);
|
||||
border-radius: 8px;
|
||||
background: rgba(0, 0, 0, 0.02);
|
||||
}
|
||||
|
||||
.aksrt-status-preview__label {
|
||||
color: var(--aksrt-color-muted);
|
||||
.jio-status-preview__label {
|
||||
color: var(--jio-color-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.aksrt-status-preview .aksrt-ticket-badge {
|
||||
.jio-status-preview .jio-ticket-badge {
|
||||
max-width: 70%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -381,20 +412,20 @@ defineExpose({ reload: load })
|
||||
}
|
||||
|
||||
/* —— 弹窗:颜色选择(预设色板 + 自定义 + 十六进制输入) —— */
|
||||
.aksrt-status-color {
|
||||
.jio-status-color {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.aksrt-status-color__swatches {
|
||||
.jio-status-color__swatches {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aksrt-status-color__swatch {
|
||||
.jio-status-color__swatch {
|
||||
position: relative;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
@@ -407,21 +438,21 @@ defineExpose({ reload: load })
|
||||
transition: transform 0.12s ease, box-shadow 0.12s ease;
|
||||
}
|
||||
|
||||
.aksrt-status-color__swatch:hover {
|
||||
.jio-status-color__swatch:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.aksrt-status-color__swatch:focus-visible {
|
||||
outline: 2px solid var(--aksrt-color-primary, #2271b1);
|
||||
.jio-status-color__swatch:focus-visible {
|
||||
outline: 2px solid var(--jio-color-primary, #2271b1);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* 选中态:白色内圈 + 同色外环,深浅主题都清晰。 */
|
||||
.aksrt-status-color__swatch.is-active {
|
||||
.jio-status-color__swatch.is-active {
|
||||
box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--swatch);
|
||||
}
|
||||
|
||||
.aksrt-status-color__swatch.is-active::after {
|
||||
.jio-status-color__swatch.is-active::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
@@ -434,11 +465,11 @@ defineExpose({ reload: load })
|
||||
}
|
||||
|
||||
/* 自定义:未选中时显示色环,提示「更多颜色」。 */
|
||||
.aksrt-status-color__swatch--custom:not(.is-active) {
|
||||
.jio-status-color__swatch--custom:not(.is-active) {
|
||||
background: conic-gradient(#ef4444, #f59e0b, #eab308, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ec4899, #ef4444);
|
||||
}
|
||||
|
||||
.aksrt-status-color__swatch--custom:not(.is-active)::after {
|
||||
.jio-status-color__swatch--custom:not(.is-active)::after {
|
||||
content: '+';
|
||||
position: absolute;
|
||||
inset: 5px;
|
||||
@@ -453,12 +484,12 @@ defineExpose({ reload: load })
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.aksrt-status-color__hex {
|
||||
.jio-status-color__hex {
|
||||
width: 160px;
|
||||
font-family: var(--n-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
||||
}
|
||||
|
||||
.aksrt-status-color__chip {
|
||||
.jio-status-color__chip {
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
@@ -466,15 +497,27 @@ defineExpose({ reload: load })
|
||||
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
/* —— 弹窗:标识 —— */
|
||||
.jio-status-key {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.jio-status-key__input {
|
||||
font-family: var(--n-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
||||
}
|
||||
|
||||
/* —— 弹窗:完结开关 —— */
|
||||
.aksrt-status-closed {
|
||||
.jio-status-closed {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aksrt-ticket-status__hint {
|
||||
color: var(--aksrt-color-muted);
|
||||
.jio-ticket-status__hint {
|
||||
color: var(--jio-color-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<n-card class="jio-section-card">
|
||||
<div class="jio-section-header">
|
||||
<h3>工单部门</h3>
|
||||
<n-button size="small" type="primary" :disabled="saving" @click="openCreate">新增部门</n-button>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@ function resolveComponent(page) {
|
||||
// Log missing component for debugging — avoids silent fallback to DeferredPage
|
||||
if (page.component && page.component !== 'DeferredPage') {
|
||||
console.warn(
|
||||
`[AKSRT Route] Component "${page.component}" not found in componentLoaders for route "${page.route}". Falling back to DeferredPage.`
|
||||
`[Jio Route] Component "${page.component}" not found in componentLoaders for route "${page.route}". Falling back to DeferredPage.`
|
||||
)
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ function createSectionRedirectRoutes() {
|
||||
* (封禁/举报 as a sidebar entry lives in constants/sections/users.js → /users/ban.)
|
||||
*/
|
||||
const NATIVE_OPS_REDIRECTS = [
|
||||
{ path: '/users/messages', title: '消息中心', nativeAdminPath: 'users.php?page=aksrt_messages' },
|
||||
{ path: '/users/report', title: '禁封/举报', nativeAdminPath: 'users.php?page=aksrt_user_ban' },
|
||||
{ path: '/users/tickets', title: '工单管理', nativeAdminPath: 'users.php?page=aksrt_tickets' },
|
||||
{ path: '/users/messages', title: '消息中心', nativeAdminPath: 'users.php?page=jio_messages' },
|
||||
{ path: '/users/report', title: '禁封/举报', nativeAdminPath: 'users.php?page=jio_user_ban' },
|
||||
{ path: '/users/tickets', title: '工单管理', nativeAdminPath: 'users.php?page=jio_tickets' },
|
||||
]
|
||||
|
||||
const routes = [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Schema Registry — central index for all admin section schemas.
|
||||
*
|
||||
* Each section's schema defines the form fields, groups, API endpoints,
|
||||
* and default values for a settings page. The AksFormRenderer component
|
||||
* and default values for a settings page. The JioFormRenderer component
|
||||
* consumes these schemas to render settings pages automatically.
|
||||
*
|
||||
* Schema shape per section:
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
export const codeHighlightSchema = {
|
||||
key: 'global.code-highlight',
|
||||
title: '代码高亮',
|
||||
icon: 'fa fas fa-code',
|
||||
description: '代码块语法高亮主题、行号、最大高度等配置。',
|
||||
defaults: {
|
||||
highlight_kg: true,
|
||||
highlight_hh: false,
|
||||
highlight_btn: true,
|
||||
highlight_maxheight: 400,
|
||||
highlight_zt: 'enlighter',
|
||||
highlight_dark_zt: 'monokai',
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'basic',
|
||||
title: '代码高亮设置',
|
||||
icon: 'fa fas fa-pen',
|
||||
fields: [
|
||||
{ key: 'highlight_kg', label: '代码高亮开关', type: 'switch', default: true },
|
||||
{ key: 'highlight_hh', label: '显示行号', type: 'switch', default: false },
|
||||
{ key: 'highlight_btn', label: '显示扩展按钮', type: 'switch', default: true, help: '控制原始代码 / 信息 / 新窗口按钮的显示' },
|
||||
{ key: 'highlight_maxheight', label: '最大高度(px,0=不限)', type: 'number', default: 400, min: 0, max: 2000, help: '代码块最大高度,超出滚动显示。0 表示不限制' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'theme',
|
||||
title: '主题设置',
|
||||
icon: 'fa fas fa-paint-brush',
|
||||
fields: [
|
||||
{
|
||||
key: 'highlight_zt',
|
||||
label: '日间默认主题',
|
||||
type: 'select',
|
||||
default: 'enlighter',
|
||||
options: [
|
||||
{ label: 'Enlighter', value: 'enlighter' },
|
||||
{ label: 'Bootstrap 4', value: 'bootstrap4' },
|
||||
{ label: 'Classic', value: 'classic' },
|
||||
{ label: 'Beyond', value: 'beyond' },
|
||||
{ label: 'Mowtwo', value: 'mowtwo' },
|
||||
{ label: 'Eclipse', value: 'eclipse' },
|
||||
{ label: 'Droide', value: 'droide' },
|
||||
{ label: 'Minimal', value: 'minimal' },
|
||||
{ label: 'Rowhammer', value: 'rowhammer' },
|
||||
{ label: 'Godzilla', value: 'godzilla' },
|
||||
{ label: 'Dracula', value: 'dracula' },
|
||||
{ label: 'Atomic', value: 'atomic' },
|
||||
{ label: 'Monokai', value: 'monokai' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'highlight_dark_zt',
|
||||
label: '暗色默认主题',
|
||||
type: 'select',
|
||||
default: 'monokai',
|
||||
options: [
|
||||
{ label: 'Dracula', value: 'dracula' },
|
||||
{ label: 'Atomic', value: 'atomic' },
|
||||
{ label: 'Monokai', value: 'monokai' },
|
||||
{ label: 'Enlighter', value: 'enlighter' },
|
||||
{ label: 'Bootstrap 4', value: 'bootstrap4' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,13 +1,23 @@
|
||||
const themeRoot = typeof window !== 'undefined' && window.aksrtAdminData?.themeUri
|
||||
? String(window.aksrtAdminData.themeUri).replace(/\/$/, '')
|
||||
const themeRoot = typeof window !== 'undefined' && window.jioAdminData?.themeUri
|
||||
? String(window.jioAdminData.themeUri).replace(/\/$/, '')
|
||||
: ''
|
||||
const defaultThumbnail = themeRoot ? `${themeRoot}/assets/img/thumbnail.svg` : ''
|
||||
|
||||
const noticeColorOptions = [
|
||||
{ label: '主题色', value: 'primary' },
|
||||
{ label: '成功绿', value: 'success' },
|
||||
{ label: '警告橙', value: 'warning' },
|
||||
{ label: '危险红', value: 'danger' },
|
||||
{ label: '信息蓝', value: 'info' },
|
||||
{ label: '深紫', value: 'purple' },
|
||||
{ label: '深灰', value: 'dark' },
|
||||
]
|
||||
|
||||
export const commonSchema = {
|
||||
key: 'global.common',
|
||||
title: '常用功能',
|
||||
icon: 'fa fas fa-cog',
|
||||
description: '管理站点常用开关、懒加载与备案信息等基础配置。',
|
||||
description: '图像懒加载、代码高亮与弹窗公告等全站常用配置。',
|
||||
defaults: {
|
||||
lazy_posts_thumb: true,
|
||||
lazy_avatar: true,
|
||||
@@ -18,9 +28,35 @@ export const commonSchema = {
|
||||
lazy_other: true,
|
||||
lazy_animation: 'blur',
|
||||
thumbnail: defaultThumbnail,
|
||||
icp_filing: '',
|
||||
police_filing: '',
|
||||
footer_text: '',
|
||||
highlight_kg: true,
|
||||
highlight_hh: false,
|
||||
highlight_btn: true,
|
||||
highlight_maxheight: 400,
|
||||
highlight_zt: 'enlighter',
|
||||
highlight_dark_zt: 'monokai',
|
||||
system_notice_enabled: true,
|
||||
system_notice_policy: '',
|
||||
system_notice_title: '',
|
||||
system_notice_content: '',
|
||||
system_notice_btn1_text: '',
|
||||
system_notice_btn1_link: '',
|
||||
system_notice_btn1_color: 'primary',
|
||||
system_notice_btn2_text: '',
|
||||
system_notice_btn2_link: '',
|
||||
system_notice_btn2_color: 'primary',
|
||||
system_notice_btn3_text: '',
|
||||
system_notice_btn3_link: '',
|
||||
system_notice_btn3_color: 'primary',
|
||||
system_notice_btn4_text: '',
|
||||
system_notice_btn4_link: '',
|
||||
system_notice_btn4_color: 'primary',
|
||||
system_notice_size: '',
|
||||
system_notice_radius: false,
|
||||
system_notice_class: '',
|
||||
system_notice_title_icon: '',
|
||||
system_notice_title_class: '',
|
||||
system_notice_title_style: '',
|
||||
system_notice_expires: 24,
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
@@ -57,13 +93,121 @@ export const commonSchema = {
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'filing',
|
||||
title: '备案信息',
|
||||
icon: 'fa fas fa-shield-alt',
|
||||
key: 'code-highlight',
|
||||
title: '代码高亮',
|
||||
icon: 'fa fas fa-code',
|
||||
fields: [
|
||||
{ key: 'icp_filing', label: 'ICP 备案号', type: 'input', placeholder: '例如:京ICP备12345678号', help: '显示在页脚的备案信息' },
|
||||
{ key: 'police_filing', label: '公安备案号', type: 'input', placeholder: '例如:公网安备11000000000000号', help: '显示在页脚的备案信息' },
|
||||
{ key: 'footer_text', label: '页脚附加文字', type: 'input', placeholder: '自定义页脚文字', help: '显示在版权信息下方' },
|
||||
{ key: 'highlight_kg', label: '代码高亮开关', type: 'switch', default: true },
|
||||
{ key: 'highlight_hh', label: '显示行号', type: 'switch', default: false, dependsOn: { key: 'highlight_kg', value: true } },
|
||||
{ key: 'highlight_btn', label: '显示扩展按钮', type: 'switch', default: true, dependsOn: { key: 'highlight_kg', value: true }, help: '控制原始代码 / 信息 / 新窗口按钮的显示' },
|
||||
{ key: 'highlight_maxheight', label: '最大高度(px,0=不限)', type: 'number', default: 400, min: 0, max: 2000, dependsOn: { key: 'highlight_kg', value: true }, help: '代码块最大高度,超出滚动显示。0 表示不限制' },
|
||||
{
|
||||
key: 'highlight_zt',
|
||||
label: '日间默认主题',
|
||||
type: 'select',
|
||||
default: 'enlighter',
|
||||
dependsOn: { key: 'highlight_kg', value: true },
|
||||
options: [
|
||||
{ label: 'Enlighter', value: 'enlighter' },
|
||||
{ label: 'Bootstrap 4', value: 'bootstrap4' },
|
||||
{ label: 'Classic', value: 'classic' },
|
||||
{ label: 'Beyond', value: 'beyond' },
|
||||
{ label: 'Mowtwo', value: 'mowtwo' },
|
||||
{ label: 'Eclipse', value: 'eclipse' },
|
||||
{ label: 'Droide', value: 'droide' },
|
||||
{ label: 'Minimal', value: 'minimal' },
|
||||
{ label: 'Rowhammer', value: 'rowhammer' },
|
||||
{ label: 'Godzilla', value: 'godzilla' },
|
||||
{ label: 'Dracula', value: 'dracula' },
|
||||
{ label: 'Atomic', value: 'atomic' },
|
||||
{ label: 'Monokai', value: 'monokai' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'highlight_dark_zt',
|
||||
label: '暗色默认主题',
|
||||
type: 'select',
|
||||
default: 'monokai',
|
||||
dependsOn: { key: 'highlight_kg', value: true },
|
||||
options: [
|
||||
{ label: 'Dracula', value: 'dracula' },
|
||||
{ label: 'Atomic', value: 'atomic' },
|
||||
{ label: 'Monokai', value: 'monokai' },
|
||||
{ label: 'Enlighter', value: 'enlighter' },
|
||||
{ label: 'Bootstrap 4', value: 'bootstrap4' },
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'system-notice',
|
||||
title: '弹窗通知',
|
||||
icon: 'fa fas fa-bullhorn',
|
||||
fields: [
|
||||
{ key: 'system_notice_enabled', label: '启用系统公告', type: 'switch', default: true },
|
||||
{
|
||||
key: 'system_notice_policy',
|
||||
label: '显示对象',
|
||||
type: 'select',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '所有访客', value: '' },
|
||||
{ label: '仅登录用户', value: 'signin' },
|
||||
{ label: '仅 VIP 会员', value: 'vip' },
|
||||
{ label: '仅非 VIP', value: 'free' },
|
||||
{ label: '仅认证用户', value: 'auth' },
|
||||
],
|
||||
dependsOn: { key: 'system_notice_enabled', value: true },
|
||||
},
|
||||
{ key: 'system_notice_title', label: '公告标题', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_content', label: '公告内容', type: 'textarea', default: '', rows: 5, dependsOn: { key: 'system_notice_enabled', value: true }, help: '支持 HTML 标签' },
|
||||
{ key: 'system_notice_btn1_text', label: '按钮 1 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn1_link', label: '按钮 1 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true }, help: '可选,填写后按钮变为链接' },
|
||||
{ key: 'system_notice_btn1_color', label: '按钮 1 颜色', type: 'select', default: 'primary', options: noticeColorOptions, dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn2_text', label: '按钮 2 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn2_link', label: '按钮 2 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn2_color', label: '按钮 2 颜色', type: 'select', default: 'primary', options: noticeColorOptions, dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn3_text', label: '按钮 3 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn3_link', label: '按钮 3 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn3_color', label: '按钮 3 颜色', type: 'select', default: 'primary', options: noticeColorOptions, dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn4_text', label: '按钮 4 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn4_link', label: '按钮 4 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn4_color', label: '按钮 4 颜色', type: 'select', default: 'primary', options: noticeColorOptions, dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{
|
||||
key: 'system_notice_size',
|
||||
label: '弹窗尺寸',
|
||||
type: 'select',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '迷你', value: 'modal-mini' },
|
||||
{ label: '小号', value: 'modal-sm' },
|
||||
{ label: '大号', value: 'modal-lg' },
|
||||
],
|
||||
dependsOn: { key: 'system_notice_enabled', value: true },
|
||||
},
|
||||
{ key: 'system_notice_radius', label: '按钮圆角', type: 'switch', default: false, dependsOn: { key: 'system_notice_enabled', value: true }, help: '开启后弹窗按钮使用圆角样式' },
|
||||
{ key: 'system_notice_class', label: '公告样式类', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_title_icon', label: '标题图标', type: 'icon', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{
|
||||
key: 'system_notice_title_class',
|
||||
label: '标题背景配色',
|
||||
type: 'select',
|
||||
default: '',
|
||||
dependsOn: { key: 'system_notice_enabled', value: true },
|
||||
options: [
|
||||
{ label: '无', value: '' },
|
||||
{ label: '炫彩黄', value: 'jb-yellow' },
|
||||
{ label: '炫彩蓝', value: 'jb-blue' },
|
||||
{ label: '炫彩绿', value: 'jb-green' },
|
||||
{ label: '炫彩紫', value: 'jb-purple' },
|
||||
{ label: '炫彩红', value: 'jb-red' },
|
||||
{ label: '炫彩橙', value: 'jb-orange' },
|
||||
],
|
||||
help: '弹窗标题区域的背景配色方案',
|
||||
},
|
||||
{ key: 'system_notice_title_style', label: '标题样式', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_expires', label: '弹窗周期(小时)', type: 'number', default: 24, min: 0, max: 720, dependsOn: { key: 'system_notice_enabled', value: true }, help: '0 表示永不过期' },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -37,7 +37,7 @@ export const i18nSchema = {
|
||||
],
|
||||
dependsOn: { key: 'i18n_enabled', value: true },
|
||||
},
|
||||
{ key: 'i18n_auto_detect', label: '自动检测浏览器语言', type: 'switch', default: true, dependsOn: { key: 'i18n_enabled', value: true }, help: '基于浏览器 Accept-Language 自动切换(AKSRT 方案,区别于 legacy IP 定位方案)' },
|
||||
{ key: 'i18n_auto_detect', label: '自动检测浏览器语言', type: 'switch', default: true, dependsOn: { key: 'i18n_enabled', value: true }, help: '基于浏览器 Accept-Language 自动切换(Jio 方案,区别于 legacy IP 定位方案)' },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -12,8 +12,6 @@ import { tabbarSchema } from './tabbar.js'
|
||||
import { i18nSchema } from './i18n.js'
|
||||
import { customCodeSchema } from './custom-code.js'
|
||||
import { seoSchema } from './seo.js'
|
||||
import { codeHighlightSchema } from './code-highlight.js'
|
||||
import { systemNoticeSchema } from './system-notice.js'
|
||||
import { shareSchema } from './share.js'
|
||||
|
||||
export const globalSchemas = {
|
||||
@@ -26,7 +24,5 @@ export const globalSchemas = {
|
||||
i18n: i18nSchema,
|
||||
'custom-code': customCodeSchema,
|
||||
seo: seoSchema,
|
||||
'code-highlight': codeHighlightSchema,
|
||||
'system-notice': systemNoticeSchema,
|
||||
share: shareSchema,
|
||||
}
|
||||
@@ -1,3 +1,52 @@
|
||||
const bgDefault = {
|
||||
color: '',
|
||||
image: '',
|
||||
position: 'center top',
|
||||
repeat: 'no-repeat',
|
||||
attachment: 'fixed',
|
||||
size: '100%',
|
||||
origin: '',
|
||||
}
|
||||
|
||||
const opts = (pairs) => pairs.map(([value, label]) => ({ label, value }))
|
||||
|
||||
// 与 Settings ThemeSearch::background_css() 的白名单一致。
|
||||
const bgField = (key, label, help) => ({
|
||||
key,
|
||||
label,
|
||||
type: 'fieldset',
|
||||
default: { ...bgDefault },
|
||||
help,
|
||||
fields: [
|
||||
{ key: 'color', label: '背景颜色', type: 'color', default: '' },
|
||||
{ key: 'image', label: '背景图片', type: 'media', default: '' },
|
||||
{ key: 'position', label: '背景位置', type: 'select', default: 'center top', options: opts([
|
||||
['', '默认'], ['left top', '左上'], ['left center', '左中'], ['left bottom', '左下'],
|
||||
['center top', '中上'], ['center center', '居中'], ['center bottom', '中下'],
|
||||
['right top', '右上'], ['right center', '右中'], ['right bottom', '右下'],
|
||||
]) },
|
||||
{ key: 'repeat', label: '背景重复', type: 'select', default: 'no-repeat', options: opts([
|
||||
['', '默认'], ['repeat', '重复'], ['no-repeat', '不重复'], ['repeat-x', '水平重复'], ['repeat-y', '垂直重复'],
|
||||
]) },
|
||||
{ key: 'attachment', label: '背景附着', type: 'select', default: 'fixed', options: opts([
|
||||
['', '默认'], ['scroll', '滚动'], ['fixed', '固定'],
|
||||
]) },
|
||||
{ key: 'size', label: '背景尺寸', type: 'select', default: '100%', options: opts([
|
||||
['', '默认'], ['100%', '100%'], ['cover', '覆盖 (cover)'], ['contain', '包含 (contain)'], ['auto', '自动 (auto)'],
|
||||
]) },
|
||||
{ key: 'origin', label: '背景原点', type: 'select', default: '', options: opts([
|
||||
['', '默认'], ['padding-box', 'Padding Box'], ['border-box', 'Border Box'], ['content-box', 'Content Box'],
|
||||
]) },
|
||||
],
|
||||
})
|
||||
|
||||
// palette 的 label 即色块背景色;ff1856 的色块沿用参考主题的 #fd2760。
|
||||
const SKIN_PALETTE = [
|
||||
['ff1856', '#fd2760'], ['f04494', '#f04494'], ['ae53f3', '#ae53f3'], ['627bf5', '#627bf5'],
|
||||
['00a2e3', '#00a2e3'], ['16b597', '#16b597'], ['36af18', '#36af18'], ['8fb107', '#8fb107'],
|
||||
['b18c07', '#b18c07'], ['e06711', '#e06711'], ['f74735', '#f74735'],
|
||||
].map(([value, label]) => ({ label, value }))
|
||||
|
||||
export const layoutSchema = {
|
||||
key: 'global.layout',
|
||||
title: '显示 & 布局',
|
||||
@@ -6,11 +55,13 @@ export const layoutSchema = {
|
||||
defaults: {
|
||||
theme_mode: 'time-auto',
|
||||
theme_mode_button: ['pc_nav', 'm_menu'],
|
||||
primary_color: '#1890ff',
|
||||
theme_img_bg: { ...bgDefault },
|
||||
dark_theme_img_bg: { ...bgDefault },
|
||||
theme_skin_custom: '',
|
||||
theme_skin: 'f04494',
|
||||
dark_primary_color: '',
|
||||
border_radius: 8,
|
||||
theme_main_radius: 12,
|
||||
dark_theme_skin_custom: '',
|
||||
close_backdrop: false,
|
||||
theme_main_radius: 8,
|
||||
container_max_width: 1200,
|
||||
sidebar_enabled: true,
|
||||
sidebar_position: 'right',
|
||||
@@ -22,6 +73,7 @@ export const layoutSchema = {
|
||||
sidebar_page_enabled: true,
|
||||
sidebar_search_enabled: true,
|
||||
font_family: 'system',
|
||||
font_family_custom: '',
|
||||
qj_loading: false,
|
||||
qj_dh_xs: 'no1',
|
||||
},
|
||||
@@ -61,50 +113,41 @@ export const layoutSchema = {
|
||||
fields: [
|
||||
{
|
||||
key: 'theme_mode',
|
||||
label: '默认主题模式',
|
||||
label: '主题模式',
|
||||
type: 'radio',
|
||||
default: 'time-auto',
|
||||
options: [
|
||||
{ label: '浅色', value: 'white-theme' },
|
||||
{ label: '深色', value: 'dark-theme' },
|
||||
{ label: '跟随系统', value: 'time-auto' },
|
||||
{ label: '日间亮色主题', value: 'white-theme' },
|
||||
{ label: '夜间深色主题', value: 'dark-theme' },
|
||||
{ label: '早晚8点自动切换', value: 'time-auto' },
|
||||
],
|
||||
help: '此处设置为默认风格,实际显示风格以用户设置优先。如需固定风格,则关闭还需下方主题切换按钮',
|
||||
},
|
||||
{
|
||||
key: 'theme_mode_button',
|
||||
label: '主题切换按钮位置',
|
||||
label: '主题切换按钮',
|
||||
type: 'checkbox',
|
||||
default: ['pc_nav', 'm_menu'],
|
||||
options: [
|
||||
{ label: 'PC 顶部导航', value: 'pc_nav' },
|
||||
{ label: '移动端菜单', value: 'm_menu' },
|
||||
{ label: 'PC端顶部导航', value: 'pc_nav' },
|
||||
{ label: '移动端弹出菜单', value: 'm_menu' },
|
||||
],
|
||||
help: '控制主题切换按钮在哪些位置显示',
|
||||
help: '如果关闭此功能,则前端不会显示切换按钮',
|
||||
},
|
||||
{ key: 'primary_color', label: '主题色', type: 'color', default: '#f04494', help: '按钮、链接和强调元素的主色调' },
|
||||
bgField('theme_img_bg', '全局背景图', '注意:要达到良好的效果需要图片与参数配合,同时需注意颜色搭配!配合不好容易降低显示美感'),
|
||||
bgField('dark_theme_img_bg', '夜间模式背景图', '如未设置夜间模式背景图,则夜间模式也显示上方背景图'),
|
||||
{ key: 'theme_skin_custom', label: '全局主题色', type: 'color', default: '', help: '默认主题高亮颜色。如需选择下方预置颜色,请先清空上方颜色' },
|
||||
{
|
||||
key: 'theme_skin',
|
||||
label: '预设主题色',
|
||||
label: ' ',
|
||||
type: 'palette',
|
||||
default: 'f04494',
|
||||
options: [
|
||||
{ label: '玫红', value: 'ff1856' },
|
||||
{ label: '粉色', value: 'f04494' },
|
||||
{ label: '紫色', value: 'ae53f3' },
|
||||
{ label: '靛蓝', value: '627bf5' },
|
||||
{ label: '天蓝', value: '00a2e3' },
|
||||
{ label: '青绿', value: '16b597' },
|
||||
{ label: '翠绿', value: '36af18' },
|
||||
{ label: '黄绿', value: '8fb107' },
|
||||
{ label: '棕金', value: 'b18c07' },
|
||||
{ label: '橘橙', value: 'e06711' },
|
||||
{ label: '朱红', value: 'f74735' },
|
||||
],
|
||||
help: '选择预设主题色,将覆盖上方自定义主题色',
|
||||
dependsOn: { key: 'theme_skin_custom', operator: 'empty' },
|
||||
options: SKIN_PALETTE,
|
||||
},
|
||||
{ key: 'dark_primary_color', label: '暗色模式主题色', type: 'color', default: '', help: '暗色模式下独立的主题色,留空则跟随浅色模式' },
|
||||
{ key: 'border_radius', label: '全局圆角 (px)', type: 'slider', min: 0, max: 20, step: 1, default: 8 },
|
||||
{ key: 'theme_main_radius', label: '卡片圆角 (px)', type: 'number', min: 0, max: 30, default: 12, help: '独立卡片圆角,留空则使用全局圆角 +4' },
|
||||
{ key: 'dark_theme_skin_custom', label: '夜间模式主题色', type: 'color', default: '', help: '在此可单独设置夜间模式的高亮色,清空此处则使用上方默认高亮色' },
|
||||
{ key: 'close_backdrop', label: '全局关闭背景高斯模糊', type: 'switch', default: false, help: '在支持的浏览器上部分UI(例如导航栏)会显示背景高斯模糊的特效,但此功能比较消耗浏览器性能。同时系统会自动检测用户浏览器性能情况,如果性能较差,将自动关闭此特效,以提供更流畅的体验' },
|
||||
{ key: 'theme_main_radius', label: '卡片圆角', type: 'spinner', default: 8, min: 0, max: 30, step: 1, unit: 'PX', description: '页面卡片的圆角尺寸' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -112,16 +155,7 @@ export const layoutSchema = {
|
||||
title: '布局设置',
|
||||
icon: 'fa fas fa-columns',
|
||||
fields: [
|
||||
{ key: 'container_max_width', label: '内容最大宽度 (px)', type: 'select', default: 1200, options: [
|
||||
{ label: '1200px', value: 1200 },
|
||||
{ label: '1320px', value: 1320 },
|
||||
{ label: '1440px', value: 1440 },
|
||||
{ label: '1600px', value: 1600 },
|
||||
{ label: '1800px', value: 1800 },
|
||||
{ label: '2000px', value: 2000 },
|
||||
{ label: '2200px', value: 2200 },
|
||||
{ label: '全宽', value: 0 },
|
||||
]},
|
||||
{ key: 'container_max_width', label: '内容最大宽度', type: 'number', default: 1200, min: 1200, max: 2200, step: 50, unit: 'PX', help: '页面布局的最大宽度,可设置 1200–2200PX。宽度过大会造成显示不协调,非特殊需求请勿调整。' },
|
||||
{ key: 'sidebar_enabled', label: '开启侧边栏', type: 'switch', default: true },
|
||||
{ key: 'sidebar_position', label: '侧边栏位置', type: 'radio', default: 'right', dependsOn: { key: 'sidebar_enabled', value: true }, options: [
|
||||
{ label: '左侧', value: 'left' },
|
||||
@@ -153,7 +187,8 @@ export const layoutSchema = {
|
||||
{ label: '思源黑体', value: 'noto-sans-sc' },
|
||||
{ label: '思源宋体', value: 'noto-serif-sc' },
|
||||
{ label: '自定义', value: 'custom' },
|
||||
]},
|
||||
], help: '思源字体不会远程加载,访客设备未安装时回退到系统字体。' },
|
||||
{ key: 'font_family_custom', label: '自定义字体', type: 'input', default: '', placeholder: '例如:"LXGW WenKai", "PingFang SC", sans-serif', dependsOn: { key: 'font_family', value: 'custom' }, help: 'CSS font-family 字体栈,多个字体用英文逗号分隔;留空使用系统字体。' },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
const themeRoot = typeof window !== 'undefined' && window.jioAdminData?.themeUri
|
||||
? String(window.jioAdminData.themeUri).replace(/\/$/, '')
|
||||
: ''
|
||||
const defaultLogo = themeRoot ? `${themeRoot}/assets/img/logo.png` : ''
|
||||
const defaultFavicon = themeRoot ? `${themeRoot}/assets/img/favicon.png` : ''
|
||||
|
||||
export const logoSchema = {
|
||||
key: 'global.logo',
|
||||
title: 'LOGO & 品牌',
|
||||
icon: 'fa fas fa-image',
|
||||
description: '管理站点 Logo、站点图标和品牌标识。',
|
||||
defaults: {
|
||||
site_logo: '',
|
||||
site_logo_dark: '',
|
||||
site_favicon: '',
|
||||
site_icon: '',
|
||||
logo_width: 150,
|
||||
site_logo: defaultLogo,
|
||||
site_logo_dark: defaultLogo,
|
||||
site_favicon: defaultFavicon,
|
||||
site_icon: defaultFavicon,
|
||||
logo_text: '',
|
||||
},
|
||||
groups: [
|
||||
@@ -17,9 +22,8 @@ export const logoSchema = {
|
||||
title: 'Logo 设置',
|
||||
icon: 'fa fas fa-image',
|
||||
fields: [
|
||||
{ key: 'site_logo', label: '站点 Logo', type: 'media', help: '建议尺寸 300x80,支持 PNG/SVG 透明背景' },
|
||||
{ key: 'site_logo_dark', label: '暗色模式 Logo', type: 'media', help: '暗色模式下显示的 Logo,留空则使用默认 Logo' },
|
||||
{ key: 'logo_width', label: 'Logo 宽度 (px)', type: 'number', min: 50, max: 400, step: 10, help: '导航栏中 Logo 显示宽度' },
|
||||
{ key: 'site_logo', label: '站点 Logo', type: 'media', default: defaultLogo, help: '建议尺寸 300x80,支持 PNG/SVG 透明背景' },
|
||||
{ key: 'site_logo_dark', label: '暗色模式 Logo', type: 'media', default: defaultLogo, help: '暗色模式下显示的 Logo,留空则使用默认 Logo' },
|
||||
{ key: 'logo_text', label: 'Logo 文字', type: 'input', placeholder: '当无 Logo 图片时显示的文字', help: '同时作为首页标题和 alt 文本使用' },
|
||||
],
|
||||
},
|
||||
@@ -28,8 +32,8 @@ export const logoSchema = {
|
||||
title: '站点图标',
|
||||
icon: 'fa fas fa-id-badge',
|
||||
fields: [
|
||||
{ key: 'site_favicon', label: '浏览器图标 (Favicon)', type: 'media', help: '建议 32x32 或 16x16 的 ICO/PNG 文件' },
|
||||
{ key: 'site_icon', label: '移动端图标', type: 'media', help: '建议 192x192 的 PNG,用于移动端添加到桌面' },
|
||||
{ key: 'site_favicon', label: '浏览器图标 (Favicon)', type: 'media', default: defaultFavicon, help: '建议 32x32 或 16x16 的 ICO/PNG 文件' },
|
||||
{ key: 'site_icon', label: '移动端图标', type: 'media', default: defaultFavicon, help: '建议 192x192 的 PNG,用于移动端添加到桌面' },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -20,7 +20,7 @@ export const searchSchema = {
|
||||
search_custom_key: ['title', 'content', 'excerpt', 'category', 'post_tag'],
|
||||
search_facets: {},
|
||||
search_ms_s: false,
|
||||
search_ms_opt: { api_url: 'http://127.0.0.1:7700', api_key: '', index_prefix: 'aksrt', synonyms: [{ key: 'wordpress', val: 'wp,wordp,wordpre' }] },
|
||||
search_ms_opt: { api_url: 'http://127.0.0.1:7700', api_key: '', index_prefix: 'jio', synonyms: [{ key: 'wordpress', val: 'wp,wordp,wordpre' }] },
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
@@ -63,12 +63,13 @@ export const searchSchema = {
|
||||
{ key: 'search_custom_key_s', label: '自定义匹配范围', type: 'switch', default: true, help: '启用后可配置搜索匹配字段范围' },
|
||||
{ key: 'search_custom_key', label: '匹配字段', type: 'checkbox', default: ['title', 'content', 'excerpt', 'category', 'post_tag'], dependsOn: { key: 'search_custom_key_s', value: true }, options: [
|
||||
{ label: '标题', value: 'title' }, { label: '内容', value: 'content' }, { label: '简介', value: 'excerpt' },
|
||||
{ label: '分类', value: 'category' }, { label: '标签', value: 'post_tag' },
|
||||
{ label: '分类', value: 'category' }, { label: '标签', value: 'post_tag' }, { label: '专题', value: 'topics' },
|
||||
{ label: '评论', value: 'coment' }, { label: '作者昵称', value: 'user' },
|
||||
] },
|
||||
{ key: 'search_facets', label: '搜索筛选', type: 'fieldset', sanitizeType: 'array', default: {}, dependsOn: { key: 'search_ms_s', value: false }, help: '搜索结果中显示的筛选列表;启用 Meilisearch 后由搜索引擎生成关联筛选。', fields: [
|
||||
{ key: 'category', label: '[文章] 分类', type: 'taxonomy_select', taxonomy: 'category', multiple: true, default: [] },
|
||||
{ key: 'post_tag', label: '[文章] 标签', type: 'taxonomy_select', taxonomy: 'post_tag', multiple: true, default: [] },
|
||||
{ key: 'topics', label: '[文章] 专题', type: 'taxonomy_select', taxonomy: 'topics', multiple: true, default: [] },
|
||||
] },
|
||||
],
|
||||
},
|
||||
@@ -98,10 +99,10 @@ export const searchSchema = {
|
||||
icon: 'fa fas fa-bolt',
|
||||
fields: [
|
||||
{ key: 'search_ms_s', label: '启用 Meilisearch', type: 'switch', default: false },
|
||||
{ key: 'search_ms_opt', label: 'Meilisearch 参数', type: 'fieldset', sanitizeType: 'array', dependsOn: { key: 'search_ms_s', value: true }, default: { api_url: 'http://127.0.0.1:7700', api_key: '', index_prefix: 'aksrt', synonyms: [{ key: 'wordpress', val: 'wp,wordp,wordpre' }] }, fields: [
|
||||
{ key: 'search_ms_opt', label: 'Meilisearch 参数', type: 'fieldset', sanitizeType: 'array', dependsOn: { key: 'search_ms_s', value: true }, default: { api_url: 'http://127.0.0.1:7700', api_key: '', index_prefix: 'jio', synonyms: [{ key: 'wordpress', val: 'wp,wordp,wordpre' }] }, fields: [
|
||||
{ key: 'api_url', label: 'API 地址', type: 'input', default: 'http://127.0.0.1:7700' },
|
||||
{ key: 'api_key', label: 'API 密钥', type: 'input', default: '' },
|
||||
{ key: 'index_prefix', label: '索引前缀', type: 'input', default: 'aksrt' },
|
||||
{ key: 'index_prefix', label: '索引前缀', type: 'input', default: 'jio' },
|
||||
{ key: 'synonyms', label: '同义词', type: 'repeater', default: [{ key: 'wordpress', val: 'wp,wordp,wordpre' }], addText: '添加同义词', fields: [
|
||||
{ key: 'key', label: '关键词', type: 'input', default: '' },
|
||||
{ key: 'val', label: '同义词', type: 'textarea', default: '' },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const themeRoot = typeof window !== 'undefined' && window.aksrtAdminData?.themeUri
|
||||
? String(window.aksrtAdminData.themeUri).replace(/\/$/, '')
|
||||
const themeRoot = typeof window !== 'undefined' && window.jioAdminData?.themeUri
|
||||
? String(window.jioAdminData.themeUri).replace(/\/$/, '')
|
||||
: ''
|
||||
|
||||
const shareOptions = [
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
export const systemNoticeSchema = {
|
||||
key: 'global.system-notice',
|
||||
title: '弹窗通知',
|
||||
icon: 'fa fas fa-bullhorn',
|
||||
description: '全站弹窗公告配置,支持按用户身份定向、多按钮组、弹窗尺寸与过期周期。',
|
||||
defaults: {
|
||||
system_notice_enabled: true,
|
||||
system_notice_policy: '',
|
||||
system_notice_title: '',
|
||||
system_notice_content: '',
|
||||
system_notice_btn1_text: '',
|
||||
system_notice_btn1_link: '',
|
||||
system_notice_btn1_color: 'primary',
|
||||
system_notice_btn2_text: '',
|
||||
system_notice_btn2_link: '',
|
||||
system_notice_btn2_color: 'primary',
|
||||
system_notice_btn3_text: '',
|
||||
system_notice_btn3_link: '',
|
||||
system_notice_btn3_color: 'primary',
|
||||
system_notice_btn4_text: '',
|
||||
system_notice_btn4_link: '',
|
||||
system_notice_btn4_color: 'primary',
|
||||
system_notice_size: '',
|
||||
system_notice_radius: false,
|
||||
system_notice_class: '',
|
||||
system_notice_title_icon: '',
|
||||
system_notice_title_class: '',
|
||||
system_notice_title_style: '',
|
||||
system_notice_expires: 24,
|
||||
},
|
||||
groups: [
|
||||
{
|
||||
key: 'basic',
|
||||
title: '公告设置',
|
||||
icon: 'fa fas fa-bullhorn',
|
||||
fields: [
|
||||
{ key: 'system_notice_enabled', label: '启用系统公告', type: 'switch', default: true },
|
||||
{
|
||||
key: 'system_notice_policy',
|
||||
label: '显示对象',
|
||||
type: 'select',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '所有访客', value: '' },
|
||||
{ label: '仅登录用户', value: 'signin' },
|
||||
{ label: '仅 VIP 会员', value: 'vip' },
|
||||
{ label: '仅非 VIP', value: 'free' },
|
||||
{ label: '仅认证用户', value: 'auth' },
|
||||
],
|
||||
dependsOn: { key: 'system_notice_enabled', value: true },
|
||||
},
|
||||
{ key: 'system_notice_title', label: '公告标题', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_content', label: '公告内容', type: 'textarea', default: '', rows: 5, dependsOn: { key: 'system_notice_enabled', value: true }, help: '支持 HTML 标签' },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'buttons',
|
||||
title: '按钮组(留空则不显示)',
|
||||
icon: 'fa fas fa-th-large',
|
||||
fields: [
|
||||
{ key: 'system_notice_btn1_text', label: '按钮 1 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn1_link', label: '按钮 1 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true }, help: '可选,填写后按钮变为链接' },
|
||||
{ key: 'system_notice_btn1_color', label: '按钮 1 颜色', type: 'select', default: 'primary', options: [
|
||||
{ label: '主题色', value: 'primary' },
|
||||
{ label: '成功绿', value: 'success' },
|
||||
{ label: '警告橙', value: 'warning' },
|
||||
{ label: '危险红', value: 'danger' },
|
||||
{ label: '信息蓝', value: 'info' },
|
||||
{ label: '深紫', value: 'purple' },
|
||||
{ label: '深灰', value: 'dark' },
|
||||
], dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn2_text', label: '按钮 2 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn2_link', label: '按钮 2 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn2_color', label: '按钮 2 颜色', type: 'select', default: 'primary', options: [
|
||||
{ label: '主题色', value: 'primary' },
|
||||
{ label: '成功绿', value: 'success' },
|
||||
{ label: '警告橙', value: 'warning' },
|
||||
{ label: '危险红', value: 'danger' },
|
||||
{ label: '信息蓝', value: 'info' },
|
||||
{ label: '深紫', value: 'purple' },
|
||||
{ label: '深灰', value: 'dark' },
|
||||
], dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn3_text', label: '按钮 3 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn3_link', label: '按钮 3 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn3_color', label: '按钮 3 颜色', type: 'select', default: 'primary', options: [
|
||||
{ label: '主题色', value: 'primary' },
|
||||
{ label: '成功绿', value: 'success' },
|
||||
{ label: '警告橙', value: 'warning' },
|
||||
{ label: '危险红', value: 'danger' },
|
||||
{ label: '信息蓝', value: 'info' },
|
||||
{ label: '深紫', value: 'purple' },
|
||||
{ label: '深灰', value: 'dark' },
|
||||
], dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn4_text', label: '按钮 4 文案', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn4_link', label: '按钮 4 链接', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_btn4_color', label: '按钮 4 颜色', type: 'select', default: 'primary', options: [
|
||||
{ label: '主题色', value: 'primary' },
|
||||
{ label: '成功绿', value: 'success' },
|
||||
{ label: '警告橙', value: 'warning' },
|
||||
{ label: '危险红', value: 'danger' },
|
||||
{ label: '信息蓝', value: 'info' },
|
||||
{ label: '深紫', value: 'purple' },
|
||||
{ label: '深灰', value: 'dark' },
|
||||
], dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'style',
|
||||
title: '样式设置',
|
||||
icon: 'fa fas fa-paint-brush',
|
||||
fields: [
|
||||
{
|
||||
key: 'system_notice_size',
|
||||
label: '弹窗尺寸',
|
||||
type: 'select',
|
||||
default: '',
|
||||
options: [
|
||||
{ label: '默认', value: '' },
|
||||
{ label: '迷你', value: 'modal-mini' },
|
||||
{ label: '小号', value: 'modal-sm' },
|
||||
{ label: '大号', value: 'modal-lg' },
|
||||
],
|
||||
dependsOn: { key: 'system_notice_enabled', value: true },
|
||||
},
|
||||
{ key: 'system_notice_radius', label: '按钮圆角', type: 'switch', default: false, dependsOn: { key: 'system_notice_enabled', value: true }, help: '开启后弹窗按钮使用圆角样式' },
|
||||
{ key: 'system_notice_class', label: '公告样式类', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_title_icon', label: '标题图标', type: 'icon', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
{ key: 'system_notice_title_class', label: '标题背景配色', type: 'select', default: '', dependsOn: { key: 'system_notice_enabled', value: true }, options: [
|
||||
{ label: '无', value: '' },
|
||||
{ label: '炫彩黄', value: 'jb-yellow' },
|
||||
{ label: '炫彩蓝', value: 'jb-blue' },
|
||||
{ label: '炫彩绿', value: 'jb-green' },
|
||||
{ label: '炫彩紫', value: 'jb-purple' },
|
||||
{ label: '炫彩红', value: 'jb-red' },
|
||||
{ label: '炫彩橙', value: 'jb-orange' },
|
||||
], help: '弹窗标题区域的背景配色方案' },
|
||||
{ key: 'system_notice_title_style', label: '标题样式', type: 'input', default: '', dependsOn: { key: 'system_notice_enabled', value: true } },
|
||||
],
|
||||
},
|
||||
{
|
||||
key: 'expire',
|
||||
title: '过期设置',
|
||||
icon: 'fa fas fa-clock',
|
||||
fields: [
|
||||
{ key: 'system_notice_expires', label: '弹窗周期(小时)', type: 'number', default: 24, min: 0, max: 720, dependsOn: { key: 'system_notice_enabled', value: true }, help: '0 表示永不过期' },
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
Loaded 100 of 1323 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user