pageMenuDialog.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <el-dialog
  3. class="bs-dialog-wrap bs-page-menu-wrap bs-el-dialog"
  4. title="新建页面"
  5. :visible.sync="dialogVisible"
  6. width="800px"
  7. @close="dialogVisible=false"
  8. >
  9. <div class="page-menu-box">
  10. <div
  11. v-for="(page,index) in pageList"
  12. :key="index"
  13. class="page-item"
  14. @click="addPage(page)"
  15. >
  16. <div class="page-img-box">
  17. <img
  18. :src="page.icon"
  19. >
  20. </div>
  21. <div class="page-item-icon">
  22. {{ page.name }}
  23. </div>
  24. </div>
  25. </div>
  26. </el-dialog>
  27. </template>
  28. <script>
  29. export default {
  30. name: 'PageMenuDialog',
  31. data () {
  32. return {
  33. dialogVisible: false,
  34. pageList: [
  35. {
  36. name: '目录',
  37. icon: require('./images/目录.png'),
  38. type: 'catalog',
  39. categories: 'catalog'
  40. },
  41. {
  42. name: '大屏',
  43. icon: require('./images/大屏.png'),
  44. type: 'bigScreen',
  45. categories: 'bigScreen'
  46. }
  47. ]
  48. }
  49. },
  50. methods: {
  51. // 新增页面
  52. addPage (page) {
  53. this.$emit('addPageDesign', page)
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .bs-page-menu-wrap{
  60. .page-menu-box{
  61. width: 100%;
  62. display: grid;
  63. grid-template-columns: repeat(4, 25%);
  64. .page-item{
  65. height: 140px;
  66. display: flex;
  67. justify-content: center;
  68. align-items: center;
  69. flex-wrap: wrap;
  70. &:hover{
  71. cursor: pointer;
  72. }
  73. .page-img-box{
  74. width: 100px;
  75. height: 100px;
  76. display: flex;
  77. justify-content: center;
  78. align-items: center;
  79. border: 1px solid #e5e5e5;
  80. &:hover{
  81. border: 1px dashed var(--bs-el-color-primary);
  82. }
  83. }
  84. img{
  85. width: 80%;
  86. }
  87. .page-item-icon{
  88. width: 100%;
  89. text-align: center;
  90. }
  91. }
  92. }
  93. }
  94. </style>