fix
Showing
2 changed files
with
16 additions
and
25 deletions
| ... | @@ -307,3 +307,9 @@ export const deleteStandardCodeFieldsData = (params) => request({ | ... | @@ -307,3 +307,9 @@ export const deleteStandardCodeFieldsData = (params) => request({ |
| 307 | method: 'post', | 307 | method: 'post', |
| 308 | data: params | 308 | data: params |
| 309 | }) | 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 | ||
| 315 | }) | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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, |
| ... | @@ -1080,32 +1080,15 @@ const uploadFile = (file) => { | ... | @@ -1080,32 +1080,15 @@ const uploadFile = (file) => { |
| 1080 | } | 1080 | } |
| 1081 | 1081 | ||
| 1082 | const exportData = (type: any = null) => { | 1082 | const exportData = (type: any = null) => { |
| 1083 | if (type == 'model') { | 1083 | let body = [treeCurrentNodeKey.value] |
| 1084 | let params = { | 1084 | exportStandardCodeData(body).then((res:any) => { |
| 1085 | guid: dictGuid.value | ||
| 1086 | } | ||
| 1087 | if (drawerInfo.value.type == 'add') { | ||
| 1088 | params.guid = fieldSheetInfo.value.guid | ||
| 1089 | } | ||
| 1090 | exportDictionary(params).then((res: any) => { | ||
| 1091 | if (res && !res.msg) { | ||
| 1092 | download(res, '数据字典模板.xlsx', 'excel') | ||
| 1093 | } else { | ||
| 1094 | res?.msg && ElMessage.error(res?.msg); | ||
| 1095 | } | ||
| 1096 | }); | ||
| 1097 | } else { | ||
| 1098 | let params = { | ||
| 1099 | guid: dictGuid.value | ||
| 1100 | } | ||
| 1101 | exportDictionaryFileds(params).then((res: any) => { | ||
| 1102 | if (res && !res.msg) { | 1085 | if (res && !res.msg) { |
| 1103 | download(res, '字典数据.xlsx', 'excel'); | 1086 | download(res, '标准代码表.xlsx', 'excel') |
| 1104 | } else { | 1087 | } else { |
| 1105 | res?.msg && ElMessage.error(res?.msg); | 1088 | res?.msg && ElMessage.error(res?.msg); |
| 1106 | } | 1089 | } |
| 1107 | }); | 1090 | }) |
| 1108 | } | 1091 | return |
| 1109 | } | 1092 | } |
| 1110 | 1093 | ||
| 1111 | const importData = (file: any = null) => { | 1094 | const importData = (file: any = null) => { |
| ... | @@ -1221,6 +1204,7 @@ const loadDrawer = async () => { | ... | @@ -1221,6 +1204,7 @@ const loadDrawer = async () => { |
| 1221 | setCodeOptions() | 1204 | setCodeOptions() |
| 1222 | }; | 1205 | }; |
| 1223 | 1206 | ||
| 1207 | const treeCurrentNodeKey = ref('') | ||
| 1224 | const batching = (type) => { | 1208 | const batching = (type) => { |
| 1225 | if (type == 'delete') { | 1209 | if (type == 'delete') { |
| 1226 | if (selectRowData.value.length == 0) { | 1210 | if (selectRowData.value.length == 0) { |
| ... | @@ -1268,6 +1252,7 @@ const nodeClick = (data) => { | ... | @@ -1268,6 +1252,7 @@ const nodeClick = (data) => { |
| 1268 | nextTick(() => { | 1252 | nextTick(() => { |
| 1269 | dictFiledsRef.value.standardGuid = data.value | 1253 | dictFiledsRef.value.standardGuid = data.value |
| 1270 | dictFiledsRef.value.standardName = data.label | 1254 | dictFiledsRef.value.standardName = data.label |
| 1255 | treeCurrentNodeKey.value = data.value | ||
| 1271 | dictFiledsRef.value.getFirstPageData() | 1256 | dictFiledsRef.value.getFirstPageData() |
| 1272 | }) | 1257 | }) |
| 1273 | } else { | 1258 | } else { |
| ... | @@ -1385,7 +1370,7 @@ const saveData = async (params) => { | ... | @@ -1385,7 +1370,7 @@ const saveData = async (params) => { |
| 1385 | drawerInfo.value.visible = false | 1370 | drawerInfo.value.visible = false |
| 1386 | } | 1371 | } |
| 1387 | }).finally(() => { | 1372 | }).finally(() => { |
| 1388 | drawerInfo.value.footer.btns.map((item: any) => item.disabled = true) | 1373 | drawerInfo.value.footer.btns.map((item: any) => item.disabled = false) |
| 1389 | }) | 1374 | }) |
| 1390 | } | 1375 | } |
| 1391 | 1376 | ||
| ... | @@ -1513,7 +1498,7 @@ onMounted(() => { | ... | @@ -1513,7 +1498,7 @@ onMounted(() => { |
| 1513 | <template> | 1498 | <template> |
| 1514 | <div class="container_wrap full flex"> | 1499 | <div class="container_wrap full flex"> |
| 1515 | <div class="aside_wrap"> | 1500 | <div class="aside_wrap"> |
| 1516 | <div class="aside_title">数据字典列表</div> | 1501 | <div class="aside_title">标准代码列表</div> |
| 1517 | <Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @loadNode="loadTreeNode"/> | 1502 | <Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @loadNode="loadTreeNode"/> |
| 1518 | </div> | 1503 | </div> |
| 1519 | <DictFileds ref="dictFiledsRef" v-if="showFiledsPage" @exportData="exportData" /> | 1504 | <DictFileds ref="dictFiledsRef" v-if="showFiledsPage" @exportData="exportData" /> | ... | ... |
-
Please register or sign in to post a comment