e7fc36f3 by xukangle

updata: 增加元数据模块

1 parent 8ad5d02b
......@@ -3,8 +3,8 @@ VITE_APP_TITLE = 数据资产管理系统
# 接口域名
# VITE_API_BASEURL = https://www.zgsjzc.com/api
# VITE_API_BASEURL = https://swzl-test.csbr.cn/api
VITE_API_BASEURL = http://localhost:9000
# VITE_API_BASEURL = http://10.4.82.1:28052/
# VITE_API_BASEURL = http://localhost:9000
VITE_API_BASEURL = http://10.4.82.1:28052/
# 平台用户 接口请地址
VITE_APP_USER_API_BASEURL = gateway-server
......@@ -13,6 +13,7 @@ VITE_APP_AUTH_URL = 'ms-daop-auth-service'
# 系统管理 接口地址
VITE_APP_API_BASEURL = ms-daop-zcgl-system-manager-service
# 文件上传请求地址
VITE_APP_ADD_FILE = ms-daop-import-data-service
# 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
......@@ -29,8 +30,8 @@ VITE_APP_PLAN_BASEURL = ms-daop-jgjf-data-plan-service
VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service
#数据盘点接口地址ms-daop-zcgl-data-inventory
VITE_APP_CHECK_BASEURL = /mock
# VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
# VITE_APP_CHECK_BASEURL = /mock
VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
#门户接口
VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal
......
......@@ -2,6 +2,159 @@ import request from "@/utils/request";
/**
* 数据字典
**/
// 编码规则流水号
export const getCoderuleList = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/code-rule/list`,
method: 'post',
data: params
})
// 获取数据类型的接口
export const getDataTypeList = (params) => request({
url: `${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`,
method: 'post',
data: params,
})
// 获取数据库列表
export const getDataBaseList = (params) => request({
url: `${import.meta.env.VITE_APP_API_BASEURL}/data-source/get-source-list`,
method: 'post',
data: params,
})
// 新增
export const addDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/add`,
method: 'post',
data: params
})
// 删除
export const deleteDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/del`,
method: 'delete',
data: params
})
// 删除数据字典前的校验
export const checkDeleteDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check-del`,
method: 'delete',
data: params
})
// 编辑校验数据结构删除的条件
export const checkDeleteDictionaryScheme = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check-del/dictionary-scheme`,
method: 'post',
data: params
})
// 分页查询
export const getDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/page-list`,
method: 'post',
data: params
})
// 查询数据字典启用状态的数据
export const getDictionaryAll = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/list-all`,
method: 'post',
params
})
// 修改
export const updateDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/update`,
method: 'put',
data: params
})
// 详情
export const getDictionaryDetail = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/detail/${params}`,
method: 'get'
})
// 查看数据字典数据
export const getDictionaryFileds = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/dictionary-data/${params}`,
method: 'get'
})
// 数据字典启用停用
export const updateDictionaryState = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/change-state`,
method: 'get',
params
})
// 检验是否存在
export const checkDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check-exist`,
method: 'get',
params
})
// 数据字典新增数据时生成编码规则
export const getDictionaryRuleData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/generate/code-rule/byGuid`,
method: 'get',
params
})
// 数据字典树形数据
export const getDictionaryTree = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/tree-list`,
method: 'post',
params
})
// 保存动态数据字典数据
export const saveDictionaryData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/save/dictionary-data`,
method: 'post',
data: params
})
// 更新数据字典数据
export const updateDictionaryData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/update/dictionary-data`,
method: 'post',
data: params
})
// 删除数据字典数据
export const deleteDictionaryData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/del/dictionary-data`,
method: 'delete',
data: params
})
// 导入数据字典
export const importDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/import/data-dictionary`,
method: 'post',
data: params
})
// 显示导入的数据字典数据
export const showDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/import/show/data-dictionary`,
method: 'post',
data: params,
headers: {
'Content-Type': 'multipart/form-data'
}
})
// 导出数据字典模板
export const exportDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/export/data-dictionary/schema`,
method: 'post',
data: params,
responseType: 'blob'
})
// 导出数据字典数据
export const exportDictionaryFileds = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/export/data-dictionary/data`,
method: 'post',
data: params,
responseType: 'blob'
})
// 验证数据是否符合标准
export const checkDictionaryData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check/dictionary-data`,
method: 'post',
data: params
})
/**
* 获取数据级别
* @param {Object}
* { paramCode: "DATA-CLASSIFY" }
......@@ -230,10 +383,10 @@ export const getCgDirFieldPageList = (data) => request({
/** 获取字典列表
* VITE_APP_PLAN_BASEURL 为环境变量 现在只是mock数据
*/
export const getDictionary = (params) => request({
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`,
method: 'post'
})
// export const getDictionary = (params) => request({
// url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`,
// method: 'post'
// })
......@@ -268,3 +421,8 @@ export const getDbDirTablePageList = (data) => request({
method: 'post',
data
})
......
......@@ -17,10 +17,11 @@ export const deleteMetaDataTask = (params) => request({
})
// 分页查询
export const getMetaDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/page-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/page-list`,
method: 'post',
data: params
})
// 修改
export const updateMetaDataTask = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/update`,
......@@ -57,7 +58,7 @@ export const getMetaDataTaskLog = (params) => request({
method: 'post',
data: params
})
//
//
export const saveMetaReportAnalysis = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage-analysis-report/add`,
method: 'post',
......@@ -65,34 +66,34 @@ export const saveMetaReportAnalysis = (params) => request({
})
/**
* 元数据-元数据查询
**/
**/
// 树形数据
export const getMetaTreeData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-tree-list`,
method: 'post',
data: params
})
// 数据库汇总信息
export const getMetaDatabaseCollect = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-database-collect-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-database-collect-list`,
method: 'post',
data: params
})
// 库分页查询
export const getMetaDataBase = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-collect-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-collect-list`,
method: 'post',
data: params
})
// 表分页查询
export const getMetaDataSheet = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-detail-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-detail-list`,
method: 'post',
data: params
})
// 表字段查询
export const getMetaSheetField = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-field-list`,
url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-field-list`,
method: 'post',
params
})
......@@ -114,7 +115,7 @@ export const getMetaChangeRecord = (params) => request({
method: 'post',
data: params
})
//
//
export const getMetacompareList = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-change-compare-list/${params}`,
method: 'get',
......@@ -216,7 +217,7 @@ export const updateAnalysisRepor = (params) => request({
method: 'put',
data: params
})
/** 删除边 */
/** 删除边 */
export const delLineAge = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/del-edge?euid=${params}`,
method: 'delete',
......@@ -226,7 +227,7 @@ export const checkTableData = (params) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/check-table-data/${params}`,
method: 'get',
})
/**校验任务是否有数据库信息 */
/**校验任务是否有数据库信息 */
export const checkDatabaseIsExist = (dataSourceGuid) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/check-database-is-exist/${dataSourceGuid}`,
method: 'get',
......@@ -236,4 +237,4 @@ export const checkDatabaseIsExist = (dataSourceGuid) => request({
export const syncChangeDetail = (guid) => request({
url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/sync-change-detail/${guid}`,
method: 'get',
})
\ No newline at end of file
})
......
......@@ -231,7 +231,28 @@ const routes: RouteRecordRaw[] = [
},
},
],
}
},
{
path: '/data-standards/data-dictionary',
component: Layout,
meta: {
title: '数据字典',
icon: 'sidebar-cooperation',
},
children: [
{
path: '',
name: 'dictionary',
component: () => import('@/views/data_standards/dictionary.vue'),
meta: {
title: '数据字典',
sidebar: false,
breadcrumb: false,
cache: true
},
},
],
},
]
export default routes
......
......@@ -58,6 +58,7 @@ const useUserStore = defineStore(
userName.value = res.data.userName
// userData.value = JSON.stringify(res.data.data);
currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : '';
localStorage.setItem('currentTenantGuid', currentTenantGuid.value);
let currentTenant = res.data.tenantInfoList?.[0];
return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
if (info.code == '00000') {
......
......@@ -31,7 +31,7 @@ service.interceptors.request.use(
* 为每一次请求生成一个cancleToken
*/
const source = axios.CancelToken.source();
config.headers.tenant = '9e5b9d7bfd8c4f4f8079e05de19bf7e0'; //会员guid先写死
config.headers.tenant = localStorage.getItem('currentTenantGuid'); //会员guid先写死
config.cancelToken = source.token;
if (config.method === "postfile") {
config.method = "post";
......
......@@ -2,9 +2,86 @@
name: configureRules //标签管理
</route>
<script lang="ts" setup name="configureRules"></script>
<script lang="ts" setup name="configureRules">
import { TableColumnWidth } from '@/utils/enum';
const dataBasePage = ref({
limit: 10,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "20", value: 20 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
});
const dataBaseTableInfo = ref({
id: "data-base-table",
multiple: false,
fixedSelection: true,
fields: [
{ label: "序号", type: "index", width: 56, align: "center" },
{ label: "数据源", field: "databaseChName", width: 140 },
{ label: "表名称", field: "tableChName", width: 180 },
{ label: "数据库表", field: "enName", width: 120 },
{
label: "新建方式", field: "foundMode", width: 140, getName: (scope) => {
let dataGrade = scope.row.foundMode;
return dataGrade == 1 ? '根据文件新建' : '已有表新建';
}
},
{
label: "状态", field: "state", type: 'tag', width: 180, getName: (scope) => {
let status = scope.row.state;
// 0 草稿中 1 已建表 2 已有默认表
return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
}
},
{ label: "任务修改人", field: "damName", width: 120 },
{ label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
{ label: "描述", field: "databaseName", width: 120, align: 'center' },
{
label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y',
inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center'
},
],
data: [],
page: {
type: "normal",
rows: 0,
...dataBasePage.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 300,
fixed: 'right',
btns: [
{
label: "配置业务规则", value: "edit", click: (scope) => {
console.log('编辑', scope);
// 路由跳转configure-rules
}
},
{
label: "编辑表结构", value: "copy", click: (scope) => {
console.log('复制', scope);
}
}
]
},
loading: false
});
</script>
<template>
<div>111</div>
<div class="table_panel_wrap">
<Table :tableInfo="dataBaseTableInfo" />
</div>
</template>
......
......@@ -4,14 +4,14 @@
<script lang="ts" setup name="importFile">
import { ref } from "vue";
import { useRoute,useRouter } from "vue-router"
import { useRoute, useRouter } from "vue-router"
import useUserStore from "@/store/modules/user";
import { ElMessage, ElMessageBox } from "element-plus";
import Tabs from '@/components/Tabs/index.vue'
import Table from '@/components/Table/index.vue'
import Dialog from '@/components/Dialog/index.vue'
import useCatchStore from "@/store/modules/catch";
import { download, downFile,getDownloadUrl } from '@/utils/common'
import { download, downFile, getDownloadUrl } from '@/utils/common'
import {
addImportData,
deleteImportData,
......@@ -25,7 +25,7 @@ import { commonPageConfig } from '@/utils/enum';
const { proxy } = getCurrentInstance() as any;
const userStore = useUserStore()
const route = useRoute()
const route = useRoute()
const router = useRouter()
/** 2表示资产目录的。3是主数据; 4是元数据导入 */
const isfileImport = route.query.isfileImport
......@@ -39,21 +39,21 @@ const tabsActiveName = ref('')
const uploadSetting: any = ref({})
const importType = ref('')
const defaulttabs = [
{ label: '标准集导入', name: 'standard' },
{ label: '字段标准导入', name: 'field' },
{ label: '命名标准导入', name: 'naming' },
{ label: '数据字典导入', name: 'dictionary' },
// { label: '质量模型导入', name: 'qualityModelGroup' },
// { label: '质量规则导入', name: 'qualityRule' },
]
{ label: '标准集导入', name: 'standard' },
{ label: '字段标准导入', name: 'field' },
{ label: '命名标准导入', name: 'naming' },
{ label: '数据字典导入', name: 'dictionary' },
// { label: '质量模型导入', name: 'qualityModelGroup' },
// { label: '质量规则导入', name: 'qualityRule' },
]
const importTabs = [
{ label: '导入文件数据', name: 'importFile' },
// { label: '质量模型导入', name: 'qualityModelGroup' },
// { label: '质量规则导入', name: 'qualityRule' },
]
{ label: '导入文件数据', name: 'importFile' },
// { label: '质量模型导入', name: 'qualityModelGroup' },
// { label: '质量规则导入', name: 'qualityRule' },
]
const tabsInfo = ref({
activeName: '',
tabs: isfileImport?importTabs:defaulttabs
tabs: isfileImport ? importTabs : defaulttabs
})
const currTableData: any = ref<Object>({});
......@@ -217,27 +217,27 @@ const tableBtnClick = async (scope, btn) => {
currTableData.value = row;
if (type == "export_file") {
getImageContent(row.filePath).then((res: any) => {
if (res && !res.msg) {
let name = row.filePath;
var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
download(res, row.fileName, fileSuffix);
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
if (res && !res.msg) {
let name = row.filePath;
var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
download(res, row.fileName, fileSuffix);
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
//downFile(row.filePath, row.fileName)
} else if (type == 'export_abnormal_data') {
//downFile(row.errorFilePath, '')
getImageContent(row.errorFilePath).then((res: any) => {
if (res && !res.msg) {
let name = row.errorFilePath;
var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
let fileName = name ? name.substring(name.lastIndexOf('/') + 1) :''
download(res, fileName, fileSuffix);
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
if (res && !res.msg) {
let name = row.errorFilePath;
var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
let fileName = name ? name.substring(name.lastIndexOf('/') + 1) : ''
download(res, fileName, fileSuffix);
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
} else if (type == "delete") {
open("此操作将永久删除, 是否继续?", "warning");
}
......@@ -267,7 +267,7 @@ const batching = (type) => {
return
}
open("此操作将永久删除, 是否继续?", "warning", true);
} else if(type === 'importFile') {
} else if (type === 'importFile') {
if (isfileImport == '2' || isfileImport == '4') {
dialogInfo.value.header.title = '导入数据'
dialogInfo.value.type = 'upload'
......@@ -279,8 +279,8 @@ const batching = (type) => {
dialogInfo.value.visible = true
} else {
router.push({
name:"importData",
query:route.query
name: "importData",
query: route.query
})
}
}
......@@ -379,19 +379,19 @@ const importData = (info) => {
type: 'error',
message: '请填写数据源名称'
})
return;
return;
}
if (!info.databaseNameEn) {
ElMessage({
type: 'error',
message: '请填写数据库英文名'
})
return;
return;
}
uploadFiles.value.forEach((item: any, index: number) => {
params.append("uploadFile", item.raw);
});
paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&databaseNameZh=${info.databaseNameZh}&databaseNameEn=${info.databaseNameEn}&isCover=${info.isCover}`
paramUrl = `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&databaseNameZh=${info.databaseNameZh}&databaseNameEn=${info.databaseNameEn}&isCover=${info.isCover}`
} else {
uploadFiles.value.forEach((item: any, index: number) => {
params.append("file", item.raw);
......@@ -455,7 +455,7 @@ const setUploadInfo = () => {
importType.value = '0034';
} else if (isfileImport == '4') {
importType.value = '0042';
} else {
} else {
importType.value = '0033';
}
}
......@@ -567,7 +567,7 @@ const setUploadInfo = () => {
uploadInfo.value.uploadInfo.extraParams = {}
} else if (tabsActiveName.value == 'importFile' && isfileImport == '4') { //元数据导入
uploadSteps.value = [
{
{
title: '1、导入前请先录入以下内容',
type: 'group',
formItems: [{
......@@ -643,12 +643,12 @@ const setUploadInfo = () => {
onActivated(() => {
uploadSetting.value = cacheStore.getCatch('uploadSetting') ?? {}
if(isfileImport) {
if (isfileImport) {
tabsActiveName.value = 'importFile'
} else {
} else {
tabsActiveName.value = uploadSetting.value?.type || 'standard'
}
//getDictList()
setUploadInfo()
})
......@@ -660,8 +660,10 @@ onActivated(() => {
<Tabs v-if="!isfileImport" :tabs-info="tabsInfo" @tabChange="tabsChange" />
<div class="table_tool_wrap">
<div class="tools_btns">
<el-button type="primary" @click="batching('import')" v-if="tabsActiveName !== 'importFile'" v-preReClick>批量导入</el-button>
<el-button type="primary" @click="batching('importFile')" v-if="tabsActiveName == 'importFile'" v-preReClick>文件导入</el-button>
<el-button type="primary" @click="batching('import')" v-if="tabsActiveName !== 'importFile'"
v-preReClick>批量导入</el-button>
<el-button type="primary" @click="batching('importFile')" v-if="tabsActiveName == 'importFile'"
v-preReClick>文件导入</el-button>
<el-button @click="batching('delete')" v-preReClick>批量删除</el-button>
<el-button @click="getFirstPageData" v-preReClick>刷新结果</el-button>
</div>
......@@ -736,4 +738,4 @@ onActivated(() => {
height: calc(100% - 71px);
}
}
</style>
\ No newline at end of file
</style>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!