|
@@ -73,26 +73,6 @@
|
|
import {BeatchQueryParam, getDataDictionary, queryEquip} from "@/api/scan/request";
|
|
import {BeatchQueryParam, getDataDictionary, queryEquip} from "@/api/scan/request";
|
|
import {mapGetters} from "vuex";
|
|
import {mapGetters} from "vuex";
|
|
|
|
|
|
- function flattenKeys(obj) {
|
|
|
|
- let res = {}
|
|
|
|
-
|
|
|
|
- function isObject(val) {
|
|
|
|
- return typeof val === 'object' && !Array.isArray(val)
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function digKeys(prev, obj) {
|
|
|
|
- Object.entries(obj).forEach(([key, value]) => {
|
|
|
|
- const currentKey = prev ? `${prev}.${key}` : key
|
|
|
|
- if (isObject(value)) {
|
|
|
|
- digKeys(currentKey, value)
|
|
|
|
- } else {
|
|
|
|
- res[currentKey] = value
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- digKeys('', obj)
|
|
|
|
- return res
|
|
|
|
- }
|
|
|
|
export default {
|
|
export default {
|
|
name: "deviceDetails",
|
|
name: "deviceDetails",
|
|
components: {
|
|
components: {
|
|
@@ -212,7 +192,7 @@
|
|
this.name = this.exampleData.EquipLocalName?this.exampleData.EquipLocalName:this.exampleData.EquipName?this.exampleData.EquipName:'';
|
|
this.name = this.exampleData.EquipLocalName?this.exampleData.EquipLocalName:this.exampleData.EquipName?this.exampleData.EquipName:'';
|
|
this.code = this.exampleData.EquipLocalID?this.exampleData.EquipLocalID:'';
|
|
this.code = this.exampleData.EquipLocalID?this.exampleData.EquipLocalID:'';
|
|
let obj = this.deepCopy(values[1].Content[0]);
|
|
let obj = this.deepCopy(values[1].Content[0]);
|
|
- obj = flattenKeys(obj);
|
|
|
|
|
|
+ obj = tools.flattenKeys(obj);
|
|
this.instance = obj;
|
|
this.instance = obj;
|
|
this.handleRadios(1)
|
|
this.handleRadios(1)
|
|
this.pointData.forEach(item => {
|
|
this.pointData.forEach(item => {
|