Browse Source

数据安全调度配置

master
si@aidatagov.com 1 week ago
parent
commit
f6c44180df
  1. 2
      vue-fastapi-backend/module_admin/entity/do/metadata_config_do.py
  2. 2
      vue-fastapi-backend/module_admin/service/datasec_config_service.py
  3. 64
      vue-fastapi-frontend/src/views/meta/metatask/logsDialog.vue
  4. 6
      vue-fastapi-frontend/src/views/meta/metatask/secConfig.vue

2
vue-fastapi-backend/module_admin/entity/do/metadata_config_do.py

@ -127,7 +127,7 @@ class DatasecConfig(Base):
update_by = Column(String(64), nullable=True, default="", comment="更新者")
update_time = Column(DateTime, nullable=True, comment="更新时间")
metatask_param = Column(String(500), nullable=True, comment="参数")
status = Column(String(10), nullable=False, default="N", comment="状态")
status = Column(String(10), nullable=True, default='OFFLINE', comment='状态')
ds_time = Column(DateTime, nullable=True, comment="调度时间")
ds_ids = Column(String(50), nullable=True, comment="任务ID")
schId = Column(String(50), nullable=True, comment="调度id")

2
vue-fastapi-backend/module_admin/service/datasec_config_service.py

@ -441,8 +441,8 @@ class DatasecConfigService:
delresponsJson = json.loads(deldstext)
if delresponsJson['msg'] == 'success':
metatask_info = await cls.get_datasec_detail_services(query_db, process.metaTaskId)
metatask_info.schId=""
metatask_info2 = metatask_info.model_dump(exclude_unset=True)
metatask_info2.schId=""
await DatasecConfigDao.edit(query_db,metatask_info.onum, metatask_info2)
await query_db.commit()
return "调度删除成功!"

64
vue-fastapi-frontend/src/views/meta/metatask/logsDialog.vue

@ -1,6 +1,5 @@
<template>
<el-dialog v-model="visible" width="80%" top="5vh" append-to-body>
<div style="display: flex; flex-direction: column; gap: 10px;">
<!-- 第一部分实例表格带分页 -->
<el-card shadow="hover">
@ -13,6 +12,7 @@
<el-table
:data="instances"
border
highlight-current-row
style="width: 100%"
@row-click="handleFirstRowClick"
:height="350"
@ -38,7 +38,7 @@
:total="total"
:page-size="pageSize"
:current-page="currentPage"
@current-change="fetchInstances"
@current-change="handlePageChange"
style="margin-top: 10px; text-align: right;"
/>
</el-card>
@ -54,6 +54,7 @@
<el-table
:data="taskNodesData"
border
highlight-current-row
style="width: 100%"
@row-click="handleSecondRowClick"
:height="300"
@ -92,50 +93,75 @@
</template>
<script setup>
import { ref, getCurrentInstance } from "vue";
import { listInstances, taskNodes, logDetails } from "@/api/meta/metatask";
import { ref } from "vue";
const { proxy } = getCurrentInstance();
const { meta_instance_status } = proxy.useDict("meta_instance_status");
// Define props
// Props
const props = defineProps({
defindName: String, // Assuming defindName is a string, you can adjust based on actual type
defindName: String,
});
// Define reactive state
const visible = ref(false); //
const instances = ref([]); //
const total = ref(0); //
const pageSize = ref(10); //
const currentPage = ref(1); //
const taskNodesData = ref([]); //
const logDetailsContent = ref(""); //
// State
const visible = ref(false);
const instances = ref([]);
const total = ref(0);
const pageSize = ref(10);
const currentPage = ref(1);
const taskNodesData = ref([]);
const logDetailsContent = ref("");
//
defineExpose({
show(name) {
visible.value = true;
currentPage.value = 1;
fetchInstances(name);
},
});
// Fetch first table data
const fetchInstances = (defindName) => {
//
const fetchInstances = (name) => {
listInstances({
page_num: currentPage.value,
page_size: pageSize.value,
searchVal: defindName,
searchVal: name,
}).then((response) => {
instances.value = response.rows;
total.value = response.total;
//
if (instances.value.length > 0) {
handleFirstRowClick(instances.value[0]);
} else {
taskNodesData.value = [];
logDetailsContent.value = "";
}
});
};
// Handle row click in the first table and fetch task node data
//
const handlePageChange = (page) => {
currentPage.value = page;
fetchInstances(props.defindName);
};
//
const handleFirstRowClick = (row) => {
taskNodes(row.id).then((response) => {
taskNodesData.value = response.rows;
if (taskNodesData.value.length > 0) {
handleSecondRowClick(taskNodesData.value[0]);
} else {
logDetailsContent.value = "";
}
});
};
// Handle row click in the second table and fetch log details
//
const handleSecondRowClick = (row) => {
logDetails(row.id).then((response) => {
logDetailsContent.value = response.data;
@ -143,9 +169,7 @@ const handleSecondRowClick = (row) => {
};
</script>
<style scoped>
/* 添加全局间距和样式优化 */
.el-card {
padding: 5px;
}

6
vue-fastapi-frontend/src/views/meta/metatask/secConfig.vue

@ -357,7 +357,9 @@
</el-row>
<el-dialog v-model="open" width="600px" append-to-body>
<template #title>
<span style="font-weight: bold; font-size: 18px;">调度任务配置</span>
</template>
<el-form ref="taskForm" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="24">
@ -666,7 +668,7 @@ const handleRunRow = (row) => {
};
const handleLogRow = (row) => {
defindName.value = `${row.metataskName}-${row.dsTypes === "0" ? "表字段采集" : "存储过程采集"}`;
defindName.value =row.metataskName
if (logdialog.value) {
logdialog.value.show(defindName.value);

Loading…
Cancel
Save