修改产品登记样式;元数据添加删除按钮
Showing
3 changed files
with
54 additions
and
36 deletions
| ... | @@ -243,3 +243,9 @@ export const syncChangeDetail = (guid) => request({ | ... | @@ -243,3 +243,9 @@ export const syncChangeDetail = (guid) => request({ |
| 243 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/sync-change-detail/${guid}`, | 243 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/sync-change-detail/${guid}`, |
| 244 | method: 'get', | 244 | method: 'get', |
| 245 | }) | 245 | }) |
| 246 | |||
| 247 | /** 删除元数据查询数据库 */ | ||
| 248 | export const delMetaDataSource = (databaseGuid) => request({ | ||
| 249 | url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/del-by-database-guid?databaseGuid=${databaseGuid}`, | ||
| 250 | method: 'delete', | ||
| 251 | }) | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -61,9 +61,6 @@ const searchItemList = ref([ | ... | @@ -61,9 +61,6 @@ const searchItemList = ref([ |
| 61 | props: { | 61 | props: { |
| 62 | value: 'value', | 62 | value: 'value', |
| 63 | label: 'label' | 63 | label: 'label' |
| 64 | }, | ||
| 65 | style: { | ||
| 66 | width: '230px' | ||
| 67 | } | 64 | } |
| 68 | }, | 65 | }, |
| 69 | { | 66 | { |
| ... | @@ -478,12 +475,6 @@ const handleWindowResize = () => { | ... | @@ -478,12 +475,6 @@ const handleWindowResize = () => { |
| 478 | align-items: center; | 475 | align-items: center; |
| 479 | } | 476 | } |
| 480 | 477 | ||
| 481 | :deep(.tools_search) { | ||
| 482 | .el-form-item .el-select { | ||
| 483 | width: 230px; | ||
| 484 | } | ||
| 485 | } | ||
| 486 | |||
| 487 | .table_panel_wrap { | 478 | .table_panel_wrap { |
| 488 | margin-top: 16px; | 479 | margin-top: 16px; |
| 489 | position: relative; | 480 | position: relative; |
| ... | @@ -518,7 +509,8 @@ const handleWindowResize = () => { | ... | @@ -518,7 +509,8 @@ const handleWindowResize = () => { |
| 518 | 509 | ||
| 519 | 510 | ||
| 520 | .v-add { | 511 | .v-add { |
| 521 | width: 294px; | 512 | width: calc(25% - 20px); |
| 513 | min-width: 220px; | ||
| 522 | height: 268px; | 514 | height: 268px; |
| 523 | // height: auto; | 515 | // height: auto; |
| 524 | background: #FAFAFA; | 516 | background: #FAFAFA; |
| ... | @@ -558,7 +550,8 @@ const handleWindowResize = () => { | ... | @@ -558,7 +550,8 @@ const handleWindowResize = () => { |
| 558 | } | 550 | } |
| 559 | 551 | ||
| 560 | .card-content { | 552 | .card-content { |
| 561 | width: 294px; | 553 | width: calc(25% - 20px); |
| 554 | min-width: 220px; | ||
| 562 | height: 268px; | 555 | height: 268px; |
| 563 | // height: auto; | 556 | // height: auto; |
| 564 | background: #FAFAFA; | 557 | background: #FAFAFA; | ... | ... |
| ... | @@ -8,12 +8,13 @@ import { ElMessage, ElMessageBox } from "element-plus"; | ... | @@ -8,12 +8,13 @@ import { ElMessage, ElMessageBox } from "element-plus"; |
| 8 | import Tree from '@/components/Tree/index.vue' | 8 | import Tree from '@/components/Tree/index.vue' |
| 9 | import Table from '@/components/Table/index.vue' | 9 | import Table from '@/components/Table/index.vue' |
| 10 | import { changeNum } from '@/utils/common' | 10 | import { changeNum } from '@/utils/common' |
| 11 | import { useRouter ,useRoute} from "vue-router"; | 11 | import { useRouter, useRoute } from "vue-router"; |
| 12 | import { | 12 | import { |
| 13 | getMetaTreeData, | 13 | getMetaTreeData, |
| 14 | getMetaDatabaseCollect, | 14 | getMetaDatabaseCollect, |
| 15 | getMetaDataBase, | 15 | getMetaDataBase, |
| 16 | getMetaDataSheet, | 16 | getMetaDataSheet, |
| 17 | delMetaDataSource, | ||
| 17 | } from '@/api/modules/dataMetaService'; | 18 | } from '@/api/modules/dataMetaService'; |
| 18 | import { TableColumnWidth } from '@/utils/enum'; | 19 | import { TableColumnWidth } from '@/utils/enum'; |
| 19 | 20 | ||
| ... | @@ -189,11 +190,16 @@ const tableInfo: any = ref({ | ... | @@ -189,11 +190,16 @@ const tableInfo: any = ref({ |
| 189 | actionInfo: { | 190 | actionInfo: { |
| 190 | label: "操作", | 191 | label: "操作", |
| 191 | type: "btn", | 192 | type: "btn", |
| 192 | width: 60, | 193 | width: 100, |
| 193 | fixed: 'right', | 194 | fixed: 'right', |
| 194 | btns: [ | 195 | btns: (scope) => { |
| 196 | return treeActive.value == 'source' ? [ | ||
| 195 | { label: "详情", value: "detail" }, | 197 | { label: "详情", value: "detail" }, |
| 196 | ], | 198 | { label: "删除", value: "del" }, |
| 199 | ] : [ | ||
| 200 | { label: "详情", value: "detail" }, | ||
| 201 | ]; | ||
| 202 | } | ||
| 197 | }, | 203 | }, |
| 198 | loading: false | 204 | loading: false |
| 199 | }) | 205 | }) |
| ... | @@ -332,13 +338,28 @@ const tableBtnClick = (scope, btn) => { | ... | @@ -332,13 +338,28 @@ const tableBtnClick = (scope, btn) => { |
| 332 | } | 338 | } |
| 333 | }) | 339 | }) |
| 334 | } | 340 | } |
| 341 | } else if (type == 'del') { | ||
| 342 | proxy.$openMessageBox("确定要删除该数据库吗?", () => { | ||
| 343 | tableInfo.value.loading = true; | ||
| 344 | delMetaDataSource(row.databaseGuid).then((res: any) => { | ||
| 345 | tableInfo.value.loading = false; | ||
| 346 | if (res.code == proxy.$passCode) { | ||
| 347 | proxy.$ElMessage.success('删除数据库成功'); | ||
| 348 | getTreeData(); | ||
| 349 | } else { | ||
| 350 | proxy.$ElMessage.error(res.msg); | ||
| 351 | } | ||
| 352 | }); | ||
| 353 | }, () => { | ||
| 354 | proxy.$ElMessage.info("已取消删除"); | ||
| 355 | }) | ||
| 335 | } | 356 | } |
| 336 | }; | 357 | }; |
| 337 | 358 | ||
| 338 | const filterValue = (row,num=1) => { | 359 | const filterValue = (row, num = 1) => { |
| 339 | let val: any = null | 360 | let val: any = null |
| 340 | if (row.type == 'chnum') { | 361 | if (row.type == 'chnum') { |
| 341 | val = changeNum(row.value ? row.value/num : 0, row.fixedNum ?? 0) | 362 | val = changeNum(row.value ? row.value / num : 0, row.fixedNum ?? 0) |
| 342 | } | 363 | } |
| 343 | return val | 364 | return val |
| 344 | } | 365 | } |
| ... | @@ -366,7 +387,7 @@ const nodeClick = (data) => { | ... | @@ -366,7 +387,7 @@ const nodeClick = (data) => { |
| 366 | }) | 387 | }) |
| 367 | } | 388 | } |
| 368 | } | 389 | } |
| 369 | const getQueryTreeData = ()=>{ | 390 | const getQueryTreeData = () => { |
| 370 | treeInfo.value.loading = true | 391 | treeInfo.value.loading = true |
| 371 | let params = {} | 392 | let params = {} |
| 372 | getMetaTreeData(params).then((res: any) => { | 393 | getMetaTreeData(params).then((res: any) => { |
| ... | @@ -379,22 +400,22 @@ const getQueryTreeData = ()=>{ | ... | @@ -379,22 +400,22 @@ const getQueryTreeData = ()=>{ |
| 379 | if (treeList.length) { | 400 | if (treeList.length) { |
| 380 | expandedKey.value = [dataSourceGuid] | 401 | expandedKey.value = [dataSourceGuid] |
| 381 | currentNodeKey.value = dataSourceGuid as string | 402 | currentNodeKey.value = dataSourceGuid as string |
| 382 | currNodeInfo.value = {type:2,guid:dataSourceGuid,name:datasourceName} | 403 | currNodeInfo.value = { type: 2, guid: dataSourceGuid, name: datasourceName } |
| 383 | } | 404 | } |
| 384 | nextTick(() => { | 405 | nextTick(() => { |
| 385 | treeInfo.value.currentNodeKey = <string>route.query.tableGuid || currentNodeKey.value; | 406 | treeInfo.value.currentNodeKey = <string>route.query.tableGuid || currentNodeKey.value; |
| 386 | treeInfo.value.expandedKey = expandedKey.value | 407 | treeInfo.value.expandedKey = expandedKey.value |
| 387 | }) | 408 | }) |
| 388 | nodeClick({type:2,guid:dataSourceGuid,name:datasourceName}) | 409 | nodeClick({ type: 2, guid: dataSourceGuid, name: datasourceName }) |
| 389 | dataSourceGuid = "" | 410 | dataSourceGuid = "" |
| 390 | } | 411 | } |
| 391 | }).catch(()=>{ | 412 | }).catch(() => { |
| 392 | treeInfo.value.loading = false | 413 | treeInfo.value.loading = false |
| 393 | }) | 414 | }) |
| 394 | } | 415 | } |
| 395 | onBeforeMount(() => { | 416 | onBeforeMount(() => { |
| 396 | cardList.value = cardMap.value[treeActive.value].count; | 417 | cardList.value = cardMap.value[treeActive.value].count; |
| 397 | if(dataSourceGuid){ | 418 | if (dataSourceGuid) { |
| 398 | getQueryTreeData() | 419 | getQueryTreeData() |
| 399 | } else { | 420 | } else { |
| 400 | getTreeData() | 421 | getTreeData() |
| ... | @@ -407,18 +428,18 @@ onBeforeMount(() => { | ... | @@ -407,18 +428,18 @@ onBeforeMount(() => { |
| 407 | <template> | 428 | <template> |
| 408 | <div class="container_wrap full flex"> | 429 | <div class="container_wrap full flex"> |
| 409 | <div class="aside_wrap"> | 430 | <div class="aside_wrap"> |
| 410 | <div class="aside_title" >数据库目录列表</div> | 431 | <div class="aside_title">数据库目录列表</div> |
| 411 | <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" /> | 432 | <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" /> |
| 412 | </div> | 433 | </div> |
| 413 | <div class="pane-trigger-con"></div> | 434 | <div class="pane-trigger-con"></div> |
| 414 | <div class="main_wrap"> | 435 | <div class="main_wrap"> |
| 415 | <div class="table_tool_wrap"> | 436 | <div class="table_tool_wrap"> |
| 416 | <div class="aside_title" style="padding: 0;"> | 437 | <div class="aside_title" style="padding: 0;"> |
| 417 | <template v-if="currentTitle !=='数据库总览'"> | 438 | <template v-if="currentTitle !== '数据库总览'"> |
| 418 | <span>数据库:</span>{{ currentTitle }} | 439 | <span>数据库:</span>{{ currentTitle }} |
| 419 | </template> | 440 | </template> |
| 420 | <template v-else> | 441 | <template v-else> |
| 421 | {{ currentTitle }} <span >({{ databaseCount }})</span> | 442 | {{ currentTitle }} <span>({{ databaseCount }})</span> |
| 422 | </template> | 443 | </template> |
| 423 | </div> | 444 | </div> |
| 424 | <div class="card_panel"> | 445 | <div class="card_panel"> |
| ... | @@ -426,20 +447,17 @@ onBeforeMount(() => { | ... | @@ -426,20 +447,17 @@ onBeforeMount(() => { |
| 426 | <img :src="item.icon" alt=""> | 447 | <img :src="item.icon" alt=""> |
| 427 | <div class="tags_item"> | 448 | <div class="tags_item"> |
| 428 | <p class="tag_text">{{ item.label }}</p> | 449 | <p class="tag_text">{{ item.label }}</p> |
| 429 | <template v-if="item.field==='dataCount'"> | 450 | <template v-if="item.field === 'dataCount'"> |
| 430 | <el-tooltip | 451 | <el-tooltip placement="top-start" trigger="hover" effect="light" :show-after="400" |
| 431 | placement="top-start" | 452 | :content="filterValue(item) + '个'"> |
| 432 | trigger="hover" | 453 | <p class="tag_num"><span>{{ filterValue(item, 10000) }}</span><span class="unit">{{ ' ' + item.unit |
| 433 | effect="light" | 454 | }}</span></p> |
| 434 | :show-after="400" | ||
| 435 | :content="filterValue(item)+'个'" | ||
| 436 | > | ||
| 437 | <p class="tag_num"><span>{{ filterValue(item,10000)}}</span><span class="unit">{{ ' ' + item.unit }}</span></p> | ||
| 438 | </el-tooltip> | 455 | </el-tooltip> |
| 439 | 456 | ||
| 440 | </template> | 457 | </template> |
| 441 | <template v-else> | 458 | <template v-else> |
| 442 | <p class="tag_num"><span>{{ filterValue(item) }}</span><span class="unit">{{ ' ' + item.unit }}</span></p> | 459 | <p class="tag_num"><span>{{ filterValue(item) }}</span><span class="unit">{{ ' ' + item.unit }}</span> |
| 460 | </p> | ||
| 443 | </template> | 461 | </template> |
| 444 | 462 | ||
| 445 | </div> | 463 | </div> |
| ... | @@ -467,7 +485,7 @@ onBeforeMount(() => { | ... | @@ -467,7 +485,7 @@ onBeforeMount(() => { |
| 467 | height: 48px; | 485 | height: 48px; |
| 468 | // padding: 24px 0; | 486 | // padding: 24px 0; |
| 469 | margin-bottom: 20px; | 487 | margin-bottom: 20px; |
| 470 | padding-top:10px ; | 488 | padding-top: 10px; |
| 471 | display: flex; | 489 | display: flex; |
| 472 | // justify-content: space-between; | 490 | // justify-content: space-between; |
| 473 | align-items: center; | 491 | align-items: center; |
| ... | @@ -526,6 +544,7 @@ onBeforeMount(() => { | ... | @@ -526,6 +544,7 @@ onBeforeMount(() => { |
| 526 | overflow: hidden auto; | 544 | overflow: hidden auto; |
| 527 | } | 545 | } |
| 528 | } | 546 | } |
| 547 | |||
| 529 | .aside_title { | 548 | .aside_title { |
| 530 | padding: 0 8px; | 549 | padding: 0 8px; |
| 531 | font-size: 14px; | 550 | font-size: 14px; | ... | ... |
-
Please register or sign in to post a comment