修改分布图侧栏传感器 设备数量累加问题
This commit is contained in:
parent
c138049f54
commit
da0a2425f9
@ -11,7 +11,7 @@ export const useFactoryStore = defineStore(Names.Factory, () => {
|
||||
//要更新的传感器数据
|
||||
const updateSensorData= ref<any>({})
|
||||
//传感器数量列表
|
||||
const iconList = ref([
|
||||
const temp_iconList = [
|
||||
{
|
||||
id: 1,
|
||||
name: "icon-icon-temperature",
|
||||
@ -110,16 +110,18 @@ export const useFactoryStore = defineStore(Names.Factory, () => {
|
||||
counts: 0,
|
||||
allnum: 0,
|
||||
},
|
||||
])
|
||||
//设备数量列表
|
||||
const devList = ref([ {
|
||||
]
|
||||
const temp_devList = [ {
|
||||
id: 1,
|
||||
name: "icon-shebeiditu",
|
||||
i18n:'messages.Dev',
|
||||
value: "设备",
|
||||
counts: 0,
|
||||
allnum: 0,
|
||||
},])
|
||||
},]
|
||||
const iconList = ref(JSON.parse(JSON.stringify(temp_iconList)))
|
||||
//设备数量列表
|
||||
const devList = ref(JSON.parse(JSON.stringify(temp_devList)))
|
||||
|
||||
//更新传感器数据方法
|
||||
const updateSensorList= (data:any) => {
|
||||
@ -139,6 +141,9 @@ export const useFactoryStore = defineStore(Names.Factory, () => {
|
||||
|
||||
const setDataList = (sensor:any) => {
|
||||
const data:any[] = []
|
||||
sensorList.value = []
|
||||
iconList.value = JSON.parse(JSON.stringify(temp_iconList))
|
||||
|
||||
for(let i in sensor) {
|
||||
let iconListKey = iconList.value.findIndex(item=>item.iconType == i)
|
||||
let items = sensor[i].map((item:any)=>{
|
||||
@ -177,6 +182,8 @@ export const useFactoryStore = defineStore(Names.Factory, () => {
|
||||
sensorList.value = newData;
|
||||
}
|
||||
const setdevList = (data:any) => {
|
||||
devList.value = JSON.parse(JSON.stringify(temp_devList))
|
||||
devdataList.value = []
|
||||
for(let i in data) {
|
||||
data[i].forEach(element => {
|
||||
element.icon = '设备'
|
||||
|
Loading…
Reference in New Issue
Block a user