 export  const  useType = [
  { value: '0', label: '专船件' },
  { value: '1', label: '标准件' }
]

 export  const ckCode=[
   { value: '03', label: '管系安装附件库' },
   { value: '04', label: '管系内场附件库' },
   { value: '04', label: '管系内场附件库' },
 ]


 export  const departCodeCode=[
   { value: '02', label: '管系制造部' },
   { value: '01', label: '铁舾制造部' },
   { value: '03', label: '单元制造部' },
 ]

 /**
  * 获取字典编码
  * @param name dictFormat, deptFormat,ddeptFormat,institutionFormat,ghsFormat,numberFormat
  * @param code
  */
 export function getDictValue(name, code,value){
   if(value===undefined){
     return ''
   }

   switch (name)
   {
     case 'dictFormat':
       const dict=window.localStorage.getItem(code);
       console.log(dict)
       if (!dict){
         return code;
       }
       let dictItems=JSON.parse(dict)
       for (const item of dictItems) {
         if (item.bm===value){
           return item.bmsm
         }
       }
       break;

     case 'deptFormat':
       let deptName=window.localStorage.getItem(value)
       // console.log(code)
       return deptName&&deptName!=='undefined'?deptName:value;
       break;

     case 'ddeptFormat':
       let deptName1=window.localStorage.getItem("d_"+value)
       return deptName1?deptName1:value;
       break;

     case 'institutionFormat':
       const dict1=window.localStorage.getItem(code);
       if (!dict1){
         return code;
       }
       let dictItems1=JSON.parse(dict1)
       for (const item of dictItems1) {
         if (item.institutionCode===value){
           return item.institutionName
         }
       }
       break;

     case 'ghsFormat':
       let deptName2=window.localStorage.getItem("ghs_"+value)
       return deptName2?deptName2:value;
       break;

     case 'jjxmFormt':
       let deptName3=window.localStorage.getItem("jjxm_"+value)
       return deptName3?deptName3:value;
       break;


   }

 }


