From e128d46a425ddefba70df942a0b372ada2a97a85 Mon Sep 17 00:00:00 2001 From: chuzhongzai Date: Wed, 1 Mar 2023 21:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=90=8E=E7=9A=84=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=8C=E7=B2=BE=E7=AE=80=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?(=E5=90=8C=E6=AD=A5=E6=9B=B4=E6=96=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 43973ba..e705806 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -663,14 +663,14 @@ const mutations = { _setCategory(state, category){ state.category = category confirmCurrentTask(state) + sortTasks(state) }, _setShowType(state, showType){ state.showType = showType confirmCurrentTask(state) - if(showType === 'video' && state.sortType === "shortName") { + if(showType === 'video' && state.sortType === "shortName") state.sortType = 'name' - sortTasks(state) - } + sortTasks(state) }, _setSortType(state, sortType){ state.sortType = sortType @@ -853,9 +853,6 @@ function confirmCurrentTask(state){ function sortTasks(state){ switch (state.sortType) { case "name": - state.currentTasks = state.currentTasks.sort((before, after) => { - return before.name > after.name ? 1: -1 - }) state.currentTasks = state.currentTasks.sort((before, after) => { return before.name > after.name ? 1: -1 }) @@ -869,9 +866,6 @@ function sortTasks(state){ state.currentTasks = state.currentTasks.sort((before, after) => { return before.createTime - after.createTime }) - state.currentTasks = state.currentTasks.sort((before, after) => { - return before.createTime - after.createTime - }) } }