Commit 92abb1c7afe1c428609db8089a428859e8d398a7

Authored by ww
1 parent 2bdc34af

feat: add video component to sidebar

  1 +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-camera-reels-fill" viewBox="0 0 16 16">
  2 + <path d="M6 3a3 3 0 1 1-6 0 3 3 0 0 1 6 0z"/>
  3 + <path d="M9 6a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"/>
  4 + <path d="M9 6h.5a2 2 0 0 1 1.983 1.738l3.11-1.382A1 1 0 0 1 16 7.269v7.462a1 1 0 0 1-1.406.913l-3.111-1.382A2 2 0 0 1 9.5 16H2a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h7z"/>
  5 +</svg>
... ...
... ... @@ -217,11 +217,17 @@
217 217 * @description 柱状图类型
218 218 */
219 219 BAR_CHART: 'barChart',
  220 +
  221 + /**
  222 + * @description 视频
  223 + */
  224 + VIDEO: 'video',
220 225
221 226 /**
222 227 * @description 默认类型
223 228 */
224   - DEFAULT: 'default'
  229 + DEFAULT: 'default',
  230 +
225 231 }
226 232
227 233 /**
... ...
... ... @@ -52,6 +52,12 @@
52 52 this.setCellAttributes(cell, { [basicAttr.COMPONENT_TYPE]: componentType.VAR_IMAGE })
53 53 return this.createVertexTemplateFromCells([ cell ], cell.geometry.width, cell.geometry.height, '变量图片');
54 54 })),
  55 + this.addEntry(this.getTagsForStencil('mxgraph.basic', '视频', 'basic').join(' '), mxUtils.bind(this, function () {
  56 + const cell = new mxCell('', new mxGeometry(0, 0, 100, 95), 'image;image=images/thingskit/video.svg;imageAspect=0;');
  57 + cell.setVertex(true)
  58 + this.setCellAttributes(cell, { [basicAttr.COMPONENT_TYPE]: componentType.VIDEO })
  59 + return this.createVertexTemplateFromCells([ cell ], cell.geometry.width, cell.geometry.height, '视频');
  60 + })),
55 61 ];
56 62
57 63 this.addPaletteFunctions('component', '基础元件', true, fns);
... ...