# 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: { Global: {
textFontSize: '6', textFontSize: '6',
backgroundColor: '#000000' backgroundColor: '#000000'
},
'Link': {
linkColor: '#a0a0a0',
linkWidth: 6,
linkTextColor: '#FFFFFF'
} }
}; };
/** link风格配置*/ /** 皮肤配置*/
deviceStyle[deviceType.Link] = { const deviceSkin = {
linkColor: 'green', '03': fuzhouSkin,
linkWidth: 6, '04': fuzhouSkin,
linkTextColor: '#FFFFFF' '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 ProxyHandle from './proxyHandle';
import MouseController from './mouseController'; import MouseController from './mouseController';
import deviceState from './config/deviceState'; 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 deviceType from './config/deviceType';
import { parser, deviceFactory } from './utils/parser'; import { parser, deviceFactory } from './utils/parser';
@ -64,7 +65,8 @@ class Jmap {
loadData(data) { loadData(data) {
// 保存皮肤类型 // 保存皮肤类型
this.skinStyle = data.skinStyle; // this.skinStyle = data.skinStyle;
this.skinStyle = data.skinVO.code;
// 保存原始数据 // 保存原始数据
this.data = data; this.data = data;
@ -89,7 +91,9 @@ class Jmap {
} }
loadStyle(skinStyle) { loadStyle(skinStyle) {
return deviceStyle; const style = selectSkinStyle(skinStyle);
return style;
// return deviceStyle;
} }
loadDefaultState() { loadDefaultState() {
@ -194,7 +198,7 @@ class Jmap {
return this.skinStyle; return this.skinStyle;
} }
getStyleDict() { getStyleDict() { // 皮肤对象
return this.styleDict; return this.styleDict;
} }

View File

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