代码拉取完成,页面将自动刷新
/**
* 文件上传管理View
*/
Ext.define('Panda.view.core.fileUpload.FileUpload',{
extend: 'Ext.window.Window',
xtype: 'fileupload',
alias: 'widget.fileupload',
requires: [
'Panda.view.core.fileUpload.FileUploadController',
'Panda.view.core.fileUpload.FileUploadModel'
],
controller: 'core-fileUpload-FileUploadController',
viewModel: {
type: 'core-fileUpload-FileUploadModel'
},
//region 自定义参数
/**
* 上传组件的调用者
*/
caller: null,
/**
* 上传完成后,需要关联数据的容器、变量
*/
needFillElement: null,
/**
* 允许上传的文件类型
* 格式参考:'.xlsx||.xls||.pdf'
*/
allowUploadFileType: '',
/**
* 上传框顶部的文本
*/
customPromptText:'请选择上传文件',
/**
* 是否允许自定义文件名称
*/
allowCustomFileName: false,
/**
* 是否允许取消文件上传
*/
allowCancelFileUpload: true,
/**
* 上传成功后的回调函数
*/
uploadSuccessCallback: null,
/**
* 上传出现错误回调函数
*/
uploadErrorCallback: null,
/**
* 上传完成回调函数(不论是否成功)
*/
uploadFinishCallback: null,
//endregion
/**
* 构造函数
* @param configs 参数
*/
constructor:function (configs) {
//初始化调用者参数
Ext.apply(this, configs);
//调用父类构造函数
this.callParent(configs);
//初始化上传组件
this.initUploadPanel();
},
/***
* 初始化上传组件
*/
initUploadPanel:function () {
//设置窗口的标题
this.setTitle(this.customPromptText);
},
closable: true,
listeners: {
beforeclose: 'onCloseButtonClickEventHandler',
},
scrollable: true,
minHeight: 150,
maxHeight: 300,
minWidth: 200,
maxWidth: 500,
layout: 'fit',
items: [
{
xtype: 'form',
reference: 'uploadForm',
padding: '20px',
items: [
{
xtype: 'container',
width: '100%',
},
{
xtype: 'filefield',
reference: 'uploadFile',
width: '100%',
},
{
xtype: 'textfield',
fieldLabel: '自定义文件名(选填)',
labelWidth: 175,
reference: 'userDefineFileName',
name: 'userDefineFileName',
width: '100%',
},
]
}
],
buttons: [
{
text: '开始上传',
handler: 'onSubmitUploadButtonClickEventHandler',
},
{
text: '取消上传',
handler: 'onCancelSubmitButtonClickEventHandler',
},
],
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。