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 1df2d0f2
authored
Jul 01, 2021
by
jml0128
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat
1 parent
0d805885
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
380 additions
and
153 deletions
src/packages/bi/src/commonComponents/chart-block.vue
src/packages/bi/src/components/cover.vue
src/packages/bi/src/components/operate.vue
src/packages/bi/src/main.vue
src/packages/bi/src/mock/index.js
src/packages/bi/src/project/20-configurable.vue
src/packages/bi/src/project/6-zone.vue
src/packages/bi/src/commonComponents/chart-block.vue
View file @
1df2d0f
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: jml
* @Author: jml
* @Date: 2021-03-24 10:22:27
* @Date: 2021-03-24 10:22:27
* @LastEditors: Please set LastEditors
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-0
6-30 22:36:55
* @LastEditTime: 2021-0
7-01 13:28:14
-->
-->
<
template
>
<
template
>
<div
style=
"position:relative;"
class=
"bi-chart-block"
>
<div
style=
"position:relative;"
class=
"bi-chart-block"
>
...
@@ -135,6 +135,7 @@ export default {
...
@@ -135,6 +135,7 @@ export default {
},
},
changeText
(
text
)
{
changeText
(
text
)
{
// 修改附加文字的内容
// 修改附加文字的内容
this
.
chartConfig
[
'desc'
][
'customText'
]
=
text
;
console
.
log
(
`
${
this
.
title
.
name
}
-用户自定义描述`
,
text
);
console
.
log
(
`
${
this
.
title
.
name
}
-用户自定义描述`
,
text
);
},
},
toggleAxis
()
{
toggleAxis
()
{
...
...
src/packages/bi/src/components/cover.vue
View file @
1df2d0f
...
@@ -6,14 +6,17 @@
...
@@ -6,14 +6,17 @@
<div
class=
"bi-cover"
>
<div
class=
"bi-cover"
>
<div
<div
class=
"bi-cover_bg"
class=
"bi-cover_bg"
:style=
"
{ backgroundColor: coverList[coverIndex].background }"
:style=
"
{
backgroundImage: `url(${chooseBackground.templatePicUrl})`,
backgroundSize: '100% 100%'
}"
>
>
<el-popover
<el-popover
:popper-class=
"isMobile ? 'mobile-popover' : ''"
:popper-class=
"isMobile ? 'mobile-popover' : ''"
placement=
"bottom"
placement=
"bottom"
trigger=
"click"
trigger=
"click"
v-model=
"visibleCoverList"
v-model=
"visibleCoverList"
v-if=
"!isPrint"
v-if=
"
coverList.length > 0 &&
!isPrint"
>
>
<div
class=
"bi-cover_popover"
>
请选择封面
</div>
<div
class=
"bi-cover_popover"
>
请选择封面
</div>
<swiper
class=
"bi-cover_swiper"
:options=
"swiperOptions"
>
<swiper
class=
"bi-cover_swiper"
:options=
"swiperOptions"
>
...
@@ -28,9 +31,12 @@
...
@@ -28,9 +31,12 @@
<div
<div
@
click=
"localIndex = index"
@
click=
"localIndex = index"
class=
"bi-cover_item_img"
class=
"bi-cover_item_img"
:style=
"
{ background: item.background }"
:style=
"
{
backgroundImage: `url(${item.templatePicUrl})`,
backgroundSize: '100% 100%'
}"
>
</div>
>
</div>
<div
class=
"bi-cover_name"
>
{{
item
.
n
ame
}}
</div>
<div
class=
"bi-cover_name"
>
{{
item
.
templateN
ame
}}
</div>
</swiper-slide>
</swiper-slide>
</swiper>
</swiper>
<el-button
<el-button
...
@@ -101,6 +107,14 @@ export default {
...
@@ -101,6 +107,14 @@ export default {
coverContent
:
{
coverContent
:
{
default
:
()
=>
[],
default
:
()
=>
[],
type
:
Array
type
:
Array
},
coverList
:
{
default
:
()
=>
[],
type
:
Array
},
coverId
:
{
default
:
0
,
type
:
[
Number
,
String
]
}
}
},
},
data
()
{
data
()
{
...
@@ -112,33 +126,24 @@ export default {
...
@@ -112,33 +126,24 @@ export default {
content
:
[],
content
:
[],
coverIndex
:
0
,
coverIndex
:
0
,
localIndex
:
0
,
localIndex
:
0
,
coverList
:
[
{
background
:
'#6C71FF'
,
name
:
'模板一'
},
{
background
:
'#1989FA'
,
name
:
'模板二'
},
{
background
:
'#3BCF9F'
,
name
:
'模板三'
},
{
background
:
'#FF846E'
,
name
:
'模板四'
}
],
drag
:
false
drag
:
false
};
};
},
},
computed
:
{
chooseBackground
()
{
const
a
=
this
.
coverList
.
find
(
item
=>
item
.
id
==
this
.
coverId
)
||
this
.
coverList
[
0
]
||
{};
return
a
;
}
},
methods
:
{
methods
:
{
dealPos
(
dis
)
{
dealPos
(
dis
)
{
return
dis
*
(
this
.
isPrint
?
printWidth
:
this
.
baseFontSize
);
return
dis
*
(
this
.
isPrint
?
printWidth
:
this
.
baseFontSize
);
},
},
changeCover
()
{
changeCover
()
{
this
.
coverIndex
=
this
.
localIndex
;
this
.
$emit
(
'change'
,
this
.
coverList
[
this
.
localIndex
].
id
)
;
this
.
visibleCoverList
=
false
;
this
.
visibleCoverList
=
false
;
},
},
handleMouseDown
(
e
,
pos
)
{
handleMouseDown
(
e
,
pos
)
{
...
@@ -257,7 +262,11 @@ export default {
...
@@ -257,7 +262,11 @@ export default {
this
.
content
=
baseContent
.
map
((
item
,
index
)
=>
{
this
.
content
=
baseContent
.
map
((
item
,
index
)
=>
{
const
{
name
,
pos
}
=
arr
[
index
];
const
{
name
,
pos
}
=
arr
[
index
];
name
&&
(
item
.
name
=
name
);
name
&&
(
item
.
name
=
name
);
pos
&&
(
item
.
pos
=
pos
);
try
{
pos
&&
(
item
.
pos
=
JSON
.
parse
(
pos
));
}
catch
(
error
)
{
console
.
warn
(
error
);
}
return
item
;
return
item
;
});
});
}
}
...
@@ -268,6 +277,7 @@ export default {
...
@@ -268,6 +277,7 @@ export default {
if
(
Array
.
isArray
(
newV
)
&&
newV
.
length
>
0
)
{
if
(
Array
.
isArray
(
newV
)
&&
newV
.
length
>
0
)
{
this
.
dealCoverContent
(
newV
);
this
.
dealCoverContent
(
newV
);
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
Array
.
isArray
(
this
.
$refs
[
'input'
])
&&
this
.
$refs
[
'input'
].
forEach
(
item
=>
{
this
.
$refs
[
'input'
].
forEach
(
item
=>
{
item
.
addEventListener
(
'paste'
,
function
(
e
)
{
item
.
addEventListener
(
'paste'
,
function
(
e
)
{
e
.
stopPropagation
();
e
.
stopPropagation
();
...
...
src/packages/bi/src/components/operate.vue
View file @
1df2d0f
...
@@ -13,11 +13,11 @@
...
@@ -13,11 +13,11 @@
<img
src=
"../lib/svg/chexiao.svg"
/>
<img
src=
"../lib/svg/chexiao.svg"
/>
撤销删除
撤销删除
</div>
</div>
<div
class=
""
>
<div
class=
""
@
click=
"save"
>
<img
src=
"../lib/svg/baocun.svg"
/>
<img
src=
"../lib/svg/baocun.svg"
/>
保存
保存
</div>
</div>
<div
class=
""
>
<div
class=
""
@
click=
"exportFn"
>
<img
src=
"../lib/svg/daochu-tianchong.svg"
/>
<img
src=
"../lib/svg/daochu-tianchong.svg"
/>
导出
导出
</div>
</div>
...
@@ -56,8 +56,9 @@
...
@@ -56,8 +56,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
check
}
from
'xrk-tools'
;
import
mixin
from
'../mixin/index'
;
import
mixin
from
'../mixin/index'
;
import
{
Dialog
,
Button
,
Checkbox
,
CheckboxGroup
}
from
'element-ui'
;
import
{
Dialog
,
Button
,
Checkbox
,
CheckboxGroup
,
Message
}
from
'element-ui'
;
export
default
{
export
default
{
name
:
'bi-operate'
,
name
:
'bi-operate'
,
mixins
:
[
mixin
],
mixins
:
[
mixin
],
...
@@ -71,6 +72,14 @@ export default {
...
@@ -71,6 +72,14 @@ export default {
questionData
:
{
questionData
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[]
default
:
()
=>
[]
},
saveInfo
:
{
type
:
Function
,
default
:
()
=>
{}
},
exportBi
:
{
type
:
Function
,
default
:
()
=>
{}
}
}
},
},
data
()
{
data
()
{
...
@@ -86,6 +95,26 @@ export default {
...
@@ -86,6 +95,26 @@ export default {
item
.
isDelete
=
0
;
item
.
isDelete
=
0
;
});
});
this
.
resetDeleteArr
=
[];
this
.
resetDeleteArr
=
[];
},
save
()
{
if
(
check
.
isFunction
(
this
.
saveInfo
))
{
const
loading
=
Message
({
message
:
'保存中...请稍等'
,
duration
:
0
});
this
.
saveInfo
().
then
(()
=>
{
loading
.
close
();
Message
({
message
:
'保存成功'
,
type
:
'success'
});
});
}
},
exportFn
()
{
if
(
check
.
isFunction
(
this
.
exportBi
))
{
this
.
exportBi
();
}
}
}
}
}
};
};
...
...
src/packages/bi/src/main.vue
View file @
1df2d0f
...
@@ -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-0
6-30 16:53:40
* @LastEditTime: 2021-0
7-01 14:30:15
-->
-->
<
template
>
<
template
>
<div
class=
"xrk-components-bi bi"
:class=
"
{ 'bi-print': print }">
<div
class=
"xrk-components-bi bi"
:class=
"
{ 'bi-print': print }">
...
@@ -52,6 +52,18 @@ export default {
...
@@ -52,6 +52,18 @@ export default {
getGroupInfo
:
{
getGroupInfo
:
{
type
:
Function
,
type
:
Function
,
default
:
()
=>
{}
default
:
()
=>
{}
},
saveInfo
:
{
type
:
Function
,
default
:
()
=>
{}
},
exportBi
:
{
type
:
Function
,
default
:
()
=>
{}
},
getTemplateList
:
{
type
:
Function
,
default
:
()
=>
{}
}
}
},
},
components
:
{
components
:
{
...
...
src/packages/bi/src/mock/index.js
View file @
1df2d0f
...
@@ -191,7 +191,8 @@ export const chartConfig = () => {
...
@@ -191,7 +191,8 @@ export const chartConfig = () => {
text
:
znResultSystem
,
text
:
znResultSystem
,
customText
:
znResultUser
,
customText
:
znResultUser
,
resText
:
'总结可知:不同年龄患者的发病状态无显著性差异。'
resText
:
'总结可知:不同年龄患者的发病状态无显著性差异。'
}
},
baseInfo
:
{
...
options
}
};
};
},
},
create
:
(
xLength
,
yLength
,
type
=
1
,
options
=
{})
=>
{
create
:
(
xLength
,
yLength
,
type
=
1
,
options
=
{})
=>
{
...
...
src/packages/bi/src/project/20-configurable.vue
View file @
1df2d0f
...
@@ -4,7 +4,13 @@
...
@@ -4,7 +4,13 @@
-->
-->
<
template
>
<
template
>
<div
class=
"bi-configurable"
>
<div
class=
"bi-configurable"
>
<BiCover
:coverContent=
"coverContent"
></BiCover>
<BiCover
:coverContent=
"coverContent"
ref=
"cover"
:coverList=
"coverList"
:coverId=
"coverId"
@
change=
"id => (coverId = id)"
></BiCover>
<BiCatalogue
class=
"bi-block"
:catalogueArr=
"catalogueArr"
></BiCatalogue>
<BiCatalogue
class=
"bi-block"
:catalogueArr=
"catalogueArr"
></BiCatalogue>
<BiOverview
<BiOverview
class=
"bi-block"
class=
"bi-block"
...
@@ -42,6 +48,8 @@
...
@@ -42,6 +48,8 @@
<BiCoverEnd
title=
"奇正藏药医学沙龙推广项目数据报告"
></BiCoverEnd>
<BiCoverEnd
title=
"奇正藏药医学沙龙推广项目数据报告"
></BiCoverEnd>
<BiOperate
<BiOperate
:questionData=
"[...singleChoice, ...singleChoiceMixin]"
:questionData=
"[...singleChoice, ...singleChoiceMixin]"
:saveInfo=
"saveInfo"
:exportBi=
"exportBi"
></BiOperate>
></BiOperate>
</div>
</div>
</
template
>
</
template
>
...
@@ -66,14 +74,14 @@ import { chartConfig } from '../mock/index';
...
@@ -66,14 +74,14 @@ import { chartConfig } from '../mock/index';
import
{
date
,
base
}
from
'xrk-tools'
;
import
{
date
,
base
}
from
'xrk-tools'
;
const
ChartConfigFn
=
chartConfig
();
const
ChartConfigFn
=
chartConfig
();
const
dealAxis
=
arr
=>
{
const
dealAxis
=
(
arr
=
[])
=>
{
return
arr
.
map
(
item
=>
({
return
arr
.
map
(
item
=>
({
x
:
item
.
genderType
||
item
.
xTopicName
||
'-'
,
x
:
item
.
genderType
||
item
.
xTopicName
||
'-'
,
y
:
item
.
yTopicName
,
y
:
item
.
yTopicName
,
value
:
item
.
num
||
item
.
countNum
||
0
value
:
item
.
num
||
item
.
countNum
||
0
}));
}));
};
};
const
dealLegends
=
arr
=>
{
const
dealLegends
=
(
arr
=
[])
=>
{
const
total
=
arr
.
reduce
((
pre
,
cur
)
=>
{
const
total
=
arr
.
reduce
((
pre
,
cur
)
=>
{
return
pre
+
(
cur
.
num
||
cur
.
countNum
||
0
);
return
pre
+
(
cur
.
num
||
cur
.
countNum
||
0
);
},
0
);
},
0
);
...
@@ -89,10 +97,35 @@ const dealLegends = arr => {
...
@@ -89,10 +97,35 @@ const dealLegends = arr => {
return
pre
;
return
pre
;
},
[]);
},
[]);
};
};
const
randomType
=
arr
=>
{
const
randomType
=
(
arr
=
[])
=>
{
return
arr
[
Math
.
ceil
(
Math
.
random
()
*
arr
.
length
)]
||
arr
[
0
];
return
arr
[
Math
.
ceil
(
Math
.
random
()
*
arr
.
length
)]
||
arr
[
0
];
};
};
const
chartConfigToSetInfo
=
chartConfigs
=>
{
return
chartConfigs
.
map
((
item
,
index
)
=>
{
const
{
baseInfo
,
desc
,
analysisDesc
,
analysis
,
isDelete
,
chart
}
=
item
;
const
{
id
,
type
}
=
baseInfo
;
const
{
customText
=
''
,
setShow
}
=
desc
;
return
{
groupDetailId
:
id
,
topicDetailId
:
id
,
fixedId
:
id
,
type
:
type
,
chartType
:
+
chart
.
type
,
colourGroup
:
Array
.
isArray
(
chart
.
colors
)
?
chart
.
colors
.
join
(
','
)
:
chart
.
colors
,
showSort
:
+
index
+
1
,
isDelete
:
isDelete
,
resultUser
:
customText
,
znResultUser
:
analysisDesc
.
customText
,
resultIsShow
:
setShow
?
1
:
0
,
znResultIsShow
:
analysisDesc
.
setShow
?
1
:
0
,
znTableIsShow
:
analysis
.
setShow
?
1
:
0
};
});
};
export
default
{
export
default
{
name
:
'bi-configurable'
,
name
:
'bi-configurable'
,
mixins
:
[
mixin
,
project
],
mixins
:
[
mixin
,
project
],
...
@@ -114,23 +147,13 @@ export default {
...
@@ -114,23 +147,13 @@ export default {
singleChoice
:
[],
singleChoice
:
[],
singleChoiceMixin
:
[],
singleChoiceMixin
:
[],
missionData
:
[],
missionData
:
[],
coverId
:
0
,
coverContent
:
[],
coverContent
:
[],
questionInfo
:
[
coverList
:
[],
{
name
:
'总参与题目'
,
value
:
'20'
,
unit
:
'条'
},
{
name
:
'总参与数'
,
desc
:
'(人或者机构)'
,
value
:
'2000'
,
unit
:
'人'
}
],
projectName
:
''
,
projectName
:
''
,
baseInfo
:
[],
baseInfo
:
[],
textData
:
[]
textData
:
[],
biInfo
:
{}
};
};
},
},
computed
:
{
computed
:
{
...
@@ -199,9 +222,12 @@ export default {
...
@@ -199,9 +222,12 @@ export default {
dealPos
(
dis
)
{
dealPos
(
dis
)
{
return
dis
*
(
this
.
isPrint
?
printWidth
:
this
.
baseFontSize
);
return
dis
*
(
this
.
isPrint
?
printWidth
:
this
.
baseFontSize
);
},
},
setData
()
{},
dealBaseInfo
(
info
)
{
dealBaseInfo
(
info
)
{
const
{
const
{
id
,
coverTemplateId
,
// 模板ID
styleConfigureId
,
// 配置ID
title
,
title
,
titlePosition
,
titlePosition
,
aspEnterpriseNameWrite
,
aspEnterpriseNameWrite
,
...
@@ -210,7 +236,8 @@ export default {
...
@@ -210,7 +236,8 @@ export default {
styleConfigureSettlementTimePosition
,
styleConfigureSettlementTimePosition
,
projectName
=
'-'
,
projectName
=
'-'
,
aspEnterpriseName
,
sendEnterpriseName
=
'-'
,
aspEnterpriseName
=
'-'
,
settlementTime
,
settlementTime
,
taskSum
,
taskSum
,
executePeopleNumber
,
executePeopleNumber
,
...
@@ -223,7 +250,13 @@ export default {
...
@@ -223,7 +250,13 @@ export default {
isContrainGroupAnalyse
,
isContrainGroupAnalyse
,
isContrainSingleAnalyse
isContrainSingleAnalyse
}
=
info
;
}
=
info
;
this
.
projectName
=
`
${
projectName
}
统计报表`
;
this
.
biInfo
=
{
biInfoId
:
id
,
styleConfigureId
};
this
.
coverId
=
coverTemplateId
;
const
biCreateDt
=
date
.
dateFormat
(
createDt
,
'Y-M-D'
);
this
.
projectName
=
`
${
projectName
}${
biCreateDt
}
服务报告`
;
this
.
coverContent
=
[
this
.
coverContent
=
[
{
{
name
:
title
,
name
:
title
,
...
@@ -245,36 +278,40 @@ export default {
...
@@ -245,36 +278,40 @@ export default {
value
:
projectName
value
:
projectName
},
},
{
{
name
:
'
服务商
'
,
name
:
'
发起方
'
,
value
:
asp
EnterpriseName
value
:
send
EnterpriseName
},
},
{
{
name
:
'
提交时间
'
,
name
:
'
服务商
'
,
value
:
settlementTi
me
value
:
aspEnterpriseNa
me
}
}
],
],
[
[
{
{
name
:
'任务量'
,
name
:
'提交时间'
,
value
:
settlementTime
},
{
name
:
'任务数量'
,
value
:
taskSum
value
:
taskSum
},
},
{
{
name
:
'项目执行人数'
,
name
:
'项目执行人数'
,
value
:
`
${
executePeopleNumber
}
人`
value
:
`
${
executePeopleNumber
}
人`
},
{
name
:
'数据收集'
,
value
:
`
${
dataCollectNumber
}
条`
}
}
],
],
[
[
{
{
name
:
'参与调研人数'
,
name
:
'数据收集数'
,
value
:
`
${
dataCollectNumber
}
条`
},
{
name
:
'参与调研样本'
,
value
:
`
${
examinePeopleNumber
}
人`
value
:
`
${
examinePeopleNumber
}
人`
},
},
{
{
name
:
'报表生成时间'
,
name
:
'报表生成时间'
,
value
:
date
.
dateFormat
(
createDt
,
'Y-M-D'
)
value
:
biCreateDt
}
}
]
]
];
];
...
@@ -308,11 +345,12 @@ export default {
...
@@ -308,11 +345,12 @@ export default {
];
];
},
},
dealFixedInfo
(
infoArr
)
{
dealFixedInfo
(
infoArr
)
{
const
[
group1
=
{},
group2
=
{},
group3
=
{}]
=
infoArr
;
this
.
missionData
=
[
this
.
missionData
=
[
ChartConfigFn
.
createConfig
(
dealAxis
(
infoArr
[
0
]
.
fixedCountInfos
),
{
ChartConfigFn
.
createConfig
(
dealAxis
(
group1
.
fixedCountInfos
),
{
...
infoArr
[
0
]
,
...
group1
,
chartType
:
infoArr
[
0
]
.
chartType
||
12
,
chartType
:
group1
.
chartType
||
12
,
legends
:
dealLegends
(
infoArr
[
0
]
.
fixedCountInfos
),
legends
:
dealLegends
(
group1
.
fixedCountInfos
),
blockTitle
:
'参与任务执行的性别分布'
,
blockTitle
:
'参与任务执行的性别分布'
,
legendName
:
'总参与项目执行人数${num}人'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDesc
:
true
,
hideDesc
:
true
,
...
@@ -322,10 +360,10 @@ export default {
...
@@ -322,10 +360,10 @@ export default {
disableTypes
:
[
3
,
4
],
disableTypes
:
[
3
,
4
],
extendTypes
:
[
12
]
extendTypes
:
[
12
]
}),
}),
ChartConfigFn
.
createConfig
(
dealAxis
(
infoArr
[
1
]
.
fixedCountInfos
),
{
ChartConfigFn
.
createConfig
(
dealAxis
(
group2
.
fixedCountInfos
),
{
...
infoArr
[
1
]
,
...
group2
,
chartType
:
infoArr
[
1
]
.
chartType
||
1
,
chartType
:
group2
.
chartType
||
1
,
legends
:
dealLegends
(
infoArr
[
1
]
.
fixedCountInfos
),
legends
:
dealLegends
(
group2
.
fixedCountInfos
),
blockTitle
:
'执行任务的年龄段'
,
blockTitle
:
'执行任务的年龄段'
,
legendName
:
'总参与项目执行人数${num}人'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDesc
:
true
,
hideDesc
:
true
,
...
@@ -340,10 +378,10 @@ export default {
...
@@ -340,10 +378,10 @@ export default {
hideChart
:
true
,
hideChart
:
true
,
hideTitle
:
true
hideTitle
:
true
}),
}),
ChartConfigFn
.
createConfig
(
dealAxis
(
infoArr
[
2
]
.
fixedCountInfos
),
{
ChartConfigFn
.
createConfig
(
dealAxis
(
group3
.
fixedCountInfos
),
{
...
infoArr
[
2
]
,
...
group3
,
chartType
:
infoArr
[
1
]
.
chartType
||
2
,
chartType
:
group3
.
chartType
||
2
,
legends
:
dealLegends
(
infoArr
[
2
]
.
fixedCountInfos
),
legends
:
dealLegends
(
group3
.
fixedCountInfos
),
blockTitle
:
'项目参与人完成任务区间分布'
,
blockTitle
:
'项目参与人完成任务区间分布'
,
legendName
:
'总参与项目执行人数${num}人'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDelete
:
true
,
hideDelete
:
true
,
...
@@ -353,41 +391,86 @@ export default {
...
@@ -353,41 +391,86 @@ export default {
];
];
},
},
dealChoice
(
arr
)
{
dealChoice
(
arr
)
{
this
.
singleChoice
=
arr
.
map
(
item
=>
{
this
.
singleChoice
=
arr
.
map
(
item
=>
{
return
ChartConfigFn
.
createConfig
(
dealAxis
(
item
.
topicCountInfos
),
{
return
ChartConfigFn
.
createConfig
(
dealAxis
(
item
.
topicCountInfos
),
{
...
item
,
...
item
,
blockTitle
:
item
.
topicTitle
,
blockTitle
:
item
.
topicTitle
,
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
5
,
6
,
9
,
10
,
11
]),
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
5
,
6
,
9
,
10
,
11
]),
disableTypes
:
[
3
,
4
]
disableTypes
:
[
3
,
4
]
});
});
})
.
sort
((
a
,
b
)
=>
{
if
(
a
.
sort
<
b
.
sort
)
{
return
-
1
;
}
});
});
},
},
dealChoiceMixin
(
arr
)
{
dealChoiceMixin
(
arr
)
{
this
.
singleChoiceMixin
=
arr
.
map
(
item
=>
{
this
.
singleChoiceMixin
=
arr
.
map
(
item
=>
{
return
ChartConfigFn
.
createConfig
(
dealAxis
(
item
.
topicCountInfos
),
{
return
ChartConfigFn
.
createConfig
(
dealAxis
(
item
.
topicCountInfos
),
{
...
item
,
...
item
,
xAxisName
:
item
.
title
,
xAxisName
:
item
.
title
,
yAxisName
:
item
.
secondTitle
,
yAxisName
:
item
.
secondTitle
,
isGroup
:
true
,
isGroup
:
true
,
blockTitle
:
`
${
item
.
title
}
与
${
item
.
secondTitle
}
`
,
blockTitle
:
`
${
item
.
title
}
与
${
item
.
secondTitle
}
`
,
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
3
,
4
,
5
,
6
,
9
,
10
,
11
])
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
3
,
4
,
5
,
6
,
9
,
10
,
11
])
});
});
})
.
sort
((
a
,
b
)
=>
{
if
(
a
.
sort
<
b
.
sort
)
{
return
-
1
;
}
});
},
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
)
});
},
exportBi
()
{
this
.
Bi
.
exportBi
({
commandType
:
1
,
type
:
1
});
});
}
}
},
},
created
()
{
created
()
{
this
.
setData
();
Promise
.
all
([
Promise
.
all
([
this
.
Bi
.
getBaseInfo
(),
this
.
Bi
.
getBaseInfo
(),
this
.
Bi
.
getFixedInfo
(),
this
.
Bi
.
getFixedInfo
(),
this
.
Bi
.
getTopicInfo
(),
this
.
Bi
.
getTopicInfo
(),
this
.
Bi
.
getGroupInfo
()
this
.
Bi
.
getGroupInfo
(),
]).
then
(([
baseInfo
,
fixedInfo
,
topicInfo
,
topicMixinInfo
])
=>
{
this
.
Bi
.
getTemplateList
()
]).
then
(
([
baseInfo
,
fixedInfo
,
topicInfo
,
topicMixinInfo
,
tempaletList
])
=>
{
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
||
[];
}
);
window
.
status
=
'completed'
;
window
.
status
=
'completed'
;
}
}
...
...
src/packages/bi/src/project/6-zone.vue
View file @
1df2d0f
...
@@ -4,12 +4,18 @@
...
@@ -4,12 +4,18 @@
-->
-->
<
template
>
<
template
>
<div
class=
"bi-zone"
>
<div
class=
"bi-zone"
>
<BiCover></BiCover>
<BiCover
:coverContent=
"coverContent"
ref=
"cover"
:coverList=
"coverList"
:coverId=
"coverId"
@
change=
"id => (coverId = id)"
></BiCover>
<BiCatalogue
class=
"bi-block"
:catalogueArr=
"catalogueArr"
></BiCatalogue>
<BiCatalogue
class=
"bi-block"
:catalogueArr=
"catalogueArr"
></BiCatalogue>
<BiOverview
<BiOverview
class=
"bi-block"
class=
"bi-block"
name=
"数据报告信息"
name=
"数据报告信息"
title=
"奇正藏药医学沙龙推广项目数据报告2021-04-28期
"
:title=
"projectName
"
:data=
"baseInfo"
:data=
"baseInfo"
></BiOverview>
></BiOverview>
<BiMission
<BiMission
...
@@ -49,6 +55,8 @@
...
@@ -49,6 +55,8 @@
<BiCoverEnd
title=
"奇正藏药医学沙龙推广项目数据报告"
></BiCoverEnd>
<BiCoverEnd
title=
"奇正藏药医学沙龙推广项目数据报告"
></BiCoverEnd>
<BiOperate
<BiOperate
:questionData=
"[...singleChoice, ...singleChoiceMixin]"
:questionData=
"[...singleChoice, ...singleChoiceMixin]"
:saveInfo=
"saveInfo"
:exportBi=
"exportBi"
></BiOperate>
></BiOperate>
</div>
</div>
</
template
>
</
template
>
...
@@ -72,6 +80,8 @@ import project from '../mixin/project';
...
@@ -72,6 +80,8 @@ import project from '../mixin/project';
import
{
chartConfig
}
from
'../mock/index'
;
import
{
chartConfig
}
from
'../mock/index'
;
const
ChartConfigFn
=
chartConfig
();
const
ChartConfigFn
=
chartConfig
();
import
{
date
,
base
}
from
'xrk-tools'
;
export
default
{
export
default
{
name
:
'bi-zone'
,
name
:
'bi-zone'
,
mixins
:
[
mixin
,
project
],
mixins
:
[
mixin
,
project
],
...
@@ -91,79 +101,15 @@ export default {
...
@@ -91,79 +101,15 @@ export default {
page2
:
0
,
page2
:
0
,
page2Info
:
[],
page2Info
:
[],
page3Info
:
[],
page3Info
:
[],
coverId
:
0
,
coverContent
:
[],
coverList
:
[],
singleChoice
:
[],
singleChoice
:
[],
singleChoiceMixin
:
[],
singleChoiceMixin
:
[],
missionData
:
[],
missionData
:
[],
questionInfo
:
[
projectName
:
''
,
{
baseInfo
:
[],
name
:
'专区内容:'
,
textData
:
[]
value
:
'20'
},
{
name
:
'本期有效点击量:'
,
value
:
'2000'
},
{
name
:
'总执行数(人或者机构):'
,
value
:
'2000'
}
],
baseInfo
:
[
[
{
name
:
'发起方'
,
value
:
'在山西地区的零售药店巡店项目'
},
{
name
:
'服务商'
,
value
:
'北京医洋科技有限公司'
},
{
name
:
'任务时间'
,
value
:
'24天'
}
],
[
{
name
:
'任务开始时间'
,
value
:
'2021-04-02'
},
{
name
:
'任务结算时间'
,
value
:
'2021-04-02'
},
{
name
:
'报表生成时间'
,
value
:
'2020-10-2'
}
],
[
{
name
:
'本期个人数据数'
,
value
:
'213123'
},
{
name
:
'累计个人数据总数'
,
value
:
'2020-10-2'
}
]
],
textData
:
[
[
{
name
:
'专区内容:'
,
value
:
'20题'
},
{
name
:
'总执行数(人或者机构):'
,
value
:
'11111'
},
{
name
:
'本期有效点击量:'
,
value
:
'20000人次'
}
]
]
};
};
},
},
computed
:
{
computed
:
{
...
@@ -308,10 +254,155 @@ export default {
...
@@ -308,10 +254,155 @@ export default {
}),
}),
ChartConfigFn
.
create
(
4
,
0
,
1
,
{
hideDelete
:
true
,
height
:
400
})
ChartConfigFn
.
create
(
4
,
0
,
1
,
{
hideDelete
:
true
,
height
:
400
})
];
];
},
dealBaseInfo
(
info
)
{
const
{
id
,
coverTemplateId
,
// 模板ID
styleConfigureId
,
// 配置ID
title
,
titlePosition
,
aspEnterpriseNameWrite
,
aspNamePosition
,
styleConfigureSettlementTime
,
styleConfigureSettlementTimePosition
,
projectName
=
'-'
,
sendEnterpriseName
=
'-'
,
aspEnterpriseName
=
'-'
,
settlementTime
,
taskSum
,
executePeopleNumber
,
dataCollectNumber
,
examinePeopleNumber
,
createDt
,
totalTopicNum
,
chooseTopicNum
,
isContrainGroupAnalyse
,
isContrainSingleAnalyse
}
=
info
;
this
.
biInfo
=
{
biInfoId
:
id
,
styleConfigureId
};
this
.
coverId
=
coverTemplateId
;
const
biCreateDt
=
date
.
dateFormat
(
createDt
,
'Y-M-D'
);
this
.
projectName
=
`
${
projectName
}${
biCreateDt
}
服务报告`
;
this
.
coverContent
=
[
{
name
:
title
,
pos
:
titlePosition
},
{
name
:
styleConfigureSettlementTime
,
pos
:
styleConfigureSettlementTimePosition
},
{
name
:
aspEnterpriseNameWrite
,
pos
:
aspNamePosition
}
];
this
.
baseInfo
=
[
[
{
name
:
'发起方'
,
value
:
'在山西地区的零售药店巡店项目'
},
{
name
:
'服务商'
,
value
:
'北京医洋科技有限公司'
},
{
name
:
'任务时间'
,
value
:
'24天'
}
],
[
{
name
:
'任务开始时间'
,
value
:
'2021-04-02'
},
{
name
:
'任务结算时间'
,
value
:
'2021-04-02'
},
{
name
:
'报表生成时间'
,
value
:
'2020-10-2'
}
],
[
{
name
:
'本期个人数据数'
,
value
:
'213123'
},
{
name
:
'累计个人数据总数'
,
value
:
'2020-10-2'
}
]
];
this
.
textData
=
[
[
{
name
:
'专区内容:'
,
value
:
'20题'
},
{
name
:
'总执行数(人或者机构):'
,
value
:
'11111'
},
{
name
:
'本期有效点击量:'
,
value
:
'20000人次'
}
]
];
},
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
)
});
},
exportBi
()
{
this
.
Bi
.
exportBi
({
commandType
:
1
,
type
:
1
});
}
}
},
},
created
()
{
created
()
{
this
.
setData
();
this
.
setData
();
Promise
.
all
([
this
.
Bi
.
getBaseInfo
(),
this
.
Bi
.
getFixedInfo
(),
this
.
Bi
.
getTopicInfo
(),
this
.
Bi
.
getGroupInfo
(),
this
.
Bi
.
getTemplateList
()
]).
then
(([
baseInfo
,
tempaletList
])
=>
{
this
.
dealBaseInfo
(
baseInfo
.
data
.
data
[
0
]
||
{});
this
.
coverList
=
tempaletList
.
data
.
data
||
[];
});
window
.
status
=
'completed'
;
window
.
status
=
'completed'
;
}
}
};
};
...
...
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