Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop
Showing
5 changed files
with
72 additions
and
51 deletions
| ... | @@ -306,4 +306,10 @@ export const deleteStandardCodeFieldsData = (params) => request({ | ... | @@ -306,4 +306,10 @@ export const deleteStandardCodeFieldsData = (params) => request({ |
| 306 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/standard-code/data/remove-data`, | 306 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/standard-code/data/remove-data`, |
| 307 | method: 'post', | 307 | method: 'post', |
| 308 | data: params | 308 | data: params |
| 309 | }) | ||
| 310 | /** 元数据-导出 */ | ||
| 311 | export const exportStandardCodeData = (params) => request({ | ||
| 312 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/standard-code/data/data-export`, | ||
| 313 | method: 'post', | ||
| 314 | data: params | ||
| 309 | }) | 315 | }) |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -213,6 +213,17 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -213,6 +213,17 @@ const routes: RouteRecordRaw[] = [ |
| 213 | breadcrumb: false, | 213 | breadcrumb: false, |
| 214 | cache: true | 214 | cache: true |
| 215 | } | 215 | } |
| 216 | }, | ||
| 217 | { | ||
| 218 | path: 'standard-import', | ||
| 219 | name: 'metadataStandardImport', | ||
| 220 | component: () => import('@/views/data_meta/standard-import.vue'), | ||
| 221 | meta: { | ||
| 222 | title: '标准代码导入', | ||
| 223 | breadcrumb: false, | ||
| 224 | cache: true, | ||
| 225 | activeMenu: '/data-meta/metadata-standard/standard-codetable' | ||
| 226 | } | ||
| 216 | } | 227 | } |
| 217 | ] | 228 | ] |
| 218 | } | 229 | } | ... | ... |
| ... | @@ -26,6 +26,7 @@ const { proxy } = getCurrentInstance() as any; | ... | @@ -26,6 +26,7 @@ const { proxy } = getCurrentInstance() as any; |
| 26 | 26 | ||
| 27 | const cacheStore = useCatchStore() | 27 | const cacheStore = useCatchStore() |
| 28 | const standardGuid = ref("") | 28 | const standardGuid = ref("") |
| 29 | const standardName = ref('') | ||
| 29 | const tableSearchInput = ref('') | 30 | const tableSearchInput = ref('') |
| 30 | const tableFields: any = ref([]) | 31 | const tableFields: any = ref([]) |
| 31 | const orginData: any = ref([]) | 32 | const orginData: any = ref([]) |
| ... | @@ -156,19 +157,17 @@ const tablePageChange = (info) => { | ... | @@ -156,19 +157,17 @@ const tablePageChange = (info) => { |
| 156 | }; | 157 | }; |
| 157 | 158 | ||
| 158 | const toolBtnClick = (btn) => { | 159 | const toolBtnClick = (btn) => { |
| 159 | console.log('btnType', btn) | ||
| 160 | const type = btn.value | 160 | const type = btn.value |
| 161 | if (type == 'export') { | 161 | if (type == 'export') { |
| 162 | exportData() | 162 | exportData() |
| 163 | } else if (type == 'import') { | 163 | } else if (type == 'import') { |
| 164 | const info = { | 164 | const info = [ |
| 165 | type: 'dictionary', | 165 | { standardGuid: standardGuid.value, standardName: standardName.value } |
| 166 | standardGuid: standardGuid.value | 166 | ] |
| 167 | } | ||
| 168 | cacheStore.setCatch('uploadSetting', info) | 167 | cacheStore.setCatch('uploadSetting', info) |
| 169 | nextTick(() => { | 168 | nextTick(() => { |
| 170 | router.push({ | 169 | router.push({ |
| 171 | path: '/data-inventory/data-dictionary/import-file', | 170 | path: '/data-meta/metadata-standard/standard-import', |
| 172 | }); | 171 | }); |
| 173 | }) | 172 | }) |
| 174 | } else if (type == 'submit') { | 173 | } else if (type == 'submit') { |
| ... | @@ -537,6 +536,7 @@ const dialogBtnClick = (btn, info) => { | ... | @@ -537,6 +536,7 @@ const dialogBtnClick = (btn, info) => { |
| 537 | 536 | ||
| 538 | defineExpose({ | 537 | defineExpose({ |
| 539 | standardGuid, | 538 | standardGuid, |
| 539 | standardName, | ||
| 540 | getFirstPageData, | 540 | getFirstPageData, |
| 541 | checkSave | 541 | checkSave |
| 542 | }); | 542 | }); | ... | ... |
| ... | @@ -15,7 +15,7 @@ import { download } from '@/utils/common' | ... | @@ -15,7 +15,7 @@ import { download } from '@/utils/common' |
| 15 | import { getParamsList } from '@/api/modules/dataAsset' | 15 | import { getParamsList } from '@/api/modules/dataAsset' |
| 16 | import { getStandardCodeList, saveStandardCode, | 16 | import { getStandardCodeList, saveStandardCode, |
| 17 | updateStandardCode, getStandardCodeDetail, | 17 | updateStandardCode, getStandardCodeDetail, |
| 18 | deleteStandardCode, getStandardCodeStandard | 18 | deleteStandardCode, getStandardCodeStandard, exportStandardCodeData |
| 19 | } from '@/api/modules/dataMetaService' | 19 | } from '@/api/modules/dataMetaService' |
| 20 | import { | 20 | import { |
| 21 | addDictionary, | 21 | addDictionary, |
| ... | @@ -38,6 +38,7 @@ import { | ... | @@ -38,6 +38,7 @@ import { |
| 38 | checkDictionaryData, | 38 | checkDictionaryData, |
| 39 | getNewDataTypeList | 39 | getNewDataTypeList |
| 40 | } from '@/api/modules/dataInventory'; | 40 | } from '@/api/modules/dataInventory'; |
| 41 | import router from '@/router' | ||
| 41 | 42 | ||
| 42 | const { proxy } = getCurrentInstance() as any; | 43 | const { proxy } = getCurrentInstance() as any; |
| 43 | 44 | ||
| ... | @@ -103,6 +104,7 @@ const page = ref({ | ... | @@ -103,6 +104,7 @@ const page = ref({ |
| 103 | ], | 104 | ], |
| 104 | }); | 105 | }); |
| 105 | const selectRowData = ref([]) | 106 | const selectRowData = ref([]) |
| 107 | const selectedRowData = ref([]) | ||
| 106 | const tableInfo: any = ref({ | 108 | const tableInfo: any = ref({ |
| 107 | id: 'data-source-table', | 109 | id: 'data-source-table', |
| 108 | multiple: true, | 110 | multiple: true, |
| ... | @@ -140,6 +142,7 @@ const orginOptions = [ | ... | @@ -140,6 +142,7 @@ const orginOptions = [ |
| 140 | { label: 'code', value: 'code' }, | 142 | { label: 'code', value: 'code' }, |
| 141 | { label: 'name', value: 'name' }, | 143 | { label: 'name', value: 'name' }, |
| 142 | ] | 144 | ] |
| 145 | let codeOptions = ref([]) | ||
| 143 | const orginItems = [ | 146 | const orginItems = [ |
| 144 | { | 147 | { |
| 145 | label: '标准类型', | 148 | label: '标准类型', |
| ... | @@ -306,18 +309,17 @@ const formItems: any = ref([ | ... | @@ -306,18 +309,17 @@ const formItems: any = ref([ |
| 306 | required: true | 309 | required: true |
| 307 | }, | 310 | }, |
| 308 | { | 311 | { |
| 309 | label: '编码字段', | 312 | label: '编码字段11', |
| 310 | type: 'select', | 313 | type: 'select', |
| 311 | placeholder: '请选择', | 314 | placeholder: '请选择', |
| 312 | field: 'codeFields', | 315 | field: 'codeFields', |
| 313 | default: [], | 316 | default: [], |
| 314 | options: [ | 317 | options: codeOptions, |
| 315 | { label: 'code', value: 'code' }, | ||
| 316 | { label: 'name', value: 'name' } | ||
| 317 | ], | ||
| 318 | clearable: true, | 318 | clearable: true, |
| 319 | required: true, | 319 | required: true, |
| 320 | multiple: true | 320 | multiple: true, |
| 321 | tagsTooltip: true, | ||
| 322 | filterable: true, | ||
| 321 | }, | 323 | }, |
| 322 | { | 324 | { |
| 323 | label: '编码名称', | 325 | label: '编码名称', |
| ... | @@ -325,10 +327,7 @@ const formItems: any = ref([ | ... | @@ -325,10 +327,7 @@ const formItems: any = ref([ |
| 325 | placeholder: '请选择', | 327 | placeholder: '请选择', |
| 326 | field: 'codeFieldName', | 328 | field: 'codeFieldName', |
| 327 | default: '', | 329 | default: '', |
| 328 | options: [ | 330 | options: codeOptions, |
| 329 | { label: 'code', value: 'code' }, | ||
| 330 | { label: 'name', value: 'name' } | ||
| 331 | ], | ||
| 332 | clearable: true, | 331 | clearable: true, |
| 333 | required: true | 332 | required: true |
| 334 | }, | 333 | }, |
| ... | @@ -566,7 +565,7 @@ const drawerInfo: any = ref({ | ... | @@ -566,7 +565,7 @@ const drawerInfo: any = ref({ |
| 566 | btns: [ | 565 | btns: [ |
| 567 | { type: 'default', label: '取消', value: 'cancel' }, | 566 | { type: 'default', label: '取消', value: 'cancel' }, |
| 568 | { type: 'primary', label: '保存', value: 'submit' }, | 567 | { type: 'primary', label: '保存', value: 'submit' }, |
| 569 | { type: 'primary', label: '保存并添加数据', value: 'saveAndAdd', visible: true }, | 568 | { type: 'primary', label: '保存并添加数据', value: 'submit', visible: true }, |
| 570 | ] | 569 | ] |
| 571 | }, | 570 | }, |
| 572 | }) | 571 | }) |
| ... | @@ -759,6 +758,7 @@ const tableSelectionChange = (val, tId) => { | ... | @@ -759,6 +758,7 @@ const tableSelectionChange = (val, tId) => { |
| 759 | } | 758 | } |
| 760 | } else { | 759 | } else { |
| 761 | selectRowData.value = val.map((item) => item.guid); | 760 | selectRowData.value = val.map((item) => item.guid); |
| 761 | selectedRowData.value = val | ||
| 762 | } | 762 | } |
| 763 | }; | 763 | }; |
| 764 | 764 | ||
| ... | @@ -789,11 +789,7 @@ const setCodeOptions = () => { | ... | @@ -789,11 +789,7 @@ const setCodeOptions = () => { |
| 789 | opts.push(row) | 789 | opts.push(row) |
| 790 | } | 790 | } |
| 791 | }) | 791 | }) |
| 792 | formItems.value.at(-1).children.map(child => { | 792 | codeOptions.value = opts |
| 793 | if (child.type == 'select') { | ||
| 794 | child.options = opts | ||
| 795 | } | ||
| 796 | }) | ||
| 797 | } | 793 | } |
| 798 | 794 | ||
| 799 | const toolBtnClick = (btn, data) => { | 795 | const toolBtnClick = (btn, data) => { |
| ... | @@ -1084,32 +1080,15 @@ const uploadFile = (file) => { | ... | @@ -1084,32 +1080,15 @@ const uploadFile = (file) => { |
| 1084 | } | 1080 | } |
| 1085 | 1081 | ||
| 1086 | const exportData = (type: any = null) => { | 1082 | const exportData = (type: any = null) => { |
| 1087 | if (type == 'model') { | 1083 | let body = [treeCurrentNodeKey.value] |
| 1088 | let params = { | 1084 | exportStandardCodeData(body).then((res:any) => { |
| 1089 | guid: dictGuid.value | 1085 | if (res && !res.msg) { |
| 1090 | } | 1086 | download(res, '标准代码表.xlsx', 'excel') |
| 1091 | if (drawerInfo.value.type == 'add') { | 1087 | } else { |
| 1092 | params.guid = fieldSheetInfo.value.guid | 1088 | res?.msg && ElMessage.error(res?.msg); |
| 1093 | } | ||
| 1094 | exportDictionary(params).then((res: any) => { | ||
| 1095 | if (res && !res.msg) { | ||
| 1096 | download(res, '数据字典模板.xlsx', 'excel') | ||
| 1097 | } else { | ||
| 1098 | res?.msg && ElMessage.error(res?.msg); | ||
| 1099 | } | ||
| 1100 | }); | ||
| 1101 | } else { | ||
| 1102 | let params = { | ||
| 1103 | guid: dictGuid.value | ||
| 1104 | } | 1089 | } |
| 1105 | exportDictionaryFileds(params).then((res: any) => { | 1090 | }) |
| 1106 | if (res && !res.msg) { | 1091 | return |
| 1107 | download(res, '字典数据.xlsx', 'excel'); | ||
| 1108 | } else { | ||
| 1109 | res?.msg && ElMessage.error(res?.msg); | ||
| 1110 | } | ||
| 1111 | }); | ||
| 1112 | } | ||
| 1113 | } | 1092 | } |
| 1114 | 1093 | ||
| 1115 | const importData = (file: any = null) => { | 1094 | const importData = (file: any = null) => { |
| ... | @@ -1222,9 +1201,10 @@ const loadDrawer = async () => { | ... | @@ -1222,9 +1201,10 @@ const loadDrawer = async () => { |
| 1222 | drawerInfo.value.visible = true | 1201 | drawerInfo.value.visible = true |
| 1223 | console.log('table', formTable.value) | 1202 | console.log('table', formTable.value) |
| 1224 | console.log('formInfo', formInfo) | 1203 | console.log('formInfo', formInfo) |
| 1225 | 1204 | setCodeOptions() | |
| 1226 | }; | 1205 | }; |
| 1227 | 1206 | ||
| 1207 | const treeCurrentNodeKey = ref('') | ||
| 1228 | const batching = (type) => { | 1208 | const batching = (type) => { |
| 1229 | if (type == 'delete') { | 1209 | if (type == 'delete') { |
| 1230 | if (selectRowData.value.length == 0) { | 1210 | if (selectRowData.value.length == 0) { |
| ... | @@ -1238,6 +1218,26 @@ const batching = (type) => { | ... | @@ -1238,6 +1218,26 @@ const batching = (type) => { |
| 1238 | open("此操作将永久删除, 是否继续?", "warning", true); | 1218 | open("此操作将永久删除, 是否继续?", "warning", true); |
| 1239 | tableInfo.value.loading = false | 1219 | tableInfo.value.loading = false |
| 1240 | } | 1220 | } |
| 1221 | if (type == 'export') { | ||
| 1222 | if (selectRowData.value.length == 0) { | ||
| 1223 | ElMessage({ | ||
| 1224 | type: 'error', | ||
| 1225 | message: '请选择代码名称', | ||
| 1226 | }) | ||
| 1227 | return | ||
| 1228 | } | ||
| 1229 | // console.log(selectedRowData) | ||
| 1230 | let uploadSetting = selectedRowData.value.map(item => { | ||
| 1231 | return { | ||
| 1232 | standardName: item.codeName, | ||
| 1233 | standardGuid: item.guid | ||
| 1234 | } | ||
| 1235 | }) | ||
| 1236 | cacheStore.setCatch('uploadSetting', uploadSetting) | ||
| 1237 | router.push({ | ||
| 1238 | path: '/data-meta/metadata-standard/standard-import', | ||
| 1239 | }); | ||
| 1240 | } | ||
| 1241 | }; | 1241 | }; |
| 1242 | 1242 | ||
| 1243 | const nodeClick = (data) => { | 1243 | const nodeClick = (data) => { |
| ... | @@ -1251,6 +1251,8 @@ const nodeClick = (data) => { | ... | @@ -1251,6 +1251,8 @@ const nodeClick = (data) => { |
| 1251 | showFiledsPage.value = true | 1251 | showFiledsPage.value = true |
| 1252 | nextTick(() => { | 1252 | nextTick(() => { |
| 1253 | dictFiledsRef.value.standardGuid = data.value | 1253 | dictFiledsRef.value.standardGuid = data.value |
| 1254 | dictFiledsRef.value.standardName = data.label | ||
| 1255 | treeCurrentNodeKey.value = data.value | ||
| 1254 | dictFiledsRef.value.getFirstPageData() | 1256 | dictFiledsRef.value.getFirstPageData() |
| 1255 | }) | 1257 | }) |
| 1256 | } else { | 1258 | } else { |
| ... | @@ -1354,6 +1356,7 @@ const setDetailInfo = () => { | ... | @@ -1354,6 +1356,7 @@ const setDetailInfo = () => { |
| 1354 | drawerInfo.value.container.contents = contents.value['add'] | 1356 | drawerInfo.value.container.contents = contents.value['add'] |
| 1355 | 1357 | ||
| 1356 | drawerInfo.value.visible = true | 1358 | drawerInfo.value.visible = true |
| 1359 | setCodeOptions() | ||
| 1357 | } | 1360 | } |
| 1358 | 1361 | ||
| 1359 | const saveData = async (params) => { | 1362 | const saveData = async (params) => { |
| ... | @@ -1367,7 +1370,7 @@ const saveData = async (params) => { | ... | @@ -1367,7 +1370,7 @@ const saveData = async (params) => { |
| 1367 | drawerInfo.value.visible = false | 1370 | drawerInfo.value.visible = false |
| 1368 | } | 1371 | } |
| 1369 | }).finally(() => { | 1372 | }).finally(() => { |
| 1370 | drawerInfo.value.footer.btns.map((item: any) => item.disabled = true) | 1373 | drawerInfo.value.footer.btns.map((item: any) => item.disabled = false) |
| 1371 | }) | 1374 | }) |
| 1372 | } | 1375 | } |
| 1373 | 1376 | ||
| ... | @@ -1495,7 +1498,7 @@ onMounted(() => { | ... | @@ -1495,7 +1498,7 @@ onMounted(() => { |
| 1495 | <template> | 1498 | <template> |
| 1496 | <div class="container_wrap full flex"> | 1499 | <div class="container_wrap full flex"> |
| 1497 | <div class="aside_wrap"> | 1500 | <div class="aside_wrap"> |
| 1498 | <div class="aside_title">数据字典列表</div> | 1501 | <div class="aside_title">标准代码列表</div> |
| 1499 | <Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @loadNode="loadTreeNode"/> | 1502 | <Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @loadNode="loadTreeNode"/> |
| 1500 | </div> | 1503 | </div> |
| 1501 | <DictFileds ref="dictFiledsRef" v-if="showFiledsPage" @exportData="exportData" /> | 1504 | <DictFileds ref="dictFiledsRef" v-if="showFiledsPage" @exportData="exportData" /> |
| ... | @@ -1504,6 +1507,7 @@ onMounted(() => { | ... | @@ -1504,6 +1507,7 @@ onMounted(() => { |
| 1504 | <div class="tools_btns"> | 1507 | <div class="tools_btns"> |
| 1505 | <el-button type="primary" @click="loadDrawer" v-preReClick>新建</el-button> | 1508 | <el-button type="primary" @click="loadDrawer" v-preReClick>新建</el-button> |
| 1506 | <el-button @click="batching('delete')" v-preReClick>批量删除</el-button> | 1509 | <el-button @click="batching('delete')" v-preReClick>批量删除</el-button> |
| 1510 | <el-button @click="batching('export')" v-preReClick>批量导入</el-button> | ||
| 1507 | </div> | 1511 | </div> |
| 1508 | <el-input class="table_search_input" v-model.trim="tableSearchInput" placeholder="请输入代码名称搜索" | 1512 | <el-input class="table_search_input" v-model.trim="tableSearchInput" placeholder="请输入代码名称搜索" |
| 1509 | :suffix-icon="Search" clearable @change="val => getFirstPageData()" /> | 1513 | :suffix-icon="Search" clearable @change="val => getFirstPageData()" /> | ... | ... |
src/views/data_meta/standard-import.vue
0 → 100644
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment