eff44138 by xukangle

update:修改元数据采集任务

1 parent d41c7c0b
......@@ -196,6 +196,11 @@ export const getDatabase = (params) => request({
method: 'post',
data: params
})
// 检验是否存在导入数据源
export const checkDataSource = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/check-exist-import-database?databaseNameEn=${params.databaseNameEn}`,
method: 'get',
})
/** 源数据分析报告 */
/**查询列表 */
......
......@@ -14,7 +14,8 @@ import {
checkMetaDataTask,
executeMetaDataTask,
getDatabase,
checkDatabaseIsExist
checkDatabaseIsExist,
checkDataSource
} from '@/api/modules/dataMetaService';
import {
getCronExecTime
......@@ -84,7 +85,7 @@ const tableInfo = ref({
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
{ label: "采集任务名称", field: "collectTaskName", width: 140 },
{ label: "元模型", field: "metadataModelChName", width: 140 },
{ label: "数据源名称", field: "datasourceName", width: 160,type: 'text_btn', value: 'datasourceName',columClass:"text_btn" },
{ label: "数据源名称", field: "datasourceName", width: 160, type: 'text_btn', value: 'datasourceName', columClass: "text_btn" },
{ label: '任务状态', field: 'taskState', type: 'switch', activeText: '上线', inactiveText: '下线', activeValue: 1, inactiveValue: 0, switchWidth: 56, width: 100, align: 'center' },
{ label: "执行计划", field: "collectType", type: 'filter', width: 90 },
{ label: "同步策略", field: "collectMode", type: 'filter', width: 90 },
......@@ -126,17 +127,17 @@ const tableInfo = ref({
const collectType = ref(1)
const formItems: any = ref([
{
{
label: '元模型',
type: 'select',
placeholder: '请选择',
field: 'metadataModel',
default: '1',
options:[
{ label:"数据库表", value:'1' },
options: [
{ label: "数据库表", value: '1' },
// {label:"BI报表",value:2,},
// {label:"数据服务",value:3,},
{ label:"ETL工具",value:'4' },
{ label: "ETL工具", value: '4' },
// {label:"数据处理",value:5,}
],
clearable: true,
......@@ -425,19 +426,19 @@ const tableBtnClick = (scope, btn) => {
}
});
})
} else if(type=="datasourceName"){
} else if (type == "datasourceName") {
if (row.metadataModel == '4') {
proxy.$ElMessage.warning("元模型为ETL工具的采集任务无元数据详情!")
return;
}
checkDatabaseIsExist(row.dataSourceGuid).then((res:any)=>{
if(res.code===proxy.$passCode){
if(res.data){
checkDatabaseIsExist(row.dataSourceGuid).then((res: any) => {
if (res.code === proxy.$passCode) {
if (res.data) {
router.push({
name:"metadataQuery",
query:{
dataSourceGuid:row.dataSourceGuid,
datasourceName:row.datasourceName,
name: "metadataQuery",
query: {
dataSourceGuid: row.dataSourceGuid,
datasourceName: row.datasourceName,
}
})
} else {
......@@ -498,6 +499,35 @@ const scheduleChange = (val, rowValue) => {
formInfo.value.formInfo.items = formItems.value
}
const databaseNameEn = ref<any>('')
const selectChange = (val, row, info) => {
// dataSourceList.value
console.log(val, row, info)
let data: any = dataSourceList.value.find((item: any) => item.guid == val)
if (data) {
databaseNameEn.value = data.databaseNameEn
checkDataSource({
databaseNameEn: databaseNameEn.value,
}).then((res: any) => {
if (res.code == proxy.$passCode) {
if (!res.data) {
proxy.$ElMessage({
type: 'warning',
message: '已存在导入数据源,请确认是否覆盖!',
})
}
} else {
proxy.$ElMessage({
type: 'error',
message: res.msg,
})
}
})
}
}
// 切换结构类型 设置选项显隐
const setGroup = () => {
if (collectType.value == 2) {
......@@ -518,8 +548,9 @@ const taskCreateDialogRef = ref();
const dialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
let params = { ...info ,}
let params = { ...info, }
// params.taskState = 1;
params.databaseNameEn = databaseNameEn.value
if (dialogInfo.value.type == 'add') {
params.taskState = 1;
addMetaDataTask(params).then((res: any) => {
......@@ -603,17 +634,16 @@ onBeforeMount(() => {
</div>
<div class="table_panel_wrap">
<!-- 右侧采集任务表格 -->
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick"
@tablePageChange="tablePageChange" @tableSwitchBeforeChange="tableSwitchBeforeChange" />
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange"
@tableSwitchBeforeChange="tableSwitchBeforeChange" />
</div>
<!-- 新建编辑采集任务对话框 -->
<Dialog ref="taskCreateDialogRef" :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @radioGroupChange="radioGroupChange"
@scheduleChange="scheduleChange" />
<Dialog ref="taskCreateDialogRef" :dialogInfo="dialogInfo" @btnClick="dialogBtnClick"
@radioGroupChange="radioGroupChange" @scheduleChange="scheduleChange" @selectChange="selectChange" />
</div>
</template>
<style scoped lang="scss">
.table_tool_wrap {
width: 100%;
height: 84px !important;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!