3f016796 by lihua

修改产品登记样式;元数据添加删除按钮

1 parent c371ff14
......@@ -243,3 +243,9 @@ export const syncChangeDetail = (guid) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/sync-change-detail/${guid}`,
method: 'get',
})
/** 删除元数据查询数据库 */
export const delMetaDataSource = (databaseGuid) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/del-by-database-guid?databaseGuid=${databaseGuid}`,
method: 'delete',
})
\ No newline at end of file
......
......@@ -61,9 +61,6 @@ const searchItemList = ref([
props: {
value: 'value',
label: 'label'
},
style: {
width: '230px'
}
},
{
......@@ -478,12 +475,6 @@ const handleWindowResize = () => {
align-items: center;
}
:deep(.tools_search) {
.el-form-item .el-select {
width: 230px;
}
}
.table_panel_wrap {
margin-top: 16px;
position: relative;
......@@ -518,7 +509,8 @@ const handleWindowResize = () => {
.v-add {
width: 294px;
width: calc(25% - 20px);
min-width: 220px;
height: 268px;
// height: auto;
background: #FAFAFA;
......@@ -558,7 +550,8 @@ const handleWindowResize = () => {
}
.card-content {
width: 294px;
width: calc(25% - 20px);
min-width: 220px;
height: 268px;
// height: auto;
background: #FAFAFA;
......
......@@ -8,12 +8,13 @@ import { ElMessage, ElMessageBox } from "element-plus";
import Tree from '@/components/Tree/index.vue'
import Table from '@/components/Table/index.vue'
import { changeNum } from '@/utils/common'
import { useRouter ,useRoute} from "vue-router";
import { useRouter, useRoute } from "vue-router";
import {
getMetaTreeData,
getMetaDatabaseCollect,
getMetaDataBase,
getMetaDataSheet,
delMetaDataSource,
} from '@/api/modules/dataMetaService';
import { TableColumnWidth } from '@/utils/enum';
......@@ -22,7 +23,7 @@ const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const route = useRoute()
let dataSourceGuid = route.query.dataSourceGuid
let datasourceName = route.query.datasourceName
let datasourceName = route.query.datasourceName
const currNodeInfo: any = ref({})
const expandedKey: any = ref([])
const currentNodeKey = ref('')
......@@ -49,7 +50,7 @@ const cardMap = ref({
source: {
id: 'database-table',
count: [
{
{
label: '总表数',
field: 'tableCount',
value: 0,
......@@ -189,11 +190,16 @@ const tableInfo: any = ref({
actionInfo: {
label: "操作",
type: "btn",
width: 60,
width: 100,
fixed: 'right',
btns: [
{ label: "详情", value: "detail" },
],
btns: (scope) => {
return treeActive.value == 'source' ? [
{ label: "详情", value: "detail" },
{ label: "删除", value: "del" },
] : [
{ label: "详情", value: "detail" },
];
}
},
loading: false
})
......@@ -218,7 +224,7 @@ const getTreeData = () => {
treeInfo.value.expandedKey = expandedKey.value
})
getFirstPageData()
getDatabaseCount({ databaseGuid: currentNodeKey.value === "0" ? "" : currentNodeKey.value })
getDatabaseCount({ databaseGuid: currentNodeKey.value === "0" ? "" : currentNodeKey.value })
} else {
ElMessage.error(res.msg);
}
......@@ -307,12 +313,12 @@ const tableBtnClick = (scope, btn) => {
const row = scope.row;
currTableData.value = row;
if (type == "detail") {
if (treeActive.value == 'source') {
let params: any = {}
currentTitle.value = row.databaseNameZh
params.databaseGuid = row.databaseGuid
currNodeInfo.value.guid = row.databaseGuid
params.databaseGuid = row.databaseGuid
currNodeInfo.value.guid = row.databaseGuid
getDatabaseCount(params)
treeActive.value = 'database'
getFirstPageData();
......@@ -332,13 +338,28 @@ const tableBtnClick = (scope, btn) => {
}
})
}
} else if (type == 'del') {
proxy.$openMessageBox("确定要删除该数据库吗?", () => {
tableInfo.value.loading = true;
delMetaDataSource(row.databaseGuid).then((res: any) => {
tableInfo.value.loading = false;
if (res.code == proxy.$passCode) {
proxy.$ElMessage.success('删除数据库成功');
getTreeData();
} else {
proxy.$ElMessage.error(res.msg);
}
});
}, () => {
proxy.$ElMessage.info("已取消删除");
})
}
};
const filterValue = (row,num=1) => {
const filterValue = (row, num = 1) => {
let val: any = null
if (row.type == 'chnum') {
val = changeNum(row.value ? row.value/num : 0, row.fixedNum ?? 0)
val = changeNum(row.value ? row.value / num : 0, row.fixedNum ?? 0)
}
return val
}
......@@ -366,7 +387,7 @@ const nodeClick = (data) => {
})
}
}
const getQueryTreeData = ()=>{
const getQueryTreeData = () => {
treeInfo.value.loading = true
let params = {}
getMetaTreeData(params).then((res: any) => {
......@@ -379,27 +400,27 @@ const getQueryTreeData = ()=>{
if (treeList.length) {
expandedKey.value = [dataSourceGuid]
currentNodeKey.value = dataSourceGuid as string
currNodeInfo.value = {type:2,guid:dataSourceGuid,name:datasourceName}
currNodeInfo.value = { type: 2, guid: dataSourceGuid, name: datasourceName }
}
nextTick(() => {
treeInfo.value.currentNodeKey = <string>route.query.tableGuid || currentNodeKey.value;
treeInfo.value.expandedKey = expandedKey.value
})
nodeClick({type:2,guid:dataSourceGuid,name:datasourceName})
nodeClick({ type: 2, guid: dataSourceGuid, name: datasourceName })
dataSourceGuid = ""
}
}).catch(()=>{
}
}).catch(() => {
treeInfo.value.loading = false
})
}
onBeforeMount(() => {
cardList.value = cardMap.value[treeActive.value].count;
if(dataSourceGuid){
if (dataSourceGuid) {
getQueryTreeData()
} else {
getTreeData()
}
})
</script>
......@@ -407,18 +428,18 @@ onBeforeMount(() => {
<template>
<div class="container_wrap full flex">
<div class="aside_wrap">
<div class="aside_title" >数据库目录列表</div>
<div class="aside_title">数据库目录列表</div>
<Tree :treeInfo="treeInfo" @nodeClick="nodeClick" />
</div>
<div class="pane-trigger-con"></div>
<div class="main_wrap">
<div class="table_tool_wrap">
<div class="aside_title" style="padding: 0;">
<template v-if="currentTitle !=='数据库总览'">
<template v-if="currentTitle !== '数据库总览'">
<span>数据库:</span>{{ currentTitle }}
</template>
<template v-else>
{{ currentTitle }} <span >({{ databaseCount }})</span>
{{ currentTitle }} <span>({{ databaseCount }})</span>
</template>
</div>
<div class="card_panel">
......@@ -426,20 +447,17 @@ onBeforeMount(() => {
<img :src="item.icon" alt="">
<div class="tags_item">
<p class="tag_text">{{ item.label }}</p>
<template v-if="item.field==='dataCount'">
<el-tooltip
placement="top-start"
trigger="hover"
effect="light"
:show-after="400"
:content="filterValue(item)+'个'"
>
<p class="tag_num"><span>{{ filterValue(item,10000)}}</span><span class="unit">{{ ' ' + item.unit }}</span></p>
</el-tooltip>
<template v-if="item.field === 'dataCount'">
<el-tooltip placement="top-start" trigger="hover" effect="light" :show-after="400"
:content="filterValue(item) + '个'">
<p class="tag_num"><span>{{ filterValue(item, 10000) }}</span><span class="unit">{{ ' ' + item.unit
}}</span></p>
</el-tooltip>
</template>
<template v-else>
<p class="tag_num"><span>{{ filterValue(item) }}</span><span class="unit">{{ ' ' + item.unit }}</span></p>
<p class="tag_num"><span>{{ filterValue(item) }}</span><span class="unit">{{ ' ' + item.unit }}</span>
</p>
</template>
</div>
......@@ -465,9 +483,9 @@ onBeforeMount(() => {
.card_panel {
height: 48px;
// padding: 24px 0;
margin-bottom: 20px;
padding-top:10px ;
// padding: 24px 0;
margin-bottom: 20px;
padding-top: 10px;
display: flex;
// justify-content: space-between;
align-items: center;
......@@ -526,6 +544,7 @@ onBeforeMount(() => {
overflow: hidden auto;
}
}
.aside_title {
padding: 0 8px;
font-size: 14px;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!