App.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <div id="app" :style="'font-family:' + fontStyle">
  3. <router-view v-if="refresh" />
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'App',
  9. provide() {
  10. return {
  11. reload: this.reload,
  12. }
  13. },
  14. data() {
  15. return {
  16. refresh: true, // 控制整个页面刷新
  17. fontStyle: '',
  18. }
  19. },
  20. methods: {
  21. reload() {
  22. this.refresh = false
  23. this.$nextTick(() => {
  24. this.refresh = true
  25. })
  26. },
  27. },
  28. watch: {
  29. fontStyle(val) {
  30. // //console.log(val);
  31. },
  32. },
  33. mounted() {
  34. var that = this
  35. // 关于客户系统嵌套大数据平台代码 --勿删勿动
  36. // window.parent.postMessage(
  37. // {
  38. // test: "123",
  39. // },
  40. // "*"
  41. // );
  42. window.addEventListener('message', function (e) {
  43. if (e.data.send) {
  44. localStorage.setItem('session', e.data.send)
  45. localStorage.setItem('isLogin', true)
  46. if (e.data.url) {
  47. that.$router.push(e.data.url)
  48. } else {
  49. that.$router.push('/index/home')
  50. }
  51. }
  52. })
  53. // -------------------------------------------------
  54. if (localStorage.getItem('fontStyle') == null) {
  55. this.fontStyle = 'missyuan'
  56. } else {
  57. this.fontStyle = localStorage.getItem('fontStyle')
  58. document.querySelector('body').style.fontFamily = this.fontStyle
  59. }
  60. var param = window.name
  61. localStorage.setItem('iframeurl', param)
  62. // var version = JSON.stringify(process.env.VUE_APP_VERSION)
  63. // console.log(version)
  64. console.log('测试')
  65. },
  66. }
  67. </script>
  68. <style lang="less" scoped>
  69. @import '/assets/css/glass.css';
  70. @font-face {
  71. font-family: 'missyuan';
  72. src: url('assets/font/missyuan/SourceHanSans-Regular.otf');
  73. }
  74. html,
  75. body {
  76. height: 100%;
  77. width: 100%;
  78. margin: 0;
  79. font-family: 'missyuan';
  80. #app {
  81. height: 100%;
  82. width: 100%;
  83. position: absolute;
  84. left: 0;
  85. top: 0;
  86. background: #f1f1f1;
  87. }
  88. }
  89. /deep/ .el-button,
  90. button,
  91. input {
  92. font-family: 'missyuan' !important;
  93. }
  94. /deep/.customClass {
  95. .el-loading-spinner {
  96. i.el-icon-loading {
  97. color: #dcdfe6 !important;
  98. }
  99. .el-loading-text {
  100. color: #dcdfe6 !important;
  101. }
  102. }
  103. }
  104. /deep/ .el-breadcrumb__inner:hover {
  105. cursor: default !important;
  106. }
  107. // 所有卡片d
  108. /deep/ .custom-ffffff .el-card.is-always-shadow {
  109. border-radius: 10px;
  110. }
  111. // /deep/ .el-col>.is-always-shadow:hover{
  112. // transform:scale(1.03)
  113. // }
  114. // 所有弹框
  115. /deep/ .custom-ffffff .el-dialog {
  116. border-radius: 5px;
  117. }
  118. /deep/ .custom-ffffff .el-dialog__header {
  119. border-radius: 5px 5px 0 0;
  120. }
  121. /deep/ li.el-select-dropdown__item {
  122. font-family: 'missyuan' !important;
  123. }
  124. /deep/ .el-input__inner {
  125. font-family: 'missyuan';
  126. }
  127. </style>