|
@@ -1110,30 +1110,11 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
|
1110
|
1110
|
uploader.filters.push({
|
1111
|
1111
|
name: "customFilter",
|
1112
|
1112
|
fn: function (item /*{File|FileLikeObject}*/, options) {
|
1113
|
|
- return this.queue.length < 10;
|
|
1113
|
+ return this.queue.length < 10;
|
1114
|
1114
|
},
|
1115
|
1115
|
});
|
1116
|
1116
|
|
1117
|
|
- $scope.dropfile = function (
|
1118
|
|
- APIService,
|
1119
|
|
- processInstanceId,
|
1120
|
|
- taskId,
|
1121
|
|
- userId
|
1122
|
|
- ) {
|
1123
|
|
- uploader.onBeforeUploadItem = function (item) {
|
1124
|
|
- angular.extend(item.headers, $rootScope.getSession());
|
1125
|
|
- item.url = APIService.addFile(
|
1126
|
|
- processInstanceId,
|
1127
|
|
- taskId,
|
1128
|
|
- userId
|
1129
|
|
- ).getRequestedUrl();
|
1130
|
|
- item.formData.push({
|
1131
|
|
- fileName: item.file.name,
|
1132
|
|
- });
|
1133
|
|
- console.info("onBeforeUploadItem", item);
|
1134
|
|
- };
|
1135
|
|
- uploader.uploadAll();
|
1136
|
|
- };
|
|
1117
|
+
|
1137
|
1118
|
|
1138
|
1119
|
// CALLBACKS
|
1139
|
1120
|
uploader.onWhenAddingFileFailed = function (
|
|
@@ -1144,7 +1125,26 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
|
1144
|
1125
|
console.info("onWhenAddingFileFailed", item, filter, options);
|
1145
|
1126
|
};
|
1146
|
1127
|
uploader.onAfterAddingFile = function (fileItem) {
|
|
1128
|
+ console.log(fileItem.file)
|
1147
|
1129
|
console.info("onAfterAddingFile", fileItem);
|
|
1130
|
+ if (fileItem.file.size >= 1024 * 1024 * 10) {
|
|
1131
|
+ alert("文件不能大于10MB");
|
|
1132
|
+ fileItem.uploader.queue.pop();
|
|
1133
|
+ console.log($scope);
|
|
1134
|
+ }
|
|
1135
|
+
|
|
1136
|
+ if (
|
|
1137
|
+ fileItem.file.type !== 'text/plain'
|
|
1138
|
+ && fileItem.file.type !== 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
1139
|
+ && fileItem.file.type !== 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
|
|
1140
|
+ && fileItem.file.type !== 'application/pdf'
|
|
1141
|
+ && fileItem.file.type !== 'application/vnd.ms-excel'
|
|
1142
|
+ && fileItem.file.type !== 'application/msword'
|
|
1143
|
+ ) {
|
|
1144
|
+ alert("只能上传word,excel,pdf,txt");
|
|
1145
|
+ fileItem.uploader.queue.pop();
|
|
1146
|
+ console.log($scope);
|
|
1147
|
+ }
|
1148
|
1148
|
};
|
1149
|
1149
|
uploader.onAfterAddingAll = function (addedFileItems) {
|
1150
|
1150
|
console.info("onAfterAddingAll", addedFileItems);
|
|
@@ -1271,6 +1271,14 @@ app.controller('incidentListCtrl', ["$scope", "$http", "i18nService", "$rootScop
|
1271
|
1271
|
console.log(response)
|
1272
|
1272
|
$rootScope.isMask = false;
|
1273
|
1273
|
if (response.state == 200) {
|
|
1274
|
+ uploader.onBeforeUploadItem = function (item) {
|
|
1275
|
+ angular.extend(item.headers, $rootScope.getSession());
|
|
1276
|
+ item.url = api_bpm_domain.uploadAttachmentJryModel("handleAttachment", response.data.id).getRequestedUrl();
|
|
1277
|
+ item.formData.push({ 'fileName': item.file.name });
|
|
1278
|
+ console.info('onBeforeUploadItem', item);
|
|
1279
|
+ };
|
|
1280
|
+ uploader.uploadAll();
|
|
1281
|
+
|
1274
|
1282
|
Alert.swal({
|
1275
|
1283
|
title: "操作成功!",
|
1276
|
1284
|
confirmButtonColor: "#007AFF",
|