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 62a5103b
authored
Jun 08, 2022
by
web
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release' into 'master'
Release See merge request
!21
2 parents
84f7e4bc
e5c2a3d3
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
2241 additions
and
48 deletions
.eslintignore
package.json
src/App copy.vue
src/App.vue
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/components/photo-wall/waterfall.vue
src/packages/bi/src/main.vue
src/packages/bi/src/mixin/project.js
src/packages/bi/src/project/20-configurable.vue
.eslintignore
View file @
62a5103
/dist
\ No newline at end of file
/dist
/src/packages/bi/src/components/photo-wall/waterfall.vue
\ No newline at end of file
package.json
View file @
62a5103
{
"name"
:
"xrk-bi"
,
"version"
:
"0.
3.0-beta.1
1"
,
"version"
:
"0.
4.
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/App copy.vue
0 → 100644
View file @
62a5103
<!--
* @Description:
* @LastEditors: Please set LastEditors
* @Date: 2021-01-28 23:29:19
-->
<
template
>
<div>
<XrkBi
:print=
"1"
:cantEdit=
"2"
projectType=
"20"
from=
"cso"
v-bind=
"config"
:getTemplateList=
"getTemplateList"
></XrkBi>
</div>
<!--
<ul
class=
"pervie"
>
<li
name=
"任务记录"
>
<h1>
任务记录
</h1>
<TaskDetail
:config=
"taskDetailOptions"
></TaskDetail>
</li>
<li
name=
"滑动组件"
>
<h1>
滑动组件
</h1>
<div
style=
"padding:300px 0 30px 100px;width:350px;"
class=
"block"
>
<input
type=
"text"
v-model=
"form.phone"
/>
<button
@
click=
"showVerify"
>
submit
</button>
<XrkSlideVerify
ref=
"verify"
title=
"12"
:options=
"options"
></XrkSlideVerify>
</div>
</li>
</ul>
-->
</
template
>
<
script
>
import
{
getQueryVariable
}
from
'./packages/bi/src/chart-type/common'
;
export
default
{
name
:
'App'
,
data
()
{
return
{
isMobile
:
+
getQueryVariable
(
'mobile'
)
===
1
,
isPrint
:
+
getQueryVariable
(
'print'
)
===
1
,
projectType
:
+
getQueryVariable
(
'projectType'
)
||
6
,
componentName
:
getQueryVariable
(
'componentName'
)
||
'XrkBi'
,
config
:
{
getBaseInfo
()
{
return
{
data
:
{
data
:
[
{
styleConfigureSettlementTime
:
'2022-05-23'
,
createUserId
:
3
,
createFullName
:
'尚杰'
,
projectType
:
5
,
endDt
:
null
,
isAuditCso
:
0
,
dataCollectNumber
:
674806
,
type
:
1
,
title
:
'关于BI照片墙压力002产品全国区域患者调研项目数据报告'
,
isAuditGongye
:
0
,
aspEnterpriseNameWrite
:
'项目方:中国人民银行资本管理有限责任公司-甲方'
,
aspEnterpriseName
:
'康师傅方便面投资(中国)有限公司-乙方'
,
examinePeopleNumber
:
30673
,
executePeopleNumber
:
60
,
taskSum
:
30673
,
clickNum
:
null
,
id
:
155846
,
aspNamePosition
:
null
,
titlePosition
:
null
,
reportId
:
null
,
coverTemplateUrl
:
'https://cdn.yxvzb.com/sunflower/invoice/1651894583988.png'
,
isContrainGroupAnalyse
:
0
,
nameShowType
:
1
,
patternType
:
1
,
videoNum
:
null
,
isContrainSingleAnalyse
:
1
,
createDt
:
1653307550000
,
coverTemplateId
:
2
,
enterpriseType
:
null
,
isAuditAllince
:
0
,
settlementTime
:
'2022-05-23'
,
chooseTopicNum
:
2
,
startDt
:
null
,
enterpriseId
:
null
,
projectName
:
'关于BI照片墙压力002产品全国区域患者调研项目'
,
fenpeiId
:
121433
,
sendEnterpriseName
:
'中国人民银行资本管理有限责任公司-甲方'
,
projectId
:
6945
,
styleConfigureId
:
16248
,
styleConfigureSettlementTimePosition
:
null
,
totalTopicNum
:
2
,
csoAuditUser
:
null
}
],
message
:
'操作成功'
,
status
:
'1'
}
};
},
getFixedInfo
()
{
return
{
data
:
{
data
:
[
{
resultSystem
:
'项目执行总人数60人,其中男性60人,占比100.00%;女性0,占比0%'
,
resultUser
:
null
,
analyseDescribe
:
'执行人数60,18-30岁的男性占比100.00% ,女性0%;31-40岁的男性占比0% ,女性0%;41-50岁的男性占比0% ,女性0%;51岁以上的男性占比0% ,女性0%'
,
chartType
:
null
,
colourGroup
:
null
,
id
:
63753
,
fixedCountInfos
:
[
{
id
:
208295
,
fixedDetaileId
:
63753
,
num
:
60
,
passType
:
null
,
genderType
:
'男'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208296
,
fixedDetaileId
:
63753
,
num
:
0
,
passType
:
null
,
genderType
:
'女'
,
ageType
:
null
,
taskNumType
:
null
}
],
type
:
1
,
createDt
:
1653307550000
},
{
resultSystem
:
'项目执行总人数60人,其中18-30岁的60人,占比100.00%; 31-40岁的0人,占比0%;41-50岁的0人,占比0%;50岁及其以上0人 ,占比0%'
,
resultUser
:
null
,
analyseDescribe
:
'执行人数60,18-30岁的男性占比100.00% ,女性0%;31-40岁的男性占比0% ,女性0%;41-50岁的男性占比0% ,女性0%;51岁以上的男性占比0% ,女性0%'
,
chartType
:
null
,
colourGroup
:
null
,
id
:
63754
,
fixedCountInfos
:
[
{
id
:
208297
,
fixedDetaileId
:
63754
,
num
:
60
,
passType
:
null
,
genderType
:
'18-30岁'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208298
,
fixedDetaileId
:
63754
,
num
:
0
,
passType
:
null
,
genderType
:
'31-40岁'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208299
,
fixedDetaileId
:
63754
,
num
:
0
,
passType
:
null
,
genderType
:
'41-50岁'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208300
,
fixedDetaileId
:
63754
,
num
:
0
,
passType
:
null
,
genderType
:
'51岁以上'
,
ageType
:
null
,
taskNumType
:
null
}
],
type
:
2
,
createDt
:
1653307550000
},
{
resultSystem
:
'项目执行总人数60人:完成1-10单的有0人,占比0%;完成11-20单的有0人,占比0%;完成21-30单的有0人,占比0%;完成31-40单的有0人,占比0%;完成41单以上的有60人,占比100.00%'
,
resultUser
:
null
,
analyseDescribe
:
null
,
chartType
:
null
,
colourGroup
:
null
,
id
:
63755
,
fixedCountInfos
:
[
{
id
:
208301
,
fixedDetaileId
:
63755
,
num
:
0
,
passType
:
null
,
genderType
:
'1-10'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208302
,
fixedDetaileId
:
63755
,
num
:
0
,
passType
:
null
,
genderType
:
'11-20'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208303
,
fixedDetaileId
:
63755
,
num
:
0
,
passType
:
null
,
genderType
:
'21-30'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208304
,
fixedDetaileId
:
63755
,
num
:
0
,
passType
:
null
,
genderType
:
'31-40'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208305
,
fixedDetaileId
:
63755
,
num
:
60
,
passType
:
null
,
genderType
:
'41个以上'
,
ageType
:
null
,
taskNumType
:
null
}
],
type
:
3
,
createDt
:
1653307550000
},
{
resultSystem
:
'项目执行总任务数:0次,其中通过任务数0,占比0%;未通过任务数0,占比0%'
,
resultUser
:
null
,
analyseDescribe
:
null
,
chartType
:
null
,
colourGroup
:
null
,
id
:
63756
,
fixedCountInfos
:
[
{
id
:
208306
,
fixedDetaileId
:
63756
,
num
:
0
,
passType
:
null
,
genderType
:
'通过'
,
ageType
:
null
,
taskNumType
:
null
},
{
id
:
208307
,
fixedDetaileId
:
63756
,
num
:
0
,
passType
:
null
,
genderType
:
'未通过'
,
ageType
:
null
,
taskNumType
:
null
}
],
type
:
4
,
createDt
:
1653307550000
}
],
message
:
'操作成功'
,
status
:
'1'
}
};
},
getTopicInfo
()
{
return
{
data
:
{
data
:
[
{
resultSystem
:
'参与【此题为单选题(点击编辑题干)】调查的30673个样本。选择答案【选项1】有30673个,占比100.00%'
,
resultUser
:
null
,
isDelete
:
0
,
type
:
1
,
createDt
:
1653307550000
,
topicTitle
:
'此题为单选题(点击编辑题干)'
,
topicId
:
7768
,
showSort
:
null
,
chartType
:
null
,
topicCountInfos
:
[
{
xTopicName
:
'选项1'
,
topicDetaileId
:
124730
,
countNum
:
30673
,
id
:
467661
}
],
colourGroup
:
null
,
id
:
124730
,
resultIsShow
:
1
},
{
resultSystem
:
'参与【此题为多选题(点击编辑题干)】调查的30673个样本。选择答案【选项1】有30673个,占比100.00%'
,
resultUser
:
null
,
isDelete
:
0
,
type
:
2
,
createDt
:
1653307550000
,
topicTitle
:
'此题为多选题(点击编辑题干)'
,
topicId
:
7771
,
showSort
:
null
,
chartType
:
null
,
topicCountInfos
:
[
{
xTopicName
:
'选项1'
,
topicDetaileId
:
124731
,
countNum
:
30673
,
id
:
467662
}
],
colourGroup
:
null
,
id
:
124731
,
resultIsShow
:
1
}
],
message
:
'操作成功'
,
status
:
'1'
}
};
},
getGroupInfo
()
{
return
{
data
:
{
data
:
[],
message
:
'操作成功'
,
status
:
'1'
}
};
},
// 获取是否含有照片题
getImageQuestionCount
()
{
return
{
data
:
{
data
:
2
,
message
:
'操作成功'
,
status
:
'1'
}
};
},
// 当期BI-保持选择的图片
saveBiPicList
()
{
return
{
data
:
{
data
:
[],
message
:
'操作成功'
,
status
:
'1'
}
};
},
// 当期BI-任务记录图片列表
getTaskPicList
()
{
return
{
data
:
{
data
:
{
imageStyle
:
1
,
//展示样式 1 流式 2平铺
imageSize
:
2
,
//图片大小 1 大 2中 3小
taskImages
:
[
{
biInfoId
:
123
,
//BI主键
taskId
:
123
,
//任务记录ID
imageUrl
:
'http://yiyang.oss-cn-beijing.aliyuncs.com/WEB/SaaS/images/2103251844.png'
},
{
biInfoId
:
123
,
//BI主键
taskId
:
123
,
//任务记录ID
imageUrl
:
'http://yiyang.oss-cn-beijing.aliyuncs.com/WEB/SaaS/images/2103251844.png'
},
{
biInfoId
:
123
,
//BI主键
taskId
:
123
,
//任务记录ID
imageUrl
:
'http://yiyang.oss-cn-beijing.aliyuncs.com/WEB/SaaS/images/2103251844.png'
}
]
},
message
:
'操作成功'
,
status
:
'1'
}
};
},
// 累计、当期、自定义BI获取随机50张图片
getImageList
()
{
return
{
data
:
{
data
:
{
topicDetailId
:
124732
,
isDelete
:
0
,
imageUrls
:
[
{
id
:
5253
,
biInfoId
:
155846
,
taskId
:
1508932
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5254
,
biInfoId
:
155846
,
taskId
:
1508683
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5255
,
biInfoId
:
155846
,
taskId
:
1509580
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5256
,
biInfoId
:
155846
,
taskId
:
1509456
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5257
,
biInfoId
:
155846
,
taskId
:
1508944
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5258
,
biInfoId
:
155846
,
taskId
:
1509098
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5259
,
biInfoId
:
155846
,
taskId
:
1509051
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5260
,
biInfoId
:
155846
,
taskId
:
1509463
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5261
,
biInfoId
:
155846
,
taskId
:
1509453
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5262
,
biInfoId
:
155846
,
taskId
:
1509000
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5263
,
biInfoId
:
155846
,
taskId
:
1509477
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5264
,
biInfoId
:
155846
,
taskId
:
1509368
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5265
,
biInfoId
:
155846
,
taskId
:
1509064
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5266
,
biInfoId
:
155846
,
taskId
:
1509141
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5267
,
biInfoId
:
155846
,
taskId
:
1509233
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5268
,
biInfoId
:
155846
,
taskId
:
1509546
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5269
,
biInfoId
:
155846
,
taskId
:
1508757
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5270
,
biInfoId
:
155846
,
taskId
:
1509436
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5271
,
biInfoId
:
155846
,
taskId
:
1508743
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5272
,
biInfoId
:
155846
,
taskId
:
1508735
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5273
,
biInfoId
:
155846
,
taskId
:
1509518
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5274
,
biInfoId
:
155846
,
taskId
:
1508821
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5275
,
biInfoId
:
155846
,
taskId
:
1509240
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5276
,
biInfoId
:
155846
,
taskId
:
1509222
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5277
,
biInfoId
:
155846
,
taskId
:
1509035
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5278
,
biInfoId
:
155846
,
taskId
:
1509141
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5279
,
biInfoId
:
155846
,
taskId
:
1508767
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5280
,
biInfoId
:
155846
,
taskId
:
1508557
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5281
,
biInfoId
:
155846
,
taskId
:
1509580
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5282
,
biInfoId
:
155846
,
taskId
:
1508749
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5283
,
biInfoId
:
155846
,
taskId
:
1509133
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5284
,
biInfoId
:
155846
,
taskId
:
1509179
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5285
,
biInfoId
:
155846
,
taskId
:
1509241
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5286
,
biInfoId
:
155846
,
taskId
:
1508940
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5287
,
biInfoId
:
155846
,
taskId
:
1509281
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5288
,
biInfoId
:
155846
,
taskId
:
1508594
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5289
,
biInfoId
:
155846
,
taskId
:
1509281
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5290
,
biInfoId
:
155846
,
taskId
:
1509241
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5291
,
biInfoId
:
155846
,
taskId
:
1508749
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5292
,
biInfoId
:
155846
,
taskId
:
1509052
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5293
,
biInfoId
:
155846
,
taskId
:
1509592
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5294
,
biInfoId
:
155846
,
taskId
:
1509336
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5295
,
biInfoId
:
155846
,
taskId
:
1509136
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5296
,
biInfoId
:
155846
,
taskId
:
1509524
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/R4JPN1_1653287247871.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=7BFCC7FFE3202860C3C964BDF7E27FEA7FFEFFFCFCE061A0F900E800B2009200&pHash=D9B4270020000000'
},
{
id
:
5297
,
biInfoId
:
155846
,
taskId
:
1508784
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5298
,
biInfoId
:
155846
,
taskId
:
1508804
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3WRPC8_1653287250895.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=C5FB9E7F1C9FE01950A3BFDF77FFFFF8F8FCFFF5FFF6FE0A8000000000000000&pHash=DA10241800000000'
},
{
id
:
5299
,
biInfoId
:
155846
,
taskId
:
1509028
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5300
,
biInfoId
:
155846
,
taskId
:
1508821
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
},
{
id
:
5301
,
biInfoId
:
155846
,
taskId
:
1508858
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/3LYNWV_1653287253819.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=0000000000033FFFDFFF3FFFFFFFFFDBFFFFFFC03FFFDFFD177FE400003F4080&pHash=831B494000000400'
},
{
id
:
5302
,
biInfoId
:
155846
,
taskId
:
1509222
,
imageUrl
:
'https://cdn.yxvzb.com/sunflower/xcx/M7U6JV_1653287244442.jpg?x-oss-process=style/set-jpg&auto-orient&aHash=FFFEFFFEFFFE3EC67F7C7F208BFECCE2E7982138227E46660FF03FF0F29E8004&pHash=E0A01A8A00821080'
}
],
imageSize
:
2
,
imageStyle
:
2
},
message
:
'操作成功'
,
status
:
'1'
}
};
},
saveInfo
()
{
return
null
;
},
exportBi
()
{
return
null
;
}
}
};
},
methods
:
{
getTemplateList
()
{
return
{
data
:
{
data
:
[
{
id
:
2
,
templateCode
:
null
,
templateName
:
'2022050711'
,
templatePicUrl
:
'https://cdn.yxvzb.com/sunflower/invoice/1651894583988.png'
,
status
:
null
,
isDelete
:
null
,
createDt
:
null
}
],
message
:
'操作成功'
,
status
:
'1'
}
};
}
}
};
</
script
>
<
style
>
.block
{
box-sizing
:
border-box
;
border-radius
:
8px
;
box-shadow
:
0
0
20px
rgba
(
0
,
0
,
0
,
0.2
);
}
</
style
>
src/App.vue
View file @
62a5103
...
...
@@ -11,8 +11,8 @@
:mobile=
"isMobile"
:print=
"isPrint"
:projectType=
"projectType"
:selectType=
"selectType"
></component>
<!--
<XrkTaskRecordPdf
:projectType=
"20"
:taskId=
"1209388"
:from=
"1"
/>
-->
</div>
<!--
<ul
class=
"pervie"
>
<li
name=
"任务记录"
>
...
...
@@ -36,7 +36,7 @@
<
script
>
import
{
getQueryVariable
}
from
'./packages/bi/src/chart-type/common'
;
// import { XrkTaskRecordPdf } from './packages/task-recored/index';
export
default
{
name
:
'App'
,
data
()
{
...
...
@@ -44,7 +44,8 @@ export default {
isMobile
:
+
getQueryVariable
(
'mobile'
)
===
1
,
isPrint
:
+
getQueryVariable
(
'print'
)
===
1
,
projectType
:
+
getQueryVariable
(
'projectType'
)
||
6
,
componentName
:
getQueryVariable
(
'componentName'
)
||
'XrkBi'
componentName
:
getQueryVariable
(
'componentName'
)
||
'XrkBi'
,
selectType
:
+
getQueryVariable
(
'selectType'
)
||
45
// 44自定义-BI报告 45当期-BI报告 46累计-BI报告
};
}
};
...
...
src/main.js
View file @
62a5103
/*
* @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'
;
Vue
.
config
.
productionTip
=
false
;
Vue
.
use
(
Xrk
);
...
...
src/packages/bi/src/commonComponents/title.vue
View file @
62a5103
...
...
@@ -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 @
62a5103
...
...
@@ -74,7 +74,6 @@ export default {
// return cataloguePageSize;
//
}
}
,
created
()
{
}
,
watch
:
{
catalogueArr
:
{
handler
()
{
...
...
src/packages/bi/src/components/operate.vue
View file @
62a5103
...
...
@@ -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 @
62a5103
<!--
* @Description:
* @Date: 2022-05-13 09:41:06
-->
<
template
>
<div>
<el-button
@
click=
"handleRemove"
class=
"bi-photo_btn"
>
<img
src=
"http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/delete.svg"
alt=
""
/>
删除
</el-button>
</div>
</
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 @
62a5103
<
template
>
<!--
<ul
:style=
"
{ columnCount }">
<li
v-for=
"(item, index) in taskImageInfo.imageUrls"
:key=
"index"
>
<img
:src=
"setUrl(item.imageUrl)"
/>
</li>
</ul>
-->
<div>
<div
v-for=
"(imageUrls, imageUrlsIndex) in waterfalls"
:key=
"imageUrlsIndex"
>
<waterfall
ref=
"waterfall"
:col=
"columnCount"
:data=
"imageUrls"
@
finish=
"finish"
>
<template>
<div
v-for=
"(item, index) in imageUrls"
:key=
"index"
:style=
"
{
padding: '10px 0',
'text-align': 'center'
}"
>
<img
:style=
"
{ width: widthPx, height: heightPx }"
:src="setUrl(item.imageUrl)"
/>
</div>
</
template
>
</waterfall>
</div>
</div>
</template>
<
script
>
import
waterfall
from
'./waterfall.vue'
;
const
IMG_MAPPING
=
{
1
:
{
column
:
2
,
// 2列数据
width
:
548
,
height
:
305
},
2
:
{
column
:
3
,
width
:
355
,
height
:
198
},
3
:
{
column
:
4
,
width
:
262
,
height
:
144
}
};
const
baseHeight
=
1697
;
export
default
{
name
:
'bi-photo-wall-images'
,
components
:
{
waterfall
},
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: '图片地址'
// }
]
};
}
}
},
watch
:
{
taskImageInfo
:
{
deep
:
true
,
immediate
:
true
,
handler
(
v
)
{
const
{
imageUrls
,
imageStyle
}
=
v
;
let
waterfalls
=
[];
const
titleHeight
=
88
;
const
margin
=
20
;
// 第一页图片总列数
const
firstColumnNum
=
Math
.
floor
(
(
baseHeight
-
titleHeight
)
/
(
this
.
height
+
margin
)
);
// 其他页图片总列数
const
otherColumnNum
=
Math
.
floor
(
baseHeight
/
(
this
.
height
+
margin
));
const
firstCount
=
firstColumnNum
*
this
.
columnCount
;
// 第一页数据总数
const
otherCount
=
otherColumnNum
*
this
.
columnCount
;
// 其他页数据总数
if
(
imageUrls
)
{
if
(
imageStyle
===
2
)
{
imageUrls
.
forEach
((
item
,
index
)
=>
{
// 第一个 || 第一组最后一个(只会出现一次) || 其他组最后一个(多次出现)
if
(
index
===
0
||
index
===
firstCount
||
!
(
index
%
otherCount
)
)
{
waterfalls
[
waterfalls
.
length
]
=
[];
}
waterfalls
[
waterfalls
.
length
-
1
].
push
(
item
);
});
}
else
{
waterfalls
=
[
imageUrls
];
}
this
.
waterfalls
=
waterfalls
;
}
}
}
},
data
()
{
return
{
waterfalls
:
[]
// 二维数组,第一个为第一页算上title单独计算,其他为统一计算分组
};
},
computed
:
{
columnCount
()
{
return
IMG_MAPPING
[
this
.
taskImageInfo
.
imageSize
].
column
;
},
width
()
{
return
IMG_MAPPING
[
this
.
taskImageInfo
.
imageSize
].
width
;
},
height
()
{
return
IMG_MAPPING
[
this
.
taskImageInfo
.
imageSize
].
height
;
},
widthPx
()
{
return
this
.
width
+
'px'
;
},
heightPx
()
{
if
(
this
.
taskImageInfo
.
imageStyle
===
2
)
{
return
this
.
height
+
'px'
;
}
return
'auto'
;
}
},
methods
:
{
finish
()
{
this
.
$emit
(
'finish'
);
},
setUrl
(
url
)
{
// x-oss-process=image/resize,w_355 流式
// ?x-oss-process=image/resize,m_fill,w_355,h_355
const
_url
=
url
.
split
(
'?'
)[
0
];
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
.
height
}
`
;
}
}
};
</
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
;
li
{
break-inside
:
avoid
;
img
{
max-height
:
588px
;
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 @
62a5103
<!--
* @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
style=
"margin: 0 5px"
v-if=
"showEdit"
:layout=
"
{
imageStyle: value.imageStyle,
imageSize: value.imageSize
}"
@handleSave="selectStyleSave"
/>
<SelectImages
style=
"margin: 0 5px"
v-if=
"showEdit"
:imageUrls=
"value.imageUrls"
@
handleSave=
"selectImgSave"
/>
<Del
style=
"margin: 0 5px"
@
del=
"onDel"
/>
</div>
</
template
>
</BiTitle>
<BiImages
:taskImageInfo=
"value"
@
finish=
"finish"
/>
</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
}
},
computed
:
{
showEdit
()
{
return
+
this
.
Bi
.
selectType
===
45
;
// 44自定义-BI报告 45当期-BI报告(显示样式、选择) 46累计-BI报告
}
},
methods
:
{
finish
()
{
this
.
$emit
(
'finish'
);
},
// 选择图片的保存
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
:
flex-end
;
}
</
style
>
src/packages/bi/src/components/photo-wall/select.vue
0 → 100644
View file @
62a5103
<
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 && !imageUrlsMap.includes(item.imageUrl)"
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 @
62a5103
<
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/components/photo-wall/waterfall.vue
0 → 100644
View file @
62a5103
<
template
>
<div
class=
"vue-waterfall"
:style=
"
{ height: height }"
ref="vueWaterfall"
id="vueWaterfall"
:class="isTransition
&&
'is-transition'"
>
<div
class=
"slot-box"
>
<slot></slot>
</div>
</div>
</
template
>
<
script
>
export
default
{
props
:
{
col
:
{
type
:
Number
,
default
:
2
},
width
:
Number
,
height
:
{
type
:
String
// default:'100vh', 取消height默认值
},
data
:
{
type
:
Array
,
default
:
[]
},
gutterWidth
:
{
type
:
Number
,
default
:
10
},
isTransition
:
{
type
:
Boolean
,
default
:
true
},
lazyDistance
:
{
type
:
Number
,
default
:
300
},
loadDistance
:
{
type
:
Number
,
default
:
300
}
},
data
()
{
return
{
root
:
null
,
columns
:
[],
loadmore
:
true
,
timeout
:
null
,
lazyTimeout
:
null
,
lastScrollTop
:
0
,
timer
:
null
,
loadedIndex
:
0
,
columnWidth
:
0
,
isresizing
:
false
,
clientHeight
:
document
.
documentElement
.
clientHeight
||
document
.
body
.
clientHeight
,
clientWidth
:
document
.
documentElement
.
clientWidth
||
document
.
body
.
clientWidth
};
},
computed
:
{
trueLazyDistance
()
{
return
(
this
.
clientWidth
/
375
)
*
this
.
lazyDistance
;
},
max
()
{
return
(
this
.
clientWidth
/
375
)
*
this
.
loadDistance
;
}
},
watch
:
{
col
(
val
)
{
this
.
$nextTick
(()
=>
{
this
.
init
();
});
},
data
(
newVal
,
oldVal
)
{
this
.
$nextTick
(()
=>
{
clearTimeout
(
this
.
timer
);
this
.
timer
=
setTimeout
(()
=>
{
if
(
this
.
isresizing
)
{
return
;
}
if
(
newVal
.
length
<
this
.
loadedIndex
)
{
this
.
loadedIndex
=
0
;
}
if
(
newVal
.
length
>
oldVal
.
length
||
newVal
.
length
>
this
.
loadedIndex
)
{
if
(
newVal
.
length
===
oldVal
.
length
)
{
this
.
resize
(
this
.
loadedIndex
>
0
?
this
.
loadedIndex
:
null
);
return
;
}
this
.
resize
(
oldVal
.
length
>
0
?
oldVal
.
length
:
null
);
}
},
300
);
});
}
},
methods
:
{
init
()
{
//initialize
this
.
root
=
this
.
$refs
.
vueWaterfall
;
this
.
clearColumn
();
var
col
=
parseInt
(
this
.
col
);
for
(
var
i
=
0
;
i
<
col
;
i
++
)
{
let
odiv
=
document
.
createElement
(
'div'
);
odiv
.
className
=
'vue-waterfall-column'
;
if
(
this
.
width
)
{
odiv
.
style
.
width
=
this
.
width
+
'px'
;
if
(
i
!=
0
)
{
odiv
.
style
.
marginLeft
=
this
.
gutterWidth
+
'px'
;
}
this
.
columnWidth
=
this
.
width
;
}
else
{
odiv
.
style
.
width
=
100
/
parseInt
(
col
)
+
'%'
;
this
.
columnWidth
=
(
100
/
parseInt
(
col
)
/
100
)
*
document
.
documentElement
.
clientWidth
;
}
if
(
!
this
.
root
)
{
this
.
root
=
this
.
$refs
.
vueWaterfall
;
}
this
.
root
&&
this
.
root
.
appendChild
(
odiv
);
this
.
columns
.
push
(
odiv
);
}
this
.
resize
();
},
async
__setDomImageHeight
(
dom
)
{
if
(
!
dom
.
getElementsByTagName
)
{
return
;
}
var
imgs
=
dom
.
getElementsByTagName
(
'img'
);
for
(
var
i
=
0
;
i
<
imgs
.
length
;
i
++
)
{
var
lazySrc
=
imgs
[
i
].
getAttribute
(
'lazy-src'
);
if
(
!
imgs
[
i
].
getAttribute
(
'src'
)
&&
lazySrc
)
{
var
newImg
=
new
Image
();
var
parameter
=
`
${
lazySrc
.
includes
(
'?'
)
?
'&'
:
'?'
}
t=
${
Date
.
now
()}
`
;
newImg
.
src
=
lazySrc
+
parameter
;
if
(
newImg
.
complete
)
{
var
trueWidth
=
imgs
[
i
].
offsetWidth
||
this
.
columnWidth
;
var
imgColumnHeight
=
(
newImg
.
height
*
trueWidth
)
/
newImg
.
width
;
if
(
imgs
[
i
].
offsetWidth
)
{
imgs
[
i
].
style
.
height
=
imgColumnHeight
+
'px'
;
}
}
else
{
await
new
Promise
((
resolve
,
reject
)
=>
{
newImg
.
onload
=
function
()
{
var
trueWidth
=
imgs
[
i
].
offsetWidth
||
this
.
columnWidth
;
var
imgColumnHeight
=
(
newImg
.
height
*
trueWidth
)
/
newImg
.
width
;
if
(
imgs
[
i
].
offsetWidth
)
{
imgs
[
i
].
style
.
height
=
imgColumnHeight
+
'px'
;
}
resolve
();
};
newImg
.
onerror
=
function
()
{
resolve
();
};
});
}
}
}
},
async
append
(
dom
)
{
//append dom element
var
self
=
this
;
if
(
this
.
columns
.
length
>
0
)
{
let
min
=
this
.
columns
[
0
];
for
(
var
i
=
1
;
i
<
this
.
columns
.
length
;
i
++
)
{
if
(
(
await
self
.
__getHeight
(
min
))
>
(
await
self
.
__getHeight
(
self
.
columns
[
i
]))
)
{
min
=
self
.
columns
[
i
];
}
}
await
this
.
__setDomImageHeight
(
dom
);
min
&&
min
.
appendChild
(
dom
);
}
},
checkImg
(
dom
)
{
//check has image
if
(
!
dom
)
{
return
false
;
}
if
(
dom
.
getElementsByTagName
&&
dom
.
getElementsByTagName
(
'img'
).
length
)
{
return
true
;
}
else
{
return
false
;
}
},
async
resize
(
index
,
elements
)
{
//resize and render
this
.
isresizing
=
true
;
this
.
routeChanged
=
false
;
// 重置routeChanged
var
self
=
this
;
if
(
!
this
.
$slots
.
default
)
{
this
.
isresizing
=
false
;
return
;
}
if
(
!
index
&&
index
!=
0
&&
!
elements
)
{
elements
=
this
.
$slots
.
default
;
this
.
loadedIndex
=
0
;
this
.
clear
();
}
else
if
(
!
elements
)
{
this
.
loadedIndex
=
index
;
elements
=
this
.
$slots
.
default
.
splice
(
index
);
}
for
(
var
j
=
0
;
j
<
elements
.
length
;
j
++
)
{
if
(
this
.
routeChanged
)
{
console
.
warn
(
'路由发生变化,<vue-waterfall>组件停止渲染'
);
break
;
}
if
(
elements
[
j
].
elm
&&
self
.
checkImg
(
elements
[
j
].
elm
))
{
var
imgs
=
elements
[
j
].
elm
.
getElementsByTagName
(
'img'
);
var
_url
=
imgs
[
0
].
getAttribute
(
'src'
)
||
imgs
[
0
].
getAttribute
(
'lazy-src'
);
var
parameter
=
`
${
_url
.
includes
(
'?'
)
?
'&'
:
'?'
}
t=
${
Date
.
now
()}
`
;
var
newImg
=
new
Image
();
newImg
.
src
=
_url
+
parameter
;
if
(
newImg
.
complete
)
{
await
self
.
append
(
elements
[
j
].
elm
);
self
.
lazyLoad
(
imgs
);
}
else
{
await
new
Promise
((
resolve
,
reject
)
=>
{
newImg
.
onload
=
async
function
()
{
await
self
.
append
(
elements
[
j
].
elm
);
self
.
lazyLoad
(
imgs
);
resolve
();
};
newImg
.
onerror
=
async
function
(
e
)
{
await
self
.
append
(
elements
[
j
].
elm
);
self
.
lazyLoad
(
imgs
);
resolve
();
};
});
}
}
else
{
await
self
.
append
(
elements
[
j
].
elm
);
}
self
.
loadedIndex
++
;
}
this
.
isresizing
=
false
;
self
.
$emit
(
'finish'
);
},
computedPx
(
img
,
imgApi
)
{
img
.
style
.
width
=
imgApi
.
width
/
this
.
columnWidth
;
},
lazyLoad
(
imgs
)
{
if
(
!
imgs
)
{
if
(
!
this
.
root
)
{
this
.
root
=
this
.
$refs
.
vueWaterfall
;
}
imgs
=
this
.
root
&&
this
.
root
.
getElementsByTagName
(
'img'
);
}
if
(
!
imgs
||
imgs
.
length
<
0
)
{
return
;
}
for
(
var
index
=
0
;
index
<
imgs
.
length
;
index
++
)
{
if
(
imgs
[
index
].
className
.
match
(
'animation'
)
&&
imgs
[
index
].
getAttribute
(
'src'
)
)
{
continue
;
}
else
if
(
imgs
[
index
].
className
.
match
(
'animation'
)
&&
!
imgs
[
index
].
getAttribute
(
'src'
)
)
{
imgs
[
index
].
src
=
imgs
[
index
].
getAttribute
(
'lazy-src'
);
imgs
[
index
].
removeAttribute
(
'lazy-src'
);
}
else
if
(
imgs
[
index
].
getAttribute
(
'src'
)
&&
!
imgs
[
index
].
className
.
match
(
'animation'
)
)
{
imgs
[
index
].
className
=
imgs
[
index
].
className
+
' animation'
;
}
else
if
(
!
imgs
[
index
].
getAttribute
(
'src'
)
&&
imgs
[
index
].
getBoundingClientRect
().
top
<
this
.
clientHeight
+
this
.
trueLazyDistance
)
{
imgs
[
index
].
src
=
imgs
[
index
].
getAttribute
(
'lazy-src'
);
imgs
[
index
].
className
=
imgs
[
index
].
className
+
' animation'
;
imgs
[
index
].
removeAttribute
(
'lazy-src'
);
}
}
},
clearColumn
()
{
this
.
columns
.
forEach
(
item
=>
{
item
.
remove
();
});
this
.
columns
=
[];
},
clear
()
{
this
.
columns
.
forEach
(
item
=>
{
item
.
innerHTML
=
''
;
});
},
mix
()
{
var
elements
=
this
.
$slots
.
default
;
elements
.
sort
(()
=>
{
return
Math
.
random
()
-
0.5
;
});
this
.
resize
(
0
,
elements
);
},
async
__getHeight
(
dom
)
{
return
dom
.
offsetHeight
;
},
__emitLoadMore
()
{
if
(
!
this
.
root
)
{
return
;
}
var
self
=
this
;
const
scrollTop
=
this
.
height
?
this
.
root
.
scrollTop
:
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
;
const
scrollHeight
=
this
.
height
?
this
.
root
.
scrollHeight
:
document
.
documentElement
.
offsetHeight
;
var
diff
=
scrollHeight
-
scrollTop
-
self
.
clientHeight
;
self
.
$emit
(
'scroll'
,
{
scrollHeight
:
scrollHeight
,
scrollTop
:
scrollTop
,
clientHeight
:
self
.
clientHeight
,
diff
:
diff
,
time
:
Date
.
now
()
});
if
(
diff
<
self
.
max
&&
self
.
loadmore
&&
scrollHeight
>
self
.
clientHeight
)
{
self
.
lastScrollTop
=
scrollTop
;
self
.
loadmore
=
false
;
self
.
$emit
(
'loadmore'
);
}
else
if
(
diff
>=
self
.
max
)
{
self
.
loadmore
=
true
;
}
clearTimeout
(
self
.
lazyTimeout
);
self
.
lazyTimeout
=
setTimeout
(
function
()
{
self
.
lazyLoad
();
},
14
);
},
// 监听路由是否发生变化
__listenRouterChange
()
{
// 重写pushState与replaceState事件函数
var
_wr
=
function
(
type
)
{
// 记录原生事件
var
orig
=
history
[
type
];
return
function
()
{
// 触发原生事件
var
rv
=
orig
.
apply
(
this
,
arguments
);
// 自定义事件
var
e
=
new
Event
(
type
);
e
.
arguments
=
arguments
;
// 触发自定义事件
window
.
dispatchEvent
(
e
);
return
rv
;
};
};
const
events
=
[
'replaceState'
,
'pushState'
];
events
.
forEach
(
event
=>
{
window
.
addEventListener
(
event
,
()
=>
{
this
.
routeChanged
=
true
;
});
// 重写history
window
.
history
[
event
]
=
_wr
(
event
);
});
window
.
addEventListener
(
'popstate'
,
()
=>
{
this
.
routeChanged
=
true
;
});
}
},
destroyed
()
{
this
.
root
&&
(
this
.
root
.
onscroll
=
null
);
this
.
root
&&
(
this
.
root
.
onresize
=
null
);
window
.
onscroll
=
null
;
window
.
onresize
=
null
;
},
beforeCreate
()
{
// bus.$on('forceUpdate', () => {
// this.resize();
// });
// bus.$on('mix', () => {
// this.mix();
// });
},
updated
()
{
// console.log(555);
// this.resize();
},
mounted
()
{
this
.
__listenRouterChange
();
this
.
$nextTick
(()
=>
{
this
.
init
();
var
self
=
this
;
if
(
this
.
height
)
{
this
.
root
.
onscroll
=
function
(
e
)
{
self
.
__emitLoadMore
();
};
this
.
root
.
addEventListener
(
'touchmove'
,
function
()
{
self
.
__emitLoadMore
();
});
}
else
{
window
.
onscroll
=
function
(
e
)
{
self
.
__emitLoadMore
();
};
document
.
addEventListener
(
'touchmove'
,
function
()
{
self
.
__emitLoadMore
();
});
}
});
}
};
</
script
>
<
style
>
.vue-waterfall
{
width
:
100%
;
overflow-y
:
auto
;
position
:
relative
;
}
.vue-waterfall
.slot-box
{
position
:
absolute
;
top
:
100%
;
left
:
100%
;
width
:
0
;
height
:
0
;
overflow
:
hidden
;
}
.vue-waterfall
.vue-waterfall-column
{
float
:
left
;
}
/* .vue-waterfall.is-transition img {
opacity: 0;
}
.vue-waterfall.is-transition img.animation {
animation: 0.4s lazy-animation linear;
animation-fill-mode: forwards;
}
@keyframes lazy-animation {
from {
opacity: 0;
}
to {
opacity: 1;
}
} */
</
style
>
src/packages/bi/src/main.vue
View file @
62a5103
...
...
@@ -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-06-07 11:25:17
-->
<
template
>
<div
class=
"xrk-components-bi bi"
:class=
"
{ 'bi-print': print }">
...
...
@@ -59,6 +58,7 @@ export default {
cantEdit
:
[
Number
,
String
],
projectType
:
[
Number
,
String
],
from
:
[
Number
,
String
],
selectType
:
Number
,
// 44自定义-BI报告 45当期-BI报告 46累计-BI报告
getBaseInfo
:
{
type
:
Function
,
default
:
()
=>
{}
...
...
@@ -86,6 +86,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/mixin/project.js
View file @
62a5103
...
...
@@ -51,6 +51,12 @@ export default {
resolve
(
'load fail'
);
};
});
},
preloadImgs
(
urls
)
{
if
(
!
urls
.
length
)
{
return
Promise
.
resolve
();
}
return
Promise
.
all
(
urls
.
map
(
url
=>
this
.
preloadImg
(
url
)));
}
}
};
src/packages/bi/src/project/20-configurable.vue
View file @
62a5103
...
...
@@ -53,9 +53,28 @@
@
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')"
@
finish=
"taskImageInfo.finish = true"
/>
<BiCoverEnd
title=
"奇正藏药医学沙龙推广项目数据报告"
></BiCoverEnd>
<BiOperate
:questionData=
"[...singleChoice, ...singleChoiceMixin]"
:questionData=
"[...singleChoice, ...singleChoiceMixin
, taskImageInfo
]"
:saveInfo=
"saveInfo"
:exportBi=
"exportBi"
></BiOperate>
...
...
@@ -70,8 +89,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 +120,8 @@ export default {
BiSingleChoice
,
BiSingleChoiceInfo
,
BiCoverEnd
,
BiOperate
BiOperate
,
BiPhoto
},
data
()
{
return
{
...
...
@@ -117,7 +138,25 @@ export default {
projectName
:
''
,
baseInfo
:
[],
textData
:
[],
biInfo
:
{}
biInfo
:
{},
taskImageInfo
:
{
title
:
{
name
:
'照片墙'
},
finish
:
false
,
// 图片是否渲染完成
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 +217,18 @@ export default {
};
})
]
}
},
...(
!
this
.
hideTaskImage
&&
[
{
name
:
'照片合集'
,
child
:
[
{
name
:
'照片合集'
,
page
:
4
}
]
}
])
];
},
showSingleChoice
()
{
...
...
@@ -192,9 +242,21 @@ export default {
},
hideSingleChoiceMixin
()
{
return
this
.
dealSingleChoice
(
this
.
singleChoiceMixin
,
true
);
},
hideTaskImage
()
{
return
!!
this
.
taskImageInfo
.
isDelete
||
!
this
.
taskImageInfo
.
has
;
}
},
methods
:
{
taskImageFinish
(
resolve
)
{
if
(
this
.
taskImageInfo
.
finish
)
{
resolve
();
}
else
{
setTimeout
(()
=>
{
this
.
taskImageFinish
(
resolve
);
},
1000
);
}
},
dealPos
(
dis
)
{
return
dis
*
(
this
.
isPrint
?
printWidth
:
this
.
baseFontSize
);
},
...
...
@@ -452,26 +514,52 @@ 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
.
hideTaskImage
&&
!
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 +572,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,16 +582,33 @@ 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
||
[];
// taskImageInfo.data.data.imageUrls.forEach(item => {
// item.imageUrl = item.imageUrl.replace('https', 'http');
// });
Object
.
assign
(
this
.
taskImageInfo
,
taskImageInfo
.
data
.
data
,
{
has
:
hasImageQuestion
,
finish
:
!
hasImageQuestion
||
!!
taskImageInfo
.
data
.
data
.
isDelete
});
this
.
$nextTick
(
async
()
=>
{
await
this
.
preloadImg
(
this
.
coverUrl
);
window
.
status
=
'1'
;
await
new
Promise
(
resolve
=>
{
this
.
taskImageFinish
(
resolve
);
// 提供给wkwebivewtopdf使用,页面处理完成,node不用
});
setTimeout
(()
=>
{
window
.
status
=
'1'
;
// 提供给wkwebivewtopdf使用,页面处理完成,node不用
console
.
log
(
'done7'
);
},
1000
*
5
);
});
}
)
...
...
@@ -513,8 +620,4 @@ export default {
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.bi-block
{
//
margin-top
:
8px
;
}
</
style
>
<
style
lang=
"scss"
scoped
></
style
>
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