Showing
7 changed files
with
154 additions
and
55 deletions
No preview for this file type
@@ -5839,7 +5839,7 @@ App.prototype.updateButtonContainer = function() | @@ -5839,7 +5839,7 @@ App.prototype.updateButtonContainer = function() | ||
5839 | { | 5839 | { |
5840 | if (this.shareButton == null) | 5840 | if (this.shareButton == null) |
5841 | { | 5841 | { |
5842 | - // TODO 预览模式按钮 | 5842 | + // TODO thingsKit 预览模式按钮 |
5843 | this.shareButton = document.createElement('div'); | 5843 | this.shareButton = document.createElement('div'); |
5844 | this.shareButton.className = 'geBtn gePrimaryBtn'; | 5844 | this.shareButton.className = 'geBtn gePrimaryBtn'; |
5845 | this.shareButton.style.display = 'inline-block'; | 5845 | this.shareButton.style.display = 'inline-block'; |
@@ -4594,7 +4594,8 @@ | @@ -4594,7 +4594,8 @@ | ||
4594 | 4594 | ||
4595 | if (Object.getOwnPropertyNames != null && Object.getOwnPropertyNames(properties).length > 0) | 4595 | if (Object.getOwnPropertyNames != null && Object.getOwnPropertyNames(properties).length > 0) |
4596 | { | 4596 | { |
4597 | - this.container.appendChild(this.addProperties(this.createPanel(), properties, sstate)); | 4597 | + // TODO thingsKit 隐藏属性 |
4598 | + // this.container.appendChild(this.addProperties(this.createPanel(), properties, sstate)); | ||
4598 | } | 4599 | } |
4599 | } | 4600 | } |
4600 | }; | 4601 | }; |
@@ -1203,7 +1203,7 @@ | @@ -1203,7 +1203,7 @@ | ||
1203 | // in older browsers. URL param has precedence over the saved setting. | 1203 | // in older browsers. URL param has precedence over the saved setting. |
1204 | if (mxClient.IS_CHROMEAPP || isLocalStorage) | 1204 | if (mxClient.IS_CHROMEAPP || isLocalStorage) |
1205 | { | 1205 | { |
1206 | - // TODO switch language 切换语言按钮 多语言切换 | 1206 | + // TODO thingsKit switch language 切换语言按钮 多语言切换 |
1207 | // this.put('language', new Menu(mxUtils.bind(this, function(menu, parent) | 1207 | // this.put('language', new Menu(mxUtils.bind(this, function(menu, parent) |
1208 | // { | 1208 | // { |
1209 | // var addLangItem = mxUtils.bind(this, function (id) | 1209 | // var addLangItem = mxUtils.bind(this, function (id) |
@@ -3718,10 +3718,15 @@ | @@ -3718,10 +3718,15 @@ | ||
3718 | // Overrides edit menu to add find, copyAsImage editGeometry | 3718 | // Overrides edit menu to add find, copyAsImage editGeometry |
3719 | this.put('edit', new Menu(mxUtils.bind(this, function(menu, parent) | 3719 | this.put('edit', new Menu(mxUtils.bind(this, function(menu, parent) |
3720 | { | 3720 | { |
3721 | + // TODO thingsKit 隐藏 编辑菜单中的编辑数据 | ||
3721 | this.addMenuItems(menu, ['undo', 'redo', '-', 'cut', 'copy', 'copyAsImage', 'paste', | 3722 | this.addMenuItems(menu, ['undo', 'redo', '-', 'cut', 'copy', 'copyAsImage', 'paste', |
3722 | - 'delete', '-', 'duplicate', '-', 'findReplace', '-', 'editData', 'editTooltip', '-', | 3723 | + 'delete', '-', 'duplicate', '-', 'findReplace', '-', 'editTooltip', '-', |
3723 | 'editStyle', 'editGeometry', '-', 'edit', '-', 'editLink', 'openLink', '-', | 3724 | 'editStyle', 'editGeometry', '-', 'edit', '-', 'editLink', 'openLink', '-', |
3724 | - 'selectVertices', 'selectEdges', 'selectAll', 'selectNone', '-', 'lockUnlock']); | 3725 | + 'selectVertices', 'selectEdges', 'selectAll', 'selectNone', '-', 'lockUnlock']); |
3726 | + // this.addMenuItems(menu, ['undo', 'redo', '-', 'cut', 'copy', 'copyAsImage', 'paste', | ||
3727 | + // 'delete', '-', 'duplicate', '-', 'findReplace', '-', 'editData', 'editTooltip', '-', | ||
3728 | + // 'editStyle', 'editGeometry', '-', 'edit', '-', 'editLink', 'openLink', '-', | ||
3729 | + // 'selectVertices', 'selectEdges', 'selectAll', 'selectNone', '-', 'lockUnlock']); | ||
3725 | }))); | 3730 | }))); |
3726 | 3731 | ||
3727 | var action = editorUi.actions.addAction('comments', mxUtils.bind(this, function() | 3732 | var action = editorUi.actions.addAction('comments', mxUtils.bind(this, function() |
@@ -3795,12 +3800,13 @@ | @@ -3795,12 +3800,13 @@ | ||
3795 | 3800 | ||
3796 | if (isLocalStorage || mxClient.IS_CHROMEAPP) | 3801 | if (isLocalStorage || mxClient.IS_CHROMEAPP) |
3797 | { | 3802 | { |
3798 | - var item = this.addMenuItem(menu, 'scratchpad', parent); | ||
3799 | - | ||
3800 | - if (!editorUi.isOffline() || mxClient.IS_CHROMEAPP || EditorUi.isElectronApp) | ||
3801 | - { | ||
3802 | - this.addLinkToItem(item, 'https://www.diagrams.net/doc/faq/scratchpad'); | ||
3803 | - } | 3803 | + // TODO thingsKit 隐藏 查看菜单中的 便笺本 |
3804 | + // var item = this.addMenuItem(menu, 'scratchpad', parent); | ||
3805 | + // | ||
3806 | + // if (!editorUi.isOffline() || mxClient.IS_CHROMEAPP || EditorUi.isElectronApp) | ||
3807 | + // { | ||
3808 | + // this.addLinkToItem(item, 'https://www.diagrams.net/doc/faq/scratchpad'); | ||
3809 | + // } | ||
3804 | } | 3810 | } |
3805 | 3811 | ||
3806 | this.addMenuItems(menu, ['shapes', '-', 'pageView', 'pageScale']); | 3812 | this.addMenuItems(menu, ['shapes', '-', 'pageView', 'pageScale']); |
1 | (function () { | 1 | (function () { |
2 | - // Adds Atlassian shapes | ||
3 | - // 图表 | ||
4 | - Sidebar.prototype.addChartsPalette = function () { | ||
5 | - var s = 'html=1;shadow=0;dashed=0;shape=mxgraph.atlassian.'; | ||
6 | - var s2 = 'html=1;shadow=0;dashed=0;fillColor=none;strokeColor=none;shape=mxgraph.bootstrap.rect;'; | ||
7 | - var s3 = mxConstants.STYLE_STROKEWIDTH + '=1;shadow=0;dashed=0;align=center;html=1;' + mxConstants.STYLE_SHAPE + "=mxgraph.mockup."; | ||
8 | - var gn = 'mxgraph.charts'; | ||
9 | - var dt = 'charts '; | ||
10 | - var sb = this; | ||
11 | - this.setCurrentSearchEntryLibrary('charts'); | ||
12 | - | ||
13 | - const now = () => Date.now | ||
14 | - var fns = [ | ||
15 | - this.addEntry('charts', mxUtils.bind(this, function () { | ||
16 | - const nodeId = `echarts__${ now() }` | ||
17 | - var cell = new mxCell(`<div style="color: red" id="${ nodeId }">${ now() }</div>`, new mxGeometry(0, 0, 160, 20), 'text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;overflow=hidden;'); | ||
18 | - cell.setVertex(true) | ||
19 | - return this.createVertexTemplateFromCells([cell], cell.geometry.width, cell.geometry.height, 'charts'); | ||
20 | - })), | ||
21 | - ]; | ||
22 | - | ||
23 | - this.addPalette('charts', '图表', false, mxUtils.bind(this, function (content) { | ||
24 | - for (var i = 0; i < fns.length; i++) { | ||
25 | - content.appendChild(fns[i](content)); | ||
26 | - } | ||
27 | - })); | ||
28 | - | ||
29 | - this.setCurrentSearchEntryLibrary(); | ||
30 | - }; | 2 | + // Adds Atlassian shapes |
3 | + // 图表 | ||
4 | + Sidebar.prototype.addChartsPalette = function () { | ||
5 | + | ||
6 | + const generatorId = () => `echarts__instance__${ Date.now() }` | ||
7 | + | ||
8 | + const addClickHandler = Sidebar.prototype.addClickHandler | ||
9 | + Sidebar.prototype.addClickHandler = function (elt, ds, cells) { | ||
10 | + var graph = this.editorUi.editor.graph; | ||
11 | + var tol = graph.tolerance; | ||
12 | + const cell = cells[0] | ||
13 | + const cellValue = cell.value | ||
14 | + const validate = cellValue && cellValue.nodeName === 'UserObject' && cellValue.getAttribute('componentsType') === 'charts' | ||
15 | + const mouseDown = ds.mouseDown | ||
16 | + | ||
17 | + ds.mouseDown = function (evt) { | ||
18 | + if (validate) { | ||
19 | + cell.value.setAttribute('id', generatorId()) | ||
20 | + graph.setAttributeForCell(cell, 'label', `<div class="echarts__instance" id="${ generatorId() }">${ generatorId() }</div>`) | ||
21 | + } | ||
22 | + mouseDown.apply(this, arguments) | ||
23 | + }; | ||
24 | + | ||
25 | + const mouseUp = ds.mouseUp | ||
26 | + ds.mouseUp = function () { | ||
27 | + try { | ||
28 | + mouseUp.apply(this, arguments) | ||
29 | + } finally { | ||
30 | + if (validate) { | ||
31 | + const id = cell.value.id | ||
32 | + const chartDom = document.getElementById(id); | ||
33 | + chartDom.style.width = '400px' | ||
34 | + chartDom.style.height = '400px' | ||
35 | + const myChart = echarts.init(chartDom); | ||
36 | + const option = { | ||
37 | + xAxis: { | ||
38 | + type: 'category', | ||
39 | + data: [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ], | ||
40 | + }, | ||
41 | + yAxis: { | ||
42 | + type: 'value', | ||
43 | + }, | ||
44 | + series: [ | ||
45 | + { | ||
46 | + data: [ 150, 230, 224, 218, 135, 147, 260 ], | ||
47 | + type: 'line', | ||
48 | + }, | ||
49 | + ], | ||
50 | + }; | ||
51 | + | ||
52 | + option && myChart.setOption(option); | ||
53 | + } | ||
54 | + } | ||
55 | + // const dom = document.getElementById() | ||
56 | + } | ||
57 | + addClickHandler.apply(this, arguments) | ||
58 | + } | ||
59 | + | ||
60 | + const convertValueToString = this.graph.convertValueToString | ||
61 | + this.graph.convertValueToString = function (cell) { | ||
62 | + const cellValue = cell.value | ||
63 | + const validate = cellValue && cellValue.nodeName === 'UserObject' && cellValue.getAttribute('componentsType') === 'charts' | ||
64 | + if (validate) { | ||
65 | + setTimeout(() => { | ||
66 | + const id = cell.value.id | ||
67 | + console.log(id) | ||
68 | + const chartDom = document.getElementById(id); | ||
69 | + chartDom.style.width = '400px' | ||
70 | + chartDom.style.height = '400px' | ||
71 | + const myChart = echarts.init(chartDom); | ||
72 | + const option = { | ||
73 | + xAxis: { | ||
74 | + type: 'category', | ||
75 | + data: [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ], | ||
76 | + }, | ||
77 | + yAxis: { | ||
78 | + type: 'value', | ||
79 | + }, | ||
80 | + series: [ | ||
81 | + { | ||
82 | + data: [ 150, 230, 224, 218, 135, 147, 260 ], | ||
83 | + type: 'line', | ||
84 | + }, | ||
85 | + ], | ||
86 | + }; | ||
87 | + | ||
88 | + option && myChart.setOption(option); | ||
89 | + }) | ||
90 | + } | ||
91 | + | ||
92 | + return convertValueToString.apply(this, arguments) | ||
93 | + } | ||
94 | + | ||
95 | + var s = 'html=1;shadow=0;dashed=0;shape=mxgraph.atlassian.'; | ||
96 | + var s2 = 'html=1;shadow=0;dashed=0;fillColor=none;strokeColor=none;shape=mxgraph.bootstrap.rect;'; | ||
97 | + var s3 = mxConstants.STYLE_STROKEWIDTH + '=1;shadow=0;dashed=0;align=center;html=1;' + mxConstants.STYLE_SHAPE + "=mxgraph.mockup."; | ||
98 | + var gn = 'mxgraph.charts'; | ||
99 | + var dt = 'charts '; | ||
100 | + var sb = this; | ||
101 | + this.setCurrentSearchEntryLibrary('charts'); | ||
102 | + | ||
103 | + const now = Date.now | ||
104 | + var fns = [ | ||
105 | + this.addEntry('charts', mxUtils.bind(this, function () { | ||
106 | + const id = generatorId() | ||
107 | + var cell = new mxCell(`<div id="${ id }" class="echarts__instance"></div>`, new mxGeometry(0, 0, 400, 400), 'text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;overflow=hidden;'); | ||
108 | + cell.setVertex(true) | ||
109 | + this.graph.setAttributeForCell(cell, 'placeholders', '1'); | ||
110 | + this.graph.setAttributeForCell(cell, 'componentsType', 'charts'); | ||
111 | + cell.value.setAttribute('id', id) | ||
112 | + return this.createVertexTemplateFromCells([ cell ], cell.geometry.width, cell.geometry.height, 'charts'); | ||
113 | + })), | ||
114 | + ]; | ||
115 | + | ||
116 | + this.addPaletteFunctions('charts', '图表', false, fns); | ||
117 | + | ||
118 | + this.setCurrentSearchEntryLibrary(); | ||
119 | + }; | ||
31 | })(); | 120 | })(); |
121 | + | ||
122 | +function testChartImg() { | ||
123 | + return 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMQAAADECAMAAAD3eH5ZAAABy1BMVEUAAADwhwXyhwX0iQXwgADzhQbgbQztgwThbQv1iQbziQXziQXlcAzmcgrlcAzmcQvpdQfwhwXgbQz//////v3whwDfaADwhwbgbhXvewDgbxrhcyrf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PhEajVEvE0txuMgkuxijghxvMru4Ov0XcNThCdm7kY5HAQ7WZoCwK7FaL2nYWQksIx5YrSXGcRB9Hd9zBAiijesNsIHV4pIEStSwqExAh0YuOqM58RPSE/86aDv/0PUW9h1+EdMhIkwESbCRJgIE2EiTISJMBEmwkSYCBNhIkyEiTARJuIdI7bCOkEMw534pLPiz6MQUW/zH/mseMyHg3Cnb/QSIkKrhTobTVyitEKKGKu1tw3U+z4B0Uvl1oNBug4i+iPhiePXJEUrRejW42eEa3ZjddfsaGdmbZZszW7exjtxELAULIu1ooN+P81Rfwk4OoW3eop+bxhzHdtN8nyCx29JAl03CRuXw1eEmIXBBI+7o4CaHPgd7/+Lcbx2PxUd8dVHuITC9V68E8fhmedFmxMTATM982ooBK9MeeCrjUkOB0/LKQZ3c/DEWGdeOpuBzzxsBDs9+Wp1CeuGXRqNxhzwpWQVqcTlWQYjNzcyGdFFst+JooZfBUanlubOKMn+k8s/pwJCENZBXiGuh9c2FnKKTvzJ/MrQZtiRwNvvhL67E1I0JZ5VEiETlhxKv1fjcgip8KBvT8mJ99alsI0LRsj3AE7/NeJbtylKUOQcGHsARc7pV3Zif4yLudTsxqTYb144lcVRaknKGD6nwvhoXuW+WO833bTeAyjZXNS9AlANoABUAygA1QAKZYi+z3WtAFQDKADVAApANYACUA2gAFQDKADVAAqcSuhWASiMeHWqwELAaozrUQHwDNSXelQACi9ePSoAhavQYYuCCOPXAlANoABUAyhIEH16UwCqARTATpHE+wWtIwWweEkYfTpSjLcB62GTsWvRcvEUaM83UYZWtLx8H3QeIwzcoloefQiaLUeGVrSMt30EQMeBxWtgRdujDwAArda8xbC1aGl7dKoVgPdAs/XgqKmpyXhP2paWlvFHp5ohAf5p7bDk84deslp8Rb+rjF98+ajtg9aiART/0dzZbrWQfXa/M0Ww7dT7H350fPn/Amby+guTq1oUAAAAAElFTkSuQmCC' | ||
124 | +} |
@@ -4879,7 +4879,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { | @@ -4879,7 +4879,7 @@ DataFormatPanel.prototype.addDataFont = function (container) { | ||
4879 | const ss = ui.getSelectionState(); | 4879 | const ss = ui.getSelectionState(); |
4880 | const vertices = ss.vertices || [] | 4880 | const vertices = ss.vertices || [] |
4881 | 4881 | ||
4882 | - console.log(this.editorUi) | 4882 | + // console.log(this.editorUi) |
4883 | console.log(vertices) | 4883 | console.log(vertices) |
4884 | 4884 | ||
4885 | 4885 | ||
@@ -6564,13 +6564,14 @@ StyleFormatPanel.prototype.init = function () { | @@ -6564,13 +6564,14 @@ StyleFormatPanel.prototype.init = function () { | ||
6564 | this.container.appendChild(this.addEffects(this.createPanel())); | 6564 | this.container.appendChild(this.addEffects(this.createPanel())); |
6565 | } | 6565 | } |
6566 | 6566 | ||
6567 | - var opsPanel = this.addEditOps(this.createPanel()); | 6567 | + // TODO thingsKit 编辑样式 隐藏 |
6568 | + // var opsPanel = this.addEditOps(this.createPanel()); | ||
6568 | 6569 | ||
6569 | - if (opsPanel.firstChild != null) { | ||
6570 | - mxUtils.br(opsPanel); | ||
6571 | - } | 6570 | + // if (opsPanel.firstChild != null) { |
6571 | + // mxUtils.br(opsPanel); | ||
6572 | + // } | ||
6572 | 6573 | ||
6573 | - this.container.appendChild(this.addStyleOps(opsPanel)); | 6574 | + // this.container.appendChild(this.addStyleOps(opsPanel)); |
6574 | }; | 6575 | }; |
6575 | 6576 | ||
6576 | /** | 6577 | /** |
@@ -11285,12 +11286,13 @@ class DispatchCenter { | @@ -11285,12 +11286,13 @@ class DispatchCenter { | ||
11285 | /** | 11286 | /** |
11286 | * @description 更新页面 | 11287 | * @description 更新页面 |
11287 | * @param callback | 11288 | * @param callback |
11289 | + * @param cell | ||
11288 | */ | 11290 | */ |
11289 | - updatePage(callback) { | 11291 | + updatePage(callback, cell) { |
11290 | this.graph.getModel().beginUpdate() | 11292 | this.graph.getModel().beginUpdate() |
11291 | try { | 11293 | try { |
11292 | callback() | 11294 | callback() |
11293 | - this.graph.refresh(); | 11295 | + this.graph.refresh(cell); |
11294 | } finally { | 11296 | } finally { |
11295 | this.graph.getModel().endUpdate() | 11297 | this.graph.getModel().endUpdate() |
11296 | } | 11298 | } |
@@ -11495,7 +11497,6 @@ class HandleDataInteraction { | @@ -11495,7 +11497,6 @@ class HandleDataInteraction { | ||
11495 | } | 11497 | } |
11496 | for (const item of list) { | 11498 | for (const item of list) { |
11497 | const { deviceId, slaveDeviceId, value, way } = item | 11499 | const { deviceId, slaveDeviceId, value, way } = item |
11498 | - console.log(item) | ||
11499 | if (!value || !deviceId) continue | 11500 | if (!value || !deviceId) continue |
11500 | const data = { | 11501 | const data = { |
11501 | method: "methodThingskit", | 11502 | method: "methodThingskit", |
@@ -11659,7 +11660,7 @@ class HandleDynamicEffect { | @@ -11659,7 +11660,7 @@ class HandleDynamicEffect { | ||
11659 | } | 11660 | } |
11660 | switch (type) { | 11661 | switch (type) { |
11661 | case HandleDynamicEffect.enumActType.ROTATE: | 11662 | case HandleDynamicEffect.enumActType.ROTATE: |
11662 | - // invoke = this.rotate.bind(this) | 11663 | + invoke = this.rotate.bind(this) |
11663 | break | 11664 | break |
11664 | case HandleDynamicEffect.enumActType.DISPLAY: | 11665 | case HandleDynamicEffect.enumActType.DISPLAY: |
11665 | invoke = this.display.bind(this) | 11666 | invoke = this.display.bind(this) |
@@ -11677,7 +11678,6 @@ class HandleDynamicEffect { | @@ -11677,7 +11678,6 @@ class HandleDynamicEffect { | ||
11677 | */ | 11678 | */ |
11678 | rotate(data) { | 11679 | rotate(data) { |
11679 | const { subscriptionId } = data | 11680 | const { subscriptionId } = data |
11680 | - console.log(data) | ||
11681 | const node = this.getNodeByCmdId(subscriptionId) | 11681 | const node = this.getNodeByCmdId(subscriptionId) |
11682 | let deg = 0 | 11682 | let deg = 0 |
11683 | this.cleanSetInterval = RAFSetInterval(() => { | 11683 | this.cleanSetInterval = RAFSetInterval(() => { |
@@ -11687,7 +11687,6 @@ class HandleDynamicEffect { | @@ -11687,7 +11687,6 @@ class HandleDynamicEffect { | ||
11687 | // const reg = /rotation=(-?)\w+(;?)/g | 11687 | // const reg = /rotation=(-?)\w+(;?)/g |
11688 | // style = style.replace(reg, `rotation=${ deg }`) | 11688 | // style = style.replace(reg, `rotation=${ deg }`) |
11689 | // // node.setStyle(style) | 11689 | // // node.setStyle(style) |
11690 | - // console.log(node) | ||
11691 | // this.graph.getModel().beginUpdate() | 11690 | // this.graph.getModel().beginUpdate() |
11692 | // try { | 11691 | // try { |
11693 | // node.setStyle(style) | 11692 | // node.setStyle(style) |
@@ -11703,7 +11702,7 @@ class HandleDynamicEffect { | @@ -11703,7 +11702,7 @@ class HandleDynamicEffect { | ||
11703 | style = style.replace(reg, `rotation=${ deg }`) | 11702 | style = style.replace(reg, `rotation=${ deg }`) |
11704 | node.setStyle(style) | 11703 | node.setStyle(style) |
11705 | this.graph.updateCellStyles(style, node) | 11704 | this.graph.updateCellStyles(style, node) |
11706 | - }) | 11705 | + }, node) |
11707 | }, 100) | 11706 | }, 100) |
11708 | } | 11707 | } |
11709 | 11708 |
@@ -31,8 +31,8 @@ Menus.prototype.defaultFontSize = '12'; | @@ -31,8 +31,8 @@ Menus.prototype.defaultFontSize = '12'; | ||
31 | * Sets the default font size. | 31 | * Sets the default font size. |
32 | */ | 32 | */ |
33 | // Menus.prototype.defaultMenuItems = ['file', 'edit', 'view', 'arrange', 'extras', 'help']; | 33 | // Menus.prototype.defaultMenuItems = ['file', 'edit', 'view', 'arrange', 'extras', 'help']; |
34 | -// TODO 工具栏 文件选项隐藏 | ||
35 | -Menus.prototype.defaultMenuItems = ['edit', 'view', 'arrange', 'extras', 'help']; | 34 | +// TODO thingsKit 工具栏 文件选项隐藏 |
35 | +Menus.prototype.defaultMenuItems = ['edit', 'view', 'arrange']; | ||
36 | 36 | ||
37 | /** | 37 | /** |
38 | * Adds the label menu items to the given menu and parent. | 38 | * Adds the label menu items to the given menu and parent. |