🐞fix(royalpay): 修复风控中心风控材料文件显示bug

master
xiao.tang 4 years ago
parent cf20ef1ff6
commit 34340abe32

@ -672,6 +672,18 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function (resp) { $http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function (resp) {
$scope.riskMaterial = resp.data; $scope.riskMaterial = resp.data;
const reg = /\.(png|jpg|gif|jpeg|bmp)$/
console.log()
$scope.riskMaterial.material.forEach(element => {
if (element.file) {
element.file.forEach((item, index) => {
const fileType = item.substring(item.lastIndexOf('.')).toLowerCase()
const flag = reg.test(item.substring(item.lastIndexOf('.')).toLowerCase())
element.file[index] = { isImg: flag, type: fileType, src: item }
})
}
})
console.log($scope.riskMaterial)
}); });
}; };
$scope.loadRiskMaterial(); $scope.loadRiskMaterial();
@ -684,6 +696,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
if (files && files.length) { if (files && files.length) {
let urls = []; let urls = [];
let value = 0; let value = 0;
const reg = /\.(png|jpg|gif|jpeg|bmp)$/
$scope.riskMaterial.material[index].fileProgressValue = 0; $scope.riskMaterial.material[index].fileProgressValue = 0;
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
let file = files[i]; let file = files[i];
@ -691,7 +704,10 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
url: '/attachment/riskFiles', url: '/attachment/riskFiles',
data: { file: file } data: { file: file }
}).then(function (resp) { }).then(function (resp) {
urls.push(resp.data.url); const fileType = resp.data.url.substring(resp.data.url.lastIndexOf('.')).toLowerCase()
const flag = reg.test(resp.data.url.substring(resp.data.url.lastIndexOf('.')).toLowerCase())
urls.push({ isImg: flag, type: fileType, src: resp.data.url })
// urls.push(resp.data.url);
delete $scope.riskMaterial.material[index].fileProgressValue; delete $scope.riskMaterial.material[index].fileProgressValue;
}, function (resp) { }, function (resp) {
delete $scope.riskMaterial.material[index].fileProgressValue; delete $scope.riskMaterial.material[index].fileProgressValue;

@ -9,17 +9,14 @@
</style> </style>
<div class="panel panel-default" ng-if="fileLength != 0"> <div class="panel panel-default" ng-if="fileLength != 0">
<div class="panel-heading">Audit Files &nbsp;&nbsp;&nbsp; <div class="panel-heading">Audit Files &nbsp;&nbsp;&nbsp;
<a class="btn-group btn btn-success" <a class="btn-group btn btn-success" ng-href="{{downloadAsZip()}}" target="_blank">
ng-href="{{downloadAsZip()}}"
target="_blank">
<i class="fa fa-cloud-download">一键下载</i> <i class="fa fa-cloud-download">一键下载</i>
</a> </a>
<a class="btn-group btn btn-success pull-right" <a class="btn-group btn btn-success pull-right"
ng-if="(riskEvent.result_type == 2 || riskEvent.result_type == 1) && ('10000000000'|withRole)" ng-if="(riskEvent.result_type == 2 || riskEvent.result_type == 1) && ('10000000000'|withRole)"
ng-click="auditMaterial(3)">通过 ng-click="auditMaterial(3)">通过
</a> </a>
<a class="btn-group btn btn-warning pull-right" <a class="btn-group btn btn-warning pull-right" ng-if="riskEvent.result_type == 2 && ('10000000000'|withRole)"
ng-if="riskEvent.result_type == 2 && ('10000000000'|withRole)"
ng-click="auditMaterial(4)" style="margin: 0 10px">打回 ng-click="auditMaterial(4)" style="margin: 0 10px">打回
</a> </a>
</div> </div>
@ -42,27 +39,28 @@
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<div class="col-xs-12"> <div class="col-xs-12">
<button class="btn btn-primary" <button class="btn btn-primary" type="button"
type="button"
ng-if="uploadShowFlag && ('10000000000'|withRole)" ng-if="uploadShowFlag && ('10000000000'|withRole)"
ngf-select="uploadFile($files, $index)" ngf-select="uploadFile($files, $index)" ngf-multiple="true">
ngf-multiple="true">
<i class="fa fa-upload"></i> Upload <i class="fa fa-upload"></i> Upload
</button> </button>
</div> </div>
&nbsp;&nbsp;<br> &nbsp;&nbsp;<br>
<div class="col-xs-12"> <div class="col-xs-12">
<uib-progressbar value="item.fileProgressValue" <uib-progressbar value="item.fileProgressValue" type="success" animate="true"
type="success" ng-if="item.fileProgressValue" max="100" ng-if="uploadShowFlag">
animate="true" {{item.fileProgressValue}}%</uib-progressbar>
ng-if="item.fileProgressValue"
max="100"
ng-if="uploadShowFlag"
>{{item.fileProgressValue}}%</uib-progressbar>
<img class="col-xs-3 logo-width" <div ng-repeat="file in (item.file) track by $index">
ng-repeat="url in (item.file) track by $index" <img ng-if="file.isImg" class="col-xs-3 logo-width" ng-src="{{file.src}}">
ng-src="{{url}}"> <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 === '.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"
aria-hidden="true"></i>
<span style="font-size: 12px">download</span>
</a>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -70,11 +68,8 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-2">Description</label> <label class="control-label col-sm-2">Description</label>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea class="form-control" required <textarea class="form-control" required ng-model="riskMaterial.description"
ng-model="riskMaterial.description" placeholder="No more than 500" name="description" ng-disabled="!uploadShowFlag"
placeholder="No more than 500"
name="description"
ng-disabled="!uploadShowFlag"
maxlength="500"></textarea> maxlength="500"></textarea>
</div> </div>
</div> </div>
@ -83,15 +78,10 @@
</form> </form>
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
<a role="button" id="test-btn" <a role="button" id="test-btn" ui-sref="^.^" class="btn btn-info">返回
ui-sref="^.^"
class="btn btn-info">返回
</a> </a>
<button <button class="btn btn-success" ng-disabled="!uploadShowFlag || (!riskMaterial.description)"
class="btn btn-success" ng-if="uploadShowFlag && ('10000000000'|withRole)" ng-click="submit(uploadForm);">Submit</button>
ng-disabled="!uploadShowFlag || (!riskMaterial.description)"
ng-if="uploadShowFlag && ('10000000000'|withRole)"
ng-click="submit(uploadForm);">Submit</button>
</div> </div>
</div> </div>
Loading…
Cancel
Save