e7fc36f3 by xukangle

updata: 增加元数据模块

1 parent 8ad5d02b
...@@ -3,8 +3,8 @@ VITE_APP_TITLE = 数据资产管理系统 ...@@ -3,8 +3,8 @@ VITE_APP_TITLE = 数据资产管理系统
3 # 接口域名 3 # 接口域名
4 # VITE_API_BASEURL = https://www.zgsjzc.com/api 4 # VITE_API_BASEURL = https://www.zgsjzc.com/api
5 # VITE_API_BASEURL = https://swzl-test.csbr.cn/api 5 # VITE_API_BASEURL = https://swzl-test.csbr.cn/api
6 VITE_API_BASEURL = http://localhost:9000 6 # VITE_API_BASEURL = http://localhost:9000
7 # VITE_API_BASEURL = http://10.4.82.1:28052/ 7 VITE_API_BASEURL = http://10.4.82.1:28052/
8 # 平台用户 接口请地址 8 # 平台用户 接口请地址
9 VITE_APP_USER_API_BASEURL = gateway-server 9 VITE_APP_USER_API_BASEURL = gateway-server
10 10
...@@ -13,6 +13,7 @@ VITE_APP_AUTH_URL = 'ms-daop-auth-service' ...@@ -13,6 +13,7 @@ VITE_APP_AUTH_URL = 'ms-daop-auth-service'
13 13
14 # 系统管理 接口地址 14 # 系统管理 接口地址
15 VITE_APP_API_BASEURL = ms-daop-zcgl-system-manager-service 15 VITE_APP_API_BASEURL = ms-daop-zcgl-system-manager-service
16
16 # 文件上传请求地址 17 # 文件上传请求地址
17 VITE_APP_ADD_FILE = ms-daop-import-data-service 18 VITE_APP_ADD_FILE = ms-daop-import-data-service
18 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 19 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
...@@ -29,8 +30,8 @@ VITE_APP_PLAN_BASEURL = ms-daop-jgjf-data-plan-service ...@@ -29,8 +30,8 @@ VITE_APP_PLAN_BASEURL = ms-daop-jgjf-data-plan-service
29 VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service 30 VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service
30 31
31 #数据盘点接口地址ms-daop-zcgl-data-inventory 32 #数据盘点接口地址ms-daop-zcgl-data-inventory
32 VITE_APP_CHECK_BASEURL = /mock 33 # VITE_APP_CHECK_BASEURL = /mock
33 # VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory 34 VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
34 35
35 #门户接口 36 #门户接口
36 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal 37 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal
......
...@@ -2,6 +2,159 @@ import request from "@/utils/request"; ...@@ -2,6 +2,159 @@ import request from "@/utils/request";
2 2
3 3
4 /** 4 /**
5 * 数据字典
6 **/
7 // 编码规则流水号
8 export const getCoderuleList = (params) => request({
9 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/code-rule/list`,
10 method: 'post',
11 data: params
12 })
13 // 获取数据类型的接口
14 export const getDataTypeList = (params) => request({
15 url: `${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`,
16 method: 'post',
17 data: params,
18 })
19 // 获取数据库列表
20 export const getDataBaseList = (params) => request({
21 url: `${import.meta.env.VITE_APP_API_BASEURL}/data-source/get-source-list`,
22 method: 'post',
23 data: params,
24 })
25
26 // 新增
27 export const addDictionary = (params) => request({
28 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/add`,
29 method: 'post',
30 data: params
31 })
32 // 删除
33 export const deleteDictionary = (params) => request({
34 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/del`,
35 method: 'delete',
36 data: params
37 })
38 // 删除数据字典前的校验
39 export const checkDeleteDictionary = (params) => request({
40 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check-del`,
41 method: 'delete',
42 data: params
43 })
44 // 编辑校验数据结构删除的条件
45 export const checkDeleteDictionaryScheme = (params) => request({
46 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check-del/dictionary-scheme`,
47 method: 'post',
48 data: params
49 })
50 // 分页查询
51 export const getDictionary = (params) => request({
52 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/page-list`,
53 method: 'post',
54 data: params
55 })
56 // 查询数据字典启用状态的数据
57 export const getDictionaryAll = (params) => request({
58 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/list-all`,
59 method: 'post',
60 params
61 })
62 // 修改
63 export const updateDictionary = (params) => request({
64 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/update`,
65 method: 'put',
66 data: params
67 })
68 // 详情
69 export const getDictionaryDetail = (params) => request({
70 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/detail/${params}`,
71 method: 'get'
72 })
73 // 查看数据字典数据
74 export const getDictionaryFileds = (params) => request({
75 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/dictionary-data/${params}`,
76 method: 'get'
77 })
78 // 数据字典启用停用
79 export const updateDictionaryState = (params) => request({
80 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/change-state`,
81 method: 'get',
82 params
83 })
84 // 检验是否存在
85 export const checkDictionary = (params) => request({
86 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check-exist`,
87 method: 'get',
88 params
89 })
90 // 数据字典新增数据时生成编码规则
91 export const getDictionaryRuleData = (params) => request({
92 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/generate/code-rule/byGuid`,
93 method: 'get',
94 params
95 })
96 // 数据字典树形数据
97 export const getDictionaryTree = (params) => request({
98 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/tree-list`,
99 method: 'post',
100 params
101 })
102 // 保存动态数据字典数据
103 export const saveDictionaryData = (params) => request({
104 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/save/dictionary-data`,
105 method: 'post',
106 data: params
107 })
108 // 更新数据字典数据
109 export const updateDictionaryData = (params) => request({
110 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/update/dictionary-data`,
111 method: 'post',
112 data: params
113 })
114 // 删除数据字典数据
115 export const deleteDictionaryData = (params) => request({
116 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/del/dictionary-data`,
117 method: 'delete',
118 data: params
119 })
120 // 导入数据字典
121 export const importDictionary = (params) => request({
122 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/import/data-dictionary`,
123 method: 'post',
124 data: params
125 })
126 // 显示导入的数据字典数据
127 export const showDictionary = (params) => request({
128 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/import/show/data-dictionary`,
129 method: 'post',
130 data: params,
131 headers: {
132 'Content-Type': 'multipart/form-data'
133 }
134 })
135 // 导出数据字典模板
136 export const exportDictionary = (params) => request({
137 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/export/data-dictionary/schema`,
138 method: 'post',
139 data: params,
140 responseType: 'blob'
141 })
142 // 导出数据字典数据
143 export const exportDictionaryFileds = (params) => request({
144 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/export/data-dictionary/data`,
145 method: 'post',
146 data: params,
147 responseType: 'blob'
148 })
149 // 验证数据是否符合标准
150 export const checkDictionaryData = (params) => request({
151 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/check/dictionary-data`,
152 method: 'post',
153 data: params
154 })
155
156
157 /**
5 * 获取数据级别 158 * 获取数据级别
6 * @param {Object} 159 * @param {Object}
7 * { paramCode: "DATA-CLASSIFY" } 160 * { paramCode: "DATA-CLASSIFY" }
...@@ -230,10 +383,10 @@ export const getCgDirFieldPageList = (data) => request({ ...@@ -230,10 +383,10 @@ export const getCgDirFieldPageList = (data) => request({
230 /** 获取字典列表 383 /** 获取字典列表
231 * VITE_APP_PLAN_BASEURL 为环境变量 现在只是mock数据 384 * VITE_APP_PLAN_BASEURL 为环境变量 现在只是mock数据
232 */ 385 */
233 export const getDictionary = (params) => request({ 386 // export const getDictionary = (params) => request({
234 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`, 387 // url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`,
235 method: 'post' 388 // method: 'post'
236 }) 389 // })
237 390
238 391
239 392
...@@ -268,3 +421,8 @@ export const getDbDirTablePageList = (data) => request({ ...@@ -268,3 +421,8 @@ export const getDbDirTablePageList = (data) => request({
268 method: 'post', 421 method: 'post',
269 data 422 data
270 }) 423 })
424
425
426
427
428
......
...@@ -17,10 +17,11 @@ export const deleteMetaDataTask = (params) => request({ ...@@ -17,10 +17,11 @@ export const deleteMetaDataTask = (params) => request({
17 }) 17 })
18 // 分页查询 18 // 分页查询
19 export const getMetaDataTask = (params) => request({ 19 export const getMetaDataTask = (params) => request({
20 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/page-list`, 20 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-collect-task/page-list`,
21 method: 'post', 21 method: 'post',
22 data: params 22 data: params
23 }) 23 })
24
24 // 修改 25 // 修改
25 export const updateMetaDataTask = (params) => request({ 26 export const updateMetaDataTask = (params) => request({
26 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/update`, 27 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/update`,
...@@ -57,7 +58,7 @@ export const getMetaDataTaskLog = (params) => request({ ...@@ -57,7 +58,7 @@ export const getMetaDataTaskLog = (params) => request({
57 method: 'post', 58 method: 'post',
58 data: params 59 data: params
59 }) 60 })
60 // 61 //
61 export const saveMetaReportAnalysis = (params) => request({ 62 export const saveMetaReportAnalysis = (params) => request({
62 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage-analysis-report/add`, 63 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage-analysis-report/add`,
63 method: 'post', 64 method: 'post',
...@@ -65,34 +66,34 @@ export const saveMetaReportAnalysis = (params) => request({ ...@@ -65,34 +66,34 @@ export const saveMetaReportAnalysis = (params) => request({
65 }) 66 })
66 /** 67 /**
67 * 元数据-元数据查询 68 * 元数据-元数据查询
68 **/ 69 **/
69 // 树形数据 70 // 树形数据
70 export const getMetaTreeData = (params) => request({ 71 export const getMetaTreeData = (params) => request({
71 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list`, 72 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-tree-list`,
72 method: 'post', 73 method: 'post',
73 data: params 74 data: params
74 }) 75 })
75 // 数据库汇总信息 76 // 数据库汇总信息
76 export const getMetaDatabaseCollect = (params) => request({ 77 export const getMetaDatabaseCollect = (params) => request({
77 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-database-collect-list`, 78 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-database-collect-list`,
78 method: 'post', 79 method: 'post',
79 data: params 80 data: params
80 }) 81 })
81 // 库分页查询 82 // 库分页查询
82 export const getMetaDataBase = (params) => request({ 83 export const getMetaDataBase = (params) => request({
83 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-collect-list`, 84 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-collect-list`,
84 method: 'post', 85 method: 'post',
85 data: params 86 data: params
86 }) 87 })
87 // 表分页查询 88 // 表分页查询
88 export const getMetaDataSheet = (params) => request({ 89 export const getMetaDataSheet = (params) => request({
89 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-detail-list`, 90 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-detail-list`,
90 method: 'post', 91 method: 'post',
91 data: params 92 data: params
92 }) 93 })
93 // 表字段查询 94 // 表字段查询
94 export const getMetaSheetField = (params) => request({ 95 export const getMetaSheetField = (params) => request({
95 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-table-field-list`, 96 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/meta-table/meta-table-field-list`,
96 method: 'post', 97 method: 'post',
97 params 98 params
98 }) 99 })
...@@ -114,7 +115,7 @@ export const getMetaChangeRecord = (params) => request({ ...@@ -114,7 +115,7 @@ export const getMetaChangeRecord = (params) => request({
114 method: 'post', 115 method: 'post',
115 data: params 116 data: params
116 }) 117 })
117 // 118 //
118 export const getMetacompareList = (params) => request({ 119 export const getMetacompareList = (params) => request({
119 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-change-compare-list/${params}`, 120 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-change-compare-list/${params}`,
120 method: 'get', 121 method: 'get',
...@@ -216,7 +217,7 @@ export const updateAnalysisRepor = (params) => request({ ...@@ -216,7 +217,7 @@ export const updateAnalysisRepor = (params) => request({
216 method: 'put', 217 method: 'put',
217 data: params 218 data: params
218 }) 219 })
219 /** 删除边 */ 220 /** 删除边 */
220 export const delLineAge = (params) => request({ 221 export const delLineAge = (params) => request({
221 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/del-edge?euid=${params}`, 222 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/lineage/del-edge?euid=${params}`,
222 method: 'delete', 223 method: 'delete',
...@@ -226,7 +227,7 @@ export const checkTableData = (params) => request({ ...@@ -226,7 +227,7 @@ export const checkTableData = (params) => request({
226 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/check-table-data/${params}`, 227 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/check-table-data/${params}`,
227 method: 'get', 228 method: 'get',
228 }) 229 })
229 /**校验任务是否有数据库信息 */ 230 /**校验任务是否有数据库信息 */
230 export const checkDatabaseIsExist = (dataSourceGuid) => request({ 231 export const checkDatabaseIsExist = (dataSourceGuid) => request({
231 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/check-database-is-exist/${dataSourceGuid}`, 232 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/check-database-is-exist/${dataSourceGuid}`,
232 method: 'get', 233 method: 'get',
...@@ -236,4 +237,4 @@ export const checkDatabaseIsExist = (dataSourceGuid) => request({ ...@@ -236,4 +237,4 @@ export const checkDatabaseIsExist = (dataSourceGuid) => request({
236 export const syncChangeDetail = (guid) => request({ 237 export const syncChangeDetail = (guid) => request({
237 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/sync-change-detail/${guid}`, 238 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/task-change-record/sync-change-detail/${guid}`,
238 method: 'get', 239 method: 'get',
239 })
...\ No newline at end of file ...\ No newline at end of file
240 })
......
...@@ -231,7 +231,28 @@ const routes: RouteRecordRaw[] = [ ...@@ -231,7 +231,28 @@ const routes: RouteRecordRaw[] = [
231 }, 231 },
232 }, 232 },
233 ], 233 ],
234 } 234 },
235 {
236 path: '/data-standards/data-dictionary',
237 component: Layout,
238 meta: {
239 title: '数据字典',
240 icon: 'sidebar-cooperation',
241 },
242 children: [
243 {
244 path: '',
245 name: 'dictionary',
246 component: () => import('@/views/data_standards/dictionary.vue'),
247 meta: {
248 title: '数据字典',
249 sidebar: false,
250 breadcrumb: false,
251 cache: true
252 },
253 },
254 ],
255 },
235 ] 256 ]
236 257
237 export default routes 258 export default routes
......
...@@ -58,6 +58,7 @@ const useUserStore = defineStore( ...@@ -58,6 +58,7 @@ const useUserStore = defineStore(
58 userName.value = res.data.userName 58 userName.value = res.data.userName
59 // userData.value = JSON.stringify(res.data.data); 59 // userData.value = JSON.stringify(res.data.data);
60 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : ''; 60 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : '';
61 localStorage.setItem('currentTenantGuid', currentTenantGuid.value);
61 let currentTenant = res.data.tenantInfoList?.[0]; 62 let currentTenant = res.data.tenantInfoList?.[0];
62 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { 63 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
63 if (info.code == '00000') { 64 if (info.code == '00000') {
......
...@@ -31,7 +31,7 @@ service.interceptors.request.use( ...@@ -31,7 +31,7 @@ service.interceptors.request.use(
31 * 为每一次请求生成一个cancleToken 31 * 为每一次请求生成一个cancleToken
32 */ 32 */
33 const source = axios.CancelToken.source(); 33 const source = axios.CancelToken.source();
34 config.headers.tenant = '9e5b9d7bfd8c4f4f8079e05de19bf7e0'; //会员guid先写死 34 config.headers.tenant = localStorage.getItem('currentTenantGuid'); //会员guid先写死
35 config.cancelToken = source.token; 35 config.cancelToken = source.token;
36 if (config.method === "postfile") { 36 if (config.method === "postfile") {
37 config.method = "post"; 37 config.method = "post";
......
...@@ -2,9 +2,86 @@ ...@@ -2,9 +2,86 @@
2 name: configureRules //标签管理 2 name: configureRules //标签管理
3 </route> 3 </route>
4 4
5 <script lang="ts" setup name="configureRules"></script> 5 <script lang="ts" setup name="configureRules">
6 import { TableColumnWidth } from '@/utils/enum';
6 7
8 const dataBasePage = ref({
9 limit: 10,
10 curr: 1,
11 sizes: [
12 { label: "10", value: 10 },
13 { label: "20", value: 20 },
14 { label: "100", value: 100 },
15 { label: "150", value: 150 },
16 { label: "200", value: 200 },
17 ],
18 });
7 19
20 const dataBaseTableInfo = ref({
21 id: "data-base-table",
22 multiple: false,
23 fixedSelection: true,
24 fields: [
25 { label: "序号", type: "index", width: 56, align: "center" },
26 { label: "数据源", field: "databaseChName", width: 140 },
27 { label: "表名称", field: "tableChName", width: 180 },
28 { label: "数据库表", field: "enName", width: 120 },
29 {
30 label: "新建方式", field: "foundMode", width: 140, getName: (scope) => {
31 let dataGrade = scope.row.foundMode;
32 return dataGrade == 1 ? '根据文件新建' : '已有表新建';
33 }
34 },
35 {
36 label: "状态", field: "state", type: 'tag', width: 180, getName: (scope) => {
37 let status = scope.row.state;
38 // 0 草稿中 1 已建表 2 已有默认表
39 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
40 }
41 },
42 { label: "任务修改人", field: "damName", width: 120 },
43 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
44 { label: "描述", field: "databaseName", width: 120, align: 'center' },
45 {
46 label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y',
47 inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center'
48 },
49
50 ],
51 data: [],
52 page: {
53 type: "normal",
54 rows: 0,
55 ...dataBasePage.value,
56 },
57 actionInfo: {
58 label: "操作",
59 type: "btn",
60 width: 300,
61 fixed: 'right',
62 btns: [
63 {
64 label: "配置业务规则", value: "edit", click: (scope) => {
65 console.log('编辑', scope);
66 // 路由跳转configure-rules
67
68
69 }
70 },
71
72 {
73 label: "编辑表结构", value: "copy", click: (scope) => {
74 console.log('复制', scope);
75 }
76 }
77 ]
78
79 },
80 loading: false
81 });
82 </script>
8 <template> 83 <template>
9 <div>111</div> 84 <div class="table_panel_wrap">
85 <Table :tableInfo="dataBaseTableInfo" />
86 </div>
10 </template> 87 </template>
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
4 4
5 <script lang="ts" setup name="importFile"> 5 <script lang="ts" setup name="importFile">
6 import { ref } from "vue"; 6 import { ref } from "vue";
7 import { useRoute,useRouter } from "vue-router" 7 import { useRoute, useRouter } from "vue-router"
8 import useUserStore from "@/store/modules/user"; 8 import useUserStore from "@/store/modules/user";
9 import { ElMessage, ElMessageBox } from "element-plus"; 9 import { ElMessage, ElMessageBox } from "element-plus";
10 import Tabs from '@/components/Tabs/index.vue' 10 import Tabs from '@/components/Tabs/index.vue'
11 import Table from '@/components/Table/index.vue' 11 import Table from '@/components/Table/index.vue'
12 import Dialog from '@/components/Dialog/index.vue' 12 import Dialog from '@/components/Dialog/index.vue'
13 import useCatchStore from "@/store/modules/catch"; 13 import useCatchStore from "@/store/modules/catch";
14 import { download, downFile,getDownloadUrl } from '@/utils/common' 14 import { download, downFile, getDownloadUrl } from '@/utils/common'
15 import { 15 import {
16 addImportData, 16 addImportData,
17 deleteImportData, 17 deleteImportData,
...@@ -25,7 +25,7 @@ import { commonPageConfig } from '@/utils/enum'; ...@@ -25,7 +25,7 @@ import { commonPageConfig } from '@/utils/enum';
25 const { proxy } = getCurrentInstance() as any; 25 const { proxy } = getCurrentInstance() as any;
26 26
27 const userStore = useUserStore() 27 const userStore = useUserStore()
28 const route = useRoute() 28 const route = useRoute()
29 const router = useRouter() 29 const router = useRouter()
30 /** 2表示资产目录的。3是主数据; 4是元数据导入 */ 30 /** 2表示资产目录的。3是主数据; 4是元数据导入 */
31 const isfileImport = route.query.isfileImport 31 const isfileImport = route.query.isfileImport
...@@ -39,21 +39,21 @@ const tabsActiveName = ref('') ...@@ -39,21 +39,21 @@ const tabsActiveName = ref('')
39 const uploadSetting: any = ref({}) 39 const uploadSetting: any = ref({})
40 const importType = ref('') 40 const importType = ref('')
41 const defaulttabs = [ 41 const defaulttabs = [
42 { label: '标准集导入', name: 'standard' }, 42 { label: '标准集导入', name: 'standard' },
43 { label: '字段标准导入', name: 'field' }, 43 { label: '字段标准导入', name: 'field' },
44 { label: '命名标准导入', name: 'naming' }, 44 { label: '命名标准导入', name: 'naming' },
45 { label: '数据字典导入', name: 'dictionary' }, 45 { label: '数据字典导入', name: 'dictionary' },
46 // { label: '质量模型导入', name: 'qualityModelGroup' }, 46 // { label: '质量模型导入', name: 'qualityModelGroup' },
47 // { label: '质量规则导入', name: 'qualityRule' }, 47 // { label: '质量规则导入', name: 'qualityRule' },
48 ] 48 ]
49 const importTabs = [ 49 const importTabs = [
50 { label: '导入文件数据', name: 'importFile' }, 50 { label: '导入文件数据', name: 'importFile' },
51 // { label: '质量模型导入', name: 'qualityModelGroup' }, 51 // { label: '质量模型导入', name: 'qualityModelGroup' },
52 // { label: '质量规则导入', name: 'qualityRule' }, 52 // { label: '质量规则导入', name: 'qualityRule' },
53 ] 53 ]
54 const tabsInfo = ref({ 54 const tabsInfo = ref({
55 activeName: '', 55 activeName: '',
56 tabs: isfileImport?importTabs:defaulttabs 56 tabs: isfileImport ? importTabs : defaulttabs
57 }) 57 })
58 58
59 const currTableData: any = ref<Object>({}); 59 const currTableData: any = ref<Object>({});
...@@ -217,27 +217,27 @@ const tableBtnClick = async (scope, btn) => { ...@@ -217,27 +217,27 @@ const tableBtnClick = async (scope, btn) => {
217 currTableData.value = row; 217 currTableData.value = row;
218 if (type == "export_file") { 218 if (type == "export_file") {
219 getImageContent(row.filePath).then((res: any) => { 219 getImageContent(row.filePath).then((res: any) => {
220 if (res && !res.msg) { 220 if (res && !res.msg) {
221 let name = row.filePath; 221 let name = row.filePath;
222 var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : ''; 222 var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
223 download(res, row.fileName, fileSuffix); 223 download(res, row.fileName, fileSuffix);
224 } else { 224 } else {
225 res?.msg && ElMessage.error(res?.msg); 225 res?.msg && ElMessage.error(res?.msg);
226 } 226 }
227 }); 227 });
228 //downFile(row.filePath, row.fileName) 228 //downFile(row.filePath, row.fileName)
229 } else if (type == 'export_abnormal_data') { 229 } else if (type == 'export_abnormal_data') {
230 //downFile(row.errorFilePath, '') 230 //downFile(row.errorFilePath, '')
231 getImageContent(row.errorFilePath).then((res: any) => { 231 getImageContent(row.errorFilePath).then((res: any) => {
232 if (res && !res.msg) { 232 if (res && !res.msg) {
233 let name = row.errorFilePath; 233 let name = row.errorFilePath;
234 var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : ''; 234 var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
235 let fileName = name ? name.substring(name.lastIndexOf('/') + 1) :'' 235 let fileName = name ? name.substring(name.lastIndexOf('/') + 1) : ''
236 download(res, fileName, fileSuffix); 236 download(res, fileName, fileSuffix);
237 } else { 237 } else {
238 res?.msg && ElMessage.error(res?.msg); 238 res?.msg && ElMessage.error(res?.msg);
239 } 239 }
240 }); 240 });
241 } else if (type == "delete") { 241 } else if (type == "delete") {
242 open("此操作将永久删除, 是否继续?", "warning"); 242 open("此操作将永久删除, 是否继续?", "warning");
243 } 243 }
...@@ -267,7 +267,7 @@ const batching = (type) => { ...@@ -267,7 +267,7 @@ const batching = (type) => {
267 return 267 return
268 } 268 }
269 open("此操作将永久删除, 是否继续?", "warning", true); 269 open("此操作将永久删除, 是否继续?", "warning", true);
270 } else if(type === 'importFile') { 270 } else if (type === 'importFile') {
271 if (isfileImport == '2' || isfileImport == '4') { 271 if (isfileImport == '2' || isfileImport == '4') {
272 dialogInfo.value.header.title = '导入数据' 272 dialogInfo.value.header.title = '导入数据'
273 dialogInfo.value.type = 'upload' 273 dialogInfo.value.type = 'upload'
...@@ -279,8 +279,8 @@ const batching = (type) => { ...@@ -279,8 +279,8 @@ const batching = (type) => {
279 dialogInfo.value.visible = true 279 dialogInfo.value.visible = true
280 } else { 280 } else {
281 router.push({ 281 router.push({
282 name:"importData", 282 name: "importData",
283 query:route.query 283 query: route.query
284 }) 284 })
285 } 285 }
286 } 286 }
...@@ -379,19 +379,19 @@ const importData = (info) => { ...@@ -379,19 +379,19 @@ const importData = (info) => {
379 type: 'error', 379 type: 'error',
380 message: '请填写数据源名称' 380 message: '请填写数据源名称'
381 }) 381 })
382 return; 382 return;
383 } 383 }
384 if (!info.databaseNameEn) { 384 if (!info.databaseNameEn) {
385 ElMessage({ 385 ElMessage({
386 type: 'error', 386 type: 'error',
387 message: '请填写数据库英文名' 387 message: '请填写数据库英文名'
388 }) 388 })
389 return; 389 return;
390 } 390 }
391 uploadFiles.value.forEach((item: any, index: number) => { 391 uploadFiles.value.forEach((item: any, index: number) => {
392 params.append("uploadFile", item.raw); 392 params.append("uploadFile", item.raw);
393 }); 393 });
394 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}` 394 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}`
395 } else { 395 } else {
396 uploadFiles.value.forEach((item: any, index: number) => { 396 uploadFiles.value.forEach((item: any, index: number) => {
397 params.append("file", item.raw); 397 params.append("file", item.raw);
...@@ -455,7 +455,7 @@ const setUploadInfo = () => { ...@@ -455,7 +455,7 @@ const setUploadInfo = () => {
455 importType.value = '0034'; 455 importType.value = '0034';
456 } else if (isfileImport == '4') { 456 } else if (isfileImport == '4') {
457 importType.value = '0042'; 457 importType.value = '0042';
458 } else { 458 } else {
459 importType.value = '0033'; 459 importType.value = '0033';
460 } 460 }
461 } 461 }
...@@ -567,7 +567,7 @@ const setUploadInfo = () => { ...@@ -567,7 +567,7 @@ const setUploadInfo = () => {
567 uploadInfo.value.uploadInfo.extraParams = {} 567 uploadInfo.value.uploadInfo.extraParams = {}
568 } else if (tabsActiveName.value == 'importFile' && isfileImport == '4') { //元数据导入 568 } else if (tabsActiveName.value == 'importFile' && isfileImport == '4') { //元数据导入
569 uploadSteps.value = [ 569 uploadSteps.value = [
570 { 570 {
571 title: '1、导入前请先录入以下内容', 571 title: '1、导入前请先录入以下内容',
572 type: 'group', 572 type: 'group',
573 formItems: [{ 573 formItems: [{
...@@ -643,12 +643,12 @@ const setUploadInfo = () => { ...@@ -643,12 +643,12 @@ const setUploadInfo = () => {
643 643
644 onActivated(() => { 644 onActivated(() => {
645 uploadSetting.value = cacheStore.getCatch('uploadSetting') ?? {} 645 uploadSetting.value = cacheStore.getCatch('uploadSetting') ?? {}
646 if(isfileImport) { 646 if (isfileImport) {
647 tabsActiveName.value = 'importFile' 647 tabsActiveName.value = 'importFile'
648 } else { 648 } else {
649 tabsActiveName.value = uploadSetting.value?.type || 'standard' 649 tabsActiveName.value = uploadSetting.value?.type || 'standard'
650 } 650 }
651 651
652 //getDictList() 652 //getDictList()
653 setUploadInfo() 653 setUploadInfo()
654 }) 654 })
...@@ -660,8 +660,10 @@ onActivated(() => { ...@@ -660,8 +660,10 @@ onActivated(() => {
660 <Tabs v-if="!isfileImport" :tabs-info="tabsInfo" @tabChange="tabsChange" /> 660 <Tabs v-if="!isfileImport" :tabs-info="tabsInfo" @tabChange="tabsChange" />
661 <div class="table_tool_wrap"> 661 <div class="table_tool_wrap">
662 <div class="tools_btns"> 662 <div class="tools_btns">
663 <el-button type="primary" @click="batching('import')" v-if="tabsActiveName !== 'importFile'" v-preReClick>批量导入</el-button> 663 <el-button type="primary" @click="batching('import')" v-if="tabsActiveName !== 'importFile'"
664 <el-button type="primary" @click="batching('importFile')" v-if="tabsActiveName == 'importFile'" v-preReClick>文件导入</el-button> 664 v-preReClick>批量导入</el-button>
665 <el-button type="primary" @click="batching('importFile')" v-if="tabsActiveName == 'importFile'"
666 v-preReClick>文件导入</el-button>
665 <el-button @click="batching('delete')" v-preReClick>批量删除</el-button> 667 <el-button @click="batching('delete')" v-preReClick>批量删除</el-button>
666 <el-button @click="getFirstPageData" v-preReClick>刷新结果</el-button> 668 <el-button @click="getFirstPageData" v-preReClick>刷新结果</el-button>
667 </div> 669 </div>
...@@ -736,4 +738,4 @@ onActivated(() => { ...@@ -736,4 +738,4 @@ onActivated(() => {
736 height: calc(100% - 71px); 738 height: calc(100% - 71px);
737 } 739 }
738 } 740 }
739 </style>
...\ No newline at end of file ...\ No newline at end of file
741 </style>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!