export function fileListToStr(fileList){
  var result = "";
  result  = JSON.stringify(fileList)
  return result;
}


export function strToFileList(str){
  var files = []
  if(str!=='' && str!==null && str!=='null' && str!==undefined){
      files = JSON.parse(str)
      //files = [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}]
  }
  return files;
}

export function strToHerf(str){
  if(str!=='' && str!==null && str !=='null' && str!==undefined){
    var hrefs = "";
    var files = JSON.parse(str);
    var file =[];
    for(var i = 0;i<files.length;i++){
      file = files[i];
      //hrefs="<el-link type=\"primary\">主要链接</el-link>";

      hrefs = hrefs + "<a href="+'#'+" @click="+"\""+"javascript:download('"+file.fileId+"','"+file.name+"')"+"\""+">"+file.name+"</a><br>"
    }
  }
  return hrefs
}

export function checkNull(value){
  var result = false;
  if(value=='' || value == null || value=='null'){
      result = true;
  }
  return result;
}

