SettingPanel.vue 4.5 KB

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