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
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
110 additions
and
60 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 @@
...
@@ -3,6 +3,26 @@
*
@Date: 2021-09-08 15:26:40
*
@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
# 0.1.19
1.
增加 npmignore 文件
1.
增加 npmignore 文件
...
...
package.json
View file @
de3da45
{
{
"name"
:
"xrk-bi"
,
"name"
:
"xrk-bi"
,
"version"
:
"0.1.2
0
"
,
"version"
:
"0.1.2
5
"
,
"description"
:
"xrk-bi"
,
"description"
:
"xrk-bi"
,
"author"
:
"xrk"
,
"author"
:
"xrk"
,
"main"
:
"dist/bundler.js"
,
"main"
:
"dist/bundler.js"
,
...
...
src/packages/bi/src/chart-type/bar/createBar.js
View file @
de3da45
...
@@ -2,11 +2,10 @@
...
@@ -2,11 +2,10 @@
* @Description:
* @Description:
* @Date: 2021-06-10 13:51:26
* @Date: 2021-06-10 13:51:26
*/
*/
import
{
dealString
,
dealFormatter
,
getInterval
}
from
'../common'
;
import
{
dealString
,
dealFormatter
}
from
'../common'
;
const
grid
=
{
const
grid
=
{
containLabel
:
true
,
containLabel
:
true
,
left
:
10
,
left
:
10
,
right
:
15
,
bottom
:
10
,
bottom
:
10
,
top
:
30
top
:
30
};
};
...
...
src/packages/bi/src/chart-type/line/createLine.js
View file @
de3da45
...
@@ -71,14 +71,14 @@ export const createLine = (
...
@@ -71,14 +71,14 @@ export const createLine = (
type
:
'line'
,
type
:
'line'
,
data
:
item
,
data
:
item
,
barWidth
:
'28px'
,
barWidth
:
'28px'
,
symbolSize
:
7
,
symbolSize
:
10
,
lineStyle
:
{
lineStyle
:
{
color
:
isSingle
color
:
isSingle
?
colors
.
length
==
1
?
colors
.
length
==
1
?
colors
[
0
]
?
colors
[
0
]
:
'#D8E5F2'
:
'#D8E5F2'
:
colors
[
index
],
:
colors
[
index
],
width
:
3
width
:
5
// shadowColor: hexColorToRgba(colors[index], 0.6),
// shadowColor: hexColorToRgba(colors[index], 0.6),
// shadowBlur: isSingle ? 0 : 10
// shadowBlur: isSingle ? 0 : 10
},
},
...
@@ -102,7 +102,7 @@ export const createLine = (
...
@@ -102,7 +102,7 @@ export const createLine = (
?
colors
[
0
]
?
colors
[
0
]
:
'#D8E5F2'
:
'#D8E5F2'
:
colors
[
index
],
:
colors
[
index
],
width
:
3
width
:
5
}
}
}
}
};
};
...
@@ -159,14 +159,14 @@ export const createLineSmooth = (
...
@@ -159,14 +159,14 @@ export const createLineSmooth = (
type
:
'line'
,
type
:
'line'
,
data
:
item
,
data
:
item
,
smooth
:
true
,
smooth
:
true
,
symbolSize
:
7
,
symbolSize
:
10
,
lineStyle
:
{
lineStyle
:
{
color
:
isSingle
color
:
isSingle
?
colors
.
length
==
1
?
colors
.
length
==
1
?
colors
[
0
]
?
colors
[
0
]
:
'#D8E5F2'
:
'#D8E5F2'
:
colors
[
index
],
:
colors
[
index
],
width
:
3
width
:
5
// shadowColor: hexColorToRgba(colors[index], 0.6),
// shadowColor: hexColorToRgba(colors[index], 0.6),
// shadowBlur: isSingle ? 0 : 10
// shadowBlur: isSingle ? 0 : 10
},
},
...
@@ -190,7 +190,7 @@ export const createLineSmooth = (
...
@@ -190,7 +190,7 @@ export const createLineSmooth = (
?
colors
[
0
]
?
colors
[
0
]
:
'#D8E5F2'
:
'#D8E5F2'
:
colors
[
index
],
:
colors
[
index
],
width
:
3
width
:
5
}
}
}
}
};
};
...
...
src/packages/bi/src/components/catalogue.vue
View file @
de3da45
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
>
>
<div>
<div>
<p class="
bi
-
catalogue_list_item_child_item_name
"
>
<p class="
bi
-
catalogue_list_item_child_item_name
"
>
<
span
>
{{
`${index + 1
}
.${cIndex + 1
}
`
}}
{{
name
}}
<
/span
>
<
span
>
{{
`${index + 1
}
.${cIndex + 1
}
`
}}
{{
name
}}
<
/span
>
<
/p
>
<
/p
>
<
div
class
=
"bi-catalogue_list_item_child_item_hr"
><
/div
>
<
div
class
=
"bi-catalogue_list_item_child_item_hr"
><
/div
>
<
span
class
=
"bi-catalogue_list_item_child_item_page"
>
<
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 {
...
@@ -35,7 +35,7 @@ export default {
value
:
'张三'
value
:
'张三'
},
},
{
{
label
:
'
发起
方:'
,
label
:
'
项目
方:'
,
value
:
'葵花医疗集团'
value
:
'葵花医疗集团'
},
},
{
{
...
...
src/packages/bi/src/project/20-configurable.vue
View file @
de3da45
...
@@ -229,7 +229,9 @@ export default {
...
@@ -229,7 +229,9 @@ export default {
isAuditCso
,
// 乙方可见
isAuditCso
,
// 乙方可见
isAuditGongye
,
// 甲方可见
isAuditGongye
,
// 甲方可见
csoAuditUser
// 审核人姓名
csoAuditUser
,
// 审核人姓名
nameShowType
//1:正常显示甲乙方 2:隐藏发起方,原"服务商"改为"项目方" 3:隐藏发起方
}
=
info
;
}
=
info
;
this
.
biInfo
=
{
this
.
biInfo
=
{
biInfoId
:
id
,
biInfoId
:
id
,
...
@@ -253,22 +255,29 @@ export default {
...
@@ -253,22 +255,29 @@ export default {
pos
:
aspNamePosition
pos
:
aspNamePosition
}
}
];
];
const
showReviewer
=
()
=>
{
switch
(
this
.
platform
)
{
case
'gongye'
:
return
isAuditGongye
==
1
;
case
'cso'
:
return
isAuditCso
==
1
;
}
return
false
;
};
const
_baseInfo
=
[
const
_baseInfo
=
[
[
{
{
name
:
'项目名称'
,
name
:
'项目名称'
,
value
:
projectName
value
:
projectName
},
},
{
{
name
:
'发起方'
,
hide
:
nameShowType
==
2
||
nameShowType
==
3
,
name
:
'项目方'
,
value
:
sendEnterpriseName
value
:
sendEnterpriseName
},
},
{
{
name
:
'服务商'
,
name
:
nameShowType
==
2
?
'项目方'
:
'服务商'
,
value
:
aspEnterpriseName
value
:
aspEnterpriseName
}
},
],
[
{
{
name
:
'提交时间'
,
name
:
'提交时间'
,
value
:
settlementTime
value
:
settlementTime
...
@@ -280,9 +289,7 @@ export default {
...
@@ -280,9 +289,7 @@ export default {
{
{
name
:
'项目执行人数'
,
name
:
'项目执行人数'
,
value
:
`
${
executePeopleNumber
}
人`
value
:
`
${
executePeopleNumber
}
人`
}
},
],
[
{
{
name
:
'数据收集数'
,
name
:
'数据收集数'
,
value
:
`
${
dataCollectNumber
}
条`
value
:
`
${
dataCollectNumber
}
条`
...
@@ -294,28 +301,24 @@ export default {
...
@@ -294,28 +301,24 @@ export default {
{
{
name
:
'报表生成时间'
,
name
:
'报表生成时间'
,
value
:
biCreateDt
value
:
biCreateDt
}
},
]
];
const
showReviewer
=
()
=>
{
switch
(
this
.
platform
)
{
case
'gongye'
:
return
isAuditGongye
==
1
;
case
'cso'
:
return
isAuditCso
==
1
;
}
return
false
;
};
this
.
baseInfo
=
showReviewer
()
?
_baseInfo
.
concat
([
[
{
{
hide
:
!
showReviewer
(),
name
:
'服务商审核人'
,
name
:
'服务商审核人'
,
value
:
csoAuditUser
||
'-'
value
:
csoAuditUser
||
'-'
}
}
]
];
])
this
.
baseInfo
=
_baseInfo
.
reduce
((
pre
,
cur
)
=>
{
:
_baseInfo
;
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
=
[
this
.
textData
=
[
[
[
{
{
...
@@ -385,7 +388,7 @@ export default {
...
@@ -385,7 +388,7 @@ export default {
hideChart
:
true
,
hideChart
:
true
,
hideTitle
:
true
hideTitle
:
true
}),
}),
ChartConfigFn
.
createConfig
(
dealAxis
(
group3
.
fixedCountInfos
),
{
ChartConfigFn
.
createConfig
(
dealAxis
(
group3
.
fixedCountInfos
,
'个'
),
{
...
group3
,
...
group3
,
resultIsShow
:
1
,
resultIsShow
:
1
,
hideBtn
:
true
,
hideBtn
:
true
,
...
@@ -406,8 +409,14 @@ export default {
...
@@ -406,8 +409,14 @@ export default {
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
:
disableTypes
:
[
3
,
4
]
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
)
=>
{
.
sort
((
a
,
b
)
=>
{
...
@@ -428,7 +437,12 @@ export default {
...
@@ -428,7 +437,12 @@ export default {
toggleAxisContenteditable
:
true
,
toggleAxisContenteditable
:
true
,
blockTitle
:
`
${
item
.
xFactor
}
与
${
item
.
yFactor
}
相关性分析`
,
blockTitle
:
`
${
item
.
xFactor
}
与
${
item
.
yFactor
}
相关性分析`
,
chartType
:
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
)
=>
{
.
sort
((
a
,
b
)
=>
{
...
...
src/packages/bi/src/project/6-zone.vue
View file @
de3da45
...
@@ -223,7 +223,9 @@ export default {
...
@@ -223,7 +223,9 @@ export default {
taskEndTime
,
taskEndTime
,
taskSum
,
taskSum
,
executePeopleNumber
,
executePeopleNumber
,
createDt
createDt
,
nameShowType
//1:正常显示甲乙方 2:隐藏发起方,原"服务商"改为"项目方" 3:隐藏发起方
}
=
info
;
}
=
info
;
this
.
biInfo
=
{
this
.
biInfo
=
{
biInfoId
:
biInfoId
,
biInfoId
:
biInfoId
,
...
@@ -248,21 +250,19 @@ export default {
...
@@ -248,21 +250,19 @@ export default {
}
}
];
];
this
.
baseInfo
=
[
this
.
baseInfo
=
[
[
{
{
name
:
'发起方'
,
hide
:
nameShowType
==
2
||
nameShowType
==
3
,
name
:
'项目方'
,
value
:
sendEnterpriseName
value
:
sendEnterpriseName
},
},
{
{
name
:
'服务商'
,
name
:
nameShowType
==
2
?
'项目方'
:
'服务商'
,
value
:
aspEnterpriseName
value
:
aspEnterpriseName
},
},
{
{
name
:
'任务时间'
,
name
:
'任务时间'
,
value
:
`
${
taskTime
}
天`
value
:
`
${
taskTime
}
天`
}
},
],
[
{
{
name
:
'任务开始时间'
,
name
:
'任务开始时间'
,
value
:
taskStartTime
value
:
taskStartTime
...
@@ -274,9 +274,7 @@ export default {
...
@@ -274,9 +274,7 @@ export default {
{
{
name
:
'报表生成时间'
,
name
:
'报表生成时间'
,
value
:
biCreateDt
value
:
biCreateDt
}
},
],
[
{
{
name
:
'本期个人数据数'
,
name
:
'本期个人数据数'
,
value
:
executePeopleNumber
value
:
executePeopleNumber
...
@@ -285,8 +283,17 @@ export default {
...
@@ -285,8 +283,17 @@ export default {
name
:
'累计个人数据总数'
,
name
:
'累计个人数据总数'
,
value
:
taskSum
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
=
[
this
.
textData
=
[
[
[
{
{
...
@@ -382,7 +389,7 @@ export default {
...
@@ -382,7 +389,7 @@ export default {
disableTypes
:
[
3
,
4
,
9
,
10
,
11
]
disableTypes
:
[
3
,
4
,
9
,
10
,
11
]
}),
}),
item
=>
({
item
=>
({
hideThisChart
:
item
.
topicCountInfos
.
length
<
7
,
hideThisChart
:
!!
item
.
hideThisChart
,
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
5
,
6
]),
chartType
:
item
.
chartType
||
randomType
([
1
,
2
,
5
,
6
]),
blockTitle
:
'数字专区单日点击量Top5日期分布图'
,
blockTitle
:
'数字专区单日点击量Top5日期分布图'
,
hideLegend
:
true
,
hideLegend
:
true
,
...
@@ -390,7 +397,7 @@ export default {
...
@@ -390,7 +397,7 @@ export default {
disableTypes
:
[
3
,
4
,
9
,
10
,
11
]
disableTypes
:
[
3
,
4
,
9
,
10
,
11
]
}),
}),
item
=>
({
item
=>
({
hideThisChart
:
item
.
topicCountInfos
.
length
<
7
,
hideThisChart
:
!!
item
.
hideThisChart
,
chartType
:
item
.
chartType
||
9
,
chartType
:
item
.
chartType
||
9
,
blockTitle
:
'数字专区单日点击量Top5占周期总有效点击量占比分析图'
,
blockTitle
:
'数字专区单日点击量Top5占周期总有效点击量占比分析图'
,
hideLegend
:
true
,
hideLegend
:
true
,
...
...
src/packages/bi/src/project/tools.js
View file @
de3da45
...
@@ -4,12 +4,21 @@
...
@@ -4,12 +4,21 @@
*/
*/
import
{
base
}
from
'../chart-type/common'
;
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
=
''
)
=>
{
export
const
dealAxis
=
(
arr
=
[],
unit
=
''
,
lastUnit
=
''
)
=>
{
return
arr
.
map
((
item
,
index
)
=>
{
return
arr
.
map
((
item
,
index
)
=>
{
const
isLast
=
index
===
arr
.
length
-
1
;
const
isLast
=
index
===
arr
.
length
-
1
;
const
xName
=
item
.
genderType
||
item
.
xTopicName
;
const
xName
=
item
.
genderType
||
item
.
xTopicName
;
return
{
return
{
x
:
xName
?
(
isLast
?
`
${
xName
}${
lastUnit
}
`
:
`
${
xName
}${
unit
}
`
)
:
'-'
,
x
:
xName
?
dealStr
(
xName
,
isLast
?
lastUnit
:
unit
)
:
'-'
,
y
:
item
.
yTopicName
,
y
:
item
.
yTopicName
,
value
:
item
.
num
||
item
.
countNum
||
0
value
:
item
.
num
||
item
.
countNum
||
0
};
};
...
@@ -21,9 +30,10 @@ export const dealLegends = (arr = [], unit = '', lastUnit = '') => {
...
@@ -21,9 +30,10 @@ export const dealLegends = (arr = [], unit = '', lastUnit = '') => {
},
0
);
},
0
);
return
arr
.
reduce
((
pre
,
cur
,
index
)
=>
{
return
arr
.
reduce
((
pre
,
cur
,
index
)
=>
{
pre
.
push
(
pre
.
push
(
`
${
cur
.
genderType
||
cur
.
xTopicName
}${
`
${
dealStr
(
cur
.
genderType
||
cur
.
xTopicName
,
index
===
arr
.
length
-
1
?
lastUnit
:
unit
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
,
total
?
(
cur
.
num
||
cur
.
countNum
||
0
)
/
total
:
0
,
0.01
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