dsh-data-cleaning-agent 0.9.5 → 0.9.7
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/CHANGELOG.md +11 -0
- package/README.en.md +2 -2
- package/README.md +3 -3
- package/lib/client.js +690 -155
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.7] - 2026-09-11
|
|
8
|
+
|
|
9
|
+
- 优化数据清洗补全工作台的区域间距、信息层级与明暗主题响应式布局,重构导入清单、字段映射、质量体检和主体匹配页面。
|
|
10
|
+
- 字段映射改为按维度分组的单选网格;搜索维度名称时展示该维度全部子字段,并保持既有选择与匹配规则。
|
|
11
|
+
- 导入成功后隐藏文件、图片和粘贴入口,完成态保留“重新导入”与下一步两个底部动作;替换失败时保留编辑区供重试。
|
|
12
|
+
- 扩充桌面、窄屏及明暗主题 UI 回归,发布前通过 269 项自动化测试与 10 组 Chromium 布局矩阵。
|
|
13
|
+
|
|
14
|
+
## [0.9.6] - 2026-09-11
|
|
15
|
+
|
|
16
|
+
- 任务结果报告降为统计卡片后的次要下载链接,不再与客户主结果并列展示文件卡片或预览按钮;窄侧栏自动换行。
|
|
17
|
+
|
|
7
18
|
## [0.9.5] - 2026-09-11
|
|
8
19
|
|
|
9
20
|
- 主结果 XLSX 仅保留客户原列和选定补全字段;执行状态、来源及诊断信息改为独立任务结果报告,状态中文化。
|
package/README.en.md
CHANGED
|
@@ -10,9 +10,9 @@ Related agents: [数据清洗补全](https://github.com/duhu2000/dsh-data-cleani
|
|
|
10
10
|
|
|
11
11
|
> A data cleaning & completion agent plugin for DeepSeek Harness: local CSV/XLSX/JSON engine plus optional Qichacha (QCC) MCP enterprise-data enrichment. Initiated and maintained by the Qichacha (QCC) team.
|
|
12
12
|
>
|
|
13
|
-
> Current source version / 当前源码版本: **0.9.
|
|
13
|
+
> Current source version / 当前源码版本: **0.9.7** (stable release)
|
|
14
14
|
|
|
15
|
-
This release
|
|
15
|
+
This release refines workbench hierarchy, spacing, and responsive behavior across imported lists, field mapping, quality profiling, and entity matching. File, image, and pasted-data inputs collapse after a successful import and return through the explicit reimport action. Field mapping uses grouped choices, and searching a dimension exposes all fields in that group. Preparing a draft does not query QCC; sending starts execution. Fully restart DSH after upgrading. Existing download artifacts are not rewritten.
|
|
16
16
|
|
|
17
17
|
[](https://github.com/duhu2000/dsh-data-cleaning-agent/actions/workflows/ci.yml)
|
|
18
18
|
[](https://www.npmjs.com/package/dsh-data-cleaning-agent)
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
数据清洗补全智能体:面向 Excel/CSV/JSON 企业名单,提供数据清洗、表格清洗、清洗补全、去重、企业数据补全与字段补全,支持企查查 MCP 和结果导出。
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
dsh plugin --profile web add dsh-data-cleaning-agent@0.9.
|
|
12
|
+
dsh plugin --profile web add dsh-data-cleaning-agent@0.9.7
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
请先满足下文的 DSH、连接器及侧边栏依赖要求;安装后完整停止并重启对应 Profile。
|
|
@@ -27,9 +27,9 @@ dsh plugin --profile web add dsh-data-cleaning-agent@0.9.5
|
|
|
27
27
|
|
|
28
28
|
> 在 DeepSeek Harness 中清洗、补全、画像企业名单数据的智能体插件:本地 CSV/XLSX/JSON 引擎 + 可选企查查(Qichacha/QCC)MCP 企业数据补全,由企查查(Qichacha/QCC)团队发起并维护。
|
|
29
29
|
>
|
|
30
|
-
> 当前源码版本 / Current source version: **0.9.
|
|
30
|
+
> 当前源码版本 / Current source version: **0.9.7**(正式版本)
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
本版优化工作台的信息层级、区域间距与响应式布局,重构导入清单、字段映射、质量体检及主体匹配页面。导入成功后文件、图片与粘贴入口自动收起,通过“重新导入”再次展开;映射字段按维度分组选择,搜索维度名称时展示该组全部字段。生成说明不查询,发送才执行;升级后需完整重启 DSH,历史下载文件不自动改写。
|
|
33
33
|
|
|
34
34
|
[](https://github.com/duhu2000/dsh-data-cleaning-agent/actions/workflows/ci.yml)
|
|
35
35
|
[](https://www.npmjs.com/package/dsh-data-cleaning-agent)
|
package/lib/client.js
CHANGED
|
@@ -157,12 +157,7 @@ window.__ModuleLoader__.load({
|
|
|
157
157
|
box-sizing: border-box; display: flex; flex-direction: column;
|
|
158
158
|
width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden;
|
|
159
159
|
background: var(--dc-surface); color: var(--dc-text);
|
|
160
|
-
container
|
|
161
|
-
}
|
|
162
|
-
@container (max-width: 520px) {
|
|
163
|
-
.dcAgentRulesGrid, .dcAgentMappingRow { grid-template-columns: 1fr; }
|
|
164
|
-
.dcAgentMappingRow > b { display: none; }
|
|
165
|
-
.dcAgentCandidate { grid-template-columns: 1fr; }
|
|
160
|
+
container: dc-agent-workbench / inline-size;
|
|
166
161
|
}
|
|
167
162
|
.dcAgentCapabilities {
|
|
168
163
|
display: flex;
|
|
@@ -515,8 +510,13 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
515
510
|
|
|
516
511
|
.dcAgentWbBody {
|
|
517
512
|
flex: 1 1 auto;
|
|
513
|
+
display: flex;
|
|
514
|
+
flex-direction: column;
|
|
515
|
+
gap: 14px;
|
|
518
516
|
overflow: auto;
|
|
519
517
|
padding: 18px;
|
|
518
|
+
background: var(--dc-page);
|
|
519
|
+
scrollbar-gutter: stable;
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
.dcAgentPane { display: flex; flex-direction: column; gap: 14px; }
|
|
@@ -569,7 +569,7 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
569
569
|
|
|
570
570
|
.dcAgentGrid {
|
|
571
571
|
display: grid;
|
|
572
|
-
grid-template-columns: repeat(auto-
|
|
572
|
+
grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
|
|
573
573
|
gap: 10px;
|
|
574
574
|
}
|
|
575
575
|
|
|
@@ -718,10 +718,10 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
718
718
|
color: var(--dc-text);
|
|
719
719
|
}
|
|
720
720
|
.dcAgentHistoryTask { border: 1px solid var(--dc-border); border-radius: 6px; background: var(--dc-surface); color: inherit; font: inherit; cursor: pointer; }
|
|
721
|
-
.dcAgentWizardNav { display: grid; grid-template-columns: repeat(4, 1fr); gap:
|
|
722
|
-
.dcAgentWizardStep { display: flex; align-items: center; gap: 6px; padding:
|
|
721
|
+
.dcAgentWizardNav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--dc-border); }
|
|
722
|
+
.dcAgentWizardStep { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--dc-muted); font: inherit; font-size: 12px; cursor: pointer; }
|
|
723
723
|
.dcAgentWizardStep b { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--dc-border); color: var(--dc-muted); }
|
|
724
|
-
.dcAgentWizardStep.is-active { border-color: var(--dc-action); background:
|
|
724
|
+
.dcAgentWizardStep.is-active { border-bottom-color: var(--dc-action); background: transparent; color: var(--dc-action); }
|
|
725
725
|
.dcAgentWizardStep.is-active b { background: var(--dc-action); color: var(--dc-on-action); }
|
|
726
726
|
.dcAgentWizardPane { min-height: 230px; }
|
|
727
727
|
.dcAgentWizardPane h4 { margin: 0 0 3px; font-size: 14px; }
|
|
@@ -730,14 +730,158 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
730
730
|
.dcAgentPromptRules label { font-size: 12px; }
|
|
731
731
|
.dcAgentPromptPreview { max-height: 260px; overflow: auto; margin: 10px 0 0; padding: 12px; border-radius: 8px; background: var(--dc-page); white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 12px; line-height: 18px; }
|
|
732
732
|
.dcAgentFormField { display: grid; gap: 6px; font-size: 12px; font-weight: 600; }
|
|
733
|
-
.
|
|
734
|
-
.
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
733
|
+
.dcAgentMappingSection { padding: 0; }
|
|
734
|
+
.dcAgentMappingHeader {
|
|
735
|
+
display: grid;
|
|
736
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
737
|
+
align-items: start;
|
|
738
|
+
gap: 12px 20px;
|
|
739
|
+
padding: 14px 16px;
|
|
740
|
+
border-bottom: 1px solid var(--dc-border);
|
|
741
|
+
}
|
|
742
|
+
.dcAgentMappingHeader h3 { margin: 0; font-size: 14px; }
|
|
743
|
+
.dcAgentMappingHeader .dcAgentHint { margin-top: 4px; }
|
|
744
|
+
.dcAgentMappingProgress {
|
|
745
|
+
display: inline-flex;
|
|
746
|
+
align-items: baseline;
|
|
747
|
+
gap: 4px;
|
|
748
|
+
min-width: 108px;
|
|
749
|
+
padding: 8px 10px;
|
|
750
|
+
border: 1px solid var(--dc-border);
|
|
751
|
+
border-radius: 6px;
|
|
752
|
+
background: var(--dc-page);
|
|
753
|
+
color: var(--dc-muted);
|
|
754
|
+
font-size: 12px;
|
|
755
|
+
white-space: nowrap;
|
|
756
|
+
}
|
|
757
|
+
.dcAgentMappingProgress b { color: var(--dc-action); font-size: 16px; font-variant-numeric: tabular-nums; }
|
|
758
|
+
.dcAgentMappingToolbar {
|
|
759
|
+
display: flex;
|
|
760
|
+
align-items: center;
|
|
761
|
+
justify-content: space-between;
|
|
762
|
+
gap: 10px 16px;
|
|
763
|
+
padding: 10px 16px;
|
|
764
|
+
border-bottom: 1px solid var(--dc-border);
|
|
765
|
+
background: var(--dc-page);
|
|
766
|
+
}
|
|
767
|
+
.dcAgentMappingLegend { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; color: var(--dc-muted); font-size: 12px; }
|
|
768
|
+
.dcAgentMappingLegendItem { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
|
|
769
|
+
.dcAgentMappingLegendItem::before { width: 7px; height: 7px; border-radius: 50%; background: var(--dc-border); content: ''; }
|
|
770
|
+
.dcAgentMappingLegendItem[data-status="confirmed"]::before { background: light-dark(#15803d, #86efac); }
|
|
771
|
+
.dcAgentMappingLegendItem[data-status="review"]::before { background: light-dark(#a16207, #fcd34d); }
|
|
772
|
+
.dcAgentMappingLegendItem[data-status="unmatched"]::before { background: light-dark(#b91c1c, #fca5a5); }
|
|
773
|
+
.dcAgentMappingAuto { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; }
|
|
774
|
+
.dcAgentMappingNote { padding: 10px 16px; border-bottom: 1px solid var(--dc-border); }
|
|
775
|
+
.dcAgentMappingListHead,
|
|
776
|
+
.dcAgentMappingSummary,
|
|
777
|
+
.dcAgentMappingMeta {
|
|
778
|
+
display: grid;
|
|
779
|
+
grid-template-columns: minmax(120px, 0.8fr) 24px minmax(220px, 1.2fr);
|
|
780
|
+
align-items: center;
|
|
781
|
+
gap: 8px;
|
|
782
|
+
}
|
|
783
|
+
.dcAgentMappingListHead {
|
|
784
|
+
padding: 8px 16px;
|
|
785
|
+
border-bottom: 1px solid var(--dc-border);
|
|
786
|
+
background: var(--dc-page);
|
|
787
|
+
color: var(--dc-muted);
|
|
788
|
+
font-size: 11px;
|
|
789
|
+
font-weight: 600;
|
|
790
|
+
}
|
|
791
|
+
.dcAgentMappingListHead > span:last-child { grid-column: 3; }
|
|
792
|
+
.dcAgentMappingRow { font-size: 12px; }
|
|
793
|
+
.dcAgentMappingRow + .dcAgentMappingRow { border-top: 1px solid var(--dc-border); }
|
|
794
|
+
.dcAgentMappingPicker { display: block; }
|
|
795
|
+
.dcAgentMappingSummary {
|
|
796
|
+
min-height: 52px;
|
|
797
|
+
padding: 8px 16px;
|
|
798
|
+
cursor: pointer;
|
|
799
|
+
list-style: none;
|
|
800
|
+
}
|
|
801
|
+
.dcAgentMappingSummary::-webkit-details-marker { display: none; }
|
|
802
|
+
.dcAgentMappingSummary:hover { background: var(--dc-page); }
|
|
803
|
+
.dcAgentMappingPicker[open] > .dcAgentMappingSummary { background: var(--dc-selected); }
|
|
804
|
+
.dcAgentMappingSource { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
|
|
805
|
+
.dcAgentMappingSummary > b { text-align: center; color: light-dark(#8792a3, #8290a5); }
|
|
806
|
+
.dcAgentMappingValue {
|
|
807
|
+
display: flex;
|
|
808
|
+
align-items: center;
|
|
809
|
+
justify-content: space-between;
|
|
810
|
+
gap: 10px;
|
|
811
|
+
min-width: 0;
|
|
812
|
+
min-height: 36px;
|
|
813
|
+
padding: 7px 10px;
|
|
814
|
+
border: 1px solid var(--dc-border);
|
|
815
|
+
border-radius: 6px;
|
|
816
|
+
background: var(--dc-surface);
|
|
817
|
+
font-size: 14px;
|
|
818
|
+
font-weight: 500;
|
|
819
|
+
overflow-wrap: anywhere;
|
|
820
|
+
}
|
|
821
|
+
.dcAgentMappingValue::after {
|
|
822
|
+
flex: 0 0 auto;
|
|
823
|
+
width: 7px;
|
|
824
|
+
height: 7px;
|
|
825
|
+
border-right: 1.5px solid currentColor;
|
|
826
|
+
border-bottom: 1.5px solid currentColor;
|
|
827
|
+
content: '';
|
|
828
|
+
transform: rotate(45deg) translate(-2px, 2px);
|
|
829
|
+
transition: transform 120ms ease;
|
|
830
|
+
}
|
|
831
|
+
.dcAgentMappingPicker[open] .dcAgentMappingValue::after { transform: rotate(225deg); }
|
|
832
|
+
.dcAgentMappingPickerPanel {
|
|
833
|
+
display: grid;
|
|
834
|
+
gap: 8px;
|
|
835
|
+
padding: 12px 16px 14px;
|
|
836
|
+
border-top: 1px solid var(--dc-border);
|
|
837
|
+
border-bottom: 1px solid var(--dc-border);
|
|
838
|
+
background: var(--dc-page);
|
|
839
|
+
}
|
|
840
|
+
.dcAgentMappingPickerFilters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 0.42fr); gap: 8px; }
|
|
841
|
+
.dcAgentMappingPickerPanel .dcAgentField { box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0; margin: 0; }
|
|
842
|
+
.dcAgentMappingOptionGroups {
|
|
843
|
+
max-height: 286px;
|
|
844
|
+
overflow: auto;
|
|
845
|
+
padding-right: 4px;
|
|
846
|
+
scrollbar-gutter: stable;
|
|
847
|
+
}
|
|
848
|
+
.dcAgentMappingClearOption,
|
|
849
|
+
.dcAgentMappingOption {
|
|
850
|
+
display: flex;
|
|
851
|
+
align-items: center;
|
|
852
|
+
gap: 8px;
|
|
853
|
+
min-width: 0;
|
|
854
|
+
min-height: 36px;
|
|
855
|
+
padding: 6px 8px;
|
|
856
|
+
border-radius: 4px;
|
|
857
|
+
cursor: pointer;
|
|
858
|
+
}
|
|
859
|
+
.dcAgentMappingClearOption {
|
|
860
|
+
position: sticky;
|
|
861
|
+
top: 0;
|
|
862
|
+
z-index: 1;
|
|
863
|
+
border-bottom: 1px solid var(--dc-border);
|
|
864
|
+
border-radius: 0;
|
|
865
|
+
background: var(--dc-page);
|
|
866
|
+
color: var(--dc-muted);
|
|
867
|
+
}
|
|
868
|
+
.dcAgentMappingOption:hover,
|
|
869
|
+
.dcAgentMappingOption:has(input:checked) { background: var(--dc-selected); color: var(--dc-action); }
|
|
870
|
+
.dcAgentMappingOption:has(input:disabled) { opacity: 0.52; cursor: not-allowed; }
|
|
871
|
+
.dcAgentMappingClearOption input,
|
|
872
|
+
.dcAgentMappingOption input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--dc-action); }
|
|
873
|
+
.dcAgentMappingOption > span { min-width: 0; overflow-wrap: anywhere; }
|
|
874
|
+
.dcAgentMappingRow .dcAgentMappingOption > small { margin: 0 0 0 auto; color: var(--dc-muted); white-space: nowrap; }
|
|
875
|
+
.dcAgentMappingOptionGroup { margin-top: 12px; }
|
|
876
|
+
.dcAgentMappingOptionGroupTitle { margin: 0 0 6px; color: var(--dc-muted); font-size: 12px; font-weight: 600; }
|
|
877
|
+
.dcAgentMappingOptionGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 4px 8px; }
|
|
878
|
+
.dcAgentMappingCurrentNotice { margin: 8px 0 0; padding: 7px 8px; background: var(--dc-surface); color: var(--dc-muted); font-size: 12px; }
|
|
879
|
+
.dcAgentMappingMatch { margin: 0; }
|
|
880
|
+
.dcAgentMappingMeta { padding: 7px 16px 10px; }
|
|
881
|
+
.dcAgentMappingMeta > * { grid-column: 3; min-width: 0; }
|
|
882
|
+
.dcAgentMappingMeta > .dcAgentHint { margin: 0; }
|
|
739
883
|
.dcAgentMappingRow .dcAgentButton { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
|
|
740
|
-
.dcAgentMappingRow small { display: block; margin:
|
|
884
|
+
.dcAgentMappingRow small { display: block; margin: 0; overflow-wrap: anywhere; }
|
|
741
885
|
.dcAgentMappingStatus[data-status="confirmed"] { color: light-dark(#15803d, #86efac); }
|
|
742
886
|
.dcAgentMappingStatus[data-status="review"] { color: light-dark(#a16207, #fcd34d); }
|
|
743
887
|
.dcAgentMappingStatus[data-status="unmatched"] { color: light-dark(#b91c1c, #fca5a5); }
|
|
@@ -762,6 +906,11 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
762
906
|
.dcAgentArtifactList { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; min-width: 0; }
|
|
763
907
|
.dcAgentArtifactList > .dcAgentButton { display: inline-flex; align-items: center; box-sizing: border-box; max-width: 100%; min-width: 0; height: auto; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; text-decoration: none; }
|
|
764
908
|
.dcAgentArtifactList > a.dcAgentButton { flex-basis: 100%; }
|
|
909
|
+
.dcAgentResultSummary { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; min-width: 0; }
|
|
910
|
+
.dcAgentResultSummary > .dcAgentGrid { flex: 1 1 500px; min-width: 0; }
|
|
911
|
+
.dcAgentReportLink { color: var(--dc-muted); font-size: 13px; text-decoration: underline; padding: 8px 0; }
|
|
912
|
+
.dcAgentReportLink:hover { color: var(--dc-action); }
|
|
913
|
+
.dcAgentReportLink[aria-disabled="true"] { opacity: .5; cursor: wait; }
|
|
765
914
|
.dcAgentArtifactList > .dcAgentCard { width: 100%; min-width: 0; box-sizing: border-box; }
|
|
766
915
|
.dcAgentArtifactList .dcAgentCard p { overflow-wrap: anywhere; margin: 0 0 10px; }
|
|
767
916
|
.dcAgentArtifactList .dcAgentCard .dcAgentButton { max-width: 100%; height: auto; white-space: normal; overflow-wrap: anywhere; }
|
|
@@ -781,8 +930,175 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
781
930
|
.dcAgentPreviewTable > .dcAgentTable th {
|
|
782
931
|
position: sticky; top: 0; z-index: 2; background: var(--dc-table-head);
|
|
783
932
|
}
|
|
933
|
+
.dcAgentDatasetPreview {
|
|
934
|
+
padding: 0;
|
|
935
|
+
overflow: hidden;
|
|
936
|
+
}
|
|
937
|
+
.dcAgentDatasetHeader {
|
|
938
|
+
display: flex;
|
|
939
|
+
align-items: baseline;
|
|
940
|
+
justify-content: space-between;
|
|
941
|
+
gap: 8px 16px;
|
|
942
|
+
padding: 14px 16px 12px;
|
|
943
|
+
border-bottom: 1px solid var(--dc-border);
|
|
944
|
+
}
|
|
945
|
+
.dcAgentDatasetHeader h3 { margin: 0; font-size: 14px; }
|
|
946
|
+
.dcAgentDatasetHeader .dcAgentHint { text-align: right; }
|
|
947
|
+
.dcAgentDatasetPreview > .dcAgentPreviewTable {
|
|
948
|
+
margin: 0;
|
|
949
|
+
border: 0;
|
|
950
|
+
border-radius: 0;
|
|
951
|
+
}
|
|
952
|
+
.dcAgentDatasetPreview > .dcAgentPreviewTable > .dcAgentTable :is(th, td):last-child { border-right: 0; }
|
|
953
|
+
.dcAgentDatasetPreview > .dcAgentPreviewTable > .dcAgentTable tbody tr:last-child > td { border-bottom: 0; }
|
|
954
|
+
.dcAgentDatasetPreview > .dcAgentPreviewTable > .dcAgentTable :is(th, td):first-child {
|
|
955
|
+
width: 72px;
|
|
956
|
+
min-width: 72px;
|
|
957
|
+
max-width: 72px;
|
|
958
|
+
text-align: center;
|
|
959
|
+
color: var(--dc-muted);
|
|
960
|
+
font-variant-numeric: tabular-nums;
|
|
961
|
+
}
|
|
962
|
+
.dcAgentDatasetFooter {
|
|
963
|
+
display: grid;
|
|
964
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
965
|
+
align-items: center;
|
|
966
|
+
gap: 10px 16px;
|
|
967
|
+
padding: 12px 16px;
|
|
968
|
+
border-top: 1px solid var(--dc-border);
|
|
969
|
+
background: var(--dc-page);
|
|
970
|
+
}
|
|
971
|
+
.dcAgentDatasetPagination,
|
|
972
|
+
.dcAgentDatasetDownloads {
|
|
973
|
+
display: flex;
|
|
974
|
+
align-items: center;
|
|
975
|
+
gap: 8px;
|
|
976
|
+
min-width: 0;
|
|
977
|
+
}
|
|
978
|
+
.dcAgentDatasetDownloads { justify-content: flex-end; }
|
|
979
|
+
.dcAgentDatasetPreview .dcAgentButton {
|
|
980
|
+
display: inline-flex;
|
|
981
|
+
align-items: center;
|
|
982
|
+
justify-content: center;
|
|
983
|
+
gap: 6px;
|
|
984
|
+
min-height: 32px;
|
|
985
|
+
padding: 6px 10px;
|
|
986
|
+
line-height: 18px;
|
|
987
|
+
}
|
|
988
|
+
.dcAgentDatasetPage {
|
|
989
|
+
min-width: 72px;
|
|
990
|
+
padding: 6px 8px;
|
|
991
|
+
border: 1px solid var(--dc-border);
|
|
992
|
+
border-radius: 6px;
|
|
993
|
+
background: var(--dc-surface);
|
|
994
|
+
font-size: 12px;
|
|
995
|
+
font-variant-numeric: tabular-nums;
|
|
996
|
+
font-weight: 600;
|
|
997
|
+
text-align: center;
|
|
998
|
+
white-space: nowrap;
|
|
999
|
+
}
|
|
1000
|
+
.dcAgentDatasetFooterNote {
|
|
1001
|
+
grid-column: 1 / -1;
|
|
1002
|
+
padding-top: 10px;
|
|
1003
|
+
border-top: 1px solid var(--dc-border);
|
|
1004
|
+
font-size: 12px;
|
|
1005
|
+
line-height: 1.55;
|
|
1006
|
+
}
|
|
1007
|
+
.dcAgentIntakeSummary { padding: 0; overflow: hidden; }
|
|
1008
|
+
.dcAgentIntakeSummaryHead {
|
|
1009
|
+
padding: 14px 16px 10px;
|
|
1010
|
+
}
|
|
1011
|
+
.dcAgentIntakeSummaryHead > div { min-width: 0; }
|
|
1012
|
+
.dcAgentIntakeSummaryHead h3 { margin-bottom: 4px; }
|
|
1013
|
+
.dcAgentIntakeSummary > .dcAgentHint { padding: 0 16px 14px; }
|
|
1014
|
+
.dcAgentIntakeEditor { padding: 0; overflow: hidden; }
|
|
1015
|
+
.dcAgentIntakeEditorHeader { padding: 14px 16px 10px; border-bottom: 1px solid var(--dc-border); }
|
|
1016
|
+
.dcAgentIntakeEditorHeader h3 { margin-bottom: 4px; }
|
|
1017
|
+
.dcAgentIntakeSourceActions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
|
|
1018
|
+
.dcAgentIntakePaste { padding: 0 16px 12px; }
|
|
1019
|
+
.dcAgentIntakePaste .dcAgentTextarea { min-height: 116px; }
|
|
1020
|
+
.dcAgentIntakeEditorActions { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--dc-border); }
|
|
1021
|
+
.dcAgentUploadActions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
|
|
784
1022
|
.dcAgentHistoryTask { display: block; width: 100%; padding: 10px; text-align: left; }
|
|
785
1023
|
.dcAgentHistoryTask h3 { margin: 0; font-size: 12px; }
|
|
1024
|
+
.dcAgentViewTabs {
|
|
1025
|
+
display: flex;
|
|
1026
|
+
align-items: center;
|
|
1027
|
+
gap: 20px;
|
|
1028
|
+
min-height: 34px;
|
|
1029
|
+
padding: 0 4px;
|
|
1030
|
+
border-bottom: 1px solid var(--dc-border);
|
|
1031
|
+
}
|
|
1032
|
+
.dcAgentViewTabs .dcAgentButton {
|
|
1033
|
+
align-self: stretch;
|
|
1034
|
+
padding: 6px 2px;
|
|
1035
|
+
border: 0;
|
|
1036
|
+
border-bottom: 2px solid transparent;
|
|
1037
|
+
border-radius: 0;
|
|
1038
|
+
background: transparent;
|
|
1039
|
+
color: var(--dc-muted);
|
|
1040
|
+
font-size: 12px;
|
|
1041
|
+
}
|
|
1042
|
+
.dcAgentViewTabs .dcAgentButton[aria-pressed="true"] { border-bottom-color: var(--dc-action); color: var(--dc-action); font-weight: 600; }
|
|
1043
|
+
.dcAgentProfilePane { flex: 1 0 auto; min-height: 320px; }
|
|
1044
|
+
.dcAgentProfileSurface {
|
|
1045
|
+
flex: 1 0 auto;
|
|
1046
|
+
display: flex;
|
|
1047
|
+
flex-direction: column;
|
|
1048
|
+
min-height: 320px;
|
|
1049
|
+
padding: 0;
|
|
1050
|
+
overflow: hidden;
|
|
1051
|
+
}
|
|
1052
|
+
.dcAgentProfileHeader { padding: 14px 16px; border-bottom: 1px solid var(--dc-border); }
|
|
1053
|
+
.dcAgentProfileHeader h3 { margin: 0; font-size: 14px; }
|
|
1054
|
+
.dcAgentProfileHeader .dcAgentHint { margin-top: 4px; }
|
|
1055
|
+
.dcAgentProfileReport { flex: 1 0 auto; display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; }
|
|
1056
|
+
.dcAgentProfileMetrics { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
|
|
1057
|
+
.dcAgentProfileMetrics .dcAgentCard { padding: 10px 12px; background: var(--dc-page); }
|
|
1058
|
+
.dcAgentProfileMetrics .dcAgentCard b { font-size: 17px; }
|
|
1059
|
+
.dcAgentProfileTableSection { min-width: 0; }
|
|
1060
|
+
.dcAgentProfileTableHead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
|
|
1061
|
+
.dcAgentProfileTableHead h4 { margin: 0; font-size: 13px; }
|
|
1062
|
+
.dcAgentProfileTableWrap { max-width: 100%; max-height: 360px; overflow: auto; border: 1px solid var(--dc-border); border-radius: 6px; scrollbar-gutter: stable; }
|
|
1063
|
+
.dcAgentProfileTableWrap .dcAgentTable { min-width: 420px; border-collapse: separate; border-spacing: 0; }
|
|
1064
|
+
.dcAgentProfileTableWrap .dcAgentTable th { position: sticky; top: 0; z-index: 1; }
|
|
1065
|
+
.dcAgentProfileTableWrap .dcAgentTable :is(th, td):last-child { border-right: 0; }
|
|
1066
|
+
.dcAgentProfileTableWrap .dcAgentTable tbody tr:last-child > td { border-bottom: 0; }
|
|
1067
|
+
.dcAgentProfileTableWrap .dcAgentTable :is(th, td):not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
|
|
1068
|
+
.dcAgentProfileActions { display: flex; justify-content: flex-end; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--dc-border); }
|
|
1069
|
+
.dcAgentProfileEmpty { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
|
|
1070
|
+
.dcAgentMatchPane { flex: 0 0 auto; }
|
|
1071
|
+
.dcAgentMatchSurface {
|
|
1072
|
+
flex: 0 0 auto;
|
|
1073
|
+
display: flex;
|
|
1074
|
+
flex-direction: column;
|
|
1075
|
+
padding: 0;
|
|
1076
|
+
overflow: hidden;
|
|
1077
|
+
}
|
|
1078
|
+
.dcAgentMatchHeader { padding: 14px 16px; border-bottom: 1px solid var(--dc-border); }
|
|
1079
|
+
.dcAgentMatchHeader h3 { margin: 0; font-size: 14px; }
|
|
1080
|
+
.dcAgentMatchHeader .dcAgentHint { margin-top: 4px; }
|
|
1081
|
+
.dcAgentMatchContent {
|
|
1082
|
+
display: grid;
|
|
1083
|
+
grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
|
|
1084
|
+
align-items: stretch;
|
|
1085
|
+
}
|
|
1086
|
+
.dcAgentMatchBlock { min-width: 0; padding: 16px; }
|
|
1087
|
+
.dcAgentMatchBlock + .dcAgentMatchBlock { border-left: 1px solid var(--dc-border); }
|
|
1088
|
+
.dcAgentMatchBlockHead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
|
|
1089
|
+
.dcAgentMatchBlockHead h4 { margin: 0; font-size: 13px; }
|
|
1090
|
+
.dcAgentMatchBlock .dcAgentChips { margin-bottom: 8px; }
|
|
1091
|
+
.dcAgentMatchBlock .dcAgentHint + .dcAgentHint { margin-top: 6px; }
|
|
1092
|
+
.dcAgentMatchScope {
|
|
1093
|
+
display: inline-flex;
|
|
1094
|
+
align-items: baseline;
|
|
1095
|
+
gap: 5px;
|
|
1096
|
+
color: var(--dc-muted);
|
|
1097
|
+
font-size: 12px;
|
|
1098
|
+
white-space: nowrap;
|
|
1099
|
+
}
|
|
1100
|
+
.dcAgentMatchScope b { color: var(--dc-text); font-size: 14px; font-variant-numeric: tabular-nums; }
|
|
1101
|
+
.dcAgentMatchActions { display: flex; justify-content: flex-end; margin: 0 16px; padding: 14px 0; border-top: 1px solid var(--dc-border); }
|
|
786
1102
|
@media (max-width: 760px) {
|
|
787
1103
|
.dcAgentQccBadge, .dcAgentJobsPill { display: none; }
|
|
788
1104
|
.dcAgentCandidate { grid-template-columns: 1fr; }
|
|
@@ -792,8 +1108,11 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
792
1108
|
.dcAgentPromptPanel { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
|
|
793
1109
|
.dcAgentWizardNav { grid-template-columns: repeat(2, 1fr); }
|
|
794
1110
|
.dcAgentRulesGrid { grid-template-columns: 1fr; }
|
|
795
|
-
.
|
|
796
|
-
.
|
|
1111
|
+
.dcAgentMappingListHead { display: none; }
|
|
1112
|
+
.dcAgentMappingSummary, .dcAgentMappingMeta { grid-template-columns: 1fr; }
|
|
1113
|
+
.dcAgentMappingSummary > b { display: none; }
|
|
1114
|
+
.dcAgentMappingPickerFilters { grid-template-columns: 1fr; }
|
|
1115
|
+
.dcAgentMappingMeta > * { grid-column: 1; }
|
|
797
1116
|
}
|
|
798
1117
|
@media (min-width: 761px) and (max-width: 1040px) {
|
|
799
1118
|
.dcAgentQccBadge, .dcAgentJobsPill { display: none; }
|
|
@@ -815,6 +1134,58 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
815
1134
|
.dcAgentTable th, .dcAgentTable td { height: 44px; box-sizing: border-box; font-size: 13px; }
|
|
816
1135
|
.dcAgentTable tbody tr:hover { background: var(--dc-selected); }
|
|
817
1136
|
.dcAgentSection, .dcAgentCard { background: var(--dc-surface); }
|
|
1137
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] {
|
|
1138
|
+
display: grid;
|
|
1139
|
+
grid-template-columns: minmax(0, 1fr) auto auto;
|
|
1140
|
+
align-items: center;
|
|
1141
|
+
gap: 6px 10px;
|
|
1142
|
+
padding: 14px 16px;
|
|
1143
|
+
}
|
|
1144
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > h3 {
|
|
1145
|
+
grid-column: 1;
|
|
1146
|
+
grid-row: 1;
|
|
1147
|
+
min-width: 0;
|
|
1148
|
+
margin: 0;
|
|
1149
|
+
overflow-wrap: anywhere;
|
|
1150
|
+
font-size: 14px;
|
|
1151
|
+
}
|
|
1152
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > b {
|
|
1153
|
+
grid-column: 2;
|
|
1154
|
+
grid-row: 1;
|
|
1155
|
+
padding: 2px 8px;
|
|
1156
|
+
border: 1px solid var(--dc-border);
|
|
1157
|
+
border-radius: 4px;
|
|
1158
|
+
background: var(--dc-page);
|
|
1159
|
+
color: var(--dc-muted);
|
|
1160
|
+
font-size: 12px;
|
|
1161
|
+
font-weight: 600;
|
|
1162
|
+
white-space: nowrap;
|
|
1163
|
+
}
|
|
1164
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > details {
|
|
1165
|
+
grid-column: 3;
|
|
1166
|
+
grid-row: 1;
|
|
1167
|
+
color: var(--dc-muted);
|
|
1168
|
+
font-size: 12px;
|
|
1169
|
+
}
|
|
1170
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > :is(p, progress) { grid-column: 1 / -1; }
|
|
1171
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > p { margin: 0; }
|
|
1172
|
+
.dcAgentWbBody > .dcAgentSection[role="status"]:not([aria-label]) {
|
|
1173
|
+
min-height: 156px;
|
|
1174
|
+
display: flex;
|
|
1175
|
+
flex-direction: column;
|
|
1176
|
+
align-items: center;
|
|
1177
|
+
justify-content: center;
|
|
1178
|
+
gap: 12px;
|
|
1179
|
+
border: 0;
|
|
1180
|
+
background: transparent;
|
|
1181
|
+
text-align: center;
|
|
1182
|
+
}
|
|
1183
|
+
.dcAgentWbBody > .dcAgentSection[role="status"]:not([aria-label]) > p {
|
|
1184
|
+
max-width: 440px;
|
|
1185
|
+
margin: 0;
|
|
1186
|
+
color: var(--dc-muted);
|
|
1187
|
+
}
|
|
1188
|
+
.dcAgentPane > .dcAgentArtifactList { margin-top: 0; }
|
|
818
1189
|
.dcAgentFieldGroup { background: var(--dc-page); padding: 12px; border-radius: 8px; }
|
|
819
1190
|
.dcAgentPromptFieldGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; margin-top: 10px; }
|
|
820
1191
|
.dcAgentPromptFieldGrid .dcAgentPromptChoice { border: 0; border-radius: 4px; min-width: 0; align-items: flex-start; font-size: 13px; }
|
|
@@ -825,6 +1196,66 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
825
1196
|
.dcAgentPromptAction.is-primary:hover:not(:disabled) { background: var(--dc-hover); }
|
|
826
1197
|
:is(.dcAgentWorkbenchContent, .dcAgentPromptPanel, .dcAgentCapabilities, .dcAgentPromptLayer) :is(button, input, select, textarea, summary):focus-visible,
|
|
827
1198
|
.dcAgentLauncher:focus-visible { outline: 2px solid var(--dc-action); outline-offset: 2px; }
|
|
1199
|
+
@container dc-agent-workbench (max-width: 640px) {
|
|
1200
|
+
.dcAgentRulesGrid { grid-template-columns: 1fr; }
|
|
1201
|
+
.dcAgentCandidate { grid-template-columns: 1fr; }
|
|
1202
|
+
}
|
|
1203
|
+
@container dc-agent-workbench (max-width: 570px) {
|
|
1204
|
+
.dcAgentGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
1205
|
+
.dcAgentGrid > .dcAgentCard:last-child:nth-child(odd) { grid-column: 1 / -1; }
|
|
1206
|
+
}
|
|
1207
|
+
@container dc-agent-workbench (max-width: 520px) {
|
|
1208
|
+
.dcAgentMappingHeader { grid-template-columns: 1fr; }
|
|
1209
|
+
.dcAgentMappingProgress { justify-self: start; }
|
|
1210
|
+
.dcAgentMappingToolbar { align-items: flex-start; flex-direction: column; }
|
|
1211
|
+
.dcAgentMappingListHead { display: none; }
|
|
1212
|
+
.dcAgentMappingSummary, .dcAgentMappingMeta { grid-template-columns: 1fr; }
|
|
1213
|
+
.dcAgentMappingSummary > b { display: none; }
|
|
1214
|
+
.dcAgentMappingPickerFilters { grid-template-columns: 1fr; }
|
|
1215
|
+
.dcAgentMappingMeta > * { grid-column: 1; }
|
|
1216
|
+
.dcAgentStep { gap: 6px; padding: 10px 3px; font-size: 11px; }
|
|
1217
|
+
.dcAgentStepIcon { width: 26px; height: 26px; }
|
|
1218
|
+
.dcAgentStepLabel {
|
|
1219
|
+
display: -webkit-box;
|
|
1220
|
+
min-height: 32px;
|
|
1221
|
+
line-height: 16px;
|
|
1222
|
+
white-space: normal;
|
|
1223
|
+
-webkit-box-orient: vertical;
|
|
1224
|
+
-webkit-line-clamp: 2;
|
|
1225
|
+
}
|
|
1226
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] { grid-template-columns: minmax(0, 1fr) auto; }
|
|
1227
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > h3 { grid-column: 1 / -1; }
|
|
1228
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > b { grid-column: 1; grid-row: 2; justify-self: start; }
|
|
1229
|
+
.dcAgentWbBody > .dcAgentSection[aria-label="当前任务进展"] > details { grid-column: 2; grid-row: 2; }
|
|
1230
|
+
.dcAgentDatasetHeader { display: grid; }
|
|
1231
|
+
.dcAgentDatasetHeader .dcAgentHint { text-align: left; }
|
|
1232
|
+
.dcAgentDatasetFooter { grid-template-columns: 1fr; }
|
|
1233
|
+
.dcAgentDatasetPagination,
|
|
1234
|
+
.dcAgentDatasetDownloads { justify-content: flex-start; flex-wrap: wrap; }
|
|
1235
|
+
.dcAgentDatasetFooterNote { grid-column: 1; }
|
|
1236
|
+
.dcAgentProfileHeader, .dcAgentProfileReport { padding-inline: 12px; }
|
|
1237
|
+
.dcAgentProfileMetrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
1238
|
+
}
|
|
1239
|
+
@container dc-agent-workbench (max-width: 640px) {
|
|
1240
|
+
.dcAgentMatchContent { grid-template-columns: 1fr; }
|
|
1241
|
+
.dcAgentMatchBlock + .dcAgentMatchBlock { border-top: 1px solid var(--dc-border); border-left: 0; }
|
|
1242
|
+
}
|
|
1243
|
+
@container dc-agent-workbench (max-width: 420px) {
|
|
1244
|
+
.dcAgentIntakeSummaryHead { padding-inline: 12px; }
|
|
1245
|
+
.dcAgentIntakeSummary > .dcAgentHint,
|
|
1246
|
+
.dcAgentIntakeEditorHeader,
|
|
1247
|
+
.dcAgentIntakeSourceActions,
|
|
1248
|
+
.dcAgentIntakePaste,
|
|
1249
|
+
.dcAgentIntakeEditorActions { padding-inline: 12px; }
|
|
1250
|
+
.dcAgentIntakeSourceActions .dcAgentButton { flex: 1 1 100%; }
|
|
1251
|
+
.dcAgentUploadActions .dcAgentButton { flex: 1 1 100%; }
|
|
1252
|
+
.dcAgentMatchHeader, .dcAgentMatchBlock { padding-inline: 12px; }
|
|
1253
|
+
.dcAgentMatchActions { margin-inline: 12px; }
|
|
1254
|
+
.dcAgentMatchActions .dcAgentButton { width: 100%; }
|
|
1255
|
+
}
|
|
1256
|
+
@container dc-agent-workbench (max-width: 360px) {
|
|
1257
|
+
.dcAgentDatasetDownloads > .dcAgentButton { flex: 1 1 100%; }
|
|
1258
|
+
}
|
|
828
1259
|
@media (max-width: 760px) {
|
|
829
1260
|
[data-dc-agent-hero-title="true"] { font-size: 20px; }
|
|
830
1261
|
.dcAgentHeroLogo { width: 40px; height: 40px; border-radius: 8px; }
|
|
@@ -1349,41 +1780,60 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
1349
1780
|
const occupied = (id) => isAnchorField(id) && mappings.some((item) => item.sourceField !== sourceField && item.targetField === id);
|
|
1350
1781
|
const fields = groups.flatMap(([, , items]) => items);
|
|
1351
1782
|
const label = fields.find(([id]) => id === value)?.[1] || '不参与匹配 / 补全';
|
|
1352
|
-
const
|
|
1783
|
+
const normalizedQuery = normalizeMappingLabel(query);
|
|
1784
|
+
const matches = (id, name) => normalizeMappingLabel([id, name, ...(MAPPING_ALIASES[id] || []), ...Object.entries(MAPPING_HINTS).filter(([, ids]) => ids.includes(id)).map(([hint]) => hint)].join(' ')).includes(normalizedQuery);
|
|
1353
1785
|
const filteredGroups = groups.filter(([id]) => !category || id === category)
|
|
1354
|
-
.map(([id, title, items
|
|
1786
|
+
.map(([id, title, items, tool]) => {
|
|
1787
|
+
const groupMatches = normalizeMappingLabel([id, title, tool || ''].join(' ')).includes(normalizedQuery);
|
|
1788
|
+
return [id, title, groupMatches ? items : items.filter(([key, name]) => matches(key, name))];
|
|
1789
|
+
})
|
|
1355
1790
|
.filter(([, , items]) => items.length);
|
|
1356
1791
|
const filteredFields = filteredGroups.flatMap(([, , items]) => items);
|
|
1357
1792
|
const hiddenSelection = value && !filteredFields.some(([id]) => id === value);
|
|
1793
|
+
const selectMapping = (event) => {
|
|
1794
|
+
onChange(sourceField, event.currentTarget.value);
|
|
1795
|
+
const details = event.currentTarget.closest('details');
|
|
1796
|
+
if (details) { details.open = false; details.querySelector('summary')?.focus(); }
|
|
1797
|
+
};
|
|
1358
1798
|
return h('div', { className: 'dcAgentMappingRow' },
|
|
1359
|
-
h('
|
|
1360
|
-
h('div', { style: { minWidth: 0 } },
|
|
1361
|
-
h('details', { className: 'dcAgentMappingPicker', onKeyDown: (event) => {
|
|
1799
|
+
h('details', { className: 'dcAgentMappingPicker', onKeyDown: (event) => {
|
|
1362
1800
|
if (event.key === 'Escape' && event.currentTarget.open) {
|
|
1363
1801
|
event.preventDefault(); event.stopPropagation();
|
|
1364
1802
|
event.currentTarget.open = false; event.currentTarget.querySelector('summary')?.focus();
|
|
1365
1803
|
}
|
|
1366
1804
|
} },
|
|
1367
|
-
|
|
1368
|
-
h('
|
|
1369
|
-
h('
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1805
|
+
h('summary', { className: 'dcAgentMappingSummary', 'aria-label': `${sourceField} 当前映射` },
|
|
1806
|
+
h('span', { className: 'dcAgentMappingSource', title: sourceField }, sourceField),
|
|
1807
|
+
h('b', { 'aria-hidden': 'true' }, '→'),
|
|
1808
|
+
h('span', { className: 'dcAgentMappingValue' }, label),
|
|
1809
|
+
),
|
|
1810
|
+
h('div', { className: 'dcAgentMappingPickerPanel' },
|
|
1811
|
+
h('div', { className: 'dcAgentMappingPickerFilters' },
|
|
1812
|
+
h('input', { className: 'dcAgentField', value: query, placeholder: '模糊搜索字段名称 / 英文键 / 别名', 'aria-label': `${sourceField} 搜索映射字段`, onChange: (event) => setQuery(event.target.value) }),
|
|
1813
|
+
h('select', { className: 'dcAgentField', value: category, 'aria-label': `${sourceField} 映射大类`, onChange: (event) => setCategory(event.target.value) },
|
|
1814
|
+
h('option', { value: '' }, '全部维度'),
|
|
1815
|
+
groups.map(([id, title]) => h('option', { key: id, value: id }, title))),
|
|
1816
|
+
),
|
|
1817
|
+
h('div', { className: 'dcAgentMappingOptionGroups', role: 'radiogroup', 'aria-label': `${sourceField} 字段映射` },
|
|
1818
|
+
h('label', { className: 'dcAgentMappingClearOption' },
|
|
1819
|
+
h('input', { type: 'radio', name: `mapping:${sourceField}`, value: '', checked: !value, onChange: selectMapping }),
|
|
1820
|
+
h('span', null, '不参与匹配 / 补全')),
|
|
1821
|
+
hiddenSelection ? h('p', { className: 'dcAgentMappingCurrentNotice' }, `当前选择:${label}(不符合筛选,保持不变)`) : null,
|
|
1822
|
+
filteredGroups.map(([id, title, items]) => h('section', { key: id, className: 'dcAgentMappingOptionGroup', 'data-mapping-group': id },
|
|
1823
|
+
h('h4', { className: 'dcAgentMappingOptionGroupTitle' }, title),
|
|
1824
|
+
h('div', { className: 'dcAgentMappingOptionGrid' }, items.map(([key, name]) => h('label', { key, className: 'dcAgentMappingOption' },
|
|
1825
|
+
h('input', { type: 'radio', name: `mapping:${sourceField}`, value: key, checked: value === key, disabled: occupied(key), onChange: selectMapping }),
|
|
1826
|
+
h('span', null, name),
|
|
1827
|
+
occupied(key) ? h('small', null, '已占用') : null,
|
|
1828
|
+
))),
|
|
1829
|
+
)),
|
|
1381
1830
|
),
|
|
1382
|
-
h('p', { className: 'dcAgentHint', role: 'status' }, filteredFields.length ? `匹配 ${filteredFields.length} 个字段;选择后采用。` : '无匹配字段;当前选择保持不变。'),
|
|
1831
|
+
h('p', { className: 'dcAgentHint dcAgentMappingMatch', role: 'status' }, filteredFields.length ? `匹配 ${filteredFields.length} 个字段;选择后采用。` : '无匹配字段;当前选择保持不变。'),
|
|
1383
1832
|
),
|
|
1833
|
+
),
|
|
1834
|
+
h('div', { className: 'dcAgentMappingMeta' },
|
|
1384
1835
|
value === 'beneficial_owner_first_name' || value.startsWith('financial_') ? h('p', { className: 'dcAgentHint' }, value === 'beneficial_owner_first_name' ? '仅取返回首条受益所有人,不代表唯一或最大受益人。' : '取返回首个报告期,不跨期补值;报告期保留在结果取值说明中。') : null,
|
|
1385
|
-
h('small', { className: 'dcAgentMappingStatus', 'data-status': value ? 'confirmed' : recommendation.candidates.length ? 'review' : 'unmatched',
|
|
1386
|
-
style: { display: 'block', padding: '6px 0' } },
|
|
1836
|
+
h('small', { className: 'dcAgentMappingStatus', 'data-status': value ? 'confirmed' : recommendation.candidates.length ? 'review' : 'unmatched' },
|
|
1387
1837
|
value ? `${recommendation.automatic && recommendation.candidates[0]?.[0] === value ? '自动通过' : '已确认'}:${label};可手动调整` : recommendation.candidates.length ? `待人工确认:${recommendation.conflict ? '重复列可确认使用同一补全字段;主体标识只选一列' : recommendation.reason}` : '未匹配:保留原列,可手动选择字段'),
|
|
1388
1838
|
!value && recommendation.candidates.length ? h('div', { className: 'dcAgentRow', 'aria-label': `${sourceField} 推荐映射` }, recommendation.candidates.map(([id, name]) =>
|
|
1389
1839
|
h('button', { key: id, type: 'button', className: 'dcAgentButton', disabled: occupied(id), onClick: () => onChange(sourceField, id) }, `推荐:${name}${occupied(id) ? '(已占用)' : ''}`))) : null,
|
|
@@ -3256,11 +3706,13 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
3256
3706
|
} catch (error) { onError?.(error instanceof Error ? error.message : String(error)); }
|
|
3257
3707
|
};
|
|
3258
3708
|
const complete = expectedCount == null || expectedCount === total;
|
|
3259
|
-
return h('section', { className: 'dcAgentSection', 'aria-label': title },
|
|
3260
|
-
h('
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3709
|
+
return h('section', { className: 'dcAgentSection dcAgentDatasetPreview', 'aria-label': title },
|
|
3710
|
+
h('div', { className: 'dcAgentDatasetHeader' },
|
|
3711
|
+
h('h3', null, title),
|
|
3712
|
+
h('p', { className: 'dcAgentHint', role: 'status' }, complete
|
|
3713
|
+
? `共 ${total} 条,当前显示 ${total ? start + 1 : 0}–${Math.min(start + pageSize, total)} 条;共 ${columns.length} 列,可横向滚动。`
|
|
3714
|
+
: `完整清单尚未就绪:预期 ${expectedCount} 条,当前载入 ${total} 条。请等待同步;刷新后若仍缺失,请重新上传源文件。`),
|
|
3715
|
+
),
|
|
3264
3716
|
h('div', { className: 'dcAgentPreviewTable', tabIndex: 0, role: 'region', 'aria-label': '表格预览,可横向和纵向滚动,表头固定', style: { overflow: 'auto', maxHeight: '420px' } },
|
|
3265
3717
|
h('table', { className: 'dcAgentTable' },
|
|
3266
3718
|
h('thead', null, h('tr', null, h('th', null, '序号'), columns.map((key) => h('th', { key }, resultFieldLabel(key))))),
|
|
@@ -3270,16 +3722,18 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
3270
3722
|
))),
|
|
3271
3723
|
),
|
|
3272
3724
|
),
|
|
3273
|
-
h('div', { className: '
|
|
3274
|
-
h('
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
h('
|
|
3280
|
-
|
|
3725
|
+
h('div', { className: 'dcAgentDatasetFooter' },
|
|
3726
|
+
h('div', { className: 'dcAgentDatasetPagination', 'aria-label': '清单分页' },
|
|
3727
|
+
h('button', { type: 'button', className: 'dcAgentButton', disabled: currentPage === 0, onClick: () => setPage(currentPage - 1) }, '上一页'),
|
|
3728
|
+
h('span', { className: 'dcAgentDatasetPage', 'aria-live': 'polite' }, `第 ${currentPage + 1} / ${Math.max(1, Math.ceil(total / pageSize))} 页`),
|
|
3729
|
+
h('button', { type: 'button', className: 'dcAgentButton', disabled: start + pageSize >= total, onClick: () => setPage(currentPage + 1) }, '下一页'),
|
|
3730
|
+
),
|
|
3731
|
+
h('div', { className: 'dcAgentDatasetDownloads', 'aria-label': '清单导出' },
|
|
3732
|
+
h('button', { type: 'button', className: 'dcAgentButton', 'aria-label': `下载全部 ${total} 条 CSV`, disabled: !complete || !total, onClick: () => download('csv') }, h(IconDownloadOutline16), h('span', null, `下载全部 ${total} 条 CSV`)),
|
|
3733
|
+
h('button', { type: 'button', className: 'dcAgentButton', 'aria-label': '下载原值 JSON', disabled: !complete || !total, onClick: () => download('json') }, h(IconDownloadOutline16), h('span', null, '下载原值 JSON')),
|
|
3734
|
+
),
|
|
3735
|
+
h('p', { className: 'dcAgentHint dcAgentDatasetFooterNote' }, '下载包含全部行,不受分页影响。CSV 对公式及长编号作文本保护;JSON 保留原值。仅导出当前清单,不触发企查查调用。'),
|
|
3281
3736
|
),
|
|
3282
|
-
h('p', { className: 'dcAgentHint' }, '下载包含全部行,不受分页影响。CSV 对公式及长编号作文本保护;JSON 保留原值。仅导出当前清单,不触发企查查调用。'),
|
|
3283
3737
|
);
|
|
3284
3738
|
}
|
|
3285
3739
|
|
|
@@ -3314,6 +3768,19 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
3314
3768
|
const paidConfirmed = useStore((state) => state.paidConfirmed);
|
|
3315
3769
|
const activeSessionId = useStore((state) => state.activeSessionId);
|
|
3316
3770
|
const [fieldQuery, setFieldQuery] = react.useState('');
|
|
3771
|
+
const [intakeEditorOpen, setIntakeEditorOpen] = react.useState(() => dataset == null);
|
|
3772
|
+
|
|
3773
|
+
react.useEffect(() => {
|
|
3774
|
+
setIntakeEditorOpen(dataset == null);
|
|
3775
|
+
}, [dataset]);
|
|
3776
|
+
|
|
3777
|
+
react.useEffect(() => {
|
|
3778
|
+
if (!open || !visible) return;
|
|
3779
|
+
const owner = [...(document.querySelectorAll?.('.dcAgentWorkbenchContent') || [])]
|
|
3780
|
+
.find((node) => node.dataset.sessionId === String(activeSessionId));
|
|
3781
|
+
const body = owner?.querySelector?.('.dcAgentWbBody');
|
|
3782
|
+
if (body) body.scrollTop = 0;
|
|
3783
|
+
}, [step, activeSessionId, open, visible]);
|
|
3317
3784
|
|
|
3318
3785
|
react.useEffect(() => {
|
|
3319
3786
|
if (!open || !visible) return undefined;
|
|
@@ -3362,6 +3829,7 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
3362
3829
|
const stagedSource = runtimeFor(`session:${activeSessionId || 'unassigned'}`, false);
|
|
3363
3830
|
const sourceRows = stagedSource?.sourceRows ?? runtime.sourceRows ?? runtime.rows;
|
|
3364
3831
|
const intake = intakeState(dataset, sourceRows, input, runtime.source || stagedSource?.source || cachedTask?.source);
|
|
3832
|
+
const showIntakeEditor = !dataset || intakeEditorOpen;
|
|
3365
3833
|
const lastCsv = runtime.lastCsv;
|
|
3366
3834
|
const fieldByPattern = (pattern) => runtime.headers.find((field) => pattern.test(field)) ?? null;
|
|
3367
3835
|
const phoneField = fieldByPattern(/^(phone|mobile|tel|telephone|联系电话|手机号码|手机号)$/i);
|
|
@@ -3917,16 +4385,31 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
3917
4385
|
h('span', null, '任务名称'),
|
|
3918
4386
|
h('input', { className: 'dcAgentField', value: taskTitle, maxLength: 120, onChange: (event) => actions.setTaskTitle(event.target.value) }),
|
|
3919
4387
|
),
|
|
3920
|
-
h('section', { className: 'dcAgentSection' },
|
|
3921
|
-
h('
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
}
|
|
4388
|
+
h('section', { className: 'dcAgentSection dcAgentMappingSection', 'aria-label': '字段映射' },
|
|
4389
|
+
h('div', { className: 'dcAgentMappingHeader' },
|
|
4390
|
+
h('div', null,
|
|
4391
|
+
h('h3', null, '字段映射'),
|
|
4392
|
+
h('p', { className: 'dcAgentHint' }, '至少映射企业名称、统一社会信用代码或注册号其中一项。未映射列会原样保留,但不参与匹配。'),
|
|
4393
|
+
),
|
|
4394
|
+
h('div', { className: 'dcAgentMappingProgress', 'aria-label': `已映射 ${mappings.length} / ${dataset?.headers?.length || 0} 列` },
|
|
4395
|
+
h('b', null, `${mappings.length} / ${dataset?.headers?.length || 0}`), h('span', null, '列已映射')),
|
|
4396
|
+
),
|
|
4397
|
+
h('div', { className: 'dcAgentMappingToolbar' },
|
|
4398
|
+
h('div', { className: 'dcAgentMappingLegend', 'aria-label': '映射状态说明' },
|
|
4399
|
+
h('span', { className: 'dcAgentMappingLegendItem', 'data-status': 'confirmed' }, '通过'),
|
|
4400
|
+
h('span', { className: 'dcAgentMappingLegendItem', 'data-status': 'review' }, '待确认'),
|
|
4401
|
+
h('span', { className: 'dcAgentMappingLegendItem', 'data-status': 'unmatched' }, '未匹配')),
|
|
4402
|
+
h('button', { type: 'button', className: 'dcAgentButton dcAgentMappingAuto', onClick: () => actions.setMappings(mergeRecommendedMappings(dataset?.headers || [], mappings, targetFields)) }, '补充自动映射(保留已有选择)'),
|
|
4403
|
+
),
|
|
4404
|
+
h('p', { className: 'dcAgentHint dcAgentMappingNote' }, '确认映射自动选入补全范围,不调用模型或企查查。多个原列可确认使用同一补全字段,主体匹配标识只选一列。'),
|
|
4405
|
+
h('div', { className: 'dcAgentMappingList' },
|
|
4406
|
+
h('div', { className: 'dcAgentMappingListHead', 'aria-hidden': 'true' }, h('span', null, '原始列'), h('span', null, '目标字段')),
|
|
4407
|
+
mappingHints.map((recommendation, index) => h(MappingPicker, {
|
|
4408
|
+
key: `${index}:${recommendation.sourceField}`, sourceField: recommendation.sourceField,
|
|
4409
|
+
mappings, groups: [...uiFieldGroups, ['input-only', '输入校验字段', inputOnlyMappingFields]],
|
|
4410
|
+
recommendation, onChange: actions.setMapping,
|
|
4411
|
+
})),
|
|
4412
|
+
),
|
|
3930
4413
|
),
|
|
3931
4414
|
h('section', { className: 'dcAgentSection' },
|
|
3932
4415
|
h('h3', null, '任务目标'),
|
|
@@ -3980,56 +4463,83 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
3980
4463
|
),
|
|
3981
4464
|
);
|
|
3982
4465
|
} else if (step === 'profile') {
|
|
3983
|
-
pane = h('div', { className: 'dcAgentPane' },
|
|
3984
|
-
h('
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
stat('列数', profile.columnCount ?? '—'),
|
|
3989
|
-
profile.amountStats ? stat('金额 最小', profile.amountStats.min) : null,
|
|
3990
|
-
profile.amountStats ? stat('金额 最大', profile.amountStats.max) : null,
|
|
3991
|
-
profile.amountStats ? stat('金额 总和', profile.amountStats.sum) : null,
|
|
3992
|
-
profile.amountStats ? stat('金额 均值', typeof profile.amountStats.mean === 'number' ? profile.amountStats.mean.toFixed(2) : profile.amountStats.mean) : null,
|
|
4466
|
+
pane = h('div', { className: 'dcAgentPane dcAgentProfilePane' },
|
|
4467
|
+
h('section', { className: 'dcAgentSection dcAgentProfileSurface', 'aria-label': '质量体检报告' },
|
|
4468
|
+
h('header', { className: 'dcAgentProfileHeader' },
|
|
4469
|
+
h('h3', null, '质量体检报告'),
|
|
4470
|
+
h('p', { className: 'dcAgentHint' }, '基于已解析数据生成本地质量画像(缺失率、去重值、金额分布)。本步骤不发起企查查调用。'),
|
|
3993
4471
|
),
|
|
3994
|
-
|
|
3995
|
-
h('
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
h('
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4472
|
+
profile ? h('div', { className: 'dcAgentProfileReport' },
|
|
4473
|
+
h('div', { className: 'dcAgentGrid dcAgentProfileMetrics', 'aria-label': '体检摘要' },
|
|
4474
|
+
stat('行数', profile.rowCount ?? '—'),
|
|
4475
|
+
stat('列数', profile.columnCount ?? '—'),
|
|
4476
|
+
profile.amountStats ? stat('金额 最小', profile.amountStats.min) : null,
|
|
4477
|
+
profile.amountStats ? stat('金额 最大', profile.amountStats.max) : null,
|
|
4478
|
+
profile.amountStats ? stat('金额 总和', profile.amountStats.sum) : null,
|
|
4479
|
+
profile.amountStats ? stat('金额 均值', typeof profile.amountStats.mean === 'number' ? profile.amountStats.mean.toFixed(2) : profile.amountStats.mean) : null,
|
|
4480
|
+
),
|
|
4481
|
+
Array.isArray(profile.columns) && profile.columns.length ? h('section', { className: 'dcAgentProfileTableSection', 'aria-label': '字段质量明细' },
|
|
4482
|
+
h('div', { className: 'dcAgentProfileTableHead' },
|
|
4483
|
+
h('h4', null, '字段质量明细'),
|
|
4484
|
+
h('span', { className: 'dcAgentHint' }, `共 ${profile.columns.length} 列`),
|
|
4485
|
+
),
|
|
4486
|
+
h('div', { className: 'dcAgentProfileTableWrap', tabIndex: 0 },
|
|
4487
|
+
h('table', { className: 'dcAgentTable' },
|
|
4488
|
+
h('thead', null, h('tr', null,
|
|
4489
|
+
h('th', null, '字段'),
|
|
4490
|
+
h('th', null, '非空'),
|
|
4491
|
+
h('th', null, '缺失'),
|
|
4492
|
+
h('th', null, '去重值'),
|
|
4493
|
+
)),
|
|
4494
|
+
h('tbody', null, profile.columns.map((col) => h('tr', { key: col.name },
|
|
4495
|
+
h('td', null, col.name),
|
|
4496
|
+
h('td', { className: 'num' }, String(col.present)),
|
|
4497
|
+
h('td', { className: 'num' }, String(col.missing)),
|
|
4498
|
+
h('td', { className: 'num' }, String(col.distinct)),
|
|
4499
|
+
))),
|
|
4500
|
+
),
|
|
4501
|
+
),
|
|
4502
|
+
) : null,
|
|
4503
|
+
h('div', { className: 'dcAgentProfileActions' },
|
|
4504
|
+
h('button', {
|
|
4505
|
+
type: 'button',
|
|
4506
|
+
className: 'dcAgentButton is-primary',
|
|
4507
|
+
disabled: busy,
|
|
4508
|
+
onClick: () => actions.setStep(requiresQcc ? 'match' : 'enrich'),
|
|
4509
|
+
}, requiresQcc ? '下一步:匹配核验' : '下一步:本地清洗补全'),
|
|
4510
|
+
),
|
|
4511
|
+
) : h('div', { className: 'dcAgentProfileEmpty' },
|
|
4512
|
+
h('button', { type: 'button', className: 'dcAgentButton is-primary', disabled: busy || !hasData, 'aria-label': '生成体检报告', onClick: runProfile }, busy ? '体检中…' : '生成体检报告'),
|
|
4015
4513
|
),
|
|
4016
|
-
) : h('div', { className: 'dcAgentRow' },
|
|
4017
|
-
h('button', { type: 'button', className: 'dcAgentButton is-primary', disabled: busy || !hasData, 'aria-label': '生成体检报告', onClick: runProfile }, busy ? '体检中…' : '生成体检报告'),
|
|
4018
4514
|
),
|
|
4019
4515
|
);
|
|
4020
4516
|
} else if (step === 'match') {
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
h('section', { className: 'dcAgentSection' },
|
|
4024
|
-
h('
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4517
|
+
const identityMappings = mappings.filter((mapping) => ['company_name', 'credit_no', 'reg_no'].includes(mapping.targetField));
|
|
4518
|
+
pane = h('div', { className: 'dcAgentPane dcAgentMatchPane' },
|
|
4519
|
+
h('section', { className: 'dcAgentSection dcAgentMatchSurface', 'aria-label': '主体匹配执行准备' },
|
|
4520
|
+
h('header', { className: 'dcAgentMatchHeader' },
|
|
4521
|
+
h('h3', null, '主体匹配'),
|
|
4522
|
+
h('p', { className: 'dcAgentHint' }, '通过当前用户连接的企查查 MCP 定位企业主体,并按已选维度补全一企一行字段。多候选始终由人工选择;界面不生成虚构置信度。'),
|
|
4523
|
+
),
|
|
4524
|
+
h('div', { className: 'dcAgentMatchContent' },
|
|
4525
|
+
h('section', { className: 'dcAgentMatchBlock', 'aria-label': '匹配依据' },
|
|
4526
|
+
h('div', { className: 'dcAgentMatchBlockHead' },
|
|
4527
|
+
h('h4', null, '匹配依据'),
|
|
4528
|
+
h('span', { className: 'dcAgentMatchScope' }, h('b', null, identityMappings.length), '项'),
|
|
4529
|
+
),
|
|
4530
|
+
h('div', { className: 'dcAgentChips' }, identityMappings.map((mapping) => h('span', { key: mapping.sourceField, className: 'dcAgentChip' }, `${mapping.sourceField} → ${resultFieldLabel(mapping.targetField)}`))),
|
|
4531
|
+
h('p', { className: 'dcAgentHint' }, '统一社会信用代码等强标识优先;名称匹配不明确时进入人工核验队列。'),
|
|
4532
|
+
),
|
|
4533
|
+
h('section', { className: 'dcAgentMatchBlock', 'aria-label': '准备任务说明' },
|
|
4534
|
+
h('div', { className: 'dcAgentMatchBlockHead' },
|
|
4535
|
+
h('h4', null, '准备任务说明'),
|
|
4536
|
+
h('span', { className: 'dcAgentMatchScope' }, h('b', null, dataset?.rowCount ?? runtime.rows.length), '条记录'),
|
|
4537
|
+
),
|
|
4538
|
+
h('p', { className: 'dcAgentHint' }, `已选择 ${fieldSelection.length} 个补全字段。Host 自动检查所需工具并计算去重主体与调用上界。`),
|
|
4539
|
+
h('p', { className: 'dcAgentHint' }, '回填后可修改;点击发送才开始查询,使用你已连接的企查查 MCP 账号及额度。'),
|
|
4540
|
+
),
|
|
4541
|
+
),
|
|
4542
|
+
h('div', { className: 'dcAgentMatchActions' },
|
|
4033
4543
|
h('button', { type: 'button', className: 'dcAgentButton is-primary', disabled: busy || !hasData || !cachedTask?.id, onClick: runQcc }, busy ? '检查并生成中…' : '生成可编辑任务说明'),
|
|
4034
4544
|
),
|
|
4035
4545
|
),
|
|
@@ -4091,18 +4601,25 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
4091
4601
|
);
|
|
4092
4602
|
} else if (step === 'download') {
|
|
4093
4603
|
const availableArtifacts = (cachedTask?.artifacts || []).filter(artifact => artifact.format === 'xlsx' && (artifact.kind !== 'review' || artifact.rowCount > 0));
|
|
4604
|
+
const resultArtifacts = availableArtifacts.filter(artifact => artifact.kind !== 'report');
|
|
4605
|
+
const reportArtifact = availableArtifacts.find(artifact => artifact.kind === 'report');
|
|
4094
4606
|
const canCreateArtifacts = Boolean(exportRows()?.length) && ['rules_confirmed', 'diagnosed', 'export_ready', 'partial'].includes(cachedTask?.state);
|
|
4095
4607
|
pane = h('div', { className: 'dcAgentPane' },
|
|
4096
4608
|
h('p', { className: 'dcAgentHint' }, '结果文件由 Host 保存;有失败、未匹配或待核验记录时展示异常清单。任务或插件重启后,可从任务历史继续下载;无需再次调用企查查。'),
|
|
4097
|
-
h('div', { className: 'dcAgentGrid' },
|
|
4609
|
+
h('div', { className: 'dcAgentResultSummary' }, h('div', { className: 'dcAgentGrid' },
|
|
4098
4610
|
stat('输入行数', dataset ? dataset.rowCount : workflowTask?.source?.rowCount ?? '—'),
|
|
4099
4611
|
stat('匹配补全', qccEnrichedCount, qccEnrichedCount > 0 ? 'good' : null),
|
|
4100
4612
|
stat('待核验', qccReviewCount, qccReviewCount > 0 ? 'warn' : null),
|
|
4101
4613
|
stat('任务状态', WORKFLOW_STATE_LABELS[cachedTask?.state] || cachedTask?.state || '进行中'),
|
|
4102
4614
|
stat('失败', qccFailedCount, qccFailedCount > 0 ? 'bad' : null),
|
|
4103
|
-
),
|
|
4104
|
-
|
|
4105
|
-
|
|
4615
|
+
), reportArtifact ? h('a', {
|
|
4616
|
+
className: 'dcAgentReportLink',
|
|
4617
|
+
href: `/data-cleaning/api/workflow/tasks/${encodeURIComponent(cachedTask.id)}/artifacts/${encodeURIComponent(reportArtifact.id)}`,
|
|
4618
|
+
download: reportArtifact.fileName, 'aria-disabled': busy ? 'true' : undefined,
|
|
4619
|
+
onClick: event => { event.preventDefault(); if (!busy) downloadArtifact(reportArtifact); },
|
|
4620
|
+
}, '下载任务结果报告') : null),
|
|
4621
|
+
resultArtifacts.length ? h('div', { className: 'dcAgentArtifactList' },
|
|
4622
|
+
resultArtifacts.map(artifact => h('div', { key: artifact.id, className: 'dcAgentCard' },
|
|
4106
4623
|
h('p', { className: 'dcAgentHint' }, artifact.fileName),
|
|
4107
4624
|
h('div', { className: 'dcAgentRow' }, h('a', {
|
|
4108
4625
|
key: 'preview-' + artifact.id, className: 'dcAgentButton',
|
|
@@ -4115,7 +4632,7 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
4115
4632
|
disabled: busy,
|
|
4116
4633
|
onClick: () => downloadArtifact(artifact),
|
|
4117
4634
|
'aria-label': `下载 ${artifact.fileName}`,
|
|
4118
|
-
}, `下载${artifact.kind === 'review' ? '异常清单' :
|
|
4635
|
+
}, `下载${artifact.kind === 'review' ? '异常清单' : '清洗补全结果'} XLSX · ${artifact.rowCount} 行`)))),
|
|
4119
4636
|
) : h('div', null,
|
|
4120
4637
|
h('div', { className: 'dcAgentRow' },
|
|
4121
4638
|
h('button', { type: 'button', className: 'dcAgentButton is-primary', disabled: busy || !canCreateArtifacts, onClick: () => createAndDownload('complete', 'xlsx') }, '生成并下载结果 XLSX'),
|
|
@@ -4126,44 +4643,59 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
4126
4643
|
);
|
|
4127
4644
|
} else {
|
|
4128
4645
|
pane = h('div', { className: 'dcAgentPane' },
|
|
4129
|
-
h('
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4646
|
+
dataset ? h('section', { className: 'dcAgentSection dcAgentIntakeSummary', 'aria-label': '当前导入数据', role: 'status' },
|
|
4647
|
+
h('div', { className: 'dcAgentIntakeSummaryHead' },
|
|
4648
|
+
h('div', null,
|
|
4649
|
+
h('h3', null, intake.available ? `已解析 ${intake.count} 条数据` : '已保存导入摘要'),
|
|
4650
|
+
h('p', { className: 'dcAgentHint', style: { overflowWrap: 'anywhere' } }, `当前来源:${intake.fileName}`),
|
|
4651
|
+
),
|
|
4652
|
+
),
|
|
4133
4653
|
h('p', { className: 'dcAgentHint' }, intake.available
|
|
4134
|
-
? '
|
|
4654
|
+
? '数据已导入。请核对下方完整名单;需要替换来源时点击“重新导入”。'
|
|
4135
4655
|
: '当前页面没有完整原始数据。请重新导入原文件;历史下载制品仍可从任务历史获取。'),
|
|
4136
4656
|
) : null,
|
|
4137
|
-
h('
|
|
4138
|
-
h('
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4657
|
+
showIntakeEditor ? h('section', { id: 'dc-agent-intake-editor', className: 'dcAgentSection dcAgentIntakeEditor', 'aria-label': dataset ? '重新导入数据' : '导入数据' },
|
|
4658
|
+
h('header', { className: 'dcAgentIntakeEditorHeader' },
|
|
4659
|
+
h('h3', null, dataset ? '重新导入数据' : '导入数据'),
|
|
4660
|
+
h('p', { className: 'dcAgentHint' }, '选择表格或 JSON 文件、识别图片,或者粘贴 CSV / JSON 数据。成功解析后此区域会自动收起。'),
|
|
4661
|
+
),
|
|
4662
|
+
h('div', { className: 'dcAgentIntakeSourceActions' },
|
|
4663
|
+
h('button', { type: 'button', className: 'dcAgentButton', disabled: busy,
|
|
4664
|
+
onClick: (event) => event.currentTarget.nextElementSibling?.click() }, '选择文件(自动解析)'),
|
|
4665
|
+
h('input', {
|
|
4666
|
+
type: 'file',
|
|
4667
|
+
accept: '.csv,.json,.xlsx,.xls,image/png,image/jpeg,image/webp',
|
|
4668
|
+
className: 'dcAgentField',
|
|
4669
|
+
style: { display: 'none' },
|
|
4670
|
+
disabled: busy,
|
|
4671
|
+
'aria-label': '选择数据文件',
|
|
4672
|
+
onChange: handleFile,
|
|
4673
|
+
}),
|
|
4674
|
+
h('button', { type: 'button', className: 'dcAgentButton', disabled: busy,
|
|
4675
|
+
onClick: () => openImageIntake() }, '图片识别(粘贴 / 选择)'),
|
|
4676
|
+
),
|
|
4677
|
+
h('div', { className: 'dcAgentIntakePaste' },
|
|
4678
|
+
h('textarea', {
|
|
4679
|
+
className: 'dcAgentTextarea',
|
|
4680
|
+
placeholder: '粘贴 CSV 文本,或 JSON 数组(例如 [{"name":"某公司","amount":"100"}])…',
|
|
4681
|
+
'aria-label': '粘贴数据',
|
|
4682
|
+
value: input,
|
|
4683
|
+
disabled: busy,
|
|
4684
|
+
onPaste: (event) => {
|
|
4685
|
+
const files = imageFilesFromTransfer(event.clipboardData);
|
|
4686
|
+
if (files.length && openImageIntake(files[0])) {
|
|
4687
|
+
event.preventDefault();
|
|
4688
|
+
event.stopPropagation?.();
|
|
4689
|
+
}
|
|
4690
|
+
},
|
|
4691
|
+
onInput: (event) => { actions.setInput(event.target.value); actions.setError(null); },
|
|
4692
|
+
}),
|
|
4693
|
+
),
|
|
4694
|
+
h('div', { className: 'dcAgentIntakeEditorActions' },
|
|
4695
|
+
h('button', { type: 'button', className: 'dcAgentButton is-primary', disabled: busy || !intake.pendingText, 'aria-label': '解析数据', onClick: handleParse }, busy ? '解析中…' : '解析粘贴内容'),
|
|
4696
|
+
intake.pendingText && hasData ? h('p', { className: 'dcAgentHint', role: 'status' }, '有尚未解析的新粘贴内容,请先解析或清空后再继续。') : null,
|
|
4697
|
+
),
|
|
4698
|
+
) : null,
|
|
4167
4699
|
dataset ? h('div', { className: 'dcAgentChips' },
|
|
4168
4700
|
h('span', { className: 'dcAgentChip' }, `格式 ${dataset.fmt}`),
|
|
4169
4701
|
h('span', { className: 'dcAgentChip' }, `${dataset.rowCount} 行`),
|
|
@@ -4177,10 +4709,13 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
4177
4709
|
onError: actions.setError,
|
|
4178
4710
|
}) : null,
|
|
4179
4711
|
hasData ? h('p', { className: 'dcAgentHint' }, '请核对完整名单。识别清单不代表已完成企查查匹配。核对后进入「规则与体检」,确认规则生成质量体检;再进入「主体匹配」直接生成可编辑任务说明。Host 自动检查工具和调用范围,回填中央对话框后点击发送才开始查询。') : null,
|
|
4180
|
-
h('div', { className: '
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4712
|
+
h('div', { className: 'dcAgentUploadActions' },
|
|
4713
|
+
hasData && !intakeEditorOpen ? h('button', {
|
|
4714
|
+
type: 'button', className: 'dcAgentButton', disabled: busy,
|
|
4715
|
+
'aria-expanded': false, 'aria-controls': 'dc-agent-intake-editor',
|
|
4716
|
+
onClick: () => { actions.setError(null); setIntakeEditorOpen(true); },
|
|
4717
|
+
}, '重新导入') : null,
|
|
4718
|
+
hasData ? h('button', { type: 'button', className: 'dcAgentButton is-primary', disabled: busy || !intake.available || intake.pendingText, onClick: () => { actions.setError(null); actions.setStep('rules'); } }, '已核对清单,下一步:字段映射与规则') : null,
|
|
4184
4719
|
),
|
|
4185
4720
|
);
|
|
4186
4721
|
}
|
|
@@ -4230,7 +4765,7 @@ body:has(.dcAgentPromptBackdrop) { overflow: hidden; }
|
|
|
4230
4765
|
h('p', { className: 'dcAgentHint' }, '导入与核验 → 规则与体检 → 主体匹配 → 字段补全 → 结果下载。菜单只切换视图,不启动调用;按页面主按钮逐步确认。'),
|
|
4231
4766
|
h('p', { className: 'dcAgentHint' }, '支持文本、Excel、JSON 和图片名单。原值保留、多候选人工核验;企查查调用使用当前用户自己的连接与额度。'),
|
|
4232
4767
|
) : null,
|
|
4233
|
-
['rules', 'profile'].includes(step) ? h('nav', { className: '
|
|
4768
|
+
['rules', 'profile'].includes(step) ? h('nav', { className: 'dcAgentViewTabs', 'aria-label': '规则与体检视图' },
|
|
4234
4769
|
h('button', { type: 'button', className: 'dcAgentButton', 'aria-pressed': step === 'rules', onClick: () => actions.setStep('rules') }, '字段映射与规则'),
|
|
4235
4770
|
h('button', { type: 'button', className: 'dcAgentButton', 'aria-pressed': step === 'profile', onClick: () => actions.setStep('profile') }, '质量体检报告'),
|
|
4236
4771
|
) : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-data-cleaning-agent",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "Data cleaning and data enrichment for CSV/XLSX/JSON enterprise lists in DeepSeek Harness, including spreadsheet cleaning, deduplication, profiling, optional Qichacha MCP and exports.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|