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 9df4e0d4
authored
Apr 22, 2022
by
web
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/数字问卷' of
http://git.jimijiayuan.cn/jml0128/xrk-bi
into develop
2 parents
209a1079
9c038f4b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
114 additions
and
9 deletions
src/packages/bi/src/chart-type/types.js
src/packages/bi/src/commonComponents/article.vue
src/packages/bi/src/commonComponents/chart-base.vue
src/packages/bi/src/commonComponents/chart-block.vue
src/packages/bi/src/commonComponents/chart.vue
src/packages/bi/src/components/singleChoice.vue
src/packages/bi/src/components/singleChoiceInfo.vue
src/packages/bi/src/main.vue
src/packages/bi/src/project/21-digitalQuestionnaire.vue
src/packages/bi/src/project/tools.js
src/packages/bi/src/chart-type/types.js
View file @
9df4e0d
...
...
@@ -119,5 +119,12 @@ export default {
sort
:
1
,
icon
:
''
,
create
:
createMapScatter
},
// 表格
15
:
{
name
:
'article'
,
cnName
:
'图文'
,
sort
:
1
,
icon
:
'http://cdn.yxvzb.com/WEB/SaaS/images/bi/svg/biaoge.svg'
}
};
src/packages/bi/src/commonComponents/article.vue
0 → 100644
View file @
9df4e0d
<!--
* @Description:
* @Date: 2022-04-20 15:31:47
-->
<!--
* @Description: file content
* @Author: jml
* @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-04-20 15:50:05
-->
<
template
>
<div>
<BiBlank
height=
"40"
:usePrint=
"true"
></BiBlank>
<div
v-html=
"content"
></div>
<BiBlank
height=
"40"
:usePrint=
"true"
></BiBlank>
</div>
</
template
>
<
script
>
import
BiBlank
from
'./blank.vue'
;
export
default
{
name
:
'bi-sex-icon'
,
components
:
{
BiBlank
},
props
:
{
title
:
{
type
:
String
,
default
:
''
},
content
:
{
type
:
String
,
default
:
''
}
},
data
()
{
return
{
option
:
{}
};
},
created
()
{}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.bi-sex-icon
{
text-align
:
center
;
padding-top
:
110px
;
height
:
350px
;
&_item
{
display
:
inline-block
;
margin
:
0
45px
;
p
{
margin-top
:
15px
;
}
}
}
</
style
>
src/packages/bi/src/commonComponents/chart-base.vue
View file @
9df4e0d
...
...
@@ -93,13 +93,14 @@ export default {
this
.
myChart
=
init
(
document
.
getElementById
(
this
.
uuid
));
}
const
{
option
,
myChart
}
=
this
;
const
maxLength
=
option
.
series
[
0
].
data
.
length
;
const
cloneArr
=
[...
option
.
series
[
0
].
data
];
const
f
=
(
option
.
series
||
[])[
0
]
||
{
data
:
[]
};
const
maxLength
=
f
.
data
.
length
;
const
cloneArr
=
[...
f
.
data
];
if
(
maxLength
>
200
)
{
const
setData
=
(
_myChart
,
startIndex
)
=>
{
const
endIndex
=
startIndex
+
200
;
if
(
startIndex
==
0
)
{
option
.
series
[
0
]
.
data
=
cloneArr
.
slice
(
startIndex
,
endIndex
);
f
.
data
=
cloneArr
.
slice
(
startIndex
,
endIndex
);
_myChart
.
setOption
(
option
);
}
else
{
_myChart
.
appendData
({
...
...
src/packages/bi/src/commonComponents/chart-block.vue
View file @
9df4e0d
...
...
@@ -3,7 +3,7 @@
* @Author: jml
* @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors
* @LastEditTime: 202
1-07-28 21:17
:43
* @LastEditTime: 202
2-04-20 15:36
:43
-->
<
template
>
<div
style=
"position:relative;"
class=
"bi-chart-block"
>
...
...
@@ -44,6 +44,7 @@
}"
>
</BiTable>
<BiSexIcon
v-else-if=
"chart.type == 12"
v-bind=
"chart"
></BiSexIcon>
<BiArticle
v-else-if=
"chart.type == 15"
v-bind=
"baseInfo"
></BiArticle>
<BiChart
:showGuide=
"showGuide"
v-else
v-bind=
"chart"
></BiChart>
</
template
>
<BiChartLegend
...
...
@@ -78,6 +79,7 @@ import BiTable from './table.vue';
import
BiSexIcon
from
'./sex-icon.vue'
;
import
BiChartLegend
from
'./chart-legend.vue'
;
import
BiChartDesc
from
'./chart-desc.vue'
;
import
BiArticle
from
'./article.vue'
;
import
BiChartChoiceMinxinToggleAxis
from
'./chart-choice-mixin-toggle-axis.vue'
;
import
BiChartChoiceMinxinAnalysis
from
'./chart-choice-mixin-analysis.vue'
;
...
...
@@ -89,6 +91,7 @@ export default {
BiChart
,
BiTable
,
BiSexIcon
,
BiArticle
,
BiChartDesc
,
BiChartLegend
,
BiChartChoiceMinxinToggleAxis
,
...
...
@@ -108,6 +111,9 @@ export default {
analysisDesc
()
{
return
this
.
chartConfig
.
analysisDesc
||
{};
},
baseInfo
()
{
return
this
.
chartConfig
.
baseInfo
||
{};
},
chart
()
{
return
this
.
chartConfig
.
chart
||
{};
},
...
...
src/packages/bi/src/commonComponents/chart.vue
View file @
9df4e0d
...
...
@@ -3,7 +3,7 @@
* @Author: jml
* @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors
* @LastEditTime: 202
1-07-28 21:34:18
* @LastEditTime: 202
2-04-20 13:35:29
-->
<
template
>
<div
:style=
"
{ height: `${(cHeight + 80) * zoom}px`, zoom: 1 / zoom }">
...
...
src/packages/bi/src/components/singleChoice.vue
View file @
9df4e0d
...
...
@@ -15,6 +15,7 @@
<div
ref=
"print-area"
>
<div
class=
"print-item"
:class=
"item.className"
v-for=
"(item, index) in scaleDomsInfo.items"
:key=
"index"
:style=
"
{
...
...
@@ -133,6 +134,7 @@ export default {
type
:
Array
,
default
:
()
=>
[]
},
printInfo
:
Boolean
,
pageWrap
:
Boolean
,
disabled
:
Boolean
},
...
...
@@ -247,10 +249,17 @@ export default {
return
Math
.
min
(
baseHeight
/
height
,
1
);
};
const
newDom
=
(
this
.
$refs
[
'bi-single-choice_item'
]
||
[]).
reduce
(
(
pre
,
cur
)
=>
{
(
pre
,
cur
,
index
)
=>
{
const
{
$el
}
=
cur
;
const
{
offsetHeight
}
=
$el
;
const
domUsePage
=
parseInt
(
offsetHeight
/
(
baseHeight
*
baseScale
));
if
(
this
.
printInfo
)
{
console
.
log
(
topDom
,
cur
);
}
let
className
=
'print-item'
;
if
(
index
==
0
&&
cur
.
chart
.
type
==
15
)
{
className
=
'print-item nowarp'
;
}
if
(
pre
.
height
+
offsetHeight
<
baseHeight
*
baseScale
)
{
// 当前dom高度加上历史高度 小于 A4纸高度的1.15倍
if
(
pre
.
height
===
0
)
{
...
...
@@ -271,6 +280,7 @@ export default {
pre
.
totalPage
+=
Math
.
max
(
domUsePage
,
1
);
pre
.
height
=
offsetHeight
;
pre
.
items
.
push
({
className
,
allHeight
:
offsetHeight
,
scale
:
domUsePage
===
0
?
cScale
(
offsetHeight
)
:
1
,
chartConfigs
:
[
cur
.
chartConfig
]
...
...
@@ -299,6 +309,9 @@ export default {
catalogueInfoArr
:
[]
}
);
if
(
this
.
printInfo
)
{
console
.
log
(
newDom
);
}
this
.
scaleDomsInfo
=
newDom
;
this
.
$emit
(
'page'
,
{
pageSize
:
newDom
.
totalPage
,
...
...
@@ -329,6 +342,18 @@ export default {
}
};
</
script
>
<
style
lang=
"scss"
>
.print-item
{
&.nowarp
{
.bi-chart-block
{
background
:
#fff
;
&
>
div
{
page-break-inside
:
inherit
;
}
}
}
}
</
style
>
<
style
lang=
"scss"
scoped
>
.print-item
{
...
...
@@ -339,6 +364,9 @@ export default {
//
page-break-before
:
auto
;
//
page-break-inside
:
avoid
;
//
}
&
.nowarp
{
page-break-before
:
inherit
;
}
}
.bi-single-choice
{
//
page-break-before
:
always
;
...
...
src/packages/bi/src/components/singleChoiceInfo.vue
View file @
9df4e0d
...
...
@@ -73,6 +73,8 @@ export default {
&.one
{
padding-left
:
60px
;
padding-top
:
23px
;
text-align
:
center
;
padding-left
:
130px
;
&
>
div
{
width
:
inherit
;
&
+
div
{
...
...
src/packages/bi/src/main.vue
View file @
9df4e0d
...
...
@@ -3,7 +3,7 @@
* @Author: jml
* @Date: 2021-02-26 15:38:10
* @LastEditors: Please set LastEditors
* @LastEditTime: 202
1-09-08 15:00:42
* @LastEditTime: 202
2-04-20 13:26:04
-->
<
template
>
<div
class=
"xrk-components-bi bi"
:class=
"
{ 'bi-print': print }">
...
...
@@ -18,6 +18,9 @@
<BiZoneMobile
v-if=
"mobile"
></BiZoneMobile>
<BiZone
v-else
></BiZone>
</
template
>
<
template
v-if=
"projectType == 21"
>
<BiDigitalQuestionnaire></BiDigitalQuestionnaire>
</
template
>
<
template
v-if=
"projectType == 2"
name=
"otc拜访"
>
<BiOtc></BiOtc>
</
template
>
...
...
@@ -39,6 +42,7 @@ import BiZoneMobile from './project/6-zone-mobile.vue';
import
BiOtc
from
'./project/2-otc.vue'
;
import
BiJcyl
from
'./project/10-jcyl.vue'
;
import
BiGradeHospital
from
'./project/9-gradeHospital.vue'
;
import
BiDigitalQuestionnaire
from
'./project/21-digitalQuestionnaire.vue'
;
export
default
{
name
:
'XrkBi'
,
...
...
@@ -91,7 +95,8 @@ export default {
BiZoneMobile
,
BiOtc
,
BiJcyl
,
BiGradeHospital
BiGradeHospital
,
BiDigitalQuestionnaire
},
methods
:
{
setFontSize
()
{
...
...
src/packages/bi/src/project/21-digitalQuestionnaire.vue
0 → 100644
View file @
9df4e0d
This diff is collapsed.
Click to expand it.
src/packages/bi/src/project/tools.js
View file @
9df4e0d
...
...
@@ -16,7 +16,7 @@ const dealStr = (str, unit = '') => {
export
const
dealAxis
=
(
arr
=
[],
unit
=
''
,
lastUnit
=
''
)
=>
{
return
arr
.
map
((
item
,
index
)
=>
{
const
isLast
=
index
===
arr
.
length
-
1
;
const
xName
=
item
.
genderType
||
item
.
xTopicName
;
const
xName
=
item
.
genderType
||
item
.
xTopicName
||
item
.
optionName
;
return
{
x
:
xName
?
dealStr
(
xName
,
isLast
?
lastUnit
:
unit
)
:
'-'
,
y
:
item
.
yTopicName
,
...
...
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