yyuap-template
Version:
template project which is based on tinper
130 lines (117 loc) • 4.42 kB
JavaScript
import uiTemplate from '../src/startCreate/uiTemplate';
const options = {
// url:'http://workbench.yyuap.com',
// url:'http://localhost:8080',
// 模板生成dom的id
templateComponentName : 'root',
// nexuskey : 'customer',
// funcnode : 'basedoc',
// nexuskey : 'customerclass',
// funcnode : 'basedoc',
// nexuskey : 'func_adminorg',
// funcnode : 'org',
// nexuskey : 'projectorg',
// funcnode : 'org',
// nexuskey : 'orgunit',
// funcnode : 'org',
// nexuskey : 'psn',
// funcnode : '001PSN_TEST',
// nexuskey:'func_corporate',
//funcnode:'org',
// nexuskey:'staff_test_edit',
// funcnode:'HRPA020',
nexuskey:'position',
funcnode:'position',
//url:'https://ms-daily.yyuap.com',
"sysLocale":"en_US",
"localeList": {
"zh_CN":{
"zh_CN":{"label":"简体中文","value":""},
"en_US":{"label":"英文","value":""},
"zh_TW":{"label":"繁体中文","value":""},
"fr_FR":{"label":"法语","value":""}
},
"en_US":{
"zh_CN":{"label":"Simplified Chinese","value":""},
"en_US":{"label":"English","value":""},
"zh_TW":{"label":"traditional Chinese","value":""},
"fr_FR":{"label":"French","value":""}
},
"zh_TW":{
"zh_CN":{"label":"簡體中文","value":""},
"en_US":{"label":"英文","value":""},
"zh_TW":{"label":"繁體中文","value":""},
"fr_FR":{"label":"法語","value":""}
},
"fr_FR":{
"zh_CN":{"label":"Chinois simplifié","value":""},
"en_US":{"label":"Anglais","value":""},
"zh_TW":{"label":"Chinois traditionnel","value":""},
"fr_FR":{"label":"Français","value":""}
}
},
//url:'https://ms.diwork.com',
//url:'http://zhoulei.yyuap.com:8080',
// nexuskey : 'order',
//funcnode : 'juechao',
// testUrl:'http:baidu.com',
// nexuskey: 'CHGTYPE0000000000014',
//funcnode: 'HRPA060',
// nexuskey :"orgunit",
// funcnode:"org",
// url:'https://ms.diwork.com',
// nexuskey : 'psnall',
// funcnode : '002PSN_TEST',
// nexuskey : 'adminorg',
// funcnode : 'HR010003',
// templateType:"hr",
// hideButton:true,
// useSample:true,
registerFunc : function () {
},
afterInit : function () {
// ct.updateTemplateData()
//ct.setAuthorityByItemCode('customer.code',true);
// console.log(new Date().getTime());
// console.log(11111);
ct.setAttributeByItemCode('customer.code',"isDisplay",false);
// console.log(new Date().getTime());
// console.log(222222);
ct.setFormEdit();
// ct.setAuthorityByItemCode('customer.code',true);
// console.log(ct.getTemplateInfo())
},
// 保存的回调方法
onSave : function (params) {
console.log(params.rowData);
params.doSave()
},
// 取消的回调方法
onCancel : function (params) {
params.doCancel();
},
// 删除行的回调方法
onDelete : function (rowData) {
console.log(rowData);
},
onHeadFormDataChange : function (headFormData) {
console.log(headFormData);
},
onBodyFormDataChange : function (bodyFormData) {
console.log(bodyFormData);
},
// 当输入控件的值发生改变时回调此方法来进行一些关联性的赋值操作
handleComponentCallback : function (params) {
// if (params.itemCode === 'staff.staff_bankacc.bank') {
// params.setValue({itemCode:'staff.staff_bankacc.bankname',value:params.currentRef.id})
// }
// if (params.itemCode === 'adminorg.orgmgr') { // A控件改变B控件,同时通知改变C控件
// params.setValue({itemCode:'adminorg.branchleader',value:params.id,nextComponent:{itemCode:"adminorg.region",value:params.value}})
// }
// if (params.itemCode === 'adminorg.branchleader') {// B控件改变C控件
// params.setValue({itemCode:'adminorg.region',value:params.value.id})
// }
}
}
window.ct = new uiTemplate(options);
ct.startCreate()