From 386fb026b550ee617fdd3bcb47981e44548bbae6 Mon Sep 17 00:00:00 2001 From: mll Date: Tue, 17 Mar 2026 15:43:52 +0800 Subject: [PATCH] =?UTF-8?q?isHideCol=E9=9A=90=E8=97=8F=E5=88=97=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BF=AE=E6=94=B9=20=E5=8E=BB=E6=8E=89=E5=AD=90?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=92=8C=E5=AD=97=E6=AE=B5=E5=88=86=E7=BB=84?= =?UTF-8?q?=20=E6=A0=B9=E6=8D=AE=E5=AD=97=E5=85=B8cssClass=E7=9A=84?= =?UTF-8?q?=E5=80=BC=E8=AE=BE=E7=BD=AE=E6=95=B4=E8=A1=8C=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LowDesign/src/LowReport/index.vue | 26 ++++++++++++++----- .../lowdesign/reportDesign/designData.ts | 4 +-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/LowDesign/src/LowReport/index.vue b/src/components/LowDesign/src/LowReport/index.vue index 581d9ce..d42e8ef 100644 --- a/src/components/LowDesign/src/LowReport/index.vue +++ b/src/components/LowDesign/src/LowReport/index.vue @@ -13,6 +13,7 @@ :option="tableOption" v-bind="crudBind" :summary-method=summaryMethod1 + :row-style="rowStyleMethod" @search-change="searchChange" @search-reset="resetChange" @refresh-change="refreshChange" @@ -154,6 +155,8 @@ const dimensionFields=ref({}) const exportLoading = ref(false) const fieldList = ref([]) // 添加fieldList引用 const hideFeilds= ref({}) +const hideCols=ref([]) +const dictFieldList=ref([]) const permissions = wsCache.get(CACHE_KEY.USER).lideeYunjipermissions?.[route.meta.menuDataId as string] || false const selectIds = computed(() => { @@ -222,6 +225,15 @@ const summaryMethod1=({columns,data})=>{ }) return result; } + const rowStyleMethod=({row,rowIndex})=>{ + let styleObj={} + dictFieldList.value.forEach(item=>{ + if(row[item.prop]){ + styleObj['color']=item.dicData.find(d=>d.value===row[item.prop]).cssClass + } + }) + return styleObj + } function getCurrentDate() { const now = new Date(); // 补零函数:小于10则前面加0 @@ -279,6 +291,7 @@ const initTable = async () => { const fixedFields = apiFieldList.filter(f => f.isFixedColumn === 'Y') const dynamicFields = apiFieldList.filter(f => f.isFixedColumn !== 'Y') + // 处理固定列 fixedFields.forEach((item) => { const config: any = { @@ -381,6 +394,7 @@ const initTable = async () => { config.dicData=dictData config.searchType= 'select' config.dataType= 'string' + dictFieldList.value.push(config) } const moreIn="MORE_IN".includes(item.queryMode) config.searchType=moreIn?'select':config.searchType @@ -398,9 +412,9 @@ const initTable = async () => { dimensionFields.value[config.prop]=config hideFeilds.value[config.prop]=item.isHideDimension } - if(item.isHideCol == 'Y') { + if(item.isHideCol == 'Y') {hideCols.value.push(config.prop) config.hide = true - hideColumns.value.push( config.prop ) + hideColumns.value.push(config.prop) } if (item.queryMode == 'RANGE') config.searchRange = true if (item.queryMode == 'LIKE') config.multiple = config.collapseTags=true @@ -532,7 +546,6 @@ const getTableData = async (isLoading = true) => { { "yuefen": "五月", "benyue": 333, "leiji": 444 }, { "yuefen": "六月", "benyue": 555, "leiji": 555 }, { "yuefen": "六月", "benyue": 666, "leiji": 666 }, - ], total: 6 } @@ -672,11 +685,10 @@ const getTableData = async (isLoading = true) => { tableData.value = processedData Object.values(tableOption.value.column).forEach( item=>{ - item.hide=item.children?.every(child=>tableData.value[0]&&(tableData.value[0][child.prop]===undefined)) + let oldHide=hideCols.value.indexOf(item.prop)!==-1 + item.hide=item.children?.every(child=>tableData.value[0]&&(tableData.value[0][child.prop]===undefined))||oldHide const prH=hideColumns.value.indexOf(item.prop) - item.hide?(prH===-1?hideColumns.value.push(item.prop):''):(prH!==-1?hideColumns.value.splice(prH,1):'') - - + item.hide?(prH===-1?hideColumns.value.push(item.prop):''):(prH!==-1&&hideCols.value.indexOf(item.prop)===-1?hideColumns.value.splice(prH,1):'') }) diff --git a/src/views/lowdesign/reportDesign/designData.ts b/src/views/lowdesign/reportDesign/designData.ts index 39e4349..316e9e7 100644 --- a/src/views/lowdesign/reportDesign/designData.ts +++ b/src/views/lowdesign/reportDesign/designData.ts @@ -170,8 +170,8 @@ const infoColumn = { isHideDimension: { title: '维度隐藏列', width: 180, editRender: { name: 'LowSelectMultiple', verifyEdit: true, filterable: true, multiple:true,dicData: [] } }, isShowSort: { title: '是否排序', width: 75, align: "center", editRender: { name: 'LowCheckbox' } }, - isDynamicGroup: { title: '动态分组', width: 75, align: "center", editRender: { name: 'LowCheckbox' } }, - hasChildren: { title: '子字段', width: 90, align: "center", editRender: { name: 'LowButton', disabled: (row) => row.isSubField === true, buttonText: '添加子字段', buttonType: 'primary', buttonSize: 'small' } }, + //isDynamicGroup: { title: '动态分组', width: 75, align: "center", editRender: { name: 'LowCheckbox' } }, + //hasChildren: { title: '子字段', width: 90, align: "center", editRender: { name: 'LowButton', disabled: (row) => row.isSubField === true, buttonText: '添加子字段', buttonType: 'primary', buttonSize: 'small' } }, }, }