Skip to content

Commit 0dd1846

Browse files
committed
fix: Workflow Knowledge Base Execution Record Search Result Exception
1 parent ff26835 commit 0dd1846

File tree

2 files changed

+14
-30
lines changed

2 files changed

+14
-30
lines changed

apps/knowledge/views/knowledge_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class Page(APIView):
139139
def get(self, request: Request, workspace_id: str, knowledge_id: str, current_page: int, page_size: int):
140140
return result.success(
141141
KnowledgeWorkflowActionSerializer(data={'workspace_id': workspace_id, 'knowledge_id': knowledge_id})
142-
.page(current_page, page_size, request.data))
142+
.page(current_page, page_size, request.query_params))
143143

144144
class Operate(APIView):
145145
authentication_classes = [TokenAuth]

ui/src/views/knowledge-workflow/component/execution-record/ExecutionRecordDrawer.vue

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
</el-select>
2020
<el-select
2121
v-if="filter_type === 'state'"
22-
v-model="query.status"
23-
@change="getList"
22+
v-model="query.state"
23+
@change="getList(true)"
2424
style="width: 220px"
2525
clearable
2626
>
@@ -31,7 +31,7 @@
3131
<el-input
3232
v-else
3333
v-model="query.user_name"
34-
@change="getList"
34+
@change="getList(true)"
3535
:placeholder="$t('common.search')"
3636
prefix-icon="Search"
3737
style="width: 220px"
@@ -133,7 +133,7 @@ const paginationConfig = reactive({
133133
})
134134
const query = ref<any>({
135135
user_name: '',
136-
status: '',
136+
state: '',
137137
})
138138
const loading = ref(false)
139139
const filter_type = ref<string>('user_name')
@@ -165,38 +165,22 @@ const changePage = () => {
165165
getList()
166166
}
167167
168-
const getList = () => {
168+
const getList = (clear?: boolean) => {
169+
if (clear) {
170+
paginationConfig.current_page = 1
171+
}
169172
return loadSharedApi({ type: 'knowledge', systemType: apiType.value })
170173
.getWorkflowActionPage(active_knowledge_id.value, paginationConfig, query.value, loading)
171174
.then((ok: any) => {
172175
paginationConfig.total = ok.data?.total
173-
data.value = data.value.concat(ok.data.records)
176+
if (clear) {
177+
data.value = ok.data.records
178+
} else {
179+
data.value = data.value.concat(ok.data.records)
180+
}
174181
})
175182
}
176183
177-
const setRowClass = ({ row }: any) => {
178-
return currentId.value === row?.id ? 'highlight' : ''
179-
}
180-
181-
/**
182-
* 下一页
183-
*/
184-
const nextRecord = () => {
185-
const index = tableIndexMap.value[currentId.value] + 1
186-
if (index >= data.value.length) {
187-
if (index >= paginationConfig.total - 1) {
188-
return
189-
}
190-
paginationConfig.current_page = paginationConfig.current_page + 1
191-
getList().then(() => {
192-
currentId.value = data.value[index].id
193-
currentContent.value = data.value[index]
194-
})
195-
} else {
196-
currentId.value = data.value[index].id
197-
currentContent.value = data.value[index]
198-
}
199-
}
200184
const pre_disable = computed(() => {
201185
const index = tableIndexMap.value[currentId.value] - 1
202186
return index < 0

0 commit comments

Comments
 (0)