| | |
| | | <div |
| | | v-show="showStep1Thumbnail" |
| | | class="prod-thumbnail-wrapper" |
| | | :style="{ height: viewHeight }" |
| | | :style="{ height: viewHeight + 'px' }" |
| | | @click="changeActive(1)" |
| | | > |
| | | <div class="prod-thumbnail">①修改选项</div> |
| | |
| | | <div v-show="showStep2Content"> |
| | | <div ref="titleRef" class="prod-title"> |
| | | <el-text tag="b" size="large">数据产品预览</el-text> |
| | | <el-button type="primary" @click="$emit('onStep2')"> |
| | | 下载数据产品 |
| | | </el-button> |
| | | </div> |
| | | <slot name="step2" :contentHeight="contentHeight"></slot> |
| | | </div> |
| | |
| | | <div |
| | | v-show="showStep2Thumbnail" |
| | | class="prod-thumbnail-wrapper" |
| | | :style="{ height: viewHeight }" |
| | | :style="{ height: viewHeight + 'px' }" |
| | | @click="changeActive(2)" |
| | | > |
| | | <div |
| | |
| | | <slot name="step3"></slot> |
| | | </template> |
| | | <template v-else> |
| | | <ProdDownload></ProdDownload> |
| | | <ProdDownload |
| | | :loading="loading" |
| | | :queryOpt="queryOpt" |
| | | @submit="onDownload" |
| | | ></ProdDownload> |
| | | </template> |
| | | </div> |
| | | </transition> |
| | |
| | | <div |
| | | v-show="showStep3Thumbnail" |
| | | class="prod-thumbnail-wrapper" |
| | | :style="{ height: viewHeight }" |
| | | :style="{ height: viewHeight + 'px' }" |
| | | @click="changeActive(3)" |
| | | > |
| | | <div |
| | |
| | | </el-row> |
| | | </template> |
| | | <script setup> |
| | | import { computed, inject, ref, watch, onMounted } from 'vue'; |
| | | import { computed, inject, ref, watch, onMounted, onUnmounted } from 'vue'; |
| | | import { unCalc } from '@/utils/css-util'; |
| | | import ProdQueryOpt from '@/views/fysp/data-product/base-data-product/components/ProdQueryOpt.vue'; |
| | | import ProdDownload from '@/views/fysp/data-product/base-data-product/components/ProdDownload.vue'; |
| | |
| | | } |
| | | }); |
| | | |
| | | const emit = defineEmits(['update:active', 'onStep1']); |
| | | const emit = defineEmits(['update:active', 'onStep1', 'onStep2', 'onStep3']); |
| | | |
| | | const viewHeight = inject('viewHeight'); |
| | | const contentMaxHeight = inject('contentMaxHeight'); |
| | | const viewHeight = inject('viewHeight', contentMaxHeight.value); |
| | | |
| | | const btnDisabled = ref(false); |
| | | |
| | |
| | | const contentHeight = ref('50vh'); |
| | | |
| | | function calContentHeight() { |
| | | console.log(titleRef.value.offsetHeight); |
| | | contentHeight.value = `calc(${unCalc(viewHeight.value)} - ${ |
| | | titleRef.value?.offsetHeight || 0 |
| | | }px)`; |
| | | console.log(contentHeight.value); |
| | | |
| | | // console.log(titleRef.value.offsetHeight); |
| | | contentHeight.value = viewHeight.value - (titleRef.value?.offsetHeight || 0); |
| | | // console.log(contentHeight.value); |
| | | } |
| | | |
| | | // 数据产品生成选项 |
| | | const queryOpt = ref({}); |
| | | |
| | | // 步骤引用 |
| | | const step1Ref = ref(null); |
| | |
| | | } |
| | | |
| | | function onSearch(opt) { |
| | | queryOpt.value = opt; |
| | | emit('onStep1', opt); |
| | | } |
| | | function onDownload(val) { |
| | | emit('onStep3', val); |
| | | } |
| | | function changeActive(index) { |
| | | let isAnimate = false; |
| | |
| | | // emit('update:active', index); |
| | | } |
| | | |
| | | let resizeObserver = null; |
| | | |
| | | onMounted(() => { |
| | | if (titleRef.value) { |
| | | resizeObserver = new ResizeObserver(() => { |
| | | calContentHeight(); |
| | | }); |
| | | resizeObserver.observe(titleRef.value); |
| | | } |
| | | }); |
| | | // 在组件卸载时清理 |
| | | onUnmounted(() => { |
| | | if (resizeObserver && titleRef.value) { |
| | | resizeObserver.unobserve(titleRef); |
| | | } |
| | | }); |
| | | </script> |
| | | <style scoped> |
| | |
| | | } |
| | | |
| | | .prod-title { |
| | | padding: 10px; |
| | | padding: 20px; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | } |
| | | |
| | | .prod-thumbnail-wrapper { |
| | |
| | | text-orientation: upright; |
| | | letter-spacing: 8px; |
| | | font-size: 18px; |
| | | font-weight: 500; |
| | | font-weight: 600; |
| | | border-top-left-radius: 4px; |
| | | border-bottom-left-radius: 4px; |
| | | cursor: pointer; |