|
@@ -39,7 +39,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<ul v-else class="view-independent">
|
|
<ul v-else class="view-independent">
|
|
|
- <li v-for="file in data.file_list" :key="file.file_id" @click="handleIndicatorClick(i)">
|
|
|
|
|
|
|
+ <li v-for="(file, i) in data.file_list" :key="file.file_id" @click="handleIndicatorClick(i)">
|
|
|
<el-image :id="file.file_id" :src="file.file_url" fit="contain" />
|
|
<el-image :id="file.file_id" :src="file.file_url" fit="contain" />
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
@@ -135,25 +135,23 @@ export default {
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
const ele = this.$refs.pictureAreaBox;
|
|
const ele = this.$refs.pictureAreaBox;
|
|
|
- if (ele) {
|
|
|
|
|
- const sn_position = this.data.property.sn_position;
|
|
|
|
|
- const viewMemo = this.isEnable(this.data.property.view_memo);
|
|
|
|
|
- // 序号在左和右补齐序号高度,去掉padding(8*2)
|
|
|
|
|
- if (sn_position.includes('left') || sn_position.includes('right')) {
|
|
|
|
|
- this.elementWidth = viewMemo ? (ele.clientWidth - 16) * 0.8 : ele.clientWidth - 16;
|
|
|
|
|
- this.elementHeight = ele.clientHeight;
|
|
|
|
|
- } else {
|
|
|
|
|
- this.elementWidth = viewMemo ? ele.clientWidth * 0.8 : ele.clientWidth;
|
|
|
|
|
- this.elementHeight = ele.clientHeight;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (!ele) return;
|
|
|
|
|
+ const sn_position = this.data.property.sn_position;
|
|
|
|
|
+ const viewMemo = this.isEnable(this.data.property.view_memo);
|
|
|
|
|
+ // 序号在左和右补齐序号高度,去掉padding(8*2)
|
|
|
|
|
+ if (sn_position.includes('left') || sn_position.includes('right')) {
|
|
|
|
|
+ this.elementWidth = viewMemo ? (ele.clientWidth - 16) * 0.8 : ele.clientWidth - 16;
|
|
|
|
|
+ this.elementHeight = ele.clientHeight;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.elementWidth = viewMemo ? ele.clientWidth * 0.8 : ele.clientWidth;
|
|
|
|
|
+ this.elementHeight = ele.clientHeight;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- this.fileLen = this.data.file_list.length;
|
|
|
|
|
- if (this.fileLen > 1) {
|
|
|
|
|
- this.isMore = true;
|
|
|
|
|
- }
|
|
|
|
|
- this.isViewLeftRightBtn();
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ this.fileLen = this.data.file_list.length;
|
|
|
|
|
+ if (this.fileLen > 1) {
|
|
|
|
|
+ this.isMore = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ this.isViewLeftRightBtn();
|
|
|
|
|
|
|
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
|
if (!this.getDragStatus()) return;
|
|
if (!this.getDragStatus()) return;
|
|
@@ -203,6 +201,7 @@ export default {
|
|
|
handleIndicatorClick(index) {
|
|
handleIndicatorClick(index) {
|
|
|
// 获取 Carousel 实例
|
|
// 获取 Carousel 实例
|
|
|
const carousel = this.$refs.pictureCarousel;
|
|
const carousel = this.$refs.pictureCarousel;
|
|
|
|
|
+ if (!carousel) return;
|
|
|
// 切换到对应索引的图片
|
|
// 切换到对应索引的图片
|
|
|
carousel.setActiveItem(index);
|
|
carousel.setActiveItem(index);
|
|
|
this.curPictureMemoIndex = index;
|
|
this.curPictureMemoIndex = index;
|