SettingPanel.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <template>
  2. <!-- <transition name="slide-fade"> -->
  3. <div
  4. v-if="rightVisiable"
  5. class="bs-right-panel-wrap"
  6. >
  7. <div class="bs-set-title">
  8. <SettingTitle>{{ chartSettingShow ? `${title}设置` : '大屏设置' }}</SettingTitle>
  9. </div>
  10. <div :class="!rightVisiable ? 'bs-page-right bs-page-right-fold' : 'bs-page-right'">
  11. <RightSetting
  12. v-if="chartSettingShow"
  13. @closeRightPanel="close"
  14. @updateSetting="updateSetting"
  15. @updateDataSetting="updateDataSetting"
  16. >
  17. <template #dataSetSelect="{value}">
  18. <slot
  19. name="dataSetSelect"
  20. :value="value"
  21. />
  22. </template>
  23. </RightSetting>
  24. <OverallSetting
  25. v-if="!chartSettingShow"
  26. ref="OverallSetting"
  27. @close="close"
  28. @styleHandler="styleHandler"
  29. />
  30. </div>
  31. </div>
  32. <!-- </transition> -->
  33. </template>
  34. <script>
  35. import SettingTitle from 'data-room-ui/SettingTitle/index.vue'
  36. import RightSetting from 'data-room-ui/BigScreenDesign/RightSetting/index.vue'
  37. import OverallSetting from 'data-room-ui/BigScreenDesign/OverallSetting/index.vue'
  38. import { mapState } from 'vuex'
  39. export default {
  40. name: '',
  41. components: {
  42. SettingTitle,
  43. RightSetting,
  44. OverallSetting
  45. },
  46. props: {
  47. rightVisiable: {
  48. type: Boolean,
  49. default: false
  50. },
  51. pageInfoVisiable: {
  52. type: Boolean,
  53. default: false
  54. },
  55. headerShow: {
  56. type: Boolean,
  57. default: true
  58. },
  59. height: {
  60. type: String,
  61. default: '100vh'
  62. }
  63. },
  64. data () {
  65. return {
  66. }
  67. },
  68. watch: {
  69. rightVisiable (value) {
  70. if (value) {
  71. const leftElement = document.querySelector('.bs-left-panel')
  72. const contentElement = document.querySelector('.grid-wrap-box')
  73. // const rightElement = document.querySelector('.bs-right-panel-wrap')
  74. const mapElement = document.querySelector('.minimap')
  75. if (parseInt(window.getComputedStyle(mapElement).right) > parseInt(window.getComputedStyle(leftElement).width) + parseInt(window.getComputedStyle(contentElement).width) - 320 - parseInt(window.getComputedStyle(mapElement).width)) {
  76. mapElement.style.right = parseInt(window.getComputedStyle(leftElement).width) + parseInt(window.getComputedStyle(contentElement).width) - 320 - parseInt(window.getComputedStyle(mapElement).width) + 'px'
  77. }
  78. }
  79. }
  80. },
  81. computed: {
  82. ...mapState('bigScreen', {
  83. activeItem: state => state.activeItemConfig,
  84. activeCode: state => state.activeCode
  85. }),
  86. chartSettingShow () {
  87. return this.rightVisiable && this.activeCode
  88. },
  89. title () {
  90. if(this.activeItem.type=='customComponent'){
  91. return this.activeItem?.category
  92. }else if(this.activeItem.type=='"remoteComponent"'){
  93. return this.activeItem?.title
  94. }
  95. else{
  96. return this.activeItem?.name
  97. }
  98. // if(this.activeItem)
  99. }
  100. },
  101. mounted () { },
  102. methods: {
  103. styleHandler (config) {
  104. this.$emit('styleHandler', config)
  105. },
  106. toggleShow () {
  107. this.$emit('update:rightVisiable', !this.rightVisiable)
  108. },
  109. close () {
  110. this.$emit('update:rightVisiable', false)
  111. },
  112. updateSetting (config) {
  113. this.$emit('updateSetting', config)
  114. },
  115. updateDataSetting (config) {
  116. this.$emit('updateDataSetting', config)
  117. }
  118. }
  119. }
  120. </script>
  121. <style lang="scss" scoped>
  122. .bs-right-panel-wrap {
  123. //z-index: 108;
  124. display: flex;
  125. flex-direction: column;
  126. background-color: var(--bs-background-1);
  127. .bs-set-title {
  128. background-color: var(--bs-background-2);
  129. color: var(--bs-el-title);
  130. height: 40px;
  131. font-size: 14px;
  132. border-bottom: 2px solid var(--bs-background-1);
  133. display: flex;
  134. align-items: center;
  135. .bs-set-title-text {
  136. position: relative;
  137. padding-left: 12px;
  138. display: inline-block;
  139. &:after{
  140. position: absolute;
  141. left: 0;
  142. top: 50%;
  143. transform: translateY(-50%);
  144. content: '';
  145. width: 4px;
  146. height: 14px;
  147. background-color: var(--bs-el-color-primary);
  148. }
  149. }
  150. }
  151. .bs-folder-wrap {
  152. width: 20px;
  153. position: relative;
  154. i {
  155. position: absolute;
  156. top: 50%;
  157. left: 0;
  158. transform: translateY(-50%);
  159. font-size: 20px;
  160. color: #fff;
  161. cursor: pointer;
  162. z-index: 1;
  163. }
  164. &:hover {
  165. background: rgba(143, 225, 255, .1)
  166. }
  167. }
  168. .bs-page-right {
  169. height: calc(100vh - 80px);
  170. width: 320px;
  171. box-sizing: border-box;
  172. background-color: var(--bs-background-2);
  173. .config-title {
  174. display: flex;
  175. height: 40px;
  176. line-height: 40px;
  177. padding: 0 10px;
  178. color: #fff;
  179. font-size: 14px;
  180. /* border-bottom: 1px solid #ebeef5; */
  181. .config-title-text {
  182. display: inline-block;
  183. max-width: 200px;
  184. overflow: hidden;
  185. text-overflow: ellipsis;
  186. white-space: nowrap;
  187. }
  188. }
  189. >* {
  190. color: #fff;
  191. }
  192. // 左侧居中伸缩图标
  193. &::after {
  194. content: '';
  195. position: absolute;
  196. top: 0;
  197. left: -10px;
  198. width: 10px;
  199. height: 100%;
  200. background: #fff;
  201. cursor: pointer;
  202. z-index: 1;
  203. }
  204. }
  205. .bs-page-right-fold {
  206. width: 0;
  207. overflow: hidden;
  208. }
  209. .slider-zoom {
  210. position: absolute;
  211. bottom: 10px;
  212. right: -10px;
  213. }
  214. }
  215. .slide-fade-enter-active {
  216. transition: all .3s ease;
  217. }
  218. .slide-fade-leave-active {
  219. transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
  220. }
  221. .slide-fade-enter,
  222. .slide-fade-leave-to
  223. /* .slide-fade-leave-active for below version 2.1.8 */
  224. {
  225. transform: translateX(10px);
  226. opacity: 0;
  227. }
  228. ::v-deep .el-scrollbar__view{
  229. height: calc(100vh - 80px);
  230. overflow-x: unset;
  231. }
  232. </style>