import ObjConfig from '../../../src/plugins/GerJsonObjectConfig'

import Vue from "vue";

describe.only('配置文件转换', () => {


  it.only('数组对象转换对象', async () => {
  var arr =   {
    "燃气表": {
      "index": 1,
      "checkmust": true,
      "items": {
        "表具故障": {
          "index": 13,
          "multiple": true,
          "type": "selector",
          "options": [{"data": "死表", "isdefect": true, "level": "安检维修"}, {
            "data": "常通",
            "isdefect": true,
            "level": "安检维修"
          }, {"data": "表体漏气", "isdefect": true, "level": "一级隐患安检维修"}, {
            "data": "接口漏气",
            "isdefect": true,
            "level": "一级隐患安检维修"
          }, {"data": "偷气", "isdefect": true, "level": "一级隐患"}, {"data": "反装", "isdefect": true}, {
            "data": "气量不符",
            "isdefect": true,
            "level": "安检维修"
          }, {"data": "其他", "isdefect": true, "level": "一级隐患"}]
        },
        "其他": {"index": 14, "isshow": false, "type": "string"},
        "表具隐患类型": {
          "index": 15,
          "multiple": true,
          "type": "selector",
          "options": [{"data": "挂物", "isdefect": true}, {"data": "包裹", "isdefect": true}, {
            "data": "不便维修",
            "isdefect": true
          }, {"data": "封闭包裹", "isdefect": true, "level": "一级隐患"}, {
            "data": "与电源或火源过近",
            "isdefect": true,
            "level": "三级隐患"
          }]
        }
      }
    },
    "报警器": {
      "index": 2,
      "checkmust": true,
      "items": {
        "有否": {
          "index": 1,
          "multiple": false,
          "type": "selector",
          "options": [{"data": "有", "isdefect": false, "isdefault": true}, {"data": "无", "isdefect": false}]
        },
        "厂家": {
          "index": 2,
          "multiple": false,
          "isshow": false,
          "type": "selector",
          "options": [{"data": "汉威", "isdefect": false}, {"data": "鑫豪斯", "isdefect": false}, {
            "data": "友谊",
            "isdefect": false
          }, {"data": "其他", "isdefect": false}, {"data": "富昌", "isdefect": false}, {"data": "科信", "isdefect": false}]
        },
        "安装时间": {"index": 3, "isshow": false, "type": "date"},
        "到期时间": {"index": 4, "isshow": false, "type": "date"},
        "是否通电": {
          "index": 5,
          "multiple": false,
          "isshow": false,
          "type": "selector",
          "options": [{"data": "是", "isdefect": false, "isdefault": true}, {"data": "否", "isdefect": true}]
        },
        "安装渠道": {
          "index": 6,
          "isshow": false,
          "multiple": false,
          "type": "selector",
          "options": [{"data": "惠众", "isdefect": false}, {"data": "其他", "isdefect": false}]
        },
        "电磁阀接口漏气": {
          "index": 7,
          "multiple": false,
          "isshow": false,
          "type": "selector",
          "options": [{"data": "否", "isdefect": false, "isdefault": true}, {
            "data": "是",
            "isdefect": true,
            "level": "一级隐患安检维修"
          }]
        }
      }
    }
  }
    var obj = ObjConfig.getObjConfig(arr)
    console.log(JSON.stringify(obj))

  })


})
