SettingBase.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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, "confirm": this.lp.base_adminPassword_confirm},
  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.baseCaptchaLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  35. "lp": {"title": this.lp.base_captchaLogin, "infor": this.lp.base_captchaLogin_infor, "action": this.lp.base_captchaLogin_action},
  36. "data": {"key": "personData", "valueKey": "captchaLogin", "notEmpty": false },
  37. "value": this.explorer.personData.captchaLogin
  38. });
  39. this.baseCodeLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  40. "lp": {"title": this.lp.base_codeLogin, "infor": this.lp.base_codeLogin_infor, "action": this.lp.base_codeLogin_action},
  41. "data": {"key": "personData", "valueKey": "codeLogin", "notEmpty": false },
  42. "value": this.explorer.personData.codeLogin
  43. });
  44. this.baseBindLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  45. "lp": {"title": this.lp.base_bindLogin, "infor": this.lp.base_bindLogin_infor, "action": this.lp.base_bindLogin_action},
  46. "data": {"key": "personData", "valueKey": "bindLogin", "notEmpty": false },
  47. "value": this.explorer.personData.bindLogin
  48. });
  49. this.baseFaceLoginInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  50. "lp": {"title": this.lp.base_faceLogin, "infor": this.lp.base_faceLogin_infor, "action": this.lp.base_faceLogin_action},
  51. "data": {"key": "personData", "valueKey": "faceLogin", "notEmpty": false },
  52. "value": this.explorer.personData.faceLogin
  53. });
  54. this.baseRegisterInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  55. "lp": {"title": this.lp.base_register, "infor": this.lp.base_register_infor, "action": this.lp.base_register_action},
  56. "data": {"key": "personData", "valueKey": "register", "notEmpty": false },
  57. "value": this.explorer.personData.register,
  58. "options": [{"value": "disable", "text": this.lp.register_disable}, {"value": "captcha", "text": this.lp.register_captcha}, {"value": "code", "text": this.lp.register_code}]
  59. });
  60. this.baseLoginPortalTypeInput = new MWF.xApplication.Setting.Document.Check(this.explorer, this.node, {
  61. "lp": {"title": this.lp.base_portalLogin, "infor": this.lp.base_portalLogin_infor, "action": this.lp.base_portalLogin_action},
  62. "data": {"key": "personData", "valueKey": "loginPage.enable", "notEmpty": false },
  63. "value": this.explorer.personData.loginPage.enable
  64. });
  65. var getOptions = function(){
  66. var options = [{"value": "", "text": this.lp.mobile_index_defalue}];
  67. MWF.Actions.get("x_portal_assemble_surface").listApplication(function(json){
  68. json.data.each(function(d){
  69. var o = {"value": d.id, "text": d.name+((d.alias) ? "("+d.alias+")" : "")};
  70. options.push(o);
  71. });
  72. }.bind(this), null, false);
  73. return options;
  74. }.bind(this);
  75. this.baseLoginPortalInput = new MWF.xApplication.Setting.Document.Select(this.explorer, this.node, {
  76. "lp": {"title": this.lp.base_loginPortalId, "infor": this.lp.base_loginPortalId_infor},
  77. "data": {"key": "personData", "valueKey": "loginPage.portal"},
  78. "value": this.explorer.personData.loginPage.portal,
  79. "options": getOptions
  80. });
  81. }
  82. });
  83. MWF.xApplication.Setting.BaseSSODocument = new Class({
  84. Extends: MWF.xApplication.Setting.Document,
  85. load: function(){
  86. this.node = new Element("div", {"styles": {"overflow": "hidden", "padding-bottom": "80px"}}).inject(this.contentAreaNode);
  87. this.titleName = new Element("div", {"styles": this.explorer.css.explorerContentTitleNode}).inject(this.node);
  88. this.titleName.set("text", this.lp.base_ssoSetting);
  89. this.baseSSOInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  90. "lp": {"title": this.lp.base_ssos, "infor": this.lp.base_sso_infor, "action": this.lp.base_sso_action, "editAction": this.lp.base_sso_editAction},
  91. "data": {"key": "tokenData", "valueKey": "ssos", "notEmpty": false },
  92. "value": this.explorer.tokenData.ssos,
  93. "itemTitle": "{client}",
  94. "addItem": {"enable": true, "client": "", "key": ""},
  95. "icon": "sso.png"
  96. });
  97. this.baseOauthsInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  98. "lp": {"title": this.lp.base_oauths, "infor": this.lp.base_oauths_infor, "action": this.lp.base_oauths_action, "editAction": this.lp.base_oauths_editAction},
  99. "data": {"key": "tokenData", "valueKey": "oauths", "notEmpty": false },
  100. "value": this.explorer.tokenData.oauths,
  101. "itemTitle": "{clientId}",
  102. "addItem": {"enable": true, "clientId": "", "mapping": {}},
  103. "icon": "sso.png"
  104. });
  105. this.baseOauthsServerInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  106. "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},
  107. "data": {"key": "tokenData", "valueKey": "oauthClients", "notEmpty": false },
  108. "value": this.explorer.tokenData.oauthClients,
  109. "itemTitle": "{name}",
  110. "addItem": {
  111. "enable": false,
  112. "name": "",
  113. "icon": "",
  114. "clientId": "",
  115. "clientSecret": "",
  116. "authAddress": "",
  117. "authParameter": "client_id={$client_id}&client_secret={$client_secret}",
  118. "authMethod": "GET",
  119. "tokenAddress": "",
  120. "tokenParameter": "code={$code}&grant_type=authorization_code&client_id={$client_id}",
  121. "tokenMethod": "POST",
  122. "tokenType": "json",
  123. "infoAddress": "",
  124. "infoParameter": "access_token={$access_token}&client_id={$client_id}",
  125. "infoMethod": "GET",
  126. "infoType": "json",
  127. "infoCredentialField": "username"
  128. },
  129. "icon": "sso.png"
  130. });
  131. if (!this.explorer.tokenData.qyweixin) this.explorer.tokenData.qyweixin = {
  132. "enable": false,
  133. "syncCron": "",
  134. "forceSyncCron": "",
  135. "apiAddress": "",
  136. "corpId": "",
  137. "corpSecret": "",
  138. "agentId": "",
  139. "token": "",
  140. "encodingAesKey": "",
  141. "messageEnable": false
  142. };
  143. this.baseQyweixinInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  144. "lp": {"title": this.lp.base_qyweixin, "infor": this.lp.base_qyweixin_infor, "action": this.lp.base_qyweixin_action},
  145. "data": {"key": "tokenData", "valueKey": "qiyeweixin", "notEmpty": false},
  146. "value": this.explorer.tokenData.qiyeweixin,
  147. "itemTitle": "corpId: {corpId}",
  148. "addItem": {"corpId": "", "corpSecret": ""},
  149. "icon": "weixin.png"
  150. });
  151. if (!this.explorer.tokenData.dingding) this.explorer.tokenData.dingding = {
  152. "enable": false,
  153. "corpId": "",
  154. "agentId": "",
  155. "appKey": "",
  156. "appSecret": "",
  157. "syncCron": "",
  158. "forceSyncCron": "",
  159. "oapiAddress": "",
  160. "messageEnable": true
  161. };
  162. this.baseDingdingInput = new MWF.xApplication.Setting.Document.List(this.explorer, this.node, {
  163. "lp": {"title": this.lp.base_dingding, "infor": this.lp.base_dingding_infor, "action": this.lp.base_dingding_action},
  164. "data": {"key": "tokenData", "valueKey": "dingding", "notEmpty": false},
  165. "value": this.explorer.tokenData.dingding,
  166. "itemTitle": "agentId: {agentId}",
  167. "addItem": {"corpId": "", "corpSecret": "", "agentId": ""},
  168. "icon": "dingding.png"
  169. });
  170. }
  171. });