Commit 492ca115 by jml0128

修改图表

1 parent a33a97b5
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* @Date: 2021-09-08 15:26:40 * @Date: 2021-09-08 15:26:40
--> -->
# 0.1.25
1. 名称显示调整,折线图线段加粗
# 0.1.23 # 0.1.23
1. 图表数据大于 30 条后,禁止使用表格形式 1. 图表数据大于 30 条后,禁止使用表格形式
......
{ {
"name": "xrk-bi", "name": "xrk-bi",
"version": "0.1.24", "version": "0.1.25",
"description": "xrk-bi", "description": "xrk-bi",
"author": "xrk", "author": "xrk",
"main": "dist/bundler.js", "main": "dist/bundler.js",
......
...@@ -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
} }
} }
}; };
......
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
value: '张三' value: '张三'
}, },
{ {
label: '发起方:', label: '项目方:',
value: '葵花医疗集团' value: '葵花医疗集团'
}, },
{ {
......
...@@ -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,50 +255,6 @@ export default { ...@@ -253,50 +255,6 @@ export default {
pos: aspNamePosition 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 = () => { const showReviewer = () => {
switch (this.platform) { switch (this.platform) {
case 'gongye': case 'gongye':
...@@ -306,16 +264,61 @@ export default { ...@@ -306,16 +264,61 @@ export default {
} }
return false; return false;
}; };
this.baseInfo = showReviewer() const _baseInfo = [
? _baseInfo.concat([ {
[ name: '项目名称',
{ value: projectName
name: '服务商审核人', },
value: csoAuditUser || '-' {
} hide: nameShowType == 2 || nameShowType == 3,
] name: '项目方',
]) value: sendEnterpriseName
: _baseInfo; },
{
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 = [ 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,
......
...@@ -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,45 +250,50 @@ export default { ...@@ -248,45 +250,50 @@ export default {
} }
]; ];
this.baseInfo = [ this.baseInfo = [
[ {
{ hide: nameShowType == 2 || nameShowType == 3,
name: '发起方', name: '项目方',
value: sendEnterpriseName value: sendEnterpriseName
}, },
{ {
name: '服务商', name: nameShowType == 2 ? '项目方' : '服务商',
value: aspEnterpriseName value: aspEnterpriseName
}, },
{ {
name: '任务时间', name: '任务时间',
value: `${taskTime}天` value: `${taskTime}天`
} },
], {
[ name: '任务开始时间',
{ value: taskStartTime
name: '任务开始时间', },
value: taskStartTime {
}, name: '任务结算时间',
{ value: taskEndTime
name: '任务结算时间', },
value: taskEndTime {
}, name: '报表生成时间',
{ value: biCreateDt
name: '报表生成时间', },
value: biCreateDt {
} name: '本期个人数据数',
], value: executePeopleNumber
[ },
{ {
name: '本期个人数据数', name: '累计个人数据总数',
value: executePeopleNumber value: taskSum
}, }
{ ].reduce((pre, cur) => {
name: '累计个人数据总数', if (!cur.hide) {
value: taskSum 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 = [
[ [
{ {
......
...@@ -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
)}%` )}%`
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!