From 5cbf0986abdec78fe448df5df60f2dbe93dcf8f9 Mon Sep 17 00:00:00 2001 From: wdz <1573797922@qq.com> Date: Tue, 29 Nov 2022 15:21:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9Ema-curd=20rank=20?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=20=E4=BB=A5=E4=BE=BF=E8=AE=A9=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=A1=B5=E4=B8=8E=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=9A=84=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 From 6c8e562a67f39d027b92268b41b2a1eb108a0fc6 Mon Sep 17 00:00:00 2001 From: wdz <1573797922@qq.com> Date: Wed, 30 Nov 2022 15:37:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E5=BA=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ma-crud/index.vue | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/ma-crud/index.vue b/src/components/ma-crud/index.vue index 1b44913..0e119c6 100644 --- a/src/components/ma-crud/index.vue +++ b/src/components/ma-crud/index.vue @@ -225,7 +225,7 @@