# Conflicts:
#	src/views/jmap/index.vue
This commit is contained in:
ival 2019-07-15 09:02:47 +08:00
commit 359b902dfc
3 changed files with 41 additions and 13 deletions

View File

@ -1,17 +1,40 @@
import deviceType from './deviceType';
// import deviceType from './deviceType';
const deviceStyle = {
const fuzhouSkin = {
Global: {
textFontSize: '6',
backgroundColor: '#000000'
},
'Link': {
linkColor: '#a0a0a0',
linkWidth: 6,
linkTextColor: '#FFFFFF'
}
};
/** link风格配置*/
deviceStyle[deviceType.Link] = {
linkColor: 'green',
linkWidth: 6,
linkTextColor: '#FFFFFF'
/** 皮肤配置*/
const deviceSkin = {
'03': fuzhouSkin,
'04': fuzhouSkin,
'05': fuzhouSkin
};
export default deviceStyle;
export function selectSkinStyle(code) {
return deviceSkin[code];
}
// const deviceStyle = {
// Global: {
// textFontSize: '6',
// backgroundColor: '#000000'
// }
// };
// /** link风格配置*/
// deviceStyle[deviceType.Link] = {
// linkColor: '#a0a0a0',
// linkWidth: 6,
// linkTextColor: '#FFFFFF'
// };
// export default deviceStyle;

View File

@ -5,7 +5,8 @@ import Options from './options';
import ProxyHandle from './proxyHandle';
import MouseController from './mouseController';
import deviceState from './config/deviceState';
import deviceStyle from './config/deviceStyle';
// import { deviceStyle, selectSkinStyle} from './config/deviceStyle';
import { selectSkinStyle} from './config/deviceStyle';
import deviceType from './config/deviceType';
import { parser, deviceFactory } from './utils/parser';
@ -64,7 +65,8 @@ class Jmap {
loadData(data) {
// 保存皮肤类型
this.skinStyle = data.skinStyle;
// this.skinStyle = data.skinStyle;
this.skinStyle = data.skinVO.code;
// 保存原始数据
this.data = data;
@ -89,7 +91,9 @@ class Jmap {
}
loadStyle(skinStyle) {
return deviceStyle;
const style = selectSkinStyle(skinStyle);
return style;
// return deviceStyle;
}
loadDefaultState() {
@ -194,7 +198,7 @@ class Jmap {
return this.skinStyle;
}
getStyleDict() {
getStyleDict() { // 皮肤对象
return this.styleDict;
}

View File

@ -7,12 +7,13 @@ export function deviceFactory(type, defaultStateDict, elem) {
_type: type,
_code: elem.code,
model: elem,
// state: {},
state: Object.assign({}, defaultStateDict[type])
}, deviceRender[type]);
}
export function parser(data, defaultStateDict) {
let mapDevice = {};
const mapDevice = {};
if (data) {
zrUtil.each(data.linkList || [], (elem) => {