Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
jml0128
/
xrk-bi
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3d37b3a6
authored
May 19, 2022
by
web
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/照片墙' into 'develop'
Feature/照片墙 See merge request
!18
2 parents
9c4b8c2a
f5f97075
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
840 additions
and
36 deletions
package.json
src/main.js
src/packages/bi/src/commonComponents/title.vue
src/packages/bi/src/components/catalogue.vue
src/packages/bi/src/components/operate.vue
src/packages/bi/src/components/photo-wall/del.vue
src/packages/bi/src/components/photo-wall/images.vue
src/packages/bi/src/components/photo-wall/index.vue
src/packages/bi/src/components/photo-wall/select.vue
src/packages/bi/src/components/photo-wall/style.vue
src/packages/bi/src/main.vue
src/packages/bi/src/project/20-configurable.vue
package.json
View file @
3d37b3a
{
"name"
:
"xrk-bi"
,
"version"
:
"0.3.0-beta.
1
1"
,
"version"
:
"0.3.0-beta.
2
1"
,
"description"
:
"xrk-bi"
,
"author"
:
"xrk"
,
"main"
:
"dist/bundler.js"
,
...
...
@@ -40,6 +40,7 @@
"babel-eslint"
:
"^10.1.0"
,
"babel-loader"
:
"^7.1.2"
,
"babel-plugin-component"
:
"^1.1.1"
,
"babel-polyfill"
:
"^6.26.0"
,
"babel-preset-env"
:
"^1.6.0"
,
"babel-preset-stage-3"
:
"^6.24.1"
,
"cross-env"
:
"^5.2.1"
,
...
...
src/main.js
View file @
3d37b3a
/*
* @Description:
* @LastEditors: jml
* @Date: 2021-01-28 23:29:19
*/
import
'babel-polyfill'
;
import
Vue
from
'vue'
;
import
App
from
'./App'
;
import
Xrk
from
'./lib/index.js'
;
...
...
src/packages/bi/src/commonComponents/title.vue
View file @
3d37b3a
...
...
@@ -13,6 +13,7 @@
class
=
"bi_title_text_icon"
/
>
<
/div
>
<
slot
name
=
"handler"
><
/slot
>
<
/div
>
<
/template
>
...
...
@@ -33,9 +34,12 @@ $bluecolor: #1989fa;
line
-
height
:
0
;
height
:
88
px
;
border
-
bottom
:
2
px
solid
#
f4f4f4
;
padding
-
left
:
29
px
;
padding
:
0
29
px
;
display
:
flex
;
align
-
items
:
center
;
justify
-
content
:
space
-
between
;
&
_text
{
margin
-
top
:
32
px
;
//
margin-top: 32px;
height
:
33
px
;
background
:
$bluecolor
;
font
-
size
:
22
px
;
...
...
src/packages/bi/src/components/catalogue.vue
View file @
3d37b3a
...
...
@@ -74,7 +74,6 @@ export default {
// return cataloguePageSize;
//
}
}
,
created
()
{
}
,
watch
:
{
catalogueArr
:
{
handler
()
{
...
...
src/packages/bi/src/components/operate.vue
View file @
3d37b3a
...
...
@@ -118,10 +118,10 @@ export default {
});
this
.
saving
=
false
;
})
.
catch
(
()
=>
{
.
catch
(
e
=>
{
this
.
saving
=
false
;
loading
.
close
();
Message
.
error
(
'保存失败'
);
Message
.
error
(
e
||
'保存失败'
);
});
}
},
...
...
src/packages/bi/src/components/photo-wall/del.vue
0 → 100644
View file @
3d37b3a
<!--
* @Description:
* @Date: 2022-05-13 09:41:06
-->
<
template
>
<el-button
@
click=
"handleRemove"
class=
"bi-photo_btn"
>
<img
src=
"http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/delete.svg"
alt=
""
/>
删除
</el-button>
</
template
>
<
script
>
import
{
MessageBox
,
Message
,
Button
}
from
'element-ui'
;
export
default
{
name
:
'photo-wall-del'
,
components
:
{
[
Button
.
name
]:
Button
},
methods
:
{
handleRemove
()
{
MessageBox
.
confirm
(
'是否确认删除?删除后可在撤销删除里面回复该分析'
,
'提示'
,
{
confirmButtonText
:
'是'
,
cancelButtonText
:
'否'
,
type
:
'warning'
}
)
.
then
(()
=>
{
this
.
$emit
(
'del'
);
Message
({
type
:
'success'
,
message
:
'删除成功!'
});
})
.
catch
(()
=>
{
Message
({
type
:
'info'
,
message
:
'已取消删除'
});
});
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.bi-photo
{
//
page-break-before
:
always
;
//
page-break-after
:
always
;
padding-bottom
:
50px
;
&_btn
{
display
:
inline-block
;
min-width
:
42px
;
height
:
42px
;
border
:
1px
solid
#bac1ce
;
border-radius
:
4px
;
vertical-align
:
top
;
text-align
:
center
;
line-height
:
42px
;
padding
:
0
15px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#6f7a91
;
cursor
:
pointer
;
position
:
relative
;
&_group
{
position
:
absolute
;
right
:
16px
;
top
:
50%
;
margin-top
:
-21px
;
z-index
:
3
;
&_item
{
&
+
.bi-chart-title_btn_group_item
{
margin-left
:
8px
;
}
}
}
}
}
</
style
>
src/packages/bi/src/components/photo-wall/images.vue
0 → 100644
View file @
3d37b3a
<
template
>
<ul
:style=
"
{ columnCount }">
<li
v-for=
"(item, index) in taskImageInfo.imageUrls"
:key=
"index"
>
<img
:src=
"setUrl(item.imageUrl)"
/>
</li>
</ul>
</
template
>
<
script
>
const
IMG_MAPPING
=
{
1
:
{
column
:
2
,
width
:
548
},
2
:
{
column
:
3
,
width
:
355
},
3
:
{
column
:
4
,
width
:
262
}
};
export
default
{
name
:
'bi-photo-wall-images'
,
props
:
{
taskImageInfo
:
{
type
:
Object
,
default
()
{
return
{
imageStyle
:
2
,
// 1流式 2平铺 流式不限制高度,但是有max-height,平铺为正方形
imageSize
:
2
,
//图片大小 1 大 2中 3小
imageUrls
:
[
// {
// id: 1,
// biInfoId: 123, //BI主键
// taskId: 123, //任务记录ID
// imageUrl: '图片地址'
// }
]
};
}
}
},
computed
:
{
columnCount
()
{
return
IMG_MAPPING
[
this
.
taskImageInfo
.
imageSize
].
column
;
},
width
()
{
return
IMG_MAPPING
[
this
.
taskImageInfo
.
imageSize
].
width
;
},
height
()
{
if
(
this
.
taskImageInfo
.
imageStyle
===
2
)
{
return
this
.
width
;
}
return
'auto'
;
}
},
methods
:
{
setUrl
(
url
)
{
// x-oss-process=image/resize,w_355 流式
// ?x-oss-process=image/resize,m_fill,w_355,h_355
if
(
this
.
taskImageInfo
.
imageStyle
===
1
)
{
return
`
${
url
}
?x-oss-process=image/resize,w_
${
this
.
width
}
`
;
}
return
`
${
url
}
?x-oss-process=image/resize,m_fill,w_
${
this
.
width
}
,h_
${
this
.
width
}
`
;
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
//
https
://
help
.aliyun.com
/
document_detail
/
44688
.html
//
ul
{
//
padding
:
0
30px
;
//
padding-top
:
35px
;
//
position
:
relative
;
//
list-style
:
none
;
//
display
:
flex
;
//
flex-wrap
:
wrap
;
//
li
{
//
margin
:
10px
;
//
img
{
//
//
大548px
中355px
小262px
//
width
:
358px
;
//
height
:
358px
;
//
//
object-fit
:
fill
;
//
}
//
}
//
}
ul
{
padding
:
0
30px
;
padding-top
:
35px
;
position
:
relative
;
list-style
:
none
;
//
display
:
flex
;
//
flex-wrap
:
wrap
;
column-count
:
3
;
column-gap
:
0
;
img
{
margin
:
10px
;
//
大548px
中355px
小262px
//
width
:
358px
;
//
height
:
358px
;
//
object-fit
:
fill
;
}
}
</
style
>
src/packages/bi/src/components/photo-wall/index.vue
0 → 100644
View file @
3d37b3a
<!--
* @Description:
* @Date: 2021-06-09 19:05:20
-->
<
template
>
<div
class=
"bi-photo"
ref=
"bi-photo"
>
<BiTitle
:index=
"index"
:name=
"name"
>
<template
#
handler
>
<div
class=
"bi-title-photo-btn"
v-if=
"!isPrint"
>
<SelectStyle
:layout=
"
{
imageStyle: value.imageStyle,
imageSize: value.imageSize
}"
@handleSave="selectStyleSave"
/>
<SelectImages
:imageUrls=
"value.imageUrls"
@
handleSave=
"selectImgSave"
/>
<Del
@
del=
"onDel"
/>
</div>
</
template
>
</BiTitle>
<BiImages
:taskImageInfo=
"value"
/>
</div>
</template>
<
script
>
import
BiTitle
from
'../../commonComponents/title.vue'
;
import
BiImages
from
'./images'
;
import
SelectImages
from
'./select'
;
import
SelectStyle
from
'./style'
;
import
Del
from
'./del'
;
import
{
heightToPage
}
from
'../../chart-type/common'
;
import
mixin
from
'../../mixin/index'
;
export
default
{
name
:
'bi-photo-wall'
,
mixins
:
[
mixin
],
components
:
{
BiTitle
,
BiImages
,
SelectImages
,
SelectStyle
,
Del
},
props
:
{
name
:
String
,
value
:
{
default
()
{
return
{
isDelete
:
0
,
// 1删除
imageStyle
:
2
,
// 1流式 2平铺 流式不限制高度,但是有max-height,平铺为正方形
imageSize
:
2
,
//图片大小 1 大 2中 3小
imageUrls
:
[
// {
// id: 1,
// biInfoId: 123, //BI主键
// taskId: 123, //任务记录ID
// imageUrl: '图片地址'
// }
]
};
},
type
:
Object
},
index
:
{
type
:
Number
,
default
:
4
}
},
methods
:
{
// 选择图片的保存
selectImgSave
(
e
)
{
this
.
$emit
(
'input'
,
{
...
this
.
value
,
imageUrls
:
e
});
},
// 选择样式的保存
selectStyleSave
(
e
)
{
this
.
$emit
(
'input'
,
{
...
this
.
value
,
...
e
});
},
onDel
()
{
this
.
$emit
(
'input'
,
{
...
this
.
value
,
isDelete
:
1
});
}
},
watch
:
{
value
:
{
handler
()
{
this
.
$nextTick
(()
=>
{
this
.
$emit
(
'page'
,
heightToPage
(
this
.
$refs
[
'bi-photo'
].
offsetHeight
));
});
},
deep
:
true
,
immediate
:
true
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.bi-photo
{
//
page-break-before
:
always
;
//
page-break-after
:
always
;
padding-bottom
:
50px
;
&_btn
{
display
:
inline-block
;
min-width
:
42px
;
height
:
42px
;
border
:
1px
solid
#bac1ce
;
border-radius
:
4px
;
vertical-align
:
top
;
text-align
:
center
;
line-height
:
42px
;
padding
:
0
15px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#6f7a91
;
cursor
:
pointer
;
position
:
relative
;
&_group
{
position
:
absolute
;
right
:
16px
;
top
:
50%
;
margin-top
:
-21px
;
z-index
:
3
;
&_item
{
&
+
.bi-chart-title_btn_group_item
{
margin-left
:
8px
;
}
}
}
}
}
.bi-title-photo-btn
{
display
:
flex
;
width
:
320px
;
justify-content
:
space-between
;
}
</
style
>
src/packages/bi/src/components/photo-wall/select.vue
0 → 100644
View file @
3d37b3a
<
template
>
<div>
<el-button
@
click=
"openDialog"
class=
"bi-photo_btn"
>
<img
src=
"http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/delete.svg"
alt=
""
/>
选择图片
</el-button>
<el-dialog
title=
"选择图片"
:visible
.
sync=
"selectImgShow"
width=
"700px"
center
:before-close=
"handleClose"
>
<div
class=
"select-img-main"
>
<div
class=
"select-img-item"
v-for=
"(item, index) in imgWallPageList"
:key=
"item.imageUrl + index"
>
<el-checkbox
:disabled=
"selectSum >= 50 && item.isSelect === 0"
class=
"select-box"
:value=
"imageUrlsMap.includes(item.imageUrl)"
@
change=
"
e =>
{
selectChange(e, item);
}
"
>
</el-checkbox>
<img
:src=
"item.imageUrl"
/>
</div>
</div>
<div
style=
"margin: 10px"
>
<el-checkbox
:indeterminate=
"selectSum > 0 && selectSum
< imgWallList
.
length
"
:value=
"selectSum === imgWallList.length"
@
change=
"selectAll"
>
全选
</el-checkbox>
<span>
当前选中
{{
selectSum
}}
张
</span>
<span
style=
"color: red"
>
(最大选取50张)
</span>
</div>
<el-pagination
:current-page
.
sync=
"currentPage"
:page-size=
"pageSize"
layout=
"total, prev, pager, next, jumper"
:total=
"imgWallList.length"
></el-pagination>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave"
>
保 存
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
mixin
from
'../../mixin/index'
;
import
{
Dialog
,
Button
,
Checkbox
,
CheckboxGroup
,
Pagination
,
Message
}
from
'element-ui'
;
export
default
{
name
:
'select-img'
,
mixins
:
[
mixin
],
props
:
{
// 已勾选数据 [url,url]
imageUrls
:
{
type
:
Array
,
default
()
{
return
[];
}
}
},
components
:
{
[
Dialog
.
name
]:
Dialog
,
[
Button
.
name
]:
Button
,
[
CheckboxGroup
.
name
]:
CheckboxGroup
,
[
Checkbox
.
name
]:
Checkbox
,
[
Pagination
.
name
]:
Pagination
},
data
()
{
return
{
selectImgShow
:
false
,
selectedImageUrls
:
[],
currentPage
:
1
,
pageSize
:
6
,
imgWallList
:
[]
};
},
methods
:
{
async
openDialog
()
{
this
.
selectedImageUrls
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
imageUrls
));
this
.
selectImgShow
=
true
;
const
asyncData
=
await
this
.
Bi
.
getTaskPicList
();
this
.
imgWallList
=
asyncData
.
data
.
data
.
taskImages
;
},
// 全选/取消全选
selectAll
(
e
)
{
if
(
e
)
{
// 全部选择
if
(
this
.
imgWallList
.
length
>
50
)
{
// 超出50条弹出提示
Message
.
error
(
'当前可选照片超过50张,已为您自动选择前50张照片'
);
this
.
selectedImageUrls
=
this
.
imgWallList
.
slice
(
0
,
50
);
}
else
{
this
.
selectedImageUrls
=
this
.
imgWallList
;
}
}
else
{
// 取消全选
this
.
selectedImageUrls
=
[];
}
},
// 单选
selectChange
(
e
,
item
)
{
if
(
e
)
{
this
.
selectedImageUrls
.
push
(
item
);
}
else
{
this
.
selectedImageUrls
=
this
.
selectedImageUrls
.
filter
(
urls
=>
urls
.
imageUrl
!==
item
.
imageUrl
);
}
},
handleClose
()
{
this
.
selectImgShow
=
false
;
},
handleSave
()
{
if
(
this
.
selectSum
<=
0
)
{
Message
.
error
(
'至少选择一张图片!'
);
return
;
}
this
.
$emit
(
'handleSave'
,
this
.
selectedImageUrls
);
this
.
selectImgShow
=
false
;
}
},
computed
:
{
// 模拟分页
imgWallPageList
()
{
return
this
.
imgWallList
.
slice
(
(
this
.
currentPage
-
1
)
*
this
.
pageSize
,
this
.
currentPage
*
this
.
pageSize
);
},
// 所选条数
selectSum
()
{
return
this
.
selectedImageUrls
.
length
;
},
imageUrlsMap
()
{
return
this
.
selectedImageUrls
.
map
(
item
=>
item
.
imageUrl
);
}
},
created
()
{}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.bi-photo
{
//
page-break-before
:
always
;
//
page-break-after
:
always
;
padding-bottom
:
50px
;
&_btn
{
display
:
inline-block
;
min-width
:
42px
;
height
:
42px
;
border
:
1px
solid
#bac1ce
;
border-radius
:
4px
;
vertical-align
:
top
;
text-align
:
center
;
line-height
:
42px
;
padding
:
0
15px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#6f7a91
;
cursor
:
pointer
;
position
:
relative
;
&_group
{
position
:
absolute
;
right
:
16px
;
top
:
50%
;
margin-top
:
-21px
;
z-index
:
3
;
&_item
{
&
+
.bi-chart-title_btn_group_item
{
margin-left
:
8px
;
}
}
}
}
}
.select-img-main
{
display
:
flex
;
flex-wrap
:
wrap
;
.select-img-item
{
border
:
1px
solid
rgb
(
182
,
185
,
188
);
margin
:
4px
;
position
:
relative
;
.select-box
{
position
:
absolute
;
top
:
15px
;
right
:
15px
;
}
}
img
{
width
:
200px
;
height
:
150px
;
}
}
</
style
>
src/packages/bi/src/components/photo-wall/style.vue
0 → 100644
View file @
3d37b3a
<
template
>
<div>
<el-button
@
click=
"openDialog"
class=
"bi-photo_btn"
>
<img
src=
"http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/delete.svg"
alt=
""
/>
选择样式
</el-button>
<el-dialog
title=
"选择样式"
:visible
.
sync=
"selectStyleShow"
width=
"400px"
center
:before-close=
"handleClose"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"80px"
>
<el-form-item
label=
"布局样式:"
>
<el-radio-group
v-model=
"form.imageStyle"
>
<el-radio
:label=
"1"
>
流式布局
</el-radio>
<el-radio
:label=
"2"
>
平铺布局
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"图片大小:"
>
<el-radio-group
v-model=
"form.imageSize"
>
<el-radio
:label=
"1"
>
大图
</el-radio>
<el-radio
:label=
"2"
>
中图
</el-radio>
<el-radio
:label=
"3"
>
小图
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"handleClose"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"handleSave"
>
保 存
</el-button>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
import
{
Dialog
,
Button
,
Radio
,
RadioGroup
,
Form
,
FormItem
}
from
'element-ui'
;
export
default
{
name
:
'select-style'
,
props
:
{
layout
:
{
type
:
Object
,
default
()
{
return
{
imageStyle
:
2
,
imageSize
:
2
};
}
}
},
components
:
{
[
Form
.
name
]:
Form
,
[
FormItem
.
name
]:
FormItem
,
[
Dialog
.
name
]:
Dialog
,
[
Button
.
name
]:
Button
,
[
RadioGroup
.
name
]:
RadioGroup
,
[
Radio
.
name
]:
Radio
},
data
()
{
return
{
selectStyleShow
:
false
,
form
:
{
imageStyle
:
2
,
imageSize
:
2
}
};
},
methods
:
{
openDialog
()
{
this
.
selectStyleShow
=
true
;
Object
.
assign
(
this
.
form
,
this
.
layout
);
},
handleClose
()
{
this
.
selectStyleShow
=
false
;
},
handleSave
()
{
this
.
$emit
(
'handleSave'
,
this
.
form
);
this
.
selectStyleShow
=
false
;
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.bi-photo
{
//
page-break-before
:
always
;
//
page-break-after
:
always
;
padding-bottom
:
50px
;
&_btn
{
display
:
inline-block
;
min-width
:
42px
;
height
:
42px
;
border
:
1px
solid
#bac1ce
;
border-radius
:
4px
;
vertical-align
:
top
;
text-align
:
center
;
line-height
:
42px
;
padding
:
0
15px
;
font-size
:
16px
;
font-weight
:
500
;
color
:
#6f7a91
;
cursor
:
pointer
;
position
:
relative
;
&_group
{
position
:
absolute
;
right
:
16px
;
top
:
50%
;
margin-top
:
-21px
;
z-index
:
3
;
&_item
{
&
+
.bi-chart-title_btn_group_item
{
margin-left
:
8px
;
}
}
}
}
}
</
style
>
src/packages/bi/src/main.vue
View file @
3d37b3a
...
...
@@ -2,8 +2,7 @@
* @Description:
* @Author: jml
* @Date: 2021-02-26 15:38:10
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-04-20 13:26:04
* @LastEditTime: 2022-05-19 15:25:49
-->
<
template
>
<div
class=
"xrk-components-bi bi"
:class=
"
{ 'bi-print': print }">
...
...
@@ -86,6 +85,32 @@ export default {
getTemplateList
:
{
type
:
Function
,
default
:
()
=>
{}
},
// 当期BI-保持选择的图片
saveBiPicList
:
{
type
:
Function
,
default
:
()
=>
{}
},
// 当期BI-任务记录图片列表
getTaskPicList
:
{
type
:
Function
,
default
:
()
=>
{}
},
// 照片墙获取50张图片
getImageList
:
{
type
:
Function
,
default
:
()
=>
{}
},
// 获取是否含有照片题
getImageQuestionCount
:
{
type
:
Function
,
default
:
()
=>
{
return
{
data
:
{
data
:
0
}
};
}
}
},
components
:
{
...
...
src/packages/bi/src/project/20-configurable.vue
View file @
3d37b3a
...
...
@@ -53,9 +53,27 @@
@
sort=
"sort(arguments, 'singleChoiceMixin', hideSingleChoiceMixin)"
@
page=
"setPage(arguments, 'page3', 'page3Info')"
></BiSingleChoice>
<!--
<BiSingleChoice
v-if=
"showSingleChoice.length > 0"
class=
"bi-block no-border"
:singleChoice=
"showSingleChoice"
:pageWrap=
"true"
@
sort=
"sort(arguments, 'singleChoice', hideSingleChoice)"
@
page=
"setPage(arguments, 'page4')"
>
<BiSingleChoiceInfo
index=
"4"
name=
"照片集合"
></BiSingleChoiceInfo>
</BiSingleChoice>
-->
<BiPhoto
v-if=
"!hideTaskImage"
class=
"bi-block"
ref=
"bi-photo"
name=
"照片集合"
v-model=
"taskImageInfo"
@
page=
"setPage(arguments, 'page4')"
/>
<BiCoverEnd
title=
"奇正藏药医学沙龙推广项目数据报告"
></BiCoverEnd>
<BiOperate
:questionData=
"[...singleChoice, ...singleChoiceMixin]"
:questionData=
"[...singleChoice, ...singleChoiceMixin
, taskImageInfo
]"
:saveInfo=
"saveInfo"
:exportBi=
"exportBi"
></BiOperate>
...
...
@@ -70,8 +88,9 @@ import BiOverview from '../components/overview.vue';
import
BiMission
from
'../components/mission.vue'
;
import
BiSingleChoice
from
'../components/singleChoice.vue'
;
import
BiCoverEnd
from
'../components/cover-end.vue'
;
import
BiOperate
from
'../components/operate.vue'
;
import
BiPhoto
from
'../components/photo-wall/index.vue'
;
import
mixin
,
{
printWidth
}
from
'../mixin/index'
;
/**
* dealSingleChoice、sort、setPage
...
...
@@ -100,7 +119,8 @@ export default {
BiSingleChoice
,
BiSingleChoiceInfo
,
BiCoverEnd
,
BiOperate
BiOperate
,
BiPhoto
},
data
()
{
return
{
...
...
@@ -117,7 +137,24 @@ export default {
projectName
:
''
,
baseInfo
:
[],
textData
:
[],
biInfo
:
{}
biInfo
:
{},
taskImageInfo
:
{
title
:
{
name
:
'照片墙'
},
has
:
false
,
// true有图片题,false无
isDelete
:
0
,
imageStyle
:
2
,
//展示样式 1 流式 2平铺
imageSize
:
2
,
//图片大小 1 大 2中 3小
imageUrls
:
[
// {
// id: 1,
// biInfoId: 123, //BI主键
// taskId: 123, //任务记录ID
// imageUrl: '图片地址'
// }
]
}
};
},
computed
:
{
...
...
@@ -178,7 +215,18 @@ export default {
};
})
]
}
},
...(
!
this
.
hideTaskImage
&&
[
{
name
:
'照片集合'
,
child
:
[
{
name
:
'照片集合'
,
page
:
4
}
]
}
])
];
},
showSingleChoice
()
{
...
...
@@ -192,6 +240,9 @@ export default {
},
hideSingleChoiceMixin
()
{
return
this
.
dealSingleChoice
(
this
.
singleChoiceMixin
,
true
);
},
hideTaskImage
()
{
return
!!
this
.
taskImageInfo
.
isDelete
||
!
this
.
taskImageInfo
.
has
;
}
},
methods
:
{
...
...
@@ -452,26 +503,56 @@ export default {
});
},
saveInfo
()
{
const
{
biInfoId
,
styleConfigureId
}
=
this
.
biInfo
;
const
{
content
}
=
this
.
$refs
[
'cover'
];
return
this
.
Bi
.
saveInfo
({
biInfoId
:
biInfoId
,
commandType
:
2
,
biStyleConfigureInfo
:
{
aspEnterpriseNameWrite
:
content
[
2
].
name
||
''
,
//乙方封面名称
aspNamePosition
:
JSON
.
stringify
(
content
[
2
].
pos
),
//乙方封面名称位置
styleConfigId
:
styleConfigureId
,
//封面配置ID
coverTemplateId
:
this
.
coverId
,
//封面ID
settlementTime
:
content
[
1
].
name
||
''
,
//封面时间
settlementTimePosition
:
JSON
.
stringify
(
content
[
1
].
pos
),
//封面时间位置
title
:
content
[
0
].
name
||
''
,
//封面标题
titlePosition
:
JSON
.
stringify
(
content
[
0
].
pos
)
//标题位置
},
makeSceneFixedDetailInfos
:
chartConfigToSetInfo
(
this
.
missionData
),
makeSceneStyleConfigureTopicDetailInfos
:
chartConfigToSetInfo
(
this
.
singleChoice
),
makeSceneGroupDetails
:
chartConfigToSetInfo
(
this
.
singleChoiceMixin
)
return
new
Promise
((
resolve
,
reject
)
=>
{
const
{
biInfoId
,
styleConfigureId
}
=
this
.
biInfo
;
const
{
content
}
=
this
.
$refs
[
'cover'
];
if
(
this
.
taskImageInfo
.
has
&&
!
this
.
taskImageInfo
.
isDelete
&&
!
this
.
taskImageInfo
.
imageUrls
.
length
)
{
reject
(
'照片墙:请删除或至少选择一张图片'
);
}
Promise
.
all
([
this
.
Bi
.
saveInfo
({
biInfoId
:
biInfoId
,
commandType
:
2
,
biStyleConfigureInfo
:
{
aspEnterpriseNameWrite
:
content
[
2
].
name
||
''
,
//乙方封面名称
aspNamePosition
:
JSON
.
stringify
(
content
[
2
].
pos
),
//乙方封面名称位置
styleConfigId
:
styleConfigureId
,
//封面配置ID
coverTemplateId
:
this
.
coverId
,
//封面ID
settlementTime
:
content
[
1
].
name
||
''
,
//封面时间
settlementTimePosition
:
JSON
.
stringify
(
content
[
1
].
pos
),
//封面时间位置
title
:
content
[
0
].
name
||
''
,
//封面标题
titlePosition
:
JSON
.
stringify
(
content
[
0
].
pos
)
//标题位置
},
makeSceneFixedDetailInfos
:
chartConfigToSetInfo
(
this
.
missionData
),
makeSceneStyleConfigureTopicDetailInfos
:
chartConfigToSetInfo
(
this
.
singleChoice
),
makeSceneGroupDetails
:
chartConfigToSetInfo
(
this
.
singleChoiceMixin
)
}),
...(
this
.
taskImageInfo
.
has
&&
[
this
.
Bi
.
saveBiPicList
({
biInfoId
,
isDelete
:
this
.
taskImageInfo
.
isDelete
,
...(
!
this
.
taskImageInfo
.
isDelete
&&
{
biInfoImageJson
:
JSON
.
stringify
(
this
.
taskImageInfo
.
imageUrls
.
map
(
item
=>
{
return
{
...
item
,
imageStyle
:
this
.
taskImageInfo
.
imageStyle
,
imageSize
:
this
.
taskImageInfo
.
imageSize
};
})
)
})
})
])
]).
then
(()
=>
{
resolve
();
});
});
},
exportBi
()
{
...
...
@@ -484,7 +565,9 @@ export default {
this
.
Bi
.
getFixedInfo
(),
this
.
Bi
.
getTopicInfo
(),
this
.
Bi
.
getGroupInfo
(),
this
.
Bi
.
getTemplateList
()
this
.
Bi
.
getTemplateList
(),
this
.
Bi
.
getImageList
(),
this
.
Bi
.
getImageQuestionCount
()
])
.
then
(
([
...
...
@@ -492,13 +575,21 @@ export default {
fixedInfo
,
topicInfo
,
topicMixinInfo
,
tempaletList
=
{
data
:
{
data
:
[]
}
}
tempaletList
=
{
data
:
{
data
:
[]
}
},
taskImageInfo
,
imageQuestionCount
])
=>
{
const
hasImageQuestion
=
imageQuestionCount
.
data
.
data
>
0
;
this
.
dealBaseInfo
(
baseInfo
.
data
.
data
[
0
]
||
{});
this
.
dealFixedInfo
(
fixedInfo
.
data
.
data
||
[]);
this
.
dealChoice
(
topicInfo
.
data
.
data
||
[]);
this
.
dealChoiceMixin
(
topicMixinInfo
.
data
.
data
||
[]);
this
.
coverList
=
tempaletList
.
data
.
data
||
[];
if
(
hasImageQuestion
)
{
Object
.
assign
(
this
.
taskImageInfo
,
taskImageInfo
.
data
.
data
,
{
has
:
hasImageQuestion
});
}
this
.
$nextTick
(
async
()
=>
{
await
this
.
preloadImg
(
this
.
coverUrl
);
window
.
status
=
'1'
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment