Merge remote-tracking branch 'origin/develop' into develop

master
yixian 4 years ago
commit 3c00929fc2

@ -672,6 +672,17 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
$http.get('/risk/business/' + $scope.riskEvent.risk_id + '/all_material_info').then(function (resp) {
$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 }
})
}
})
});
};
$scope.loadRiskMaterial();
@ -684,6 +695,7 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
if (files && files.length) {
let urls = [];
let value = 0;
const reg = /\.(png|jpg|gif|jpeg|bmp)$/
$scope.riskMaterial.material[index].fileProgressValue = 0;
for (let i = 0; i < files.length; i++) {
let file = files[i];
@ -691,7 +703,10 @@ define(['angular', 'jquery', 'uiRouter', './monitoring/analysis-monitoring'],
url: '/attachment/riskFiles',
data: { file: file }
}).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;
}, function (resp) {
delete $scope.riskMaterial.material[index].fileProgressValue;

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