7901b7d1 by lxs

Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop

2 parents 4eabcb1c ccc1b00e
......@@ -33,6 +33,9 @@ VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service
# VITE_APP_CHECK_BASEURL = /mock
VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
#数据源接口地址
VITE_APP_DATA_SOURCE_URL = ms-daop-data-source-service
# 数据字典接口地址
VITE_APP_CONFIG_URL = 'ms-daop-configure-service'
......
......@@ -62,6 +62,9 @@ VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
# 数据字典接口地址
VITE_APP_CONFIG_URL = 'ms-daop-configure-service'
#数据源接口地址
VITE_APP_DATA_SOURCE_URL = ms-daop-data-source-service
# 文件上传下载接口地址
VITE_APP_COMMON_URL = 'ms-daop-common-service'
......
......@@ -764,8 +764,8 @@ export const createTableSql = (data) => request({
* @param {no params}
* @path /cg-dir/export
*/
export const exportCgDir = () => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-dir/export`,
export const exportCgDir = (params) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-dir/export?execGuid=${params.execGuid}`,
method: 'post',
responseType: 'blob',
})
......@@ -792,6 +792,21 @@ export const getDbDirDetail = (params) => request({
method: 'get',
})
/**
* 数据库目录修改规划数据资产
* @param {Object}
* @path /db-dir/table/update-data-asset
*
*/
export const updateDataAsset = (data) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/update-data-asset`,
method: 'post',
data
})
/*********************业务规则配置 ************数据库目录************************* */
/**
......
......@@ -192,7 +192,7 @@ export const getMetaChangeList = (params) => request({
/** 获取数据库选择列表 */
export const getDatabase = (params) => request({
url: `${import.meta.env.VITE_APP_API_BASEURL}/data-source/get-source-list`,
url: `${import.meta.env.VITE_APP_DATA_SOURCE_URL}/data-source/get-source-list`,
method: 'post',
data: params
})
......
......@@ -235,8 +235,8 @@ const routes: RouteRecordRaw[] = [
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.domainName) {
to.meta.title = `已有表新建(${to.query.domainName})`;
if (to.query.editOpt) {
to.meta.title = `编辑-(${to.query.tableChName})`;
to.meta.editPage = true;
}
}
......
......@@ -93,46 +93,46 @@ const routes: RouteRecordRaw[] = [
},
],
},
// {
// path: '/data-meta/metadata-lineage',
// component: Layout,
// meta: {
// title: '元数据血缘',
// icon: 'ep:grid',
// },
// children: [
// {
// path: 'analysis-view',
// name: 'analysisView',
// component: () => import('@/views/data_meta/analysisView.vue'),
// meta: {
// title: '查看血缘',
// breadcrumb: false,
// cache: true
// },
// },
// {
// path: 'change-detection',
// name: 'changeDetection',
// component: () => import('@/views/data_meta/changeDetection.vue'),
// meta: {
// title: '血缘变更检测',
// breadcrumb: false,
// cache: true
// },
// },
// {
// path: 'analysis-reports',
// name: 'analysisReports',
// component: () => import('@/views/data_meta/analysisReports.vue'),
// meta: {
// title: '血缘关系解析',
// breadcrumb: false,
// cache: true
// },
// },
// ],
// },
{
path: '/data-meta/metadata-lineage',
component: Layout,
meta: {
title: '元数据血缘',
icon: 'ep:grid',
},
children: [
{
path: 'analysis-view',
name: 'analysisView',
component: () => import('@/views/data_meta/analysisView.vue'),
meta: {
title: '查看血缘',
breadcrumb: false,
cache: true
},
},
{
path: 'change-detection',
name: 'changeDetection',
component: () => import('@/views/data_meta/changeDetection.vue'),
meta: {
title: '血缘变更检测',
breadcrumb: false,
cache: true
},
},
{
path: 'analysis-reports',
name: 'analysisReports',
component: () => import('@/views/data_meta/analysisReports.vue'),
meta: {
title: '血缘关系解析',
breadcrumb: false,
cache: true
},
},
],
},
]
export default routes
......
......@@ -5,7 +5,7 @@
<script lang="ts" setup name="configureRules">
import { ref } from "vue";
import useUserStore from "@/store/modules/user";
import { getBizRuleConfigDetail, saveBizRuleConfig, } from '@/api/modules/dataInventory'
import { getBizRuleConfigDetail, getNewDataTypeList, saveBizRuleConfig, } from '@/api/modules/dataInventory'
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute();
......@@ -13,6 +13,7 @@ const fullPath = route.fullPath;
const userStore = useUserStore();
const bizRuleConfigData = ref<any>()
const getBizRuleConfigDetailData = async () => {
tableFieldsLoading.value = true
const params = {
tableGuid: router.currentRoute.value.query.tableGuid,
execGuid: router.currentRoute.value.query.execGuid
......@@ -25,22 +26,37 @@ const getBizRuleConfigDetailData = async () => {
item.isEdit = false
})
tableData.value = bizRuleConfigData.value
tableFieldsLoading.value = false
} else {
proxy.$message.error(res.msg)
}
}
// 获取字段类型
const fieldData = ref<any>([]);
const getFieldTypeData = async () => {
const params = {
dictType: "字段类型"
}
const res: any = await getNewDataTypeList(params);
if (res.code == proxy.$passCode) {
fieldData.value = res.data || [];
} else {
proxy.$ElMessage.error(res.msg);
}
}
onMounted(() => {
getBizRuleConfigDetailData()
onMounted(async () => {
await getFieldTypeData()
await getBizRuleConfigDetailData()
})
const tableData1 = ref([
{
cgDirName: router.currentRoute.value.query.cgDirName,
tableName: router.currentRoute.value.query.tableName,
tableChName: router.currentRoute.value.query.tableChName,
description: router.currentRoute.value.query.description,
databaseChName: router.currentRoute.value.query.databaseChName || '--',
tableName: router.currentRoute.value.query.tableName || '--',
tableChName: router.currentRoute.value.query.tableChName || '--',
description: router.currentRoute.value.query.description || '--',
},
])
// 表格数据
......@@ -71,7 +87,7 @@ const moveUp = () => {
return;
}
selectedRows.value.forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.guid === row.guid);
const index = tableData.value.findIndex((item) => item.tableData === row.tableData);
if (index > 0) {
[tableData.value[index - 1], tableData.value[index]] = [
tableData.value[index],
......@@ -89,7 +105,7 @@ const moveDown = () => {
}
// 倒序遍历选中行
[...selectedRows.value].reverse().forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.guid === row.guid);
const index = tableData.value.findIndex((item) => item.tableData === row.tableData);
if (index < tableData.value.length - 1) {
[tableData.value[index], tableData.value[index + 1]] = [
tableData.value[index + 1],
......@@ -98,6 +114,30 @@ const moveDown = () => {
}
});
};
// 删除行
const deleteRow = (index) => {
// confirm 弹窗
proxy.$confirm('是否删除该行数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
tableData.value.splice(index, 1)
}).catch(() => {
proxy.$message({
type: 'info',
message: '已取消删除'
});
});
}
// 批量删除功能
const batchDelete = () => {
selectedRows.value.forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.tableData === row.tableData);
if (index !== -1) tableData.value.splice(index, 1);
});
selectedRows.value = [];
};
// 编辑行
const editRow = (row) => {
......@@ -125,19 +165,6 @@ const saveRow = (row) => {
}
row.isEdit = false
}
// 删除行
const deleteRow = (index) => {
tableData.value.splice(index, 1)
}
// 批量删除功能
const batchDelete = () => {
selectedRows.value.forEach((row: any) => {
const index = tableData.value.findIndex((item) => item.id === row.id);
if (index !== -1) tableData.value.splice(index, 1);
});
selectedRows.value = [];
};
const data = [
{
value: '1',
......@@ -274,7 +301,7 @@ const cancel = () => {
'max-height': 'calc(100% - 16px)',
display: 'inline-block',
}">
<el-table-column prop="cgDirName" label="数据源" width="180" />
<el-table-column prop="databaseChName" label="数据源" width="180" />
<el-table-column prop="tableName" label="表名称" width="180" />
<el-table-column prop="tableChName" label="数据库表" width="280" />
<el-table-column prop="description" label="描述" width="180" show-overflow-tooltip />
......@@ -296,33 +323,37 @@ const cancel = () => {
<!-- 排序列(不可编辑) -->
<el-table-column type="index" label="排序" width="80" align="center" />
<!-- 字段中文名(不可编辑)fieldChName -->
<el-table-column prop="fieldChName" label="字段中文名" width="120">
<el-table-column prop="fieldChName" label="字段中文名" width="120" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.fieldChName ? scope.row.fieldChName : '--' }}
</template>
</el-table-column>
<!-- 字段英文名(不可编辑) -->
<el-table-column prop="fieldName" label="字段英文名" width="120">
<el-table-column prop="fieldName" label="字段英文名" width="120" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.fieldName ? scope.row.fieldName : '--' }}
</template>
</el-table-column>
<!-- 分类(不可编辑)classifyName -->
<!-- <el-table-column prop="fieldEnglish" label="分类" width="120">
<el-table-column prop="classifyName" label="分类" width="80" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.fieldEnglish ? scope.row.fieldEnglish : '--' }}
{{ scope.row.classifyName ? scope.row.classifyName : '--' }}
</template>
</el-table-column> -->
</el-table-column>
<!-- 分级(不可编辑) -->
<!-- <el-table-column prop="gradeDetailName" label="分级" width="120" align="center">
<el-table-column prop="gradeDetailName" label="分级" width="80" align="center" show-overflow-tooltip>
<template #default="scope">
{{ scope.row.gradeDetailName ? scope.row.gradeDetailName : '--' }}
</template>
</el-table-column> -->
</el-table-column>
<!-- 字段类型fieldType (不可编辑) -->
<el-table-column prop="fieldType" label="字段类型" width="150" align="center">
<el-table-column prop="fieldType" label="字段类型" width="120" align="center">
<template #default="scope">
{{ scope.row.fieldType ? scope.row.fieldType : '--' }}
{{
fieldData ? (fieldData.find((item: any) => item.value === scope.row.fieldType)?.label || '--')
: '--'
}}
</template>
</el-table-column>
......
......@@ -78,12 +78,22 @@ const labelPageList = ref<any>()
const getLabelPageData = async () => {
refCount.value++;
tableInfo.value.loading = true;
const params = {
pageIndex: page.value.curr,
pageSize: page.value.limit,
classifyGuid: classifyGuid.value,
detailGuid: classifyDetailGuid.value
let params = {}
if (guids.value.length == 0) {
params = {
pageIndex: page.value.curr,
pageSize: page.value.limit,
classifyGuid: classifyGuid.value,
detailGuid: classifyDetailGuid.value
}
} else {
params = {
pageIndex: page.value.curr,
pageSize: page.value.limit,
guids: guids.value
}
}
const res: any = await getLabelPageList(params);
if (res.code == proxy.$passCode) {
labelPageList.value = res.data.records;
......@@ -254,8 +264,13 @@ const tableInfo = ref({
{
label: "编辑", value: "edit", click: async (scope) => {
console.log('编辑', scope);
const index = findIndexInRecursiveData(classGradeTreeData.value, scope.row.classifyDetailGuid);
const temp = classGradeTreeData.value.slice(index, index + 1);
console.log('temp', temp);
newCreateGradeFormItems.value[1].options = transformDataForTree([temp[0]])
newCreateGradeStandardDialogInfo.value.submitBtnLoading = false;
newCreateGradeStandardDialogInfo.value.title = '编辑标签';
classifyGuid.value = scope.row.classifyGuid;
await getGradeListData(scope.row.gradeGuid);
// 遍历classGradeTreeData 找到对应的guid item的refGradeGuid
classGradeTreeData.value.forEach((element: any) => {
......@@ -301,6 +316,28 @@ const tableInfo = ref({
loading: false
});
const findIndexInRecursiveData = (data: any[], targetGuid: string): number => {
// 遍历数组
for (let i = 0; i < data.length; i++) {
const item = data[i];
// 检查当前项的 guid 是否匹配
if (item.guid === targetGuid) {
return i; // 返回当前索引
}
// 如果当前项有 children,则递归查询
if (item.children) {
const childIndex = findIndexInRecursiveData(item.children, targetGuid);
if (childIndex !== -1) {
return i; // 返回外层索引
}
}
}
return -1; // 如果没有找到匹配项,则返回 -1
};
// 批量删除
const batchRemobe = async () => {
// 批量删除,增加confirm确认弹窗
......@@ -401,6 +438,7 @@ const tableBtnClick = async (scope, value) => {
// newCreateGradeStandardDialogInfo.value.visible = true;
newCreateGradeStandardDialogInfo.value.submitBtnLoading = false;
newCreateGradeStandardDialogInfo.value.title = '编辑标签';
classifyGuid.value = scope.row.classifyGuid;
await getGradeListData(scope.row.gradeGuid);
// 遍历classGradeTreeData 找到对应的guid item的refGradeGuid
classGradeTreeData.value.forEach((element: any) => {
......@@ -687,6 +725,7 @@ const classSearchItemList = ref<any>([
const guids = ref<any>([])
const selectChange = async (val: any, row: any) => {
console.log('selectChange', val, row);
if (val) {
guids.value = val;
}
......@@ -798,7 +837,7 @@ const positionOptions = [
];
// 语言options
const languageOptions = [
{ label: '中文名', value: 'zhName' },
{ label: '中文名', value: 'chName' },
{ label: '英文名', value: 'enName' },
];
// 当前悬停的行索引
......
......@@ -196,7 +196,7 @@ const getPreviewData = () => {
const getTableStructure = () => {
let tableName = currDatasourceSelect.value.tableName;
console.log('tableName', currDatasourceSelect.value);
console.log('tableName');
currDsTableStructureLoading.value = true;
currDsTableStructure.value = [];
getDsTableStructure({
......@@ -275,7 +275,6 @@ const datasource_selection_all_change = (selection) => {
});
};
const datasource_selection_change = (selection, row) => {
console.log(selection, row);
let index = selection.findIndex((s) => s.tableName == row.tableName);
if (index === -1) {
datasourceSelectedRows.value.splice(
......@@ -331,6 +330,7 @@ watch(
watch(currDatasourceSelect, (val) => {
if (val?.tableName) {
// getPreviewData();
console.log('currDatasourceSelect', currDatasourceSelect, val);
getTableStructure();
}
});
......
......@@ -104,7 +104,7 @@ const tableInfo = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 210,
width: 230,
fixed: 'right',
btns: (scope) => {
const row = scope.row
......@@ -114,7 +114,7 @@ const tableInfo = ref({
} else {
btnsArr.splice(0, 0, { label: "立即执行", value: "carry", disabled: row.taskState === 0 || row.execState == 1 })
}
// btnsArr.push({ label: "编辑", value: "edit", disabled: row.taskState === 1 || row.isCarry || row.execState == 1 });
btnsArr.push({ label: "编辑", value: "edit", disabled: row.taskState === 1 || row.isCarry || row.execState == 1 });
btnsArr.push({ label: "删除", value: "delete", disabled: row.isCarry || row.taskState === 1 || row.execState == 1 });
btnsArr.push({ label: "执行日志", value: "log" });
return btnsArr
......@@ -472,19 +472,18 @@ const setDetailInfo = (row) => {
}
const getDataSourceList = () => {
// TODO
// getDatabase({ connectStatus: 1 }).then((res: any) => {
// if (res.code == proxy.$passCode) {
// dataSourceList.value = res.data || [];
// formItems.value[1].options = dataSourceList.value;
// searchItemList.value[1].options = dataSourceList.value;
// } else {
// proxy.$ElMessage({
// type: "error",
// message: res.msg,
// });
// }
// })
getDatabase({ connectStatus: 1 }).then((res: any) => {
if (res.code == proxy.$passCode) {
dataSourceList.value = res.data || [];
formItems.value[1].options = dataSourceList.value;
searchItemList.value[1].options = dataSourceList.value;
} else {
proxy.$ElMessage({
type: "error",
message: res.msg,
});
}
})
}
const radioGroupChange = (val, info) => {
......@@ -598,7 +597,7 @@ onBeforeMount(() => {
<!-- 头部搜索 -->
<TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" :init="false" />
<div class="tools_btns">
<!-- <el-button type="primary" @click="loadDrawer">新建</el-button> -->
<el-button type="primary" @click="loadDrawer">新建</el-button>
<el-button @click="importMeta">导入</el-button>
</div>
</div>
......
......@@ -60,8 +60,8 @@ const tabsInfo = ref({
activeName: '',
tabs: [
{ label: '基础信息', name: 'first' },
// / { label: '数据血缘', name: 'second' },
//{ label: '变更记录', name: 'third' }
{ label: '数据血缘', name: 'second' },
{ label: '变更记录', name: 'third' }
]
})
/** 切换布局 */
......@@ -192,13 +192,13 @@ const tabsPaneMap = ref({
tableInfo: fieldTableInfo.value,
show: true
},
// {
// title: '索引信息',
// type: 'table',
// isIndex: true,
// tableInfo: indexTableInfo.value,
// show: true
// },
{
title: '索引信息',
type: 'table',
isIndex: true,
tableInfo: indexTableInfo.value,
show: true
},
],
second: [
{
......@@ -310,10 +310,10 @@ const lineageDataLoading = ref(true);
const getDetailInfo = () => {
getSheetDetail()
getSheetField()
// getSheetKeys()
getSheetKeys()
logPage.value.curr = 1
//getSheetLog();
// getTableLineageMap();
getSheetLog();
getTableLineageMap();
}
const getSheetDetail = () => {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!