From 110528b9617f7f1b27be2111fd3f1cfab4249ab1 Mon Sep 17 00:00:00 2001 From: wdz <1573797922@qq.com> Date: Tue, 29 Nov 2022 15:17:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Ema-form=20rank=20=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=20=E4=BB=A5=E4=BE=BF=E8=AE=A9=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E4=B8=8E=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E7=9A=84?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E9=9A=8F=E6=84=8F=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ma-crud/index.vue | 36 +++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/src/components/ma-crud/index.vue b/src/components/ma-crud/index.vue index f1fe832..1b44913 100644 --- a/src/components/ma-crud/index.vue +++ b/src/components/ma-crud/index.vue @@ -151,7 +151,7 @@ { return sls } -slots.value = getSlot(settingProps.columns) -searchSlots.value = getSearchSlot(settingProps.columns) +slots.value = getSlot() +searchSlots.value = getSearchSlot() const requestData = async () => { defaultCrud.value = Object.assign(defaultCrud.value, settingProps.crud) @@ -513,10 +514,35 @@ const requestData = async () => { columns.value.push({ title: defaultCrud.value.operationColumnText, dataIndex: '__operation', width: defaultCrud.value.operationWidth, align: 'right', fixed: 'right' }) } showSearch.value = !defaultCrud.value.expandSearch + + //深度克隆 + listColumns = cloneDeep(columns) + //列表字段排序 + await bubleSort(listColumns.value) initRequestParams() await refresh() } +//列表字段排序 +const bubleSort = (arr) => { + const len = arr.length; + let data = '' + for (let k=0;karr[i+1]['rank']){ + data = arr[k] + arr[k] = arr[i+1] + arr[i+1] = data + + } + } + } + return arr +} + + const initRequestParams = () => { requestParams.value[config.request.page] = 1 requestParams.value[config.request.pageSize] = config.pageSize @@ -660,7 +686,7 @@ const dbClickOpenEdit = (record) => { editAction(record) } } - + } } -- Gitee