fix: 数据字典,上传文件去掉签名
Showing
4 changed files
with
48 additions
and
25 deletions
| ... | @@ -69,10 +69,18 @@ export const getUpFileSignByUrl = (params) => { | ... | @@ -69,10 +69,18 @@ export const getUpFileSignByUrl = (params) => { |
| 69 | }); | 69 | }); |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | function getPathUrl(url:string) { | ||
| 73 | // 查找问号的位置 | ||
| 74 | var questionMarkIndex = url.indexOf('?'); | ||
| 75 | |||
| 76 | // 如果存在问号,则返回问号之前的部分;如果不存在,则返回原url | ||
| 77 | return questionMarkIndex !== -1 ? url.substring(0, questionMarkIndex) : url; | ||
| 78 | } | ||
| 79 | |||
| 72 | //obs上传 | 80 | //obs上传 |
| 73 | export const obsUploadRequest = (params) => { | 81 | export const obsUploadRequest = (params) => { |
| 74 | return request({ | 82 | return request({ |
| 75 | url: params.signedUrl, | 83 | url: params.signedUrl && getPathUrl(params.signedUrl), |
| 76 | withCredentials: false, | 84 | withCredentials: false, |
| 77 | headers: params.actualSignedRequestHeaders ? { | 85 | headers: params.actualSignedRequestHeaders ? { |
| 78 | "Content-Type": params.actualSignedRequestHeaders[ | 86 | "Content-Type": params.actualSignedRequestHeaders[ | ... | ... |
| ... | @@ -280,6 +280,17 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -280,6 +280,17 @@ const routes: RouteRecordRaw[] = [ |
| 280 | cache: true | 280 | cache: true |
| 281 | }, | 281 | }, |
| 282 | }, | 282 | }, |
| 283 | { | ||
| 284 | path: '/data-inventory/data-dictionary/import-file', | ||
| 285 | name: 'importFile', | ||
| 286 | component: () => import('@/views/importFile.vue'), | ||
| 287 | meta: { | ||
| 288 | title: '文件导入', | ||
| 289 | sidebar: false, | ||
| 290 | breadcrumb: false, | ||
| 291 | cache: true | ||
| 292 | }, | ||
| 293 | }, | ||
| 283 | ], | 294 | ], |
| 284 | }, | 295 | }, |
| 285 | { | 296 | { | ... | ... |
| ... | @@ -170,7 +170,7 @@ const toolBtnClick = (btn) => { | ... | @@ -170,7 +170,7 @@ const toolBtnClick = (btn) => { |
| 170 | cacheStore.setCatch('uploadSetting', info) | 170 | cacheStore.setCatch('uploadSetting', info) |
| 171 | nextTick(() => { | 171 | nextTick(() => { |
| 172 | router.push({ | 172 | router.push({ |
| 173 | path: '/data-standards/import-file', | 173 | path: '/data-inventory/data-dictionary/import-file', |
| 174 | }); | 174 | }); |
| 175 | }) | 175 | }) |
| 176 | } else if (type == 'submit') { | 176 | } else if (type == 'submit') { | ... | ... |
| ... | @@ -25,6 +25,9 @@ import { | ... | @@ -25,6 +25,9 @@ import { |
| 25 | getDownFileSignByUrl, | 25 | getDownFileSignByUrl, |
| 26 | obsDownloadRequest | 26 | obsDownloadRequest |
| 27 | } from '@/api/modules/obsService'; | 27 | } from '@/api/modules/obsService'; |
| 28 | import { | ||
| 29 | getDictionaryTree | ||
| 30 | } from '@/api/modules/dataInventory'; | ||
| 28 | import { commonPageConfig } from '@/utils/enum'; | 31 | import { commonPageConfig } from '@/utils/enum'; |
| 29 | 32 | ||
| 30 | const { proxy } = getCurrentInstance() as any; | 33 | const { proxy } = getCurrentInstance() as any; |
| ... | @@ -44,9 +47,9 @@ const tabsActiveName = ref('') | ... | @@ -44,9 +47,9 @@ const tabsActiveName = ref('') |
| 44 | const uploadSetting: any = ref({}) | 47 | const uploadSetting: any = ref({}) |
| 45 | const importType = ref('') | 48 | const importType = ref('') |
| 46 | const defaulttabs = [ | 49 | const defaulttabs = [ |
| 47 | { label: '标准集导入', name: 'standard' }, | 50 | // { label: '标准集导入', name: 'standard' }, |
| 48 | { label: '字段标准导入', name: 'field' }, | 51 | // { label: '字段标准导入', name: 'field' }, |
| 49 | { label: '命名标准导入', name: 'naming' }, | 52 | // { label: '命名标准导入', name: 'naming' }, |
| 50 | { label: '数据字典导入', name: 'dictionary' }, | 53 | { label: '数据字典导入', name: 'dictionary' }, |
| 51 | // { label: '质量模型导入', name: 'qualityModelGroup' }, | 54 | // { label: '质量模型导入', name: 'qualityModelGroup' }, |
| 52 | // { label: '质量规则导入', name: 'qualityRule' }, | 55 | // { label: '质量规则导入', name: 'qualityRule' }, |
| ... | @@ -135,23 +138,23 @@ const dialogInfo: any = ref({ | ... | @@ -135,23 +138,23 @@ const dialogInfo: any = ref({ |
| 135 | }) | 138 | }) |
| 136 | 139 | ||
| 137 | // // 获取所有数据字典 | 140 | // // 获取所有数据字典 |
| 138 | // const getDictList = () => { | 141 | const getDictList = () => { |
| 139 | // const params = { | 142 | const params = { |
| 140 | // paramCode: 'data_structure_code' | 143 | paramCode: '数据字典类型' |
| 141 | // } | 144 | } |
| 142 | // getDictionaryTree(params).then((res: any) => { | 145 | getDictionaryTree(params).then((res: any) => { |
| 143 | // if (res.code == proxy.$passCode) { | 146 | if (res.code == proxy.$passCode) { |
| 144 | // const data = res.data ?? [] | 147 | const data = res.data ?? [] |
| 145 | // const treeList = data.filter(item => item.children && item.children.length) | 148 | const treeList = data.filter(item => item.children && item.children.length) |
| 146 | // dictionaryList.value = treeList | 149 | dictionaryList.value = treeList |
| 147 | // } else { | 150 | } else { |
| 148 | // ElMessage({ | 151 | ElMessage({ |
| 149 | // type: 'error', | 152 | type: 'error', |
| 150 | // message: res.msg, | 153 | message: res.msg, |
| 151 | // }) | 154 | }) |
| 152 | // } | 155 | } |
| 153 | // }) | 156 | }) |
| 154 | // } | 157 | } |
| 155 | 158 | ||
| 156 | const tabsChange = (name) => { | 159 | const tabsChange = (name) => { |
| 157 | tabsActiveName.value = name | 160 | tabsActiveName.value = name |
| ... | @@ -658,10 +661,11 @@ onActivated(() => { | ... | @@ -658,10 +661,11 @@ onActivated(() => { |
| 658 | if (isfileImport) { | 661 | if (isfileImport) { |
| 659 | tabsActiveName.value = 'importFile' | 662 | tabsActiveName.value = 'importFile' |
| 660 | } else { | 663 | } else { |
| 661 | tabsActiveName.value = uploadSetting.value?.type || 'standard' | 664 | tabsActiveName.value = uploadSetting.value?.type || 'dictionary' |
| 665 | } | ||
| 666 | if (tabsActiveName.value == 'dictionary') { | ||
| 667 | getDictList(); | ||
| 662 | } | 668 | } |
| 663 | |||
| 664 | //getDictList() | ||
| 665 | setUploadInfo() | 669 | setUploadInfo() |
| 666 | }) | 670 | }) |
| 667 | 671 | ... | ... |
-
Please register or sign in to post a comment