提交元数据导入修改;新增引用完整性规则
Showing
11 changed files
with
145 additions
and
33 deletions
| ... | @@ -3,7 +3,7 @@ VITE_APP_TITLE = 数据资产管理系统 | ... | @@ -3,7 +3,7 @@ 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://10.4.82.30:8052/ | 6 | VITE_API_BASEURL = http://10.4.82.1:28052/ |
| 7 | # 平台用户 接口请地址 | 7 | # 平台用户 接口请地址 |
| 8 | VITE_APP_USER_API_BASEURL = gateway-server/user | 8 | VITE_APP_USER_API_BASEURL = gateway-server/user |
| 9 | # 系统管理 接口地址 | 9 | # 系统管理 接口地址 | ... | ... |
| ... | @@ -150,6 +150,13 @@ export const getSmallCategoryList = () => request({ | ... | @@ -150,6 +150,13 @@ export const getSmallCategoryList = () => request({ |
| 150 | data: { paramCode: "SMALL-CATEGORY" } | 150 | data: { paramCode: "SMALL-CATEGORY" } |
| 151 | }) | 151 | }) |
| 152 | 152 | ||
| 153 | // 获取规范性检验规则。 | ||
| 154 | export const getCheckRulesList = () => request({ | ||
| 155 | url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`, | ||
| 156 | method: 'post', | ||
| 157 | data: { paramCode: "REGULAR_RULE" } | ||
| 158 | }) | ||
| 159 | |||
| 153 | // 根据规则guid获取规则的详情信息。 | 160 | // 根据规则guid获取规则的详情信息。 |
| 154 | export const getRuleConfDetail = (param) => request({ | 161 | export const getRuleConfDetail = (param) => request({ |
| 155 | url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/conf/detail?ruleConfGuid=${param}`, | 162 | url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/conf/detail?ruleConfGuid=${param}`, | ... | ... |
| ... | @@ -47,7 +47,7 @@ export const getImageUrl = (params) => request({ | ... | @@ -47,7 +47,7 @@ export const getImageUrl = (params) => request({ |
| 47 | 47 | ||
| 48 | /** 查看图片 */ | 48 | /** 查看图片 */ |
| 49 | export const getImageContent = (params) => request({ | 49 | export const getImageContent = (params) => request({ |
| 50 | url: `${import.meta.env.VITE_APP_API_BASEURL}/obs/view-pic?filePath=${params}`, | 50 | url: `${import.meta.env.VITE_APP_API_BASEURL}/obs`, |
| 51 | method: 'get', | 51 | method: 'get', |
| 52 | responseType: 'blob' | 52 | responseType: 'blob' |
| 53 | }); | 53 | }); | ... | ... |
| ... | @@ -146,11 +146,26 @@ defineExpose({ | ... | @@ -146,11 +146,26 @@ defineExpose({ |
| 146 | :max-collapse-tags="item.cascaderInfo.maxTags ?? 1" :filterable="item.cascaderInfo.filterable ?? false" | 146 | :max-collapse-tags="item.cascaderInfo.maxTags ?? 1" :filterable="item.cascaderInfo.filterable ?? false" |
| 147 | @change="cascaderChange" /> | 147 | @change="cascaderChange" /> |
| 148 | </div> | 148 | </div> |
| 149 | <div class="form_item" v-if="item.type == 'input'"> | 149 | <div class="form_item" v-else-if="item.type == 'input'"> |
| 150 | <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label | 150 | <span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label |
| 151 | }}:</span> | 151 | }}:</span> |
| 152 | <el-input v-model="extraParams[item.selectInfo.field]" :placeholder="item.selectInfo.placeholder" | 152 | <el-input v-model="extraParams[item.selectInfo.field]" :placeholder="item.selectInfo.placeholder" |
| 153 | :disabled="item.selectInfo.disabled" :clearable="item.selectInfo.disabled"> </el-input> | 153 | :disabled="item.selectInfo.disabled" :clearable="item.selectInfo.clearable"> </el-input> |
| 154 | </div> | ||
| 155 | <div class="group-con" v-else-if="item.type == 'group'"> | ||
| 156 | <template v-for="formItem in (item.formItems || [])"> | ||
| 157 | <div class="form_item" v-if="formItem.type == 'input'" style="margin-right: 15px;"> | ||
| 158 | <span class="item_label" style="display: block;margin-bottom: 2px" :class="{ required_mark: formItem.required }">{{ formItem.label }}:</span> | ||
| 159 | <el-input v-model="extraParams[formItem.field]" :placeholder="formItem.placeholder" | ||
| 160 | :disabled="formItem.disabled" :clearable="formItem.clearable"> </el-input> | ||
| 161 | </div> | ||
| 162 | <div class="form_item" v-else-if="formItem.type == 'switch'"> | ||
| 163 | <span class="item_label" style="display: block;margin-bottom: 2px" :class="{ required_mark: formItem.required }">{{ formItem.label }}:</span> | ||
| 164 | <el-switch inline-prompt v-model="extraParams[formItem.field]" :active-value="formItem.activeValue" | ||
| 165 | :inactive-value="formItem.inactiveValue" :active-text="formItem.activeText" | ||
| 166 | :inactive-text="formItem.inactiveText" :disabled="formItem.disabled" /> | ||
| 167 | </div> | ||
| 168 | </template> | ||
| 154 | </div> | 169 | </div> |
| 155 | <div class="item_btn" v-else-if="item.type == 'btn_down'"> | 170 | <div class="item_btn" v-else-if="item.type == 'btn_down'"> |
| 156 | <el-button plain @click="toolBtnClick({ value: 'exoprt_model' })" v-preReClick> | 171 | <el-button plain @click="toolBtnClick({ value: 'exoprt_model' })" v-preReClick> |
| ... | @@ -363,5 +378,11 @@ defineExpose({ | ... | @@ -363,5 +378,11 @@ defineExpose({ |
| 363 | } | 378 | } |
| 364 | } | 379 | } |
| 365 | } | 380 | } |
| 381 | |||
| 382 | .group-con { | ||
| 383 | display: flex; | ||
| 384 | flex-wrap: wrap; | ||
| 385 | margin-bottom: -12px; | ||
| 386 | } | ||
| 366 | } | 387 | } |
| 367 | </style> | 388 | </style> | ... | ... |
| ... | @@ -44,16 +44,13 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -44,16 +44,13 @@ const routes: RouteRecordRaw[] = [ |
| 44 | name: 'importFileMeta', | 44 | name: 'importFileMeta', |
| 45 | component: () => import('@/views/importFile.vue'), | 45 | component: () => import('@/views/importFile.vue'), |
| 46 | meta: { | 46 | meta: { |
| 47 | title: '导入数据', | 47 | title: '导入数据-采集任务', |
| 48 | sidebar: false, | 48 | sidebar: false, |
| 49 | breadcrumb: false, | 49 | breadcrumb: false, |
| 50 | cache: true, | 50 | cache: true, |
| 51 | reuse: true | 51 | reuse: true |
| 52 | }, | 52 | }, |
| 53 | beforeEnter: (to, from) => { | 53 | beforeEnter: (to, from) => { |
| 54 | if (to.query.bizGuid) { | ||
| 55 | to.meta.title = `导入数据-采集任务`; | ||
| 56 | } | ||
| 57 | } | 54 | } |
| 58 | } | 55 | } |
| 59 | ], | 56 | ], | ... | ... |
| ... | @@ -598,7 +598,7 @@ onBeforeMount(() => { | ... | @@ -598,7 +598,7 @@ onBeforeMount(() => { |
| 598 | <TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" :init="false" /> | 598 | <TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" :init="false" /> |
| 599 | <div class="tools_btns"> | 599 | <div class="tools_btns"> |
| 600 | <el-button type="primary" @click="loadDrawer">新建</el-button> | 600 | <el-button type="primary" @click="loadDrawer">新建</el-button> |
| 601 | <el-button type="primary" @click="importMeta">导入</el-button> | 601 | <el-button @click="importMeta">导入</el-button> |
| 602 | </div> | 602 | </div> |
| 603 | </div> | 603 | </div> |
| 604 | <div class="table_panel_wrap"> | 604 | <div class="table_panel_wrap"> | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -332,6 +332,35 @@ const transformRulesInfo = (info: any) => { | ... | @@ -332,6 +332,35 @@ const transformRulesInfo = (info: any) => { |
| 332 | })] | 332 | })] |
| 333 | })); | 333 | })); |
| 334 | } | 334 | } |
| 335 | } else if (info.ruleCode == 'ref_integrality') { | ||
| 336 | let subjectTables = toSubjectTables.value; | ||
| 337 | info.ruleFields.forEach(row => { | ||
| 338 | let tableInfo = subjectTables.find(t => t.guid === row.mainTable); | ||
| 339 | let modelRule = modelRules.find(m => m.subjectName == tableInfo.enName); | ||
| 340 | if (modelRule) { | ||
| 341 | modelRule.modelRuleConfList.ruleField.push({ | ||
| 342 | enName: row.mainTableField, | ||
| 343 | compareTableGuid: row.compareTableGuid, | ||
| 344 | compareTableName: row.compareTableName, | ||
| 345 | compareEnName: row.compareEnName | ||
| 346 | }); | ||
| 347 | } else { | ||
| 348 | modelRules.push(Object.assign({}, { | ||
| 349 | modelGroupGuid: modelGroupGuid.value, | ||
| 350 | name: tableInfo.chName, | ||
| 351 | subjectName: tableInfo.enName, | ||
| 352 | subjectGuid: tableInfo.guid, | ||
| 353 | dataSourceGuid: tableInfo.dataSourceGuid, | ||
| 354 | databaseName: tableInfo.dataServerName, | ||
| 355 | modelRuleConfList: [Object.assign({}, info, { | ||
| 356 | enName: row.mainTableField, | ||
| 357 | compareTableGuid: row.compareTableGuid, | ||
| 358 | compareTableName: row.compareTableName, | ||
| 359 | compareEnName: row.compareEnName | ||
| 360 | })] | ||
| 361 | })); | ||
| 362 | } | ||
| 363 | }) | ||
| 335 | } | 364 | } |
| 336 | return modelRules; | 365 | return modelRules; |
| 337 | } | 366 | } |
| ... | @@ -380,9 +409,10 @@ const save = () => { | ... | @@ -380,9 +409,10 @@ const save = () => { |
| 380 | :from-tree-data-loading="dsFromTreeDataLoading" :lazy="true" :checkOnClickNode="true" | 409 | :from-tree-data-loading="dsFromTreeDataLoading" :lazy="true" :checkOnClickNode="true" |
| 381 | :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid" | 410 | :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid" |
| 382 | :transferOpenNode="true" width="70%" :defaultProps="{ | 411 | :transferOpenNode="true" width="70%" :defaultProps="{ |
| 383 | label: 'name', | 412 | label: 'name', |
| 384 | value: 'guid' | 413 | value: 'guid' |
| 385 | }" :lazyFn="handleSubjectTableLazyFn" @left-check-change="handleSubjectCheckedChange" height="calc(100% - 64px)"> | 414 | }" :lazyFn="handleSubjectTableLazyFn" @left-check-change="handleSubjectCheckedChange" |
| 415 | height="calc(100% - 64px)"> | ||
| 386 | </TreeTransfer> | 416 | </TreeTransfer> |
| 387 | </div> | 417 | </div> |
| 388 | </div> | 418 | </div> | ... | ... |
| ... | @@ -140,6 +140,21 @@ const transformRulesInfo = (info: any) => { | ... | @@ -140,6 +140,21 @@ const transformRulesInfo = (info: any) => { |
| 140 | }), | 140 | }), |
| 141 | ruleFields: '' | 141 | ruleFields: '' |
| 142 | }); | 142 | }); |
| 143 | } else if (info.ruleCode == 'ref_integrality') { | ||
| 144 | return Object.assign({}, info, { | ||
| 145 | guid: ruleGuid, | ||
| 146 | qualityModelGuid: detailInfo.value.qualityModelGuid, | ||
| 147 | ruleCode: detailInfo.value.ruleCode, | ||
| 148 | ruleField: info.ruleFields.map(row => { | ||
| 149 | return { | ||
| 150 | enName: row.mainTableField, | ||
| 151 | compareTableGuid: row.compareTableGuid, | ||
| 152 | compareTableName: row.compareTableName, | ||
| 153 | compareEnName: row.compareEnName | ||
| 154 | } | ||
| 155 | }), | ||
| 156 | ruleFields: '' | ||
| 157 | }); | ||
| 143 | } | 158 | } |
| 144 | } | 159 | } |
| 145 | 160 | ... | ... |
| ... | @@ -99,7 +99,7 @@ const transformRulesInfo = (info) => { | ... | @@ -99,7 +99,7 @@ const transformRulesInfo = (info) => { |
| 99 | qualityModelGuid: modelGuid, | 99 | qualityModelGuid: modelGuid, |
| 100 | ruleCode: info.ruleCode, | 100 | ruleCode: info.ruleCode, |
| 101 | customSql: info.customSqls?.[modelDetailInfo.value.subjectName], | 101 | customSql: info.customSqls?.[modelDetailInfo.value.subjectName], |
| 102 | ruleField: info.ruleFields?.[modelDetailInfo.value.subjectName]?.map(f => { | 102 | ruleField: info.ruleFields?.[modelDetailInfo.value.subjectName]?.map(f => { |
| 103 | return { | 103 | return { |
| 104 | enName: f | 104 | enName: f |
| 105 | } | 105 | } |
| ... | @@ -116,22 +116,38 @@ const transformRulesInfo = (info) => { | ... | @@ -116,22 +116,38 @@ const transformRulesInfo = (info) => { |
| 116 | differenceRange: info.rows[0].differenceRange, | 116 | differenceRange: info.rows[0].differenceRange, |
| 117 | rows: '' | 117 | rows: '' |
| 118 | }); | 118 | }); |
| 119 | } else if (info.ruleCode === 'value_of_range') { | 119 | } else if (info.ruleCode === 'value_of_range') { |
| 120 | let subjectName = modelDetailInfo.value.subjectName; | 120 | let subjectName = modelDetailInfo.value.subjectName; |
| 121 | let fields = info.ruleFields[subjectName]; | 121 | let fields = info.ruleFields[subjectName]; |
| 122 | return Object.assign({}, info, { | 122 | return Object.assign({}, info, { |
| 123 | qualityModelGuid: modelGuid, | 123 | qualityModelGuid: modelGuid, |
| 124 | ruleCode: info.ruleCode, | 124 | ruleCode: info.ruleCode, |
| 125 | ruleField: fields.map(f => { | 125 | ruleField: fields.map(f => { |
| 126 | return { | 126 | return { |
| 127 | guid: f.guid, | 127 | guid: f.guid, |
| 128 | enName: f.enName, | 128 | enName: f.enName, |
| 129 | chName: f.chName, | 129 | chName: f.chName, |
| 130 | dataType: f.dataType, | 130 | dataType: f.dataType, |
| 131 | startValue: f.startValue, | 131 | startValue: f.startValue, |
| 132 | endValue: f.endValue, | 132 | endValue: f.endValue, |
| 133 | dataRange: f.dataRange | 133 | dataRange: f.dataRange |
| 134 | } | 134 | } |
| 135 | }), | ||
| 136 | ruleFields: '' | ||
| 137 | }); | ||
| 138 | } else if (info.ruleCode == 'ref_integrality') { | ||
| 139 | return Object.assign({}, info, { | ||
| 140 | qualityModelGuid: modelGuid, | ||
| 141 | ruleCode: info.ruleCode, | ||
| 142 | ruleField: info.ruleFields.map(row => { | ||
| 143 | return { | ||
| 144 | // guid: row.mainTable, | ||
| 145 | enName: row.mainTableField, | ||
| 146 | //chName: row.chName, | ||
| 147 | compareTableGuid: row.compareTableGuid, | ||
| 148 | compareTableName: row.compareTableName, | ||
| 149 | compareEnName: row.compareEnName | ||
| 150 | } | ||
| 135 | }), | 151 | }), |
| 136 | ruleFields: '' | 152 | ruleFields: '' |
| 137 | }); | 153 | }); | ... | ... |
| ... | @@ -271,7 +271,7 @@ const batching = (type) => { | ... | @@ -271,7 +271,7 @@ const batching = (type) => { |
| 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' |
| 274 | dialogInfo.value.size = 500 | 274 | dialogInfo.value.size = isfileImport == '4' ? 600 : 500; |
| 275 | uploadFiles.value = [] | 275 | uploadFiles.value = [] |
| 276 | uploadInfo.value.uploadInfo.steps = uploadSteps.value | 276 | uploadInfo.value.uploadInfo.steps = uploadSteps.value |
| 277 | const content: any = [uploadInfo.value] | 277 | const content: any = [uploadInfo.value] |
| ... | @@ -374,17 +374,24 @@ const importData = (info) => { | ... | @@ -374,17 +374,24 @@ const importData = (info) => { |
| 374 | }); | 374 | }); |
| 375 | paramUrl = `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/excel-by-subject-guid?staffGuid=${userData.staffGuid}&subjectGuid=${route.query.bizGuid}` | 375 | paramUrl = `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/excel-by-subject-guid?staffGuid=${userData.staffGuid}&subjectGuid=${route.query.bizGuid}` |
| 376 | } else if (isfileImport == '4') { | 376 | } else if (isfileImport == '4') { |
| 377 | if (!info.collectTaskName) { | 377 | if (!info.databaseNameZh) { |
| 378 | ElMessage({ | 378 | ElMessage({ |
| 379 | type: 'error', | 379 | type: 'error', |
| 380 | message: '请填写采集任务名称' | 380 | message: '请填写数据源名称' |
| 381 | }) | ||
| 382 | return; | ||
| 383 | } | ||
| 384 | if (!info.databaseNameEn) { | ||
| 385 | ElMessage({ | ||
| 386 | type: 'error', | ||
| 387 | message: '请填写数据库英文名' | ||
| 381 | }) | 388 | }) |
| 382 | return; | 389 | return; |
| 383 | } | 390 | } |
| 384 | uploadFiles.value.forEach((item: any, index: number) => { | 391 | uploadFiles.value.forEach((item: any, index: number) => { |
| 385 | params.append("uploadFile", item.raw); | 392 | params.append("uploadFile", item.raw); |
| 386 | }); | 393 | }); |
| 387 | paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&collectTaskName=${info.collectTaskName}` | 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}` |
| 388 | } else { | 395 | } else { |
| 389 | uploadFiles.value.forEach((item: any, index: number) => { | 396 | uploadFiles.value.forEach((item: any, index: number) => { |
| 390 | params.append("file", item.raw); | 397 | params.append("file", item.raw); |
| ... | @@ -562,17 +569,36 @@ const setUploadInfo = () => { | ... | @@ -562,17 +569,36 @@ const setUploadInfo = () => { |
| 562 | uploadSteps.value = [ | 569 | uploadSteps.value = [ |
| 563 | { | 570 | { |
| 564 | title: '1、导入前请先录入以下内容', | 571 | title: '1、导入前请先录入以下内容', |
| 565 | type: 'input', | 572 | type: 'group', |
| 566 | selectInfo: { | 573 | formItems: [{ |
| 567 | label: '采集任务名称', | 574 | type: 'input', |
| 575 | label: '数据源名称', | ||
| 568 | placeholder: '请输入', | 576 | placeholder: '请输入', |
| 569 | field: 'collectTaskName', | 577 | field: 'databaseNameZh', |
| 570 | default: '', | 578 | default: '', |
| 571 | clearable: true, | 579 | clearable: true, |
| 572 | maxlength: 50, | 580 | maxlength: 50, |
| 573 | filterable: true, | 581 | filterable: true, |
| 574 | required: true | 582 | required: true |
| 575 | } | 583 | }, { |
| 584 | type: 'input', | ||
| 585 | label: '数据库英文名', | ||
| 586 | placeholder: '请输入', | ||
| 587 | field: 'databaseNameEn', | ||
| 588 | default: '', | ||
| 589 | clearable: true, | ||
| 590 | maxlength: 50, | ||
| 591 | filterable: true, | ||
| 592 | required: true | ||
| 593 | }, { | ||
| 594 | label: '是否覆盖原有数据', | ||
| 595 | type: 'switch', | ||
| 596 | field: 'isCover', | ||
| 597 | activeValue: 'Y', | ||
| 598 | block: true, | ||
| 599 | required: true, | ||
| 600 | inactiveValue: 'N' | ||
| 601 | }] | ||
| 576 | }, | 602 | }, |
| 577 | { | 603 | { |
| 578 | title: '2、请下载最新的模板,并按照模板格式准备需要导入的数据', | 604 | title: '2、请下载最新的模板,并按照模板格式准备需要导入的数据', |
| ... | @@ -591,7 +617,7 @@ const setUploadInfo = () => { | ... | @@ -591,7 +617,7 @@ const setUploadInfo = () => { |
| 591 | } | 617 | } |
| 592 | } | 618 | } |
| 593 | ] | 619 | ] |
| 594 | uploadInfo.value.uploadInfo.extraParams = {} | 620 | uploadInfo.value.uploadInfo.extraParams = { isCover: 'Y' } |
| 595 | } else { | 621 | } else { |
| 596 | uploadSteps.value = [ | 622 | uploadSteps.value = [ |
| 597 | { | 623 | { | ... | ... |
-
Please register or sign in to post a comment