@qilitt-mickey/vue3-temp-skill 1.0.12 → 1.1.2

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 (42) hide show
  1. package/README.md +66 -214
  2. package/SKILL.md +165 -527
  3. package/package.json +2 -2
  4. package/references/api-check.md +187 -128
  5. package/references/base-code-dict.md +49 -48
  6. package/references/chart-echarts.md +61 -0
  7. package/references/code-quality.md +44 -15
  8. package/references/core-kernel.md +305 -0
  9. package/references/crud-pages.md +87 -261
  10. package/references/data-compare.md +502 -501
  11. package/references/data-mapping.md +218 -213
  12. package/references/data-screen.md +94 -79
  13. package/references/data-writeback.md +104 -104
  14. package/references/detail-page.md +100 -99
  15. package/references/directives-advanced.md +27 -4
  16. package/references/download-export.md +70 -68
  17. package/references/feedback-loading.md +62 -60
  18. package/references/feedback-ui.md +125 -111
  19. package/references/file-management.md +28 -7
  20. package/references/flowchart-g6.md +249 -244
  21. package/references/form-advanced.md +264 -26
  22. package/references/graph-relation.md +12 -7
  23. package/references/http-api.md +138 -103
  24. package/references/icons.md +326 -0
  25. package/references/layout-theme.md +1 -1
  26. package/references/mobile-h5.md +20 -0
  27. package/references/particles.md +143 -0
  28. package/references/permission-auth.md +8 -31
  29. package/references/project-inventory.md +175 -120
  30. package/references/qrcode-barcode.md +107 -92
  31. package/references/rich-text.md +85 -73
  32. package/references/seamless-scroll.md +40 -38
  33. package/references/table-vxe.md +114 -0
  34. package/references/tree-table.md +2 -1
  35. package/references/ui-components.md +5 -1
  36. package/references/verify-captcha.md +110 -96
  37. package/references/websocket-realtime.md +2 -1
  38. package/references/wechat-js.md +58 -0
  39. package/references/workflow-bpmn.md +207 -206
  40. package/references/advanced-ui.md +0 -302
  41. package/references/build-optim.md +0 -282
  42. package/references/vue-core.md +0 -209
