From 6b6d9a85405e0a58458a38763aec0ddf12ac3540 Mon Sep 17 00:00:00 2001 From: wq1234wq Date: Fri, 5 Aug 2022 19:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E6=A0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../conditionbuilder.component.html | 62 ++++++ .../conditionbuilder.component.less | 3 + .../conditionbuilder.component.spec.ts | 25 +++ .../conditionbuilder.component.ts | 204 ++++++++++++++++++ .../rules/diagram/diagram.component.html | 24 +-- .../rules/diagram/diagram.component.less | 3 + .../routes/rules/diagram/diagram.component.ts | 40 +++- .../app/routes/rules/rules-routing.module.ts | 6 +- .../src/app/routes/rules/rules.module.ts | 3 +- .../ClientApp/src/assets/custom/gh/custom.js | 10 + .../src/assets/custom/gh/customContextPad.js | 80 +++++++ .../src/assets/custom/gh/customPalette.js | 62 ++++++ .../src/assets/custom/gh/customRenderer.js | 82 +++++++ .../ClientApp/src/assets/custom/gh/parts.js | 10 + IoTSharp/ClientApp/src/style-icons-auto.ts | 4 +- 15 files changed, 596 insertions(+), 22 deletions(-) create mode 100644 IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.html create mode 100644 IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.less create mode 100644 IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.spec.ts create mode 100644 IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.ts create mode 100644 IoTSharp/ClientApp/src/assets/custom/gh/custom.js create mode 100644 IoTSharp/ClientApp/src/assets/custom/gh/customContextPad.js create mode 100644 IoTSharp/ClientApp/src/assets/custom/gh/customPalette.js create mode 100644 IoTSharp/ClientApp/src/assets/custom/gh/customRenderer.js create mode 100644 IoTSharp/ClientApp/src/assets/custom/gh/parts.js diff --git a/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.html b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.html new file mode 100644 index 00000000..c33bf925 --- /dev/null +++ b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.html @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.less b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.less new file mode 100644 index 00000000..169a71c3 --- /dev/null +++ b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.less @@ -0,0 +1,3 @@ +.customrow{ + margin-top: 1.5rem; +} \ No newline at end of file diff --git a/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.spec.ts b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.spec.ts new file mode 100644 index 00000000..22f1df3e --- /dev/null +++ b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.spec.ts @@ -0,0 +1,25 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ConditionbuilderComponent } from './conditionbuilder.component'; + +describe('ConditionbuilderComponent', () => { + let component: ConditionbuilderComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ ConditionbuilderComponent ] + }) + .compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(ConditionbuilderComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.ts b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.ts new file mode 100644 index 00000000..d5af3a9d --- /dev/null +++ b/IoTSharp/ClientApp/src/app/routes/rules/conditionbuilder/conditionbuilder.component.ts @@ -0,0 +1,204 @@ +import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; +import { NzTreeFlatDataSource, NzTreeFlattener } from 'ng-zorro-antd/tree-view'; +import { SelectionModel } from '@angular/cdk/collections'; +import { FlatTreeControl } from '@angular/cdk/tree'; +import { NzDrawerRef } from 'ng-zorro-antd/drawer'; +@Component({ + selector: 'app-conditionbuilder', + templateUrl: './conditionbuilder.component.html', + styleUrls: ['./conditionbuilder.component.less'] +}) +export class ConditionbuilderComponent implements OnInit { + treeData: TreeNode[] = [ + { + name: '1', + key: '1', + children: [] + } + ]; + columns = [ + + ]; + private transformer = (node: TreeNode, level: number): FlatNode => { + const existingNode = this.nestedNodeMap.get(node); + const flatNode = + existingNode && existingNode.key === node.key + ? existingNode + : { + expandable: true, + name: node.name, + level, + key: node.key + }; + flatNode.name = node.name; + this.flatNodeMap.set(flatNode, node); + this.nestedNodeMap.set(node, flatNode); + return flatNode; + }; + + flatNodeMap = new Map(); + nestedNodeMap = new Map(); + selectListSelection = new SelectionModel(true); + + treeControl = new FlatTreeControl( + node => node.level, + node => node.expandable + ); + treeFlattener = new NzTreeFlattener( + this.transformer, + node => node.level, + node => node.expandable, + node => node.children + ); + + dataSource = new NzTreeFlatDataSource(this.treeControl, this.treeFlattener); + + constructor(private drawerRef: NzDrawerRef) { + this.dataSource.setData(this.treeData); + this.treeControl.expandAll(); + } + + Json = '{"a":1,"b":2,"c":3}'; + ngModelChange($event) { + var data = JSON.parse($event); + this.columns = []; + for (let key in data) { + this.columns.push({ label: key, value: key }); + } + } + ngOnInit(): void { + var data = JSON.parse(this.Json); + this.columns = []; + for (let key in data) { + this.columns.push({ label: key, value: key }); + } + } + + hasChild = (_: number, node: FlatNode): boolean => true; + hasNoContent = (_: number, node: FlatNode): boolean => node.name === ''; + trackBy = (_: number, node: FlatNode): string => `${node.key}-${node.name}`; + close(){ + this.drawerRef.close({expression:this.expression,orgin:this.treeData}) + } + delete(node: FlatNode): void { + const originNode = this.flatNodeMap.get(node); + + const dfsParentNode = (): TreeNode | null => { + const stack = [...this.treeData]; + while (stack.length > 0) { + const n = stack.pop()!; + if (n.children) { + if (n.children.find(e => e === originNode)) { + return n; + } + + for (let i = n.children.length - 1; i >= 0; i--) { + stack.push(n.children[i]); + } + } + } + return null; + }; + + const parentNode = dfsParentNode(); + if (parentNode && parentNode.children) { + parentNode.children = parentNode.children.filter(e => e !== originNode); + } + + this.dataSource.setData(this.treeData); + } + addNewNode(node: FlatNode): void { + const parentNode = this.flatNodeMap.get(node); + if (parentNode) { + parentNode.children = parentNode.children || []; + parentNode.children.push({ + name: node.field, + key: `${parentNode.key}-${parentNode.children.length}`, + children: [] + }); + + this.dataSource.setData(this.treeData); + this.treeControl.expand(node); + } + } + + saveNode(node: FlatNode, value: string): void { + const nestedNode = this.flatNodeMap.get(node); + if (nestedNode) { + nestedNode.name = value; + this.dataSource.setData(this.treeData); + } + } + create() { + this.expression = this.rebuildtree(this.treeData); + } + + expression: string = ''; + + rebuildtree(nodes: TreeNode[]) { + var expression = ''; + for (var i = 0; i < nodes.length; i++) { + if (i == nodes.length - 1) { + var node = nodes[i]; + if (node.children && node.children?.length > 0) { + var flatNode = this.nestedNodeMap.get(node); + node.connector = flatNode.connector; + node.field = flatNode.field; + node.text = flatNode.text; + node.operator = flatNode.operator; + node.name = flatNode.name; + if (node.children && node.children?.length > 0) { + this.rebuildtree(node.children); + expression += node.field + ' ' + node.operator + '' + node.text + node.connector + '(' + this.rebuildtree(node.children) + ')'; + } else { + expression += node.field + ' ' + node.operator + '' + node.text + node.connector; + } + } else { + var node = nodes[i]; + var flatNode = this.nestedNodeMap.get(node); + node.connector = flatNode.connector; + node.field = flatNode.field; + node.text = flatNode.text; + node.operator = flatNode.operator; + node.name = flatNode.name; + expression += node.field + ' ' + node.operator + '' + node.text; + } + } else { + var node = nodes[i]; + var flatNode = this.nestedNodeMap.get(node); + node.connector = flatNode.connector; + node.field = flatNode.field; + node.text = flatNode.text; + node.operator = flatNode.operator; + node.name = flatNode.name; + if (node.children && node.children?.length > 0) { + expression += node.field + ' ' + node.operator + '' + node.text + node.connector + '(' + this.rebuildtree(node.children) + ')'; + } else { + expression += node.field + ' ' + node.operator + '' + node.text + node.connector; + } + } + } + return expression; + } +} +interface TreeNode { + name: string; + key: string; + children?: TreeNode[]; + level?: number; + operator?: string; + field?: string; + text?: string; + connector?: string; +} + +interface FlatNode { + expandable: boolean; + name: string; + key: string; + level: number; + operator?: string; + field?: string; + text?: string; + connector?: string; +} diff --git a/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.html b/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.html index 8207ee46..0f63f87f 100644 --- a/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.html +++ b/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.html @@ -20,7 +20,7 @@ [ngModelOptions]="{ standalone: true }" (ngModelChange)="ngModelChange($event)" /> - + @@ -30,19 +30,17 @@ [ngModelOptions]="{ standalone: true }" (ngModelChange)="ngModelChange($event)" /> - - - + + + + + + + + + @@ -106,4 +104,4 @@ - \ No newline at end of file + diff --git a/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.less b/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.less index b861f7ea..30b9e5ca 100644 --- a/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.less +++ b/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.less @@ -29,4 +29,7 @@ } nz-select{ width: 100%; + } + .exgroup{ + width: 100%; } \ No newline at end of file diff --git a/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.ts b/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.ts index cca9604e..f88ee432 100644 --- a/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.ts +++ b/IoTSharp/ClientApp/src/app/routes/rules/diagram/diagram.component.ts @@ -14,7 +14,7 @@ import { Inject, OnInit } from '@angular/core'; -import { _HttpClient } from '@delon/theme'; //test +import { SettingsService, _HttpClient } from '@delon/theme'; //test import { delay, mergeMap } from 'rxjs/operators'; import * as BpmnJS from 'bpmn-js/dist/bpmn-modeler.production.min.js'; @@ -28,6 +28,11 @@ import { NzTooltipDirective } from 'ng-zorro-antd/tooltip'; import { appmessage } from 'src/app/models/appmessage'; import { FormBpmnObject, Activity, TextAnnotation, SequenceFlow, Task, BpmnBaseObject, DesignerResult, DataOutputAssociation, GateWay } from 'src/app/models/rules/basebizobject'; +import { NzDrawerService } from 'ng-zorro-antd/drawer'; +import { ConditionbuilderComponent } from '../conditionbuilder/conditionbuilder.component'; + +// import customModule from 'src/assets/custom/gh/custom.js';// 导入自定义渲染 + @Component({ selector: 'app-diagram', templateUrl: './diagram.component.html', @@ -165,6 +170,29 @@ export class DiagramComponent implements AfterContentInit, OnChanges, OnDestroy .subscribe(); } + + showce(){ + var { nzMaskClosable, width } = this.settingService.getData('drawerconfig'); + var title = '条件生成' ; + const drawerRef = this.drawerService.create({ + nzTitle: title, + nzContent: ConditionbuilderComponent, + nzWidth: width < 1280 ? 1280 : width, + nzMaskClosable: nzMaskClosable, + nzContentParams: { + + } + }); + drawerRef.afterOpen.subscribe(() => { }); + drawerRef.afterClose.subscribe(data => { + this.form.conditionexpression=data['expression']; + var orgin=data['orgin']; //用于服务端条件解析的原始JSON对象 + + + + }); + + } getexcutors() { this.http.get('api/rules/getexecutors').subscribe( next => { @@ -183,7 +211,9 @@ export class DiagramComponent implements AfterContentInit, OnChanges, OnDestroy private nzConfigService: NzConfigService, private element: ElementRef, @Inject(DOCUMENT) document: any, - private renderer: Renderer2 + private renderer: Renderer2, + private drawerService: NzDrawerService, + private settingService: SettingsService ) { this.document = document; this.activity = new Activity(); @@ -203,7 +233,7 @@ export class DiagramComponent implements AfterContentInit, OnChanges, OnDestroy defaultStrokeColor: '#1890ff' }, // additionalModules: [ - // customModule + // customModule // ], moddleExtensions: {} }); @@ -1658,8 +1688,8 @@ export class DiagramComponent implements AfterContentInit, OnChanges, OnDestroy // var elementRegistry = this.bpmnJS.get('elementRegistry'); // var modeling = this.bpmnJS.get('modeling'); // var node = elementRegistry.get(element.id); - // node.businessObject['profile'] = task.bizObject.profile - // modeling.updateProperties(node, { profile: task.bizObject.profile }); + // node.businessObject['profile'] = task.bizObject.profile //附加自定义图形内置数据属性 + // modeling.updateProperties(node, { profile: task.bizObject.profile }); //触发任意一次change事件,通知事件总线发起一次重绘 task.incoming = element.incoming ?? []; task.outgoing = element.incoming ?? []; task.id = element.id; diff --git a/IoTSharp/ClientApp/src/app/routes/rules/rules-routing.module.ts b/IoTSharp/ClientApp/src/app/routes/rules/rules-routing.module.ts index 5ad79930..5c9091f3 100644 --- a/IoTSharp/ClientApp/src/app/routes/rules/rules-routing.module.ts +++ b/IoTSharp/ClientApp/src/app/routes/rules/rules-routing.module.ts @@ -1,5 +1,6 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; +import { ConditionbuilderComponent } from './conditionbuilder/conditionbuilder.component'; import { DesignerComponent } from './designer/designer.component'; import { FloweventsComponent } from './flowevents/flowevents.component'; import { FlowlistComponent } from './flowlist/flowlist.component'; @@ -9,7 +10,10 @@ const routes: Routes = [ { path: 'flowlist', component: FlowlistComponent }, { path: 'flowevents', component: FloweventsComponent }, { path: 'designer', component: DesignerComponent }, - { path: 'ruledevice', component: RuledeviceComponent } + { path: 'ruledevice', component: RuledeviceComponent }, + { path: 'c', component: ConditionbuilderComponent } //test + + ]; @NgModule({ diff --git a/IoTSharp/ClientApp/src/app/routes/rules/rules.module.ts b/IoTSharp/ClientApp/src/app/routes/rules/rules.module.ts index 5dd232cf..1abe7a57 100644 --- a/IoTSharp/ClientApp/src/app/routes/rules/rules.module.ts +++ b/IoTSharp/ClientApp/src/app/routes/rules/rules.module.ts @@ -3,6 +3,7 @@ import { SharedModule } from '@shared'; import { NgxEchartsModule } from 'ngx-echarts'; import { CommonDialogSevice } from '../util/commonDialogSevice'; import { WidgetsModule } from '../widgets/widgets.module'; +import { ConditionbuilderComponent } from './conditionbuilder/conditionbuilder.component'; import { DesignerComponent } from './designer/designer.component'; import { DiagramComponent } from './diagram/diagram.component'; import { FloweventsComponent } from './flowevents/flowevents.component'; @@ -25,7 +26,7 @@ const COMPONENTS = [ ForkdialogComponent, SequenceflowtesterComponent, TasktesterComponent, - RuledeviceComponent, + RuledeviceComponent,ConditionbuilderComponent ]; diff --git a/IoTSharp/ClientApp/src/assets/custom/gh/custom.js b/IoTSharp/ClientApp/src/assets/custom/gh/custom.js new file mode 100644 index 00000000..0beef51e --- /dev/null +++ b/IoTSharp/ClientApp/src/assets/custom/gh/custom.js @@ -0,0 +1,10 @@ +import CustomContextPad from './customContextPad'; +import CustomPalette from './customPalette'; +import CustomRenderer from './customRenderer'; + +export default { + __init__: [ 'customContextPad', 'customPalette', 'customRenderer' ], + customContextPad: [ 'type', CustomContextPad ], + customPalette: [ 'type', CustomPalette ], + customRenderer: [ 'type', CustomRenderer ] + }; \ No newline at end of file diff --git a/IoTSharp/ClientApp/src/assets/custom/gh/customContextPad.js b/IoTSharp/ClientApp/src/assets/custom/gh/customContextPad.js new file mode 100644 index 00000000..e2f9fb5f --- /dev/null +++ b/IoTSharp/ClientApp/src/assets/custom/gh/customContextPad.js @@ -0,0 +1,80 @@ +import { + TASKS, +} from './parts' +export default class CustomContextPad { + constructor(bpmnFactory, config, contextPad, create, elementFactory, injector, translate) { + this.bpmnFactory = bpmnFactory; + this.create = create; + this.elementFactory = elementFactory; + this.translate = translate; + if (config.autoPlace !== false) { + this.autoPlace = injector.get('autoPlace', false); + } + contextPad.registerProvider(this); + } + + getContextPadEntries(element) { + const { + autoPlace, + bpmnFactory, + create, + elementFactory, + } = this; + + function appendBuiltinShape(task) { + return function (event, element) { + if (autoPlace) { + const businessObject = bpmnFactory.create(task.shape); + businessObject.suitable = task.title; + businessObject.profile = task; + const shape = elementFactory.createShape({ + type: task.shape, + businessObject: businessObject, + }); + + autoPlace.append(element, shape); + } else { + appendBuiltinShapeStart(event, element); + } + }; + } + function appendBuiltinShapeStart(task) { + return function (event) { + const businessObject = bpmnFactory.create(task.shape); + businessObject.suitable = task.title; + businessObject.profile = task; + + const shape = elementFactory.createShape({ + type: task.shape, + businessObject: businessObject, + }); + console.log(shape) + create.start(event, shape, element); + }; + } + var tasks = {} + for (var o of TASKS) { + tasks[o.namespace] = { + group: o.group, + className: o.classname, + title: o.desc, + action: { + click: appendBuiltinShape(o), + dragstart: appendBuiltinShapeStart(o) + } + } + + } + return tasks; + } +} + +CustomContextPad.$inject = [ + 'bpmnFactory', + 'config', + 'contextPad', + 'create', + 'elementFactory', + 'injector', + 'translate' +]; \ No newline at end of file diff --git a/IoTSharp/ClientApp/src/assets/custom/gh/customPalette.js b/IoTSharp/ClientApp/src/assets/custom/gh/customPalette.js new file mode 100644 index 00000000..239ea773 --- /dev/null +++ b/IoTSharp/ClientApp/src/assets/custom/gh/customPalette.js @@ -0,0 +1,62 @@ +import { + TASKS, + } from './parts' + export default class CustomPalette { + constructor(bpmnFactory, create, elementFactory, palette, translate) { + this.bpmnFactory = bpmnFactory; + this.create = create; + this.elementFactory = elementFactory; + this.translate = translate; + + palette.registerProvider(this); + } + + getPaletteEntries(element) { + const { + bpmnFactory, + create, + elementFactory, + } = this; + + function createbuiltinshape(task) { + return function (event) { + const businessObject = bpmnFactory.create(task.shape); + businessObject.suitable = task.title; + businessObject.profile = task; + const shape = elementFactory.createShape({ + type: task.shape, + businessObject: businessObject + }); + console.log(shape) + create.start(event, shape); + }; + } + var tasks = { + 'excutors-separator': { + group: 'excutors', + separator: true + }, + }; + for (var o of TASKS) { + tasks[o.namespace] = { + group: o.group, + className: o.classname, + title: o.desc, + action: { + dragstart: createbuiltinshape(o), + click: createbuiltinshape(o) + } + } + + } + return tasks; + } + } + + CustomPalette.$inject = [ + 'bpmnFactory', + 'create', + 'elementFactory', + 'palette', + 'translate' + ]; \ No newline at end of file diff --git a/IoTSharp/ClientApp/src/assets/custom/gh/customRenderer.js b/IoTSharp/ClientApp/src/assets/custom/gh/customRenderer.js new file mode 100644 index 00000000..dad6df07 --- /dev/null +++ b/IoTSharp/ClientApp/src/assets/custom/gh/customRenderer.js @@ -0,0 +1,82 @@ +import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer'; + +import { + append as svgAppend, + attr as svgAttr, + classes as svgClasses, + create as svgCreate +} from 'tiny-svg'; + +import { + getRoundRectPath +} from 'bpmn-js/lib/draw/BpmnRenderUtil'; + +import { + is, + getBusinessObject +} from 'bpmn-js/lib/util/ModelUtil'; + +import { isNil } from 'min-dash'; + +const HIGH_PRIORITY = 1500, + TASK_BORDER_RADIUS = 3 + + + +export default class CustomRenderer extends BaseRenderer { + constructor(eventBus, bpmnRenderer) { + super(eventBus, HIGH_PRIORITY); + this.bpmnRenderer = bpmnRenderer; + } + + canRender(element) { + return !element.labelTarget; + } + + drawShape(parentNode, element) { + const shape = this.bpmnRenderer.drawShape(parentNode, element); + const profile = this.getSuitabilityProfile(element); + if (!isNil(profile)) { + const color = profile.color; + const rect = drawRect(parentNode, 120, 20, TASK_BORDER_RADIUS, color); + svgAttr(rect, { + transform: 'translate(0, -25)' + }); + var text = svgCreate('text'); + svgAttr(text, { + fill: '#fff', + transform: 'translate(0, -10)' + }); + svgClasses(text).add('djs-label'); + svgAppend(text, document.createTextNode(profile.title)); + svgAppend(parentNode, text); + } + return shape; + } + + getShapePath(shape) { + return getRoundRectPath(shape, TASK_BORDER_RADIUS); + } + + getSuitabilityProfile(element) { + const businessObject = getBusinessObject(element); + const { suitable ,profile} = businessObject; + return profile; + } + +} + +function drawRect(parentNode, width, height, borderRadius, color) { + const rect = svgCreate('rect'); + svgAttr(rect, { + width: width, + height: height, + rx: borderRadius, + ry: borderRadius, + stroke: color, + strokeWidth: 1, + fill: color + }); + svgAppend(parentNode, rect); + return rect; +} \ No newline at end of file diff --git a/IoTSharp/ClientApp/src/assets/custom/gh/parts.js b/IoTSharp/ClientApp/src/assets/custom/gh/parts.js new file mode 100644 index 00000000..6744c77f --- /dev/null +++ b/IoTSharp/ClientApp/src/assets/custom/gh/parts.js @@ -0,0 +1,10 @@ +export const + TASKS = [ + { title: '告警发布器', desc: '告警发布器', namespace: 'PublishAlarmDataTask', color: '#f5222d', shape: 'bpmn:UserTask', action: null, config: {}, classname: 'bpmn-icon-task red', group: 'excutors' }, + { title: '属性发布器', desc: '属性发布器', namespace: 'PublishAttributeDataTask', color: '#fadb14', shape: 'bpmn:ServiceTask', action: null, config: {}, classname: 'bpmn-icon-task yellow', group: 'excutors' }, + { title: '遥测数据发布器', desc: '遥测数据发布器', namespace: 'PublishTelemetryDataTask', color: '#a0d911', shape: 'bpmn:ManualTask', action: null, config: {}, classname: 'bpmn-icon-task green', group: 'excutors' }, + { title: '告警生成器', desc: '自定义的告警生成器', namespace: 'CustomeAlarmPullExcutor', color: '#1890ff', shape: 'bpmn:SendTask', action: null, config: {}, classname: 'bpmn-icon-task blue', group: 'excutors' }, + { title: '告警推送器', desc: '用于告警推送的执行器', namespace: 'AlarmPullExcutor ', color: '#722ed1', shape: 'bpmn:ReceiveTask', action: null, config: {}, classname: 'bpmn-icon-task purple', group: 'excutors' }, + { title: '消息推送器', desc: '用于消息推送的执行器', namespace: 'MessagePullExecutor', color: '#eb2f96', shape: 'bpmn:BusinessRuleTask', action: null, config: {}, classname: 'bpmn-icon-task magenta', group: 'excutors' }, + { title: '遥测数组推器', desc: '用于遥测数组推送的执行器', namespace: 'TelemetryArrayPullExcutor', color: '#13c2c2', shape: 'bpmn:ScriptTask', action: {}, config: null, classname: 'bpmn-icon-task cyan', group: 'excutors' } + ]; diff --git a/IoTSharp/ClientApp/src/style-icons-auto.ts b/IoTSharp/ClientApp/src/style-icons-auto.ts index 2d2c81d0..3b90eff7 100644 --- a/IoTSharp/ClientApp/src/style-icons-auto.ts +++ b/IoTSharp/ClientApp/src/style-icons-auto.ts @@ -51,7 +51,7 @@ import { TrophyOutline, UsbOutline, UserOutline, - WeiboCircleOutline, WarningTwoTone + WeiboCircleOutline, WarningTwoTone,MinusOutline } from '@ant-design/icons-angular/icons'; export const ICONS_AUTO = [ @@ -102,5 +102,5 @@ export const ICONS_AUTO = [ TrophyOutline, UsbOutline, UserOutline, - WeiboCircleOutline, WarningTwoTone + WeiboCircleOutline, WarningTwoTone,MinusOutline ]; -- GitLab