diff --git a/src/pages/device/deviceInfo/index.jsx b/src/pages/device/deviceInfo/index.jsx index 498de2a..ab16eae 100644 --- a/src/pages/device/deviceInfo/index.jsx +++ b/src/pages/device/deviceInfo/index.jsx @@ -107,11 +107,26 @@ const GoodsTypeManage = () => { }; function initOrgList() { gettree().then((r) => { + inittree(r.data); + function inittree(datas) { + for (var i in datas) { + if( datas[i]['type']==2|| datas[i]['type']==3){ + datas[i]['disabled']=false; + }else{ + datas[i]['disabled']=true; + } + + if (datas[i].children) { + inittree(datas[i].children); + } + } + } setOrgList(r.data); let list = {}; formateData(r.data); function formateData(datas) { for (var i in datas) { + list[datas[i]['disabled']]=true; list[datas[i]['value']] = { text: datas[i]['title'] }; if (datas[i].children) { formateData(datas[i].children); @@ -241,7 +256,7 @@ const GoodsTypeManage = () => { 更新 , { record.status = record.status == 0 ? 1 : 0; UpdateDeviceInfo(record).then((r) => {