删除无用引入

This commit is contained in:
ival 2021-04-04 02:22:27 +08:00
parent 3026eed365
commit 333fe16661
6 changed files with 12 additions and 546 deletions

View File

@ -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';

View File

@ -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';

View File

@ -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;

View File

@ -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();

View File

@ -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;

View File

@ -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';