dsh-total-quality 2.0.56 → 2.0.57
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/README.en.md +2 -2
- package/README.md +3 -3
- package/host.cjs +32 -24
- package/package.json +3 -2
- package/public/js/pages-company-knowledge.js +8 -31
- package/public/js/pages-qms.js +1 -1
- package/resources/qms-templates/019ffb58f24ed48d.docx +0 -0
- package/resources/qms-templates/04a69165fc15143a.docx +0 -0
- package/resources/qms-templates/09af69358c989a63.docx +0 -0
- package/resources/qms-templates/0e7ac77844e45311.docx +0 -0
- package/resources/qms-templates/12446a1b5e173c71.docx +0 -0
- package/resources/qms-templates/15ae40f67f9a3efc.docx +0 -0
- package/resources/qms-templates/18a69bbebf2ece7f.docx +0 -0
- package/resources/qms-templates/1978faa989134f02.docx +0 -0
- package/resources/qms-templates/1a30e121de752f7b.docx +0 -0
- package/resources/qms-templates/1b88907969ea7d4c.docx +0 -0
- package/resources/qms-templates/1e92b808722bf90a.docx +0 -0
- package/resources/qms-templates/2091cad340dc0e7f.docx +0 -0
- package/resources/qms-templates/271ae1002c896ed7.docx +0 -0
- package/resources/qms-templates/280ce53e5d3b5fcf.docx +0 -0
- package/resources/qms-templates/28ca8e4ede0adf6d.docx +0 -0
- package/resources/qms-templates/2ac6675f3cb1f993.docx +0 -0
- package/resources/qms-templates/2c3b799389909d8b.docx +0 -0
- package/resources/qms-templates/2c51038ba2cc3264.docx +0 -0
- package/resources/qms-templates/30c888851d16d764.docx +0 -0
- package/resources/qms-templates/3459fc4daaa2743d.docx +0 -0
- package/resources/qms-templates/3751dafc335e0e80.docx +0 -0
- package/resources/qms-templates/38798cd4298cd2db.docx +0 -0
- package/resources/qms-templates/38f551f9d738ab0a.docx +0 -0
- package/resources/qms-templates/3c85a23ea17018b4.docx +0 -0
- package/resources/qms-templates/3cdb7d14caf1b852.docx +0 -0
- package/resources/qms-templates/3f23239bb6b3e1db.docx +0 -0
- package/resources/qms-templates/42a5b9efeeaa8007.docx +0 -0
- package/resources/qms-templates/47352aafe9b8dac1.docx +0 -0
- package/resources/qms-templates/495359b1e3cbb8fe.docx +0 -0
- package/resources/qms-templates/4ca6920464785166.docx +0 -0
- package/resources/qms-templates/4ce862582a7791be.docx +0 -0
- package/resources/qms-templates/54c9a02a10991b9e.docx +0 -0
- package/resources/qms-templates/5aeb8fddf5f3693f.docx +0 -0
- package/resources/qms-templates/5d7e5576b0e73be7.docx +0 -0
- package/resources/qms-templates/5db3a40edac37791.docx +0 -0
- package/resources/qms-templates/5ffa21eb78eb6f77.docx +0 -0
- package/resources/qms-templates/60d0fbcb709b7161.docx +0 -0
- package/resources/qms-templates/63e1d3a166756095.docx +0 -0
- package/resources/qms-templates/65c724c080d32f10.docx +0 -0
- package/resources/qms-templates/674bd7826c6cbac2.docx +0 -0
- package/resources/qms-templates/677e851acca1b879.docx +0 -0
- package/resources/qms-templates/6bf15feb1a0d2a8d.docx +0 -0
- package/resources/qms-templates/6c3889c7d0918db9.docx +0 -0
- package/resources/qms-templates/6c4c349eeb0a96a8.docx +0 -0
- package/resources/qms-templates/6c5befbd33f759c1.docx +0 -0
- package/resources/qms-templates/6df8367901347508.docx +0 -0
- package/resources/qms-templates/71db51997037692b.docx +0 -0
- package/resources/qms-templates/78a8ef8c76510c99.docx +0 -0
- package/resources/qms-templates/8397bfd1c0a1b013.docx +0 -0
- package/resources/qms-templates/84d750cf858b60a1.docx +0 -0
- package/resources/qms-templates/880de58a4b334533.docx +0 -0
- package/resources/qms-templates/88c37d1b87d9b78c.docx +0 -0
- package/resources/qms-templates/88e9cd42f1849462.docx +0 -0
- package/resources/qms-templates/8956597403be35b6.docx +0 -0
- package/resources/qms-templates/94675c810a233e1f.docx +0 -0
- package/resources/qms-templates/94dff59dd7ebec6e.docx +0 -0
- package/resources/qms-templates/9670b9cd02141594.docx +0 -0
- package/resources/qms-templates/98c373ebd7b5163d.docx +0 -0
- package/resources/qms-templates/a4078cf2378a9388.docx +0 -0
- package/resources/qms-templates/a5b110c7ef917139.docx +0 -0
- package/resources/qms-templates/aec75820e45774be.docx +0 -0
- package/resources/qms-templates/b31c085e281d230c.docx +0 -0
- package/resources/qms-templates/b7c1c3c72f8ffeef.docx +0 -0
- package/resources/qms-templates/b81b82eaa5c8f422.docx +0 -0
- package/resources/qms-templates/b92a2fa31f75f137.docx +0 -0
- package/resources/qms-templates/b96c54ae9cfffc54.docx +0 -0
- package/resources/qms-templates/bc47cfd626c010e7.docx +0 -0
- package/resources/qms-templates/be60792734afca69.docx +0 -0
- package/resources/qms-templates/c0018d8ae9ad19e1.docx +0 -0
- package/resources/qms-templates/c171027c964c8be3.docx +0 -0
- package/resources/qms-templates/c4b93d71f5d98b4b.docx +0 -0
- package/resources/qms-templates/c531da29fcb3090f.docx +0 -0
- package/resources/qms-templates/c88eddd43358d015.docx +0 -0
- package/resources/qms-templates/cb978da542f0d892.docx +0 -0
- package/resources/qms-templates/ccde4a94532a8d36.docx +0 -0
- package/resources/qms-templates/cf3fb1e20ae6f24d.docx +0 -0
- package/resources/qms-templates/d231b4982fc8113e.docx +0 -0
- package/resources/qms-templates/d3c55aa5ed14055c.docx +0 -0
- package/resources/qms-templates/db45c44a00a13349.docx +0 -0
- package/resources/qms-templates/db849a41210f54e0.docx +0 -0
- package/resources/qms-templates/dba9ce363d83ddc8.docx +0 -0
- package/resources/qms-templates/dca3ea4c95eb2225.docx +0 -0
- package/resources/qms-templates/dfa4220d2b6b8131.docx +0 -0
- package/resources/qms-templates/dfa51222c777734f.docx +0 -0
- package/resources/qms-templates/e07ea511507e14f5.docx +0 -0
- package/resources/qms-templates/e0a2e00c03458dfa.docx +0 -0
- package/resources/qms-templates/e0e802f46b6764d1.docx +0 -0
- package/resources/qms-templates/e53fc85717f2852b.docx +0 -0
- package/resources/qms-templates/e9dd82d5e54520e5.docx +0 -0
- package/resources/qms-templates/ea7bfc22c06d82a9.docx +0 -0
- package/resources/qms-templates/ecf0db9f37294536.docx +0 -0
- package/resources/qms-templates/f05fcfc87e82ff39.docx +0 -0
- package/resources/qms-templates/fb9e56a17c4a4f97.docx +0 -0
- package/resources/qms-templates/manifest.json +932 -0
- package/src/lib/company-library.js +28 -19
- package/src/lib/qms-jobs.js +11 -7
- package/src/lib/qms-templates.js +42 -10
- package//345/256/211/350/243/205/350/257/264/346/230/216.md +2 -2
package/README.en.md
CHANGED
|
@@ -13,10 +13,10 @@ Quanzhi connects shop-floor reporting, quality analysis, reviews, and controlled
|
|
|
13
13
|
|
|
14
14
|
Enter `dsh-total-quality` in DSH’s Add Plugin dialog to install the latest npm version. The GitHub release also provides an installable bundle.
|
|
15
15
|
|
|
16
|
-
Download `qip-real-workbench-2.0.
|
|
16
|
+
Download `qip-real-workbench-2.0.57.tgz` from the [latest release](https://github.com/total-quality/dsh-total-quality/releases/latest) and install it in the DSH Web profile. Open **全质开源质量平台** in the sidebar. Choose an empty workspace for company records or load sample data for a trial.
|
|
17
17
|
|
|
18
18
|
```sh
|
|
19
|
-
dsh plugin --profile web add https://github.com/total-quality/dsh-total-quality/releases/download/v2.0.
|
|
19
|
+
dsh plugin --profile web add https://github.com/total-quality/dsh-total-quality/releases/download/v2.0.57/qip-real-workbench-2.0.57.tgz
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## What you can do
|
package/README.md
CHANGED
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
|
|
35
35
|
在 DSH 的「添加插件」中输入 `dsh-total-quality`,即可从 npm 安装最新版。也可以通过 GitHub 安装包安装。
|
|
36
36
|
|
|
37
|
-
1. 在 [发布页](https://github.com/total-quality/dsh-total-quality/releases/latest) 下载 `qip-real-workbench-2.0.
|
|
37
|
+
1. 在 [发布页](https://github.com/total-quality/dsh-total-quality/releases/latest) 下载 `qip-real-workbench-2.0.57.tgz`,添加到 DeepSeek Harness 的 Web 插件配置。装好后打开侧栏 **「全质开源质量平台」**。
|
|
38
38
|
2. 首次打开可选择「开始使用」建立空白台账,或在试用环境选择「体验示例」。在「我 → 企业设置」录入公司、车间和产品,再从数据管理下载导入模板。
|
|
39
39
|
3. 验证最小流程时,先上报一条异常,打开事项详情,核对责任人、证据和进度。操作路径见[工作台使用与数据迁移](docs/enterprise-onboarding.md)。
|
|
40
40
|
|
|
41
41
|
DSH Web 版可以直接安装:
|
|
42
42
|
|
|
43
43
|
```sh
|
|
44
|
-
dsh plugin --profile web add https://github.com/total-quality/dsh-total-quality/releases/download/v2.0.
|
|
44
|
+
dsh plugin --profile web add https://github.com/total-quality/dsh-total-quality/releases/download/v2.0.57/qip-real-workbench-2.0.57.tgz
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
[完整安装说明](安装说明.md) · [本地开发和自检](CONTRIBUTING.md)
|
|
@@ -60,7 +60,7 @@ dsh plugin --profile web add https://github.com/total-quality/dsh-total-quality/
|
|
|
60
60
|
|
|
61
61
|
在企业知识库上传作业指导书,维护文件编号、版次、生效日期及适用范围。小质能根据提问判断该列出文件目录、查阅文件正文还是解答通用问题,并引用查到的适用原文。
|
|
62
62
|
|
|
63
|
-
体系人员可把企业知识库里的手册和程序文件作为模板,结合已保存的体系调研和企业设置生成 Word
|
|
63
|
+
体系人员可把企业知识库里的手册和程序文件作为模板,结合已保存的体系调研和企业设置生成 Word 草稿。缺少适用的企业原件时,使用所选体系的平台模板。平台模板仅用于生成。生成结果在相应的「已生成」列表预览、下载或删除。提交前可对照原模板复核章次、职责、数据和附件引用。
|
|
64
64
|
|
|
65
65
|
## 功能特性
|
|
66
66
|
|
package/host.cjs
CHANGED
|
@@ -105,7 +105,7 @@ function signatureFor(req, delegationId) {
|
|
|
105
105
|
|
|
106
106
|
const qms = require('./src/lib/qms');
|
|
107
107
|
const { createJobs } = require('./src/lib/qms-jobs');
|
|
108
|
-
const { createTemplateLibrary, maxPackBytes } = require('./src/lib/qms-templates');
|
|
108
|
+
const { createTemplateLibrary, maxPackBytes, platformOriginalDigests } = require('./src/lib/qms-templates');
|
|
109
109
|
const companyLibrary = require('./src/lib/company-library');
|
|
110
110
|
const kbRevision = require('./src/lib/kb-revision');
|
|
111
111
|
const enterpriseSurvey = require('./src/lib/enterprise-survey');
|
|
@@ -1075,7 +1075,8 @@ function chatList(row, editable, req) {
|
|
|
1075
1075
|
return {
|
|
1076
1076
|
role: message.role, ts: message.ts, state: message.state, finishReason:message.finishReason, mode: message.mode, scope:message.scope, note:message.note,
|
|
1077
1077
|
answerId: editable && message.state === 'incomplete' && answers.canResume(message.answerId) ? message.answerId : undefined,
|
|
1078
|
-
sources: Array.isArray(message.sources)
|
|
1078
|
+
sources: row.mode!=='quality-expert' && Array.isArray(message.sources)
|
|
1079
|
+
? message.sources.filter(source => source.kind!=='专家资料') : undefined,
|
|
1079
1080
|
content: message.role === 'assistant' ? answers.visibleAnswer(message.content) || '这条历史回复未完整生成。' : message.content,
|
|
1080
1081
|
pending: actions,
|
|
1081
1082
|
};
|
|
@@ -2255,7 +2256,7 @@ route('GET', /^\/api\/system\/model$/, async (req, res) => {
|
|
|
2255
2256
|
/* ---------------- 企业知识库与专家问答 ---------------- */
|
|
2256
2257
|
let enterpriseKnowledge;
|
|
2257
2258
|
function enterpriseLibrary() {
|
|
2258
|
-
return enterpriseKnowledge ||= companyLibrary.open(DATA_DIR);
|
|
2259
|
+
return enterpriseKnowledge ||= companyLibrary.open(DATA_DIR, {hiddenTemplateDigests:platformOriginalDigests});
|
|
2259
2260
|
}
|
|
2260
2261
|
const businessBackups = require('./src/lib/business-backup').createBackups({
|
|
2261
2262
|
store, library:enterpriseLibrary, supplierLibrary:supplierFiles,
|
|
@@ -2375,11 +2376,11 @@ route('POST', /^\/api\/backups\/restore\/([a-f0-9-]+)$/, async (req,res,id) => {
|
|
|
2375
2376
|
});
|
|
2376
2377
|
|
|
2377
2378
|
route('GET', /^\/api\/enterprise-kb$/, async (req, res) => {
|
|
2378
|
-
sendJson(res, 200, { ok: true, ...enterpriseLibrary().list()
|
|
2379
|
+
sendJson(res, 200, { ok: true, ...enterpriseLibrary().list('company') });
|
|
2379
2380
|
});
|
|
2380
2381
|
route('GET', /^\/api\/enterprise-kb\/passages\/([^/]+)$/, async (req, res, id) => {
|
|
2381
2382
|
const library = enterpriseLibrary();
|
|
2382
|
-
const file = library.document(id);
|
|
2383
|
+
const file = library.document(id, 'company');
|
|
2383
2384
|
const { q, page } = qs(req);
|
|
2384
2385
|
const requested = Number(page || 1);
|
|
2385
2386
|
const current = Number.isSafeInteger(requested) && requested >= 1 && requested <= 10000 ? requested : 1;
|
|
@@ -2387,26 +2388,29 @@ route('GET', /^\/api\/enterprise-kb\/passages\/([^/]+)$/, async (req, res, id) =
|
|
|
2387
2388
|
sendJson(res, 200, { ok: true, ...passages, title: file.name, indexStatus: file.indexStatus, page: current });
|
|
2388
2389
|
});
|
|
2389
2390
|
route('GET', /^\/api\/enterprise-kb\/experts$/, async (req, res) => {
|
|
2390
|
-
|
|
2391
|
-
const folders = data.folders.filter((row) => row.scope.startsWith('expert:'));
|
|
2392
|
-
const ids = new Set(folders.map((row) => row.id));
|
|
2393
|
-
sendJson(res, 200, { ok: true, folders, files: data.files.filter((file) => ids.has(file.folderId)), experts: companyLibrary.experts });
|
|
2391
|
+
sendJson(res, 200, { ok: true, experts: companyLibrary.experts });
|
|
2394
2392
|
});
|
|
2395
2393
|
route('POST', /^\/api\/enterprise-kb\/folders$/, async (req, res) => {
|
|
2396
2394
|
const input = await readJson(req);
|
|
2397
2395
|
if (!input || (typeof input.id !== 'string' && typeof input.parentId !== 'string')) {
|
|
2398
2396
|
return sendJson(res, 400, { ok: false, error: '请选择上级目录' });
|
|
2399
2397
|
}
|
|
2400
|
-
|
|
2398
|
+
const library = enterpriseLibrary();
|
|
2399
|
+
library.requireCompanyFolder(input.id || input.parentId);
|
|
2400
|
+
sendJson(res, 200, { ok: true, folder: library.saveFolder(input) });
|
|
2401
2401
|
});
|
|
2402
2402
|
route('DELETE', /^\/api\/enterprise-kb\/folders\/([^/]+)$/, async (req, res, id) => {
|
|
2403
|
-
enterpriseLibrary()
|
|
2403
|
+
const library = enterpriseLibrary();
|
|
2404
|
+
library.requireCompanyFolder(id);
|
|
2405
|
+
library.removeFolder(id);
|
|
2404
2406
|
sendJson(res, 200, { ok: true });
|
|
2405
2407
|
});
|
|
2406
2408
|
route('POST', /^\/api\/enterprise-kb\/files$/, async (req, res) => {
|
|
2407
2409
|
const { folderId, name } = qs(req);
|
|
2408
2410
|
if (!folderId || !name) return sendJson(res, 400, { ok: false, error: '请选择目录和文件' });
|
|
2409
|
-
const
|
|
2411
|
+
const library = enterpriseLibrary();
|
|
2412
|
+
library.requireCompanyFolder(folderId);
|
|
2413
|
+
const result = await library.upload(folderId, name, req, {
|
|
2410
2414
|
demoCleanupMarker:demoCleanupMarker(),
|
|
2411
2415
|
matterIntake:{edition:currentScale(),submittedBy:req.signer?.name || '本机使用者'},
|
|
2412
2416
|
});
|
|
@@ -2416,13 +2420,16 @@ route('POST', /^\/api\/enterprise-kb\/files$/, async (req, res) => {
|
|
|
2416
2420
|
if (matterState === 'queued') void processMatterIntake();
|
|
2417
2421
|
});
|
|
2418
2422
|
route('GET', /^\/api\/enterprise-kb\/files\/([^/]+)\/matter$/, async (req,res,id) => {
|
|
2419
|
-
const
|
|
2423
|
+
const library = enterpriseLibrary();
|
|
2424
|
+
library.document(id, 'company');
|
|
2425
|
+
const result = library.matterIntake(id);
|
|
2420
2426
|
if (!result) return sendJson(res,404,{ok:false,error:'这份文件没有事项识别记录'});
|
|
2421
2427
|
sendJson(res,200,{ok:true,...result});
|
|
2422
2428
|
});
|
|
2423
2429
|
route('POST', /^\/api\/enterprise-kb\/files\/([^/]+)\/matter$/, async (req,res,id) => {
|
|
2424
2430
|
management(req);
|
|
2425
2431
|
const library = enterpriseLibrary();
|
|
2432
|
+
library.document(id, 'company');
|
|
2426
2433
|
const result = library.matterIntake(id);
|
|
2427
2434
|
if (result?.state !== 'review' || !result.error) return sendJson(res,409,{ok:false,error:'此识别记录无需重试'});
|
|
2428
2435
|
library.finishMatterIntake(id,'queued',{});
|
|
@@ -2482,7 +2489,7 @@ async function processMatterIntake() {
|
|
|
2482
2489
|
}
|
|
2483
2490
|
}
|
|
2484
2491
|
route('GET', /^\/api\/enterprise-kb\/files\/([^/]+)$/, async (req, res, id) => {
|
|
2485
|
-
const file = enterpriseLibrary().document(id);
|
|
2492
|
+
const file = enterpriseLibrary().document(id, 'company');
|
|
2486
2493
|
const headers = qmsHeaders('application/octet-stream', file.name, file.size);
|
|
2487
2494
|
const fd = await fs.promises.open(file.filename, 'r');
|
|
2488
2495
|
res.writeHead(200, { ...headers, 'X-Content-Type-Options': 'nosniff' });
|
|
@@ -2491,6 +2498,7 @@ route('GET', /^\/api\/enterprise-kb\/files\/([^/]+)$/, async (req, res, id) => {
|
|
|
2491
2498
|
route('GET', /^\/api\/enterprise-kb\/templates\/([0-9a-f-]{36})\/([0-9a-f]{16})$/, async (req,res,packId,id) => {
|
|
2492
2499
|
const documentId = enterpriseLibrary().findLegacySource(packId+'/'+id);
|
|
2493
2500
|
if (!documentId) return sendJson(res,404,{ok:false,error:'原件已从企业知识库移除'});
|
|
2501
|
+
enterpriseLibrary().document(documentId, 'company');
|
|
2494
2502
|
res.writeHead(302, { Location: '/qip-real-workbench/api/enterprise-kb/files/' + encodeURIComponent(documentId), 'Cache-Control':'no-store' });
|
|
2495
2503
|
res.end();
|
|
2496
2504
|
});
|
|
@@ -2498,7 +2506,9 @@ route('PUT', /^\/api\/enterprise-kb\/files\/([^/]+)\/version$/, async (req,res,i
|
|
|
2498
2506
|
management(req);
|
|
2499
2507
|
const body = await readJson(req);
|
|
2500
2508
|
if (!body || typeof body !== 'object') return sendJson(res,400,{ok:false,error:'文件版次资料无效'});
|
|
2501
|
-
const
|
|
2509
|
+
const library = enterpriseLibrary();
|
|
2510
|
+
library.document(id, 'company');
|
|
2511
|
+
const document = library.setVersion(id, body);
|
|
2502
2512
|
store.audit({ user:req.signer?.name || '本机使用者', plugin:'企业知识库', action:'更新文件版次',
|
|
2503
2513
|
params:{ id, revision:document.revision, state:document.revisionState } });
|
|
2504
2514
|
sendJson(res,200,{ok:true,document});
|
|
@@ -2534,7 +2544,7 @@ route('POST', /^\/api\/enterprise-kb\/revisions\/([a-f0-9-]{36})$/, async (req,r
|
|
|
2534
2544
|
route('DELETE', /^\/api\/enterprise-kb\/files\/([^/]+)$/, async (req, res, id) => {
|
|
2535
2545
|
management(req);
|
|
2536
2546
|
const library = enterpriseLibrary();
|
|
2537
|
-
library.document(id);
|
|
2547
|
+
library.document(id, 'company');
|
|
2538
2548
|
if (matterIntakeRun || demoCleanupBusy(1)) return sendJson(res,409,{ok:false,error:'请等当前使用知识库的操作结束后再删除'});
|
|
2539
2549
|
if (!unreferencedFiles([id]).has(id)) return sendJson(res,409,{ok:false,error:'该文件已被业务记录、对话或报告引用,需保留原件'});
|
|
2540
2550
|
library.removeDocument(id);
|
|
@@ -3706,17 +3716,15 @@ function searchXiaozhiKnowledge(query, selected = {}) {
|
|
|
3706
3716
|
if (!terms.length) return [];
|
|
3707
3717
|
const search = terms.join(' ');
|
|
3708
3718
|
const library = enterpriseLibrary();
|
|
3709
|
-
const profiles = new Map(companyLibrary.experts.map(({ slug, name }) => ['expert:' + slug, name]));
|
|
3710
3719
|
const namedProducts = currentNaming().products.filter((product)=>query.includes(product));
|
|
3711
3720
|
const product = selected.product || (namedProducts.length===1 ? namedProducts[0] : '');
|
|
3712
3721
|
const process = selected.process || '';
|
|
3713
|
-
const uploads =
|
|
3714
|
-
.
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
})));
|
|
3722
|
+
const uploads = library.search(search, 'company', true, {product,process,strictScope:true}).map((row) => ({
|
|
3723
|
+
kind: row.legacyOriginal ? '体系文件参考原件' : '企业知识库',
|
|
3724
|
+
title: row.name, detail: [row.folderName, row.documentNumber && row.documentNumber + ' ' + row.revision,
|
|
3725
|
+
row.product,row.process,row.effectiveFrom && '生效 '+row.effectiveFrom,'片段 ' + row.part].filter(Boolean).join(' · '),
|
|
3726
|
+
excerpt: row.text, url: '/qip-real-workbench/api/enterprise-kb/files/' + encodeURIComponent(row.id),
|
|
3727
|
+
}));
|
|
3720
3728
|
if (selected.companyOnly) return chatContext.relevantSources(uploads,terms)
|
|
3721
3729
|
.map((row,i)=>({...row,ref:i+1,excerpt:row.excerpt.slice(0,420)}));
|
|
3722
3730
|
const suppliers = supAll();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-total-quality",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.57",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "独立安装的全质开源质量平台,页面 /qip-real-workbench/,工具 qip_workbench_*,数据 ~/.dsh/qip-real-workbench/data。开源质量改进平台(DeepSeek Harness 插件):真实 SQLite 数据库、真实统计引擎(SPC/八大判异/Cpk/GR&R/DOE)、真实 Word/Excel 报告导出;对话默认锁定 DeepSeek-V4.1-Flash(deepseek-official / deepseek-flash),并把 16 个真实质量工具交给智能体。",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"src/**/*.js",
|
|
53
53
|
"src/lib/voice-hotwords.txt",
|
|
54
54
|
"src/package.json",
|
|
55
|
-
"public/**/*",
|
|
55
|
+
"public/**/*",
|
|
56
|
+
"resources/qms-templates/*",
|
|
56
57
|
"locale/*.json",
|
|
57
58
|
"icon.svg",
|
|
58
59
|
"README.md",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const { esc, toast, modal, closeModal, md, act } = UI;
|
|
4
4
|
const base = '/qip-real-workbench/api/enterprise-kb';
|
|
5
5
|
const chatsPath = '/qip-real-workbench/api/chats';
|
|
6
|
-
const library = { data: null, left: 'manuals', selected: 'quality-manuals', collapsed: new Set(
|
|
6
|
+
const library = { data: null, left: 'manuals', selected: 'quality-manuals', collapsed: new Set(), uploading: false };
|
|
7
7
|
const ask = { data: null, expert: '', profileTab: 'intro', browseTeam: false, history: null, conversations: new Map() };
|
|
8
8
|
const request = () => API.get(base);
|
|
9
9
|
const children = (id) => library.data.folders.filter((folder) => folder.parentId === id);
|
|
@@ -483,19 +483,8 @@
|
|
|
483
483
|
if (message.role === 'user') return '<article class="qa-user-message" aria-label="你">' + esc(text) + '</article>';
|
|
484
484
|
const name = profile ? profile.name + ' · AI 分身' : '专家团 AI';
|
|
485
485
|
const marker = profile ? avatar(profile) : '<span class="qa-avatar qa-initial">专</span>';
|
|
486
|
-
const sources = message.running ? [] : (message.sources || []);
|
|
487
|
-
const cited = new Set([...text.matchAll(/[\[[【]\s*(\d+(?:\s*[,,、]\s*\d+)*)\s*[\]]】]/g)]
|
|
488
|
-
.flatMap(([, group]) => group.split(/[,,、]/).map(Number)));
|
|
489
|
-
const lookupOnly = message.mode === 'retrieval';
|
|
490
|
-
const references = lookupOnly ? sources : sources.filter((source) => cited.has(Number(source.number)));
|
|
491
|
-
const refs = references.map((source) => `<details class="qa-source"><summary>[${esc(source.number)}] ${esc(source.name)}
|
|
492
|
-
<small>${esc(source.expert || source.folderName)}${source.part ? ' · 片段 ' + esc(source.part) : ' · 文件名命中'}</small></summary>
|
|
493
|
-
${source.text ? '<p>' + esc(source.text) + '</p>' : ''}<a class="btn btn-sm" href="${esc(fileUrl(source.id))}" download>下载原文</a></details>`).join('');
|
|
494
486
|
const status = UI.answerStatus(message, button('继续生成', 'resumeChat', index));
|
|
495
|
-
const
|
|
496
|
-
<summary>${lookupOnly ? '相关资料' : '参考资料'}(${references.length})</summary>
|
|
497
|
-
<div class="qa-sources">${refs}</div></details>` : '';
|
|
498
|
-
const body = (text ? '<div class="chat-md">' + md(text) + '</div>' : '') + status + referenceList;
|
|
487
|
+
const body = (text ? '<div class="chat-md">' + md(text) + '</div>' : '') + status;
|
|
499
488
|
return `<article class="qa-assistant-message" data-qa-message="${index}">
|
|
500
489
|
<div class="qa-reply-avatar" aria-hidden="true">${marker}</div>
|
|
501
490
|
<div class="qa-reply-content"><div class="qa-reply-name">${esc(name)}</div>
|
|
@@ -528,14 +517,12 @@
|
|
|
528
517
|
</section>`;
|
|
529
518
|
}
|
|
530
519
|
|
|
531
|
-
function expertDetail(profile
|
|
532
|
-
const tabDefinitions = [['intro', '个人简介'], ['practice', '擅长领域'], ['usage', '提问方式']
|
|
520
|
+
function expertDetail(profile) {
|
|
521
|
+
const tabDefinitions = [['intro', '个人简介'], ['practice', '擅长领域'], ['usage', '提问方式']];
|
|
533
522
|
const panels = {
|
|
534
523
|
intro: '<p>' + esc(profile.biography) + '</p>',
|
|
535
524
|
practice: '<p>' + esc(profile.summary?.[1] || profile.tags.join('、')) + '</p>',
|
|
536
|
-
usage: '<p
|
|
537
|
-
materials: '<p>' + (docs ? '当前目录已有 ' + docs + ' 份可检索文件。' : '可以把这位专家的讲义、案例或作业方法上传到对应目录。') + '</p>' +
|
|
538
|
-
button('查看资料目录', 'openLibrary'),
|
|
525
|
+
usage: '<p>可把遇到的质量现象、适用工序和已有证据写在同一个问题里。</p>',
|
|
539
526
|
};
|
|
540
527
|
return `<section class="qa-profile" aria-labelledby="qaProfileTitle">
|
|
541
528
|
<div class="qa-profile-identity">
|
|
@@ -584,22 +571,18 @@
|
|
|
584
571
|
${composerMarkup(session)}
|
|
585
572
|
</section>`;
|
|
586
573
|
}
|
|
587
|
-
const scope = profile ? '仅检索' + profile.name + '的资料' : '检索全部专家资料';
|
|
588
|
-
const folderIds = new Set(ask.data.folders.filter((entry) => !profile || entry.scope === 'expert:' + profile.slug).map((entry) => entry.id));
|
|
589
|
-
const indexed = ask.data.files.filter((file) => file.chunkCount > 0 && file.effective !== 0 && folderIds.has(file.folderId)).length;
|
|
590
574
|
return `
|
|
591
575
|
${profile ? `<nav class="qa-profile-nav" aria-label="专家导航">
|
|
592
576
|
<button type="button" class="qa-back" data-knowledge-action="teamMode">← 返回专家团</button>
|
|
593
|
-
${button('该专家资料', 'openLibrary')}
|
|
594
577
|
</nav>` : ''}
|
|
595
|
-
${profile ? expertDetail(profile
|
|
578
|
+
${profile ? expertDetail(profile) : expertTeam()}
|
|
596
579
|
<section class="qa-workspace">
|
|
597
580
|
<header class="qa-intro">
|
|
598
581
|
<div><h2>${profile ? '向' + esc(profile.name) + '老师提问' : '向全质专家团提问'}</h2>
|
|
599
582
|
<p>${profile ? esc(profile.summary?.[1] || '可以围绕该专家的专长提问。') : '直接输入质量问题,或点击上方专家进入个人问答。'}</p></div>
|
|
600
|
-
<div class="ek-actions">${
|
|
583
|
+
<div class="ek-actions">${button('历史', 'openHistory')}</div>
|
|
601
584
|
</header>
|
|
602
|
-
${composerMarkup(session
|
|
585
|
+
${composerMarkup(session)}
|
|
603
586
|
</section>`;
|
|
604
587
|
}
|
|
605
588
|
|
|
@@ -790,12 +773,6 @@
|
|
|
790
773
|
ask.profileTab = id;
|
|
791
774
|
repaintQuestions();
|
|
792
775
|
}
|
|
793
|
-
if (action === 'openLibrary') {
|
|
794
|
-
library.collapsed.delete('experts');
|
|
795
|
-
library.left = ask.expert ? 'expert-' + ask.expert : 'experts';
|
|
796
|
-
library.selected = library.left;
|
|
797
|
-
global.AppGo('companyLibrary');
|
|
798
|
-
}
|
|
799
776
|
if (action === 'cancelChat') conversation().controller?.abort();
|
|
800
777
|
if (action === 'openHistory') return showHistory();
|
|
801
778
|
if (action === 'closeHistory') {
|
package/public/js/pages-qms.js
CHANGED
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
<div class="grid g2-1">
|
|
172
172
|
<div>${summaryCard(survey.survey)}</div>
|
|
173
173
|
<div>${card(manual ? '本次手册原件' : '本次程序原件', status.plan.length ? status.plan.length + ' 份' + (status.family ? ' · ' + status.family.label : '') : '',
|
|
174
|
-
status.plan.length ? '<ul class="qms-list qms-plan">' + status.plan.map((item) =>
|
|
174
|
+
status.plan.length && status.plan.every(item => !item.folderId) ? '<p>本次使用所选体系的平台模板。上传适用的企业原件后,将优先使用企业原件。</p>' : status.plan.length ? '<ul class="qms-list qms-plan">' + status.plan.map((item) =>
|
|
175
175
|
`<li>${esc(item.filename)}${item.revision ? ' · '+esc(item.revision) : ''}${item.sourcePath ? `<small>${esc(item.sourcePath)}</small>` : ''}</li>`).join('') + '</ul>' : empty('暂无适用文件'),
|
|
176
176
|
act('打开知识库目录','qmsOpenSource',{type, folderId:manual ? status.plan[0]?.folderId : undefined},'btn btn-sm'))}</div>
|
|
177
177
|
</div>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|