|
19 | 19 | </el-select> |
20 | 20 | <el-select |
21 | 21 | v-if="filter_type === 'state'" |
22 | | - v-model="query.status" |
23 | | - @change="getList" |
| 22 | + v-model="query.state" |
| 23 | + @change="getList(true)" |
24 | 24 | style="width: 220px" |
25 | 25 | clearable |
26 | 26 | > |
|
31 | 31 | <el-input |
32 | 32 | v-else |
33 | 33 | v-model="query.user_name" |
34 | | - @change="getList" |
| 34 | + @change="getList(true)" |
35 | 35 | :placeholder="$t('common.search')" |
36 | 36 | prefix-icon="Search" |
37 | 37 | style="width: 220px" |
@@ -133,7 +133,7 @@ const paginationConfig = reactive({ |
133 | 133 | }) |
134 | 134 | const query = ref<any>({ |
135 | 135 | user_name: '', |
136 | | - status: '', |
| 136 | + state: '', |
137 | 137 | }) |
138 | 138 | const loading = ref(false) |
139 | 139 | const filter_type = ref<string>('user_name') |
@@ -165,38 +165,22 @@ const changePage = () => { |
165 | 165 | getList() |
166 | 166 | } |
167 | 167 |
|
168 | | -const getList = () => { |
| 168 | +const getList = (clear?: boolean) => { |
| 169 | + if (clear) { |
| 170 | + paginationConfig.current_page = 1 |
| 171 | + } |
169 | 172 | return loadSharedApi({ type: 'knowledge', systemType: apiType.value }) |
170 | 173 | .getWorkflowActionPage(active_knowledge_id.value, paginationConfig, query.value, loading) |
171 | 174 | .then((ok: any) => { |
172 | 175 | 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 | + } |
174 | 181 | }) |
175 | 182 | } |
176 | 183 |
|
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 | | -} |
200 | 184 | const pre_disable = computed(() => { |
201 | 185 | const index = tableIndexMap.value[currentId.value] - 1 |
202 | 186 | return index < 0 |
|
0 commit comments