This commit is contained in:
fan 2022-07-21 18:12:28 +08:00
parent 6794e6370f
commit 2c770a5bcc
17 changed files with 245 additions and 70 deletions

View File

@ -85,15 +85,22 @@ class Jlmap {
}
reloadStyle(lineCode) {
if (this.lineCode !== lineCode) {
this.handleModelData(this.lineCode, lineCode);
this.reloadModelData(this.lineCode, lineCode);
}
this.lineCode = lineCode;
this.style = selectLineCode(lineCode);
this.$zr.dom.style.backgroundColor = this.style.backgroundColor || '#000';
console.log(this.mapDevice, 'mapDevice');
}
// 处理私有属性
handleModelData(oldLineCode, lineCode) {
reloadModelData(oldLineCode, lineCode) {
// console.log(oldLineCode, lineCode, '-------------12');
const propConvert = lineCode ? Vue.prototype.$theme.loadPropConvert(lineCode) : null;
const oldPropConvert = oldLineCode ? Vue.prototype.$theme.loadPropConvert(oldLineCode) : null;
for (const device in this.mapDevice) {
oldPropConvert.deletePrivateProps(device);
propConvert.initPrivateProps(device);
}
}
loadDefaultState() { // 加载默认状态
const defaultStateDict = {};

View File

@ -43,9 +43,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -56,9 +56,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -66,6 +66,16 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -46,9 +46,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -59,9 +59,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -69,6 +69,16 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -43,9 +43,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -56,9 +56,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -66,6 +66,16 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -43,22 +43,21 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -66,6 +65,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -43,9 +43,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -56,9 +56,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -66,6 +66,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -43,9 +43,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -56,9 +56,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -66,6 +66,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -43,9 +43,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -56,9 +56,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -66,6 +66,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -45,9 +45,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -58,9 +58,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -68,6 +68,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -45,9 +45,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -58,9 +58,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -68,6 +68,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -44,9 +44,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -57,9 +57,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -67,6 +67,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -44,9 +44,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -57,9 +57,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -67,6 +67,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -54,9 +54,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -67,9 +67,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -77,6 +77,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -54,9 +54,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -67,9 +67,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -77,6 +77,17 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -54,9 +54,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -67,9 +67,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -77,6 +77,16 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -45,9 +45,9 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -58,9 +58,9 @@ class Model {
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
@ -68,6 +68,16 @@ class Model {
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();

View File

@ -48,29 +48,38 @@ class Model {
initPublicProps(model) {
if (model) {
var modelInitial = this.public[model._type];
const modelInitial = this.public[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
initPrivateProps(model) {
if (model) {
var modelInitial = this.private[model._type];
const modelInitial = this.private[model._type];
if (modelInitial) {
for (var prop in modelInitial) {
for (const prop in modelInitial) {
model[prop] = modelInitial[prop];
}
}
}
return model;
}
deletePrivateProps(model) {
if (model) {
const modelInitial = this.private[model._type];
if (modelInitial) {
for (const prop in modelInitial) {
delete model[prop];
}
}
}
}
}
export default new Model();