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 de3da450
authored
Dec 17, 2021
by
jml0128
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-样式调整' into 'master'
Feat 样式调整 See merge request
!4
2 parents
250cd8ee
492ca115
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
164 additions
and
114 deletions
README.md
package.json
src/packages/bi/src/chart-type/bar/createBar.js
src/packages/bi/src/chart-type/line/createLine.js
src/packages/bi/src/components/catalogue.vue
src/packages/bi/src/components/mobile/base-info.vue
src/packages/bi/src/project/20-configurable.vue
src/packages/bi/src/project/6-zone.vue
src/packages/bi/src/project/tools.js
README.md
View file @
de3da45
...
...
@@ -3,6 +3,26 @@
*
@Date: 2021-09-08 15:26:40
-->
# 0.1.25
1.
名称显示调整,折线图线段加粗
# 0.1.23
1.
图表数据大于 30 条后,禁止使用表格形式
# 0.1.22
1.
柱状图样式
# 0.1.21
1.
线上推广图表增加 hideThisChart 字段控制图表是否隐藏
# 0.1.20
1.
修改线上推广性别图表切换问题
# 0.1.19
1.
增加 npmignore 文件
...
...
package.json
View file @
de3da45
{
"name"
:
"xrk-bi"
,
"version"
:
"0.1.2
0
"
,
"version"
:
"0.1.2
5
"
,
"description"
:
"xrk-bi"
,
"author"
:
"xrk"
,
"main"
:
"dist/bundler.js"
,
...
...
src/packages/bi/src/chart-type/bar/createBar.js
View file @
de3da45
...
...
@@ -2,11 +2,10 @@
* @Description:
* @Date: 2021-06-10 13:51:26
*/
import
{
dealString
,
dealFormatter
,
getInterval
}
from
'../common'
;
import
{
dealString
,
dealFormatter
}
from
'../common'
;
const
grid
=
{
containLabel
:
true
,
left
:
10
,
right
:
15
,
bottom
:
10
,
top
:
30
};
...
...
src/packages/bi/src/chart-type/line/createLine.js
View file @
de3da45
...
...
@@ -71,14 +71,14 @@ export const createLine = (
type
:
'line'
,
data
:
item
,
barWidth
:
'28px'
,
symbolSize
:
7
,
symbolSize
:
10
,
lineStyle
:
{
color
:
isSingle
?
colors
.
length
==
1
?
colors
[
0
]
:
'#D8E5F2'
:
colors
[
index
],
width
:
3
width
:
5
// shadowColor: hexColorToRgba(colors[index], 0.6),
// shadowBlur: isSingle ? 0 : 10
},
...
...
@@ -102,7 +102,7 @@ export const createLine = (
?
colors
[
0
]
:
'#D8E5F2'
:
colors
[
index
],
width
:
3
width
:
5
}
}
};
...
...
@@ -159,14 +159,14 @@ export const createLineSmooth = (
type
:
'line'
,
data
:
item
,
smooth
:
true
,
symbolSize
:
7
,
symbolSize
:
10
,
lineStyle
:
{
color
:
isSingle
?
colors
.
length
==
1
?
colors
[
0
]
:
'#D8E5F2'
:
colors
[
index
],
width
:
3
width
:
5
// shadowColor: hexColorToRgba(colors[index], 0.6),
// shadowBlur: isSingle ? 0 : 10
},
...
...
@@ -190,7 +190,7 @@ export const createLineSmooth = (
?
colors
[
0
]
:
'#D8E5F2'
:
colors
[
index
],
width
:
3
width
:
5
}
}
};
...
...
src/packages/bi/src/components/catalogue.vue
View file @
de3da45
...
...
@@ -30,7 +30,7 @@
>
<div>
<p class="
bi
-
catalogue_list_item_child_item_name
"
>
<
span
>
{{
`${index + 1
}
.${cIndex + 1
}
`
}}
{{
name
}}
<
/span
>
<
span
>
{{
`${index + 1
}
.${cIndex + 1
}
`
}}
{{
name
}}
<
/span
>
<
/p
>
<
div
class
=
"bi-catalogue_list_item_child_item_hr"
><
/div
>
<
span
class
=
"bi-catalogue_list_item_child_item_page"
>
...
...
src/packages/bi/src/components/mobile/base-info.vue
View file @
de3da45
...
...
@@ -35,7 +35,7 @@ export default {
value
:
'张三'
},
{
label
:
'
发起
方:'
,
label
:
'
项目
方:'
,
value
:
'葵花医疗集团'
},
{
...
...
src/packages/bi/src/project/20-configurable.vue
View file @
de3da45
...
...
@@ -229,7 +229,9 @@ export default {
isAuditCso
,
// 乙方可见
isAuditGongye
,
// 甲方可见
csoAuditUser
// 审核人姓名
csoAuditUser
,
// 审核人姓名
nameShowType
//1:正常显示甲乙方 2:隐藏发起方,原"服务商"改为"项目方" 3:隐藏发起方
}
=
info
;
this
.
biInfo
=
{
biInfoId
:
id
,
...
...
@@ -253,50 +255,6 @@ export default {
pos
:
aspNamePosition
}
];
const
_baseInfo
=
[
[
{
name
:
'项目名称'
,
value
:
projectName
},
{
name
:
'发起方'
,
value
:
sendEnterpriseName
},
{
name
:
'服务商'
,
value
:
aspEnterpriseName
}
],
[
{
name
:
'提交时间'
,
value
:
settlementTime
},
{
name
:
'任务数量'
,
value
:
taskSum
},
{
name
:
'项目执行人数'
,
value
:
`
${
executePeopleNumber
}
人`
}
],
[
{
name
:
'数据收集数'
,
value
:
`
${
dataCollectNumber
}
条`
},
{
name
:
'参与调研样本'
,
value
:
`
${
examinePeopleNumber
}
份`
},
{
name
:
'报表生成时间'
,
value
:
biCreateDt
}
]
];
const
showReviewer
=
()
=>
{
switch
(
this
.
platform
)
{
case
'gongye'
:
...
...
@@ -306,16 +264,61 @@ export default {
}
return
false
;
};
this
.
baseInfo
=
showReviewer
()
?
_baseInfo
.
concat
([
[
{
name
:
'服务商审核人'
,
value
:
csoAuditUser
||
'-'
}
]
])
:
_baseInfo
;
const
_baseInfo
=
[
{
name
:
'项目名称'
,
value
:
projectName
},
{
hide
:
nameShowType
==
2
||
nameShowType
==
3
,
name
:
'项目方'
,
value
:
sendEnterpriseName
},
{
name
:
nameShowType
==
2
?
'项目方'
:
'服务商'
,
value
:
aspEnterpriseName
},
{
name
:
'提交时间'
,
value
:
settlementTime
},
{
name
:
'任务数量'
,
value
:
taskSum
},
{
name
:
'项目执行人数'
,
value
:
`
${
executePeopleNumber
}
人`
},
{
name
:
'数据收集数'
,
value
:
`
${
dataCollectNumber
}
条`
},
{
name
:
'参与调研样本'
,
value
:
`
${
examinePeopleNumber
}
份`
},
{
name
:
'报表生成时间'
,
value
:
biCreateDt
},
{
hide
:
!
showReviewer
(),
name
:
'服务商审核人'
,
value
:
csoAuditUser
||
'-'
}
];
this
.
baseInfo
=
_baseInfo
.
reduce
((
pre
,
cur
)
=>
{
if
(
!
cur
.
hide
)
{
const
lastArr
=
pre
[
pre
.
length
-
1
];
if
(
Array
.
isArray
(
lastArr
)
&&
lastArr
.
length
<
3
)
{
lastArr
.
push
(
cur
);
}
else
{
pre
.
push
([
cur
]);
}
}
return
pre
;
},
[]);
this
.
textData
=
[
[
{
...
...
@@ -385,7 +388,7 @@ export default {
hideChart
:
true
,
hideTitle
:
true
}),
ChartConfigFn
.
createConfig
(
dealAxis
(
group3
.
fixedCountInfos
),
{
ChartConfigFn
.
createConfig
(
dealAxis
(
group3
.
fixedCountInfos
,
'个'
),
{
...
group3
,
resultIsShow
:
1
,
hideBtn
:
true
,
...
...
@@ -406,8 +409,14 @@ export default {
return
ChartConfigFn
.
createConfig
(
dealAxis
(
item
.
topicCountInfos
),
{
...
item
,
blockTitle
:
item
.
topicTitle
,
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
5
,
6
,
9
,
10
,
11
]),
disableTypes
:
[
3
,
4
]
chartType
:
item
.
chartType
||
randomType
(
item
.
topicCountInfos
.
length
>
30
?
[
1
,
2
,
5
,
6
,
9
,
10
]
:
[
1
,
2
,
5
,
6
,
9
,
10
,
11
]
),
disableTypes
:
item
.
topicCountInfos
.
length
>
30
?
[
3
,
4
,
11
]
:
[
3
,
4
]
});
})
.
sort
((
a
,
b
)
=>
{
...
...
@@ -428,7 +437,12 @@ export default {
toggleAxisContenteditable
:
true
,
blockTitle
:
`
${
item
.
xFactor
}
与
${
item
.
yFactor
}
相关性分析`
,
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
3
,
4
,
5
,
6
,
9
,
10
,
11
])
item
.
chartType
||
randomType
(
item
.
topicCountInfos
.
length
>
30
?
[
1
,
2
,
3
,
4
,
5
,
6
,
9
,
10
]
:
[
1
,
2
,
3
,
4
,
5
,
6
,
9
,
10
,
11
]
)
});
})
.
sort
((
a
,
b
)
=>
{
...
...
src/packages/bi/src/project/6-zone.vue
View file @
de3da45
...
...
@@ -223,7 +223,9 @@ export default {
taskEndTime
,
taskSum
,
executePeopleNumber
,
createDt
createDt
,
nameShowType
//1:正常显示甲乙方 2:隐藏发起方,原"服务商"改为"项目方" 3:隐藏发起方
}
=
info
;
this
.
biInfo
=
{
biInfoId
:
biInfoId
,
...
...
@@ -248,45 +250,50 @@ export default {
}
];
this
.
baseInfo
=
[
[
{
name
:
'发起方'
,
value
:
sendEnterpriseName
},
{
name
:
'服务商'
,
value
:
aspEnterpriseName
},
{
name
:
'任务时间'
,
value
:
`
${
taskTime
}
天`
}
],
[
{
name
:
'任务开始时间'
,
value
:
taskStartTime
},
{
name
:
'任务结算时间'
,
value
:
taskEndTime
},
{
name
:
'报表生成时间'
,
value
:
biCreateDt
}
],
[
{
name
:
'本期个人数据数'
,
value
:
executePeopleNumber
},
{
name
:
'累计个人数据总数'
,
value
:
taskSum
{
hide
:
nameShowType
==
2
||
nameShowType
==
3
,
name
:
'项目方'
,
value
:
sendEnterpriseName
},
{
name
:
nameShowType
==
2
?
'项目方'
:
'服务商'
,
value
:
aspEnterpriseName
},
{
name
:
'任务时间'
,
value
:
`
${
taskTime
}
天`
},
{
name
:
'任务开始时间'
,
value
:
taskStartTime
},
{
name
:
'任务结算时间'
,
value
:
taskEndTime
},
{
name
:
'报表生成时间'
,
value
:
biCreateDt
},
{
name
:
'本期个人数据数'
,
value
:
executePeopleNumber
},
{
name
:
'累计个人数据总数'
,
value
:
taskSum
}
].
reduce
((
pre
,
cur
)
=>
{
if
(
!
cur
.
hide
)
{
const
lastArr
=
pre
[
pre
.
length
-
1
];
if
(
Array
.
isArray
(
lastArr
)
&&
lastArr
.
length
<
3
)
{
lastArr
.
push
(
cur
);
}
else
{
pre
.
push
([
cur
]);
}
]
];
}
return
pre
;
},
[]);
this
.
textData
=
[
[
{
...
...
@@ -382,7 +389,7 @@ export default {
disableTypes
:
[
3
,
4
,
9
,
10
,
11
]
}),
item
=>
({
hideThisChart
:
item
.
topicCountInfos
.
length
<
7
,
hideThisChart
:
!!
item
.
hideThisChart
,
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
5
,
6
]),
blockTitle
:
'数字专区单日点击量Top5日期分布图'
,
hideLegend
:
true
,
...
...
@@ -390,7 +397,7 @@ export default {
disableTypes
:
[
3
,
4
,
9
,
10
,
11
]
}),
item
=>
({
hideThisChart
:
item
.
topicCountInfos
.
length
<
7
,
hideThisChart
:
!!
item
.
hideThisChart
,
chartType
:
item
.
chartType
||
9
,
blockTitle
:
'数字专区单日点击量Top5占周期总有效点击量占比分析图'
,
hideLegend
:
true
,
...
...
src/packages/bi/src/project/tools.js
View file @
de3da45
...
...
@@ -4,12 +4,21 @@
*/
import
{
base
}
from
'../chart-type/common'
;
const
dealStr
=
(
str
,
unit
=
''
)
=>
{
const
length
=
unit
.
length
;
if
(
`
${
str
}
`
.
slice
(
0
-
length
)
===
unit
)
{
return
str
;
}
else
{
return
`
${
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
;
return
{
x
:
xName
?
(
isLast
?
`
${
xName
}${
lastUnit
}
`
:
`
${
xName
}${
unit
}
`
)
:
'-'
,
x
:
xName
?
dealStr
(
xName
,
isLast
?
lastUnit
:
unit
)
:
'-'
,
y
:
item
.
yTopicName
,
value
:
item
.
num
||
item
.
countNum
||
0
};
...
...
@@ -21,9 +30,10 @@ export const dealLegends = (arr = [], unit = '', lastUnit = '') => {
},
0
);
return
arr
.
reduce
((
pre
,
cur
,
index
)
=>
{
pre
.
push
(
`
${
cur
.
genderType
||
cur
.
xTopicName
}${
`
${
dealStr
(
cur
.
genderType
||
cur
.
xTopicName
,
index
===
arr
.
length
-
1
?
lastUnit
:
unit
}
$
{
cur
.
num
||
cur
.
countNum
||
0
}
人,占比
${
base
.
numberFormat
(
)
}${
cur
.
num
||
cur
.
countNum
||
0
}
人,占比
${
base
.
numberFormat
(
total
?
(
cur
.
num
||
cur
.
countNum
||
0
)
/
total
:
0
,
0.01
)}
%`
...
...
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