Skip to content

Commit 9a57a67

Browse files
z275748353张龙彬LP-J
authored
Csghub wl jlp (#1462)
* add dataflow * add dataflow * remove antv/x6/lib/registry package * Fix bugs * Fix bugs * add package * add package * add zhHantOps * 1.Adjust the image path for operator management 2.Add permission judgment on whether to display the menu in operator management * Operator Management: Modification of dataflow/operator/ interface * 1.Add the cancellation of execution for internationalization and status verification 2.If a user has no organization or no authorized operators, all public operators will be queried by default * 1.Add the cancellation of execution for internationalization and status verification 2.If a user has no organization or no authorized operators, all public operators will be queried by default * 1.Add the cancellation of execution for internationalization and status verification 2.If a user has no organization or no authorized operators, all public operators will be queried by default * Add newly developed operators, internationalize tools, and supplement the internationalization of statistics. * Add newly developed operators, internationalize tools, and supplement the internationalization of statistics. * 1.Add template deletion function 2.Celery node deletion (admin only, offline status) 3.Block the option of creating tool operators, set tools as default 4.Internationalization update * Fix the bug of dataflow with ID #36 * Fix the bug of dataflow with ID OpenCSGs/csghub-dataflow#31 * Fix the bug of dataflow with ID OpenCSGs/csghub-dataflow#43 * Fix the bug of dataflow with ID OpenCSGs/csghub-dataflow#34 * 1.Fixed the issue where modifying the custom template operator name does not take effect, and added an internationalized name subtitle. 1.Added internationalization to the description of the keyword filtering operator. * 1.Add horizontal and vertical alignment guides for operator task flow filling. 2.Select PDF for format conversion and add the Mineru Backend field. 3.Add model selection and corresponding internationalization to the MD-to-JSONL tool. 4.Implement internationalization for the existing auxiliary reminder words in operator configuration. * 1. When dealing with operator overlap, there may be duplicate connection issues 2. Add internationalization to the generate_code_qa_cir_mapper configuration item * Problem handling of model path display * 1.Add a field for "whether to generate a meta file" and corresponding internationalization support in format conversion. 2.Add a model selection list component. * Operator task list 'execution' status issue * 1. Add scheduled tasks to the data processing list 2. Generate Meta file with default false --------- Co-authored-by: 张龙彬 <bin@sxcfx.cn> Co-authored-by: Jilp <1140016490@qq.com>
1 parent 085f284 commit 9a57a67

File tree

2 files changed

+64
-3
lines changed

2 files changed

+64
-3
lines changed

frontend/src/components/dataflow_config/dataAcquisition/formatConversion/newFormatConversion.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ const formLoading = ref(false);
298298
const userStore = useUserStore();
299299
// 表单
300300
const form = ref({
301-
skip_meta: true,
301+
skip_meta: false,
302302
// from_format_types: null,
303303
// to_data_type: null,
304304
});

frontend/src/components/dataflow_config/dataflow/index.vue

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,17 @@
211211
</template>
212212

213213
<script setup>
214-
import { useRouter } from "vue-router";
215-
import { ref, onMounted } from "vue";
214+
import { useRouter, useRoute } from "vue-router";
215+
import { ref, onMounted, onBeforeUnmount, watch } from "vue";
216216
import { ElMessage } from "element-plus";
217217
import useFetchApi from "../../../packs/useFetchApi";
218218
import { convertUtcToLocalTime } from "../../../packs/datetimeUtils";
219219
import { useI18n } from "vue-i18n";
220220
221221
const { t, locale } = useI18n();
222222
const tableLoading = ref(false);
223+
const refreshTimer = ref(null);
224+
const route = useRoute();
223225
224226
const form = ref({
225227
searchStr: "",
@@ -244,11 +246,15 @@ const pagination = ref({
244246
pageSize: 10,
245247
total: 0,
246248
handleSizeChange: (size) => {
249+
// 切换分页时先停止定时任务
250+
stopRefreshTimer();
247251
pagination.value.pageSize = size;
248252
pagination.value.currentPage = 1; // 切换每页大小时回到第一页
249253
getDataFlowListFun();
250254
},
251255
handleCurrentChange: (page) => {
256+
// 切换分页时先停止定时任务
257+
stopRefreshTimer();
252258
pagination.value.currentPage = page;
253259
getDataFlowListFun();
254260
}
@@ -266,9 +272,51 @@ const getDataFlowListFun = async () => {
266272
pagination.value.total = data.value.total || 0;
267273
}
268274
tableLoading.value = false;
275+
276+
// 数据更新后检查是否需要启动/停止定时任务
277+
checkAndManageTimer();
278+
};
279+
280+
// 检查当前页是否存在 Processing 状态的任务
281+
const hasProcessingTask = () => {
282+
return tableData.value.some(item => item.status === 'Processing');
283+
};
284+
285+
// 启动定时任务
286+
const startRefreshTimer = () => {
287+
// 如果定时器已存在,先清除,避免创建多个定时器
288+
if (refreshTimer.value) {
289+
stopRefreshTimer();
290+
}
291+
292+
// 确保定时器不存在后再创建新的
293+
if (!refreshTimer.value) {
294+
refreshTimer.value = setInterval(() => {
295+
getDataFlowListFun();
296+
}, 3000); // 3秒刷新一次
297+
}
298+
};
299+
300+
// 停止定时任务
301+
const stopRefreshTimer = () => {
302+
if (refreshTimer.value) {
303+
clearInterval(refreshTimer.value);
304+
refreshTimer.value = null;
305+
}
306+
};
307+
308+
// 检查并管理定时任务
309+
const checkAndManageTimer = () => {
310+
if (hasProcessingTask()) {
311+
startRefreshTimer();
312+
} else {
313+
stopRefreshTimer();
314+
}
269315
};
270316
271317
const handleSearch = () => {
318+
// 搜索时先停止定时任务
319+
stopRefreshTimer();
272320
pagination.value.currentPage = 1;
273321
getDataFlowListFun();
274322
};
@@ -345,9 +393,22 @@ const goToNewTask = (path) => {
345393
router.push(path);
346394
};
347395
396+
// 监听路由变化,停止定时任务
397+
watch(
398+
() => route.path,
399+
() => {
400+
stopRefreshTimer();
401+
}
402+
);
403+
348404
onMounted(() => {
349405
getDataFlowListFun();
350406
});
407+
408+
// 组件卸载时清理定时器
409+
onBeforeUnmount(() => {
410+
stopRefreshTimer();
411+
});
351412
</script>
352413
<style lang="less" scoped>
353414
:deep(.settingsTableBtn) {

0 commit comments

Comments
 (0)