fix: 保留工作流列表返回状态
- 记录页码、分类和搜索条件并同步到路由 - 从工作流设计页返回时恢复原列表位置
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
import { ArrowDown, Search } from '@element-plus/icons-vue';
|
||||
import {
|
||||
@@ -31,6 +31,10 @@ const props = defineProps({
|
||||
type: Number,
|
||||
default: 3,
|
||||
},
|
||||
initialValue: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
searchPlaceholder: {
|
||||
type: String,
|
||||
default: $t('common.searchPlaceholder'),
|
||||
@@ -39,7 +43,14 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['search', 'buttonClick', 'reset']);
|
||||
|
||||
const searchValue = ref('');
|
||||
const searchValue = ref(props.initialValue);
|
||||
|
||||
watch(
|
||||
() => props.initialValue,
|
||||
(value) => {
|
||||
searchValue.value = value;
|
||||
},
|
||||
);
|
||||
|
||||
const filterButtonsByPermission = (buttons) => {
|
||||
return buttons.filter((button) => {
|
||||
|
||||
Reference in New Issue
Block a user