SettingBase.js 13 KB

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