|  | @@ -334,7 +334,7 @@ import {getDeviceType} from "@/api/system/dict/data";
 | 
	
		
			
				|  |  |  import {
 | 
	
		
			
				|  |  |    addDevice,
 | 
	
		
			
				|  |  |    delDevice,
 | 
	
		
			
				|  |  | -  getDevice,
 | 
	
		
			
				|  |  | +  getDevice, getDictList,
 | 
	
		
			
				|  |  |    getDictTree, getDictTreeByParentId,
 | 
	
		
			
				|  |  |    getHostByOrgId,
 | 
	
		
			
				|  |  |    listDevice,
 | 
	
	
		
			
				|  | @@ -390,6 +390,7 @@ export default {
 | 
	
		
			
				|  |  |        //主机集合
 | 
	
		
			
				|  |  |        hostList: [],
 | 
	
		
			
				|  |  |        dictionaryTreeList: [],
 | 
	
		
			
				|  |  | +      dictionaryList: [],
 | 
	
		
			
				|  |  |        assetChildrenDictList: [],
 | 
	
		
			
				|  |  |        brandChildrenDictList: [],
 | 
	
		
			
				|  |  |        deviceType: 0,
 | 
	
	
		
			
				|  | @@ -468,6 +469,7 @@ export default {
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted() {
 | 
	
		
			
				|  |  |      this.initDictionaryTreeList();
 | 
	
		
			
				|  |  | +    this.initDictionaryList();
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -705,21 +707,17 @@ export default {
 | 
	
		
			
				|  |  |        this.changeSelect(this.dept);
 | 
	
		
			
				|  |  |        this.devices = null;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    changeSelectDevice(val) {
 | 
	
		
			
				|  |  | -      if (val) {
 | 
	
		
			
				|  |  | -        getDeviceType(val).then((response) => {
 | 
	
		
			
				|  |  | -          this.devices = response.data;
 | 
	
		
			
				|  |  | -          this.form.deviceType = null;
 | 
	
		
			
				|  |  | -          this.queryParams.deviceType = null;
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | -    },
 | 
	
		
			
				|  |  |      //获取字典数据
 | 
	
		
			
				|  |  |      initDictionaryTreeList() {
 | 
	
		
			
				|  |  |        getDictTree().then((response) => {
 | 
	
		
			
				|  |  |          this.dictionaryTreeList = response.data;
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    initDictionaryList() {
 | 
	
		
			
				|  |  | +      getDictList().then((response) => {
 | 
	
		
			
				|  |  | +        this.dictionaryList = response.data;
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      //从基础数据中获取资产分类
 | 
	
		
			
				|  |  |      getAssetDict(type, parentId) {
 | 
	
		
			
				|  |  |        let arr = []
 | 
	
	
		
			
				|  | @@ -728,12 +726,21 @@ export default {
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |        return arr;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    //从基础数据中获取资产分类
 | 
	
		
			
				|  |  | +    getAssetDictDetailInfo(id) {
 | 
	
		
			
				|  |  | +      let arr = []
 | 
	
		
			
				|  |  | +      this.dictionaryList.filter(item => item.id == id).map(item => {
 | 
	
		
			
				|  |  | +        arr.push(item);
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +      return arr;
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      assetSelectChange(val) {
 | 
	
		
			
				|  |  |        //改成数据库查询, children里面
 | 
	
		
			
				|  |  |        if (!val) return;
 | 
	
		
			
				|  |  |        this.form.deviceType = null;
 | 
	
		
			
				|  |  |        getDictTreeByParentId(val).then((response) => {
 | 
	
		
			
				|  |  |          this.assetChildrenDictList = response.data;
 | 
	
		
			
				|  |  | +        console.log('获取设备分类数据', this.assetChildrenDictList);
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      brandSelectChange(val) {
 | 
	
	
		
			
				|  | @@ -742,6 +749,7 @@ export default {
 | 
	
		
			
				|  |  |        this.form.deviceModel = null;
 | 
	
		
			
				|  |  |        getDictTreeByParentId(val).then((response) => {
 | 
	
		
			
				|  |  |          this.brandChildrenDictList = response.data;
 | 
	
		
			
				|  |  | +        console.log('获取设备型号数据', this.assetChildrenDictList);
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      clearAsset() {
 | 
	
	
		
			
				|  | @@ -753,11 +761,15 @@ export default {
 | 
	
		
			
				|  |  |        const id = row.id || this.ids;
 | 
	
		
			
				|  |  |        getDevice(id).then((response) => {
 | 
	
		
			
				|  |  |          this.form = response.data;
 | 
	
		
			
				|  |  | -        // this.form.inBook=response.data.inBook.toString();
 | 
	
		
			
				|  |  | -        this.devices = response.devices;
 | 
	
		
			
				|  |  | -        this.hostList = response.hostList;
 | 
	
		
			
				|  |  |          this.open = true;
 | 
	
		
			
				|  |  |          this.title = "编辑设备信息";
 | 
	
		
			
				|  |  | +        console.log(this.form.assetType,this.form.deviceBrand)
 | 
	
		
			
				|  |  | +        getDictTreeByParentId(this.form.assetType).then((response) => {
 | 
	
		
			
				|  |  | +          this.assetChildrenDictList = response.data;
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +        getDictTreeByParentId(this.form.deviceBrand).then((response) => {
 | 
	
		
			
				|  |  | +          this.brandChildrenDictList = response.data;
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      /** 提交按钮 */
 |