Browse Source

反馈的bug

luyanan 6 years ago
parent
commit
0f66043158

+ 25 - 17
cmp-portal/js/articalIssue.js

36
				multiple: false
36
				multiple: false
37
			}
37
			}
38
		});
38
		});
39
		uploaderFile.on('error', function(code) {
40
			if(code=="F_EXCEED_SIZE"){
41
				$.MsgBox.Alert('提示', '上传附件的大小不超过50M')
42
			}
43
		});
39
		var fileId;
44
		var fileId;
40
		// 当有文件添加进来的时候
45
		// 当有文件添加进来的时候
41
		uploaderFile.on('fileQueued', function(file) {
46
		uploaderFile.on('fileQueued', function(file) {
42
			fileId = file.id;
47
			fileId = file.id;
43
			var $li = $(
44
				'<li class="file_list ellipsisSty-2" data-id="'+file.id+'" data-size="'+file.size+'" data-name="'+file.name+'">'+
45
					file.name +
46
					'<div class="deleteThis"></div>'+
47
				'</li>'
48
			),
49
				$file = $li.find('li');
50
			var $list = $("#fileAttachList");
51
			$list.prepend($li);
52
			var $len = $("#fileAttachList").find("li").length;
53
			if($len>0 && $len<5){
54
				$("#upAttachPicker").addClass("upAtteched")
55
				$("#upAttachPicker>.webuploader-pick").text('继续上传')
56
			}
57
			if($len>=5){
58
				$("#upAttachPicker").hide()
59
			}
48
		});
49
		uploaderFile.on('uploadError', function(file, data) {
50
			$.MsgBox.Alert('提示', '该附件上传失败,请重试')
60
		});
51
		});
61
		uploaderFile.on('uploadSuccess', function(file, data) {
52
		uploaderFile.on('uploadSuccess', function(file, data) {
62
			if(data.success) {
53
			if(data.success) {
54
				var $li = $(
55
					'<li class="file_list ellipsisSty-2" data-id="'+file.id+'" data-size="'+file.size+'" data-name="'+file.name+'">'+
56
						file.name +
57
						'<div class="deleteThis"></div>'+
58
					'</li>'
59
				),
60
					$file = $li.find('li');
61
				var $list = $("#fileAttachList");
62
				$list.prepend($li);
63
				var $len = $("#fileAttachList").find("li").length;
64
				if($len>0 && $len<5){
65
					$("#upAttachPicker").addClass("upAtteched")
66
					$("#upAttachPicker>.webuploader-pick").text('继续上传')
67
				}
68
				if($len>=5){
69
					$("#upAttachPicker").hide()
70
				}
63
				uploaderFile.removeFile(fileId);
71
				uploaderFile.removeFile(fileId);
64
				$("#fileAttachList li:first-child").attr("data-url",data.data[0].uri);
72
				$("#fileAttachList li:first-child").attr("data-url",data.data[0].uri);
65
			}
73
			}

+ 25 - 18
cmp-portal/js/articalModify.js

41
				multiple: false
41
				multiple: false
42
			}
42
			}
43
		});
43
		});
44
		uploaderFile.on('error', function(code) {
45
			if(code=="F_EXCEED_SIZE"){
46
				$.MsgBox.Alert('提示', '上传附件的大小不超过50M')
47
			}
48
		});
44
		var fileId;
49
		var fileId;
45
		// 当有文件添加进来的时候
50
		// 当有文件添加进来的时候
46
		uploaderFile.on('fileQueued', function(file) {
51
		uploaderFile.on('fileQueued', function(file) {
47
			fileId = file.id;
52
			fileId = file.id;
48
			var $li = $(
49
				'<li class="file_list ellipsisSty-2" data-id="'+file.id+'" data-size="'+file.size+'" data-name="'+file.name+'">'+
50
					file.name +
51
					'<div class="deleteThis"></div>'+
52
				'</li>'
53
			),
54
				$file = $li.find('li');
55
			var $list = $("#fileAttachList");
56
			$list.prepend($li);
57
			var $len = $("#fileAttachList").find("li").length;
58
			if($len>0 && $len<5){
59
				$("#upAttachPicker").addClass("upAtteched")
60
				$("#upAttachPicker>.webuploader-pick").text('继续上传')
61
			}
62
			if($len>=5){
63
				$("#upAttachPicker").hide()
64
			}
53
		});
54
		uploaderFile.on('uploadError', function(file, data) {
55
			$.MsgBox.Alert('提示', '该附件上传失败,请重试')
65
		});
56
		});
66
		uploaderFile.on('uploadSuccess', function(file, data) {
57
		uploaderFile.on('uploadSuccess', function(file, data) {
67
			if(data.success) {
58
			if(data.success) {
59
				var $li = $(
60
					'<li class="file_list ellipsisSty-2" data-id="'+file.id+'" data-size="'+file.size+'" data-name="'+file.name+'">'+
61
						file.name +
62
						'<div class="deleteThis"></div>'+
63
					'</li>'
64
				),
65
					$file = $li.find('li');
66
				var $list = $("#fileAttachList");
67
				$list.prepend($li);
68
				var $len = $("#fileAttachList").find("li").length;
69
				if($len>0 && $len<5){
70
					$("#upAttachPicker").addClass("upAtteched")
71
					$("#upAttachPicker>.webuploader-pick").text('继续上传')
72
				}
73
				if($len>=5){
74
					$("#upAttachPicker").hide()
75
				}
68
				uploaderFile.removeFile(fileId);
76
				uploaderFile.removeFile(fileId);
69
				$("#fileAttachList li:first-child").attr("data-url",data.data[0].uri);
77
				$("#fileAttachList li:first-child").attr("data-url",data.data[0].uri);
70
			}
78
			}
71
		});
79
		});
