|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="personnel-compare-view">
|
|
|
|
|
|
+ <div class="personnel-compare-view full">
|
|
<div class="p-l-base p-r-base p-t-medium-base fill-blank filter-form" style="padding-bottom: 10px">
|
|
<div class="p-l-base p-r-base p-t-medium-base fill-blank filter-form" style="padding-bottom: 10px">
|
|
<base-form size="small" :label-width="'88px'" :model="model" :items="items">
|
|
<base-form size="small" :label-width="'88px'" :model="model" :items="items">
|
|
<template #form-item-button-group>
|
|
<template #form-item-button-group>
|
|
@@ -24,6 +24,7 @@
|
|
:data="allTableData"
|
|
:data="allTableData"
|
|
:height="'calc(100vh - 520px)'"
|
|
:height="'calc(100vh - 520px)'"
|
|
highlight-current-row
|
|
highlight-current-row
|
|
|
|
+ @row-dblclick="onDbClick"
|
|
>
|
|
>
|
|
</base-table>
|
|
</base-table>
|
|
<base-table
|
|
<base-table
|
|
@@ -34,8 +35,7 @@
|
|
size="small"
|
|
size="small"
|
|
:columns="columns2"
|
|
:columns="columns2"
|
|
:data="allTableData"
|
|
:data="allTableData"
|
|
- :height="'calc(100vh - 520px)'"
|
|
|
|
- highlight-current-row
|
|
|
|
|
|
+ :height="multipleSelection.length ? 'calc(100vh - 520px)' : 'auto'"
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
>
|
|
>
|
|
</base-table>
|
|
</base-table>
|
|
@@ -59,6 +59,10 @@
|
|
<div v-else-if="multipleSelection.length" class="chart-box">
|
|
<div v-else-if="multipleSelection.length" class="chart-box">
|
|
<vue-e-charts class="full" :option="multLineChartOptions"></vue-e-charts>
|
|
<vue-e-charts class="full" :option="multLineChartOptions"></vue-e-charts>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-if="curRow" class="row-chart">
|
|
|
|
+ <vue-e-charts class="full" :option="rowChartOptions"></vue-e-charts>
|
|
|
|
+ <el-icon class="close-icon" @click="curRow = null"><circle-close /></el-icon>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -68,11 +72,16 @@ import { ref, reactive, computed, watch } from 'vue'
|
|
import BaseForm from '@/components/element/BaseForm.vue'
|
|
import BaseForm from '@/components/element/BaseForm.vue'
|
|
import useFetch from '@/hooks/useFetch'
|
|
import useFetch from '@/hooks/useFetch'
|
|
import BaseTable from '@/components/element/BaseTable.vue'
|
|
import BaseTable from '@/components/element/BaseTable.vue'
|
|
-import { ElButton, ElRadioButton, ElRadioGroup } from 'element-plus'
|
|
|
|
|
|
+import { ElButton, ElRadioButton, ElRadioGroup, ElIcon } from 'element-plus'
|
|
import useCompareFilter from './hooks/useCompareFilter'
|
|
import useCompareFilter from './hooks/useCompareFilter'
|
|
import VueECharts from 'vue-echarts'
|
|
import VueECharts from 'vue-echarts'
|
|
|
|
+import { CircleClose } from '@element-plus/icons-vue'
|
|
import { myColorList } from '@/utils/common'
|
|
import { myColorList } from '@/utils/common'
|
|
|
|
|
|
|
|
+const curRow = ref<any>(null)
|
|
|
|
+const onDbClick = (row: any) => {
|
|
|
|
+ curRow.value = row
|
|
|
|
+}
|
|
const dataType = ref('avg')
|
|
const dataType = ref('avg')
|
|
const dataTypeValues = ['avg', 'std', 'segmentScores', 'markingCount', 'xyRelate']
|
|
const dataTypeValues = ['avg', 'std', 'segmentScores', 'markingCount', 'xyRelate']
|
|
const dataTypeLabelMap = reactive<any>({
|
|
const dataTypeLabelMap = reactive<any>({
|
|
@@ -119,6 +128,11 @@ const allTableData = computed(() => {
|
|
return []
|
|
return []
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+watch(dataType, () => {
|
|
|
|
+ multipleSelection.value = []
|
|
|
|
+ curRow.value = null
|
|
|
|
+})
|
|
watch(allTableData, () => {
|
|
watch(allTableData, () => {
|
|
if (!multLineXdatas.value.length) {
|
|
if (!multLineXdatas.value.length) {
|
|
multLineXdatas.value = allTableData.value[0].segmentScores.map((item: any) => {
|
|
multLineXdatas.value = allTableData.value[0].segmentScores.map((item: any) => {
|
|
@@ -186,7 +200,35 @@ const handleSelectionChange = (val: any[]) => {
|
|
multipleSelection.value = val
|
|
multipleSelection.value = val
|
|
console.log('multipleSelection.value:', multipleSelection.value)
|
|
console.log('multipleSelection.value:', multipleSelection.value)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+const rowChartOptions = computed(() => {
|
|
|
|
+ if (!curRow.value) {
|
|
|
|
+ return {}
|
|
|
|
+ } else {
|
|
|
|
+ console.log('curRow.value:', curRow.value)
|
|
|
|
+ const { dateItems } = curRow.value
|
|
|
|
+ const xData = dateItems.map((v: any) => v.date)
|
|
|
|
+ const yData = dateItems.map((v: any) => v[dataType.value])
|
|
|
|
+ return {
|
|
|
|
+ grid: {
|
|
|
|
+ left: 60,
|
|
|
|
+ right: 240,
|
|
|
|
+ bottom: 40,
|
|
|
|
+ },
|
|
|
|
+ tooltip: { show: true, trigger: 'axis' },
|
|
|
|
+ legend: { show: true },
|
|
|
|
+ xAxis: {
|
|
|
|
+ axisLine: { show: false },
|
|
|
|
+ axisTick: { show: false },
|
|
|
|
+ splitLine: { show: false },
|
|
|
|
+ data: xData,
|
|
|
|
+ },
|
|
|
|
+ yAxis: {
|
|
|
|
+ type: 'value',
|
|
|
|
+ },
|
|
|
|
+ series: [{ name: dataTypeLabelMap[dataType.value], type: 'line', data: yData }],
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+})
|
|
const lineChartOptions = computed(() => {
|
|
const lineChartOptions = computed(() => {
|
|
let xData = allTableData.value.map((item) => item.loginName)
|
|
let xData = allTableData.value.map((item) => item.loginName)
|
|
return {
|
|
return {
|
|
@@ -210,28 +252,45 @@ const lineChartOptions = computed(() => {
|
|
{
|
|
{
|
|
name: dataTypeLabelMap[dataType.value],
|
|
name: dataTypeLabelMap[dataType.value],
|
|
type: 'line',
|
|
type: 'line',
|
|
- barWidth: 20,
|
|
|
|
- itemStyle: {
|
|
|
|
- color: '#3AD500',
|
|
|
|
- },
|
|
|
|
|
|
+ // itemStyle: {
|
|
|
|
+ // color: '#3AD500',
|
|
|
|
+ // },
|
|
data: allTableData.value.map((item) => item[dataType.value]),
|
|
data: allTableData.value.map((item) => item[dataType.value]),
|
|
markLine: {
|
|
markLine: {
|
|
- data: averageDatas.value.map((item: any) => {
|
|
|
|
- return {
|
|
|
|
- name:
|
|
|
|
- item.markingGroupNumber == 0
|
|
|
|
- ? '总体' + dataTypeLabelMap[dataType.value]
|
|
|
|
- : `小组${item.markingGroupNumber}` + dataTypeLabelMap[dataType.value],
|
|
|
|
- yAxis: item[dataType.value === 'markingCount' ? 'avgMarkingCount' : dataType.value],
|
|
|
|
|
|
+ data: [
|
|
|
|
+ {
|
|
|
|
+ name: '总体' + dataTypeLabelMap[dataType.value],
|
|
|
|
+ yAxis: averageDatas.value.find((item: any) => {
|
|
|
|
+ return item.markingGroupNumber == 0
|
|
|
|
+ })?.[dataType.value === 'markingCount' ? 'avgMarkingCount' : dataType.value],
|
|
label: {
|
|
label: {
|
|
show: true,
|
|
show: true,
|
|
position: 'end',
|
|
position: 'end',
|
|
},
|
|
},
|
|
lineStyle: {
|
|
lineStyle: {
|
|
- color: item.markingGroupNumber == 0 ? 'red' : 'auto',
|
|
|
|
|
|
+ color: 'red',
|
|
|
|
+ width: 3,
|
|
|
|
+ type: 'solid',
|
|
},
|
|
},
|
|
- }
|
|
|
|
- }),
|
|
|
|
|
|
+ },
|
|
|
|
+ ...filterAverageDatas.value.map((item: any, index: number) => {
|
|
|
|
+ return {
|
|
|
|
+ name: `小组${item.markingGroupNumber}` + dataTypeLabelMap[dataType.value],
|
|
|
|
+ // name:
|
|
|
|
+ // item.markingGroupNumber == 0
|
|
|
|
+ // ? '总体' + dataTypeLabelMap[dataType.value]
|
|
|
|
+ // : `小组${item.markingGroupNumber}` + dataTypeLabelMap[dataType.value],
|
|
|
|
+ yAxis: item[dataType.value === 'markingCount' ? 'avgMarkingCount' : dataType.value],
|
|
|
|
+ label: {
|
|
|
|
+ show: true,
|
|
|
|
+ position: 'end',
|
|
|
|
+ },
|
|
|
|
+ lineStyle: {
|
|
|
|
+ color: myColorList[index],
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }),
|
|
|
|
+ ],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
],
|
|
],
|
|
@@ -279,9 +338,33 @@ onOptionInit(onSearch)
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
.personnel-compare-view {
|
|
.personnel-compare-view {
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
|
+ .out-chart-box {
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
// .out-chart-box {
|
|
// .out-chart-box {
|
|
// height: 300px;
|
|
// height: 300px;
|
|
// }
|
|
// }
|
|
|
|
+ .row-chart {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ height: 300px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ z-index: 101;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ .close-icon {
|
|
|
|
+ position: absolute;
|
|
|
|
+ right: 20px;
|
|
|
|
+ top: 10px;
|
|
|
|
+ z-index: 1;
|
|
|
|
+ font-size: 26px;
|
|
|
|
+ color: #666;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ &:hover {
|
|
|
|
+ color: $color--primary;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
.chart-box {
|
|
.chart-box {
|
|
height: 300px;
|
|
height: 300px;
|
|
position: relative;
|
|
position: relative;
|