21698852 by fanguang

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

2 parents 427aa72a 7fa8fd97
......@@ -401,3 +401,10 @@ export const getSankeyData = (guid) => request({
url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/sankey-data?metaStandardGuid=${guid}`,
method: 'get'
})
/** 数仓目录树列表查询 */
export const getDataWareCatalogList = (params) => request({
url: `${import.meta.env.VITE_APP_DATA_DELIVERY}delivery/ms-daop-data-plan-service/data-catalog-directory/tree-list`,
method: 'post',
data: params
})
\ No newline at end of file
......
......@@ -335,6 +335,22 @@ onMounted(() => {
const observeResize = () => {
resizeObserver.value = new ResizeObserver(() => {
let domWidth = document.documentElement.clientWidth;
if (lastSelectNode.value) {
tooltip1Ref.value.style.display = 'none';
graphRef.value.updateItem(lastSelectNode.value, {
labelCfg: {
style: {
fill: '#212121',
},
},
style: {
stroke: '#4fa1a4',
fill: '#ebf6f7',
cursor: 'pointer'
}
});
}
lastSelectNode.value = null;
if (domWidth < 992) {//根据setting.ts里的设置,小于992,会隐藏左边的菜单栏,
setTimeout(() => {
const container: any = containerRef.value;
......@@ -591,6 +607,7 @@ defineExpose({
margin-top: 8px;
font-size: 14px;
color: #666666;
word-break: break-all;
line-height: 21px;
}
}
......
......@@ -120,6 +120,9 @@ export const filterCascaderData = (data, field, val, type = 'disabled') => {
}
// 数字千分位 保留两位小数
export const changeNum = (num, fixed = 0, round = false) => {
if(num === '' || num === null || num === undefined){
return '';
}
num = parseFloat(num);
if (round) {
let parts = num.toFixed(fixed).split(".")
......
......@@ -9,6 +9,7 @@ import Sankey from './components/Sankey.vue';
import Tree from '@/components/Tree/index.vue';
import RelationNetwork from '@/components/RelationNetwork/index.vue';
import {
getDataWareCatalogList,
getMetaStandardTreeList,
getMetaStandardField,
getSankeyData
......@@ -17,6 +18,10 @@ import { useRouter, useRoute } from "vue-router";
import useDataMetaStore from "@/store/modules/dataMeta"
import { cloneDeep } from 'lodash-es';
import { useValidator } from '@/hooks/useValidator';
const { required } = useValidator();
const router = useRouter();
const route = useRoute()
......@@ -126,7 +131,7 @@ onActivated(() => {
onBeforeMount(async () => {
await getTreeData()
// processRouter();
// processRouter();
})
onMounted(() => { })
......@@ -200,15 +205,113 @@ const handleNodeItemClick = (graph, nodeItem) => {
})
}
const handleContextMenu = (nodeData) => {
//TODO,新建引用数据集
window.open('');
const handleContextMenu = (model) => {
if (model.isHaveData == 'N') {
ElMessage.warning('当前标准下无字段,请先添加字段');
return;
}
contextNodeData.value = model;
dialogInfo.value.visible = true;
formItems.value[0].default = '';
getDataWareCatalogList({}).then((res: any) => {
if (res?.code == proxy.$passCode) {
dataCatalogList.value = res.data || [];
formItems.value[0].options = dataCatalogList.value;
} else {
ElMessage.error(res.msg);
}
})
}
onBeforeUnmount(() => {
relationNetworkRef.value.destroy();
})
/** 数仓目录树形列表 */
const dataCatalogList = ref([{
name: '测试',
guid: '1',
children: [{
name: 'cesi',
guid: '1-1'
}]
}]);
const formItems = ref([{
label: "数仓目录",
type: "tree-select",
placeholder: "请选择",
field: "domainGuid",
default: '',
options: dataCatalogList.value,
props: {
label: 'name',
value: 'guid'
},
showAllLevels: false,
checkStrictly: false,//只能选择叶子节点。
lazy: false,
filterable: true,
clearable: true,
required: true,
}]);
const formRules = ref({
domainGuid: [required('请选择数仓目录')],
});
const dialogInfo = ref({
visible: false,
size: 400,
direction: "column",
header: {
title: "引用标准新建数据集",
},
type: '',
contents: [
{
type: 'form',
title: '',
formInfo: {
id: 'select-subject-domain-list',
items: formItems.value,
rules: formRules.value
}
}
],
footer: {
btns: [
{ type: "default", label: "取消", value: "cancel" },
{ type: "primary", label: "确定", value: "submit", loading: false },
],
},
});
const contextNodeData: any = ref({});
const selectDataCatalogNodeObj: any = ref({});
const handleTreeSelectNodeChange = (node, item, nodeObj) => {
selectDataCatalogNodeObj.value = nodeObj;
}
const dialogBtnClick = (btn, info) => {
if (btn.value == 'submit') {
dialogInfo.value.visible = false;
if (selectDataCatalogNodeObj.value.parent.data.layereAttribute == 2) { //维度
window.open(`${import.meta.env.VITE_APP_DATA_DELIVERY}data-catalog/data-warehouse/dim-table-create-manual?domainGuid=${info.domainGuid}&domainName=${selectDataCatalogNodeObj.value.data.name}&metaStandard=${contextNodeData.value.guid}`);
} else {
if (selectDataCatalogNodeObj.value.parent.data.layereAttribute == 4) {
window.open(`${import.meta.env.VITE_APP_DATA_DELIVERY}data-catalog/data-warehouse/table-create-manual?domainGuid=${info.domainGuid}&domainName=${selectDataCatalogNodeObj.value.data.name}&layereAttribute=${selectDataCatalogNodeObj.value.parent.data.layereAttribute}&metaStandard=${contextNodeData.value.guid}`);
} else {
window.open(`${import.meta.env.VITE_APP_DATA_DELIVERY}data-catalog/data-warehouse/table-create-manual?domainGuid=${info.domainGuid}&domainName=${selectDataCatalogNodeObj.value.data.name}&metaStandard=${contextNodeData.value.guid}`);
}
}
} else if (btn.value == 'cancel') {
dialogInfo.value.visible = false;
}
}
</script>
<template>
......@@ -225,13 +328,17 @@ onBeforeUnmount(() => {
:tree-data="lastClickNode" v-loading="treeDataLoading" @nodeItemClick="handleNodeItemClick"
@contextMenu="handleContextMenu">
</RelationNetwork>
<Sankey v-show="lastClickNode?.guid && !isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)" v-loading="sankeyDataLoading" :tree-data="sankeyData" :names="sankeyNames">
<Sankey v-show="lastClickNode?.guid && !isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)"
v-loading="sankeyDataLoading" :tree-data="sankeyData" :names="sankeyNames">
</Sankey>
<div v-show="!lastClickNode?.guid && !treeInfo.data?.length || (!isGraphDisplay && !sankeyDataLoading && !sankeyNames?.length)" class="main-placeholder">
<div
v-show="!lastClickNode?.guid && !treeInfo.data?.length || (!isGraphDisplay && !sankeyDataLoading && !sankeyNames?.length)"
class="main-placeholder">
<img src="../../assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
<div class="empty-text">暂无数据</div>
</div>
</div>
<Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @treeSelectNodeChange="handleTreeSelectNodeChange" />
</div>
</template>
......
......@@ -203,7 +203,8 @@ const getDiseaseData = () => {
const getDataCatalog = () => {
return getDamCatalogList({ dataType: userData.superTubeFlag == 'Y' ? "P" : "D", sceneType: "D" }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data.records || [];
let data = res.data || [];
data.map(item => item.damGuid = item.guid);
typeMap.value.dataResourceGuid = JSON.parse(JSON.stringify(data));
let item = baseConfigFormItems.value.find(item => item.field == 'dataResourceGuid');
if (item) {
......@@ -458,7 +459,7 @@ const getModelDetail = (mGuid) => {
}
// 获取资源详情
const getResourceDetail = (sGuid, toPromise = true) => {
const detailData = getRegisterCatalogDetail(sGuid).then((res: any) => {
const detailData = getRegisterCatalogDetail({ guid: sGuid }).then((res: any) => {
if (res.code == proxy.$passCode) {
const data = res.data || {};
baseConfigFormItems.value.map(item => {
......
......@@ -730,7 +730,7 @@ const setSignatoryTableInfo = (row, isEdit = false) => {
},
{
label: "默认值", field: "defaultValue", width: 180, align: 'right', getName: (scope) => {
return scope.row.defaultValue !== null && scope.row.defaultValue !== '' ? changeNum(scope.row.defaultValue, 2) : '-'
return changeNum(scope.row.defaultValue, 2) || '-'
}
},
{
......
......@@ -667,9 +667,6 @@ const clickCreateGroup = () => {
formItems.value.map(item => {
if (item.field === 'orderNum') {
item.default = null;
} else if(item.field === 'damGuid'){
item.options = productList.value;
item.default = '';
} else {
item.default = "";
}
......@@ -956,6 +953,7 @@ const getProducts = () => {
if (res.code == proxy.$passCode) {
const data = res.data || [];
productList.value = data;
formItems.value.at(-2).options = data;
}
})
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!