adtec-core-package 2.9.6 → 2.9.8
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/.claude/skills/gitnexus/gitnexus-cli/SKILL.md +83 -0
- package/.claude/skills/gitnexus/gitnexus-debugging/SKILL.md +89 -0
- package/.claude/skills/gitnexus/gitnexus-exploring/SKILL.md +78 -0
- package/.claude/skills/gitnexus/gitnexus-guide/SKILL.md +64 -0
- package/.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md +97 -0
- package/.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md +121 -0
- package/AGENTS.md +43 -0
- package/CLAUDE.md +43 -0
- package/package.json +1 -1
- package/src/api/workflow/workflowCommentApi.ts +5 -2
- package/src/components/bpmntree/views/flowDesign/nodes/JumpNode.vue +16 -4
- package/src/components/bpmntree/views/flowDesign/panels/JumpPanel.vue +2 -1
- package/src/components/upload/FileView.vue +22 -18
- package/src/components/workflow/components/AddOrMinusMultiDialog.vue +17 -2
- package/src/components/workflow/components/CheckDialog.vue +3 -0
- package/src/components/workflow/components/ProcessInstanceStep.vue +17 -2
- package/src/hooks/useListenerHooks.ts +81 -52
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-cli
|
|
3
|
+
description: "Use when the user needs to run GitNexus CLI commands like analyze/index a repo, check status, clean the index, generate a wiki, or list indexed repos. Examples: \"Index this repo\", \"Reanalyze the codebase\", \"Generate a wiki\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitNexus CLI Commands
|
|
7
|
+
|
|
8
|
+
All commands work via `npx` — no global install required.
|
|
9
|
+
|
|
10
|
+
## Commands
|
|
11
|
+
|
|
12
|
+
### analyze — Build or refresh the index
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx gitnexus analyze
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Run from the project root. This parses all source files, builds the knowledge graph, writes it to `.gitnexus/`, and generates CLAUDE.md / AGENTS.md context files.
|
|
19
|
+
|
|
20
|
+
| Flag | Effect |
|
|
21
|
+
| -------------- | ---------------------------------------------------------------- |
|
|
22
|
+
| `--force` | Force full re-index even if up to date |
|
|
23
|
+
| `--embeddings` | Enable embedding generation for semantic search (off by default) |
|
|
24
|
+
| `--drop-embeddings` | Drop existing embeddings on rebuild. By default, an `analyze` without `--embeddings` preserves them. |
|
|
25
|
+
|
|
26
|
+
**When to run:** First time in a project, after major code changes, or when `gitnexus://repo/{name}/context` reports the index is stale. In Claude Code, a PostToolUse hook detects staleness after `git commit` and `git merge` and notifies the agent to run `analyze` — the hook does not run analyze itself, to avoid blocking the agent for up to 120s and risking KuzuDB corruption on timeout.
|
|
27
|
+
|
|
28
|
+
### status — Check index freshness
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx gitnexus status
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Shows whether the current repo has a GitNexus index, when it was last updated, and symbol/relationship counts. Use this to check if re-indexing is needed.
|
|
35
|
+
|
|
36
|
+
### clean — Delete the index
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx gitnexus clean
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Deletes the `.gitnexus/` directory and unregisters the repo from the global registry. Use before re-indexing if the index is corrupt or after removing GitNexus from a project.
|
|
43
|
+
|
|
44
|
+
| Flag | Effect |
|
|
45
|
+
| --------- | ------------------------------------------------- |
|
|
46
|
+
| `--force` | Skip confirmation prompt |
|
|
47
|
+
| `--all` | Clean all indexed repos, not just the current one |
|
|
48
|
+
|
|
49
|
+
### wiki — Generate documentation from the graph
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx gitnexus wiki
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Generates repository documentation from the knowledge graph using an LLM. Requires an API key (saved to `~/.gitnexus/config.json` on first use).
|
|
56
|
+
|
|
57
|
+
| Flag | Effect |
|
|
58
|
+
| ------------------- | ----------------------------------------- |
|
|
59
|
+
| `--force` | Force full regeneration |
|
|
60
|
+
| `--model <model>` | LLM model (default: minimax/minimax-m2.5) |
|
|
61
|
+
| `--base-url <url>` | LLM API base URL |
|
|
62
|
+
| `--api-key <key>` | LLM API key |
|
|
63
|
+
| `--concurrency <n>` | Parallel LLM calls (default: 3) |
|
|
64
|
+
| `--gist` | Publish wiki as a public GitHub Gist |
|
|
65
|
+
|
|
66
|
+
### list — Show all indexed repos
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
npx gitnexus list
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Lists all repositories registered in `~/.gitnexus/registry.json`. The MCP `list_repos` tool provides the same information.
|
|
73
|
+
|
|
74
|
+
## After Indexing
|
|
75
|
+
|
|
76
|
+
1. **Read `gitnexus://repo/{name}/context`** to verify the index loaded
|
|
77
|
+
2. Use the other GitNexus skills (`exploring`, `debugging`, `impact-analysis`, `refactoring`) for your task
|
|
78
|
+
|
|
79
|
+
## Troubleshooting
|
|
80
|
+
|
|
81
|
+
- **"Not inside a git repository"**: Run from a directory inside a git repo
|
|
82
|
+
- **Index is stale after re-analyzing**: Restart Claude Code to reload the MCP server
|
|
83
|
+
- **Embeddings slow**: Omit `--embeddings` (it's off by default) or set `OPENAI_API_KEY` for faster API-based embedding
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-debugging
|
|
3
|
+
description: "Use when the user is debugging a bug, tracing an error, or asking why something fails. Examples: \"Why is X failing?\", \"Where does this error come from?\", \"Trace this bug\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Debugging with GitNexus
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- "Why is this function failing?"
|
|
11
|
+
- "Trace where this error comes from"
|
|
12
|
+
- "Who calls this method?"
|
|
13
|
+
- "This endpoint returns 500"
|
|
14
|
+
- Investigating bugs, errors, or unexpected behavior
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. gitnexus_query({query: "<error or symptom>"}) → Find related execution flows
|
|
20
|
+
2. gitnexus_context({name: "<suspect>"}) → See callers/callees/processes
|
|
21
|
+
3. READ gitnexus://repo/{name}/process/{name} → Trace execution flow
|
|
22
|
+
4. gitnexus_cypher({query: "MATCH path..."}) → Custom traces if needed
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> If "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
26
|
+
|
|
27
|
+
## Checklist
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
- [ ] Understand the symptom (error message, unexpected behavior)
|
|
31
|
+
- [ ] gitnexus_query for error text or related code
|
|
32
|
+
- [ ] Identify the suspect function from returned processes
|
|
33
|
+
- [ ] gitnexus_context to see callers and callees
|
|
34
|
+
- [ ] Trace execution flow via process resource if applicable
|
|
35
|
+
- [ ] gitnexus_cypher for custom call chain traces if needed
|
|
36
|
+
- [ ] Read source files to confirm root cause
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Debugging Patterns
|
|
40
|
+
|
|
41
|
+
| Symptom | GitNexus Approach |
|
|
42
|
+
| -------------------- | ---------------------------------------------------------- |
|
|
43
|
+
| Error message | `gitnexus_query` for error text → `context` on throw sites |
|
|
44
|
+
| Wrong return value | `context` on the function → trace callees for data flow |
|
|
45
|
+
| Intermittent failure | `context` → look for external calls, async deps |
|
|
46
|
+
| Performance issue | `context` → find symbols with many callers (hot paths) |
|
|
47
|
+
| Recent regression | `detect_changes` to see what your changes affect |
|
|
48
|
+
|
|
49
|
+
## Tools
|
|
50
|
+
|
|
51
|
+
**gitnexus_query** — find code related to error:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
gitnexus_query({query: "payment validation error"})
|
|
55
|
+
→ Processes: CheckoutFlow, ErrorHandling
|
|
56
|
+
→ Symbols: validatePayment, handlePaymentError, PaymentException
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**gitnexus_context** — full context for a suspect:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
gitnexus_context({name: "validatePayment"})
|
|
63
|
+
→ Incoming calls: processCheckout, webhookHandler
|
|
64
|
+
→ Outgoing calls: verifyCard, fetchRates (external API!)
|
|
65
|
+
→ Processes: CheckoutFlow (step 3/7)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**gitnexus_cypher** — custom call chain traces:
|
|
69
|
+
|
|
70
|
+
```cypher
|
|
71
|
+
MATCH path = (a)-[:CodeRelation {type: 'CALLS'}*1..2]->(b:Function {name: "validatePayment"})
|
|
72
|
+
RETURN [n IN nodes(path) | n.name] AS chain
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Example: "Payment endpoint returns 500 intermittently"
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
1. gitnexus_query({query: "payment error handling"})
|
|
79
|
+
→ Processes: CheckoutFlow, ErrorHandling
|
|
80
|
+
→ Symbols: validatePayment, handlePaymentError
|
|
81
|
+
|
|
82
|
+
2. gitnexus_context({name: "validatePayment"})
|
|
83
|
+
→ Outgoing calls: verifyCard, fetchRates (external API!)
|
|
84
|
+
|
|
85
|
+
3. READ gitnexus://repo/my-app/process/CheckoutFlow
|
|
86
|
+
→ Step 3: validatePayment → calls fetchRates (external)
|
|
87
|
+
|
|
88
|
+
4. Root cause: fetchRates calls external API without proper timeout
|
|
89
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-exploring
|
|
3
|
+
description: "Use when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase. Examples: \"How does X work?\", \"What calls this function?\", \"Show me the auth flow\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Exploring Codebases with GitNexus
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- "How does authentication work?"
|
|
11
|
+
- "What's the project structure?"
|
|
12
|
+
- "Show me the main components"
|
|
13
|
+
- "Where is the database logic?"
|
|
14
|
+
- Understanding code you haven't seen before
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. READ gitnexus://repos → Discover indexed repos
|
|
20
|
+
2. READ gitnexus://repo/{name}/context → Codebase overview, check staleness
|
|
21
|
+
3. gitnexus_query({query: "<what you want to understand>"}) → Find related execution flows
|
|
22
|
+
4. gitnexus_context({name: "<symbol>"}) → Deep dive on specific symbol
|
|
23
|
+
5. READ gitnexus://repo/{name}/process/{name} → Trace full execution flow
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> If step 2 says "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
27
|
+
|
|
28
|
+
## Checklist
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
- [ ] READ gitnexus://repo/{name}/context
|
|
32
|
+
- [ ] gitnexus_query for the concept you want to understand
|
|
33
|
+
- [ ] Review returned processes (execution flows)
|
|
34
|
+
- [ ] gitnexus_context on key symbols for callers/callees
|
|
35
|
+
- [ ] READ process resource for full execution traces
|
|
36
|
+
- [ ] Read source files for implementation details
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Resources
|
|
40
|
+
|
|
41
|
+
| Resource | What you get |
|
|
42
|
+
| --------------------------------------- | ------------------------------------------------------- |
|
|
43
|
+
| `gitnexus://repo/{name}/context` | Stats, staleness warning (~150 tokens) |
|
|
44
|
+
| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores (~300 tokens) |
|
|
45
|
+
| `gitnexus://repo/{name}/cluster/{name}` | Area members with file paths (~500 tokens) |
|
|
46
|
+
| `gitnexus://repo/{name}/process/{name}` | Step-by-step execution trace (~200 tokens) |
|
|
47
|
+
|
|
48
|
+
## Tools
|
|
49
|
+
|
|
50
|
+
**gitnexus_query** — find execution flows related to a concept:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
gitnexus_query({query: "payment processing"})
|
|
54
|
+
→ Processes: CheckoutFlow, RefundFlow, WebhookHandler
|
|
55
|
+
→ Symbols grouped by flow with file locations
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**gitnexus_context** — 360-degree view of a symbol:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
gitnexus_context({name: "validateUser"})
|
|
62
|
+
→ Incoming calls: loginHandler, apiMiddleware
|
|
63
|
+
→ Outgoing calls: checkToken, getUserById
|
|
64
|
+
→ Processes: LoginFlow (step 2/5), TokenRefresh (step 1/3)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Example: "How does payment processing work?"
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
1. READ gitnexus://repo/my-app/context → 918 symbols, 45 processes
|
|
71
|
+
2. gitnexus_query({query: "payment processing"})
|
|
72
|
+
→ CheckoutFlow: processPayment → validateCard → chargeStripe
|
|
73
|
+
→ RefundFlow: initiateRefund → calculateRefund → processRefund
|
|
74
|
+
3. gitnexus_context({name: "processPayment"})
|
|
75
|
+
→ Incoming: checkoutHandler, webhookHandler
|
|
76
|
+
→ Outgoing: validateCard, chargeStripe, saveTransaction
|
|
77
|
+
4. Read src/payments/processor.ts for implementation details
|
|
78
|
+
```
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-guide
|
|
3
|
+
description: "Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: \"What GitNexus tools are available?\", \"How do I use GitNexus?\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GitNexus Guide
|
|
7
|
+
|
|
8
|
+
Quick reference for all GitNexus MCP tools, resources, and the knowledge graph schema.
|
|
9
|
+
|
|
10
|
+
## Always Start Here
|
|
11
|
+
|
|
12
|
+
For any task involving code understanding, debugging, impact analysis, or refactoring:
|
|
13
|
+
|
|
14
|
+
1. **Read `gitnexus://repo/{name}/context`** — codebase overview + check index freshness
|
|
15
|
+
2. **Match your task to a skill below** and **read that skill file**
|
|
16
|
+
3. **Follow the skill's workflow and checklist**
|
|
17
|
+
|
|
18
|
+
> If step 1 warns the index is stale, run `npx gitnexus analyze` in the terminal first.
|
|
19
|
+
|
|
20
|
+
## Skills
|
|
21
|
+
|
|
22
|
+
| Task | Skill to read |
|
|
23
|
+
| -------------------------------------------- | ------------------- |
|
|
24
|
+
| Understand architecture / "How does X work?" | `gitnexus-exploring` |
|
|
25
|
+
| Blast radius / "What breaks if I change X?" | `gitnexus-impact-analysis` |
|
|
26
|
+
| Trace bugs / "Why is X failing?" | `gitnexus-debugging` |
|
|
27
|
+
| Rename / extract / split / refactor | `gitnexus-refactoring` |
|
|
28
|
+
| Tools, resources, schema reference | `gitnexus-guide` (this file) |
|
|
29
|
+
| Index, status, clean, wiki CLI commands | `gitnexus-cli` |
|
|
30
|
+
|
|
31
|
+
## Tools Reference
|
|
32
|
+
|
|
33
|
+
| Tool | What it gives you |
|
|
34
|
+
| ---------------- | ------------------------------------------------------------------------ |
|
|
35
|
+
| `query` | Process-grouped code intelligence — execution flows related to a concept |
|
|
36
|
+
| `context` | 360-degree symbol view — categorized refs, processes it participates in |
|
|
37
|
+
| `impact` | Symbol blast radius — what breaks at depth 1/2/3 with confidence |
|
|
38
|
+
| `detect_changes` | Git-diff impact — what do your current changes affect |
|
|
39
|
+
| `rename` | Multi-file coordinated rename with confidence-tagged edits |
|
|
40
|
+
| `cypher` | Raw graph queries (read `gitnexus://repo/{name}/schema` first) |
|
|
41
|
+
| `list_repos` | Discover indexed repos |
|
|
42
|
+
|
|
43
|
+
## Resources Reference
|
|
44
|
+
|
|
45
|
+
Lightweight reads (~100-500 tokens) for navigation:
|
|
46
|
+
|
|
47
|
+
| Resource | Content |
|
|
48
|
+
| ---------------------------------------------- | ----------------------------------------- |
|
|
49
|
+
| `gitnexus://repo/{name}/context` | Stats, staleness check |
|
|
50
|
+
| `gitnexus://repo/{name}/clusters` | All functional areas with cohesion scores |
|
|
51
|
+
| `gitnexus://repo/{name}/cluster/{clusterName}` | Area members |
|
|
52
|
+
| `gitnexus://repo/{name}/processes` | All execution flows |
|
|
53
|
+
| `gitnexus://repo/{name}/process/{processName}` | Step-by-step trace |
|
|
54
|
+
| `gitnexus://repo/{name}/schema` | Graph schema for Cypher |
|
|
55
|
+
|
|
56
|
+
## Graph Schema
|
|
57
|
+
|
|
58
|
+
**Nodes:** File, Function, Class, Interface, Method, Community, Process
|
|
59
|
+
**Edges (via CodeRelation.type):** CALLS, IMPORTS, EXTENDS, IMPLEMENTS, DEFINES, MEMBER_OF, STEP_IN_PROCESS
|
|
60
|
+
|
|
61
|
+
```cypher
|
|
62
|
+
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "myFunc"})
|
|
63
|
+
RETURN caller.name, caller.filePath
|
|
64
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-impact-analysis
|
|
3
|
+
description: "Use when the user wants to know what will break if they change something, or needs safety analysis before editing code. Examples: \"Is it safe to change X?\", \"What depends on this?\", \"What will break?\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Impact Analysis with GitNexus
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- "Is it safe to change this function?"
|
|
11
|
+
- "What will break if I modify X?"
|
|
12
|
+
- "Show me the blast radius"
|
|
13
|
+
- "Who uses this code?"
|
|
14
|
+
- Before making non-trivial code changes
|
|
15
|
+
- Before committing — to understand what your changes affect
|
|
16
|
+
|
|
17
|
+
## Workflow
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
1. gitnexus_impact({target: "X", direction: "upstream"}) → What depends on this
|
|
21
|
+
2. READ gitnexus://repo/{name}/processes → Check affected execution flows
|
|
22
|
+
3. gitnexus_detect_changes() → Map current git changes to affected flows
|
|
23
|
+
4. Assess risk and report to user
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> If "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
27
|
+
|
|
28
|
+
## Checklist
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
- [ ] gitnexus_impact({target, direction: "upstream"}) to find dependents
|
|
32
|
+
- [ ] Review d=1 items first (these WILL BREAK)
|
|
33
|
+
- [ ] Check high-confidence (>0.8) dependencies
|
|
34
|
+
- [ ] READ processes to check affected execution flows
|
|
35
|
+
- [ ] gitnexus_detect_changes() for pre-commit check
|
|
36
|
+
- [ ] Assess risk level and report to user
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Understanding Output
|
|
40
|
+
|
|
41
|
+
| Depth | Risk Level | Meaning |
|
|
42
|
+
| ----- | ---------------- | ------------------------ |
|
|
43
|
+
| d=1 | **WILL BREAK** | Direct callers/importers |
|
|
44
|
+
| d=2 | LIKELY AFFECTED | Indirect dependencies |
|
|
45
|
+
| d=3 | MAY NEED TESTING | Transitive effects |
|
|
46
|
+
|
|
47
|
+
## Risk Assessment
|
|
48
|
+
|
|
49
|
+
| Affected | Risk |
|
|
50
|
+
| ------------------------------ | -------- |
|
|
51
|
+
| <5 symbols, few processes | LOW |
|
|
52
|
+
| 5-15 symbols, 2-5 processes | MEDIUM |
|
|
53
|
+
| >15 symbols or many processes | HIGH |
|
|
54
|
+
| Critical path (auth, payments) | CRITICAL |
|
|
55
|
+
|
|
56
|
+
## Tools
|
|
57
|
+
|
|
58
|
+
**gitnexus_impact** — the primary tool for symbol blast radius:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
gitnexus_impact({
|
|
62
|
+
target: "validateUser",
|
|
63
|
+
direction: "upstream",
|
|
64
|
+
minConfidence: 0.8,
|
|
65
|
+
maxDepth: 3
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
→ d=1 (WILL BREAK):
|
|
69
|
+
- loginHandler (src/auth/login.ts:42) [CALLS, 100%]
|
|
70
|
+
- apiMiddleware (src/api/middleware.ts:15) [CALLS, 100%]
|
|
71
|
+
|
|
72
|
+
→ d=2 (LIKELY AFFECTED):
|
|
73
|
+
- authRouter (src/routes/auth.ts:22) [CALLS, 95%]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**gitnexus_detect_changes** — git-diff based impact analysis:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
gitnexus_detect_changes({scope: "staged"})
|
|
80
|
+
|
|
81
|
+
→ Changed: 5 symbols in 3 files
|
|
82
|
+
→ Affected: LoginFlow, TokenRefresh, APIMiddlewarePipeline
|
|
83
|
+
→ Risk: MEDIUM
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Example: "What breaks if I change validateUser?"
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
1. gitnexus_impact({target: "validateUser", direction: "upstream"})
|
|
90
|
+
→ d=1: loginHandler, apiMiddleware (WILL BREAK)
|
|
91
|
+
→ d=2: authRouter, sessionManager (LIKELY AFFECTED)
|
|
92
|
+
|
|
93
|
+
2. READ gitnexus://repo/my-app/processes
|
|
94
|
+
→ LoginFlow and TokenRefresh touch validateUser
|
|
95
|
+
|
|
96
|
+
3. Risk: 2 direct callers, 2 processes = MEDIUM
|
|
97
|
+
```
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gitnexus-refactoring
|
|
3
|
+
description: "Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: \"Rename this function\", \"Extract this into a module\", \"Refactor this class\", \"Move this to a separate file\""
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Refactoring with GitNexus
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
- "Rename this function safely"
|
|
11
|
+
- "Extract this into a module"
|
|
12
|
+
- "Split this service"
|
|
13
|
+
- "Move this to a new file"
|
|
14
|
+
- Any task involving renaming, extracting, splitting, or restructuring code
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
1. gitnexus_impact({target: "X", direction: "upstream"}) → Map all dependents
|
|
20
|
+
2. gitnexus_query({query: "X"}) → Find execution flows involving X
|
|
21
|
+
3. gitnexus_context({name: "X"}) → See all incoming/outgoing refs
|
|
22
|
+
4. Plan update order: interfaces → implementations → callers → tests
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> If "Index is stale" → run `npx gitnexus analyze` in terminal.
|
|
26
|
+
|
|
27
|
+
## Checklists
|
|
28
|
+
|
|
29
|
+
### Rename Symbol
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
- [ ] gitnexus_rename({symbol_name: "oldName", new_name: "newName", dry_run: true}) — preview all edits
|
|
33
|
+
- [ ] Review graph edits (high confidence) and ast_search edits (review carefully)
|
|
34
|
+
- [ ] If satisfied: gitnexus_rename({..., dry_run: false}) — apply edits
|
|
35
|
+
- [ ] gitnexus_detect_changes() — verify only expected files changed
|
|
36
|
+
- [ ] Run tests for affected processes
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Extract Module
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
- [ ] gitnexus_context({name: target}) — see all incoming/outgoing refs
|
|
43
|
+
- [ ] gitnexus_impact({target, direction: "upstream"}) — find all external callers
|
|
44
|
+
- [ ] Define new module interface
|
|
45
|
+
- [ ] Extract code, update imports
|
|
46
|
+
- [ ] gitnexus_detect_changes() — verify affected scope
|
|
47
|
+
- [ ] Run tests for affected processes
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Split Function/Service
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
- [ ] gitnexus_context({name: target}) — understand all callees
|
|
54
|
+
- [ ] Group callees by responsibility
|
|
55
|
+
- [ ] gitnexus_impact({target, direction: "upstream"}) — map callers to update
|
|
56
|
+
- [ ] Create new functions/services
|
|
57
|
+
- [ ] Update callers
|
|
58
|
+
- [ ] gitnexus_detect_changes() — verify affected scope
|
|
59
|
+
- [ ] Run tests for affected processes
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Tools
|
|
63
|
+
|
|
64
|
+
**gitnexus_rename** — automated multi-file rename:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true})
|
|
68
|
+
→ 12 edits across 8 files
|
|
69
|
+
→ 10 graph edits (high confidence), 2 ast_search edits (review)
|
|
70
|
+
→ Changes: [{file_path, edits: [{line, old_text, new_text, confidence}]}]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**gitnexus_impact** — map all dependents first:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
gitnexus_impact({target: "validateUser", direction: "upstream"})
|
|
77
|
+
→ d=1: loginHandler, apiMiddleware, testUtils
|
|
78
|
+
→ Affected Processes: LoginFlow, TokenRefresh
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**gitnexus_detect_changes** — verify your changes after refactoring:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
gitnexus_detect_changes({scope: "all"})
|
|
85
|
+
→ Changed: 8 files, 12 symbols
|
|
86
|
+
→ Affected processes: LoginFlow, TokenRefresh
|
|
87
|
+
→ Risk: MEDIUM
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**gitnexus_cypher** — custom reference queries:
|
|
91
|
+
|
|
92
|
+
```cypher
|
|
93
|
+
MATCH (caller)-[:CodeRelation {type: 'CALLS'}]->(f:Function {name: "validateUser"})
|
|
94
|
+
RETURN caller.name, caller.filePath ORDER BY caller.filePath
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Risk Rules
|
|
98
|
+
|
|
99
|
+
| Risk Factor | Mitigation |
|
|
100
|
+
| ------------------- | ----------------------------------------- |
|
|
101
|
+
| Many callers (>5) | Use gitnexus_rename for automated updates |
|
|
102
|
+
| Cross-area refs | Use detect_changes after to verify scope |
|
|
103
|
+
| String/dynamic refs | gitnexus_query to find them |
|
|
104
|
+
| External/public API | Version and deprecate properly |
|
|
105
|
+
|
|
106
|
+
## Example: Rename `validateUser` to `authenticateUser`
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
1. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: true})
|
|
110
|
+
→ 12 edits: 10 graph (safe), 2 ast_search (review)
|
|
111
|
+
→ Files: validator.ts, login.ts, middleware.ts, config.json...
|
|
112
|
+
|
|
113
|
+
2. Review ast_search edits (config.json: dynamic reference!)
|
|
114
|
+
|
|
115
|
+
3. gitnexus_rename({symbol_name: "validateUser", new_name: "authenticateUser", dry_run: false})
|
|
116
|
+
→ Applied 12 edits across 8 files
|
|
117
|
+
|
|
118
|
+
4. gitnexus_detect_changes({scope: "all"})
|
|
119
|
+
→ Affected: LoginFlow, TokenRefresh
|
|
120
|
+
→ Risk: MEDIUM — run tests for these flows
|
|
121
|
+
```
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- gitnexus:start -->
|
|
2
|
+
# GitNexus — Code Intelligence
|
|
3
|
+
|
|
4
|
+
This project is indexed by GitNexus as **adtec-front-end-core-package** (2241 symbols, 3020 relationships, 28 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
|
5
|
+
|
|
6
|
+
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
|
|
7
|
+
|
|
8
|
+
## Always Do
|
|
9
|
+
|
|
10
|
+
- **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `gitnexus_impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.
|
|
11
|
+
- **MUST run `gitnexus_detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows.
|
|
12
|
+
- **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
|
|
13
|
+
- When exploring unfamiliar code, use `gitnexus_query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
|
|
14
|
+
- When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `gitnexus_context({name: "symbolName"})`.
|
|
15
|
+
|
|
16
|
+
## Never Do
|
|
17
|
+
|
|
18
|
+
- NEVER edit a function, class, or method without first running `gitnexus_impact` on it.
|
|
19
|
+
- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
|
|
20
|
+
- NEVER rename symbols with find-and-replace — use `gitnexus_rename` which understands the call graph.
|
|
21
|
+
- NEVER commit changes without running `gitnexus_detect_changes()` to check affected scope.
|
|
22
|
+
|
|
23
|
+
## Resources
|
|
24
|
+
|
|
25
|
+
| Resource | Use for |
|
|
26
|
+
|----------|---------|
|
|
27
|
+
| `gitnexus://repo/adtec-front-end-core-package/context` | Codebase overview, check index freshness |
|
|
28
|
+
| `gitnexus://repo/adtec-front-end-core-package/clusters` | All functional areas |
|
|
29
|
+
| `gitnexus://repo/adtec-front-end-core-package/processes` | All execution flows |
|
|
30
|
+
| `gitnexus://repo/adtec-front-end-core-package/process/{name}` | Step-by-step execution trace |
|
|
31
|
+
|
|
32
|
+
## CLI
|
|
33
|
+
|
|
34
|
+
| Task | Read this skill file |
|
|
35
|
+
|------|---------------------|
|
|
36
|
+
| Understand architecture / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |
|
|
37
|
+
| Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |
|
|
38
|
+
| Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |
|
|
39
|
+
| Rename / extract / split / refactor | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |
|
|
40
|
+
| Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
|
|
41
|
+
| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
|
|
42
|
+
|
|
43
|
+
<!-- gitnexus:end -->
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<!-- gitnexus:start -->
|
|
2
|
+
# GitNexus — Code Intelligence
|
|
3
|
+
|
|
4
|
+
This project is indexed by GitNexus as **adtec-front-end-core-package** (2241 symbols, 3020 relationships, 28 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely.
|
|
5
|
+
|
|
6
|
+
> If any GitNexus tool warns the index is stale, run `npx gitnexus analyze` in terminal first.
|
|
7
|
+
|
|
8
|
+
## Always Do
|
|
9
|
+
|
|
10
|
+
- **MUST run impact analysis before editing any symbol.** Before modifying a function, class, or method, run `gitnexus_impact({target: "symbolName", direction: "upstream"})` and report the blast radius (direct callers, affected processes, risk level) to the user.
|
|
11
|
+
- **MUST run `gitnexus_detect_changes()` before committing** to verify your changes only affect expected symbols and execution flows.
|
|
12
|
+
- **MUST warn the user** if impact analysis returns HIGH or CRITICAL risk before proceeding with edits.
|
|
13
|
+
- When exploring unfamiliar code, use `gitnexus_query({query: "concept"})` to find execution flows instead of grepping. It returns process-grouped results ranked by relevance.
|
|
14
|
+
- When you need full context on a specific symbol — callers, callees, which execution flows it participates in — use `gitnexus_context({name: "symbolName"})`.
|
|
15
|
+
|
|
16
|
+
## Never Do
|
|
17
|
+
|
|
18
|
+
- NEVER edit a function, class, or method without first running `gitnexus_impact` on it.
|
|
19
|
+
- NEVER ignore HIGH or CRITICAL risk warnings from impact analysis.
|
|
20
|
+
- NEVER rename symbols with find-and-replace — use `gitnexus_rename` which understands the call graph.
|
|
21
|
+
- NEVER commit changes without running `gitnexus_detect_changes()` to check affected scope.
|
|
22
|
+
|
|
23
|
+
## Resources
|
|
24
|
+
|
|
25
|
+
| Resource | Use for |
|
|
26
|
+
|----------|---------|
|
|
27
|
+
| `gitnexus://repo/adtec-front-end-core-package/context` | Codebase overview, check index freshness |
|
|
28
|
+
| `gitnexus://repo/adtec-front-end-core-package/clusters` | All functional areas |
|
|
29
|
+
| `gitnexus://repo/adtec-front-end-core-package/processes` | All execution flows |
|
|
30
|
+
| `gitnexus://repo/adtec-front-end-core-package/process/{name}` | Step-by-step execution trace |
|
|
31
|
+
|
|
32
|
+
## CLI
|
|
33
|
+
|
|
34
|
+
| Task | Read this skill file |
|
|
35
|
+
|------|---------------------|
|
|
36
|
+
| Understand architecture / "How does X work?" | `.claude/skills/gitnexus/gitnexus-exploring/SKILL.md` |
|
|
37
|
+
| Blast radius / "What breaks if I change X?" | `.claude/skills/gitnexus/gitnexus-impact-analysis/SKILL.md` |
|
|
38
|
+
| Trace bugs / "Why is X failing?" | `.claude/skills/gitnexus/gitnexus-debugging/SKILL.md` |
|
|
39
|
+
| Rename / extract / split / refactor | `.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md` |
|
|
40
|
+
| Tools, resources, schema reference | `.claude/skills/gitnexus/gitnexus-guide/SKILL.md` |
|
|
41
|
+
| Index, status, clean, wiki CLI commands | `.claude/skills/gitnexus/gitnexus-cli/SKILL.md` |
|
|
42
|
+
|
|
43
|
+
<!-- gitnexus:end -->
|
package/package.json
CHANGED
|
@@ -17,7 +17,10 @@ export default {
|
|
|
17
17
|
addOrEditComment(tpReviewBatch: ITpReviewBatch) {
|
|
18
18
|
return request.post<ITpReviewBatch>('/api/tm/tpApplyCheck/updateBatchInfo', tpReviewBatch)
|
|
19
19
|
},
|
|
20
|
-
getBatchInfo(tpApplyId: string) {
|
|
21
|
-
return request.get<ITpReviewBatch>('/api/tm/tpApplyCheck/getBatchInfo', { tpApplyId })
|
|
20
|
+
getBatchInfo(tpApplyId: string, batchPrefer: 'max' | 'min' = 'max') {
|
|
21
|
+
return request.get<ITpReviewBatch>('/api/tm/tpApplyCheck/getBatchInfo', { tpApplyId, batchPrefer })
|
|
22
|
+
},
|
|
23
|
+
getBatchInfoByTaskId(taskId: string) {
|
|
24
|
+
return request.get<ITpReviewBatch>('/api/tm/tpApplyCheck/getBatchInfoByTaskId', { taskId })
|
|
22
25
|
},
|
|
23
26
|
}
|
|
@@ -10,12 +10,14 @@ import Node from './Node.vue'
|
|
|
10
10
|
const props = defineProps<{
|
|
11
11
|
node: JumpNode
|
|
12
12
|
}>()
|
|
13
|
-
const { nodesError, getTaskNodes } = inject<{
|
|
13
|
+
const { nodesError, getTaskNodes, getNodeById } = inject<{
|
|
14
14
|
nodesError: Ref<Recordable<ErrorInfo[]>>
|
|
15
15
|
getTaskNodes: (arg: string) => FlowNode[]
|
|
16
|
+
getNodeById: (id: string) => FlowNode | undefined
|
|
16
17
|
}>('flowDesign', {
|
|
17
18
|
nodesError: ref({}),
|
|
18
19
|
getTaskNodes: (arg: string) => [],
|
|
20
|
+
getNodeById: () => undefined,
|
|
19
21
|
})
|
|
20
22
|
const content = ref<string>('')
|
|
21
23
|
watchEffect(() => {
|
|
@@ -24,10 +26,20 @@ watchEffect(() => {
|
|
|
24
26
|
content.value = '未指定跳转节点'
|
|
25
27
|
if (!targetNode) {
|
|
26
28
|
errors.push({ id: id, name: name, message: '未配置跳转节点' })
|
|
29
|
+
} else if (targetNode === 'end') {
|
|
30
|
+
// 结束节点仅在主链路末端定义,分支 jump 固定指向 id=end
|
|
31
|
+
content.value = '跳转至:流程结束'
|
|
27
32
|
} else {
|
|
28
|
-
|
|
29
|
-
if (
|
|
30
|
-
content.value = '跳转至:' +
|
|
33
|
+
const taskNodes = getTaskNodes('').filter((x) => x.id === targetNode)
|
|
34
|
+
if (taskNodes.length > 0) {
|
|
35
|
+
content.value = '跳转至:' + taskNodes[0].name
|
|
36
|
+
} else {
|
|
37
|
+
const endNode = getNodeById(targetNode)
|
|
38
|
+
if (endNode?.type === 'end') {
|
|
39
|
+
content.value = '跳转至:' + (endNode.name || '流程结束')
|
|
40
|
+
} else {
|
|
41
|
+
errors.push({ id: id, name: name, message: '跳转目标节点不存在' })
|
|
42
|
+
}
|
|
31
43
|
}
|
|
32
44
|
}
|
|
33
45
|
// 记录错误
|
|
@@ -10,7 +10,7 @@ const { getTaskNodes } = inject<{
|
|
|
10
10
|
getTaskNodes: (arg: string) => FlowNode[]
|
|
11
11
|
}>('flowDesign', {
|
|
12
12
|
readOnly: ref(false),
|
|
13
|
-
getTaskNodes: (arg: string) => []
|
|
13
|
+
getTaskNodes: (arg: string) => [],
|
|
14
14
|
})
|
|
15
15
|
</script>
|
|
16
16
|
|
|
@@ -18,6 +18,7 @@ const { getTaskNodes } = inject<{
|
|
|
18
18
|
<el-form label-position="top" label-width="90px">
|
|
19
19
|
<el-form-item prop="types" label="跳转节点">
|
|
20
20
|
<el-select v-model="activeData.targetNode">
|
|
21
|
+
<el-option label="流程结束" value="end" />
|
|
21
22
|
<el-option
|
|
22
23
|
v-for="item in getTaskNodes(activeData.id)"
|
|
23
24
|
:key="item.id"
|
|
@@ -115,27 +115,31 @@ const title = useVModel(props, 'title', emit)
|
|
|
115
115
|
const fileId = useVModel(props, 'fileId', emit)
|
|
116
116
|
const url = useVModel(props, 'url', emit)
|
|
117
117
|
const edit = useVModel(props, 'edit', emit)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return '
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
return '
|
|
118
|
+
|
|
119
|
+
const resolveFileExt = (type?: string, name?: string, fileUrl?: string) => {
|
|
120
|
+
const normalizedType = (type || '').toLowerCase().replace(/^\./, '')
|
|
121
|
+
if (normalizedType) {
|
|
122
|
+
return normalizedType === 'doc' ? 'docx' : normalizedType
|
|
123
|
+
}
|
|
124
|
+
const fromName = (name || '').match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase()
|
|
125
|
+
if (fromName) {
|
|
126
|
+
return fromName === 'doc' ? 'docx' : fromName
|
|
127
127
|
}
|
|
128
|
+
const urlStr = (fileUrl || '').toLowerCase()
|
|
129
|
+
if (urlStr.includes('.docx') || urlStr.includes('.doc')) return 'docx'
|
|
130
|
+
if (urlStr.includes('.pdf')) return 'pdf'
|
|
131
|
+
if (urlStr.includes('.xlsx') || urlStr.includes('.xls')) return 'xlsx'
|
|
132
|
+
if (urlStr.includes('.pptx') || urlStr.includes('.ppt')) return 'pptx'
|
|
133
|
+
return ''
|
|
128
134
|
}
|
|
135
|
+
|
|
136
|
+
const getFileType = () => resolveFileExt(undefined, title.value, url.value)
|
|
129
137
|
const getDocumentType = () => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return 'cell'
|
|
136
|
-
} else if ((url.value + '').indexOf('.pptx') !== -1 || (url.value + '').indexOf('.pptx') !== -1) {
|
|
137
|
-
return 'slide'
|
|
138
|
-
}
|
|
138
|
+
const ext = getFileType()
|
|
139
|
+
if (ext === 'docx' || ext === 'doc') return 'word'
|
|
140
|
+
if (ext === 'pdf') return 'pdf'
|
|
141
|
+
if (ext === 'xlsx' || ext === 'xls') return 'cell'
|
|
142
|
+
if (ext === 'pptx' || ext === 'ppt') return 'slide'
|
|
139
143
|
}
|
|
140
144
|
const download= async ()=>{
|
|
141
145
|
try{
|
|
@@ -54,6 +54,7 @@ import { ElMessage } from 'element-plus'
|
|
|
54
54
|
import { userInfoStore } from '../../../stores/userInfoStore'
|
|
55
55
|
import type { ISysUserInfo } from '../../../interface/ISysUserInfo'
|
|
56
56
|
import frameworkUtils from '../../../utils/FrameworkUtils.ts'
|
|
57
|
+
const emit = defineEmits<{ success: [] }>()
|
|
57
58
|
const userInfo = userInfoStore()
|
|
58
59
|
const data = ref<IWfTaskUsersVo>({
|
|
59
60
|
assignee: [],
|
|
@@ -81,6 +82,11 @@ const open = async (taskId: string, type: string) => {
|
|
|
81
82
|
data.value = { ...(await workflowInstApi.getTaskCandidate(taskId)), assignee: [] }
|
|
82
83
|
//设置当前的审批人
|
|
83
84
|
defaultAssignee.value = data.value.candidate?.map((e:ISysUserInfo) => e.id!) || []
|
|
85
|
+
if (type === 'minusMulti' && defaultAssignee.value.length <= 1) {
|
|
86
|
+
ElMessage.warning('至少需保留一名审核人,当前仅剩一名审核人,无法减签')
|
|
87
|
+
dialogVisible.value = false
|
|
88
|
+
return
|
|
89
|
+
}
|
|
84
90
|
data.value.assignee = [...defaultAssignee.value]
|
|
85
91
|
} catch (err: any) {
|
|
86
92
|
frameworkUtils.messageError(err)
|
|
@@ -122,18 +128,26 @@ const disableFunc = (val: string) => {
|
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
130
|
const save = async () => {
|
|
125
|
-
if (data.value.candidate?.length == 0
|
|
131
|
+
if (data.value.candidate?.length == 0) {
|
|
126
132
|
ElMessage.warning('请指定执行人!')
|
|
127
133
|
return
|
|
128
134
|
}
|
|
129
135
|
//加签逻辑判断
|
|
130
136
|
if (dialogType.value === 'addMulti') {
|
|
137
|
+
if (data.value.assignee.length == 0) {
|
|
138
|
+
ElMessage.warning('请指定执行人!')
|
|
139
|
+
return
|
|
140
|
+
}
|
|
131
141
|
if (data.value.assignee.length <= defaultAssignee.value.length) {
|
|
132
142
|
ElMessage.warning('加签必须选择非原审批人!')
|
|
133
143
|
return
|
|
134
144
|
}
|
|
135
145
|
} else if (dialogType.value === 'minusMulti') {
|
|
136
|
-
|
|
146
|
+
//减签逻辑判断:至少保留一名审核人
|
|
147
|
+
if (data.value.assignee.length < 1) {
|
|
148
|
+
ElMessage.warning('至少需保留一名审核人')
|
|
149
|
+
return
|
|
150
|
+
}
|
|
137
151
|
if (data.value.assignee.length >= defaultAssignee.value.length) {
|
|
138
152
|
ElMessage.warning('减签必须取消选中原审批人!')
|
|
139
153
|
return
|
|
@@ -145,6 +159,7 @@ const save = async () => {
|
|
|
145
159
|
await workflowInstApi.addOrMinusAssignee(data.value)
|
|
146
160
|
ElMessage.success('操作成功')
|
|
147
161
|
dialogVisible.value = false
|
|
162
|
+
emit('success')
|
|
148
163
|
} catch (err: any) {
|
|
149
164
|
frameworkUtils.messageError(err)
|
|
150
165
|
} finally {
|
|
@@ -201,6 +201,9 @@ const open = async (
|
|
|
201
201
|
//转办
|
|
202
202
|
dialogLabel.value = '转办原因'
|
|
203
203
|
dialogTitle.value = '转办审批'
|
|
204
|
+
// 每次打开转办弹窗清空原因与转办人,避免复用 taskVo 上次的审批/转办意见
|
|
205
|
+
task.value.comment = ''
|
|
206
|
+
transferUser.value = { id: '', userName: '' }
|
|
204
207
|
}
|
|
205
208
|
loading.value = false
|
|
206
209
|
}
|
|
@@ -220,13 +220,28 @@ const getStatus = (task: IWfTaskVo) => {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
const compParam = ref()
|
|
223
|
+
const resolveReviewBatch = async (task: IWfTaskVo) => {
|
|
224
|
+
if (task.taskId) {
|
|
225
|
+
const byTask = await workflowcommentApi.getBatchInfoByTaskId(task.taskId)
|
|
226
|
+
if (byTask?.revMeetingId) {
|
|
227
|
+
return byTask
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const batchPrefer = task.taskName === '专家会审(答辩)' ? 'max' : 'min'
|
|
231
|
+
return workflowcommentApi.getBatchInfo(task.businessId ?? '', batchPrefer)
|
|
232
|
+
}
|
|
223
233
|
const viewDetail = async (task: IWfTaskVo) => {
|
|
224
234
|
if (task.taskName === '专家评审' || task.taskName === '专家会审(答辩)') {
|
|
225
|
-
|
|
226
|
-
|
|
235
|
+
const batchInfo = await resolveReviewBatch(task)
|
|
236
|
+
if (!batchInfo?.revMeetingId) {
|
|
237
|
+
ElMessage.warning('暂无评审详情')
|
|
238
|
+
return
|
|
239
|
+
}
|
|
227
240
|
const taskInfo = {
|
|
228
241
|
businessId: batchInfo.revMeetingId + '_' + (task.businessId ?? ''),
|
|
229
242
|
nodeTag: 'TECPM:/src/views/meetingHost/componets/comp.viewResult.vue',
|
|
243
|
+
nodeParam: batchInfo.reviewType ?? '10',
|
|
244
|
+
taskName: task.taskName,
|
|
230
245
|
}
|
|
231
246
|
await showTodoDialog(ref(taskInfo as IWfTaskVo), compParam)
|
|
232
247
|
} else {
|
|
@@ -94,65 +94,94 @@ const blurEvent = (event: FocusEvent) => {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
const findSearchButton = (root: ParentNode, routeCode?: string | null): HTMLElement | null => {
|
|
98
|
+
const buttons = root.querySelectorAll('button')
|
|
99
|
+
if (routeCode) {
|
|
100
|
+
const expected = `${routeCode}_search`
|
|
101
|
+
for (const el of buttons) {
|
|
102
|
+
if (el instanceof HTMLElement && el.classList.contains(expected)) {
|
|
103
|
+
return el
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
for (const el of buttons) {
|
|
108
|
+
if (!(el instanceof HTMLElement)) continue
|
|
109
|
+
for (const cls of el.classList) {
|
|
110
|
+
if (cls.endsWith('_search')) return el
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return null
|
|
114
|
+
}
|
|
115
|
+
|
|
97
116
|
const keyUpEvent = (event: KeyboardEvent) => {
|
|
98
|
-
if (event.key
|
|
99
|
-
|
|
100
|
-
|
|
117
|
+
if (event.key !== 'Enter') {
|
|
118
|
+
return
|
|
119
|
+
}
|
|
101
120
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
const applicationModule = moduleName.value || sessionStorage.getItem('applicationModule')
|
|
122
|
+
const docTemp = event.currentTarget as any
|
|
123
|
+
const doc =
|
|
124
|
+
applicationModule === 'system'
|
|
105
125
|
? (docTemp as Document)
|
|
106
|
-
: (docTemp &&
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
: (docTemp &&
|
|
127
|
+
docTemp[applicationModule ?? 'default'] &&
|
|
128
|
+
docTemp[applicationModule ?? 'default'].document) ||
|
|
129
|
+
undefined
|
|
130
|
+
|
|
131
|
+
if (!doc) return
|
|
132
|
+
|
|
133
|
+
const isElementVisible = (el: HTMLElement | null): boolean => {
|
|
134
|
+
if (!el) return false
|
|
135
|
+
if (el.style.display === 'none' || getComputedStyle(el).display === 'none') return false
|
|
136
|
+
if (el.style.visibility === 'hidden' || getComputedStyle(el).visibility === 'hidden') {
|
|
137
|
+
return false
|
|
138
|
+
}
|
|
139
|
+
let parent = el.parentElement
|
|
140
|
+
while (parent) {
|
|
141
|
+
if (parent.style.display === 'none' || getComputedStyle(parent).display === 'none') {
|
|
142
|
+
return false
|
|
122
143
|
}
|
|
123
|
-
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
// 1. 优先查找登录按钮(可见时才点击)
|
|
127
|
-
const loginButton = doc.body.querySelector('.login_button') as HTMLElement;
|
|
128
|
-
if (loginButton && isElementVisible(loginButton)) {
|
|
129
|
-
event.stopPropagation();
|
|
130
|
-
event.preventDefault(); // 新增:阻止表单默认提交(避免页面刷新)
|
|
131
|
-
loginButton.click();
|
|
132
|
-
return;
|
|
144
|
+
parent = parent.parentElement
|
|
133
145
|
}
|
|
146
|
+
return true
|
|
147
|
+
}
|
|
134
148
|
|
|
135
|
-
|
|
136
|
-
const hasDrawer = doc.body.className === 'el-popup-parent--hidden' || doc.body.querySelector('.el-drawer .open');
|
|
137
|
-
let target: HTMLElement | null = null;
|
|
138
|
-
const routeCode = sessionStorage.getItem('activationRouteCode') as string;
|
|
149
|
+
const routeCode = sessionStorage.getItem('activationRouteCode')
|
|
139
150
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// 页面内的搜索按钮(需可见)
|
|
148
|
-
target = doc.body.querySelector(`.${routeCode}_search`) as HTMLElement;
|
|
151
|
+
const findDrawerSearchButton = (): HTMLElement | null => {
|
|
152
|
+
const drawerBodies = [...doc.body.querySelectorAll('.el-drawer__body')]
|
|
153
|
+
for (let i = drawerBodies.length - 1; i >= 0; i--) {
|
|
154
|
+
const drawer = drawerBodies[i] as HTMLElement
|
|
155
|
+
if (!isElementVisible(drawer)) continue
|
|
156
|
+
const btn = findSearchButton(drawer, routeCode)
|
|
157
|
+
if (btn && isElementVisible(btn)) return btn
|
|
149
158
|
}
|
|
159
|
+
return null
|
|
160
|
+
}
|
|
150
161
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
162
|
+
const loginButton = doc.body.querySelector('.login_button') as HTMLElement
|
|
163
|
+
if (loginButton && isElementVisible(loginButton)) {
|
|
164
|
+
event.preventDefault()
|
|
165
|
+
event.stopPropagation()
|
|
166
|
+
loginButton.click()
|
|
167
|
+
return
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const hasDrawer =
|
|
171
|
+
doc.body.classList.contains('el-popup-parent--hidden') ||
|
|
172
|
+
!!doc.body.querySelector('.el-drawer__body')
|
|
173
|
+
|
|
174
|
+
let target: HTMLElement | null = null
|
|
175
|
+
|
|
176
|
+
if (hasDrawer) {
|
|
177
|
+
target = findDrawerSearchButton()
|
|
178
|
+
} else if (routeCode) {
|
|
179
|
+
target = findSearchButton(doc.body, routeCode)
|
|
157
180
|
}
|
|
158
|
-
|
|
181
|
+
|
|
182
|
+
if (target && isElementVisible(target)) {
|
|
183
|
+
event.preventDefault()
|
|
184
|
+
event.stopPropagation()
|
|
185
|
+
target.click()
|
|
186
|
+
}
|
|
187
|
+
}
|