dsh-qizhoucnc-cam 1.3.13 → 1.3.14

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.
Files changed (2) hide show
  1. package/client.js +31 -33
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -314,9 +314,8 @@ window.__ModuleLoader__.load({
314
314
  // scene 来自 /dsh-cam/model:{ bounds:{min,max}, faces:[{id,vertices,triangles,center,area}], edges:[{id,points}] }
315
315
  // selected: { kind:'face'|'edge', id } | null;点击面/边时回传 onSelect。
316
316
  // pivot: [x,y,z] 旋转轴心;默认取模型包围盒中心。旋转/缩放都围绕该点。
317
- function ModelViewer3D({ scene, selected, onSelect, onAnnotate, pivot, features, locate, overlays, transform }) {
317
+ function ModelViewer3D({ scene, selected, onSelect, onAnnotate, pivot, features, locate, overlays, transform, maximized, onToggleMaximize }) {
318
318
  const [view, setView] = React.useState(null);
319
- const [maximized, setMaximized] = React.useState(false); // 放大模型视窗(全屏遮罩)
320
319
  const drag = React.useRef(null);
321
320
  // 单击/双击判定:记录上次点击的目标与时间(同目标 350ms 内再次点击 = 双击标注)
322
321
  const clickState = React.useRef({ time: 0, kind: null, id: null });
@@ -672,7 +671,7 @@ window.__ModuleLoader__.load({
672
671
 
673
672
  // 最大化按钮 + 恢复按钮(模型视窗放大/还原)
674
673
  const maxBtn = h('button', {
675
- onClick: () => setMaximized((v) => !v),
674
+ onClick: () => (typeof onToggleMaximize === 'function' ? onToggleMaximize() : null),
676
675
  title: maximized ? '还原模型视窗大小' : '放大模型视窗(全屏操作)',
677
676
  style: {
678
677
  marginLeft: 'auto', padding: '1px 8px', fontSize: 11, cursor: 'pointer', borderRadius: 5,
@@ -697,35 +696,6 @@ window.__ModuleLoader__.load({
697
696
  h('g', null, edgeEls),
698
697
  h('g', null, overlayEls));
699
698
 
700
- // 放大:全屏遮罩里显示更大的模型视窗
701
- if (maximized) {
702
- return h('div', {
703
- style: {
704
- position: 'fixed', inset: 0, zIndex: 3100,
705
- background: 'rgba(15, 23, 42, 0.6)',
706
- display: 'flex', flexDirection: 'column', padding: 18,
707
- },
708
- onClick: () => setMaximized(false),
709
- },
710
- h('div', {
711
- style: {
712
- flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column', gap: 6,
713
- background: 'var(--dsw-alias-bg-base, #fff)', borderRadius: 12, padding: 12,
714
- boxShadow: '0 24px 80px rgba(0,0,0,0.45)',
715
- },
716
- onClick: (e) => e.stopPropagation(),
717
- },
718
- h('div', { style: { display: 'flex', gap: 4, alignItems: 'center', flexWrap: 'wrap' } },
719
- h('span', { style: { fontSize: 12, color: 'var(--dsw-alias-label-tertiary, #9ca3af)', marginRight: 2, fontWeight: 600 } }, '模型视窗'),
720
- VIEWS.map((v) => viewBtn(v, activeView === v)),
721
- maxBtn),
722
- svgBlock({ flex: 1, minHeight: 0 }),
723
- h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, fontSize: 12 } },
724
- h('span', { style: { flex: 1, color: selected ? 'var(--dsw-alias-brand-primary, #2563eb)' : 'var(--dsw-alias-label-tertiary, #9ca3af)', fontWeight: selected ? 600 : 400 } }, selText),
725
- h('span', { style: { color: 'var(--dsw-alias-label-tertiary, #9ca3af)' } },
726
- '拖拽=旋转 · Shift/右键=平移 · 滚轮=缩放 · 面 ' + scene.faces.length + ' · 边 ' + scene.edges.length))));
727
- }
728
-
729
699
  return h('div', { style: { display: 'flex', flexDirection: 'column', gap: 6, flex: 1, minHeight: 0 } },
730
700
  h('div', { style: { display: 'flex', gap: 4, alignItems: 'center', flexWrap: 'wrap' } },
731
701
  h('span', { style: { fontSize: 11, color: 'var(--dsw-alias-label-tertiary, #9ca3af)', marginRight: 2 } }, '视图'),
@@ -1047,6 +1017,8 @@ window.__ModuleLoader__.load({
1047
1017
  // 版本更新检查(右下角:版本号 / 更新提醒 / 手动更新)
1048
1018
  const [versionInfo, setVersionInfo] = React.useState(null); // { current, latest, updateAvailable }
1049
1019
  const [updating, setUpdating] = React.useState(false); // 是否正在执行更新
1020
+ // 模型视窗放大(全屏遮罩显示整个模型操作区:标注列表 + 视窗 + 轴心 + 设置面板 + 标注输入 + 夹具/毛坯)
1021
+ const [modelMaximized, setModelMaximized] = React.useState(false);
1050
1022
  // 底部设置区(主体零件位移/旋转 + 夹具/毛坯)折叠/展开
1051
1023
  const [setupCollapsed, setSetupCollapsed] = React.useState(false);
1052
1024
  // FreeCAD 自动下载状态(未安装 FreeCAD 时展示进度并触发下载)
@@ -1728,7 +1700,31 @@ window.__ModuleLoader__.load({
1728
1700
  h('div', { style: { flex: 1, overflow: 'hidden', padding: 10, display: 'flex', flexDirection: 'column', minHeight: 0 } },
1729
1701
  err ? h('div', { style: { padding: 8, color: 'var(--dsw-alias-state-error-primary, #dc2626)', fontSize: 12, marginBottom: 8 } }, '错误:' + err) : null,
1730
1702
  viewMode === 'model'
1731
- ? h('div', { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'row', gap: 8 } },
1703
+ ? h('div', {
1704
+ style: {
1705
+ flex: 1, minHeight: 0, display: 'flex', flexDirection: 'row', gap: 8,
1706
+ // 放大:把整个模型操作区(标注列表 + 视窗 + 轴心 + 设置面板 + 标注输入 + 夹具/毛坯)
1707
+ // 原样铺到全屏,布局保持不变;position:fixed 相对视口定位,不受面板 overflow 裁剪。
1708
+ ...(modelMaximized ? {
1709
+ position: 'fixed', inset: 0, zIndex: 3100,
1710
+ background: 'var(--dsw-alias-bg-base, #fff)',
1711
+ padding: 16, boxShadow: '0 24px 80px rgba(0,0,0,0.35)',
1712
+ } : {}),
1713
+ },
1714
+ },
1715
+ // 放大态:右上角浮动「还原」按钮 + 顶部标题条(点击遮罩语义一致)
1716
+ modelMaximized ? h('div', {
1717
+ style: {
1718
+ position: 'absolute', top: 12, right: 12, zIndex: 3101,
1719
+ display: 'flex', alignItems: 'center', gap: 8,
1720
+ },
1721
+ },
1722
+ h('span', { style: { fontSize: 13, fontWeight: 600, color: 'var(--dsw-alias-label-secondary, #6b7280)' } }, '模型视窗 · 放大'),
1723
+ h('button', {
1724
+ onClick: () => setModelMaximized(false),
1725
+ style: { ...btn, fontSize: 12, padding: '3px 12px', fontWeight: 600 },
1726
+ title: '还原模型视窗',
1727
+ }, '还原')) : null,
1732
1728
  // 左侧:已标注加工位置列表
1733
1729
  h('div', { style: { width: 168, flexShrink: 0, display: 'flex', flexDirection: 'column', borderRadius: 8, background: 'var(--dsw-alias-bg-layer-2, #f3f4f6)', border: '1px solid var(--dsw-alias-border-l1, #e5e7eb)', padding: 8, overflow: 'hidden' } },
1734
1730
  h('div', { style: { fontSize: 11, fontWeight: 700, color: 'var(--dsw-alias-label-primary, #111)', marginBottom: 4 } }, '已标注加工位置'),
@@ -1757,6 +1753,8 @@ window.__ModuleLoader__.load({
1757
1753
  h(ModelViewer3D, {
1758
1754
  scene: modelScene, selected: modelSelected, pivot: modelPivot, features: modelFeatures, locate: locateTarget,
1759
1755
  transform: mainTransform,
1756
+ maximized: modelMaximized,
1757
+ onToggleMaximize: () => setModelMaximized((v) => !v),
1760
1758
  overlays: assets.filter((a) => assetScenes[a.id]).map((a) => ({ asset: a, scene: assetScenes[a.id] })),
1761
1759
  onSelect: (sel) => { setModelSelected(sel); setAnnotating(false); },
1762
1760
  onAnnotate: (sel) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-qizhoucnc-cam",
3
- "version": "1.3.13",
3
+ "version": "1.3.14",
4
4
  "description": "CNC program (NC/CNC/G-code) toolpath recognition, 3D toolpath + 3D STEP model viewport (face/edge machining-position annotation), and a large editing view with quote-to-composer, for DeepSeek Harness (DSH). Made by Chengdu Qizhou Machinery Technology Co., Ltd., for research and study only.",
5
5
  "type": "module",
6
6
  "license": "MIT",