Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions plugins/project-cost/assets/index-DhlcU5lu.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions plugins/project-cost/assets/style-F2qJBtjJ.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions plugins/project-cost/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>项目费用管理</title>
<script type="module" crossorigin src="./assets/index-DhlcU5lu.js"></script>
<link rel="stylesheet" crossorigin href="./assets/style-F2qJBtjJ.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
Binary file added plugins/project-cost/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions plugins/project-cost/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"name": "project-cost",
"title": "项目费用管理",
"author": "Samson",
"description": "多项目费用台账:明细自动汇总金额链、付款跟踪与逾期提醒、品类预算预警、支付对象欠款排行,支持 Excel/CSV/JSON 导出。",
"version": "1.0.0",
"platform": [
"win32",
"darwin",
"linux"
],
"main": "index.html",
"logo": "logo.png",
"preload": "preload.js",
"features": [
{
"code": "project",
"explain": "项目费用管理(多项目 / 明细 / 付款 / 预算预警)",
"cmds": [
"项目费用",
"项目管理",
"费用管理",
"费用台账",
"项目记账",
"装修费用",
"装修",
"renovation",
"project",
"xm"
]
},
{
"code": "project-add",
"explain": "记一笔项目支出",
"cmds": [
"记项目支出",
"项目支出",
"新增支出",
"记账",
"记装修支出",
"装修支出"
]
},
{
"code": "project-pay",
"explain": "项目付款跟踪与逾期提醒",
"cmds": [
"项目付款",
"付款跟踪",
"待付",
"付款",
"装修付款"
]
}
],
"pluginSetting": {
"single": true
}
}
49 changes: 49 additions & 0 deletions plugins/project-cost/preload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* ZTools 插件 preload —— 以 Node 上下文运行。
* 本插件全部业务在渲染进程内完成(localStorage + 纯前端计算),
* 这里只暴露宿主环境信息,供页面做「是否在 ZTools 内运行」的判断与降级。
* 规范:不压缩、不混淆,保持清晰可读。
*/
(function () {
const api = {
appName: typeof window.ztools?.getAppName === 'function' ? window.ztools.getAppName() : 'browser',
platform: process.platform,
versions: {
electron: process.versions.electron || '',
chrome: process.versions.chrome || '',
node: process.versions.node || '',
},
/** 让窗口高度贴合台账视图(680 以内,避免超出小屏) */
fit: function (height) {
try {
if (window.ztools?.setExpendHeight) {
window.ztools.setExpendHeight(Math.min(Math.max(+height || 618, 360), 680));
}
} catch (e) {
/* 浏览器里预览时忽略 */
}
},
toast: function (msg) {
try {
window.ztools?.showToast?.(String(msg));
} catch (e) {
/* 忽略 */
}
},
};

try {
if (typeof window !== 'undefined' && window.contextBridge
&& typeof window.contextBridge.exposeInMainWorld === 'function') {
window.contextBridge.exposeInMainWorld('renovationApi', api);
return;
}
} catch (e) {
/* 落到下方兜底 */
}
try {
window.renovationApi = api;
} catch (e) {
/* 极端情况下 window 不可写,放弃暴露 */
}
})();
Loading