weaver-work-cli 0.1.53 → 0.1.56
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/dist/chunks/{archive-ZQ4A4TV6.js → archive-4SQAVTIB.js} +3 -2
- package/dist/chunks/{archive-oa-57R2FYHV.js → archive-oa-W2UEJ67L.js} +137 -8
- package/dist/chunks/{asset-ZOJVBWZH.js → asset-EGZEABBI.js} +3 -2
- package/dist/chunks/{asset-idle-XGB5IPGT.js → asset-idle-EBUZBB6M.js} +3 -2
- package/dist/chunks/{attachment-content-W3TSJC3Y.js → attachment-content-QGM5MLQE.js} +4 -3
- package/dist/chunks/{blog-QSHLZSFW.js → blog-2YKMWOWI.js} +3 -2
- package/dist/chunks/{caizhilian-KCQYFH72.js → caizhilian-QJ4FLSQJ.js} +5 -4
- package/dist/chunks/{calendar-DLGMRJQA.js → calendar-H4QTJCUY.js} +3 -2
- package/dist/chunks/{chunk-XPQN4E5O.js → chunk-44KJ7WFA.js} +300 -55
- package/dist/chunks/{chunk-CZNZKOHR.js → chunk-4GG72JAT.js} +2 -2
- package/dist/chunks/{chunk-YIKSL36S.js → chunk-5N222HK6.js} +2 -2
- package/dist/chunks/{chunk-6GCXWKG6.js → chunk-6DVL5IN5.js} +4 -1
- package/dist/chunks/{chunk-WTLQGS6D.js → chunk-6MS3RLPO.js} +5 -334
- package/dist/chunks/{chunk-Z4G7LLDD.js → chunk-7EBV7Q3R.js} +124 -27
- package/dist/chunks/{chunk-76PRVYH4.js → chunk-AHJZIMCX.js} +1 -1
- package/dist/chunks/{chunk-TGAGQV4I.js → chunk-CQ4OVCKG.js} +2 -2
- package/dist/chunks/{chunk-2BQESR2U.js → chunk-DVR2EDUU.js} +99 -34
- package/dist/chunks/{chunk-QQXMHM3J.js → chunk-FDAJC7R4.js} +4 -4
- package/dist/chunks/{chunk-GR76ZDDX.js → chunk-FMNCSYIG.js} +2 -2
- package/dist/chunks/{chunk-IF33CG4V.js → chunk-L2LMBFG5.js} +1 -1
- package/dist/chunks/{chunk-DLY5GUXX.js → chunk-PH7N4UFT.js} +1 -1
- package/dist/chunks/{chunk-U6R6FZHD.js → chunk-SFM3M2L3.js} +286 -93
- package/dist/chunks/chunk-SHYQUBY3.js +48 -0
- package/dist/chunks/{chunk-HFXK54M4.js → chunk-TGM7BWEH.js} +2 -2
- package/dist/chunks/{chunk-2J3XY4ED.js → chunk-TJUAGZU7.js} +11 -11
- package/dist/chunks/{chunk-PE334WL3.js → chunk-UI66EMOR.js} +4 -4
- package/dist/chunks/{chunk-762M5XJS.js → chunk-VMCCRWFO.js} +2 -2
- package/dist/chunks/{chunk-U7ROML5E.js → chunk-WHJIUKJW.js} +681 -48
- package/dist/chunks/{chunk-PGO4ILMQ.js → chunk-WMB3SMXI.js} +1 -1
- package/dist/chunks/chunk-WMRNO6IU.js +337 -0
- package/dist/chunks/{chunk-6NXT4ICB.js → chunk-WVH5ESDA.js} +1 -1
- package/dist/chunks/{chunk-DEHJ7PMA.js → chunk-XU3FL3AW.js} +4 -4
- package/dist/chunks/{chunk-Z6UUBY37.js → chunk-Z4IPY5GV.js} +2 -2
- package/dist/chunks/{conflict-57WDJWL7.js → conflict-VAFFPUY3.js} +2 -2
- package/dist/chunks/{contract-LJRAXVZU.js → contract-LLRKMLQQ.js} +2655 -1319
- package/dist/chunks/{cowork-3ACICHDQ.js → cowork-2RDFBZWB.js} +3 -2
- package/dist/chunks/{create-flow-3FMMZBCA.js → create-flow-TVYE3IOH.js} +6 -6
- package/dist/chunks/{data-WK5CQXNF.js → data-WVICO3DT.js} +57 -11
- package/dist/chunks/{ebuilder-form-CBYI6CQ6.js → ebuilder-form-TWSXS5NA.js} +7 -6
- package/dist/chunks/{ehr-XI4BIVR2.js → ehr-52GBKNJR.js} +3 -2
- package/dist/chunks/{env-JYZE3BZB.js → env-BVVFIN4P.js} +2 -2
- package/dist/chunks/{esb-4BQHNP5C.js → esb-HJSXCEOM.js} +5 -4
- package/dist/chunks/{factory-66SCIKW3.js → factory-RCQ36LLE.js} +1 -1
- package/dist/chunks/{fna-ECOYBQYL.js → fna-OBACRT3J.js} +72 -3
- package/dist/chunks/{group-chat-MNRYMLNG.js → group-chat-YFZDUUY3.js} +3 -3
- package/dist/chunks/{host-TUOIOEMC.js → host-2BKMPWDH.js} +4 -3
- package/dist/chunks/{host-3TNBMDTR.js → host-KJT3G5D2.js} +4 -3
- package/dist/chunks/{host-7OWWPLM4.js → host-KOWUMNAY.js} +4 -3
- package/dist/chunks/{host-M4XP5URR.js → host-MFXRA2MY.js} +4 -3
- package/dist/chunks/{host-7NTIBSPK.js → host-TTSGY5NZ.js} +4 -3
- package/dist/chunks/{host-G3VU7SDW.js → host-W4JCNRFS.js} +4 -3
- package/dist/chunks/{hrm-YGIR3HGF.js → hrm-AK3WGBMN.js} +4 -3
- package/dist/chunks/{im-TN2JYVGJ.js → im-JZSBPO4Z.js} +4 -3
- package/dist/chunks/{invoice-V7ZTITUO.js → invoice-V6KD4TZE.js} +4 -3
- package/dist/chunks/{jiuchuanhui-ASFZBMPU.js → jiuchuanhui-K4EQU6GK.js} +3 -2
- package/dist/chunks/{lazy-dispatch-XSAHDK6Z.js → lazy-dispatch-JHGFCKJN.js} +5 -4
- package/dist/chunks/{mail-M3HJF5ER.js → mail-IKVCQCVZ.js} +3 -2
- package/dist/chunks/{meeting-IIY4UAJL.js → meeting-JOHV4RH3.js} +14 -12
- package/dist/chunks/minute-doc-JLS4KMFZ.js +156 -0
- package/dist/chunks/{okr-EVX7FB5G.js → okr-KV43FPPX.js} +3 -2
- package/dist/chunks/{operations-J7PUIVWZ.js → operations-ZPWBMYKE.js} +5 -4
- package/dist/chunks/{plan-2QJQEPBO.js → plan-WOYR4WEG.js} +3 -2
- package/dist/chunks/{project-XELELW2T.js → project-CQJKBUIL.js} +3 -2
- package/dist/chunks/{reception-QGPNTGHG.js → reception-MPBU3JXC.js} +3 -2
- package/dist/chunks/{recruit-stage-XCMVEQA2.js → recruit-stage-USTTRHOX.js} +3 -2
- package/dist/chunks/{registry-CJOVECZD.js → registry-GURQG4ZV.js} +3 -2
- package/dist/chunks/{registry-METZ2LWE.js → registry-LITYOH2W.js} +12 -10
- package/dist/chunks/{registry-QJCZ2GVG.js → registry-SS5J2FZQ.js} +5 -4
- package/dist/chunks/{room-recommend-YFY7HTOF.js → room-recommend-62MECG4J.js} +4 -4
- package/dist/chunks/{schedule-6I63TERA.js → schedule-6QRXIBGU.js} +4 -4
- package/dist/chunks/{smart-extract-FOUYNIG3.js → smart-extract-APX2PNIN.js} +3 -2
- package/dist/chunks/{workflow-YHXFIU63.js → workflow-WMPW3WSB.js} +5 -4
- package/dist/index.js +33 -32
- package/dist/internal/e10/auth/agent-host-key.js +68 -0
- package/dist/internal/e10/auth/agent-hosts.js +250 -0
- package/dist/internal/e10/auth/commands.js +99 -30
- package/dist/internal/e10/auth/paths.js +9 -0
- package/dist/internal/e10/auth/session.js +17 -0
- package/dist/internal/e10/auth/xiaoe.js +37 -3
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +106 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +38 -4
- package/dist/shortcuts/archive-oa/operations/registry.js +2 -1
- package/dist/shortcuts/contract/index.js +6 -7
- package/dist/shortcuts/contract/manifest.js +101 -24
- package/dist/shortcuts/contract/ooxml/docx-table.js +75 -3
- package/dist/shortcuts/contract/ooxml/xlsx.js +49 -13
- package/dist/shortcuts/contract/operations/card-action.js +113 -12
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +29 -7
- package/dist/shortcuts/contract/operations/card-plan.js +75 -9
- package/dist/shortcuts/contract/operations/card-risk-report.js +2 -2
- package/dist/shortcuts/contract/operations/card.js +1 -1
- package/dist/shortcuts/contract/operations/clause-library.js +88 -16
- package/dist/shortcuts/contract/operations/compare-screen.js +378 -0
- package/dist/shortcuts/contract/operations/compare.js +1 -1
- package/dist/shortcuts/contract/operations/credit-page.js +1 -1
- package/dist/shortcuts/contract/operations/docx-slots.js +1000 -0
- package/dist/shortcuts/contract/operations/flow.js +2 -2
- package/dist/shortcuts/contract/operations/quote-to-contract.js +495 -0
- package/dist/shortcuts/contract/operations/quote.js +2 -229
- package/dist/shortcuts/contract/operations/recommend.js +1 -1
- package/dist/shortcuts/contract/operations/registry.js +6 -2
- package/dist/shortcuts/contract/operations/review.js +230 -4
- package/dist/shortcuts/contract/operations/save-recognize.js +122 -3
- package/dist/shortcuts/contract/operations/template.js +11 -10
- package/dist/shortcuts/data/operations/ds.js +5 -5
- package/dist/shortcuts/data/operations/shared.js +76 -4
- package/dist/shortcuts/fna/manifest.js +7 -2
- package/dist/shortcuts/fna/operations/budget.js +68 -0
- package/dist/shortcuts/meeting/minute-doc.js +153 -0
- package/dist/shortcuts/meeting/operations/compose-outcome.js +176 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +47 -0
- package/dist/shortcuts/meeting/operations/eb/decision-task-batch.js +144 -0
- package/dist/shortcuts/meeting/operations/eb/decision.js +92 -4
- package/dist/shortcuts/meeting/operations/eb/index.js +133 -4
- package/dist/shortcuts/meeting/operations/eb/meeting-link.js +90 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +46 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +61 -0
- package/dist/shortcuts/meeting/operations/registry.js +14 -1
- package/dist/shortcuts/meeting/operations/self-check.js +49 -0
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +114 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +72 -46
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +41 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +46 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +18 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroupAdd.js +51 -0
- package/docs/e10-auth.md +78 -0
- package/docs/fna.md +8 -3
- package/package.json +4 -2
- package/scripts/pack-offline.mjs +228 -0
- package/scripts/package-skill.mjs +14 -5
- package/skill-template/business-info.json +3 -0
- package/skill-template/domains/qiyecheng.md +4 -3
- package/skills/weaver-e10-archive-oa/SKILL.md +6 -1
- package/skills/weaver-e10-archive-oa/references/contract-search.md +91 -4
- package/skills/weaver-e10-jinchengda/SKILL.md +100 -81
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +11 -6
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +38 -12
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +20 -6
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +8 -3
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +56 -13
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +7 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +11 -5
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +38 -7
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +13 -25
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +9 -8
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +8 -6
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +3 -1
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +26 -18
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -13
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +5 -3
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +105 -49
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +3 -6
- package/skills/weaver-e10-meeting/SKILL.md +48 -9
- package/skills/weaver-e10-qiyecheng/SKILL.md +16 -7
- package/skills/weaver-e10-qiyecheng/references/budget.md +77 -3
- package/skills/weaver-e10-qiyecheng/references/catalog.md +6 -4
- package/skills/weaver-e10-qiyecheng/references/getEnabledTemplate-api.md +255 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +70 -25
- package/skills/weaver-e10-workflow/SKILL.md +54 -40
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +134 -0
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +102 -80
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +23 -13
- package/skills/weaver-e10-workflow/references/workflow-query.md +68 -46
- package/skills/weaver-e10-workflow/references/workflow-view.md +21 -13
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +317 -332
- package/dist/shortcuts/contract/ooxml/docx.js +0 -295
- package/dist/shortcuts/contract/operations/docx-fillfromquote.js +0 -532
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +0 -178
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +0 -1270
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +0 -998
- package/skills/weaver-e10-workflow/tools/todo-serve.cjs +0 -327
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
<section id='{{CARD_ID}}' style='padding:16px 18px;font-family:sans-serif;background:#fafbfd;border-radius:12px'>
|
|
2
|
-
|
|
3
|
-
<div style='display:flex;align-items:center;justify-content:space-between;margin-bottom:16px'>
|
|
4
|
-
<div>
|
|
5
|
-
<div style='font-size:17px;font-weight:700;color:#1f2430'>合同风险审查报告</div>
|
|
6
|
-
<div style='font-size:12px;color:#7a8497;margin-top:4px'>{{CONTRACT_NAME}}</div>
|
|
7
|
-
</div>
|
|
8
|
-
<div style='flex:0 0 auto;display:flex;align-items:center;gap:8px'>
|
|
9
|
-
<button type='button' data-act='download' style='background:#fff;color:#1d6fd8;border:1px solid #1d6fd8;border-radius:8px;padding:8px 16px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit'>下载报告</button>
|
|
10
|
-
<button type='button' data-act='detail' style='background:#1d6fd8;color:#fff;border:none;border-radius:8px;padding:9px 18px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit'>查看审查详情</button>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<div style='background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-bottom:14px'>
|
|
15
|
-
<div style='font-size:14px;font-weight:700;color:#1f2430;margin-bottom:12px'>审查基本信息</div>
|
|
16
|
-
<table style='border-collapse:collapse;width:100%;font-size:13px'>{{TINFO}}</table>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div style='font-size:14px;font-weight:700;color:#1f2430;margin:0 0 10px 2px'>审查统计</div>
|
|
20
|
-
<div style='display:flex;gap:12px;margin-bottom:18px;flex-wrap:wrap'>
|
|
21
|
-
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
22
|
-
<div style='font-size:26px;font-weight:700;color:#1f2430'>{{STAT_TOTAL}}</div>
|
|
23
|
-
<div style='font-size:12px;color:#7a8497;margin-top:4px'>审查规则总数</div>
|
|
24
|
-
</div>
|
|
25
|
-
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
26
|
-
<div style='font-size:26px;font-weight:700;color:#1a9c5b'>{{STAT_NO_RISK}}</div>
|
|
27
|
-
<div style='font-size:12px;color:#7a8497;margin-top:4px'>判定无风险</div>
|
|
28
|
-
</div>
|
|
29
|
-
<div style='flex:1;min-width:130px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;text-align:center'>
|
|
30
|
-
<div style='font-size:26px;font-weight:700;color:#c0392b'>{{STAT_RISK}}</div>
|
|
31
|
-
<div style='font-size:12px;color:#7a8497;margin-top:4px'>判定有风险</div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
|
|
35
|
-
<div style='font-size:14px;font-weight:700;color:#1f2430;margin:18px 0 10px 2px'>风险详情({{RISK_COUNT}} 条)</div>
|
|
36
|
-
{{RISK_ITEMS}}
|
|
37
|
-
|
|
38
|
-
<div style='background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-top:6px'>
|
|
39
|
-
<div style='font-size:14px;font-weight:700;color:#1f2430;margin-bottom:4px'>审查通过({{PASS_COUNT}} 条)</div>
|
|
40
|
-
<div style='font-size:12px;color:#7a8497;margin-bottom:12px'>以下规则已执行判定,未发现与规则冲突的条款</div>
|
|
41
|
-
{{PASS_TAGS}}
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<p data-status style='margin:10px 0 0;color:#b45309;font-size:12px'></p>
|
|
45
|
-
</section>
|
|
46
|
-
<script>
|
|
47
|
-
(function () {
|
|
48
|
-
var CARD_ID = '{{CARD_ID}}';
|
|
49
|
-
var FILE_BASE = '{{FILE_BASE}}';
|
|
50
|
-
|
|
51
|
-
function getRoot() {
|
|
52
|
-
var el = null;
|
|
53
|
-
var sc = document.currentScript;
|
|
54
|
-
if (sc && sc.previousElementSibling && sc.previousElementSibling.id === CARD_ID) {
|
|
55
|
-
el = sc.previousElementSibling;
|
|
56
|
-
}
|
|
57
|
-
if (!el) { el = document.getElementById(CARD_ID); }
|
|
58
|
-
if (!el && document.querySelector) { el = document.querySelector('#' + CARD_ID); }
|
|
59
|
-
return el;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
var root = getRoot();
|
|
63
|
-
if (!root) { return; }
|
|
64
|
-
|
|
65
|
-
var statusEl = root.querySelector('[data-status]');
|
|
66
|
-
function say(m) { if (statusEl) { statusEl.textContent = m; } }
|
|
67
|
-
|
|
68
|
-
function getPlugin() {
|
|
69
|
-
if (window.xiaoePlugin) { return window.xiaoePlugin; }
|
|
70
|
-
if (window.rawWindow && window.rawWindow.xiaoePlugin) { return window.rawWindow.xiaoePlugin; }
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var DETAIL_CFG = {{DETAIL_CFG}};
|
|
75
|
-
|
|
76
|
-
function openDetail() {
|
|
77
|
-
var plugin = getPlugin();
|
|
78
|
-
if (!plugin || !plugin.rightPanel || typeof plugin.rightPanel.open !== 'function') {
|
|
79
|
-
say('当前环境不支持打开右侧面板,请在小e客户端内查看');
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
say('正在打开审查详情…');
|
|
83
|
-
try {
|
|
84
|
-
plugin.rightPanel.open(DETAIL_CFG);
|
|
85
|
-
say('');
|
|
86
|
-
} catch (err) {
|
|
87
|
-
say('审查详情打开失败,请确认右侧面板已挂载');
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// 导出前先克隆,去掉脚本、按钮与提示位,得到干净的静态报告
|
|
92
|
-
function cleanClone() {
|
|
93
|
-
var clone = root.cloneNode(true);
|
|
94
|
-
var nodes = clone.querySelectorAll('script, [data-act], [data-status]');
|
|
95
|
-
var i;
|
|
96
|
-
for (i = nodes.length - 1; i >= 0; i--) {
|
|
97
|
-
if (nodes[i].parentNode) { nodes[i].parentNode.removeChild(nodes[i]); }
|
|
98
|
-
}
|
|
99
|
-
return clone;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function downloadReport() {
|
|
103
|
-
var doc = root.ownerDocument || document;
|
|
104
|
-
var clone = cleanClone();
|
|
105
|
-
var html = '<!DOCTYPE html><html><head><meta charset=\'utf-8\'>'
|
|
106
|
-
+ '<title>' + FILE_BASE + '</title>'
|
|
107
|
-
+ '<style>body{margin:0;padding:16px;background:#fafbfd;font-family:sans-serif}'
|
|
108
|
-
+ '@media print{body{background:#fff}}</style></head><body>'
|
|
109
|
-
+ clone.outerHTML + '</body></html>';
|
|
110
|
-
|
|
111
|
-
if (!window.Blob || !window.URL || typeof window.URL.createObjectURL !== 'function') {
|
|
112
|
-
say('当前环境不支持文件下载,请在小e客户端内使用');
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
var url;
|
|
117
|
-
try {
|
|
118
|
-
url = window.URL.createObjectURL(new Blob([html], { type: 'text/html;charset=utf-8' }));
|
|
119
|
-
} catch (err) {
|
|
120
|
-
say('报告生成失败,请稍后重试');
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
var a = doc.createElement('a');
|
|
125
|
-
a.href = url;
|
|
126
|
-
a.download = FILE_BASE + '.html';
|
|
127
|
-
a.style.display = 'none';
|
|
128
|
-
if (doc.body && doc.body.appendChild) { doc.body.appendChild(a); }
|
|
129
|
-
a.click();
|
|
130
|
-
if (a.parentNode) { a.parentNode.removeChild(a); }
|
|
131
|
-
setTimeout(function () { window.URL.revokeObjectURL(url); }, 1500);
|
|
132
|
-
say('报告已开始下载:' + FILE_BASE + '.html');
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// 事件委托:绑定在报告根节点上,避免子元素取不到导致点击无响应
|
|
136
|
-
root.addEventListener('click', function (e) {
|
|
137
|
-
var t = e.target;
|
|
138
|
-
var act = null;
|
|
139
|
-
while (t && t !== root) {
|
|
140
|
-
if (t.getAttribute) {
|
|
141
|
-
act = t.getAttribute('data-act');
|
|
142
|
-
if (act) { break; }
|
|
143
|
-
}
|
|
144
|
-
t = t.parentNode;
|
|
145
|
-
}
|
|
146
|
-
if (act === 'detail') { openDetail(); return; }
|
|
147
|
-
if (act === 'download') { downloadReport(); return; }
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
root.addEventListener('mouseover', function (e) {
|
|
151
|
-
var t = e.target;
|
|
152
|
-
var act = null;
|
|
153
|
-
while (t && t !== root) {
|
|
154
|
-
if (t.getAttribute) {
|
|
155
|
-
act = t.getAttribute('data-act');
|
|
156
|
-
if (act) { break; }
|
|
157
|
-
}
|
|
158
|
-
t = t.parentNode;
|
|
159
|
-
}
|
|
160
|
-
if (act === 'detail') { t.style.background = '#1659b8'; }
|
|
161
|
-
if (act === 'download') { t.style.background = '#eef4fd'; }
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
root.addEventListener('mouseout', function (e) {
|
|
165
|
-
var t = e.target;
|
|
166
|
-
var act = null;
|
|
167
|
-
while (t && t !== root) {
|
|
168
|
-
if (t.getAttribute) {
|
|
169
|
-
act = t.getAttribute('data-act');
|
|
170
|
-
if (act) { break; }
|
|
171
|
-
}
|
|
172
|
-
t = t.parentNode;
|
|
173
|
-
}
|
|
174
|
-
if (act === 'detail') { t.style.background = '#1d6fd8'; }
|
|
175
|
-
if (act === 'download') { t.style.background = '#fff'; }
|
|
176
|
-
});
|
|
177
|
-
})();
|
|
178
|
-
</script>
|