|
|
@@ -57,6 +57,10 @@ Ext.define('school.view.core.form.field.FileField', {
|
|
|
return this.getValueField().value;
|
|
|
},
|
|
|
|
|
|
+ resetOriginalValue: function() {
|
|
|
+ this.getValueField().resetOriginalValue();
|
|
|
+ },
|
|
|
+
|
|
|
getValueField: function () {
|
|
|
return this.items.items[0].items.items[0];
|
|
|
},
|
|
|
@@ -69,12 +73,11 @@ Ext.define('school.view.core.form.field.FileField', {
|
|
|
},
|
|
|
renderMF: function(f){
|
|
|
f.setHtml(null);
|
|
|
- var form = f.ownerCt;
|
|
|
if(f.value != null && f.value.toString().trim() != ''){
|
|
|
f.download(f.value,f.name);
|
|
|
}
|
|
|
- if(typeof(form.readOnly)!="undefined"){
|
|
|
- f.setReadOnly(form.readOnly);
|
|
|
+ if(typeof(f.readOnly)!="undefined"){
|
|
|
+ f.setReadOnly(f.readOnly);
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
@@ -181,13 +184,13 @@ Ext.define('school.view.core.form.field.FileField', {
|
|
|
fileName: f.name,
|
|
|
value: name,
|
|
|
columnWidth: w,
|
|
|
- readOnly: false,
|
|
|
editable: false,
|
|
|
filepath: f.fullPath,
|
|
|
accessPath: f.accessPath,
|
|
|
filesize: f.size,
|
|
|
_id:f.id,
|
|
|
- fieldStyle: 'background:#E0EEEE;'
|
|
|
+ fieldStyle: 'background:#E0EEEE;',
|
|
|
+ readOnly: me.readOnly
|
|
|
}));
|
|
|
});
|
|
|
me.dirty = false;
|
|
|
@@ -210,6 +213,7 @@ Ext.define('school.view.core.form.field.FileField', {
|
|
|
},
|
|
|
setReadOnly: function(bool){
|
|
|
//只读情况下限制不允许上传
|
|
|
+ this.readOnly = bool;
|
|
|
var f=this.down('filefield');
|
|
|
if(f.button&&f.fileInputEl){
|
|
|
//若界面配置字段可修改则允许传附件
|
|
|
@@ -219,6 +223,10 @@ Ext.define('school.view.core.form.field.FileField', {
|
|
|
f.fileInputEl.dom.setAttribute('disabled',bool);
|
|
|
}else f.fileInputEl.dom.removeAttribute('disabled');
|
|
|
}
|
|
|
+ let files = this.query('trashfield');
|
|
|
+ Ext.Array.each(files, function(fe) {
|
|
|
+ fe.setReadOnly(bool);
|
|
|
+ });
|
|
|
},
|
|
|
setFieldStyle: function(str) {
|
|
|
|