BasicLayoutEntry.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div class="page-config-content">
  3. <main class="main__config">
  4. <div class="card--default" @click="toLayout('PC')">
  5. <section class="card__left">
  6. <img :src="PCIcon" />
  7. </section>
  8. <section class="card__right">
  9. <span class="span__card--title"> PC端{{ titleDefault }} </span>
  10. <span class="span__card--describe"> {{ describeDefault }} PC端生效 </span>
  11. </section>
  12. </div>
  13. <div class="card--default" @click="toLayout('Phone')">
  14. <section class="card__left">
  15. <img :src="PhoneIcon" />
  16. </section>
  17. <section class="card__right">
  18. <span class="span__card--title"> 手机端{{ titleDefault }} </span>
  19. <span class="span__card--describe"> {{ describeDefault }} 手机端生效 </span>
  20. </section>
  21. </div>
  22. </main>
  23. </div>
  24. </template>
  25. <script lang="ts" setup>
  26. import PCIcon from '@/assets/images/page-config/config-pc.png';
  27. import PhoneIcon from '@/assets/images/page-config/config-phone.png';
  28. import router from '@/router';
  29. import { LayoutConfigType, ViewType } from '@/types/page-config/type';
  30. import { ref, onMounted } from 'vue';
  31. const props = defineProps<{
  32. layoutType: LayoutConfigType.scene | LayoutConfigType.camera
  33. }>()
  34. const titleDefault = ref('');
  35. const describeDefault = ref('');
  36. const generateContentDefault = (layoutType: LayoutConfigType.scene | LayoutConfigType.camera) => {
  37. switch (layoutType) {
  38. case LayoutConfigType.scene:
  39. titleDefault.value = '主页布局';
  40. describeDefault.value = '编辑的主页布局、 \n标签位置等在\n'
  41. break;
  42. case LayoutConfigType.camera:
  43. titleDefault.value = '车间布局';
  44. describeDefault.value = '编辑的车间布局、 \n摄像头位置等在\n'
  45. break;
  46. }
  47. }
  48. const toLayout = (type: 'PC' | 'Phone') => {
  49. let viewType;
  50. if (props.layoutType === LayoutConfigType.scene) {
  51. viewType = type === 'PC' ? ViewType.companyHomepage_PC : ViewType.companyHomepage_phone
  52. router.push(`/layout/scene-list?viewType=${viewType}`);
  53. return;
  54. }
  55. viewType = type === 'PC' ? ViewType.minimap_PC : ViewType.minimap_phone
  56. router.push(`/layout/camera-list?viewType=${viewType}`);
  57. };
  58. onMounted(() => {
  59. generateContentDefault(props.layoutType);
  60. })
  61. </script>
  62. <style lang="scss" scoped>
  63. .page-config-content {
  64. width: 100%;
  65. height: calc(100vh - 64px - 12px);
  66. padding: 47px 84px 0 84px;
  67. background: #ffffff;
  68. box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.12);
  69. border-radius: 6px;
  70. }
  71. .main__config {
  72. display: flex;
  73. justify-content: space-evenly;
  74. width: 100%;
  75. height: auto;
  76. .card--default {
  77. display: flex;
  78. width: 506px;
  79. height: 315px;
  80. background-repeat: no-repeat;
  81. background-size: cover;
  82. background-image: url('@/assets/images/page-config/card-bg-default.png');
  83. transition: background-image 0.3s ease-in-out;
  84. cursor: pointer;
  85. &:hover {
  86. background-image: url('@/assets/images/page-config/card-bg-hover.png');
  87. }
  88. }
  89. .card__left {
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. flex: 1;
  94. height: inherit;
  95. }
  96. .card__right {
  97. display: flex;
  98. justify-content: center;
  99. flex-direction: column;
  100. gap: 20px;
  101. flex: 1;
  102. .span__card--title {
  103. font-weight: 600;
  104. font-size: 28px;
  105. color: #1777ff;
  106. }
  107. .span__card--describe {
  108. font-weight: 400;
  109. font-size: 24px;
  110. line-height: 33px;
  111. color: #909399;
  112. white-space: pre-line;
  113. }
  114. }
  115. }
  116. </style>