|
@@ -1,8 +1,7 @@
|
|
|
<template>
|
|
|
<div class="picture_area" :style="getAreaStyle()">
|
|
|
- <div class="sn-position" :style="getJustifyContentStyle()">
|
|
|
- {{ data.property.serial_number }}
|
|
|
- </div>
|
|
|
+ <SerialNumberPosition :property="data.property" />
|
|
|
+
|
|
|
<div class="main">
|
|
|
<div class="view_area">
|
|
|
<el-carousel
|
|
@@ -16,12 +15,7 @@
|
|
|
<el-image :id="file.file_id" :src="file.file_url" fit="contain" />
|
|
|
</el-carousel-item>
|
|
|
</el-carousel>
|
|
|
- <ul
|
|
|
- class="view_list"
|
|
|
- :style="{
|
|
|
- columnGap: 'list' === data.property.view_method ? '1%' : '4%',
|
|
|
- }"
|
|
|
- >
|
|
|
+ <ul class="view_list">
|
|
|
<li v-for="(file, i) in data.file_list" :key="i" @click="handleIndicatorClick(i)">
|
|
|
<el-image :id="file.file_id" :src="file.file_url" fit="contain" />
|
|
|
</li>
|
|
@@ -44,7 +38,6 @@ export default {
|
|
|
curImgIndex: 0,
|
|
|
};
|
|
|
},
|
|
|
- computed: {},
|
|
|
methods: {
|
|
|
handleIndicatorClick(index) {
|
|
|
// 获取 Carousel 实例
|
|
@@ -52,47 +45,6 @@ export default {
|
|
|
// 切换到对应索引的图片
|
|
|
carousel.setActiveItem(index);
|
|
|
},
|
|
|
-
|
|
|
- /**
|
|
|
- * 得到序号外部样式
|
|
|
- */
|
|
|
- getAreaStyle() {
|
|
|
- const position = this.data.property.sn_position;
|
|
|
- let grid = '';
|
|
|
-
|
|
|
- if (position.includes('right')) {
|
|
|
- grid = `"main position" / 1fr auto`;
|
|
|
- } else if (position.includes('left')) {
|
|
|
- grid = `"position main" / auto 1fr`;
|
|
|
- } else if (position.includes('top')) {
|
|
|
- grid = `"position" auto "main" 1fr`;
|
|
|
- } else if (position.includes('bottom')) {
|
|
|
- grid = `"main" 1fr "position" auto`;
|
|
|
- }
|
|
|
-
|
|
|
- return {
|
|
|
- grid,
|
|
|
- };
|
|
|
- },
|
|
|
- /**
|
|
|
- * 得到序号位置样式
|
|
|
- */
|
|
|
- getJustifyContentStyle() {
|
|
|
- const position = this.data.property.sn_position;
|
|
|
- let placeSelf = '';
|
|
|
-
|
|
|
- if (position.includes('start')) {
|
|
|
- placeSelf = 'flex-start';
|
|
|
- } else if (position.includes('end')) {
|
|
|
- placeSelf = 'flex-end';
|
|
|
- } else {
|
|
|
- placeSelf = 'center';
|
|
|
- }
|
|
|
-
|
|
|
- return {
|
|
|
- placeSelf,
|
|
|
- };
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -103,10 +55,6 @@ export default {
|
|
|
gap: 6px;
|
|
|
padding: 8px;
|
|
|
|
|
|
- .sn-position {
|
|
|
- grid-area: position;
|
|
|
- }
|
|
|
-
|
|
|
> .main {
|
|
|
display: flex;
|
|
|
margin: 4px auto;
|
|
@@ -145,21 +93,15 @@ export default {
|
|
|
}
|
|
|
|
|
|
.view_list {
|
|
|
- display: flex;
|
|
|
- flex-wrap: wrap;
|
|
|
- row-gap: 14px;
|
|
|
-
|
|
|
- li::before {
|
|
|
- display: inline-block;
|
|
|
- padding-bottom: 100%;
|
|
|
- content: '';
|
|
|
- }
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(6, 1fr);
|
|
|
+ grid-auto-rows: auto;
|
|
|
+ gap: 21px 32px;
|
|
|
|
|
|
li {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- width: 13%;
|
|
|
background-color: #d9d9d9;
|
|
|
}
|
|
|
|