@@ -1,206 +1,207 @@
1
- # BPMN 工作流查看器
2
-
3
- ## 依赖
4
-
5
- `bpmn-js/lib/Viewer` — BPMN 流程图的只读查看器(不含建模器)。
6
-
7
- ## 类型定义
8
-
9
- ```typescript
10
- // src/views/workflow/types/bpmn.ts
11
-
12
- export type BpmnElementType =
13
- | 'bpmn:StartEvent' | 'bpmn:EndEvent'
14
- | 'bpmn:UserTask' | 'bpmn:ServiceTask'
15
- | 'bpmn:ExclusiveGateway' | 'bpmn:SequenceFlow' | 'bpmn:Process'
16
-
17
- export interface BpmnElement {
18
- id: string
19
- type: string | BpmnElementType
20
- name?: string
21
- businessObject?: any
22
- }
23
-
24
- export interface ProcessInfo {
25
- finishedTasks?: string[]
26
- finishedTaskSet?: Set<string>
27
- activeTasks?: string[]
28
- activeTaskSet?: Set<string>
29
- unfinishedTasks?: string[]
30
- unfinishedTaskSet?: Set<string>
31
- finishedSequenceFlows?: string[]
32
- finishedSequenceFlowSet?: Set<string>
33
- }
34
-
35
- export interface BpmnWorkflowData {
36
- xml: string
37
- processInfo?: ProcessInfo
38
- }
39
-
40
- export interface WorkflowViewerProps {
41
- xml?: string
42
- processInfo?: ProcessInfo
43
- height?: string | number
44
- showToolbar?: boolean
45
- allowExport?: boolean
46
- }
47
- ```
48
-
49
- ## 组件结构
50
-
51
- ```vue
52
- <!-- src/views/workflow/components/WorkflowViewer.vue -->
53
- <script setup lang="ts">
54
- import Viewer from 'bpmn-js/lib/Viewer'
55
- import type { BpmnWorkflowData, ProcessInfo } from '../types/bpmn'
56
-
57
- defineOptions({ name: 'WorkflowViewer' })
58
-
59
- const props = withDefaults(defineProps<WorkflowViewerProps>(), {
60
- height: '500px',
61
- showToolbar: true,
62
- allowExport: false,
63
- })
64
-
65
- const containerRef = ref<HTMLElement>()
66
- let viewer: Viewer | null = null
67
-
68
- // 初始化查看器
69
- const initViewer = async () => {
70
- if (!containerRef.value) return
71
- viewer = new Viewer({ container: containerRef.value })
72
- }
73
-
74
- // 导入 BPMN XML
75
- const importXml = async (xml: string) => {
76
- if (!viewer) return
77
- try {
78
- await viewer.importXML(xml)
79
- // 缩放适配
80
- const canvas = viewer.get('canvas') as any
81
- canvas.zoom('fit-viewport')
82
- } catch (err) {
83
- console.error('BPMN XML 导入失败', err)
84
- }
85
- }
86
-
87
- // 高亮已完成/活动节点
88
- const highlightProcess = (processInfo: ProcessInfo) => {
89
- if (!viewer) return
90
- const canvas = viewer.get('canvas') as any
91
- const elementRegistry = viewer.get('elementRegistry') as any
92
-
93
- // 高亮已完成任务
94
- processInfo.finishedTaskSet?.forEach((id: string) => {
95
- const element = elementRegistry.get(id)
96
- if (element) canvas.addMarker(id, 'bpmn-finished')
97
- })
98
-
99
- // 高亮当前活动任务
100
- processInfo.activeTaskSet?.forEach((id: string) => {
101
- const element = elementRegistry.get(id)
102
- if (element) canvas.addMarker(id, 'bpmn-active')
103
- })
104
-
105
- // 高亮已完成序列流
106
- processInfo.finishedSequenceFlowSet?.forEach((id: string) => {
107
- const element = elementRegistry.get(id)
108
- if (element) canvas.addMarker(id, 'bpmn-flow-finished')
109
- })
110
- }
111
-
112
- // 导出 SVG
113
- const exportSvg = async () => {
114
- if (!viewer) return null
115
- const svgResult = await viewer.saveSVG()
116
- return svgResult.svg
117
- }
118
-
119
- onMounted(async () => {
120
- await initViewer()
121
- if (props.xml) await importXml(props.xml)
122
- if (props.processInfo) highlightProcess(props.processInfo)
123
- })
124
-
125
- onBeforeUnmount(() => {
126
- viewer?.destroy()
127
- viewer = null
128
- })
129
- </script>
130
-
131
- <template>
132
- <div class="workflow-viewer">
133
- <div v-if="showToolbar" class="viewer-toolbar">
134
- <el-button size="small" @click="handleZoomIn">放大</el-button>
135
- <el-button size="small" @click="handleZoomOut">缩小</el-button>
136
- <el-button size="small" @click="handleFitView">适配</el-button>
137
- <el-button v-if="allowExport" size="small" @click="handleExportSvg">导出 SVG</el-button>
138
- </div>
139
- <div ref="containerRef" :style="{ height: typeof height === 'number' ? height + 'px' : height }" />
140
- </div>
141
- </template>
142
-
143
- <style>
144
- /* BPMN 高亮样式(全局,不加 scoped) */
145
- :deep(.bpmn-active) .djs-visual > :nth-child(1) {
146
- fill: #409eff !important;
147
- stroke: #409eff !important;
148
- }
149
- :deep(.bpmn-finished) .djs-visual > :nth-child(1) {
150
- fill: #67c23a !important;
151
- stroke: #67c23a !important;
152
- }
153
- :deep(.bpmn-flow-finished) .djs-visual > :nth-child(1) {
154
- stroke: #67c23a !important;
155
- }
156
- </style>
157
- ```
158
-
159
- ## 页面调用
160
-
161
- ```vue
162
- <!-- src/views/workflow/bpmn/index.vue -->
163
- <script setup lang="ts">
164
- import { ReDialog } from '@/components/ReDialog'
165
- import WorkflowViewer from '../components/WorkflowViewer.vue'
166
-
167
- defineOptions({ name: 'WorkflowBpmn' })
168
- const showDialog = ref(false)
169
- </script>
170
-
171
- <template>
172
- <el-button type="primary" size="large" @click="showDialog = true">查看流程图</el-button>
173
- <ReDialog v-model="showDialog" title="BPMN流程图查看器">
174
- <WorkflowViewer />
175
- <template #footer>
176
- <el-button @click="showDialog = false">关闭</el-button>
177
- </template>
178
- </ReDialog>
179
- </template>
180
- ```
181
-
182
- ## 数据获取
183
-
184
- ```typescript
185
- // API 返回格式
186
- interface WorkflowApiResponse {
187
- data: BpmnWorkflowData // { xml: string, processInfo?: ProcessInfo }
188
- code?: number
189
- message?: string
190
- }
191
- ```
192
-
193
- ## 关键约定
194
-
195
- 1. 使用 `bpmn-js/lib/Viewer`(只读),不使用 `Modeler`(可编辑)除非有流程设计需求。
196
- 2. 组件销毁时必须调用 `viewer.destroy()` 释放资源。
197
- 3. 高亮通过 `canvas.addMarker(id, className)` 实现,CSS 使用 `:deep()` 穿透 BPMN 内部 SVG。
198
- 4. 流程数据(已完成/活动任务)由后端接口统一返回,前端只负责渲染。
199
- 5. 弹窗内使用时注意容器高度,BPMN 需要明确的宽高才能正确渲染。
200
- 6. `canvas.zoom('fit-viewport')` 自动缩放适配视口。
201
-
202
- ## 关联文件
203
-
204
- - [src/views/workflow/bpmn/index.vue](file:///e:/work/vue3-web-temp/src/views/workflow/bpmn/index.vue)
205
- - [src/views/workflow/components/WorkflowViewer.vue](file:///e:/work/vue3-web-temp/src/views/workflow/components/WorkflowViewer.vue)
206
- - [src/views/workflow/types/bpmn.ts](file:///e:/work/vue3-web-temp/src/views/workflow/types/bpmn.ts)
1
+ # BPMN 工作流查看器
2
+
3
+ > 按本文件示例编写;必须使用选型表中的 `bpmn-js` Viewer(见 project-inventory),勿改用同类其他流程引擎;新依赖须待确认。
4
+
5
+ ## 依赖(缺则先装)
6
+
7
+ | 包 | 版本 | 说明 |
8
+ |---|---|---|
9
+ | `bpmn-js` | `18.19.0` | 仅用 `bpmn-js/lib/Viewer`(只读),不用 Modeler |
10
+
11
+ ```bash
12
+ pnpm add bpmn-js@18.19.0
13
+ ```
14
+
15
+ ## 类型定义
16
+
17
+ ```typescript
18
+
19
+ export type BpmnElementType =
20
+ | 'bpmn:StartEvent' | 'bpmn:EndEvent'
21
+ | 'bpmn:UserTask' | 'bpmn:ServiceTask'
22
+ | 'bpmn:ExclusiveGateway' | 'bpmn:SequenceFlow' | 'bpmn:Process'
23
+
24
+ export interface BpmnElement {
25
+ id: string
26
+ type: string | BpmnElementType
27
+ name?: string
28
+ businessObject?: any
29
+ }
30
+
31
+ export interface ProcessInfo {
32
+ finishedTasks?: string[]
33
+ finishedTaskSet?: Set<string>
34
+ activeTasks?: string[]
35
+ activeTaskSet?: Set<string>
36
+ unfinishedTasks?: string[]
37
+ unfinishedTaskSet?: Set<string>
38
+ finishedSequenceFlows?: string[]
39
+ finishedSequenceFlowSet?: Set<string>
40
+ }
41
+
42
+ export interface BpmnWorkflowData {
43
+ xml: string
44
+ processInfo?: ProcessInfo
45
+ }
46
+
47
+ export interface WorkflowViewerProps {
48
+ xml?: string
49
+ processInfo?: ProcessInfo
50
+ height?: string | number
51
+ showToolbar?: boolean
52
+ allowExport?: boolean
53
+ }
54
+ ```
55
+
56
+ ## 组件结构
57
+
58
+ ```vue
59
+ <!-- WorkflowViewer.vue -->
60
+ <script setup lang="ts">
61
+ import Viewer from 'bpmn-js/lib/Viewer'
62
+ import type { BpmnWorkflowData, ProcessInfo } from '../types/bpmn'
63
+
64
+ defineOptions({ name: 'WorkflowViewer' })
65
+
66
+ const props = withDefaults(defineProps<WorkflowViewerProps>(), {
67
+ height: '500px',
68
+ showToolbar: true,
69
+ allowExport: false,
70
+ })
71
+
72
+ const containerRef = ref<HTMLElement>()
73
+ let viewer: Viewer | null = null
74
+
75
+ // 初始化查看器
76
+ const initViewer = async () => {
77
+ if (!containerRef.value) return
78
+ viewer = new Viewer({ container: containerRef.value })
79
+ }
80
+
81
+ // 导入 BPMN XML
82
+ const importXml = async (xml: string) => {
83
+ if (!viewer) return
84
+ try {
85
+ await viewer.importXML(xml)
86
+ // 缩放适配
87
+ const canvas = viewer.get('canvas') as any
88
+ canvas.zoom('fit-viewport')
89
+ } catch (err) {
90
+ console.error('BPMN XML 导入失败', err)
91
+ }
92
+ }
93
+
94
+ // 高亮已完成/活动节点
95
+ const highlightProcess = (processInfo: ProcessInfo) => {
96
+ if (!viewer) return
97
+ const canvas = viewer.get('canvas') as any
98
+ const elementRegistry = viewer.get('elementRegistry') as any
99
+
100
+ // 高亮已完成任务
101
+ processInfo.finishedTaskSet?.forEach((id: string) => {
102
+ const element = elementRegistry.get(id)
103
+ if (element) canvas.addMarker(id, 'bpmn-finished')
104
+ })
105
+
106
+ // 高亮当前活动任务
107
+ processInfo.activeTaskSet?.forEach((id: string) => {
108
+ const element = elementRegistry.get(id)
109
+ if (element) canvas.addMarker(id, 'bpmn-active')
110
+ })
111
+
112
+ // 高亮已完成序列流
113
+ processInfo.finishedSequenceFlowSet?.forEach((id: string) => {
114
+ const element = elementRegistry.get(id)
115
+ if (element) canvas.addMarker(id, 'bpmn-flow-finished')
116
+ })
117
+ }
118
+
119
+ // 导出 SVG
120
+ const exportSvg = async () => {
121
+ if (!viewer) return null
122
+ const svgResult = await viewer.saveSVG()
123
+ return svgResult.svg
124
+ }
125
+
126
+ onMounted(async () => {
127
+ await initViewer()
128
+ if (props.xml) await importXml(props.xml)
129
+ if (props.processInfo) highlightProcess(props.processInfo)
130
+ })
131
+
132
+ onBeforeUnmount(() => {
133
+ viewer?.destroy()
134
+ viewer = null
135
+ })
136
+ </script>
137
+
138
+ <template>
139
+ <div class="workflow-viewer">
140
+ <div v-if="showToolbar" class="viewer-toolbar">
141
+ <el-button size="small" @click="handleZoomIn">放大</el-button>
142
+ <el-button size="small" @click="handleZoomOut">缩小</el-button>
143
+ <el-button size="small" @click="handleFitView">适配</el-button>
144
+ <el-button v-if="allowExport" size="small" @click="handleExportSvg">导出 SVG</el-button>
145
+ </div>
146
+ <div ref="containerRef" :style="{ height: typeof height === 'number' ? height + 'px' : height }" />
147
+ </div>
148
+ </template>
149
+
150
+ <style>
151
+ /* BPMN 高亮样式(全局,不加 scoped) */
152
+ :deep(.bpmn-active) .djs-visual > :nth-child(1) {
153
+ fill: #409eff !important;
154
+ stroke: #409eff !important;
155
+ }
156
+ :deep(.bpmn-finished) .djs-visual > :nth-child(1) {
157
+ fill: #67c23a !important;
158
+ stroke: #67c23a !important;
159
+ }
160
+ :deep(.bpmn-flow-finished) .djs-visual > :nth-child(1) {
161
+ stroke: #67c23a !important;
162
+ }
163
+ </style>
164
+ ```
165
+
166
+ ## 页面调用
167
+
168
+ ```vue
169
+ <!-- bpmn 页面示例 -->
170
+ <script setup lang="ts">
171
+ import { ReDialog } from '@/components/ReDialog'
172
+ import WorkflowViewer from '../components/WorkflowViewer.vue'
173
+
174
+ defineOptions({ name: 'WorkflowBpmn' })
175
+ const showDialog = ref(false)
176
+ </script>
177
+
178
+ <template>
179
+ <el-button type="primary" size="large" @click="showDialog = true">查看流程图</el-button>
180
+ <ReDialog v-model="showDialog" title="BPMN流程图查看器">
181
+ <WorkflowViewer />
182
+ <template #footer>
183
+ <el-button @click="showDialog = false">关闭</el-button>
184
+ </template>
185
+ </ReDialog>
186
+ </template>
187
+ ```
188
+
189
+ ## 数据获取
190
+
191
+ ```typescript
192
+ // API 返回格式
193
+ interface WorkflowApiResponse {
194
+ data: BpmnWorkflowData // { xml: string, processInfo?: ProcessInfo }
195
+ code?: number
196
+ message?: string
197
+ }
198
+ ```
199
+
200
+ ## 关键约定
201
+
202
+ 1. 使用 `bpmn-js/lib/Viewer`(只读),不使用 `Modeler`(可编辑)除非有流程设计需求。
203
+ 2. 组件销毁时必须调用 `viewer.destroy()` 释放资源。
204
+ 3. 高亮通过 `canvas.addMarker(id, className)` 实现,CSS 使用 `:deep()` 穿透 BPMN 内部 SVG。
205
+ 4. 流程数据(已完成/活动任务)由后端接口统一返回,前端只负责渲染。
206
+ 5. 弹窗内使用时注意容器高度,BPMN 需要明确的宽高才能正确渲染。
207
+ 6. `canvas.zoom('fit-viewport')` 自动缩放适配视口。