From 333fe16661c264a3336c2455497ec4c49978bb9f Mon Sep 17 00:00:00 2001 From: ival <160568032@qq.com> Date: Sun, 4 Apr 2021 02:22:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E5=BC=95?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/iscs_new/factory/compose.js | 1 - src/iscs_new/factory/element.js | 4 +- src/iscs_new/map.js | 2 - src/iscs_new/mapper.js | 528 -------------------------------- src/iscs_new/selectHandle.js | 22 +- src/iscs_new/selectingHandle.js | 1 - 6 files changed, 12 insertions(+), 546 deletions(-) delete mode 100644 src/iscs_new/mapper.js diff --git a/src/iscs_new/factory/compose.js b/src/iscs_new/factory/compose.js index eaf3f71dc..9f5392b24 100644 --- a/src/iscs_new/factory/compose.js +++ b/src/iscs_new/factory/compose.js @@ -1,5 +1,4 @@ import * as utils from '../utils/utils'; -import * as graphic from '../core/graphic'; import Group from 'zrender/src/container/Group'; import AbstractShape from '../core/abstractShape'; import shapeRender from '../constant/shapeRender'; diff --git a/src/iscs_new/factory/element.js b/src/iscs_new/factory/element.js index 2ce6112bf..92f963d2a 100644 --- a/src/iscs_new/factory/element.js +++ b/src/iscs_new/factory/element.js @@ -1,7 +1,7 @@ -import AbstractShape from '../core/abstractShape'; -import shapeEvent from '../constant/shapeEvent'; import * as graphic from '../core/graphic'; import * as utils from '../utils/utils'; +import AbstractShape from '../core/abstractShape'; +import shapeEvent from '../constant/shapeEvent'; import shapeRender from '../constant/shapeRender'; import shapeLayer from '../constant/shapeLayer'; diff --git a/src/iscs_new/map.js b/src/iscs_new/map.js index 62a6d70ff..52c5f95bf 100644 --- a/src/iscs_new/map.js +++ b/src/iscs_new/map.js @@ -9,8 +9,6 @@ import Controller from './controller'; import StateHandle from './stateHandle'; import ShapeFactory from './factory'; import orders from './utils/orders'; -import shapeRender from './constant/shapeRender'; -import shapeType from './constant/shapeType'; const renderer = 'canvas'; const devicePixelRatio = 1; diff --git a/src/iscs_new/mapper.js b/src/iscs_new/mapper.js deleted file mode 100644 index 3f361e880..000000000 --- a/src/iscs_new/mapper.js +++ /dev/null @@ -1,528 +0,0 @@ -import graphType from './constant/graphType'; -// import * as utils from './utils/utils'; -import store from '@/store'; -import { MapTypeEnum, DcsModeEnum } from '@/scripts/ConstDic'; -class Mapper { - constructor() { - this.__Dialog = {}; - this.__mapper = {}; - this.loadDialogData(); - this.loadMapper(); - } - - loadDialogData() { - this.__Dialog['tpsq'] = { - ElectricGlobeValve: { - DCS: { - Left: { - command: 'ElectricGlobeValve', - dialogName: 'Adjust-Power' - }, - Right: [] - } - }, - ElectricPlowUnloader: { // 犁 - DCS: { - Left: { - command: 'ElectricPlowUnloader', - dialogName: 'Adjust-Powload' - }, - Right: [] - } - }, - MagneticGlobeValve: { - DCS: { - Left: { - command: 'MagneticGlobeValve', - dialogName: 'Adjust-Power' - }, - Right: [] - } - }, - PneumaticGlobeValve: { - DCS: { - Left: { - command: 'PneumaticGlobeValve', - dialogName: 'Adjust-Power' - }, - Right: [] - } - }, - Motor: { - DCS: { - Left: { - command: 'Motor', - dialogName: 'Adjust-Power' - }, - Right: [] - } - }, - Burner: { - DCS: { - Left: { - command: 'Burner', - dialogName: 'Adjust-Power' - }, - Right: [] - } - }, - ElectricControlValve: { - DCS: { - Left: { - command: 'ElectricControlValve', - dialogName: 'Adjust-Setting' - }, - Right: [] - } - }, - FrequencyConverter: { - DCS: { - Left: { - command: 'FrequencyConverter', - dialogName: 'Adjust-Setting' - }, - Right: [] - } - }, - ManualGlobeValve: { - DCS: { - Left: { - command: 'ManualGlobeValve', - dialogName: 'Hand-Switch-Power' - }, - Right: [] - } - }, - ThreePortValve: { // 三通阀 - DCS: { - Left: { - command: 'ThreePortValve', - dialogName: 'Hand-Side-Forward' - }, - Right: [] - } - }, - [graphType.Popup]: { - DCS: { - Left: { - command: 'Popup', - dialogName: 'Popup-Panel' - }, - Right: [] - } - }, - [graphType.Pid]: { - DCS: { - Left: { - command: 'Pid', - dialogName: 'Popup-Pid-Panel' - }, - Right: [] - } - }, - [graphType.ProgramControl]: { - DCS: { - Left: { - command: 'ProgramControl', - dialogName: 'Popup-Program-Panel' - }, - Right: [] - } - }, - [graphType.Switching]: { - DCS: { - Left: { - command: 'Switching', - dialogName: 'Switching' - }, - Right: [] - } - } - }; - this.__Dialog['neepu'] = { - // N质量流量控制器 - NMassFlowController: { - DCS: { - Left: {}, - Right: [ - { - name: '自动调节', - sign: 'AUTO_REGULATING', - dialogName: 'Auto-Regulating' - } - ] - }, - Site: { - Left: {}, - Right: [ - { - name: '自动调节', - sign: 'AUTO_REGULATING', - dialogName: 'Auto-Regulating' - } - ] - } - }, - // 报警温度计 - NAlarmThermometer: { - System: { - Left: {}, - Right: [ - { - name: '清除报警', - sign: 'CANCEL_WARNING', - command: 'CANCEL_WARNING' - } - ] - } - }, - // 恒温装置 - NThermostat: { - System: { - Left: {}, - Right: [ - { - name: '启动/停止', - sign: 'SWITCH_TO', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - } - } - ] - } - }, - // N辅助油泵 - NAuxiliaryOilPump: { - DCS: { - Left: {}, - Right: [ - { - name: '启动/停止', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - } - } - ] - } - }, - // N凝结水泵 - NCondensatePump: { - DCS: { - Left: {}, - Right: [ - { - name: '启动/停止', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - } - } - ] - } - }, - // N计量泵 - NDosingPump: { - DCS: { - Left: {}, - Right: [ - { - name: '启动/停止', - sign: 'SWITCH_TO', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - }, - isShow: (el) => { return el.controlMode === 'Remote'; } - }, - { - name: '设置频率', - sign: 'SET_FREQ', - dialogName: 'Frequency-Input', - isShow: (el) => { return el.controlMode === 'Remote'; } - }, - { - name: 'PID调节', - sign: 'PID_REGULATING', - dialogName: 'Dosing-Pump-Target', - isShow: (el) => { return el.controlMode === 'Remote'; } - } - ] - }, - Site: { - Left: {}, - Right: [ - { - name: '手动冲程', - sign: 'SET_STROKE', - dialogName: 'Frequency-Setting' - } - ] - } - }, - // N搅拌电机 - NMixingMotor: { - DCS: { - Left: {}, - Right: [ - { - name: '启动/停止', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - }, - isShow: (el) => { return el.controlMode === 'Remote'; } - } - ] - } - }, - // N虚拟组合阀 - NVirtualCombinationValve: { - DCS: { - Left: {}, - Right: [ - { - name: '打开/关闭', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - } - } - ] - } - }, - // 电动截止阀 - ElectricGlobeValve: { - DCS: { - Left: {}, - Right: [ - { - name: '打开/关闭', - sign: 'SWITCH_TO', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - }, - isShow: (el) => { return el.controlMode == null || el.controlMode === 'Remote'; } - } - ] - } - }, - // 手动截止阀 - ManualGlobeValve: { - Site: { - Left: {}, - Right: [ - { - name: '打开/关闭', - sign: 'SWITCH_TO', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - } - } - ] - }, - System: { - Left: {}, - Right: [ - { - name: '打开/关闭', - sign: 'SWITCH_TO', - dialogName: 'Switch-Power', - signParams: { - open: 'OPEN', - close: 'CLOSE' - } - } - ] - } - }, - // N溶液箱 - NStirredSolutionTank: { - DCS: { - Left: {}, - Right: [ - { - name: '设置为标液', - sign: 'SET_STANDARD', - dialogName: 'Standard-Input', - isShow: (el) => !el.solidDosing - - }, - { - name: '设置为标液', - sign: 'SET_STANDARD', - dialogName: 'Standard-Setting', - isShow: (el) => el.solidDosing - }, - { - name: '取消设置', - sign: 'CANCEL_SET', - command: 'CANCEL_SET' - } - ] - // SET_STANDARD({model, instance}) { - // const attrObj = utils.getObjFormListBySign(model.attrList, 'solidDosingDeviceCode'); - // return attrObj && attrObj.val ? 'StandardSetting': 'StandardInput'; - // } - }, - Site: { - Left: {}, - Right: [ - { - name: '设置为标液', - sign: 'SET_STANDARD', - dialogName: 'Standard-Input', - isShow: (el) => !el.solidDosing - }, - { - name: '设置为标液', - sign: 'SET_STANDARD', - dialogName: 'Standard-Setting', - isShow: (el) => el.solidDosing - }, - { - name: '取消设置', - sign: 'CANCEL_SET', - command: 'CANCEL_SET' - } - ] - // SET_STANDARD({model, instance}) { - // const attrObj = utils.getObjFormListBySign(model.attrList, 'solidDosingDeviceCode'); - // return attrObj && attrObj.val ? 'StandardSetting': 'StandardInput'; - // } - } - }, - // N固体加药器 - NSolidDoser: { - DCS: { - Left: {}, - Right: [ - { - name: '加药', - sign: 'DOSE', - dialogName: 'Solid-Dosing-Input' - } - ] - }, - Site: { - Left: {}, - Right: [ - { - name: '加药', - sign: 'DOSE', - dialogName: 'Solid-Dosing-Input' - } - ] - } - }, - // N带灯按钮 - NIlluminatedButton: { - DCS: { - Left: {}, - Right: [] - }, - Site: { - Left: { - command: 'CLICK' - }, - Right: [] - } - }, - // 转换开关 - NChangeoverSwitch: { - DCS: {}, - Site: { - Left: { - command: 'CHANGE_OVER' - }, - Right: [] - } - }, - // 手轮 - NHandWheel: { - DCS: {}, - Site: { - Left: { - command: 'ADJUST', - dialogName: 'Adjust-Opening' - }, - Right: [ - // { - // name: '调频', - // sign: 'ADJUST', - // dialogName: 'Adjust-Opening' - // } - ] - } - } - }; - } - - loadMapper() { - this.__menus = { - // 质量流量控制器 - MassFlowController: [ - { - mode: 'Right', - name: '说明', - sign: 'MENU_EXPLAIN', - graphType: 'DCS' - }, - { - mode: 'Right', - name: '说明', - sign: 'MENU_EXPLAIN', - graphType: 'Site' - } - ] - }; - } - - filter(sign, node) { // 根据模式过滤菜单 - const mapper = { - PID_REGULATING() { - return store.state.map.dcsMode == DcsModeEnum.Auto - ? node : null; - }, - AUTO_REGULATING() { - return store.state.map.dcsMode == DcsModeEnum.Auto || store.state.map.mapType == MapTypeEnum.Site - ? node : null; - }, - __default() { - return store.state.map.dcsMode == DcsModeEnum.Auto - ? null: node; - } - }; - return mapper[sign]? mapper[sign](): mapper.__default(); - } - - concat(menus, type) { - const _menus = this.__menus[type]; - return _menus? menus.concat(_menus.map(el => { return Object.assign(el, {local: true}); })) : menus; - } - - getPopUp({type, graphType, projectSign}, device, isLeft) { - const dialog = this.__Dialog[projectSign]; - graphType = graphType || 'Other'; - if (dialog[type] && dialog[type][graphType]) { - if (isLeft) { - return dialog[type][graphType]['Left'] ? dialog[type][graphType]['Left'] : null; - } else { - return dialog[type][graphType]['Right']; - } - } - } -} - -export default new Mapper(); diff --git a/src/iscs_new/selectHandle.js b/src/iscs_new/selectHandle.js index bc7cf919b..48d465b6f 100644 --- a/src/iscs_new/selectHandle.js +++ b/src/iscs_new/selectHandle.js @@ -1,6 +1,4 @@ import shapeLayer from './constant/shapeLayer'; -import LineDraggable from './draggable/Line'; -import ImageDraggable from './draggable/Image'; import * as graphic from './core/graphic'; export default class SelectHandle { @@ -48,16 +46,16 @@ export default class SelectHandle { }); } - createSelected(target) { - if (this.$map.draggle) { - switch (target.type) { - case graphic.Line: - return new LineDraggable(this); - case graphic.Image: - return new ImageDraggable(this); - } - } - } + // createSelected(target) { + // if (this.$map.draggle) { + // switch (target.type) { + // case graphic.Line: + // return new LineDraggable(this); + // case graphic.Image: + // return new ImageDraggable(this); + // } + // } + // } setDraggable(draggable) { const target = this.e.target; diff --git a/src/iscs_new/selectingHandle.js b/src/iscs_new/selectingHandle.js index 3ba5eab1f..354daf2b0 100644 --- a/src/iscs_new/selectingHandle.js +++ b/src/iscs_new/selectingHandle.js @@ -1,5 +1,4 @@ import * as graphic from './core/graphic.js'; -import * as utils from './utils/utils' import shapeRender from './constant/shapeRender'; import shapeLayer from './constant/shapeLayer';