820266a3 by xukangle

Merge branch 'develop' into dev_20241202_xukangle

2 parents bdc72733 4f8e081a
......@@ -69,7 +69,7 @@ export const saveMetaReportAnalysis = (params) => request({
**/
// 树形数据
export const getMetaTreeData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list`,
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list?isImportCreate=${params.isImportCreate}`,
method: 'post',
data: params
})
......
......@@ -81,6 +81,13 @@ export const getDatabase = (params) => request({
data: params
})
/** 获取盘点的数据库目录 */
export const getInventoryDsDir = () => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/tree-list`,
method: 'post',
data: {}
})
/** 新建质检表,获取主题域分层的主题表树结构 */
export const getSubjectTableTree = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-directory/directory-tree-list`,
......@@ -95,10 +102,10 @@ export const getSubjectTableByDomain = (params) => request({
data: params
})
/** 获取主题表的字段列表 */
export const getSubjectFields = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-subject/field/list?subjectGuid=${params}`,
method: 'get',
/** 获取主题表的字段列表,目前应包括盘点目录和元数据目录的表及字段 */
export const getSubjectFields = (tableGuid, dataSource) => request({
url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/field/list-by-subject-guid?tableGuid=${tableGuid}&dataSource=${dataSource}`,
method: 'post',
})
/** 表的逻辑条件和sql检验。 */
......
......@@ -255,10 +255,12 @@ const groupTableInfo = ref({
label: "操作",
type: "btn",
width: 92,
btns: [
{ label: "编辑", value: "edit" },
{ label: "删除", value: "delete" },
],
btns: (scope) => {
return [
{ label: "编辑", value: "edit", disabled: scope.row.dataSource != '5' },
{ label: "删除", value: "delete", disabled: scope.row.dataSource != '5' },
]
},
}
});
......@@ -402,7 +404,8 @@ const tableBtnClick = (scope, btn) => {
name: 'ruleTemplate',
query: {
modelGuid: row.guid,
name: row.name
name: row.name,
dataSource: row.dataSource
}
});
} else if (type == "delete") {
......@@ -429,9 +432,10 @@ const open = (msg, type, isBatch = false) => {
if (res.code == proxy.$passCode) {
page.value.curr = 1;
getTableData();
let node = qualityModelTreeRef.value.treeRef.store.nodesMap[currTableData.value.modelGroupGuid];
node.loaded = false;
node.expand();
// let node = qualityModelTreeRef.value.treeRef.store.nodesMap[currTableData.value.modelGroupGuid];
// node.loaded = false;
// node.expand();
getQualityGroupTreeData();
ElMessage.success('删除成功');
} else {
ElMessage.error(res.msg);
......@@ -489,6 +493,7 @@ const groupTableBtnClick = (scope, btn) => {
type: "success",
message: "删除分组成功",
});
getQualityGroupTreeData();
} else {
ElMessage({
type: "error",
......@@ -608,9 +613,10 @@ const ruleOpen = (msg, type, isBatch = false) => {
deleteQualityTableRule(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
getRuleTableData();
let node = qualityModelTreeRef.value.treeRef.store.nodesMap[lastSelectNode.value.data.guid];
node.loaded = false;
node.expand();
// let node = qualityModelTreeRef.value.treeRef.store.nodesMap[lastSelectNode.value.data.guid];
// node.loaded = false;
// node.expand();
getQualityGroupTreeData();
ElMessage.success('删除质检表成功');
} else {
ElMessage.error(res.msg);
......@@ -639,7 +645,8 @@ const clickCreateTable = () => {
name: 'ruleModel',
query: {
groupGuid: page.value.modelGroupGuid,
name: lastSelectNode.value.data.name
name: lastSelectNode.value.data.name,
dataSource: lastSelectNode.value.data.dataSource
}
});
}
......@@ -650,7 +657,8 @@ const clickCreateRule = () => {
name: 'ruleTemplate',
query: {
modelGuid: lastSelectNode.value.data.guid,
name: lastSelectNode.value.data.name
name: lastSelectNode.value.data.name,
dataSource: lastSelectNode.value.parent.data.dataSource
}
});
}
......@@ -744,6 +752,7 @@ let editSubmitPromise: any = ref(null);
/** 新建分组对话框确定。 */
const dialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
info.dataSource = '5';
if (dialogInfo.value.type == 'add') {
if (submitPromise.value) {
return;
......@@ -753,6 +762,7 @@ const dialogBtnClick = (btn, info) => {
if (res.code == proxy.$passCode) {
groupPage.value.curr = 1;
getGroupTableData();
getQualityGroupTreeData();
ElMessage({
type: 'success',
message: '新建分组成功'
......@@ -779,6 +789,7 @@ const dialogBtnClick = (btn, info) => {
type: 'success',
message: '编辑分组成功'
})
getQualityGroupTreeData();
dialogInfo.value.visible = false;
} else {
ElMessage({
......@@ -862,8 +873,9 @@ onActivated(async () => {
if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) {
getTableData();
}
let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid];
node?.expand();
// let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid];
// node?.expand();
getQualityGroupTreeData();
dataQualityStore.set(null);
});
} else {
......@@ -871,8 +883,9 @@ onActivated(async () => {
if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) {
getTableData();
}
let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid];
node.expand();
// let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid];
// node.expand();
getQualityGroupTreeData();
dataQualityStore.set(null);
}
}
......
......@@ -9,7 +9,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import StepBar from "@/components/StepBar/index.vue";
import TreeTransfer from "@/components/TreeTransfer/index.vue";
import {
getSubjectTableTree,
getInventoryDsDir,
getSubjectTableByDomain,
saveQualityTable,
getRuleTypeList,
......@@ -63,15 +63,46 @@ const toSubjectTables: any = ref([]);
const getSubjectTableTreeData = () => {
dsFromTreeDataLoading.value = true;
getMetaTreeData({}).then((res: any) => {
dsFromTreeDataLoading.value = false;
if (res.code == proxy.$passCode) {
dsFromTreeData.value = res.data?.map(d => {
d.parentGuid = 0;
return d;
}) || [];
}
})
if (route.query.dataSource == '4') {
getInventoryDsDir().then((res: any) => {
dsFromTreeDataLoading.value = false;
if (res.code == proxy.$passCode) {
dsFromTreeData.value = res.data?.map(d => {
d.parentGuid = 0;
d.guid = d.databaseGuid;
d.name = d.databaseChName;
d.label = d.databaseChName + `(${d.database})`;
d.children = d.children?.map(child => {
child.parentGuid = d.guid;
child.label = child.tableChName + `(${child.tableName})`;
child.guid = child.tableGuid;
child.dataServerName = d.database;
child.dataSourceGuid = d.databaseGuid;
child.parentGuid = d.databaseGuid;
return child;
})
return d;
}) || [];
}
})
} else {
getMetaTreeData({ isImportCreate: 'N' }).then((res: any) => {
dsFromTreeDataLoading.value = false;
if (res.code == proxy.$passCode) {
dsFromTreeData.value = res.data?.children?.map(d => {
d.parentGuid = 0;
d.label = d.name;
d.children = d.children?.map(child => {
child.label = child.name + `(${child.tableName})`;
child.dataServerName = d.name;
child.dataSourceGuid = d.guid;
return child;
})
return d;
}) || [];
}
})
}
}
const getSubjectTableByDomainData = (guid) => {
......@@ -158,11 +189,13 @@ const changeStep = (val, skip = false) => {
}
toSubjectTables.value = [];
dsToTreeData.value.forEach(d => {
d.children.forEach(c => {
c.children.forEach(child => {
child.label = `${child.enName}(${child.chName})`;
d.children.forEach(child => {
child.guid = child.tableGuid || child.guid;
child.enName = child.tableName;
child.chName = child.tableChName || child.name;
child.dataSourceGuid = child.parentGuid;
child.databaseName = child.databaseName,
toSubjectTables.value.push(child);
})
})
});
step.value = val - 1;
......@@ -211,6 +244,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
qualityModelGuid: modelGuid
})]
......@@ -229,6 +263,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
ruleField: fields?.map(f => {
return {
......@@ -252,6 +287,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
ruleField: [{
guid: fields.guid,
......@@ -276,6 +312,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
ruleField: fields?.map(f => {
return {
......@@ -300,6 +337,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
differenceRange: row.differenceRange,
rows: [],
......@@ -319,6 +357,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
ruleField: fields.map(f => {
return {
......@@ -347,6 +386,7 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
ruleField: fields.map(f => {
return {
......@@ -382,11 +422,19 @@ const transformRulesInfo = (info: any) => {
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
modelRuleConfList: [Object.assign({}, info, {
enName: row.mainTableField,
compareTableGuid: row.compareTableGuid,
compareTableName: row.compareTableName,
compareEnName: row.compareEnName
ruleField: info.ruleFields.map(row => {
return {
// guid: row.mainTable,
enName: row.mainTableField,
//chName: row.chName,
compareTableGuid: row.compareTableGuid,
compareTableName: row.compareTableName,
compareEnName: row.compareEnName
}
}),
ruleFields: ''
})]
}));
}
......@@ -432,17 +480,17 @@ const save = () => {
<div class="panel_title">
<div class="title_text">
<span>选择表</span>
<span class="tips_text">选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!</span>
<span class="tips_text">{{ route.query.dataSource == '5' ?
'选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!' : '选择需要添加质检规则的表' }}</span>
</div>
</div>
<TreeTransfer mode="transfer" :title="['可选表', '已选表']" pid="parentGuid"
:from-tree-data-loading="dsFromTreeDataLoading" :checkOnClickNode="true"
<TreeTransfer mode="transfer" :title="[route.query.dataSource == '5' ? '可选元数据目录表' : '可选盘点数据库目录表', '已选表']"
pid="parentGuid" :from-tree-data-loading="dsFromTreeDataLoading" :checkOnClickNode="true"
:from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid"
:transferOpenNode="true" width="70%" :defaultProps="{
label: 'name',
label: 'label',
value: 'guid'
}"
height="calc(100% - 64px)">
}" height="calc(100% - 64px)">
</TreeTransfer>
</div>
</div>
......@@ -457,7 +505,8 @@ const save = () => {
<div class="panel_content">
<div class="form_panel">
<ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList"
:largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList"></ruleForm>
:data-source="route.query.dataSource as string" :largeCategoryList="largeCategoryList"
:smallCategoryList="smallCategoryList"></ruleForm>
</div>
</div>
</div>
......
......@@ -204,15 +204,14 @@ const save = () => {
subjectGuid: modelDetailInfo.value.subjectGuid,
subjectName: modelDetailInfo.value.subjectName,
dataSourceGuid: modelDetailInfo.value.dataSourceGuid,
modelRuleConfList: submitInfos
modelRuleConfList: submitInfos,
dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
}]).then((res: any) => {
fullScreenLoading.value = false;
if (res.code == proxy.$passCode) {
ElMessage.success('新建规则保存成功');
router.push({
name: 'qualityRules'
});
userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
router.go(-1);
dataQualityStore.setModelGuid(modelGuid);
} else {
ElMessage.error(res.msg);
......@@ -317,7 +316,7 @@ const cancel = () => {
</div>
<div class="panel_content" v-show="item.open">
<div class="form_panel">
<ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList"
<ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" :dataSource="route.query.dataSource as string"
:largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList" :isSingle="true">
</ruleForm>
</div>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!