wwt-platform 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wwt-platform",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "WWT 工作平台 - 平台本体与工具清单分发",
5
5
  "files": [
6
6
  "platform.html",
package/platform.html CHANGED
@@ -617,11 +617,14 @@ async function syncServerTools(){
617
617
  });
618
618
 
619
619
  j.tools.forEach(t => {
620
+ // 未安装的不进模块列表 —— 否则用户点开会看到「工具尚未安装」却没有安装入口。
621
+ // 它们会出现在「检查更新 → 🆕 发现新工具」里,那里有安装按钮。
622
+ if(!t.installed) return;
620
623
  const mod = (ST.modules||[]).find(x => x.id === t.module) || ST.modules[0];
621
624
  if(!mod) return;
622
625
  mod.tools.push({
623
626
  id:'srv_'+t.key, name:t.name, desc:t.desc, tag:t.tag||'HTML',
624
- skey:t.key, local:false, mkey:t.key, installed:!!t.installed, ver:t.ver
627
+ skey:t.key, local:false, mkey:t.key, installed:true, ver:t.ver
625
628
  });
626
629
  });
627
630
 
@@ -1426,7 +1429,7 @@ function doAddMod(){
1426
1429
  // ═══════════════════════════════════════════════════════════
1427
1430
  // 平台更新(方案B:平台 + 内置工具统一检查)
1428
1431
  // ═══════════════════════════════════════════════════════════
1429
- const PLATFORM_VER = '1.1.12';
1432
+ const PLATFORM_VER = '1.1.13';
1430
1433
  const NPM_PKG = 'wwt-platform'; // NPM 包名(主力分发源)
1431
1434
  const GITEE_TOKEN_KEY = 'wwt_gitee_token';
1432
1435
  const GITEE_TOKEN_DEF = 'e45883b9c89b8d9689746ce42bbc2b0b';
@@ -1451,7 +1454,7 @@ const SOURCES = [
1451
1454
  // 更新清单:每个条目 = 一个可更新对象(平台或工具)
1452
1455
  // 这是「离线兜底种子」——联网时会与远程 tools.json 合并,远程为准
1453
1456
  const UPD_REG_DEF = [
1454
- {key:'platform', name:'WWT 工作平台', cur:'1.1.12', repo:GITEE_PLATFORM_REPO, verFile:'version.js', appFile:'app.js', pat:'__WWT_PLATFORM_VER', kind:'platform'},
1457
+ {key:'platform', name:'WWT 工作平台', cur:'1.1.13', repo:GITEE_PLATFORM_REPO, verFile:'version.js', appFile:'app.js', pat:'__WWT_PLATFORM_VER', kind:'platform'},
1455
1458
  {key:'erp-recon', name:'ERP 对账工具', cur:'V1.0.2',repo:'wwtmrhu/erp-recon', verFile:'version.js', appFile:'app.js', pat:'__ERP_LATEST_VER'},
1456
1459
  {key:'erp-tool', name:'ERP 对账单生成匹配', cur:'1.0.0', repo:'wwtmrhu/erp-tool', verFile:'version.js', appFile:'app.js', pat:'__ERP_LATEST_VER'},
1457
1460
  {key:'voucher', name:'WWT 凭证工具', cur:'P1.2.12',repo:'wwtmrhu/certificate-generation', verFile:'dist/version.json', appFile:'', pat:'ver', appUrl:true}
@@ -1733,6 +1736,12 @@ async function downloadToolContent(it) {
1733
1736
  async function installTool(key) {
1734
1737
  const it = UPD_REG.find(x => x.key === key);
1735
1738
  if (!it) { toast('找不到该工具', 'err'); return; }
1739
+
1740
+ // exe 模式下工具由本地服务托管在磁盘上,安装必须走服务端。
1741
+ // 若走下面的浏览器端分支,会往 IndexedDB 另存一份,而清单里那条服务端工具
1742
+ // 依然在列表里 —— 结果是模块里出现两个同名工具,其中一个点开报「尚未安装」。
1743
+ if (SRV_MODE) return installToolViaServer(it);
1744
+
1736
1745
  toast('正在下载「' + it.name + '」…', 'info');
1737
1746
  try {
1738
1747
  const html = await downloadToolContent(it);
@@ -1757,6 +1766,26 @@ async function installTool(key) {
1757
1766
  }
1758
1767
  }
1759
1768
 
1769
+ // exe 模式:交给本地服务安装(下载 → 写入数据目录 → 平台重新同步)
1770
+ async function installToolViaServer(it) {
1771
+ toast('正在由本地服务下载「' + it.name + '」…', 'info');
1772
+ try {
1773
+ const r = await fetch(SRV.base + '/api/install?key=' + encodeURIComponent(it.key),
1774
+ {cache:'no-store'});
1775
+ const j = await r.json();
1776
+ if (!j.ok) throw new Error(j.error || '安装失败');
1777
+ await syncServerTools(); // 重新拉工具列表,装好的工具会出现在对应模块
1778
+ refreshNewTools();
1779
+ renderNav();
1780
+ if (curPage === 'home') renderHomeMods();
1781
+ toast('✓ 「' + it.name + '」已安装完成', 'ok');
1782
+ return true;
1783
+ } catch(e) {
1784
+ toast('安装失败:' + e.message, 'err');
1785
+ return false;
1786
+ }
1787
+ }
1788
+
1760
1789
  // 把已有界面工具与注册表关联(按名称匹配)
1761
1790
  function linkExistingTools() {
1762
1791
  let changed = false;
package/tools.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": 1,
3
- "platform": "1.1.12",
3
+ "platform": "1.1.13",
4
4
  "updatedAt": "2026-09-10",
5
5
  "note": "WWT 工作平台工具清单。新增/修改工具只需改这个文件并发布新版本,用户端自动同步,无需重新分发平台。",
6
6
  "tools": [
@@ -77,6 +77,21 @@
77
77
  "pat": "ver",
78
78
  "appUrl": true
79
79
  }
80
+ },
81
+ {
82
+ "key": "income",
83
+ "name": "收入统计明细生成器",
84
+ "module": "ana",
85
+ "desc": "按月生成收入统计与明细表(维修/销售分板块),导出 Excel",
86
+ "ver": "1.0.2",
87
+ "type": "html",
88
+ "tag": "HTML",
89
+ "path": "C:/Users/Administrator/Desktop/收入统计明细生成器.html",
90
+ "src": {
91
+ "type": "npm",
92
+ "pkg": "income-stat-report",
93
+ "file": "income-stat-report.html"
94
+ }
80
95
  }
81
96
  ]
82
97
  }