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({ ...@@ -401,3 +401,10 @@ export const getSankeyData = (guid) => request({
401 url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/sankey-data?metaStandardGuid=${guid}`, 401 url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/sankey-data?metaStandardGuid=${guid}`,
402 method: 'get' 402 method: 'get'
403 }) 403 })
404
405 /** 数仓目录树列表查询 */
406 export const getDataWareCatalogList = (params) => request({
407 url: `${import.meta.env.VITE_APP_DATA_DELIVERY}delivery/ms-daop-data-plan-service/data-catalog-directory/tree-list`,
408 method: 'post',
409 data: params
410 })
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -335,6 +335,22 @@ onMounted(() => { ...@@ -335,6 +335,22 @@ onMounted(() => {
335 const observeResize = () => { 335 const observeResize = () => {
336 resizeObserver.value = new ResizeObserver(() => { 336 resizeObserver.value = new ResizeObserver(() => {
337 let domWidth = document.documentElement.clientWidth; 337 let domWidth = document.documentElement.clientWidth;
338 if (lastSelectNode.value) {
339 tooltip1Ref.value.style.display = 'none';
340 graphRef.value.updateItem(lastSelectNode.value, {
341 labelCfg: {
342 style: {
343 fill: '#212121',
344 },
345 },
346 style: {
347 stroke: '#4fa1a4',
348 fill: '#ebf6f7',
349 cursor: 'pointer'
350 }
351 });
352 }
353 lastSelectNode.value = null;
338 if (domWidth < 992) {//根据setting.ts里的设置,小于992,会隐藏左边的菜单栏, 354 if (domWidth < 992) {//根据setting.ts里的设置,小于992,会隐藏左边的菜单栏,
339 setTimeout(() => { 355 setTimeout(() => {
340 const container: any = containerRef.value; 356 const container: any = containerRef.value;
...@@ -591,6 +607,7 @@ defineExpose({ ...@@ -591,6 +607,7 @@ defineExpose({
591 margin-top: 8px; 607 margin-top: 8px;
592 font-size: 14px; 608 font-size: 14px;
593 color: #666666; 609 color: #666666;
610 word-break: break-all;
594 line-height: 21px; 611 line-height: 21px;
595 } 612 }
596 } 613 }
......
...@@ -120,6 +120,9 @@ export const filterCascaderData = (data, field, val, type = 'disabled') => { ...@@ -120,6 +120,9 @@ export const filterCascaderData = (data, field, val, type = 'disabled') => {
120 } 120 }
121 // 数字千分位 保留两位小数 121 // 数字千分位 保留两位小数
122 export const changeNum = (num, fixed = 0, round = false) => { 122 export const changeNum = (num, fixed = 0, round = false) => {
123 if(num === '' || num === null || num === undefined){
124 return '';
125 }
123 num = parseFloat(num); 126 num = parseFloat(num);
124 if (round) { 127 if (round) {
125 let parts = num.toFixed(fixed).split(".") 128 let parts = num.toFixed(fixed).split(".")
......
...@@ -9,6 +9,7 @@ import Sankey from './components/Sankey.vue'; ...@@ -9,6 +9,7 @@ import Sankey from './components/Sankey.vue';
9 import Tree from '@/components/Tree/index.vue'; 9 import Tree from '@/components/Tree/index.vue';
10 import RelationNetwork from '@/components/RelationNetwork/index.vue'; 10 import RelationNetwork from '@/components/RelationNetwork/index.vue';
11 import { 11 import {
12 getDataWareCatalogList,
12 getMetaStandardTreeList, 13 getMetaStandardTreeList,
13 getMetaStandardField, 14 getMetaStandardField,
14 getSankeyData 15 getSankeyData
...@@ -17,6 +18,10 @@ import { useRouter, useRoute } from "vue-router"; ...@@ -17,6 +18,10 @@ import { useRouter, useRoute } from "vue-router";
17 import useDataMetaStore from "@/store/modules/dataMeta" 18 import useDataMetaStore from "@/store/modules/dataMeta"
18 import { cloneDeep } from 'lodash-es'; 19 import { cloneDeep } from 'lodash-es';
19 20
21 import { useValidator } from '@/hooks/useValidator';
22
23 const { required } = useValidator();
24
20 const router = useRouter(); 25 const router = useRouter();
21 const route = useRoute() 26 const route = useRoute()
22 27
...@@ -126,7 +131,7 @@ onActivated(() => { ...@@ -126,7 +131,7 @@ onActivated(() => {
126 131
127 onBeforeMount(async () => { 132 onBeforeMount(async () => {
128 await getTreeData() 133 await getTreeData()
129 // processRouter(); 134 // processRouter();
130 }) 135 })
131 136
132 onMounted(() => { }) 137 onMounted(() => { })
...@@ -200,15 +205,113 @@ const handleNodeItemClick = (graph, nodeItem) => { ...@@ -200,15 +205,113 @@ const handleNodeItemClick = (graph, nodeItem) => {
200 }) 205 })
201 } 206 }
202 207
203 const handleContextMenu = (nodeData) => { 208 const handleContextMenu = (model) => {
204 //TODO,新建引用数据集 209 if (model.isHaveData == 'N') {
205 window.open(''); 210 ElMessage.warning('当前标准下无字段,请先添加字段');
211 return;
212 }
213 contextNodeData.value = model;
214 dialogInfo.value.visible = true;
215 formItems.value[0].default = '';
216 getDataWareCatalogList({}).then((res: any) => {
217 if (res?.code == proxy.$passCode) {
218 dataCatalogList.value = res.data || [];
219 formItems.value[0].options = dataCatalogList.value;
220 } else {
221 ElMessage.error(res.msg);
222 }
223 })
206 } 224 }
207 225
208 onBeforeUnmount(() => { 226 onBeforeUnmount(() => {
209 relationNetworkRef.value.destroy(); 227 relationNetworkRef.value.destroy();
210 }) 228 })
211 229
230 /** 数仓目录树形列表 */
231 const dataCatalogList = ref([{
232 name: '测试',
233 guid: '1',
234 children: [{
235 name: 'cesi',
236 guid: '1-1'
237 }]
238 }]);
239
240 const formItems = ref([{
241 label: "数仓目录",
242 type: "tree-select",
243 placeholder: "请选择",
244 field: "domainGuid",
245 default: '',
246 options: dataCatalogList.value,
247 props: {
248 label: 'name',
249 value: 'guid'
250 },
251 showAllLevels: false,
252 checkStrictly: false,//只能选择叶子节点。
253 lazy: false,
254 filterable: true,
255 clearable: true,
256 required: true,
257 }]);
258
259 const formRules = ref({
260 domainGuid: [required('请选择数仓目录')],
261 });
262
263 const dialogInfo = ref({
264 visible: false,
265 size: 400,
266 direction: "column",
267 header: {
268 title: "引用标准新建数据集",
269 },
270 type: '',
271 contents: [
272 {
273 type: 'form',
274 title: '',
275 formInfo: {
276 id: 'select-subject-domain-list',
277 items: formItems.value,
278 rules: formRules.value
279 }
280 }
281 ],
282 footer: {
283 btns: [
284 { type: "default", label: "取消", value: "cancel" },
285 { type: "primary", label: "确定", value: "submit", loading: false },
286 ],
287 },
288 });
289
290 const contextNodeData: any = ref({});
291
292 const selectDataCatalogNodeObj: any = ref({});
293
294 const handleTreeSelectNodeChange = (node, item, nodeObj) => {
295 selectDataCatalogNodeObj.value = nodeObj;
296 }
297
298 const dialogBtnClick = (btn, info) => {
299 if (btn.value == 'submit') {
300 dialogInfo.value.visible = false;
301 if (selectDataCatalogNodeObj.value.parent.data.layereAttribute == 2) { //维度
302 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}`);
303 } else {
304 if (selectDataCatalogNodeObj.value.parent.data.layereAttribute == 4) {
305 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}`);
306 } else {
307 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}`);
308 }
309 }
310 } else if (btn.value == 'cancel') {
311 dialogInfo.value.visible = false;
312 }
313 }
314
212 </script> 315 </script>
213 316
214 <template> 317 <template>
...@@ -225,13 +328,17 @@ onBeforeUnmount(() => { ...@@ -225,13 +328,17 @@ onBeforeUnmount(() => {
225 :tree-data="lastClickNode" v-loading="treeDataLoading" @nodeItemClick="handleNodeItemClick" 328 :tree-data="lastClickNode" v-loading="treeDataLoading" @nodeItemClick="handleNodeItemClick"
226 @contextMenu="handleContextMenu"> 329 @contextMenu="handleContextMenu">
227 </RelationNetwork> 330 </RelationNetwork>
228 <Sankey v-show="lastClickNode?.guid && !isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)" v-loading="sankeyDataLoading" :tree-data="sankeyData" :names="sankeyNames"> 331 <Sankey v-show="lastClickNode?.guid && !isGraphDisplay && (sankeyNames?.length || sankeyDataLoading)"
332 v-loading="sankeyDataLoading" :tree-data="sankeyData" :names="sankeyNames">
229 </Sankey> 333 </Sankey>
230 <div v-show="!lastClickNode?.guid && !treeInfo.data?.length || (!isGraphDisplay && !sankeyDataLoading && !sankeyNames?.length)" class="main-placeholder"> 334 <div
335 v-show="!lastClickNode?.guid && !treeInfo.data?.length || (!isGraphDisplay && !sankeyDataLoading && !sankeyNames?.length)"
336 class="main-placeholder">
231 <img src="../../assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" /> 337 <img src="../../assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
232 <div class="empty-text">暂无数据</div> 338 <div class="empty-text">暂无数据</div>
233 </div> 339 </div>
234 </div> 340 </div>
341 <Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @treeSelectNodeChange="handleTreeSelectNodeChange" />
235 </div> 342 </div>
236 </template> 343 </template>
237 344
......
...@@ -203,7 +203,8 @@ const getDiseaseData = () => { ...@@ -203,7 +203,8 @@ const getDiseaseData = () => {
203 const getDataCatalog = () => { 203 const getDataCatalog = () => {
204 return getDamCatalogList({ dataType: userData.superTubeFlag == 'Y' ? "P" : "D", sceneType: "D" }).then((res: any) => { 204 return getDamCatalogList({ dataType: userData.superTubeFlag == 'Y' ? "P" : "D", sceneType: "D" }).then((res: any) => {
205 if (res.code == proxy.$passCode) { 205 if (res.code == proxy.$passCode) {
206 const data = res.data.records || []; 206 let data = res.data || [];
207 data.map(item => item.damGuid = item.guid);
207 typeMap.value.dataResourceGuid = JSON.parse(JSON.stringify(data)); 208 typeMap.value.dataResourceGuid = JSON.parse(JSON.stringify(data));
208 let item = baseConfigFormItems.value.find(item => item.field == 'dataResourceGuid'); 209 let item = baseConfigFormItems.value.find(item => item.field == 'dataResourceGuid');
209 if (item) { 210 if (item) {
...@@ -458,7 +459,7 @@ const getModelDetail = (mGuid) => { ...@@ -458,7 +459,7 @@ const getModelDetail = (mGuid) => {
458 } 459 }
459 // 获取资源详情 460 // 获取资源详情
460 const getResourceDetail = (sGuid, toPromise = true) => { 461 const getResourceDetail = (sGuid, toPromise = true) => {
461 const detailData = getRegisterCatalogDetail(sGuid).then((res: any) => { 462 const detailData = getRegisterCatalogDetail({ guid: sGuid }).then((res: any) => {
462 if (res.code == proxy.$passCode) { 463 if (res.code == proxy.$passCode) {
463 const data = res.data || {}; 464 const data = res.data || {};
464 baseConfigFormItems.value.map(item => { 465 baseConfigFormItems.value.map(item => {
......
...@@ -730,7 +730,7 @@ const setSignatoryTableInfo = (row, isEdit = false) => { ...@@ -730,7 +730,7 @@ const setSignatoryTableInfo = (row, isEdit = false) => {
730 }, 730 },
731 { 731 {
732 label: "默认值", field: "defaultValue", width: 180, align: 'right', getName: (scope) => { 732 label: "默认值", field: "defaultValue", width: 180, align: 'right', getName: (scope) => {
733 return scope.row.defaultValue !== null && scope.row.defaultValue !== '' ? changeNum(scope.row.defaultValue, 2) : '-' 733 return changeNum(scope.row.defaultValue, 2) || '-'
734 } 734 }
735 }, 735 },
736 { 736 {
......
...@@ -667,9 +667,6 @@ const clickCreateGroup = () => { ...@@ -667,9 +667,6 @@ const clickCreateGroup = () => {
667 formItems.value.map(item => { 667 formItems.value.map(item => {
668 if (item.field === 'orderNum') { 668 if (item.field === 'orderNum') {
669 item.default = null; 669 item.default = null;
670 } else if(item.field === 'damGuid'){
671 item.options = productList.value;
672 item.default = '';
673 } else { 670 } else {
674 item.default = ""; 671 item.default = "";
675 } 672 }
...@@ -956,6 +953,7 @@ const getProducts = () => { ...@@ -956,6 +953,7 @@ const getProducts = () => {
956 if (res.code == proxy.$passCode) { 953 if (res.code == proxy.$passCode) {
957 const data = res.data || []; 954 const data = res.data || [];
958 productList.value = data; 955 productList.value = data;
956 formItems.value.at(-2).options = data;
959 } 957 }
960 }) 958 })
961 } 959 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!