vue2-client 1.2.5 → 1.2.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/CHANGELOG.md +16 -0
- package/package.json +89 -89
- package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +2 -2
- package/src/config/CreateQueryConfig.js +40 -0
- package/src/config/default/setting.config.js +1 -0
- package/src/pages/login/Login.vue +8 -4
- package/src/pages/system/ticket/index.vue +427 -0
- package/src/pages/system/ticket/submitTicketSuccess.vue +249 -0
- package/src/router/async/config.async.js +1 -0
- package/src/router/async/router.map.js +2 -2
- package/src/services/api/EmployeeDetailsViewApi.js +0 -4
- package/src/utils/util.js +34 -4
- package/vue.config.js +0 -10
- package/src/pages/system/applyInstallView/Core.vue +0 -570
- package/src/pages/system/applyInstallView/LFComponents/AddPanel.vue +0 -52
- package/src/pages/system/applyInstallView/LFComponents/Control.vue +0 -78
- package/src/pages/system/applyInstallView/LFComponents/DataDialog.vue +0 -24
- package/src/pages/system/applyInstallView/LFComponents/NodePanel.vue +0 -103
- package/src/pages/system/applyInstallView/PropertySetting/Base.vue +0 -124
- package/src/pages/system/applyInstallView/PropertySetting/CommonProperty.vue +0 -104
- package/src/pages/system/applyInstallView/PropertySetting/PropertyDialog.vue +0 -43
- package/src/pages/system/applyInstallView/background/base.png +0 -0
- package/src/pages/system/applyInstallView/background/click.png +0 -0
- package/src/pages/system/applyInstallView/background/download.png +0 -0
- package/src/pages/system/applyInstallView/background/end.png +0 -0
- package/src/pages/system/applyInstallView/background/push.png +0 -0
- package/src/pages/system/applyInstallView/background/start.png +0 -0
- package/src/pages/system/applyInstallView/background/step.png +0 -0
- package/src/pages/system/applyInstallView/background/time.png +0 -0
- package/src/pages/system/applyInstallView/config.js +0 -22
- package/src/pages/system/applyInstallView/data.json +0 -1284
- package/src/pages/system/applyInstallView/index.vue +0 -34
- package/src/pages/system/applyInstallView/registerNode/Connect.vue +0 -43
- package/src/pages/system/applyInstallView/registerNode/index.js +0 -16
- package/src/pages/system/applyInstallView/registerNode/registerBackEdge.js +0 -44
- package/src/pages/system/applyInstallView/registerNode/registerBase.js +0 -139
- package/src/pages/system/applyInstallView/registerNode/registerConnect.js +0 -60
- package/src/pages/system/applyInstallView/registerNode/registerDownload.js +0 -92
- package/src/pages/system/applyInstallView/registerNode/registerEnd.js +0 -110
- package/src/pages/system/applyInstallView/registerNode/registerPolyline.js +0 -14
- package/src/pages/system/applyInstallView/registerNode/registerPush.js +0 -127
- package/src/pages/system/applyInstallView/registerNode/registerStart.js +0 -105
- package/src/pages/system/applyInstallView/registerNode/registerStep.js +0 -209
- package/src/pages/system/applyInstallView/registerNode/registerTask.js +0 -29
|
@@ -7,10 +7,6 @@ const EmployeeDetailsViewApi = {
|
|
|
7
7
|
getFinishedTicketsCountWeekly: '/webmeterapi/getFinishedTicketsCountWeekly',
|
|
8
8
|
// 查询:是否存在此员工
|
|
9
9
|
findEmpName: '/webmeterapi/findEmpName',
|
|
10
|
-
// 查询:获取部门名字典
|
|
11
|
-
getDepartmentDictionary: '/webmeterapi/getDepartmentDictionary',
|
|
12
|
-
// 查询:获取模块名字典
|
|
13
|
-
getModelDictionary: '/webmeterapi/getModelDictionary',
|
|
14
10
|
// 查询:获取所有员工名,供前端展示备选项
|
|
15
11
|
getAllEmployeeName: '/webmeterapi/getAllEmployeeName'
|
|
16
12
|
}
|
package/src/utils/util.js
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
import enquireJs from 'enquire.js'
|
|
2
2
|
|
|
3
|
+
const timeList = [
|
|
4
|
+
{
|
|
5
|
+
CN: '早上好',
|
|
6
|
+
HK: '早晨啊',
|
|
7
|
+
US: 'Good morning'
|
|
8
|
+
}, {
|
|
9
|
+
CN: '上午好',
|
|
10
|
+
HK: '上午好',
|
|
11
|
+
US: 'Good morning'
|
|
12
|
+
}, {
|
|
13
|
+
CN: '中午好',
|
|
14
|
+
HK: '中午好',
|
|
15
|
+
US: 'Good afternoon'
|
|
16
|
+
}, {
|
|
17
|
+
CN: '下午好',
|
|
18
|
+
HK: '下午好',
|
|
19
|
+
US: 'Good afternoon'
|
|
20
|
+
}, {
|
|
21
|
+
CN: '晚上好',
|
|
22
|
+
HK: '晚上好',
|
|
23
|
+
US: 'Good evening'
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
|
|
3
27
|
export function isDef (v) {
|
|
4
28
|
return v !== undefined && v !== null
|
|
5
29
|
}
|
|
@@ -43,6 +67,13 @@ export function timeCompare (date1, date2) {
|
|
|
43
67
|
return date11.time > date22.time ? 1 : -1
|
|
44
68
|
}
|
|
45
69
|
|
|
70
|
+
export function timeFix () {
|
|
71
|
+
const time = new Date()
|
|
72
|
+
const hour = time.getHours()
|
|
73
|
+
return hour < 9
|
|
74
|
+
? timeList[0] : (hour <= 11 ? timeList[1] : (hour <= 13 ? timeList[2] : (hour <= 20 ? timeList[3] : timeList[4])))
|
|
75
|
+
}
|
|
76
|
+
|
|
46
77
|
/**
|
|
47
78
|
* Remove an item from an array.
|
|
48
79
|
*/
|
|
@@ -81,16 +112,15 @@ export function showXml (str) {
|
|
|
81
112
|
|
|
82
113
|
// 把注释编码
|
|
83
114
|
text = text.replace(/\n/g, '\r').replace(/<!--(.+?)-->/g, function ($0, text) {
|
|
84
|
-
|
|
85
|
-
return ret
|
|
115
|
+
return '<!--' + escape(text) + '-->'
|
|
86
116
|
}).replace(/\r/g, '\n')
|
|
87
117
|
|
|
88
118
|
// 调整格式
|
|
89
|
-
const rgx = /\n(<(([^?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(
|
|
119
|
+
const rgx = /\n(<(([^?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(\/)>|<(\/)\2>))?)/mg
|
|
90
120
|
const nodeStack = []
|
|
91
121
|
const output = text.replace(rgx, function ($0, all, name, isBegin, isCloseFull1, isCloseFull2, isFull1, isFull2) {
|
|
92
122
|
const isClosed = (isCloseFull1 === '/') || (isCloseFull2 === '/') || (isFull1 === '/') || (isFull2 === '/')
|
|
93
|
-
let prefix
|
|
123
|
+
let prefix
|
|
94
124
|
if (isBegin === '!') {
|
|
95
125
|
prefix = getPrefix(nodeStack.length)
|
|
96
126
|
} else {
|
package/vue.config.js
CHANGED
|
@@ -59,11 +59,6 @@ module.exports = {
|
|
|
59
59
|
ws: false,
|
|
60
60
|
changeOrigin: true
|
|
61
61
|
},
|
|
62
|
-
'iot/webmeterapi': {
|
|
63
|
-
pathRewrite: { '^/iot/webmeterapi': '/rs/logic' },
|
|
64
|
-
target: local,
|
|
65
|
-
changeOrigin: true
|
|
66
|
-
},
|
|
67
62
|
'/webmeterapi': {
|
|
68
63
|
pathRewrite: { '^/webmeterapi': '/rs/logic' },
|
|
69
64
|
target: local,
|
|
@@ -73,11 +68,6 @@ module.exports = {
|
|
|
73
68
|
pathRewrite: { '^/webmeteruploadapi': '/rs/file' },
|
|
74
69
|
target: local,
|
|
75
70
|
changeOrigin: true
|
|
76
|
-
},
|
|
77
|
-
'/webmetersql': {
|
|
78
|
-
pathRewrite: { '^/webmetersql': '/rs/sql' },
|
|
79
|
-
target: local,
|
|
80
|
-
changeOrigin: true
|
|
81
71
|
}
|
|
82
72
|
}
|
|
83
73
|
},
|
|
@@ -1,570 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="logic-flow-view">
|
|
3
|
-
<!-- 辅助工具栏 -->
|
|
4
|
-
<Control
|
|
5
|
-
class="demo-control"
|
|
6
|
-
v-if="lf"
|
|
7
|
-
:lf="lf"
|
|
8
|
-
@catData="$_catData"
|
|
9
|
-
@catRealData="$_catRealData"
|
|
10
|
-
></Control>
|
|
11
|
-
<a-card
|
|
12
|
-
class="demo-card"
|
|
13
|
-
title="属性预览"
|
|
14
|
-
size="small"
|
|
15
|
-
v-if="Object.keys(selectNodeProperties).length > 0"
|
|
16
|
-
>
|
|
17
|
-
<a-descriptions :column="1" :title="'节点:' + selectNodeProperties.text" >
|
|
18
|
-
<a-descriptions-item v-if="key !== 'formData'" v-for="key of Object.keys(selectNodeProperties)" :key="key" :label="key">
|
|
19
|
-
{{ selectNodeProperties[key] }}
|
|
20
|
-
</a-descriptions-item>
|
|
21
|
-
</a-descriptions>
|
|
22
|
-
|
|
23
|
-
</a-card>
|
|
24
|
-
<!-- 节点面板 -->
|
|
25
|
-
<NodePanel v-if="lf" :lf="lf" :nodeList="nodeList"></NodePanel>
|
|
26
|
-
<!-- 画布 -->
|
|
27
|
-
<div id="LF-view"></div>
|
|
28
|
-
<!-- 步骤节点自定义操作面板 -->
|
|
29
|
-
<AddPanel
|
|
30
|
-
v-if="showAddPanel"
|
|
31
|
-
class="add-panel"
|
|
32
|
-
:style="addPanelStyle"
|
|
33
|
-
:lf="lf"
|
|
34
|
-
:nodeData="addClickNode"
|
|
35
|
-
:node-list="addNodeList"
|
|
36
|
-
@addNodeFinish="hideAddPanel"
|
|
37
|
-
>
|
|
38
|
-
</AddPanel>
|
|
39
|
-
<!-- 属性面板 -->
|
|
40
|
-
<a-drawer
|
|
41
|
-
title="设置节点属性"
|
|
42
|
-
:visible="dialogVisible"
|
|
43
|
-
width="40%"
|
|
44
|
-
@close="closeDialog">
|
|
45
|
-
<PropertyDialog
|
|
46
|
-
v-if="dialogVisible"
|
|
47
|
-
:nodeData="clickNode"
|
|
48
|
-
:lf="lf"
|
|
49
|
-
@setPropertiesFinish="closeDialog"
|
|
50
|
-
></PropertyDialog>
|
|
51
|
-
</a-drawer>
|
|
52
|
-
<!-- 表单构建面板 -->
|
|
53
|
-
<create-simple-form-query
|
|
54
|
-
:visible.sync="createSimpleFormVisible"
|
|
55
|
-
:to-edit-json="createFormNodeJson"
|
|
56
|
-
@saveSimpleFormQueryParams="saveSimpleFormQueryParams"
|
|
57
|
-
/>
|
|
58
|
-
<!-- 数据查看面板 -->
|
|
59
|
-
<a-modal
|
|
60
|
-
title="原始数据"
|
|
61
|
-
v-model="dataVisible"
|
|
62
|
-
width="50%">
|
|
63
|
-
<DataDialog :graphData="graphData"></DataDialog>
|
|
64
|
-
</a-modal>
|
|
65
|
-
<!-- 实际数据查看面板 -->
|
|
66
|
-
<a-modal
|
|
67
|
-
title="实际数据"
|
|
68
|
-
v-model="realDataVisible"
|
|
69
|
-
width="50%"
|
|
70
|
-
@ok="saveData"
|
|
71
|
-
>
|
|
72
|
-
<a-tabs default-active-key="99999">
|
|
73
|
-
<a-tab-pane key="99999" tab="报装流程配置">
|
|
74
|
-
<pre>{{ graphRealData }}</pre>
|
|
75
|
-
</a-tab-pane>
|
|
76
|
-
<a-tab-pane v-for="item of hasFormNodeList" :key="item.id" :tab="'表单:' + item.properties.formData.describe">
|
|
77
|
-
<json-viewer :copyable="{copyText: '复制', copiedText: '已复制'}" :value="item.properties.formData" :expand-depth="parseInt('100')" style="overflow: auto;max-height: 440px"></json-viewer>
|
|
78
|
-
</a-tab-pane>
|
|
79
|
-
</a-tabs>
|
|
80
|
-
</a-modal>
|
|
81
|
-
</div>
|
|
82
|
-
</template>
|
|
83
|
-
<script>
|
|
84
|
-
import LogicFlow from '@logicflow/core'
|
|
85
|
-
// const LogicFlow = window.LogicFlow
|
|
86
|
-
import { Menu, SelectionSelect, Snapshot } from '@logicflow/extension'
|
|
87
|
-
import '@logicflow/core/dist/style/index.css'
|
|
88
|
-
import '@logicflow/extension/lib/style/index.css'
|
|
89
|
-
import NodePanel from './LFComponents/NodePanel'
|
|
90
|
-
import AddPanel from './LFComponents/AddPanel'
|
|
91
|
-
import Control from './LFComponents/Control'
|
|
92
|
-
import PropertyDialog from './PropertySetting/PropertyDialog'
|
|
93
|
-
import DataDialog from './LFComponents/DataDialog'
|
|
94
|
-
import { nodeList } from './config'
|
|
95
|
-
import { showXml } from '@vue2-client/utils/util'
|
|
96
|
-
import FileSaver from 'file-saver'
|
|
97
|
-
import JsonViewer from 'vue-json-viewer'
|
|
98
|
-
|
|
99
|
-
import {
|
|
100
|
-
registerBackEdge,
|
|
101
|
-
registerConnect,
|
|
102
|
-
registerDownload,
|
|
103
|
-
registerEnd,
|
|
104
|
-
registerPolyline,
|
|
105
|
-
registerPush,
|
|
106
|
-
registerStart,
|
|
107
|
-
registerStep,
|
|
108
|
-
registerTask,
|
|
109
|
-
registerBase
|
|
110
|
-
} from './registerNode'
|
|
111
|
-
|
|
112
|
-
const demoData = require('./data.json')
|
|
113
|
-
|
|
114
|
-
export default {
|
|
115
|
-
name: 'LF',
|
|
116
|
-
components: { NodePanel, AddPanel, Control, PropertyDialog, DataDialog, JsonViewer },
|
|
117
|
-
computed: {
|
|
118
|
-
hasFormNodeList () {
|
|
119
|
-
return this.allNodeList.filter(item => item.type === 'step' && item.properties.formData)
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
data () {
|
|
123
|
-
return {
|
|
124
|
-
lf: null,
|
|
125
|
-
showAddPanel: false,
|
|
126
|
-
addPanelStyle: {
|
|
127
|
-
top: 0,
|
|
128
|
-
left: 0
|
|
129
|
-
},
|
|
130
|
-
nodeData: null,
|
|
131
|
-
addClickNode: null,
|
|
132
|
-
clickNode: null,
|
|
133
|
-
dialogVisible: false,
|
|
134
|
-
graphData: null,
|
|
135
|
-
graphRealData: null,
|
|
136
|
-
dataVisible: false,
|
|
137
|
-
realDataVisible: false,
|
|
138
|
-
config: {
|
|
139
|
-
background: {
|
|
140
|
-
backgroundColor: '#f7f9ff'
|
|
141
|
-
},
|
|
142
|
-
grid: {
|
|
143
|
-
size: 10,
|
|
144
|
-
visible: false
|
|
145
|
-
},
|
|
146
|
-
keyboard: {
|
|
147
|
-
enabled: true
|
|
148
|
-
},
|
|
149
|
-
style: {
|
|
150
|
-
rect: {
|
|
151
|
-
radius: 6
|
|
152
|
-
},
|
|
153
|
-
edgeText: { // 边文本样式
|
|
154
|
-
background: {
|
|
155
|
-
fill: '#fff'
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
edgeTextDraggable: true,
|
|
160
|
-
hoverOutline: false,
|
|
161
|
-
guards: {
|
|
162
|
-
beforeClone (data) {
|
|
163
|
-
console.log('beforeClone', data)
|
|
164
|
-
return true
|
|
165
|
-
},
|
|
166
|
-
beforeDelete (data) {
|
|
167
|
-
// 可以根据data数据判断是否允许删除,允许返回true,不允许返回false
|
|
168
|
-
// 文档: http://logic-flow.org/guide/basic/keyboard.html#%E5%A6%82%E4%BD%95%E9%98%BB%E6%AD%A2%E5%88%A0%E9%99%A4%E6%88%96%E8%80%85%E6%8B%B7%E8%B4%9D%E8%A1%8C%E4%B8%BA
|
|
169
|
-
console.log('beforeDelete', data)
|
|
170
|
-
// _this.$message('不允许删除', 'error')
|
|
171
|
-
return true
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
moveData: {},
|
|
176
|
-
nodeList,
|
|
177
|
-
addNodeList: [],
|
|
178
|
-
baseNodeName: '',
|
|
179
|
-
createSimpleFormVisible: false,
|
|
180
|
-
createFormNodeJson: {},
|
|
181
|
-
nodeFormJsonArray: [],
|
|
182
|
-
allNodeList: [],
|
|
183
|
-
selectNodeProperties: {}
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
mounted () {
|
|
187
|
-
this.$_initLf()
|
|
188
|
-
},
|
|
189
|
-
methods: {
|
|
190
|
-
$_initLf () {
|
|
191
|
-
// 画布配置
|
|
192
|
-
|
|
193
|
-
// 使用插件
|
|
194
|
-
LogicFlow.use(Menu)
|
|
195
|
-
LogicFlow.use(Snapshot)
|
|
196
|
-
LogicFlow.use(SelectionSelect)
|
|
197
|
-
const lf = new LogicFlow({
|
|
198
|
-
...this.config,
|
|
199
|
-
container: document.querySelector('#LF-view'),
|
|
200
|
-
stopMoveGraph: true
|
|
201
|
-
})
|
|
202
|
-
this.lf = lf
|
|
203
|
-
// 1.1.0新增用法
|
|
204
|
-
lf.extension.selectionSelect.openSelectionSelect()
|
|
205
|
-
lf.zoom(false)
|
|
206
|
-
lf.zoom(false)
|
|
207
|
-
lf.zoom(false)
|
|
208
|
-
lf.zoom(false)
|
|
209
|
-
lf.zoom(false)
|
|
210
|
-
// 菜单配置文档:http://logic-flow.org/guide/extension/extension-components.html#%E8%8F%9C%E5%8D%95
|
|
211
|
-
// 重置,增加,节点自由配置(以base节点为示例)
|
|
212
|
-
// lf.setMenuConfig({
|
|
213
|
-
// nodeMenu: [],
|
|
214
|
-
// edgeMenu: []
|
|
215
|
-
// })
|
|
216
|
-
// lf.addMenuConfig({
|
|
217
|
-
// nodeMenu: [
|
|
218
|
-
// {
|
|
219
|
-
// text: '分享',
|
|
220
|
-
// callback () {
|
|
221
|
-
// alert('分享成功!')
|
|
222
|
-
// }
|
|
223
|
-
// },
|
|
224
|
-
// {
|
|
225
|
-
// text: '属性',
|
|
226
|
-
// callback (node) {
|
|
227
|
-
// alert(`
|
|
228
|
-
// 节点id:${node.id}
|
|
229
|
-
// 节点类型:${node.type}
|
|
230
|
-
// 节点坐标:(x: ${node.x}, y: ${node.y})`
|
|
231
|
-
// )
|
|
232
|
-
// }
|
|
233
|
-
// }
|
|
234
|
-
// ],
|
|
235
|
-
// edgeMenu: [
|
|
236
|
-
// {
|
|
237
|
-
// text: '属性',
|
|
238
|
-
// callback (edge) {
|
|
239
|
-
// alert(`
|
|
240
|
-
// 边id:${edge.id}
|
|
241
|
-
// 边类型:${edge.type}
|
|
242
|
-
// 边坐标:(x: ${edge.x}, y: ${edge.y})
|
|
243
|
-
// 源节点id:${edge.sourceNodeId}
|
|
244
|
-
// 目标节点id:${edge.targetNodeId}`
|
|
245
|
-
// )
|
|
246
|
-
// }
|
|
247
|
-
// }
|
|
248
|
-
// ]
|
|
249
|
-
// })
|
|
250
|
-
// 设置主题
|
|
251
|
-
lf.setTheme({
|
|
252
|
-
circle: {
|
|
253
|
-
stroke: '#000000',
|
|
254
|
-
strokeWidth: 1,
|
|
255
|
-
outlineColor: '#88f'
|
|
256
|
-
},
|
|
257
|
-
rect: {
|
|
258
|
-
outlineColor: '#88f',
|
|
259
|
-
strokeWidth: 1
|
|
260
|
-
},
|
|
261
|
-
polygon: {
|
|
262
|
-
strokeWidth: 1
|
|
263
|
-
},
|
|
264
|
-
polyline: {
|
|
265
|
-
stroke: '#000000',
|
|
266
|
-
hoverStroke: '#000000',
|
|
267
|
-
selectedStroke: '#000000',
|
|
268
|
-
outlineColor: '#88f',
|
|
269
|
-
strokeWidth: 1
|
|
270
|
-
},
|
|
271
|
-
nodeText: {
|
|
272
|
-
fontSize: 16,
|
|
273
|
-
color: '#000000'
|
|
274
|
-
},
|
|
275
|
-
baseEdge: {
|
|
276
|
-
stroke: '#999',
|
|
277
|
-
strokeWidth: 2
|
|
278
|
-
},
|
|
279
|
-
edgeText: {
|
|
280
|
-
fontSize: 14,
|
|
281
|
-
color: '#000000',
|
|
282
|
-
background: {
|
|
283
|
-
fill: '#f7f9ff'
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
})
|
|
287
|
-
this.$_registerNode()
|
|
288
|
-
},
|
|
289
|
-
// 自定义
|
|
290
|
-
$_registerNode () {
|
|
291
|
-
registerStart(this.lf)
|
|
292
|
-
registerBase(this.lf, this.clickPlus, this.mouseDownPlus, this.showPropView)
|
|
293
|
-
registerEnd(this.lf)
|
|
294
|
-
registerStep(this.lf, this.clickPlus, this.mouseDownPlus, this.showPropView, this.showSimpleFormView)
|
|
295
|
-
registerPush(this.lf, this.clickPlus, this.mouseDownPlus)
|
|
296
|
-
registerDownload(this.lf)
|
|
297
|
-
registerPolyline(this.lf)
|
|
298
|
-
registerTask(this.lf)
|
|
299
|
-
registerConnect(this.lf)
|
|
300
|
-
|
|
301
|
-
registerBackEdge(this.lf)
|
|
302
|
-
this.$_render()
|
|
303
|
-
},
|
|
304
|
-
$_render () {
|
|
305
|
-
this.lf.render(demoData)
|
|
306
|
-
this.$_LfEvent()
|
|
307
|
-
},
|
|
308
|
-
$_getData () {
|
|
309
|
-
const data = this.lf.getGraphData()
|
|
310
|
-
console.log(JSON.stringify(data))
|
|
311
|
-
},
|
|
312
|
-
showPropView (node) {
|
|
313
|
-
this.$data.clickNode = node
|
|
314
|
-
this.$data.dialogVisible = true
|
|
315
|
-
},
|
|
316
|
-
showSimpleFormView (node) {
|
|
317
|
-
this.$data.clickNode = node
|
|
318
|
-
if (node.properties.formData) {
|
|
319
|
-
this.createFormNodeJson = node.properties.formData
|
|
320
|
-
} else {
|
|
321
|
-
this.createFormNodeJson = {
|
|
322
|
-
group: this.baseNodeName ? this.baseNodeName : '',
|
|
323
|
-
describe: node.text ? node.text.value : ''
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
this.$data.createSimpleFormVisible = true
|
|
327
|
-
},
|
|
328
|
-
$_LfEvent () {
|
|
329
|
-
this.lf.on('node:click', ({ data }) => {
|
|
330
|
-
this.selectNodeProperties = data.properties
|
|
331
|
-
})
|
|
332
|
-
this.lf.on('node:dbclick', ({ data }) => {})
|
|
333
|
-
this.lf.on('edge:dbclick', ({ data }) => {})
|
|
334
|
-
this.lf.on('element:click', () => {
|
|
335
|
-
this.hideAddPanel()
|
|
336
|
-
})
|
|
337
|
-
this.lf.on('edge:add', ({ data }) => {
|
|
338
|
-
console.log('edge:add', data)
|
|
339
|
-
})
|
|
340
|
-
this.lf.on('node:mousemove', ({ data }) => {
|
|
341
|
-
console.log('node:mousemove')
|
|
342
|
-
this.moveData = data
|
|
343
|
-
})
|
|
344
|
-
this.lf.on('blank:click', () => {
|
|
345
|
-
this.hideAddPanel()
|
|
346
|
-
})
|
|
347
|
-
this.lf.on('connection:not-allowed', (data) => {
|
|
348
|
-
this.$message.error(data.msg)
|
|
349
|
-
})
|
|
350
|
-
this.lf.on('node:mousemove', () => {
|
|
351
|
-
console.log('on mousemove')
|
|
352
|
-
})
|
|
353
|
-
},
|
|
354
|
-
clickPlus (e, attributes, addNodeList) {
|
|
355
|
-
e.stopPropagation()
|
|
356
|
-
const { clientX, clientY } = e
|
|
357
|
-
console.log(clientX, clientY)
|
|
358
|
-
this.$data.addPanelStyle.top = (clientY - 180) + 'px'
|
|
359
|
-
this.$data.addPanelStyle.left = (clientX - 260) + 'px'
|
|
360
|
-
this.$data.addNodeList = addNodeList
|
|
361
|
-
this.$data.showAddPanel = true
|
|
362
|
-
this.$data.addClickNode = attributes
|
|
363
|
-
},
|
|
364
|
-
mouseDownPlus (e, attributes) {
|
|
365
|
-
e.stopPropagation()
|
|
366
|
-
console.log('mouseDownPlus', e, attributes)
|
|
367
|
-
},
|
|
368
|
-
hideAddPanel () {
|
|
369
|
-
this.$data.showAddPanel = false
|
|
370
|
-
this.$data.addPanelStyle.top = 0
|
|
371
|
-
this.$data.addPanelStyle.left = 0
|
|
372
|
-
// this.$data.addClickNode = null
|
|
373
|
-
console.warn(this.$data)
|
|
374
|
-
},
|
|
375
|
-
closeDialog () {
|
|
376
|
-
this.$data.dialogVisible = false
|
|
377
|
-
},
|
|
378
|
-
$_catData () {
|
|
379
|
-
this.$data.graphData = this.$data.lf.getGraphData()
|
|
380
|
-
this.$data.dataVisible = true
|
|
381
|
-
},
|
|
382
|
-
$_catRealData () {
|
|
383
|
-
const data = this.$data.lf.getGraphData()
|
|
384
|
-
const nodeMap = {}
|
|
385
|
-
this.allNodeList = []
|
|
386
|
-
let baseNode = null
|
|
387
|
-
for (const node of data.nodes) {
|
|
388
|
-
if (node.type === 'step' && !node.properties.id) {
|
|
389
|
-
if (node.text) {
|
|
390
|
-
this.$message.error('节点[' + node.text.value + ']没有设置ID')
|
|
391
|
-
} else {
|
|
392
|
-
this.$message.error('节点需要设置名称')
|
|
393
|
-
}
|
|
394
|
-
return
|
|
395
|
-
}
|
|
396
|
-
const item = {
|
|
397
|
-
id: node.properties.id,
|
|
398
|
-
type: node.type,
|
|
399
|
-
properties: node.properties,
|
|
400
|
-
name: node.text ? node.text.value : ''
|
|
401
|
-
}
|
|
402
|
-
if (item.type === 'base') {
|
|
403
|
-
baseNode = item
|
|
404
|
-
continue
|
|
405
|
-
}
|
|
406
|
-
nodeMap[node.id] = item
|
|
407
|
-
if (node.properties.id) {
|
|
408
|
-
this.allNodeList[node.properties.id] = item
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
if (!baseNode) {
|
|
412
|
-
this.$message.error('请设置流程根节点[基础]')
|
|
413
|
-
return
|
|
414
|
-
}
|
|
415
|
-
this.allNodeList.shift()
|
|
416
|
-
const submitList = []
|
|
417
|
-
const backList = []
|
|
418
|
-
const skipList = []
|
|
419
|
-
for (const edge of data.edges) {
|
|
420
|
-
const id = nodeMap[edge.sourceNodeId].properties.id
|
|
421
|
-
const toId = nodeMap[edge.targetNodeId].properties.id
|
|
422
|
-
let type
|
|
423
|
-
if (id && toId) {
|
|
424
|
-
if (toId - id === 1) {
|
|
425
|
-
type = 'submit'
|
|
426
|
-
} else if (id - toId === 1) {
|
|
427
|
-
type = 'back'
|
|
428
|
-
} else if (toId - id > 1) {
|
|
429
|
-
type = 'skip'
|
|
430
|
-
} else if (id - toId > 1) {
|
|
431
|
-
this.$message.error('错误的流程连接[id:' + id + ', to_id:' + toId + '],每次只能退回一个步骤')
|
|
432
|
-
return
|
|
433
|
-
} else {
|
|
434
|
-
this.$message.error('错误的流程连接[id:' + id + ', to_id:' + toId + ']')
|
|
435
|
-
return
|
|
436
|
-
}
|
|
437
|
-
const item = {
|
|
438
|
-
id: id,
|
|
439
|
-
to: toId
|
|
440
|
-
}
|
|
441
|
-
if (type === 'submit') {
|
|
442
|
-
submitList.push(item)
|
|
443
|
-
} else if (type === 'back') {
|
|
444
|
-
backList.push(item)
|
|
445
|
-
} else {
|
|
446
|
-
skipList.push(item)
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
this.baseNodeName = baseNode.properties.text
|
|
452
|
-
|
|
453
|
-
let xml = '<?xml version="1.0" encoding="utf-8"?>'
|
|
454
|
-
xml += '<WorkflowDiagram id="' + baseNode.properties.id + '" name="' + baseNode.properties.text + '">'
|
|
455
|
-
|
|
456
|
-
for (const item of baseNode.properties.propArray) {
|
|
457
|
-
xml += '<Var name="' + item.name + '" id="' + item.id + '" description="' + item.description + '" />'
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
xml += '<Actor id="' + baseNode.properties.personId + '" name="' + baseNode.properties.personName + '">'
|
|
461
|
-
|
|
462
|
-
for (const node of this.allNodeList) {
|
|
463
|
-
let personexpression
|
|
464
|
-
if (node.properties.name.length === 1) {
|
|
465
|
-
personexpression = 'R(' + node.properties.name[0] + ')'
|
|
466
|
-
} else if (node.properties.name.length > 1) {
|
|
467
|
-
personexpression = 'RS('
|
|
468
|
-
for (const nameItem of node.properties.name) {
|
|
469
|
-
personexpression += (nameItem + ',')
|
|
470
|
-
}
|
|
471
|
-
personexpression = personexpression.substring(0, personexpression.length - 1)
|
|
472
|
-
personexpression += ')'
|
|
473
|
-
} else {
|
|
474
|
-
personexpression = ''
|
|
475
|
-
}
|
|
476
|
-
let timeoutExp
|
|
477
|
-
if (node.properties.timeout) {
|
|
478
|
-
timeoutExp = 'timeout="HH(' + node.properties.timeout + ')" '
|
|
479
|
-
} else {
|
|
480
|
-
timeoutExp = ''
|
|
481
|
-
}
|
|
482
|
-
const activity = '<Activity id="' + node.id + '" name="' + node.name + '" personexpression="' + personexpression + '" ' + timeoutExp + '/>'
|
|
483
|
-
xml += activity
|
|
484
|
-
}
|
|
485
|
-
xml += '</Actor>'
|
|
486
|
-
xml += '<!-- 报建流程 -->'
|
|
487
|
-
for (const id in submitList) {
|
|
488
|
-
const edge = submitList[id]
|
|
489
|
-
const diversion = '<Diversion id="' + edge.id + '" head="' + edge.id + '" tail="' + edge.to + '" expression="subedp == $提交$" />'
|
|
490
|
-
xml += diversion
|
|
491
|
-
}
|
|
492
|
-
for (const id in skipList) {
|
|
493
|
-
const edge = skipList[id]
|
|
494
|
-
const diversion = '<Diversion id="' + edge.id + '" head="' + edge.id + '" tail="' + edge.to + '" expression="subedp == $跳过$" />'
|
|
495
|
-
xml += diversion
|
|
496
|
-
}
|
|
497
|
-
for (const id in backList) {
|
|
498
|
-
const edge = backList[id]
|
|
499
|
-
const diversion = '<Diversion id="' + edge.to + '" head="' + edge.id + '" tail="' + edge.to + '" expression="subedp == $退回$" />'
|
|
500
|
-
xml += diversion
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
xml += '</WorkflowDiagram>'
|
|
504
|
-
this.$data.graphRealData = showXml(xml)
|
|
505
|
-
this.$data.realDataVisible = true
|
|
506
|
-
},
|
|
507
|
-
saveData () {
|
|
508
|
-
// 存储流程
|
|
509
|
-
const blob = new Blob([this.graphRealData], { type: 'application/xml' })
|
|
510
|
-
FileSaver.saveAs(blob, this.baseNodeName + `.xml`)
|
|
511
|
-
},
|
|
512
|
-
// 存储基础表单配置信息
|
|
513
|
-
saveSimpleFormQueryParams (source) {
|
|
514
|
-
const properties = Object.assign(this.lf.getProperties(this.clickNode.id), {
|
|
515
|
-
formData: source
|
|
516
|
-
})
|
|
517
|
-
this.lf.setProperties(this.clickNode.id, properties)
|
|
518
|
-
this.$message.success('保存表单成功!')
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
</script>
|
|
523
|
-
<style>
|
|
524
|
-
.logic-flow-view {
|
|
525
|
-
height: 100vh;
|
|
526
|
-
position: relative;
|
|
527
|
-
}
|
|
528
|
-
.demo-title{
|
|
529
|
-
text-align: center;
|
|
530
|
-
margin: 20px;
|
|
531
|
-
}
|
|
532
|
-
.demo-control{
|
|
533
|
-
position: absolute;
|
|
534
|
-
top: 50px;
|
|
535
|
-
right: 0;
|
|
536
|
-
z-index: 2;
|
|
537
|
-
}
|
|
538
|
-
.demo-card{
|
|
539
|
-
background-color: rgba(255,255,255,0.2);
|
|
540
|
-
position: absolute;
|
|
541
|
-
width: 250px;
|
|
542
|
-
top: 85px;
|
|
543
|
-
right: 10px;
|
|
544
|
-
z-index: 2;
|
|
545
|
-
}
|
|
546
|
-
#LF-view{
|
|
547
|
-
width: calc(100%);
|
|
548
|
-
height: 100%;
|
|
549
|
-
outline: none;
|
|
550
|
-
}
|
|
551
|
-
.time-plus{
|
|
552
|
-
cursor: pointer;
|
|
553
|
-
}
|
|
554
|
-
.add-panel {
|
|
555
|
-
position: absolute;
|
|
556
|
-
z-index: 11;
|
|
557
|
-
background-color: white;
|
|
558
|
-
padding: 10px 5px;
|
|
559
|
-
}
|
|
560
|
-
.el-drawer__body {
|
|
561
|
-
height: 80%;
|
|
562
|
-
overflow: auto;
|
|
563
|
-
margin-top: -30px;
|
|
564
|
-
z-index: 3;
|
|
565
|
-
}
|
|
566
|
-
.lf-element-text {
|
|
567
|
-
font-weight: bold;
|
|
568
|
-
z-index: 99999;
|
|
569
|
-
}
|
|
570
|
-
</style>
|