SettingPanel.vue 4.6 KB

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