|
@@ -15,6 +15,7 @@ import {
|
|
|
import { dayDataColumns, monthDataColumns, weekDataColumns } from '../../utils/columns';
|
|
|
import dayjs from 'dayjs';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
+import { VxeGridInstance } from 'vxe-table';
|
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
@@ -47,10 +48,13 @@ const salesOrder = ref(null);
|
|
|
const salesField = ref(null);
|
|
|
const sortStatus = ref(true);
|
|
|
|
|
|
+const xGrid = ref<VxeGridInstance>();
|
|
|
+const highlightedColumn = ref(null);
|
|
|
+
|
|
|
const gridOptions = reactive({
|
|
|
border: 'inner',
|
|
|
keepSource: true,
|
|
|
- height: 900,
|
|
|
+ height: 800,
|
|
|
align: null,
|
|
|
round: true,
|
|
|
loading: false,
|
|
@@ -62,6 +66,7 @@ const gridOptions = reactive({
|
|
|
},
|
|
|
columnConfig: {
|
|
|
isCurrent: true,
|
|
|
+ isHover: true,
|
|
|
resizable: true,
|
|
|
},
|
|
|
rowConfig: {
|
|
@@ -292,6 +297,10 @@ async function fetchCurrentData(taskIds, resetPage = false) {
|
|
|
} else if (dateType.value === 'month') {
|
|
|
await fetchMonthData(taskIds);
|
|
|
}
|
|
|
+ if (highlightedColumn.value) {
|
|
|
+ const $grid = xGrid.value;
|
|
|
+ await $grid.setCurrentColumn(highlightedColumn.value); // 设置当前高亮列
|
|
|
+ }
|
|
|
gridOptions.loading = false;
|
|
|
}
|
|
|
|
|
@@ -477,6 +486,11 @@ watch([() => props.taskIds, currentDate], async ([newTaskIds, newCurrentDate]) =
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+function handelIsCurrent({column}) {
|
|
|
+ highlightedColumn.value= column.field;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
//loadSortState();
|
|
|
});
|
|
@@ -484,13 +498,14 @@ onMounted(() => {
|
|
|
|
|
|
<template>
|
|
|
<div>
|
|
|
- <vxe-grid :cell-style="cellStyle" :header-cell-style="headerCellStyle" :row-style="rowStyle"
|
|
|
+ <vxe-grid ref="xGrid" :cell-style="cellStyle" :header-cell-style="headerCellStyle" :row-style="rowStyle"
|
|
|
stripe
|
|
|
- v-bind="currentGridOptions" v-on="gridEvents" @sort-change="handleSortChange">
|
|
|
+ v-bind="currentGridOptions" v-on="gridEvents" @sort-change="handleSortChange"
|
|
|
+ @header-cell-click="handelIsCurrent">
|
|
|
<template #toolbar_buttons>
|
|
|
<el-button icon="plus" target="_blank" type="primary" @click="handleImport">数据录入</el-button>
|
|
|
- <el-button v-if="dateType === 'month'" text bg
|
|
|
- icon="plus" target="_blank"
|
|
|
+ <el-button v-if="dateType === 'month'" bg icon="plus"
|
|
|
+ target="_blank" text
|
|
|
@click="handelPlanSales">
|
|
|
计划销售额
|
|
|
</el-button>
|