SettingPanel.vue 4.9 KB

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