npmapps 1.0.25 → 1.0.27
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/PUBLISH.md +268 -0
- package/app/.codegraph/daemon.pid +6 -0
- package/app/.eslintrc.js +19 -0
- package/app/README.md +24 -0
- package/app/babel.config.js +5 -0
- package/app/devtool-windows-amd64.zip +0 -0
- package/app/docs/superpowers/plans/2026-05-29-quill-editor.md +836 -0
- package/app/docs/superpowers/specs/2026-05-29-quill-editor-design.md +210 -0
- package/app/docs/superpowers/specs/2026-06-06-lazy-cascader-design.md +400 -0
- package/app/jsconfig.json +19 -0
- package/app/package-lock.json +21347 -0
- package/app/package.json +63 -0
- package/app/postcss.config.js +10 -0
- package/app/public/favicon.ico +0 -0
- package/app/public/index.html +17 -0
- package/app/public//344/270/200/351/224/256/351/273/221/346/232/227.html +136 -0
- package/app/src/App.vue +110 -0
- package/app/src/assets/bpmn-camunda.jpg +0 -0
- package/app/src/assets/css/diagram.less +17 -0
- package/app/src/assets/icon/Icon.less +31 -0
- package/app/src/assets/icon/font/app-codes.css +26 -0
- package/app/src/assets/icon/font/app.eot +0 -0
- package/app/src/assets/icon/font/app.svg +60 -0
- package/app/src/assets/icon/font/app.ttf +0 -0
- package/app/src/assets/icon/font/app.woff +0 -0
- package/app/src/assets/icon/font/app.woff2 +0 -0
- package/app/src/assets/icon/font/config.json +248 -0
- package/app/src/assets/icon/font/source/raw/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/raw/align-horizontal-center-tool.svg +85 -0
- package/app/src/assets/icon/font/source/raw/align-left-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-right-tool.svg +80 -0
- package/app/src/assets/icon/font/source/raw/align-top-tool.svg +84 -0
- package/app/src/assets/icon/font/source/raw/align-vertical-center-tool.svg +89 -0
- package/app/src/assets/icon/font/source/raw/distribute-horizontally-tool.svg +95 -0
- package/app/src/assets/icon/font/source/raw/distribute-vertically-tool.svg +99 -0
- package/app/src/assets/icon/font/source/raw/set-color-tool.svg +111 -0
- package/app/src/assets/icon/font/source/symbols/align-bottom-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-horizontal-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-left-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-right-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-top-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/align-vertical-center-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-horizontally-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/distribute-vertically-tool.svg +30 -0
- package/app/src/assets/icon/font/source/symbols/set-color-tool.svg +63 -0
- package/app/src/assets/logo.png +0 -0
- package/app/src/components/EllTable/README.md +70 -0
- package/app/src/components/EllTable/article.md +184 -0
- package/app/src/components/EllTable/index.js +213 -0
- package/app/src/components/FormulaEditor/FunctionSelector.vue +123 -0
- package/app/src/components/FormulaEditor/OperatorSelector.vue +184 -0
- package/app/src/components/FormulaEditor/ParameterSelector.vue +123 -0
- package/app/src/components/FormulaEditor/api.js +69 -0
- package/app/src/components/FormulaEditor/index.vue +435 -0
- package/app/src/components/HelloWorld.vue +58 -0
- package/app/src/components/PageHeader/index.vue +158 -0
- package/app/src/components/Splitter/README.md +144 -0
- package/app/src/components/Splitter/example.vue +88 -0
- package/app/src/components/Splitter/index.vue +203 -0
- package/app/src/components/diagram/ToolBar.vue +357 -0
- package/app/src/components/diagram/customTranslate/customTranslate.js +12 -0
- package/app/src/components/diagram/customTranslate/translationsGerman.js +241 -0
- package/app/src/components/diagram/index.vue +261 -0
- package/app/src/components/diagram/xmlData.js +29 -0
- package/app/src/directives/filldown.js +155 -0
- package/app/src/directives/filldownTable.js +291 -0
- package/app/src/main.js +40 -0
- package/app/src/router/index.js +63 -0
- package/app/src/store/index.js +23 -0
- package/app/src/utils/winBox.js +23 -0
- package/app/src/views/Extend/A.vue +12 -0
- package/app/src/views/Extend/B.vue +10 -0
- package/app/src/views/Extend/MagicalComponentsForELFormItem.vue +87 -0
- package/app/src/views/Extend/index.vue +59 -0
- package/app/src/views/Extend/tableMouseHorizontalWheel.vue +193 -0
- package/app/src/views/Home.vue +37 -0
- package/app/src/views/RouterJump.vue +155 -0
- package/app/src/views/css.vue +57 -0
- package/app/src/views/cssComponents/EllipsisText.vue +83 -0
- package/app/src/views/cssComponents/HoverCard.vue +79 -0
- package/app/src/views/cssComponents/TableHover.vue +140 -0
- package/app/src/views/cssComponents/inputSlo.vue +52 -0
- package/app/src/views/cssComponents/tableFixed.vue +158 -0
- package/app/src/views/echarts/echart-dome.vue +82 -0
- package/app/src/views/echarts/index.vue +118 -0
- package/app/src/views/echarts/pei3d.vue +667 -0
- package/app/src/views/element/bpmn/index.vue +18 -0
- package/app/src/views/element/components/attendanceCycle/index.vue +131 -0
- package/app/src/views/element/components/attendanceGroup/index.vue +147 -0
- package/app/src/views/element/components/attendancePersonnel/index.vue +158 -0
- package/app/src/views/element/components/companyCalendar/index.vue +147 -0
- package/app/src/views/element/components/shift/index.vue +147 -0
- package/app/src/views/element/components/shiftRotationSystem/index.vue +147 -0
- package/app/src/views/element/elTableJsx/columnManagement.vue +340 -0
- package/app/src/views/element/elTableJsx/dialogInput.vue +71 -0
- package/app/src/views/element/elTableJsx/elTableJsx.vue +1826 -0
- package/app/src/views/element/elTableJsx/formTable.vue +598 -0
- package/app/src/views/element/elTableJsx/index.vue +29 -0
- package/app/src/views/element/elTableJsx/simpleTable.vue +192 -0
- package/app/src/views/element/elTableJsx.zip +0 -0
- package/app/src/views/element/index.vue +44 -0
- package/app/src/views/element/lazyCascader/LazyCascader.vue +302 -0
- package/app/src/views/element/lazyCascader/data.js +205 -0
- package/app/src/views/element/lazyCascader/index.vue +315 -0
- package/app/src/views/element/quillEditor/README.md +163 -0
- package/app/src/views/element/quillEditor/example.vue +314 -0
- package/app/src/views/element/quillEditor/index.vue +409 -0
- package/app/src/views/element/quillEditor/toolbar.js +122 -0
- package/app/vue.config.js +15 -0
- package/package.json +1 -1
- package/app/wujie-vue3-child/.claude/settings.local.json +0 -8
- package/app/wujie-vue3-child/.vscode/extensions.json +0 -3
- package/app/wujie-vue3-child/PROJECT_MEMORY.md +0 -427
- package/app/wujie-vue3-child/README.md +0 -5
- package/app/wujie-vue3-child/index.html +0 -13
- package/app/wujie-vue3-child/package-lock.json +0 -5744
- package/app/wujie-vue3-child/package.json +0 -28
- package/app/wujie-vue3-child/public/vite.svg +0 -1
- package/app/wujie-vue3-child/src/App.vue +0 -130
- package/app/wujie-vue3-child/src/assets/vue.svg +0 -1
- package/app/wujie-vue3-child/src/components/HelloWorld.vue +0 -43
- package/app/wujie-vue3-child/src/components/SmartAnchorTabs/index.jsx +0 -224
- package/app/wujie-vue3-child/src/components/SmartAnchorTabs/style.css +0 -154
- package/app/wujie-vue3-child/src/components/tags-view.vue +0 -193
- package/app/wujie-vue3-child/src/components/tags-view1.vue +0 -131
- package/app/wujie-vue3-child/src/directives/aiLoading.js +0 -182
- package/app/wujie-vue3-child/src/hooks/useClickOutside.js +0 -11
- package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +0 -28
- package/app/wujie-vue3-child/src/main.js +0 -18
- package/app/wujie-vue3-child/src/router/index.js +0 -104
- package/app/wujie-vue3-child/src/store/tagsViewStroe.js +0 -34
- package/app/wujie-vue3-child/src/style.css +0 -171
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.jsx +0 -108
- package/app/wujie-vue3-child/src/views/aiCoach/collapseExpand/index.module.scss +0 -97
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +0 -836
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +0 -728
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +0 -687
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +0 -560
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +0 -570
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +0 -330
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +0 -378
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +0 -228
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +0 -399
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +0 -252
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +0 -585
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +0 -331
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +0 -392
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +0 -248
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +0 -194
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +0 -1459
- package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +0 -301
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/dialogueSegment/index.module.scss +0 -28
- package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +0 -375
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +0 -121
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +0 -76
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +0 -104
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +0 -75
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +0 -12
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +0 -62
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +0 -43
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +0 -5
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +0 -58
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +0 -92
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +0 -56
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +0 -40
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +0 -53
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +0 -132
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +0 -176
- package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +0 -96
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +0 -162
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +0 -16
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +0 -29
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +0 -106
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +0 -164
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +0 -182
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +0 -203
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +0 -145
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +0 -126
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +0 -67
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +0 -105
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +0 -81
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +0 -47
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +0 -64
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +0 -85
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +0 -39
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +0 -44
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +0 -83
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +0 -101
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +0 -50
- package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +0 -25
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.jsx +0 -196
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/index.module.scss +0 -41
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.jsx +0 -183
- package/app/wujie-vue3-child/src/views/aiCoach/scriptTable/inputColumn/index.module.scss +0 -115
- package/app/wujie-vue3-child/src/views/child-to-parent.vue +0 -117
- package/app/wujie-vue3-child/src/views/home.vue +0 -53
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +0 -169
- package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +0 -69
- package/app/wujie-vue3-child/src/views/jsx/com.vue +0 -44
- package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +0 -66
- package/app/wujie-vue3-child/src/views/jsx/index.vue +0 -72
- package/app/wujie-vue3-child/src/views/jsx/props.vue +0 -33
- package/app/wujie-vue3-child/src/views/parent-to-child.vue +0 -225
- package/app/wujie-vue3-child/src/views/phone-code.vue +0 -318
- package/app/wujie-vue3-child/src/views/router-jump.vue +0 -123
- package/app/wujie-vue3-child/src/views/test.vue +0 -192
- package/app/wujie-vue3-child/vite.config.js +0 -15
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mid-container">
|
|
3
|
+
<ToolBar @updateXml="updateXml" @updateScale="updateScale" :bpmnModeler="bpmnModeler" :elementSelector="elementSelector" :xml="xml" :scale.sync="scale" />
|
|
4
|
+
|
|
5
|
+
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
6
|
+
<el-tab-pane label="diagram_1.bpmn" name="first">
|
|
7
|
+
<div class="bpmn-container" v-show="radioValue === 'Diagram'">
|
|
8
|
+
<div class="canvas-container">
|
|
9
|
+
<div ref="canvas" class="canves"></div>
|
|
10
|
+
<div class="properties" :class="{open: openPanel}">
|
|
11
|
+
<div class="toggle" @click="openPanel = !openPanel">Properties Panel</div>
|
|
12
|
+
<div ref="propertiesPanel" class="panel"></div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div class="xml-container" v-if="isShowXml">
|
|
18
|
+
<codemirror ref="cmEditor" @changes="mirrorCodeChange" :value="xml.toString()" :options="cmOptions" />
|
|
19
|
+
</div>
|
|
20
|
+
</el-tab-pane>
|
|
21
|
+
</el-tabs>
|
|
22
|
+
|
|
23
|
+
<div class="bottom-container">
|
|
24
|
+
<el-radio-group v-model="radioValue" size="mini">
|
|
25
|
+
<el-radio-button label="Diagram"></el-radio-button>
|
|
26
|
+
<el-radio-button label="Xml"></el-radio-button>
|
|
27
|
+
</el-radio-group>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import Modeler from 'bpmn-js/lib/Modeler'
|
|
35
|
+
import 'bpmn-js/dist/assets/diagram-js.css' // 左边工具栏以及编辑节点的样式
|
|
36
|
+
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css'
|
|
37
|
+
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css'
|
|
38
|
+
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
|
|
39
|
+
import 'bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css'
|
|
40
|
+
import 'bpmn-js-properties-panel/styles/properties.less'
|
|
41
|
+
import 'diagram-js-minimap/assets/diagram-js-minimap.css'
|
|
42
|
+
import minimapModule from 'diagram-js-minimap'
|
|
43
|
+
import propertiesPanelModule from 'bpmn-js-properties-panel'
|
|
44
|
+
import propertiesProviderModule from 'bpmn-js-properties-panel/lib/provider/camunda'
|
|
45
|
+
import camundaModdleDescriptor from 'camunda-bpmn-moddle/resources/camunda.json'
|
|
46
|
+
|
|
47
|
+
import { codemirror } from 'vue-codemirror'
|
|
48
|
+
import 'codemirror/lib/codemirror.css'
|
|
49
|
+
// xml syntax highlighting
|
|
50
|
+
import 'codemirror/mode/xml/xml'
|
|
51
|
+
// auto close tags
|
|
52
|
+
import 'codemirror/addon/fold/xml-fold'
|
|
53
|
+
import 'codemirror/addon/edit/closetag'
|
|
54
|
+
// search addons
|
|
55
|
+
import 'codemirror/addon/search/search'
|
|
56
|
+
import 'codemirror/addon/search/searchcursor'
|
|
57
|
+
import 'codemirror/addon/dialog/dialog'
|
|
58
|
+
import 'codemirror/addon/dialog/dialog.css'
|
|
59
|
+
|
|
60
|
+
import '@/assets/css/diagram.less'
|
|
61
|
+
import '@/assets/icon/Icon.less'
|
|
62
|
+
import ToolBar from '@/components/diagram/ToolBar.vue'
|
|
63
|
+
import { xmlStr } from './xmlData.js'
|
|
64
|
+
import { mapMutations } from 'vuex'
|
|
65
|
+
|
|
66
|
+
// 导入汉化包
|
|
67
|
+
import customTranslate from '@/components/diagram/customTranslate/customTranslate'
|
|
68
|
+
export default {
|
|
69
|
+
components: { ToolBar, codemirror },
|
|
70
|
+
props: {
|
|
71
|
+
},
|
|
72
|
+
data () {
|
|
73
|
+
return {
|
|
74
|
+
bpmnModeler: null,
|
|
75
|
+
xml: '',
|
|
76
|
+
elementSelector: [],
|
|
77
|
+
openPanel: true,
|
|
78
|
+
scale: 1,
|
|
79
|
+
activeName: 'first',
|
|
80
|
+
radioValue: 'Diagram',
|
|
81
|
+
cmOptions: {
|
|
82
|
+
autoCloseTags: true,
|
|
83
|
+
dragDrop: true,
|
|
84
|
+
allowDropFileTypes: ['text/plain'],
|
|
85
|
+
lineWrapping: true,
|
|
86
|
+
lineNumbers: true,
|
|
87
|
+
mode: {
|
|
88
|
+
name: 'application/xml',
|
|
89
|
+
htmlMode: false
|
|
90
|
+
},
|
|
91
|
+
tabSize: 2
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
computed: {
|
|
96
|
+
isShowXml () {
|
|
97
|
+
return this.radioValue === 'Xml'
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
watch: {
|
|
101
|
+
radioValue: {
|
|
102
|
+
immediate: true,
|
|
103
|
+
handler (v, o) {
|
|
104
|
+
this.setRadioValue(v)
|
|
105
|
+
if (this.isShowXml) {
|
|
106
|
+
this.saveXML()
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
mounted () {
|
|
112
|
+
this.init()
|
|
113
|
+
},
|
|
114
|
+
methods: {
|
|
115
|
+
...mapMutations(['setRadioValue']),
|
|
116
|
+
init () {
|
|
117
|
+
// 添加翻译组件
|
|
118
|
+
var customTranslateModule = {
|
|
119
|
+
translate: ['value', customTranslate]
|
|
120
|
+
}
|
|
121
|
+
this.bpmnModeler = new Modeler({
|
|
122
|
+
container: this.$refs.canvas,
|
|
123
|
+
keyboard: {
|
|
124
|
+
bindTo: document
|
|
125
|
+
},
|
|
126
|
+
propertiesPanel: {
|
|
127
|
+
parent: this.$refs.propertiesPanel
|
|
128
|
+
},
|
|
129
|
+
additionalModules: [
|
|
130
|
+
minimapModule,
|
|
131
|
+
propertiesPanelModule,
|
|
132
|
+
propertiesProviderModule,
|
|
133
|
+
customTranslateModule
|
|
134
|
+
],
|
|
135
|
+
moddleExtensions: {
|
|
136
|
+
camunda: camundaModdleDescriptor
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
this.createNewDiagram()
|
|
141
|
+
|
|
142
|
+
this.initEvent()
|
|
143
|
+
|
|
144
|
+
// 默认打开 minimap
|
|
145
|
+
this.bpmnModeler.get('minimap').open()
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
async createNewDiagram () {
|
|
149
|
+
try {
|
|
150
|
+
await this.bpmnModeler.importXML(this.xml || xmlStr)
|
|
151
|
+
this.bpmnModeler.get('canvas').zoom('fit-viewport', 'auto')
|
|
152
|
+
this.saveXML()
|
|
153
|
+
} catch (err) {
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
initEvent () {
|
|
158
|
+
const eventBus = this.bpmnModeler.get('eventBus')
|
|
159
|
+
eventBus.on('selection.changed', e => {
|
|
160
|
+
this.elementSelector = e.newSelection
|
|
161
|
+
})
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
updateXml (xml) {
|
|
165
|
+
this.xml = xml
|
|
166
|
+
this.createNewDiagram()
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
updateScale (value) {
|
|
170
|
+
this.scale = value
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
getCurDiagram () {
|
|
174
|
+
return this
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
handleClick () { },
|
|
178
|
+
|
|
179
|
+
async saveXML () {
|
|
180
|
+
const res = await this.bpmnModeler.saveXML({ format: true })
|
|
181
|
+
this.xml = res.xml.toString()
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
mirrorCodeChange (instance, changeObj) {
|
|
185
|
+
this.xml = instance.getValue()
|
|
186
|
+
this.createNewDiagram()
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
</script>
|
|
192
|
+
|
|
193
|
+
<style lang="less" scoped>
|
|
194
|
+
.bpmn-container {
|
|
195
|
+
overflow: hidden;
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
box-sizing: border-box;
|
|
199
|
+
height: calc(100vh - 295px);
|
|
200
|
+
.canvas-container {
|
|
201
|
+
display: flex;
|
|
202
|
+
height: 100%;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.canves {
|
|
206
|
+
height: 100%;
|
|
207
|
+
width: 100%;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.properties {
|
|
211
|
+
overflow: auto;
|
|
212
|
+
position: relative;
|
|
213
|
+
width: 0px;
|
|
214
|
+
flex: none;
|
|
215
|
+
border-left: solid 1px #ccc;
|
|
216
|
+
box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
|
|
217
|
+
outline: none;
|
|
218
|
+
background: #f8f8f8;
|
|
219
|
+
&.open {
|
|
220
|
+
width: 250px;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.toggle {
|
|
224
|
+
position: absolute;
|
|
225
|
+
left: -30px;
|
|
226
|
+
top: 50%;
|
|
227
|
+
background: #f8f8f8;
|
|
228
|
+
padding: 7px 10px;
|
|
229
|
+
transform: rotate(-90deg);
|
|
230
|
+
white-space: nowrap;
|
|
231
|
+
font-size: 13px;
|
|
232
|
+
border: solid 1px #ccc;
|
|
233
|
+
border-bottom: none;
|
|
234
|
+
border-radius: 2px 2px 0 0;
|
|
235
|
+
transform-origin: top left;
|
|
236
|
+
z-index: 10;
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
user-select: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.panel {
|
|
242
|
+
border-left: 1px solid #ccc;
|
|
243
|
+
overflow: auto;
|
|
244
|
+
/deep/.bpp-properties-panel {
|
|
245
|
+
height: 100%;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.bottom-container {
|
|
252
|
+
z-index: 9;
|
|
253
|
+
position: absolute;
|
|
254
|
+
bottom: 10px;
|
|
255
|
+
left: 10px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/deep/.CodeMirror {
|
|
259
|
+
height: calc(100vh - 95px);
|
|
260
|
+
}
|
|
261
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const xmlStr = `<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="bpmn-js (https://demo.bpmn.io)" exporterVersion="5.1.2">
|
|
3
|
+
<process id="Process_1" isExecutable="false">
|
|
4
|
+
<startEvent id="StartEvent_1y45yut" name="开始">
|
|
5
|
+
<outgoing>SequenceFlow_0h21x7r</outgoing>
|
|
6
|
+
</startEvent>
|
|
7
|
+
<task id="Task_1hcentk">
|
|
8
|
+
<incoming>SequenceFlow_0h21x7r</incoming>
|
|
9
|
+
</task>
|
|
10
|
+
<sequenceFlow id="SequenceFlow_0h21x7r" sourceRef="StartEvent_1y45yut" targetRef="Task_1hcentk" />
|
|
11
|
+
</process>
|
|
12
|
+
<bpmndi:BPMNDiagram id="BpmnDiagram_1">
|
|
13
|
+
<bpmndi:BPMNPlane id="BpmnPlane_1" bpmnElement="Process_1">
|
|
14
|
+
<bpmndi:BPMNShape id="StartEvent_1y45yut_di" bpmnElement="StartEvent_1y45yut">
|
|
15
|
+
<omgdc:Bounds x="152" y="102" width="36" height="36" />
|
|
16
|
+
<bpmndi:BPMNLabel>
|
|
17
|
+
<omgdc:Bounds x="160" y="145" width="22" height="14" />
|
|
18
|
+
</bpmndi:BPMNLabel>
|
|
19
|
+
</bpmndi:BPMNShape>
|
|
20
|
+
<bpmndi:BPMNShape id="Task_1hcentk_di" bpmnElement="Task_1hcentk">
|
|
21
|
+
<omgdc:Bounds x="240" y="80" width="100" height="80" />
|
|
22
|
+
</bpmndi:BPMNShape>
|
|
23
|
+
<bpmndi:BPMNEdge id="SequenceFlow_0h21x7r_di" bpmnElement="SequenceFlow_0h21x7r">
|
|
24
|
+
<omgdi:waypoint x="188" y="120" />
|
|
25
|
+
<omgdi:waypoint x="240" y="120" />
|
|
26
|
+
</bpmndi:BPMNEdge>
|
|
27
|
+
</bpmndi:BPMNPlane>
|
|
28
|
+
</bpmndi:BPMNDiagram>
|
|
29
|
+
</definitions>`
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
function ensurePosition(el) {
|
|
2
|
+
const pos = window.getComputedStyle(el).position;
|
|
3
|
+
if (!pos || pos === "static") {
|
|
4
|
+
el.style.position = "relative";
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function createHandle() {
|
|
9
|
+
const h = document.createElement("span");
|
|
10
|
+
h.className = "v-filldown-handle";
|
|
11
|
+
h.style.position = "absolute";
|
|
12
|
+
h.style.right = "2px";
|
|
13
|
+
h.style.bottom = "2px";
|
|
14
|
+
h.style.width = "0";
|
|
15
|
+
h.style.height = "0";
|
|
16
|
+
h.style.borderLeft = "6px solid transparent";
|
|
17
|
+
h.style.borderTop = "6px solid #409EFF";
|
|
18
|
+
h.style.cursor = "crosshair";
|
|
19
|
+
h.style.display = "none";
|
|
20
|
+
h.style.zIndex = "10";
|
|
21
|
+
return h;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function setSelected(el, selected) {
|
|
25
|
+
if (selected) {
|
|
26
|
+
el.classList.add("v-filldown-selected");
|
|
27
|
+
} else {
|
|
28
|
+
el.classList.remove("v-filldown-selected");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function attach(el, binding) {
|
|
33
|
+
const value = binding.value || {};
|
|
34
|
+
const group = value.group;
|
|
35
|
+
const rows = value.rows;
|
|
36
|
+
const prop = value.prop;
|
|
37
|
+
const index = value.index;
|
|
38
|
+
|
|
39
|
+
el.dataset.filldownGroup = group || "";
|
|
40
|
+
el.dataset.filldownIndex = typeof index === "number" ? String(index) : "";
|
|
41
|
+
|
|
42
|
+
ensurePosition(el);
|
|
43
|
+
let handle = el._filldownHandle;
|
|
44
|
+
if (!handle) {
|
|
45
|
+
handle = createHandle();
|
|
46
|
+
el._filldownHandle = handle;
|
|
47
|
+
el.appendChild(handle);
|
|
48
|
+
el.addEventListener("mouseenter", () => {
|
|
49
|
+
handle.style.display = "block";
|
|
50
|
+
});
|
|
51
|
+
el.addEventListener("mouseleave", () => {
|
|
52
|
+
if (!el._filldownDragging) handle.style.display = "none";
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function findTargetByPoint(clientX, clientY) {
|
|
57
|
+
let target = document.elementFromPoint(clientX, clientY);
|
|
58
|
+
while (target && target !== document.body) {
|
|
59
|
+
if (
|
|
60
|
+
target.dataset &&
|
|
61
|
+
target.dataset.filldownGroup &&
|
|
62
|
+
target.dataset.filldownGroup === group
|
|
63
|
+
) {
|
|
64
|
+
return target;
|
|
65
|
+
}
|
|
66
|
+
target = target.parentElement;
|
|
67
|
+
}
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function clearSelection() {
|
|
72
|
+
const list = document.querySelectorAll(
|
|
73
|
+
`[data-filldown-group="${group}"].v-filldown-selected`
|
|
74
|
+
);
|
|
75
|
+
list.forEach((n) => setSelected(n, false));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function startDrag(e) {
|
|
79
|
+
if (!rows || !Array.isArray(rows) || !prop) return;
|
|
80
|
+
el._filldownDragging = true;
|
|
81
|
+
handle.style.display = "block";
|
|
82
|
+
const startIndex = Number(el.dataset.filldownIndex || 0);
|
|
83
|
+
const startValue = rows[startIndex] ? rows[startIndex][prop] : undefined;
|
|
84
|
+
let lastIndex = startIndex;
|
|
85
|
+
|
|
86
|
+
function onMove(ev) {
|
|
87
|
+
const t = findTargetByPoint(ev.clientX, ev.clientY);
|
|
88
|
+
if (t && t.dataset.filldownIndex) {
|
|
89
|
+
const currIndex = Number(t.dataset.filldownIndex);
|
|
90
|
+
if (currIndex !== lastIndex) {
|
|
91
|
+
clearSelection();
|
|
92
|
+
if (currIndex > startIndex) {
|
|
93
|
+
for (let i = startIndex + 1; i <= currIndex; i++) {
|
|
94
|
+
const elItem = document.querySelector(
|
|
95
|
+
`[data-filldown-group="${group}"][data-filldown-index="${i}"]`
|
|
96
|
+
);
|
|
97
|
+
if (elItem) setSelected(elItem, true);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
lastIndex = currIndex;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function onUp() {
|
|
106
|
+
document.removeEventListener("mousemove", onMove);
|
|
107
|
+
document.removeEventListener("mouseup", onUp);
|
|
108
|
+
el._filldownDragging = false;
|
|
109
|
+
handle.style.display = "none";
|
|
110
|
+
if (typeof lastIndex === "number" && lastIndex > startIndex) {
|
|
111
|
+
for (let i = startIndex + 1; i <= lastIndex; i++) {
|
|
112
|
+
if (rows[i] && prop in rows[i]) {
|
|
113
|
+
rows[i][prop] = startValue;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
clearSelection();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
document.addEventListener("mousemove", onMove);
|
|
121
|
+
document.addEventListener("mouseup", onUp);
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
e.stopPropagation();
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
handle.onmousedown = startDrag;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export default {
|
|
130
|
+
inserted(el, binding) {
|
|
131
|
+
attach(el, binding);
|
|
132
|
+
},
|
|
133
|
+
update(el, binding) {
|
|
134
|
+
attach(el, binding);
|
|
135
|
+
},
|
|
136
|
+
unbind(el) {
|
|
137
|
+
if (el._filldownHandle) {
|
|
138
|
+
el._filldownHandle.onmousedown = null;
|
|
139
|
+
el._filldownHandle.remove();
|
|
140
|
+
el._filldownHandle = null;
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
const styleId = "v-filldown-style";
|
|
146
|
+
if (!document.getElementById(styleId)) {
|
|
147
|
+
const style = document.createElement("style");
|
|
148
|
+
style.id = styleId;
|
|
149
|
+
style.innerHTML = `
|
|
150
|
+
.v-filldown-selected{
|
|
151
|
+
background-color: rgba(64,158,255,0.12);
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
154
|
+
document.head.appendChild(style);
|
|
155
|
+
}
|