72

73
	//校验标题
80
	//校验标题
74
	$("#newstitle").on({
81
	$("#newstitle").on({
75
		focus: function() {
82
		focus: function() {

+ 1 - 1
cmp-portal/js/cmp-productIssue.js

116
		accept: {
116
		accept: {
117
			title: 'Images',
117
			title: 'Images',
118
			extensions: 'jpg,jpeg,png',
118
			extensions: 'jpg,jpeg,png',
119
			mimeTypes: 'image/jpg,image/png'
119
			mimeTypes: 'image/jpg,image/png,image/jpeg'
120
		}
120
		}
121

121

122
	});
122
	});

+ 1 - 1
cmp-portal/js/resourceIssue.js

113
			accept: {
113
			accept: {
114
				title: 'Images',
114
				title: 'Images',
115
				extensions: 'jpg,jpeg,png',
115
				extensions: 'jpg,jpeg,png',
116
				mimeTypes: 'image/jpg,image/png'
116
				mimeTypes: 'image/jpg,image/png,image/jpeg'
117
			}
117
			}
118
	
118
	
119
		});
119
		});

+ 1 - 1
js/articalPreview.js

139
						var itlist = '<li>'+
139
						var itlist = '<li>'+
140
							'<span class="atach-name ellipsisSty">'+data.data[i].name+'</span>'+
140
							'<span class="atach-name ellipsisSty">'+data.data[i].name+'</span>'+
141
							'<span class="atach-size">'+sizeTo(data.data[i].size)+'</span>'+
141
							'<span class="atach-size">'+sizeTo(data.data[i].size)+'</span>'+
142
							'<a href="/data/article/file'+data.data[i].url+'?_dl='+data.data[i].name+'" class="atach-down">点击下载</a>'+
142
							'<a href="/data/article/file'+data.data[i].url+'" class="atach-down">点击下载</a>'+
143
						'</li>'
143
						'</li>'
144
						$("#atachList").append(itlist);
144
						$("#atachList").append(itlist);
145
					}
145
					}

+ 1 - 1
js/articalShow.js

59
						var itlist = '<li>'+
59
						var itlist = '<li>'+
60
							'<span class="atach-name ellipsisSty">'+data.data[i].name+'</span>'+
60
							'<span class="atach-name ellipsisSty">'+data.data[i].name+'</span>'+
61
							'<span class="atach-size">'+sizeTo(data.data[i].size)+'</span>'+
61
							'<span class="atach-size">'+sizeTo(data.data[i].size)+'</span>'+
62
							'<a href="/data/article/file'+data.data[i].url+'?_dl='+data.data[i].name+'" class="atach-down">点击下载</a>'+
62
							'<a href="/data/article/file'+data.data[i].url+'" class="atach-down">点击下载</a>'+
63
						'</li>'
63
						'</li>'
64
						$("#atachList").append(itlist);
64
						$("#atachList").append(itlist);
65
					}
65
					}

+ 1 - 1
js/articalShow2.js

58
						var itlist = '<li>'+
58
						var itlist = '<li>'+
59
							'<span class="atach-name ellipsisSty">'+data.data[i].name+'</span>'+
59
							'<span class="atach-name ellipsisSty">'+data.data[i].name+'</span>'+
60
							'<span class="atach-size">'+sizeTo(data.data[i].size)+'</span>'+
60
							'<span class="atach-size">'+sizeTo(data.data[i].size)+'</span>'+
61
							'<a href="/data/article/file'+data.data[i].url+'?_dl='+data.data[i].name+'" class="atach-down">点击下载</a>'+
61
							'<a href="/data/article/file'+data.data[i].url+'" class="atach-down">点击下载</a>'+
62
						'</li>'
62
						'</li>'
63
						$("#atachList").append(itlist);
63
						$("#atachList").append(itlist);
64
					}
64
					}

+ 4 - 3
js/discover.js

111
			accept: {
111
			accept: {
112
				title: 'Images',
112
				title: 'Images',
113
				extensions: 'jpg,jpeg,png',
113
				extensions: 'jpg,jpeg,png',
114
				mimeTypes: 'image/jpg,image/png'
114
				mimeTypes: 'image/jpg,image/jpeg,image/png'
115
			}
115
			}
116
	
116
	
117
		});
117
		});
156
			}, 1, 1);
156
			}, 1, 1);
157
		});
157
		});
158
		uploader.onError = function(code) {
158
		uploader.onError = function(code) {
159
			console.log(code)
160
			$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过2M')
159
			if(code=="F_EXCEED_SIZE"){
160
				$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过2M')	
161
			}
161
		};
162
		};
162
		uploader.on('uploadSuccess', function(file, data) {
163
		uploader.on('uploadSuccess', function(file, data) {
163
			if(data.success) {
164
			if(data.success) {

+ 1 - 1
js/resourceIssue.js

118
		accept: {
118
		accept: {
119
			title: 'Images',
119
			title: 'Images',
120
			extensions: 'jpg,jpeg,png',
120
			extensions: 'jpg,jpeg,png',
121
			mimeTypes: 'image/jpg,image/png'
121
			mimeTypes: 'image/jpg,image/png,image/jpeg'
122
		}
122
		}
123

123

124
	});
124
	});