Эх сурвалжийг харах

feat<报表>:选择器-国家“欧洲+英国”加上葡萄牙;保持选中列;调整表格高度

xinyan 6 сар өмнө
parent
commit
71eba1bf30

+ 1 - 1
src/views/reportManage/dataCenter/combinedDisplay/components/tableData/mainData.vue

@@ -43,7 +43,7 @@ const totalSales = ref(null);
 
 const gridOptions = reactive({
   border: 'inner',
-  height: 900,
+  height: 800,
   align: null,
   round: true,
   loading: false,

+ 1 - 1
src/views/reportManage/dataCenter/combinedDisplay/components/tableData/monthlyComparativeData.vue

@@ -26,7 +26,7 @@ const monthEndDate = ref(null);
 
 const gridOptions = reactive({
   border: 'inner',
-  height: 900,
+  height: 800,
   align: null,
   round: true,
   loading: false,

+ 1 - 1
src/views/reportManage/dataCenter/combinedDisplay/components/tableData/planInfo.vue

@@ -22,7 +22,7 @@ const taskIds = ref({});
 const gridOptions = reactive({
   border: 'inner',
   // showOverflow: true,
-  height: 750,
+  height: 800,
   loading: false,
   round: true,
   editConfig: {

+ 1 - 1
src/views/reportManage/dataCenter/normalDisplay/components/Selector/index.vue

@@ -144,7 +144,7 @@ const selectCommonGroup1 = () => {
 
 // 快捷选择欧洲+英国国家
 const selectCommonGroup2 = () => {
-  countryList.value = ['比利时', '德国', '法国', '荷兰', '西班牙', '意大利', '英国', '波兰'];
+  countryList.value = ['比利时', '德国', '法国', '荷兰', '西班牙', '意大利', '英国', '波兰','葡萄牙'];
   emitChange(); // 更新选择后的数据
 };
 

+ 20 - 5
src/views/reportManage/dataCenter/normalDisplay/components/TableDataDisplay.vue

@@ -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>