Commit f407ab25f0817e5b0501b1d22e23c7551708e5c8
Merge branch 'main' of git.yuntengiot.com:huang/thingskit-drawio
Showing
9 changed files
with
149 additions
and
99 deletions
Too many changes to show.
To preserve performance only 9 of 12 files are displayed.
.idea/.gitignore
deleted
100644 → 0
.idea/azure/azureSettings.xml
deleted
100644 → 0
1 | -<?xml version="1.0" encoding="UTF-8"?> | |
2 | -<project version="4"> | |
3 | - <component name="AzureSettings"> | |
4 | - <option name="appInsights" value="rO0ABXVyAEtbTGNvbS5taWNyb3NvZnQuYXBwbGljYXRpb25pbnNpZ2h0cy5wcmVmZXJlbmNlLkFwcGxpY2F0aW9uSW5zaWdodHNSZXNvdXJjZTvCzxEP0C2HbAIAAHhwAAAAAA==" /> | |
5 | - </component> | |
6 | -</project> | |
\ No newline at end of file |
.idea/google-java-format.xml
deleted
100644 → 0
.idea/modules.xml
deleted
100644 → 0
1 | -<?xml version="1.0" encoding="UTF-8"?> | |
2 | -<project version="4"> | |
3 | - <component name="ProjectModuleManager"> | |
4 | - <modules> | |
5 | - <module fileurl="file://$PROJECT_DIR$/.idea/thingskit-drawio.iml" filepath="$PROJECT_DIR$/.idea/thingskit-drawio.iml" /> | |
6 | - </modules> | |
7 | - </component> | |
8 | -</project> | |
\ No newline at end of file |
.idea/runConfigurations.xml
deleted
100644 → 0
1 | -<?xml version="1.0" encoding="UTF-8"?> | |
2 | -<project version="4"> | |
3 | - <component name="RunConfigurationProducerService"> | |
4 | - <option name="ignoredProducers"> | |
5 | - <set> | |
6 | - <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" /> | |
7 | - </set> | |
8 | - </option> | |
9 | - </component> | |
10 | -</project> | |
\ No newline at end of file |
.idea/thingskit-drawio.iml
deleted
100644 → 0
1 | -<?xml version="1.0" encoding="UTF-8"?> | |
2 | -<module type="JAVA_MODULE" version="4"> | |
3 | - <component name="NewModuleRootManager" inherit-compiler-output="true"> | |
4 | - <exclude-output /> | |
5 | - <content url="file://$MODULE_DIR$" /> | |
6 | - <orderEntry type="inheritedJdk" /> | |
7 | - <orderEntry type="sourceFolder" forTests="false" /> | |
8 | - </component> | |
9 | -</module> | |
\ No newline at end of file |
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <meta name="Keywords" content="diagram, online, flow chart, flowchart maker, uml, erd"> |
10 | 10 | <meta itemprop="name" content="diagrams.net - free flowchart maker and diagrams online"> |
11 | 11 | <meta itemprop="description" content="diagrams.net is a free online diagramming application and flowchart maker . You can use it to create UML, entity relationship, |
12 | - org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic | |
12 | + org charts, BPMN and BPM, database schema and networks. Also possible are telecommunication network, workflow, flowcharts, maps overlays and GIS, electronic | |
13 | 13 | circuit and social network diagrams."> |
14 | 14 | <meta itemprop="image" content="https://lh4.googleusercontent.com/-cLKEldMbT_E/Tx8qXDuw6eI/AAAAAAAAAAs/Ke0pnlk8Gpg/w500-h344-k/BPMN%2Bdiagram%2Brc2f.png"> |
15 | 15 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> |
... | ... | @@ -17,18 +17,25 @@ |
17 | 17 | <meta name="mobile-web-app-capable" content="yes"> |
18 | 18 | <meta name="theme-color" content="#d89000"> |
19 | 19 | <script src="./plugins/axios.min.js"></script> |
20 | - <script src="./js/jquery/jquery-3.3.1.min.js"></script> | |
21 | - <script src="./js/jquery.easyui.min.js"></script> | |
20 | +<!-- <script src="./js/jquery/jquery-3.3.1.min.js"></script>--> | |
21 | +<!-- <script src="./js/jquery.easyui.min.js"></script>--> | |
22 | 22 | <link rel="stylesheet" href="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/css/layui.min.css" integrity="sha512-iQBJbsNHXUcgEIgWThd2dr8tOdKPvICwqjPEZYY81z3eMya44A5MiAqfWSCh+Ee1YzNYkdrI982Qhwgr8LEYOQ==" crossorigin="anonymous" referrerpolicy="no-referrer" /> |
23 | 23 | <script src="https://cdnjs.loli.net/ajax/libs/layui/2.6.8/layui.min.js" integrity="sha512-EKrFvch3qTzLFQgjbcjpsRmF8T3UCtc9ojtMAu6dvvP+bV8qYUDOaQ84nwYCkSLT7lbqGoya/Kf+8fyCBE0vRg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> |
24 | - | |
24 | + | |
25 | + <!-- 引入修改样式 --> | |
26 | + <link rel="stylesheet" href="./styles/formatChange.css"> | |
27 | + | |
25 | 28 | <!-- 引入select.zTree及相关依赖 --> |
26 | - <link rel="stylesheet" href="./styles/zTreeStyle.css" type="text/css"> | |
27 | - <link rel="stylesheet" href="./styles/jquery.select.zTree.v1.5.css" type="text/css"> | |
28 | - <script type="text/javascript" src="./js/jquery.ztree.core.min.js"></script> | |
29 | - <script type="text/javascript" src="./js/jquery.ztree.exhide.min.js"></script> | |
30 | - <script type="text/javascript" src="./js/jquery.select.zTree.v1.5.min.js"></script> | |
29 | +<!-- <link rel="stylesheet" href="./styles/zTreeStyle.css" type="text/css">--> | |
30 | +<!-- <link rel="stylesheet" href="./styles/jquery.select.zTree.v1.5.css" type="text/css">--> | |
31 | +<!-- <script type="text/javascript" src="./js/jquery.ztree.core.min.js"></script>--> | |
32 | +<!-- <script type="text/javascript" src="./js/jquery.ztree.exhide.min.js"></script>--> | |
33 | +<!-- <script type="text/javascript" src="./js/jquery.select.zTree.v1.5.min.js"></script>--> | |
34 | + | |
35 | +<!-- Axios --> | |
31 | 36 | <script src="./plugins/defHttp.js"></script> |
37 | + | |
38 | + <script src="./js/api/index.js"></script> | |
32 | 39 | |
33 | 40 | <script type="text/javascript"> |
34 | 41 | /** |
... | ... | @@ -54,27 +61,27 @@ |
54 | 61 | { |
55 | 62 | var result = new Object(); |
56 | 63 | var params = window.location.search.slice(1).split('&'); |
57 | - | |
64 | + | |
58 | 65 | for (var i = 0; i < params.length; i++) |
59 | 66 | { |
60 | 67 | var idx = params[i].indexOf('='); |
61 | - | |
68 | + | |
62 | 69 | if (idx > 0) |
63 | 70 | { |
64 | 71 | result[params[i].substring(0, idx)] = params[i].substring(idx + 1); |
65 | 72 | } |
66 | 73 | } |
67 | - | |
74 | + | |
68 | 75 | return result; |
69 | 76 | })(); |
70 | - | |
77 | + | |
71 | 78 | // Forces CDN caches by passing URL parameters via URL hash |
72 | 79 | if (window.location.hash != null && window.location.hash.substring(0, 2) == '#P') |
73 | 80 | { |
74 | 81 | try |
75 | 82 | { |
76 | 83 | urlParams = JSON.parse(decodeURIComponent(window.location.hash.substring(2))); |
77 | - | |
84 | + | |
78 | 85 | if (urlParams.hash != null) |
79 | 86 | { |
80 | 87 | window.location.hash = urlParams.hash; |
... | ... | @@ -85,7 +92,7 @@ |
85 | 92 | // ignore |
86 | 93 | } |
87 | 94 | } |
88 | - | |
95 | + | |
89 | 96 | // Global variable for desktop |
90 | 97 | var mxIsElectron = window && window.process && window.process.type; |
91 | 98 | |
... | ... | @@ -95,21 +102,21 @@ |
95 | 102 | (function() |
96 | 103 | { |
97 | 104 | var proto = window.location.protocol; |
98 | - | |
105 | + | |
99 | 106 | if (!mxIsElectron) |
100 | 107 | { |
101 | 108 | var host = window.location.host; |
102 | - | |
109 | + | |
103 | 110 | // Redirects apex, drive and rt to www |
104 | 111 | if (host === 'draw.io' || host === 'rt.draw.io' || host === 'drive.draw.io') |
105 | 112 | { |
106 | 113 | host = 'www.draw.io'; |
107 | 114 | } |
108 | - | |
115 | + | |
109 | 116 | var href = proto + '//' + host + window.location.href.substring( |
110 | 117 | window.location.protocol.length + |
111 | 118 | window.location.host.length + 2); |
112 | - | |
119 | + | |
113 | 120 | // Redirects if href changes |
114 | 121 | if (href != window.location.href) |
115 | 122 | { |
... | ... | @@ -118,7 +125,7 @@ |
118 | 125 | } |
119 | 126 | })(); |
120 | 127 | } |
121 | - | |
128 | + | |
122 | 129 | /** |
123 | 130 | * Adds meta tag to the page. |
124 | 131 | */ |
... | ... | @@ -127,15 +134,15 @@ |
127 | 134 | try |
128 | 135 | { |
129 | 136 | var s = document.createElement('meta'); |
130 | - | |
131 | - if (name != null) | |
137 | + | |
138 | + if (name != null) | |
132 | 139 | { |
133 | 140 | s.setAttribute('name', name); |
134 | 141 | } |
135 | 142 | |
136 | 143 | s.setAttribute('content', content); |
137 | - | |
138 | - if (httpEquiv != null) | |
144 | + | |
145 | + if (httpEquiv != null) | |
139 | 146 | { |
140 | 147 | s.setAttribute('http-equiv', httpEquiv); |
141 | 148 | } |
... | ... | @@ -148,14 +155,14 @@ |
148 | 155 | // ignore |
149 | 156 | } |
150 | 157 | }; |
151 | - | |
158 | + | |
152 | 159 | /** |
153 | 160 | * Synchronously adds scripts to the page. |
154 | 161 | */ |
155 | 162 | function mxscript(src, onLoad, id, dataAppKey, noWrite) |
156 | 163 | { |
157 | 164 | var defer = onLoad == null && !noWrite; |
158 | - | |
165 | + | |
159 | 166 | if ((urlParams['dev'] != '1' && typeof document.createElement('canvas').getContext === "function") || |
160 | 167 | onLoad != null || noWrite) |
161 | 168 | { |
... | ... | @@ -168,16 +175,16 @@ |
168 | 175 | { |
169 | 176 | s.setAttribute('id', id); |
170 | 177 | } |
171 | - | |
178 | + | |
172 | 179 | if (dataAppKey != null) |
173 | 180 | { |
174 | 181 | s.setAttribute('data-app-key', dataAppKey); |
175 | 182 | } |
176 | - | |
183 | + | |
177 | 184 | if (onLoad != null) |
178 | 185 | { |
179 | 186 | var r = false; |
180 | - | |
187 | + | |
181 | 188 | s.onload = s.onreadystatechange = function() |
182 | 189 | { |
183 | 190 | if (!r && (!this.readyState || this.readyState == 'complete')) |
... | ... | @@ -187,9 +194,9 @@ |
187 | 194 | } |
188 | 195 | }; |
189 | 196 | } |
190 | - | |
197 | + | |
191 | 198 | var t = document.getElementsByTagName('script')[0]; |
192 | - | |
199 | + | |
193 | 200 | if (t != null) |
194 | 201 | { |
195 | 202 | t.parentNode.insertBefore(s, t); |
... | ... | @@ -211,11 +218,11 @@ |
211 | 218 | g.type = 'text/javascript'; |
212 | 219 | g.async = true; |
213 | 220 | g.src = src; |
214 | - | |
221 | + | |
215 | 222 | var s = document.getElementsByTagName('script')[0]; |
216 | 223 | s.parentNode.insertBefore(g, s); |
217 | 224 | }; |
218 | - | |
225 | + | |
219 | 226 | /** |
220 | 227 | * Adds meta tags with application name (depends on offline URL parameter) |
221 | 228 | */ |
... | ... | @@ -230,10 +237,10 @@ |
230 | 237 | mxmeta(null, 'default-src \'self\' \'unsafe-inline\'; connect-src \'self\' https://*.draw.io https://fonts.googleapis.com https://fonts.gstatic.com; img-src * data:; media-src *; font-src *; style-src-elem \'self\' \'unsafe-inline\' https://fonts.googleapis.com', 'Content-Security-Policy'); |
231 | 238 | } |
232 | 239 | })(); |
233 | - | |
240 | + | |
234 | 241 | // Checks for local storage |
235 | 242 | var isLocalStorage = false; |
236 | - | |
243 | + | |
237 | 244 | try |
238 | 245 | { |
239 | 246 | isLocalStorage = urlParams['local'] != '1' && typeof(localStorage) != 'undefined'; |
... | ... | @@ -244,15 +251,15 @@ |
244 | 251 | } |
245 | 252 | |
246 | 253 | var mxScriptsLoaded = false, mxWinLoaded = false; |
247 | - | |
254 | + | |
248 | 255 | function checkAllLoaded() |
249 | 256 | { |
250 | 257 | if (mxScriptsLoaded && mxWinLoaded) |
251 | 258 | { |
252 | - App.main(); | |
259 | + App.main(); | |
253 | 260 | } |
254 | 261 | }; |
255 | - | |
262 | + | |
256 | 263 | var t0 = new Date(); |
257 | 264 | |
258 | 265 | // Changes paths for local development environment |
... | ... | @@ -260,18 +267,18 @@ |
260 | 267 | { |
261 | 268 | // Used to request grapheditor/mxgraph sources in dev mode |
262 | 269 | var mxDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main'; |
263 | - | |
270 | + | |
264 | 271 | // Used to request draw.io sources in dev mode |
265 | 272 | var drawDevUrl = document.location.protocol + '//devhost.jgraph.com/drawio/src/main/webapp/'; |
266 | 273 | var geBasePath = drawDevUrl + '/js/grapheditor'; |
267 | 274 | var mxBasePath = mxDevUrl + '/mxgraph'; |
268 | - | |
275 | + | |
269 | 276 | if (document.location.protocol == 'file:') |
270 | 277 | { |
271 | 278 | geBasePath = './js/grapheditor'; |
272 | 279 | mxBasePath = './mxgraph'; |
273 | 280 | drawDevUrl = './'; |
274 | - | |
281 | + | |
275 | 282 | // Forces includes for dev environment in node.js |
276 | 283 | mxForceIncludes = true; |
277 | 284 | } |
... | ... | @@ -287,19 +294,19 @@ |
287 | 294 | mxscript(drawDevUrl + 'js/diagramly/Init.js'); |
288 | 295 | mxscript(geBasePath + '/Init.js'); |
289 | 296 | mxscript(mxBasePath + '/mxClient.js'); |
290 | - | |
297 | + | |
291 | 298 | // Adds all JS code that depends on mxClient. This indirection via Devel.js is |
292 | 299 | // required in some browsers to make sure mxClient.js (and the files that it |
293 | 300 | // loads asynchronously) are available when the code loaded in Devel.js runs. |
294 | 301 | mxscript(drawDevUrl + 'js/diagramly/Devel.js'); |
295 | - | |
302 | + | |
296 | 303 | // Electron |
297 | 304 | if (mxIsElectron) |
298 | 305 | { |
299 | 306 | mxscript('js/diagramly/DesktopLibrary.js'); |
300 | 307 | mxscript('js/diagramly/ElectronApp.js'); |
301 | 308 | } |
302 | - | |
309 | + | |
303 | 310 | mxscript(drawDevUrl + 'js/PostConfig.js'); |
304 | 311 | } |
305 | 312 | else |
... | ... | @@ -307,18 +314,18 @@ |
307 | 314 | (function() |
308 | 315 | { |
309 | 316 | var hostName = window.location.hostname; |
310 | - | |
317 | + | |
311 | 318 | // Supported domains are *.draw.io and the packaged version in Quip |
312 | 319 | var supportedDomain = (hostName.substring(hostName.length - 8, hostName.length) === '.draw.io') || |
313 | 320 | (hostName.substring(hostName.length - 13, hostName.length) === '.diagrams.net'); |
314 | - | |
321 | + | |
315 | 322 | function loadAppJS() |
316 | 323 | { |
317 | 324 | mxscript('js/app.min.js', function() |
318 | 325 | { |
319 | 326 | mxScriptsLoaded = true; |
320 | 327 | checkAllLoaded(); |
321 | - | |
328 | + | |
322 | 329 | // Electron |
323 | 330 | if (mxIsElectron) |
324 | 331 | { |
... | ... | @@ -345,7 +352,7 @@ |
345 | 352 | } |
346 | 353 | }); |
347 | 354 | }; |
348 | - | |
355 | + | |
349 | 356 | if (!supportedDomain || mxIsElectron) |
350 | 357 | { |
351 | 358 | mxscript('js/PreConfig.js', loadAppJS); |
... | ... | @@ -361,7 +368,7 @@ |
361 | 368 | window.onerror = function() |
362 | 369 | { |
363 | 370 | var status = document.getElementById('geStatus'); |
364 | - | |
371 | + | |
365 | 372 | if (status != null) |
366 | 373 | { |
367 | 374 | status.innerHTML = 'Page could not be loaded. Please try refreshing.'; |
... | ... | @@ -461,7 +468,7 @@ if (navigator.userAgent != null && navigator.userAgent.toLowerCase(). |
461 | 468 | { |
462 | 469 | // Redirects old Electron app to latest version |
463 | 470 | var div = document.getElementById('geInfo'); |
464 | - | |
471 | + | |
465 | 472 | if (div != null) |
466 | 473 | { |
467 | 474 | div.innerHTML = '<center><h2>You are using an out of date version of this app.<br>Please download the latest version ' + | ... | ... |
src/main/webapp/js/api/index.js
0 → 100644
1 | +class ConfigurationNodeApi { | |
2 | + /** | |
3 | + * @description 获取组态信息 | |
4 | + * @param {'CONFIGURE' | 'CONTENT' | 'NODE'} levelType - 组态资源类型 | |
5 | + * @param {string} levelId - 组态资源ID | |
6 | + */ | |
7 | + static getConfigurationInfo(levelType, levelId) { | |
8 | + return defHttp.get(`/yt/configuration/node/${levelType}/${levelId}`) | |
9 | + } | |
10 | + | |
11 | + /** | |
12 | + * @description 获取组织节点树 | |
13 | + * @returns | |
14 | + */ | |
15 | + static getOrgTree() { | |
16 | + return defHttp.get('/yt/organization/me/list') | |
17 | + } | |
18 | + | |
19 | + /** | |
20 | + * @description 通过设备ID 获取 设备属性 | |
21 | + * @param tbDeviceId | |
22 | + * @returns {Promise<*>} | |
23 | + */ | |
24 | + static getDeviceAttr(tbDeviceId) { | |
25 | + return defHttp.get(`/plugins/telemetry/DEVICE/${tbDeviceId}/keys/timeseries`) | |
26 | + } | |
27 | + | |
28 | + /** | |
29 | + * @description 获取组织下的设备 | |
30 | + * @param {'DIRECT_CONNECTION' | 'GATEWAY' | 'SENDOR'} deviceType - 'DIRECT_CONNECTION' 直连设备 'GATEWAY' 网关设备 'SENDOR' 传感器 | |
31 | + * @param {string} orgId - 组织ID | |
32 | + * @returns {Promise<*>} | |
33 | + */ | |
34 | + static getDeviceUnderTheOrg(deviceType, orgId) { | |
35 | + return defHttp.get(`/yt/device/list/${deviceType}?organizationId=${orgId}`) | |
36 | + } | |
37 | + | |
38 | + /** | |
39 | + * @description 查询设备的子设备 | |
40 | + * @param deviceId 设备ID | |
41 | + * @returns {Promise<*>} | |
42 | + */ | |
43 | + static getDeviceChildDevice(deviceId) { | |
44 | + return defHttp.get(`/yt/device/relation?page=1&pageSize=10&fromId=${deviceId}`) | |
45 | + } | |
46 | + | |
47 | + /** | |
48 | + * @description 查询所有主设备列表 | |
49 | + * @param orgId | |
50 | + * @returns {Promise<*>} | |
51 | + */ | |
52 | + static getMasterDevice(orgId) { | |
53 | + return defHttp.get(`/yt/device/list/master/${orgId}`) | |
54 | + } | |
55 | + | |
56 | + /** | |
57 | + * @description 查询所有从设备 | |
58 | + * @param orgId | |
59 | + * @param masterDeviceId | |
60 | + * @returns {Promise<*>} | |
61 | + */ | |
62 | + static getSlaveDevice(orgId, masterDeviceId) { | |
63 | + return defHttp.get(`/yt/device/list/slave/${orgId}?masterId=${masterDeviceId}`) | |
64 | + } | |
65 | + | |
66 | + /** | |
67 | + * @description 编辑数据交互 | |
68 | + */ | |
69 | + static updateNodeEvent(data) { | |
70 | + return defHttp.post('/yt/configuration/node/event', data) | |
71 | + } | |
72 | + | |
73 | + /** | |
74 | + * @description 编辑动画效果 | |
75 | + * @param {*} data | |
76 | + * @returns | |
77 | + */ | |
78 | + static updateNodeAct(data) { | |
79 | + return defHttp.post('/yt/configuration/node/act', data) | |
80 | + } | |
81 | + | |
82 | + /** | |
83 | + * @description 更新节点绑定信息 | |
84 | + * @param {*} data | |
85 | + * @returns | |
86 | + */ | |
87 | + static updateNodeInfo(data) { | |
88 | + return defHttp.post('/yt/configuration/node', data) | |
89 | + } | |
90 | +} | ... | ... |