提交 7b480137 编写于 作者: 蔡祥熠

Merge branch 'fix/changeAdminPasswordNotice' into 'develop'

Merge of fix/changeAdminPasswordNotice  为数据表格、数据模板添加afterImport事件,修复数据表格、数据模板的resetData问题,修改管理员密码后,提示重启服务器。to develop

See merge request o2oa/o2oa!489
......@@ -63,7 +63,7 @@ MWF.xApplication.Setting.Document.Input = new Class({
if (!this.okButton) this.okButton = this.createButton(this.lp.ok, function(e){
if (this.data.lp.confirm){
var _self = this;
this.app.confirm("warn", e, "", {"html": this.data.lp.confirm}, 400, 200, function(){
this.app.confirm("warn", e, "", {"html": this.data.lp.confirm}, 400, 230, function(){
if (_self.submitData()) _self.editCancel();
this.close();
}, function(){this.close();})
......
......@@ -55,7 +55,7 @@ MWF.xApplication.Setting.LP = {
"base_adminPassword": "Super administrator password",
"base_adminPassword_infor": "Password of the super administrator xadmin",
"base_adminPassword_action": "Modify the super administrator password",
"base_adminPassword_confirm": "<div style='color:red'>The super administrator password is associated with the default database password, etc. Please carefully modify the super administrator password! </div><br>Are you sure you want to modify?",
"base_adminPassword_confirm": "<div style='color:red'>The super administrator password is associated with the default database password, etc. Please carefully modify the super administrator password! <br>Please restart immediately after changing the password, otherwise the system may go wrong!</div><br>Are you sure you want to modify?",
"base_loginSetting": "Configure user login options",
......
......@@ -54,7 +54,7 @@ MWF.xApplication.Setting.LP = {
"base_adminPassword": "超级管理员密码",
"base_adminPassword_infor": "超级管理员xadmin的密码,",
"base_adminPassword_action": "修改超级管理员密码",
"base_adminPassword_confirm": "<div style='color:red'>超级管理员密码关联默认数据库口令等,请慎重修改超级管理员密码!</div><br>您确定要修改吗?",
"base_adminPassword_confirm": "<div style='color:red'>超级管理员密码关联默认数据库口令等,请慎重修改超级管理员密码!<br>修改密码后请立即重启,否则系统可能出错!</div><br>您确定要修改吗?",
"base_loginSetting": "配置用户登录选项",
......
......@@ -77,6 +77,10 @@
"code": "",
"html": ""
},
"afterImport": {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
......
......@@ -62,6 +62,10 @@
"code": "",
"html": ""
},
"afterImport": {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
......
......@@ -165,8 +165,13 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
* @event MWF.xApplication.process.Xform.DatatablePC#import
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 在导入excel,数据设置回数据表格以后触发,this.event指向整理过的导入数据,格式见{@link DatatableData}。
* @event MWF.xApplication.process.Xform.DatatablePC#afterImport
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
"moduleEvents": ["queryLoad","postLoad","load", "afterLoad",
"beforeLoadLine", "afterLoadLine", "addLine", "deleteLine", "afterDeleteLine", "editLine", "completeLineEdit", "cancelLineEdit", "export", "import", "validImport"]
"beforeLoadLine", "afterLoadLine", "addLine", "deleteLine", "afterDeleteLine", "editLine", "completeLineEdit", "cancelLineEdit", "export", "import", "validImport", "afterImport"]
},
initialize: function(node, json, form, options){
......@@ -476,13 +481,10 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
this.table.setStyles(this.json.tableStyles);
this.table.set(this.json.properties);
},
_getValue: function(){
if (this.moduleValueAG) return this.moduleValueAG;
var value = this._getBusinessData();
if (!value){
if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
if (value && !value.then) if (o2.typeOf(value)==="array") value = {"data": value || [], "total":{}};
}
getDefaultValue: function(){
var value;
if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
if (value && !value.then) if (o2.typeOf(value)==="array") value = {"data": value || [], "total":{}};
if(!value && this.multiEditMode){
value = {"data": [], "total":{}};
var count = this.json.defaultCount ? this.json.defaultCount.toInt() : 0;
......@@ -490,6 +492,14 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
value.data.push({})
}
}
return value;
},
_getValue: function(){
if (this.moduleValueAG) return this.moduleValueAG;
var value = this._getBusinessData();
if (!value){
value = this.getDefaultValue();
}
return value || {"data": [], "total":{}};
},
getValue: function(){
......@@ -828,7 +838,8 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
* this.form.get('fieldId').resetData();
*/
resetData: function(){
this.setData(this._getValue());
var value = this.getDefaultValue() || {"data": [], "total":{}};
this.setData( value );
},
/**当参数为Promise的时候,请查看文档: {@link https://www.yuque.com/o2oa/ixsnyt/ws07m0|使用Promise处理表单异步}<br/>
* 当表单上没有对应组件的时候,可以使用this.data[fieldId] = data赋值。
......@@ -2400,6 +2411,9 @@ MWF.xApplication.process.Xform.DatatablePC.Importer = new Class({
this.datatable.fireEvent("import", [data] );
this.datatable.setData( { "data" : data } );
this.datatable.fireEvent("afterImport", [data] );
this.form.notice( MWF.xApplication.process.Xform.LP.importSuccess );
},
......
......@@ -144,8 +144,13 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
* @event MWF.xApplication.process.Xform.Datatemplate#import
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 在导入excel,数据设置回数据模板以后触发,this.event指向整理过的导入数据,格式见{@link DatatemplateData}。
* @event MWF.xApplication.process.Xform.Datatemplate#afterImport
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
"moduleEvents": ["queryLoad","postLoad","load", "afterLoad",
"beforeLoadLine", "afterLoadLine","addLine", "deleteLine", "afterDeleteLine","export", "import", "validImport"]
"beforeLoadLine", "afterLoadLine","addLine", "deleteLine", "afterDeleteLine","export", "import", "validImport", "afterImport"]
},
initialize: function(node, json, form, options){
......@@ -326,13 +331,10 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
//去要表单的所有组件加载完成以后再去获取外部组件
this.form.addEvent("afterModulesLoad", this.bindEvent );
},
_getValue: function(){
if (this.moduleValueAG) return this.moduleValueAG;
var value = this._getBusinessData();
if (!value){
if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
if (value && !value.then) if (o2.typeOf(value)==="object") value = [value];
}
getDefaultValue: function(){
var value;
if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
if (value && !value.then) if (o2.typeOf(value)==="object") value = [value];
if(!value){
value = [];
var count = this.json.defaultCount ? this.json.defaultCount.toInt() : 0;
......@@ -340,6 +342,23 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
}
return value;
},
_getValue: function(){
if (this.moduleValueAG) return this.moduleValueAG;
var value = this._getBusinessData();
if( !value ){
value = this.getDefaultValue();
}
// if (!value){
// if (this.json.defaultData && this.json.defaultData.code) value = this.form.Macro.exec(this.json.defaultData.code, this);
// if (value && !value.then) if (o2.typeOf(value)==="object") value = [value];
// }
// if(!value){
// value = [];
// var count = this.json.defaultCount ? this.json.defaultCount.toInt() : 0;
// for( var i=0; i<count; i++ )value.push({})
// }
return value;
},
getValue: function(){
return this._getValue();
},
......@@ -623,7 +642,8 @@ MWF.xApplication.process.Xform.Datatemplate = MWF.APPDatatemplate = new Class(
* this.form.get('fieldId').resetData();
*/
resetData: function(){
this.setData(this._getValue());
var value = this.getDefaultValue() || [];
this.setData(value);
},
/**当参数为Promise的时候,请查看文档: {@link https://www.yuque.com/o2oa/ixsnyt/ws07m0|使用Promise处理表单异步}<br/>
* 当表单上没有对应组件的时候,可以使用this.data[fieldId] = data赋值。
......@@ -1802,6 +1822,9 @@ MWF.xApplication.process.Xform.Datatemplate.Importer = new Class({
this.template.fireEvent("import", [data] );
this.template.setData( data );
this.template.fireEvent("afterImport", [data] );
this.form.notice( MWF.xApplication.process.Xform.LP.importSuccess );
},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册