risk 文件下载问题

master
dalong306 3 years ago
parent eeec5810e5
commit c084cbd9cb

@ -9,7 +9,7 @@
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId> <artifactId>manage</artifactId>
<version>2.4.13</version> <version>2.4.14</version>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version> <jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>

@ -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 }
}
}) })
} }
}) })

@ -54,9 +54,9 @@
<div ng-repeat="file in (item.file) track by $index"> <div ng-repeat="file in (item.file) track by $index">
<img ng-if="file.isImg" class="col-xs-3 logo-width" ng-src="{{file.src}}"> <img ng-if="file.isImg" class="col-xs-3 logo-width" ng-src="{{file.src}}">
<a ng-if="!file.isImg" href="{{file.src}}"> <a ng-if="!file.isImg" href="{{file.src}}">
<i ng-if="file.type === '.zip'" class="fa fa-file-archive-o" aria-hidden="true"></i> <i ng-if="file.type == '.zip'" class="fa fa-file-archive-o" aria-hidden="true"></i>
<i ng-if="file.type === '.pdf'" class="fa fa-file-pdf-o" aria-hidden="true"></i> <i ng-if="file.type == '.pdf'" class="fa fa-file-pdf-o" aria-hidden="true"></i>
<i ng-if="file.type !== '.pdf' && file.type !== '.zip'" class="fa fa-file-text" <i ng-if="file.type != '.pdf' && file.type != '.zip'" class="fa fa-file-text"
aria-hidden="true"></i> aria-hidden="true"></i>
<span style="font-size: 12px">download</span> <span style="font-size: 12px">download</span>
</a> </a>

Loading…
Cancel
Save