Commit 750f8b6f by web

fix: 修改变量名,完善数据

1 parent 8c7157c1
...@@ -348,16 +348,19 @@ export default { ...@@ -348,16 +348,19 @@ export default {
data: { data: [], message: '操作成功', status: '1' } data: { data: [], message: '操作成功', status: '1' }
}; };
}, },
// 当期BI-保持选择的图片 // 当期BI-任务记录图片列表
getTaskPicList() { getTaskPicList() {
return { return {
data: { data: {
data: { data: {
imageStyle: 1, //展示样式 1 流式 2平铺
imageSize: 2, //图片大小 1 大 2中 3小
taskImages: [ taskImages: [
{ {
biInfoId: 123, //BI主键 biInfoId: 123, //BI主键
taskId: 123, //任务记录ID taskId: 123, //任务记录ID
imageUrl: '图片地址' imageUrl:
'http://yiyang.oss-cn-beijing.aliyuncs.com/WEB/SaaS/images/2103251844.png'
} }
] ]
}, },
......
<template> <template>
<div :style="{ columnCount }"> <div :style="{ columnCount }">
<img v-for="(item, index) in imageUrl" :key="index" :src="setUrl(item)" /> <img v-for="(item, index) in imageUrls" :key="index" :src="setUrl(item)" />
</div> </div>
</template> </template>
...@@ -22,7 +22,7 @@ const IMG_MAPPING = { ...@@ -22,7 +22,7 @@ const IMG_MAPPING = {
export default { export default {
name: 'bi-photo-wall-images', name: 'bi-photo-wall-images',
props: { props: {
imageUrl: { imageUrls: {
type: Array, type: Array,
default() { default() {
return []; return [];
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
<template #handler> <template #handler>
<div class="bi-title-photo-btn"> <div class="bi-title-photo-btn">
<SelectStyle :layout="layout" @handleSave="selectStyleSave" /> <SelectStyle :layout="layout" @handleSave="selectStyleSave" />
<SelectImages :imageUrl="imageUrl" @handleSave="selectImgSave" /> <SelectImages :imageUrls="imageUrls" @handleSave="selectImgSave" />
<Del @del="onDel" /> <Del @del="onDel" />
</div> </div>
</template> </template>
</BiTitle> </BiTitle>
<BiImages :imageUrl="imageUrl" :layout="layout" /> <BiImages :imageUrls="imageUrls" :layout="layout" />
</div> </div>
</template> </template>
...@@ -36,7 +36,7 @@ export default { ...@@ -36,7 +36,7 @@ export default {
}, },
props: { props: {
name: String, name: String,
data: { initUrl: {
default: () => [], default: () => [],
type: Array type: Array
}, },
...@@ -47,7 +47,7 @@ export default { ...@@ -47,7 +47,7 @@ export default {
}, },
data() { data() {
return { return {
imageUrl: [], imageUrls: [],
layout: { layout: {
imageStyle: 2, // 1流式 2平铺 流式不限制高度,但是有max-height,平铺为正方形 imageStyle: 2, // 1流式 2平铺 流式不限制高度,但是有max-height,平铺为正方形
imageSize: 2 // 1大548px 2中355px 3小262px imageSize: 2 // 1大548px 2中355px 3小262px
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
methods: { methods: {
// 选择图片的保存 // 选择图片的保存
selectImgSave(e) { selectImgSave(e) {
this.imageUrl = e; this.imageUrls = e;
}, },
// 选择样式的保存 // 选择样式的保存
selectStyleSave(e) { selectStyleSave(e) {
...@@ -67,9 +67,14 @@ export default { ...@@ -67,9 +67,14 @@ export default {
this.$refs['bi-photo'].style.display = 'none'; this.$refs['bi-photo'].style.display = 'none';
} }
}, },
mounted() {},
watch: { watch: {
data: { initUrl: {
immediate: true,
handler(v) {
this.imageUrls = [...v];
}
},
imageUrls: {
handler() { handler() {
this.$nextTick(() => { this.$nextTick(() => {
this.$emit('page', heightToPage(this.$refs['bi-photo'].offsetHeight)); this.$emit('page', heightToPage(this.$refs['bi-photo'].offsetHeight));
......
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
name: 'select-img', name: 'select-img',
props: { props: {
// 已勾选数据 [url,url] // 已勾选数据 [url,url]
imageUrl: { imageUrls: {
type: Array, type: Array,
default() { default() {
return []; return [];
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author: jml * @Author: jml
* @Date: 2021-02-26 15:38:10 * @Date: 2021-02-26 15:38:10
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-09-08 15:00:42 * @LastEditTime: 2022-05-17 11:46:23
--> -->
<template> <template>
<div class="xrk-components-bi bi" :class="{ 'bi-print': print }"> <div class="xrk-components-bi bi" :class="{ 'bi-print': print }">
...@@ -82,6 +82,18 @@ export default { ...@@ -82,6 +82,18 @@ export default {
getTemplateList: { getTemplateList: {
type: Function, type: Function,
default: () => {} default: () => {}
},
saveBiPicList: {
type: Function,
default: () => {}
},
getTaskPicList: {
type: Function,
default: () => {}
},
getImageList: {
type: Function,
default: () => {}
} }
}, },
components: { components: {
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
<BiPhoto <BiPhoto
class="bi-block" class="bi-block"
name="照片集合" name="照片集合"
:initUrl="photoUrls"
@page="setPage(arguments, 'page4')" @page="setPage(arguments, 'page4')"
/> />
<BiCoverEnd title="奇正藏药医学沙龙推广项目数据报告"></BiCoverEnd> <BiCoverEnd title="奇正藏药医学沙龙推广项目数据报告"></BiCoverEnd>
...@@ -134,7 +135,8 @@ export default { ...@@ -134,7 +135,8 @@ export default {
projectName: '', projectName: '',
baseInfo: [], baseInfo: [],
textData: [], textData: [],
biInfo: {} biInfo: {},
photoUrls: []
}; };
}, },
computed: { computed: {
...@@ -510,7 +512,8 @@ export default { ...@@ -510,7 +512,8 @@ export default {
this.Bi.getFixedInfo(), this.Bi.getFixedInfo(),
this.Bi.getTopicInfo(), this.Bi.getTopicInfo(),
this.Bi.getGroupInfo(), this.Bi.getGroupInfo(),
this.Bi.getTemplateList() this.Bi.getTemplateList(),
this.Bi.getTaskPicList()
]) ])
.then( .then(
([ ([
...@@ -518,13 +521,17 @@ export default { ...@@ -518,13 +521,17 @@ export default {
fixedInfo, fixedInfo,
topicInfo, topicInfo,
topicMixinInfo, topicMixinInfo,
tempaletList = { data: { data: [] } } tempaletList = { data: { data: [] } },
photoInfo
]) => { ]) => {
this.dealBaseInfo(baseInfo.data.data[0] || {}); this.dealBaseInfo(baseInfo.data.data[0] || {});
this.dealFixedInfo(fixedInfo.data.data || []); this.dealFixedInfo(fixedInfo.data.data || []);
this.dealChoice(topicInfo.data.data || []); this.dealChoice(topicInfo.data.data || []);
this.dealChoiceMixin(topicMixinInfo.data.data || []); this.dealChoiceMixin(topicMixinInfo.data.data || []);
this.coverList = tempaletList.data.data || []; this.coverList = tempaletList.data.data || [];
this.photoUrls = photoInfo.data.data.taskImages.map(
item => item.imageUrl
);
this.$nextTick(async () => { this.$nextTick(async () => {
await this.preloadImg(this.coverUrl); await this.preloadImg(this.coverUrl);
window.status = '1'; window.status = '1';
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!