starter.js 984 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. (function(window) {
  2. window.CONFIG = {
  3. dataRoom:{
  4. datasetBtn:{// 数据集按钮的配置
  5. disabled: true, // 是否禁用数据集按钮
  6. message: '演示环境不允许操作' // 按钮提示信息
  7. }
  8. }
  9. }
  10. })(window);
  11. /**
  12. * 对象属性合并,与 Object.assign 语法不同
  13. * @param target
  14. * @param source
  15. * @returns {{}}
  16. */
  17. function configDeepMerge(target, source) {
  18. var merged = {};
  19. for (var each in source) {
  20. if (target.hasOwnProperty(each) && source.hasOwnProperty(each)) {
  21. if (typeof target[each] == "object" && typeof source[each] == "object") {
  22. merged[each] = configDeepMerge(target[each], source[each]);
  23. } else {
  24. merged[each] = source[each];
  25. }
  26. } else if (source.hasOwnProperty(each)) {
  27. merged[each] = source[each];
  28. }
  29. }
  30. for (var each in target) {
  31. if (!(each in source) && target.hasOwnProperty(each)) {
  32. merged[each] = target[each];
  33. }
  34. }
  35. return merged;
  36. }