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