|
@@ -112,81 +112,71 @@ watch(
|
|
|
|
|
|
type StatisticObjectiveByGroup = ExtractApiResponse<'getStatisticObjectiveByGroup'>
|
|
type StatisticObjectiveByGroup = ExtractApiResponse<'getStatisticObjectiveByGroup'>
|
|
|
|
|
|
-// const getXAxisData = <K extends keyof StatisticObjectiveByGroup>(field: K, data?: StatisticObjectiveByGroup[K]) => {
|
|
|
|
-// if (!data) {
|
|
|
|
-// return []
|
|
|
|
-// }
|
|
|
|
-// const getValue = <T extends keyof ExtractArrayValue<StatisticObjectiveByGroup[K]>>(
|
|
|
|
-// key: T,
|
|
|
|
-// item: ExtractArrayValue<StatisticObjectiveByGroup[K]>
|
|
|
|
-// ) => {
|
|
|
|
-// return item[key]
|
|
|
|
-// }
|
|
|
|
-// return data?.map((v) => getValue(field, v))
|
|
|
|
-// }
|
|
|
|
|
|
+type StatisticObjectiveByGroupValues = StatisticObjectiveByGroup['segmentsByAll']
|
|
|
|
|
|
-// const groupChartsOption = computed<EChartsOption>(() => {
|
|
|
|
-// return {
|
|
|
|
-// legend: {
|
|
|
|
-// right: 0,
|
|
|
|
-// itemWidth: 14,
|
|
|
|
-// data: ['小组主观分布', '题组主观分布'],
|
|
|
|
-// },
|
|
|
|
-// xAxis: {
|
|
|
|
-// axisLine: { show: false },
|
|
|
|
-// axisTick: { show: false },
|
|
|
|
-// splitLine: { show: false },
|
|
|
|
-// axisLabel: {
|
|
|
|
-// align: 'right',
|
|
|
|
-// },
|
|
|
|
-// data: getXAxisData('markingGroupNumber', groupProgressResult?.value),
|
|
|
|
-// },
|
|
|
|
-// yAxis: [
|
|
|
|
-// {
|
|
|
|
-// type: 'value',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// type: 'value',
|
|
|
|
-// axisLabel: {
|
|
|
|
-// formatter: `{value}%`,
|
|
|
|
-// },
|
|
|
|
-// splitLine: { show: false },
|
|
|
|
-// },
|
|
|
|
-// ],
|
|
|
|
-// series: [
|
|
|
|
-// {
|
|
|
|
-// name: '完成总量',
|
|
|
|
-// type: 'bar',
|
|
|
|
-// barWidth: 20,
|
|
|
|
-// itemStyle: {
|
|
|
|
-// color: '#3AD500',
|
|
|
|
-// },
|
|
|
|
-// data: getXAxisData('finishCount', groupProgressResult?.value),
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// name: '当日已完成',
|
|
|
|
-// type: 'bar',
|
|
|
|
-// barWidth: 20,
|
|
|
|
-// itemStyle: {
|
|
|
|
-// color: '#0064FF',
|
|
|
|
-// },
|
|
|
|
-// data: getXAxisData('dayFinishCount', groupProgressResult?.value),
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// name: '完成比',
|
|
|
|
-// type: 'bar',
|
|
|
|
-// barWidth: 80,
|
|
|
|
-// showBackground: true,
|
|
|
|
-// barGap: '-200%',
|
|
|
|
-// yAxisIndex: 1,
|
|
|
|
-// itemStyle: {
|
|
|
|
-// color: 'rgba(0, 186, 151,0.3)',
|
|
|
|
-// },
|
|
|
|
-// data: getXAxisData('finishRate', groupProgressResult?.value),
|
|
|
|
-// },
|
|
|
|
-// ],
|
|
|
|
-// }
|
|
|
|
-// })
|
|
|
|
|
|
+const getXAxisData = <K extends keyof ExtractArrayValue<StatisticObjectiveByGroupValues>>(
|
|
|
|
+ field: K,
|
|
|
|
+ data?: StatisticObjectiveByGroupValues
|
|
|
|
+) => {
|
|
|
|
+ if (!data) {
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+ const getValue = (key: K, item: ExtractArrayValue<StatisticObjectiveByGroupValues>) => {
|
|
|
|
+ return item[key]
|
|
|
|
+ }
|
|
|
|
+ return data?.map((v) => getValue(field, v))
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const groupChartsOption = computed<EChartsOption>(() => {
|
|
|
|
+ return {
|
|
|
|
+ legend: {
|
|
|
|
+ right: 0,
|
|
|
|
+ itemWidth: 14,
|
|
|
|
+ data: ['小组主观分布', '题组主观分布'],
|
|
|
|
+ },
|
|
|
|
+ xAxis: {
|
|
|
|
+ axisLine: { show: false },
|
|
|
|
+ axisTick: { show: false },
|
|
|
|
+ splitLine: { show: false },
|
|
|
|
+ axisLabel: {
|
|
|
|
+ align: 'right',
|
|
|
|
+ },
|
|
|
|
+ data: getXAxisData('count', subjectiveByGroup?.value?.segmentsByGroup),
|
|
|
|
+ },
|
|
|
|
+ yAxis: [
|
|
|
|
+ {
|
|
|
|
+ type: 'value',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ type: 'value',
|
|
|
|
+ axisLabel: {
|
|
|
|
+ formatter: `{value}%`,
|
|
|
|
+ },
|
|
|
|
+ splitLine: { show: false },
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ name: '小组主观分布',
|
|
|
|
+ type: 'bar',
|
|
|
|
+ barWidth: 20,
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#3AD500',
|
|
|
|
+ },
|
|
|
|
+ data: getXAxisData('rate', subjectiveByGroup?.value?.segmentsByGroup),
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: '题组主观分布',
|
|
|
|
+ type: 'bar',
|
|
|
|
+ barWidth: 20,
|
|
|
|
+ itemStyle: {
|
|
|
|
+ color: '#0064FF',
|
|
|
|
+ },
|
|
|
|
+ data: getXAxisData('rate', subjectiveByGroup?.value?.segmentsByAll),
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ }
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|