(function () { // Adds Atlassian shapes // flowMeter label Sidebar.prototype.addFlowMeterPalette = function () { const { COMPONENT_TYPE } = this.enumCellBasicAttribute const { DEFAULT } = this.enumComponentType const gn = 'mxgraph.flowMeter'; const dt = 'flowMeter'; const label = '流量计' const width = 66; const height = 74; const staticPath = `${Proxy_Prefix}/img/lib/thingskit/` const prefix = 'image;image=img/lib/thingskit/' const defaultStyle = ';imageAspect=0;' this.setCurrentSearchEntryLibrary(dt); // 自定义属性 const cellAttribute = { [ COMPONENT_TYPE ]: DEFAULT } const graphPathLib = [ { name: '压力.svg', path: 'flowMeter/压力.svg' }, { name: '微电脑控制器.svg', path: 'flowMeter/微电脑控制器.svg' }, { name: '排气压力.svg', path: 'flowMeter/排气压力.svg' }, { name: '智能电磁流量计.svg', path: 'flowMeter/智能电磁流量计.svg' }, { name: '智能科氏流量计 1.svg', path: 'flowMeter/智能科氏流量计 1.svg' }, { name: '智能科氏流量计 2.svg', path: 'flowMeter/智能科氏流量计 2.svg' }, { name: '模拟输出流量传感器.svg', path: 'flowMeter/模拟输出流量传感器.svg' }, { name: '气旋流量计.svg', path: 'flowMeter/气旋流量计.svg' }, { name: '流元件.svg', path: 'flowMeter/流元件.svg' }, { name: '流管.svg', path: 'flowMeter/流管.svg' }, { name: '流量积算器.svg', path: 'flowMeter/流量积算器.svg' }, { name: '流量计.svg', path: 'flowMeter/流量计.svg' }, { name: '涡轮流量计.svg', path: 'flowMeter/涡轮流量计.svg' }, { name: '温度.svg', path: 'flowMeter/温度.svg' }, { name: '热式质量流量计.svg', path: 'flowMeter/热式质量流量计.svg' }, { name: '电磁流量计 1.svg', path: 'flowMeter/电磁流量计 1.svg' }, { name: '电磁流量计 2.svg', path: 'flowMeter/电磁流量计 2.svg' }, { name: '电磁流量计3.svg', path: 'flowMeter/电磁流量计3.svg' }, { name: '简单流量控制器.svg', path: 'flowMeter/简单流量控制器.svg' }, { name: '简单流量控制器2.svg', path: 'flowMeter/简单流量控制器2.svg' }, { name: '锥式流量计.svg', path: 'flowMeter/锥式流量计.svg' }, ] const lib = graphPathLib.map(item => { item.staticPath = staticPath + item.path return item }) const fns = graphPathLib.map(item => { return this.addEntry(this.getTagsForStencil(gn, item.name, dt).join(' '), mxUtils.bind(this, function () { const cell = new mxCell('', new mxGeometry(0, 0, width, height), `${ prefix }${ item.path }${ defaultStyle }`); cell.setVertex(true) this.setCellAttributes(cell, cellAttribute) return this.createVertexTemplateFromCells([ cell ], cell.geometry.width, cell.geometry.height, item.name); })); }) this.setVariableImageLib(dt, label, lib) this.addPaletteFunctions(dt, label, false, fns); this.setCurrentSearchEntryLibrary(); }; })();