SettingBase.js 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. MWF.xDesktop.requireApp("Setting", "Document", null, false);
  2. MWF.xApplication.Setting.BaseNameDocument = new Class({
  3. Extends: MWF.xApplication.Setting.Document
  4. });
  5. MWF.xApplication.Setting.BasePersonDocument = new Class({
  6. Extends: MWF.xApplication.Setting.Document,
  7. load: function(){
  8. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  9. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  10. this.titleName.set("text", this.lp.base_personSetting);
  11. this.baseUserPasswordInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  12. "lp": {"title": this.lp.base_UserPassword, "infor": this.lp.base_UserPassword_infor, "action": this.lp.base_UserPassword_action},
  13. "data": {"key": "personData", "valueKey": "password", "notEmpty": true, "infor": this.lp.base_UserPassword_empty },
  14. "value": this.explorer.personData.password
  15. });
  16. this.basePasswordPeriodInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  17. "lp": {"title": this.lp.base_passwordPeriod, "infor": this.lp.base_passwordPeriod_infor, "action": this.lp.base_passwordPeriod_action},
  18. "data": {"key": "personData", "valueKey": "passwordPeriod", "notEmpty": false},
  19. "value": this.explorer.personData.passwordPeriod
  20. });
  21. this.baseAdminPasswordInput = new MWF.xApplication.Setting.Document.Input(this.explorer, this.node, {
  22. "lp": {"title": this.lp.base_adminPassword, "infor": this.lp.base_adminPassword_infor, "action": this.lp.base_adminPassword_action},
  23. "data": {"key": "tokenData", "valueKey": "password", "notEmpty": false},
  24. "value": this.explorer.tokenData.password
  25. });
  26. }
  27. });
  28. MWF.xApplication.Setting.BaseLoginDocument = new Class({
  29. Extends: MWF.xApplication.Setting.Document,
  30. load: function(){
  31. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  32. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  33. this.titleName.set("text", this.lp.base_loginSetting);
  34. this.baseCodeLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  35. "lp": {"title": this.lp.base_codeLogin, "infor": this.lp.base_codeLogin_infor, "action": this.lp.base_codeLogin_action},
  36. "data": {"key": "personData", "valueKey": "codeLogin", "notEmpty": false },
  37. "value": this.explorer.personData.codeLogin
  38. });
  39. this.baseBindLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  40. "lp": {"title": this.lp.base_bindLogin, "infor": this.lp.base_bindLogin_infor, "action": this.lp.base_bindLogin_action},
  41. "data": {"key": "personData", "valueKey": "bindLogin", "notEmpty": false },
  42. "value": this.explorer.personData.bindLogin
  43. });
  44. this.baseFaceLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  45. "lp": {"title": this.lp.base_faceLogin, "infor": this.lp.base_faceLogin_infor, "action": this.lp.base_faceLogin_action},
  46. "data": {"key": "personData", "valueKey": "faceLogin", "notEmpty": false },
  47. "value": this.explorer.personData.faceLogin
  48. });
  49. this.baseRegisterInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  50. "lp": {"title": this.lp.base_register, "infor": this.lp.base_register_infor, "action": this.lp.base_register_action},
  51. "data": {"key": "personData", "valueKey": "register", "notEmpty": false },
  52. "value": this.explorer.personData.register,
  53. "options": [{"value": "disable", "text": this.lp.register_disable}, {"value": "captcha", "text": this.lp.register_captcha}, {"value": "code", "text": this.lp.register_code}]
  54. });
  55. this.baseLoginPortalTypeInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  56. "lp": {"title": this.lp.base_portalLogin, "infor": this.lp.base_portalLogin_infor, "action": this.lp.base_portalLogin_action},
  57. "data": {"key": "personData", "valueKey": "loginPage.enable", "notEmpty": false },
  58. "value": this.explorer.personData.loginPage.enable
  59. });
  60. var getOptions = function(){
  61. var options = [{"value": "", "text": this.lp.mobile_index_defalue}];
  62. MWF.Actions.get("x_portal_assemble_surface").listApplication(function(json){
  63. json.data.each(function(d){
  64. var o = {"value": d.id, "text": d.name+((d.alias) ? "("+d.alias+")" : "")};
  65. options.push(o);
  66. });
  67. }.bind(this), null, false);
  68. return options;
  69. }.bind(this);
  70. this.baseLoginPortalInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  71. "lp": {"title": this.lp.base_loginPortalId, "infor": this.lp.base_loginPortalId_infor},
  72. "data": {"key": "personData", "valueKey": "loginPage.portal"},
  73. "value": this.explorer.personData.loginPage.portal,
  74. "options": getOptions
  75. });
  76. }
  77. });
  78. MWF.xApplication.Setting.BaseSSODocument = new Class({
  79. Extends: MWF.xApplication.Setting.Document,
  80. load: function(){
  81. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  82. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  83. this.titleName.set("text", this.lp.base_ssoSetting);
  84. this.baseSSOInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  85. "lp": {"title": this.lp.base_ssos, "infor": this.lp.base_sso_infor, "action": this.lp.base_sso_action, "editAction": this.lp.base_sso_editAction},
  86. "data": {"key": "tokenData", "valueKey": "ssos", "notEmpty": false },
  87. "value": this.explorer.tokenData.ssos,
  88. "itemTitle": "{client}",
  89. "addItem": {"client": "", "key": ""},
  90. "icon": "sso.png"
  91. });
  92. this.baseOauthsInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  93. "lp": {"title": this.lp.base_oauths, "infor": this.lp.base_oauths_infor, "action": this.lp.base_oauths_action, "editAction": this.lp.base_oauths_editAction},
  94. "data": {"key": "tokenData", "valueKey": "oauths", "notEmpty": false },
  95. "value": this.explorer.tokenData.oauths,
  96. "itemTitle": "{clientId}",
  97. "addItem": {"clientId": "", "mapping": {}},
  98. "icon": "sso.png"
  99. });
  100. this.baseOauthsServerInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  101. "lp": {"title": this.lp.base_oauths_server, "infor": this.lp.base_oauths_infor_server, "action": this.lp.base_oauths_action, "editAction": this.lp.base_oauths_editAction},
  102. "data": {"key": "tokenData", "valueKey": "oauthClients", "notEmpty": false },
  103. "value": this.explorer.tokenData.oauthClients,
  104. "itemTitle": "{name}",
  105. "addItem": {
  106. "enable": false,
  107. "name": "",
  108. "icon": "",
  109. "clientId": "",
  110. "clientSecret": "",
  111. "authAddress": "",
  112. "authParameter": "client_id={$client_id}&client_secret={$client_secret}",
  113. "authMethod": "GET",
  114. "tokenAddress": "",
  115. "tokenParameter": "code={$code}&grant_type=authorization_code&client_id={$client_id}",
  116. "tokenMethod": "POST",
  117. "tokenType": "json",
  118. "infoAddress": "",
  119. "infoParameter": "access_token={$access_token}&client_id={$client_id}",
  120. "infoMethod": "GET",
  121. "infoType": "json",
  122. "infoCredentialField": "username"
  123. },
  124. "icon": "sso.png"
  125. });
  126. this.baseQyweixinInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  127. "lp": {"title": this.lp.base_qyweixin, "infor": this.lp.base_qyweixin_infor, "action": this.lp.base_qyweixin_action},
  128. "data": {"key": "tokenData", "valueKey": "qyweixin", "notEmpty": false},
  129. "value": this.explorer.tokenData.qyweixin || {"corpId": "", "corpSecret": ""},
  130. "itemTitle": "corpId: {corpId}",
  131. "addItem": {"corpId": "", "corpSecret": ""},
  132. "icon": "weixin.png"
  133. });
  134. this.baseDingdingInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  135. "lp": {"title": this.lp.base_dingding, "infor": this.lp.base_dingding_infor, "action": this.lp.base_dingding_action},
  136. "data": {"key": "tokenData", "valueKey": "dingding", "notEmpty": false},
  137. "value": this.explorer.tokenData.dingding || {"corpId": "", "corpSecret": "", "agentId": ""},
  138. "itemTitle": "corpId: {corpId}",
  139. "addItem": {"corpId": "", "corpSecret": "", "agentId": ""},
  140. "icon": "dingding.png"
  141. });
  142. }
  143. });