Browse Source

附件上传

zhuth 6 years ago
parent
commit
4121cdba43

+ 2 - 2
frontend/pc-web/app/view/Interaction/notice/SchoolNotice.js

@@ -12,9 +12,9 @@ Ext.define('school.view.interaction.notice.SchoolNotice', {
     _title: '学校通知',
     _title: '学校通知',
     _idField: 'notify_id',
     _idField: 'notify_id',
     _codeField: null,
     _codeField: null,
-    // _readUrl: 'http://10.1.80.180:9520/api/school/notice/read',
+    // _readUrl: 'http://10.1.80.101:9520/api/school/notice/read',
     _readUrl: '/api/school/notice/read',
     _readUrl: '/api/school/notice/read',
-    // _saveUrl: 'http://10.1.80.180:9520/api/school/notice/save',
+    // _saveUrl: 'http://10.1.80.101:9520/api/school/notice/save',
     _saveUrl: '/api/school/notice/save',
     _saveUrl: '/api/school/notice/save',
     _deleteUrl: '/api/school/notice/delete',
     _deleteUrl: '/api/school/notice/delete',
     initId: 0,
     initId: 0,

+ 2 - 2
frontend/pc-web/app/view/basic/student/StudentDetail.js

@@ -13,9 +13,9 @@ Ext.define('school.view.basic.student.StudentDetail', {
     _statusCodeField: null,
     _statusCodeField: null,
     _auditmanField: null,
     _auditmanField: null,
     _auditdateField: null,
     _auditdateField: null,
-    // _readUrl: 'http://10.1.80.36:9520/api/school/student/read',
+    // _readUrl: 'http://10.1.80.101:9520/api/school/student/read',
     _readUrl: '/api/school/student/read',
     _readUrl: '/api/school/student/read',
-    // _saveUrl: 'http://10.1.80.36:9520/api/school/student/save',
+    // _saveUrl: 'http://10.1.80.101:9520/api/school/student/save',
     _saveUrl: '/api/school/student/save',
     _saveUrl: '/api/school/student/save',
     // _deleteUrl: 'http://10.1.80.47:9560/student/delete',
     // _deleteUrl: 'http://10.1.80.47:9560/student/delete',
     _deleteUrl: '/api/school/student/delete',
     _deleteUrl: '/api/school/student/delete',

+ 13 - 9
frontend/pc-web/app/view/core/form/field/FileField.js

@@ -9,6 +9,7 @@ Ext.define('school.view.core.form.field.FileField', {
 	multi: true,
 	multi: true,
 	allowBlank:true,
 	allowBlank:true,
 	isFormField: true,
 	isFormField: true,
+    defaultBindProperty: 'value',
 	initComponent: function() {
 	initComponent: function() {
 		this.columnWidth = 1;//强制占一行
 		this.columnWidth = 1;//强制占一行
 		this.cls = '';
 		this.cls = '';
@@ -58,7 +59,7 @@ Ext.define('school.view.core.form.field.FileField', {
 	setValue: function(value){
 	setValue: function(value){
 		this.value = value;
 		this.value = value;
 		this.dirty = true;
 		this.dirty = true;
-		this.ownerCt.viewModel.data[this.name] = this.value
+		this.publishState('value', value);
 	},
 	},
 	getValue: function (){
 	getValue: function (){
 		return this.down('hidden').value;
 		return this.down('hidden').value;
@@ -85,7 +86,7 @@ Ext.define('school.view.core.form.field.FileField', {
 		fd.append('folderId', 0);
 		fd.append('folderId', 0);
 		form.setLoading(true);
 		form.setLoading(true);
 		Ext.Ajax.request({
 		Ext.Ajax.request({
-			// url: 'http://10.1.80.180:9520/api/file/upload',//这里是填写需要跨域访问的URL
+			// url: 'http://10.1.80.101:9520/api/file/upload',//这里是填写需要跨域访问的URL
 			url: '/api/file/upload',//这里是填写需要跨域访问的URL
 			url: '/api/file/upload',//这里是填写需要跨域访问的URL
 			cors: true,
 			cors: true,
 			useDefaultXhrHeader: false,
 			useDefaultXhrHeader: false,
@@ -112,14 +113,17 @@ Ext.define('school.view.core.form.field.FileField', {
 							columnWidth: w,
 							columnWidth: w,
 							readOnly: false,
 							readOnly: false,
 							editable: false,
 							editable: false,
+							accessPath: data.accessPath,
 							filepath: data.fullPath,
 							filepath: data.fullPath,
 							filesize: data.size,
 							filesize: data.size,
 							_id:data.id,
 							_id:data.id,
 							fieldStyle: 'background:#E0EEEE;'
 							fieldStyle: 'background:#E0EEEE;'
 						});
 						});
 						me.add(field);
 						me.add(field);
-						var val = (me.value || '') + data.id + ';';
-						// //添加FilePath表的ID
+						var oldValue = me.value;
+						var arr = oldValue ? oldValue.replace(/[ \[ | \] ]/g, '').split(',') : [];
+						arr.push(data.accessPath);
+						var val = '[' + arr.join(',') + ']';
 						me.setValue(val);
 						me.setValue(val);
 					}
 					}
 				}else{
 				}else{
@@ -134,19 +138,19 @@ Ext.define('school.view.core.form.field.FileField', {
 		});
 		});
 	},
 	},
 	/**
 	/**
-	 * 根据id读取对应PATH
-	 * @param id{String} fp_id
+	 * 根据PATHS读取对应文件信息
+	 * @param paths
 	 */
 	 */
-	download: function(id,name){
+	download: function(paths,name){
 		var me = this;
 		var me = this;
 		me.clearAll();
 		me.clearAll();
 		var files = new Array();	
 		var files = new Array();	
 		Ext.Ajax.request({
 		Ext.Ajax.request({
-			// url : 'http://10.1.80.180:9520/api/file/info',
+			// url : 'http://10.1.80.101:9520/api/file/info',
 			url : '/api/file/info',
 			url : '/api/file/info',
 			async: false,
 			async: false,
 			params: {
 			params: {
-				ids:  id
+				accessPath:  paths.replace(/[ \[ | \] ]/g, '')
 			},
 			},
 			method : 'GET',
 			method : 'GET',
 			callback : function(options,success,response){
 			callback : function(options,success,response){

+ 1 - 1
frontend/pc-web/app/view/core/form/field/RemoteImgField.js

@@ -128,7 +128,7 @@ Ext.define('school.view.core.form.field.RemoteImgField', {
         fd.append('folderId', 0);
         fd.append('folderId', 0);
         me.setLoading(true);
         me.setLoading(true);
         Ext.Ajax.request({
         Ext.Ajax.request({
-            // url: 'http://10.1.80.36:9520/api/file/upload', //这里是填写需要跨域访问的URL
+            // url: 'http://10.1.80.101:9520/api/file/upload', //这里是填写需要跨域访问的URL
             url: '/api/file/upload',//这里是填写需要跨域访问的URL
             url: '/api/file/upload',//这里是填写需要跨域访问的URL
             cors: true,
             cors: true,
             useDefaultXhrHeader: false,
             useDefaultXhrHeader: false,