Compare commits
2 Commits
7f3b04eb08
...
d0a682f233
Author | SHA1 | Date | |
---|---|---|---|
d0a682f233 | |||
65441ddff4 |
@ -2,7 +2,7 @@
|
|||||||
* 文本框
|
* 文本框
|
||||||
*/
|
*/
|
||||||
import Base from "../index";
|
import Base from "../index";
|
||||||
import { syncData } from '../../../Global/MultiViewportMode'
|
import { syncData, getSdk } from '../../../Global/MultiViewportMode'
|
||||||
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global'
|
import { setActiveViewer, closeRotateAround, closeViewFollow } from '../../../Global/global'
|
||||||
class TextBox extends Base {
|
class TextBox extends Base {
|
||||||
/**
|
/**
|
||||||
@ -133,8 +133,15 @@ class TextBox extends Base {
|
|||||||
async getwords(words) {
|
async getwords(words) {
|
||||||
this.options.text = words
|
this.options.text = words
|
||||||
this.callback(this.options)
|
this.callback(this.options)
|
||||||
|
let { sdkP } = getSdk()
|
||||||
|
if(this.sdk === sdkP) {
|
||||||
|
console.log(3)
|
||||||
syncData(this.sdk, this.options.id)
|
syncData(this.sdk, this.options.id)
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
console.log(2)
|
||||||
|
}
|
||||||
|
}
|
||||||
async returnFun() {
|
async returnFun() {
|
||||||
return this.handler
|
return this.handler
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ function attributeElm(that) {
|
|||||||
let tr = `
|
let tr = `
|
||||||
<div class="tr">
|
<div class="tr">
|
||||||
<div class="td">
|
<div class="td">
|
||||||
<input type="checkbox" value="${'ID' in data.data.list[i] ? data.data.list[i].ID : data.data.list[i].id}">
|
<input type="checkbox" value="${data.data.list[i].deviceId}">
|
||||||
<span>绑定</span>
|
<span>绑定</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="td">${data.data.list[i].cameraName}</div>
|
<div class="td">${data.data.list[i].cameraName}</div>
|
||||||
@ -126,11 +126,8 @@ function attributeElm(that) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let newArray = that.attributeCamera.filter((item) => {
|
let newArray = that.attributeCamera.filter((item) => {
|
||||||
if ('ID' in data.data.list[i]) {
|
if ('deviceId' in data.data.list[i]) {
|
||||||
return item.ID !== data.data.list[i].ID
|
return item.deviceId !== data.data.list[i].deviceId
|
||||||
}
|
|
||||||
else {
|
|
||||||
return item.id !== data.data.list[i].id
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
that.attributeCamera = newArray
|
that.attributeCamera = newArray
|
||||||
@ -139,7 +136,7 @@ function attributeElm(that) {
|
|||||||
tableContent.appendChild(trElm)
|
tableContent.appendChild(trElm)
|
||||||
|
|
||||||
for (let m = 0; m < that.attributeCamera.length; m++) {
|
for (let m = 0; m < that.attributeCamera.length; m++) {
|
||||||
if (('ID' in data.data.list[i]) ? (that.attributeCamera[m].ID === data.data.list[i].ID) : (that.attributeCamera[m].id === data.data.list[i].id)) {
|
if (('deviceId' in data.data.list[i]) ? (that.attributeCamera[m].deviceId === data.data.list[i].deviceId):false) {
|
||||||
checkbox.checked = true
|
checkbox.checked = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -200,19 +197,11 @@ function attributeElm(that) {
|
|||||||
for (let i = that.attributeCamera.length - 1; i >= 0; i--) {
|
for (let i = that.attributeCamera.length - 1; i >= 0; i--) {
|
||||||
let flag = false
|
let flag = false
|
||||||
for (let m = 0; m < data.data.list.length; m++) {
|
for (let m = 0; m < data.data.list.length; m++) {
|
||||||
if ('ID' in data.data.list[m]) {
|
if (that.attributeCamera[i].deviceId === data.data.list[m].deviceId) {
|
||||||
if (that.attributeCamera[i].ID === data.data.list[m].ID) {
|
|
||||||
flag = true
|
flag = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ('id' in data.data.list[m]) {
|
|
||||||
if (that.attributeCamera[i].id === data.data.list[m].id) {
|
|
||||||
flag = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
that.attributeCamera.splice(i, 1)
|
that.attributeCamera.splice(i, 1)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user