eff44138 by xukangle

update:修改元数据采集任务

1 parent d41c7c0b
...@@ -196,6 +196,11 @@ export const getDatabase = (params) => request({ ...@@ -196,6 +196,11 @@ export const getDatabase = (params) => request({
196 method: 'post', 196 method: 'post',
197 data: params 197 data: params
198 }) 198 })
199 // 检验是否存在导入数据源
200 export const checkDataSource = (params) => request({
201 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/check-exist-import-database?databaseNameEn=${params.databaseNameEn}`,
202 method: 'get',
203 })
199 204
200 /** 源数据分析报告 */ 205 /** 源数据分析报告 */
201 /**查询列表 */ 206 /**查询列表 */
......
...@@ -14,7 +14,8 @@ import { ...@@ -14,7 +14,8 @@ import {
14 checkMetaDataTask, 14 checkMetaDataTask,
15 executeMetaDataTask, 15 executeMetaDataTask,
16 getDatabase, 16 getDatabase,
17 checkDatabaseIsExist 17 checkDatabaseIsExist,
18 checkDataSource
18 } from '@/api/modules/dataMetaService'; 19 } from '@/api/modules/dataMetaService';
19 import { 20 import {
20 getCronExecTime 21 getCronExecTime
...@@ -84,7 +85,7 @@ const tableInfo = ref({ ...@@ -84,7 +85,7 @@ const tableInfo = ref({
84 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, 85 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
85 { label: "采集任务名称", field: "collectTaskName", width: 140 }, 86 { label: "采集任务名称", field: "collectTaskName", width: 140 },
86 { label: "元模型", field: "metadataModelChName", width: 140 }, 87 { label: "元模型", field: "metadataModelChName", width: 140 },
87 { label: "数据源名称", field: "datasourceName", width: 160,type: 'text_btn', value: 'datasourceName',columClass:"text_btn" }, 88 { label: "数据源名称", field: "datasourceName", width: 160, type: 'text_btn', value: 'datasourceName', columClass: "text_btn" },
88 { label: '任务状态', field: 'taskState', type: 'switch', activeText: '上线', inactiveText: '下线', activeValue: 1, inactiveValue: 0, switchWidth: 56, width: 100, align: 'center' }, 89 { label: '任务状态', field: 'taskState', type: 'switch', activeText: '上线', inactiveText: '下线', activeValue: 1, inactiveValue: 0, switchWidth: 56, width: 100, align: 'center' },
89 { label: "执行计划", field: "collectType", type: 'filter', width: 90 }, 90 { label: "执行计划", field: "collectType", type: 'filter', width: 90 },
90 { label: "同步策略", field: "collectMode", type: 'filter', width: 90 }, 91 { label: "同步策略", field: "collectMode", type: 'filter', width: 90 },
...@@ -126,17 +127,17 @@ const tableInfo = ref({ ...@@ -126,17 +127,17 @@ const tableInfo = ref({
126 const collectType = ref(1) 127 const collectType = ref(1)
127 128
128 const formItems: any = ref([ 129 const formItems: any = ref([
129 { 130 {
130 label: '元模型', 131 label: '元模型',
131 type: 'select', 132 type: 'select',
132 placeholder: '请选择', 133 placeholder: '请选择',
133 field: 'metadataModel', 134 field: 'metadataModel',
134 default: '1', 135 default: '1',
135 options:[ 136 options: [
136 { label:"数据库表", value:'1' }, 137 { label: "数据库表", value: '1' },
137 // {label:"BI报表",value:2,}, 138 // {label:"BI报表",value:2,},
138 // {label:"数据服务",value:3,}, 139 // {label:"数据服务",value:3,},
139 { label:"ETL工具",value:'4' }, 140 { label: "ETL工具", value: '4' },
140 // {label:"数据处理",value:5,} 141 // {label:"数据处理",value:5,}
141 ], 142 ],
142 clearable: true, 143 clearable: true,
...@@ -425,19 +426,19 @@ const tableBtnClick = (scope, btn) => { ...@@ -425,19 +426,19 @@ const tableBtnClick = (scope, btn) => {
425 } 426 }
426 }); 427 });
427 }) 428 })
428 } else if(type=="datasourceName"){ 429 } else if (type == "datasourceName") {
429 if (row.metadataModel == '4') { 430 if (row.metadataModel == '4') {
430 proxy.$ElMessage.warning("元模型为ETL工具的采集任务无元数据详情!") 431 proxy.$ElMessage.warning("元模型为ETL工具的采集任务无元数据详情!")
431 return; 432 return;
432 } 433 }
433 checkDatabaseIsExist(row.dataSourceGuid).then((res:any)=>{ 434 checkDatabaseIsExist(row.dataSourceGuid).then((res: any) => {
434 if(res.code===proxy.$passCode){ 435 if (res.code === proxy.$passCode) {
435 if(res.data){ 436 if (res.data) {
436 router.push({ 437 router.push({
437 name:"metadataQuery", 438 name: "metadataQuery",
438 query:{ 439 query: {
439 dataSourceGuid:row.dataSourceGuid, 440 dataSourceGuid: row.dataSourceGuid,
440 datasourceName:row.datasourceName, 441 datasourceName: row.datasourceName,
441 } 442 }
442 }) 443 })
443 } else { 444 } else {
...@@ -498,6 +499,35 @@ const scheduleChange = (val, rowValue) => { ...@@ -498,6 +499,35 @@ const scheduleChange = (val, rowValue) => {
498 formInfo.value.formInfo.items = formItems.value 499 formInfo.value.formInfo.items = formItems.value
499 } 500 }
500 501
502 const databaseNameEn = ref<any>('')
503 const selectChange = (val, row, info) => {
504 // dataSourceList.value
505 console.log(val, row, info)
506
507 let data: any = dataSourceList.value.find((item: any) => item.guid == val)
508 if (data) {
509 databaseNameEn.value = data.databaseNameEn
510 checkDataSource({
511 databaseNameEn: databaseNameEn.value,
512 }).then((res: any) => {
513 if (res.code == proxy.$passCode) {
514 if (!res.data) {
515 proxy.$ElMessage({
516 type: 'warning',
517 message: '已存在导入数据源,请确认是否覆盖!',
518 })
519 }
520 } else {
521 proxy.$ElMessage({
522 type: 'error',
523 message: res.msg,
524 })
525 }
526 })
527 }
528
529 }
530
501 // 切换结构类型 设置选项显隐 531 // 切换结构类型 设置选项显隐
502 const setGroup = () => { 532 const setGroup = () => {
503 if (collectType.value == 2) { 533 if (collectType.value == 2) {
...@@ -518,8 +548,9 @@ const taskCreateDialogRef = ref(); ...@@ -518,8 +548,9 @@ const taskCreateDialogRef = ref();
518 548
519 const dialogBtnClick = (btn, info) => { 549 const dialogBtnClick = (btn, info) => {
520 if (btn.value == 'submit') { 550 if (btn.value == 'submit') {
521 let params = { ...info ,} 551 let params = { ...info, }
522 // params.taskState = 1; 552 // params.taskState = 1;
553 params.databaseNameEn = databaseNameEn.value
523 if (dialogInfo.value.type == 'add') { 554 if (dialogInfo.value.type == 'add') {
524 params.taskState = 1; 555 params.taskState = 1;
525 addMetaDataTask(params).then((res: any) => { 556 addMetaDataTask(params).then((res: any) => {
...@@ -603,17 +634,16 @@ onBeforeMount(() => { ...@@ -603,17 +634,16 @@ onBeforeMount(() => {
603 </div> 634 </div>
604 <div class="table_panel_wrap"> 635 <div class="table_panel_wrap">
605 <!-- 右侧采集任务表格 --> 636 <!-- 右侧采集任务表格 -->
606 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" 637 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange"
607 @tablePageChange="tablePageChange" @tableSwitchBeforeChange="tableSwitchBeforeChange" /> 638 @tableSwitchBeforeChange="tableSwitchBeforeChange" />
608 </div> 639 </div>
609 <!-- 新建编辑采集任务对话框 --> 640 <!-- 新建编辑采集任务对话框 -->
610 <Dialog ref="taskCreateDialogRef" :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @radioGroupChange="radioGroupChange" 641 <Dialog ref="taskCreateDialogRef" :dialogInfo="dialogInfo" @btnClick="dialogBtnClick"
611 @scheduleChange="scheduleChange" /> 642 @radioGroupChange="radioGroupChange" @scheduleChange="scheduleChange" @selectChange="selectChange" />
612 </div> 643 </div>
613 </template> 644 </template>
614 645
615 <style scoped lang="scss"> 646 <style scoped lang="scss">
616
617 .table_tool_wrap { 647 .table_tool_wrap {
618 width: 100%; 648 width: 100%;
619 height: 84px !important; 649 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!