SettingPanel.vue 4.3 KB

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