Commit 492ca115 by jml0128

修改图表

1 parent a33a97b5
......@@ -3,6 +3,10 @@
* @Date: 2021-09-08 15:26:40
-->
# 0.1.25
1. 名称显示调整,折线图线段加粗
# 0.1.23
1. 图表数据大于 30 条后,禁止使用表格形式
......
{
"name": "xrk-bi",
"version": "0.1.24",
"version": "0.1.25",
"description": "xrk-bi",
"author": "xrk",
"main": "dist/bundler.js",
......
......@@ -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
}
}
};
......
......@@ -35,7 +35,7 @@ export default {
value: '张三'
},
{
label: '发起方:',
label: '项目方:',
value: '葵花医疗集团'
},
{
......
......@@ -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,
......
......@@ -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 = [
[
{
......
......@@ -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
)}%`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!