🐛 Fixing a bug.#5248 【菜单搜索】搜索结果被追加至表格树种显示不正确

This commit is contained in:
lbw 2023-10-18 15:03:23 +08:00
parent b9b2fc8955
commit 6a6271d284

View File

@ -7,9 +7,10 @@
<el-input :placeholder="$t('sysmenu.inputNameTip')" clearable style="max-width: 180px" v-model="state.queryForm.menuName" />
</el-form-item>
<el-form-item>
<el-button @click="getDataList" class="ml10" icon="search" type="primary">
<el-button @click="query" class="ml10" icon="search" type="primary">
{{ $t('common.queryBtn') }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
</el-form-item>
</el-form>
</el-row>
@ -102,6 +103,7 @@ const { t } = useI18n();
//
const tableRef = ref();
const menuDialogRef = ref();
const queryRef = ref();
const showSearch = ref(true);
const isExpand = ref(false);
const state: BasicTableProps = reactive<BasicTableProps>({
@ -144,6 +146,19 @@ const toggleExpand = (children: any[], unfold = true) => {
}
};
//
const query = () => {
state.dataList = [];
getDataList();
};
//
const resetQuery = () => {
queryRef.value.resetFields();
state.dataList = [];
getDataList();
};
//
const handleDelete = async (row: any) => {
try {