|
@@ -22,7 +22,7 @@
|
|
|
size="small"
|
|
|
:columns="columns"
|
|
|
:data="allTableData"
|
|
|
- :height="'500px'"
|
|
|
+ :height="'calc(100vh - 520px)'"
|
|
|
highlight-current-row
|
|
|
>
|
|
|
</base-table>
|
|
@@ -34,16 +34,29 @@
|
|
|
size="small"
|
|
|
:columns="columns2"
|
|
|
:data="allTableData"
|
|
|
- :height="'500px'"
|
|
|
+ :height="'calc(100vh - 520px)'"
|
|
|
highlight-current-row
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
</base-table>
|
|
|
</div>
|
|
|
<div v-if="allTableData.length" class="m-t-small out-chart-box">
|
|
|
<div v-if="dataType !== 'segmentScores'" class="chart-box">
|
|
|
<vue-e-charts class="full" :option="lineChartOptions"></vue-e-charts>
|
|
|
+ <div class="right-box">
|
|
|
+ <div class="legend-item">
|
|
|
+ <div class="color" style="background-color: red"></div>
|
|
|
+ <div class="label">总体{{ dataTypeLabelMap[dataType] }}</div>
|
|
|
+ </div>
|
|
|
+ <div v-for="(item, index) in filterAverageDatas" :key="index" class="legend-item">
|
|
|
+ <div class="color" :style="{ backgroundColor: myColorList[index] }"></div>
|
|
|
+ <div class="label">
|
|
|
+ {{ `小组${item.markingGroupNumber}` + dataTypeLabelMap[dataType] }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div v-else class="chart-box">
|
|
|
+ <div v-else-if="multipleSelection.length" class="chart-box">
|
|
|
<vue-e-charts class="full" :option="multLineChartOptions"></vue-e-charts>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -58,6 +71,7 @@ import BaseTable from '@/components/element/BaseTable.vue'
|
|
|
import { ElButton, ElRadioButton, ElRadioGroup } from 'element-plus'
|
|
|
import useCompareFilter from './hooks/useCompareFilter'
|
|
|
import VueECharts from 'vue-echarts'
|
|
|
+import { myColorList } from '@/utils/common'
|
|
|
|
|
|
const dataType = ref('avg')
|
|
|
const dataTypeValues = ['avg', 'std', 'segmentScores', 'markingCount', 'xyRelate']
|
|
@@ -88,6 +102,11 @@ const averageDatas = computed(() => {
|
|
|
return []
|
|
|
}
|
|
|
})
|
|
|
+const filterAverageDatas = computed(() => {
|
|
|
+ return averageDatas.value.filter((item: any) => {
|
|
|
+ return item.markingGroupNumber != 0
|
|
|
+ })
|
|
|
+})
|
|
|
const allTableData = computed(() => {
|
|
|
if (result.value) {
|
|
|
let arr = []
|
|
@@ -111,6 +130,14 @@ const columns = computed(() => {
|
|
|
return [
|
|
|
{ label: '账号', prop: 'loginName', align: 'center', minWidth: 120, fixed: 'left' },
|
|
|
{ label: '姓名', prop: 'markerName', align: 'center', minWidth: 120, fixed: 'left' },
|
|
|
+ {
|
|
|
+ label: dataTypeLabelMap[dataType.value],
|
|
|
+ align: 'center',
|
|
|
+ minWidth: 80,
|
|
|
+ formatter(row: any) {
|
|
|
+ return row[dataType.value]
|
|
|
+ },
|
|
|
+ },
|
|
|
...(result.value || { columns: [] }).columns.map((d: any) => {
|
|
|
return {
|
|
|
label: d,
|
|
@@ -131,6 +158,7 @@ const columns = computed(() => {
|
|
|
})
|
|
|
const columns2: any = computed(() => {
|
|
|
let initColumns = [
|
|
|
+ { type: 'selection', width: 55 },
|
|
|
{ label: '账号', prop: 'loginName', align: 'center', minWidth: 120, fixed: 'left' },
|
|
|
{ label: '姓名', prop: 'markerName', align: 'center', minWidth: 120, fixed: 'left' },
|
|
|
]
|
|
@@ -153,30 +181,31 @@ const columns2: any = computed(() => {
|
|
|
}
|
|
|
return initColumns
|
|
|
})
|
|
|
+const multipleSelection = ref<any[]>([])
|
|
|
+const handleSelectionChange = (val: any[]) => {
|
|
|
+ multipleSelection.value = val
|
|
|
+ console.log('multipleSelection.value:', multipleSelection.value)
|
|
|
+}
|
|
|
+
|
|
|
const lineChartOptions = computed(() => {
|
|
|
let xData = allTableData.value.map((item) => item.loginName)
|
|
|
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 },
|
|
|
- axisLabel: {
|
|
|
- align: 'right',
|
|
|
- },
|
|
|
data: xData,
|
|
|
},
|
|
|
- yAxis: [
|
|
|
- {
|
|
|
- type: 'value',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'value',
|
|
|
- // axisLabel: {
|
|
|
- // formatter: `{value}%`,
|
|
|
- // },
|
|
|
- splitLine: { show: false },
|
|
|
- },
|
|
|
- ],
|
|
|
+ yAxis: {
|
|
|
+ type: 'value',
|
|
|
+ },
|
|
|
series: [
|
|
|
{
|
|
|
name: dataTypeLabelMap[dataType.value],
|
|
@@ -189,8 +218,18 @@ const lineChartOptions = computed(() => {
|
|
|
markLine: {
|
|
|
data: averageDatas.value.map((item: any) => {
|
|
|
return {
|
|
|
- name: item.markingGroupNumber == 0 ? '总体平均分' : `小组${item.markingGroupNumber}平均分`,
|
|
|
+ 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: item.markingGroupNumber == 0 ? 'red' : 'auto',
|
|
|
+ },
|
|
|
}
|
|
|
}),
|
|
|
},
|
|
@@ -200,29 +239,27 @@ const lineChartOptions = computed(() => {
|
|
|
})
|
|
|
const multLineChartOptions = computed(() => {
|
|
|
return {
|
|
|
+ grid: {
|
|
|
+ left: 60,
|
|
|
+ right: 60,
|
|
|
+ bottom: 40,
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
xAxis: {
|
|
|
axisLine: { show: false },
|
|
|
axisTick: { show: false },
|
|
|
splitLine: { show: false },
|
|
|
- axisLabel: {
|
|
|
- align: 'right',
|
|
|
- },
|
|
|
- data: multLineXdatas,
|
|
|
+ data: multLineXdatas.value,
|
|
|
},
|
|
|
- yAxis: [
|
|
|
- {
|
|
|
- type: 'value',
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'value',
|
|
|
- splitLine: { show: false },
|
|
|
- },
|
|
|
- ],
|
|
|
- series: allTableData.value.map((item: any) => {
|
|
|
+ yAxis: {
|
|
|
+ type: 'value',
|
|
|
+ },
|
|
|
+ series: multipleSelection.value.map((item: any) => {
|
|
|
return {
|
|
|
name: item.loginName,
|
|
|
type: 'line',
|
|
|
- barWidth: 20,
|
|
|
// itemStyle: {
|
|
|
// color: '#3AD500',
|
|
|
// },
|
|
@@ -242,11 +279,38 @@ onOptionInit(onSearch)
|
|
|
<style scoped lang="scss">
|
|
|
.personnel-compare-view {
|
|
|
background-color: #fff;
|
|
|
- .out-chart-box {
|
|
|
- height: 300px;
|
|
|
- }
|
|
|
+ // .out-chart-box {
|
|
|
+ // height: 300px;
|
|
|
+ // }
|
|
|
.chart-box {
|
|
|
height: 300px;
|
|
|
+ position: relative;
|
|
|
+ .right-box {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 180px;
|
|
|
+ height: 100%;
|
|
|
+ z-index: 100;
|
|
|
+ overflow: auto;
|
|
|
+ .legend-item {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ align-items: flex-start;
|
|
|
+ font-size: 12px;
|
|
|
+ .color {
|
|
|
+ width: 12px;
|
|
|
+ height: 12px;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin-top: 2px;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ .label {
|
|
|
+ flex: 1;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|