88d2782b by lihua

新建数据集

1 parent 6f2a062d
...@@ -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
......
...@@ -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
...@@ -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
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!