|
|
@ -677,9 +677,18 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
|
|
|
|
$scope.riskMaterial.material.forEach(element => {
|
|
|
|
$scope.riskMaterial.material.forEach(element => {
|
|
|
|
if (element.file) {
|
|
|
|
if (element.file) {
|
|
|
|
element.file.forEach((item, index) => {
|
|
|
|
element.file.forEach((item, index) => {
|
|
|
|
|
|
|
|
var type =item.indexOf('type');
|
|
|
|
|
|
|
|
console.log("====>type:"+type)
|
|
|
|
|
|
|
|
if(type>=0){
|
|
|
|
|
|
|
|
var fileObj= JSON.parse(item);
|
|
|
|
|
|
|
|
element.file[index] = { isImg: fileObj.isImg, type: fileObj.type, src: fileObj.src }
|
|
|
|
|
|
|
|
console.log("====>fileType:"+fileObj.type)
|
|
|
|
|
|
|
|
console.log("====>flag:"+fileObj.isImg)
|
|
|
|
|
|
|
|
}else{
|
|
|
|
const fileType = item.substring(item.lastIndexOf('.')).toLowerCase()
|
|
|
|
const fileType = item.substring(item.lastIndexOf('.')).toLowerCase()
|
|
|
|
const flag = reg.test(item.substring(item.lastIndexOf('.')).toLowerCase())
|
|
|
|
const flag = reg.test(item.substring(item.lastIndexOf('.')).toLowerCase())
|
|
|
|
element.file[index] = { isImg: flag, type: fileType, src: item }
|
|
|
|
element.file[index] = { isImg: flag, type: fileType, src: item }
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|