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 cedf1652
authored
Jul 08, 2021
by
jml0128
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
1 parent
d49f6391
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
34 deletions
package.json
src/packages/bi/src/chart-type/common.js
src/packages/bi/src/chart-type/map/createMap.js
src/packages/bi/src/project/20-configurable.vue
src/packages/bi/src/project/6-zone.vue
src/packages/bi/src/project/tools.js
package.json
View file @
cedf165
{
"name"
:
"xrk-bi"
,
"version"
:
"0.1.
1
"
,
"version"
:
"0.1.
3
"
,
"description"
:
"xrk-bi"
,
"author"
:
"xrk"
,
"main"
:
"dist/bundler.js"
,
...
...
src/packages/bi/src/chart-type/common.js
View file @
cedf165
...
...
@@ -214,6 +214,7 @@ export const initDivInput = (
let
leftText
=
''
;
let
rightText
=
''
;
let
deleteText
=
''
;
let
isComposition
=
false
;
dom
.
innerHTML
=
dom
.
innerText
;
const
setIndex
=
function
()
{
const
{
innerText
}
=
this
;
...
...
@@ -246,13 +247,18 @@ export const initDivInput = (
);
};
dom
.
addEventListener
(
'compositionstart'
,
function
(
event
)
{
dom
.
addEventListener
(
'compositionstart'
,
function
()
{
isComposition
=
true
;
setIndex
.
call
(
this
);
});
dom
.
addEventListener
(
'compositionend'
,
function
(
event
)
{
isComposition
=
false
;
dealText
.
call
(
this
,
event
.
data
);
});
dom
.
addEventListener
(
'beforeinput'
,
function
(
event
)
{
if
(
isComposition
)
{
return
;
}
const
{
inputType
}
=
event
;
if
(
inputType
!=
'insertCompositionText'
)
{
setIndex
.
call
(
this
);
...
...
src/packages/bi/src/chart-type/map/createMap.js
View file @
cedf165
...
...
@@ -3,6 +3,7 @@
* @Date: 2021-06-20 01:16:17
*/
export
const
createMap
=
(
Vue
,
chartData
)
=>
{
console
.
log
(
'map'
,
chartData
);
return
{
visualMap
:
{
borderColor
:
'#fff'
,
...
...
@@ -17,20 +18,20 @@ export const createMap = (Vue, chartData) => {
color
:
'#6C71FF'
},
{
gte
:
5
0
,
gte
:
5
1
,
lte
:
100
,
label
:
'51-100'
,
color
:
'#34CE9C'
},
{
gte
:
11
,
lt
:
50
,
lt
e
:
50
,
label
:
'11-50'
,
color
:
'#3985FF'
},
{
gt
:
0
,
lt
:
10
,
lt
e
:
10
,
label
:
'0-10'
,
color
:
'#00BAFF'
}
...
...
src/packages/bi/src/project/20-configurable.vue
View file @
cedf165
...
...
@@ -329,7 +329,7 @@ export default {
ChartConfigFn
.
createConfig
(
dealAxis
(
group1
.
fixedCountInfos
),
{
...
group1
,
chartType
:
group1
.
chartType
||
12
,
legends
:
dealLegends
(
group1
.
fixedCountInfos
,
'性'
),
legends
:
dealLegends
(
group1
.
fixedCountInfos
,
'性'
,
'性'
),
blockTitle
:
'参与任务执行的性别分布'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDesc
:
true
,
...
...
@@ -354,10 +354,10 @@ export default {
disableTypes
:
[
3
,
4
]
}),
ChartConfigFn
.
createConfig
([],
{
...
group
4
,
...
group
2
,
resultIsShow
:
1
,
hideBtn
:
true
,
resultSystem
:
`
${
group2
.
analyseDescribe
}
,
${
group4
.
resultSystem
}
`
,
resultSystem
:
`
${
group2
.
analyseDescribe
}
`
,
hideLegend
:
true
,
hideChart
:
true
,
hideTitle
:
true
...
...
@@ -367,7 +367,7 @@ export default {
resultIsShow
:
1
,
hideBtn
:
true
,
chartType
:
group3
.
chartType
||
2
,
legends
:
dealLegends
(
group3
.
fixedCountInfos
),
legends
:
dealLegends
(
group3
.
fixedCountInfos
,
'个'
,
''
),
blockTitle
:
'项目参与人完成任务区间分布'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDelete
:
true
,
...
...
src/packages/bi/src/project/6-zone.vue
View file @
cedf165
...
...
@@ -308,7 +308,7 @@ export default {
ChartConfigFn
.
createConfig
(
dealAxis
(
group1
.
topicCountInfos
),
{
...
group1
,
chartType
:
group1
.
chartType
||
12
,
legends
:
dealLegends
(
group1
.
topicCountInfos
),
legends
:
dealLegends
(
group1
.
topicCountInfos
,
'性'
,
'性'
),
blockTitle
:
'参与任务执行的性别分布'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDesc
:
true
,
...
...
@@ -319,19 +319,22 @@ export default {
disableTypes
:
[
3
,
4
],
extendTypes
:
[
12
]
}),
ChartConfigFn
.
createConfig
(
dealAxis
(
group2
.
topicCountInfos
),
{
...
group2
,
chartType
:
group2
.
chartType
||
1
,
legends
:
dealLegends
(
group2
.
topicCountInfos
),
blockTitle
:
'执行任务的年龄段'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDesc
:
true
,
hideDelete
:
true
,
dontContenteditable
:
true
,
width
:
520
,
height
:
350
,
disableTypes
:
[
3
,
4
]
}),
ChartConfigFn
.
createConfig
(
dealAxis
(
group2
.
topicCountInfos
,
''
,
'以上'
),
{
...
group2
,
chartType
:
group2
.
chartType
||
1
,
legends
:
dealLegends
(
group2
.
topicCountInfos
,
'岁'
,
'岁以上'
),
blockTitle
:
'执行任务的年龄段'
,
legendName
:
'总参与项目执行人数${num}人'
,
hideDesc
:
true
,
hideDelete
:
true
,
dontContenteditable
:
true
,
width
:
520
,
height
:
350
,
disableTypes
:
[
3
,
4
]
}
),
ChartConfigFn
.
createConfig
([],
{
...
group1
,
resultIsShow
:
1
,
...
...
src/packages/bi/src/project/tools.js
View file @
cedf165
...
...
@@ -4,22 +4,26 @@
*/
import
{
base
}
from
'../chart-type/common'
;
export
const
dealAxis
=
(
arr
=
[])
=>
{
return
arr
.
map
(
item
=>
({
x
:
item
.
genderType
||
item
.
xTopicName
||
'-'
,
y
:
item
.
yTopicName
,
value
:
item
.
num
||
item
.
countNum
||
0
}));
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
}
`
)
:
'-'
,
y
:
item
.
yTopicName
,
value
:
item
.
num
||
item
.
countNum
||
0
};
});
};
export
const
dealLegends
=
(
arr
=
[],
unit
=
''
)
=>
{
export
const
dealLegends
=
(
arr
=
[],
unit
=
''
,
lastUnit
=
''
)
=>
{
const
total
=
arr
.
reduce
((
pre
,
cur
)
=>
{
return
pre
+
(
cur
.
num
||
cur
.
countNum
||
0
);
},
0
);
return
arr
.
reduce
((
pre
,
cur
)
=>
{
return
arr
.
reduce
((
pre
,
cur
,
index
)
=>
{
pre
.
push
(
`
${
cur
.
genderType
||
cur
.
xTopicName
}${
unit
}${
cur
.
num
||
cur
.
countNum
||
0
}
人,占比
${
base
.
numberFormat
(
`
${
cur
.
genderType
||
cur
.
xTopicName
}${
index
===
arr
.
length
-
1
?
lastUnit
:
unit
}
$
{
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