@@ -14,38 +14,39 @@ import { invoke } from "@tauri-apps/api/core";
1414import SopRunOverlay from "./SopRunOverlay" ;
1515import { PracticeOverlay , QuestionsOverlay } from "./PracticeQuestionsOverlays" ;
1616
17+ /** 响应结构(SopTemplate/ActionQueueRow/CompletionEvent 均 serde camelCase——字段须 camel 读取) */
1718interface SopTemplateView {
1819 id : number ;
19- note_id : number ;
20+ noteId : number ;
2021 name : string ;
21- start_line : number ;
22- end_line : number ;
22+ startLine : number ;
23+ endLine : number ;
2324 mode : string ;
24- note_title : string ;
25+ noteTitle : string ;
2526}
2627
2728interface ActionRow {
2829 id : number ;
29- note_id : number ;
30- line_no : number ;
30+ noteId : number ;
31+ lineNo : number ;
3132 text : string ;
3233 status : string ;
3334 unrefined : boolean ;
34- plan_date : number | null ;
35+ planDate : number | null ;
3536 disposition : string | null ;
36- note_title : string ;
37+ noteTitle : string ;
3738}
3839
3940interface HistoryRow {
4041 id : number ;
4142 ts : number ;
42- event_type : string ;
43- source_type : string ;
44- source_id : number | null ;
45- note_id : number | null ;
43+ eventType : string ;
44+ sourceType : string ;
45+ sourceId : number | null ;
46+ noteId : number | null ;
4647 text : string ;
4748 note : string | null ;
48- meta_json : string | null ;
49+ metaJson : string | null ;
4950}
5051
5152interface Props {
@@ -324,7 +325,7 @@ export default function ActionCenterOverlay({ onClose, onChanged }: Props) {
324325 /** 迁出=放手:复制 todo.txt 行到剪贴板(保底三件套之复制面) */
325326 const exportCopy = async ( r : ActionRow ) => {
326327 try {
327- const line = `[ ] ${ r . text } (via:${ r . note_title } )` ;
328+ const line = `[ ] ${ r . text } (via:${ r . noteTitle } )` ;
328329 await navigator . clipboard . writeText ( line ) ;
329330 setMsg ( `⤴ 已复制 todo.txt 行(外部完成后可到完成史手动回填):${ line } ` ) ;
330331 } catch ( e ) {
@@ -336,7 +337,7 @@ export default function ActionCenterOverlay({ onClose, onChanged }: Props) {
336337 < div key = { r . id } style = { { border : overdueFlag ? "1px solid #fca5a5" : "1px solid #e5e7eb" , background : overdueFlag ? "#fff7f7" : "#fff" , borderRadius : 6 , padding : "6px 8px" , display : "flex" , flexDirection : "column" , gap : 4 } } >
337338 < div style = { { display : "flex" , gap : 6 , alignItems : "center" } } >
338339 < span style = { { fontSize : 12.5 , color : "#111827" , flex : 1 } } > { r . text } </ span >
339- < span style = { { fontSize : 10.5 , color : "#9ca3af" } } > @{ r . note_title } </ span >
340+ < span style = { { fontSize : 10.5 , color : "#9ca3af" } } > @{ r . noteTitle } </ span >
340341 { overdueFlag && < span style = { { fontSize : 10.5 , color : "#dc2626" , fontWeight : 600 } } > 逾期</ span > }
341342 </ div >
342343 { reasonFor === r . id && (
@@ -438,7 +439,7 @@ export default function ActionCenterOverlay({ onClose, onChanged }: Props) {
438439 < label key = { r . id } style = { { display : "flex" , gap : 6 , alignItems : "center" , fontSize : 12 , cursor : "pointer" , padding : "2px 4px" , borderRadius : 4 , background : checked . has ( r . id ) ? "#f5f3ff" : "transparent" } } >
439440 < input type = "checkbox" checked = { checked . has ( r . id ) } onChange = { ( ) => toggleChecked ( r . id ) } />
440441 < span style = { { color : "#111827" } } > { r . text } </ span >
441- < span style = { { fontSize : 10.5 , color : "#9ca3af" , marginLeft : "auto" } } > @{ r . note_title } </ span >
442+ < span style = { { fontSize : 10.5 , color : "#9ca3af" , marginLeft : "auto" } } > @{ r . noteTitle } </ span >
442443 </ label >
443444 ) ) }
444445 </ div >
@@ -460,7 +461,7 @@ export default function ActionCenterOverlay({ onClose, onChanged }: Props) {
460461 { unrefined . length === 0 ? empty ( "无待提炼产物行" ) : unrefined . map ( ( r ) => (
461462 < div key = { r . id } style = { { border : "1px solid #e5e7eb" , borderRadius : 6 , padding : "6px 8px" , display : "flex" , gap : 6 , alignItems : "center" } } >
462463 < span style = { { fontSize : 12.5 , flex : 1 } } > ☑️ { r . text } </ span >
463- < span style = { { fontSize : 10.5 , color : "#9ca3af" } } > @{ r . note_title } </ span >
464+ < span style = { { fontSize : 10.5 , color : "#9ca3af" } } > @{ r . noteTitle } </ span >
464465 < button style = { { ...okBtn , fontSize : 11 } } onClick = { ( ) => void refineUnrefined ( r . id ) } > 提炼为任务行</ button >
465466 </ div >
466467 ) ) }
@@ -471,8 +472,8 @@ export default function ActionCenterOverlay({ onClose, onChanged }: Props) {
471472 { history . length === 0 ? empty ( "暂无完成记录——完成即证据,周回顾原料在此沉淀" ) : history . map ( ( h ) => (
472473 < div key = { h . id } style = { { display : "flex" , gap : 8 , fontSize : 12 , borderBottom : "1px solid #f3f4f6" , padding : "4px 2px" } } >
473474 < span style = { { color : "#9ca3af" , fontVariantNumeric : "tabular-nums" , flexShrink : 0 } } > { fmtDate ( h . ts ) } </ span >
474- < span style = { { color : h . event_type === "abandoned" ? "#dc2626" : "#0f766e" , flexShrink : 0 , width : 90 } } >
475- { TYPE_LABEL [ h . event_type ] ?? h . event_type }
475+ < span style = { { color : h . eventType === "abandoned" ? "#dc2626" : "#0f766e" , flexShrink : 0 , width : 90 } } >
476+ { TYPE_LABEL [ h . eventType ] ?? h . eventType }
476477 </ span >
477478 < span style = { { flex : 1 , color : "#374151" } } > { h . text } </ span >
478479 { h . note && < span style = { { fontSize : 11 , color : "#9ca3af" } } > 因:{ h . note } </ span > }
@@ -511,7 +512,7 @@ export default function ActionCenterOverlay({ onClose, onChanged }: Props) {
511512 < div key = { t . id } style = { { border : "1px solid #e5e7eb" , borderRadius : 8 , padding : "6px 10px" } } >
512513 < div style = { { display : "flex" , gap : 6 , alignItems : "center" } } >
513514 < span style = { { fontSize : 12.5 , fontWeight : 600 , color : "#111827" } } > { t . name } </ span >
514- < span style = { { fontSize : 11 , color : "#9ca3af" } } > @{ t . note_title } · 行 { t . start_line } –{ t . end_line } · { t . mode === "confirm" ? "总览核对" : "逐步引导" } </ span >
515+ < span style = { { fontSize : 11 , color : "#9ca3af" } } > @{ t . noteTitle } · 行 { t . startLine } –{ t . endLine } · { t . mode === "confirm" ? "总览核对" : "逐步引导" } </ span >
515516 < span style = { { marginLeft : "auto" , display : "flex" , gap : 4 } } >
516517 < button style = { okBtn } onClick = { ( ) => setActiveTemplate ( t ) } > ▶ 执行</ button >
517518 < button style = { ghostBtn } onClick = { ( ) => void fetchSuggestions ( t . id ) } > 💡 修订建议</ button >
0 commit comments