|
@@ -13,7 +13,19 @@
|
|
|
<EmptyToRecord title="传习所" :loader="worksData" :showEdited="false" :showAdd="false">
|
|
|
<div class="d-flex justify-content-between p-2">
|
|
|
<a-button @click="router.back" :icon="h(ArrowLeftOutlined)">返回</a-button>
|
|
|
- <a-button type="primary" @click="handleNewSeminar">+ 新增</a-button>
|
|
|
+ <div class="d-flex flex-row">
|
|
|
+ <SimpleInput v-model="searchText" placeholder="请输入关键词" @search="handleSearch">
|
|
|
+ <template #suffix>
|
|
|
+ <IconSearch
|
|
|
+ class="search-icon"
|
|
|
+ src="@/assets/images/news/IconSearch.png"
|
|
|
+ alt="搜索"
|
|
|
+ @click="handleSearch"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </SimpleInput>
|
|
|
+ <a-button type="primary" @click="handleNewSeminar">+ 新增</a-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<a-list class="light-round" item-layout="horizontal" :data-source="worksData?.content.value || []">
|
|
|
<template #renderItem="{ item }">
|
|
@@ -44,14 +56,18 @@ import { useSimpleDataLoader } from '@/composeable/SimpleDataLoader';
|
|
|
import EmptyToRecord from '@/components/parts/EmptyToRecord.vue';
|
|
|
import InheritorContent, { InheritorWorkInfo } from '@/api/inheritor/InheritorContent';
|
|
|
import { ArrowLeftOutlined } from '@ant-design/icons-vue';
|
|
|
-import { h } from 'vue';
|
|
|
+import { h, ref } from 'vue';
|
|
|
+import SimpleInput from '@/components/controls/SimpleInput.vue';
|
|
|
+import IconSearch from '@/components/icons/IconSearch.vue';
|
|
|
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
+const searchText = ref('');
|
|
|
|
|
|
const worksData = useSimpleDataLoader(async () => {
|
|
|
const ichId = route.query.ichId ? parseFloat(route.query.ichId as string) : undefined;
|
|
|
return (await InheritorContent.getIchSeminarInfo({
|
|
|
+ keywords: searchText.value,
|
|
|
ichId: ichId!,
|
|
|
page: 1,
|
|
|
pageSize: 100,
|
|
@@ -61,6 +77,7 @@ const worksData = useSimpleDataLoader(async () => {
|
|
|
function handleNewSeminar() {
|
|
|
router.push({ name: 'FormSeminar', query: {
|
|
|
ichId: route.query.ichId,
|
|
|
+ id: -1,
|
|
|
} })
|
|
|
}
|
|
|
|
|
@@ -71,4 +88,9 @@ function handleGoSeminar(item: InheritorWorkInfo) {
|
|
|
} })
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+function handleSearch() {
|
|
|
+ worksData.loadData(undefined, true);
|
|
|
+}
|
|
|
+
|
|
|
</script>
|