SettingPanel.vue 4.5 KB

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