From b402cf47d13430644ce6e700063d878e1f6a8334 Mon Sep 17 00:00:00 2001 From: han2015 <1019850453@qq.com> Date: Wed, 4 Feb 2026 15:54:25 +0800 Subject: [PATCH] =?UTF-8?q?form=EF=BC=9A=E6=94=AF=E6=8C=81=E8=A1=A8?= =?UTF-8?q?=E5=A4=B4=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DesignForm/app/index.vue | 48 ++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/components/DesignForm/app/index.vue b/src/components/DesignForm/app/index.vue index e3f3e8c..04be0e6 100644 --- a/src/components/DesignForm/app/index.vue +++ b/src/components/DesignForm/app/index.vue @@ -31,7 +31,7 @@ import { import type { FormInstance, FormRules } from "element-plus"; import { ElLoading, ElMessage, ElNotification } from "element-plus"; import html2canvas from "html2canvas"; -import JSZip, { forEach } from "jszip"; +import JSZip from "jszip"; import { gainFormPageListCont } from "@/api/DesignForm/requestapi"; import { Picture, InfoFilled, QuestionFilled } from "@element-plus/icons-vue"; import request from "@/utils/request"; @@ -991,11 +991,19 @@ let asfQueryParams: any[] = []; @ 功能: 获取数据 */ const getPageData = () => { + + // by han2015: 处理排序字段信息 + let arr:string[]=[]; + columnSortData.forEach((value, key) => { + arr.push(`${key} ${value}`) + }); + let sendData = { formId: props.formId, page: state.currentPage, pagesize: state.pageSize, searchData: json2string(props.searchData), + sortData: arr.join(", "), }; // console.log("获取列表详细信息",sendData) @@ -1025,6 +1033,7 @@ const getPageData = () => { break; default: state.loading = true; + //by han2015, 抽成独立部分,方便其他功能调用 doGainFormPageListCont(sendData) .then((datas) => { @@ -1618,6 +1627,32 @@ const lookPageInfoIsShow = ref(false); const asflookPageInfoIsShow = ref(false); const pageInfoCont = ref(); +//------------------ by han2015: 支持表单排序功能---------------------- +const columnSortData = new Map(); +const setHeaderClass=(params:any)=>{ + if(columnSortData.has(params.column.property)){ + if(columnSortData.get(params.column.property)=="DESC"){ + params.column.order="descending" + return + }else{ + params.column.order="ascending" + return + } + } +} +// by han2015: 列表支持表头排序 +const onUpdateSort = (data: { prop: string; order: "ascending" | "descending" | null }) => { + if (data.order === "descending") { + columnSortData.set(data.prop, "DESC"); + } else if (data.order === "ascending") { + columnSortData.set(data.prop, "ASC"); + } else { + columnSortData.delete(data.prop); + } + getPageData() +} + + const lookPageInfo = (val: any) => { tablePageClass.value = 4; pageInfoCont.value = val; @@ -2154,13 +2189,15 @@ const isObject = (obj: any) => { - + +++++++++++++++++++++ @@ -2193,12 +2230,14 @@ const isObject = (obj: any) => { {{ writeListTitle(scope.row, viewPage.list) }} + - + { config="" min-width="220" header-align="center" + sortable="custom" align="center" >