Compare commits

...

2 Commits

Author SHA1 Message Date
xueyinfei e437ec550f Merge remote-tracking branch 'origin/master' 2 days ago
xueyinfei b1cb66973e 元数据 业务关系优化 2 days ago
  1. 12
      vue-fastapi-backend/module_admin/dao/meta_dao.py
  2. 3
      vue-fastapi-backend/module_admin/service/meta_service.py
  3. 20
      vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue
  4. 2
      vue-fastapi-frontend/src/views/meta/metaInfo/index.vue

12
vue-fastapi-backend/module_admin/dao/meta_dao.py

@ -494,6 +494,18 @@ class MetaDao:
)).first()
return CamelCaseUtil.transform_result(result)
@classmethod
async def get_meta_table_cn_name(cls, db: AsyncSession, sysCode, mdlName, tabEngName):
sql = text("select case when a.tab_cn_name is null then b.tab_crrct_name"
" when a.tab_cn_name is not null then a.tab_cn_name end as tab_cn_name"
" from t_metadata_extract_info a "
"left join t_metadata_supp_info b "
"on a.ssys_cd = b.ssys_cd and a.mdl_name=b.mdl_name and a.tab_eng_name=b.tab_crrct_name "
"where a.ssys_cd = :sysCode and a.mdl_name = :mdlName and a.tab_eng_name = :tabEngName")
result = (await db.execute(sql, {"sysCode": sysCode, "mdlName": mdlName, "tabEngName": tabEngName}))
return result.first().tab_cn_name
@classmethod
async def get_meta_col_name_list(cls, db: AsyncSession, query_object: MetaColObject):
query_result = (

3
vue-fastapi-backend/module_admin/service/meta_service.py

@ -402,6 +402,9 @@ class MetaService:
query_object.tab_name = table['tab_eng_name']
meta_result = await MetaDao.get_meta_col_name_list(result_db, query_object)
result = CamelCaseUtil.transform_result(meta_result)
tableCnName = await MetaDao.get_meta_table_cn_name(result_db, table['ssys_cd'], table['mdl_name'],
table['tab_eng_name'])
table['tab_cn_name'] = tableCnName
table['column'] = result
result = {
"tableList": tableList,

20
vue-fastapi-frontend/src/views/meta/metaInfo/businssRelation.vue

@ -10,8 +10,14 @@ const props = defineProps({
type: Object,
default: () => {}
},
type: {
type:String,
default:()=>""
},
currentTable: {
type:Object,
default:()=>{}
}
})
const g6data = ref([])
@ -300,7 +306,7 @@ function initG6() {
registerNode("dice-er-box", {
draw(cfg, group) {
const width = 250;
const width = 300;
const {
attrs = [],
startIndex = 0,
@ -308,10 +314,16 @@ function initG6() {
collapsed,
icon,
} = cfg;
let currentTableLabel = props.currentTable.tabEngName
if (props.currentTable.tabCnName && props.currentTable.tabCnName.length>0){
currentTableLabel += "("+props.currentTable.tabCnName+")"
}else if (props.currentTable.tabCrrctName && props.currentTable.tabCnName.tabCrrctName>0){
currentTableLabel += "("+props.currentTable.tabCrrctName+")"
}
const list = attrs;
const itemCount = list.length;
const boxStyle = {
stroke: "#096DD9",
stroke: currentTableLabel === cfg.label?"#67C23A":"#096DD9",
radius: 4,
};
const afterList = list.slice(
@ -596,7 +608,7 @@ function initG6() {
width,
height,
defaultNode: {
size: [300, 200],
size: [350, 200],
type: 'dice-er-box',
color: '#5B8FF9',
style: {
@ -646,7 +658,7 @@ watch(
let table = props.data.tableList[i]
let g6Tab = {
id: table.ssys_cd+"-"+table.mdl_name+"-"+table.tab_eng_name,
label: table.tab_eng_name,
label: table.tab_eng_name + ((table.tab_cn_name && table.tab_cn_name.length>0)?"("+table.tab_cn_name+")":""),
attrs:[],
collapsed:true
}

2
vue-fastapi-frontend/src/views/meta/metaInfo/index.vue

@ -321,7 +321,7 @@
</el-form>
</div>
<div style="width: 100%;height: 100%">
<businss-relation :data="businessRelation" :type="businessOptionSelect"></businss-relation>
<businss-relation :currentTable="currentMetaData" :data="businessRelation" :type="businessOptionSelect"></businss-relation>
</div>
</div>
</el-tab-pane>

Loading…
Cancel
Save