标注代码表导入
Showing
4 changed files
with
52 additions
and
22 deletions
| ... | @@ -257,6 +257,17 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -257,6 +257,17 @@ const routes: RouteRecordRaw[] = [ |
| 257 | breadcrumb: false, | 257 | breadcrumb: false, |
| 258 | cache: true | 258 | cache: true |
| 259 | } | 259 | } |
| 260 | }, | ||
| 261 | { | ||
| 262 | path: 'standard-import', | ||
| 263 | name: 'metadataStandardImport', | ||
| 264 | component: () => import('@/views/data_meta/standard-import.vue'), | ||
| 265 | meta: { | ||
| 266 | title: '标准代码导入', | ||
| 267 | breadcrumb: false, | ||
| 268 | cache: true, | ||
| 269 | activeMenu: '/data-meta/metadata-standard/standard-codetable' | ||
| 270 | } | ||
| 260 | } | 271 | } |
| 261 | ] | 272 | ] |
| 262 | } | 273 | } | ... | ... |
| ... | @@ -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 | }); | ... | ... |
| ... | @@ -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 | }, |
| ... | @@ -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) => { |
| ... | @@ -1222,7 +1218,7 @@ const loadDrawer = async () => { | ... | @@ -1222,7 +1218,7 @@ const loadDrawer = async () => { |
| 1222 | drawerInfo.value.visible = true | 1218 | drawerInfo.value.visible = true |
| 1223 | console.log('table', formTable.value) | 1219 | console.log('table', formTable.value) |
| 1224 | console.log('formInfo', formInfo) | 1220 | console.log('formInfo', formInfo) |
| 1225 | 1221 | setCodeOptions() | |
| 1226 | }; | 1222 | }; |
| 1227 | 1223 | ||
| 1228 | const batching = (type) => { | 1224 | const batching = (type) => { |
| ... | @@ -1238,6 +1234,26 @@ const batching = (type) => { | ... | @@ -1238,6 +1234,26 @@ const batching = (type) => { |
| 1238 | open("此操作将永久删除, 是否继续?", "warning", true); | 1234 | open("此操作将永久删除, 是否继续?", "warning", true); |
| 1239 | tableInfo.value.loading = false | 1235 | tableInfo.value.loading = false |
| 1240 | } | 1236 | } |
| 1237 | if (type == 'export') { | ||
| 1238 | if (selectRowData.value.length == 0) { | ||
| 1239 | ElMessage({ | ||
| 1240 | type: 'error', | ||
| 1241 | message: '请选择代码名称', | ||
| 1242 | }) | ||
| 1243 | return | ||
| 1244 | } | ||
| 1245 | // console.log(selectedRowData) | ||
| 1246 | let uploadSetting = selectedRowData.value.map(item => { | ||
| 1247 | return { | ||
| 1248 | standardName: item.codeName, | ||
| 1249 | standardGuid: item.guid | ||
| 1250 | } | ||
| 1251 | }) | ||
| 1252 | cacheStore.setCatch('uploadSetting', uploadSetting) | ||
| 1253 | router.push({ | ||
| 1254 | path: '/data-meta/metadata-standard/standard-import', | ||
| 1255 | }); | ||
| 1256 | } | ||
| 1241 | }; | 1257 | }; |
| 1242 | 1258 | ||
| 1243 | const nodeClick = (data) => { | 1259 | const nodeClick = (data) => { |
| ... | @@ -1251,6 +1267,7 @@ const nodeClick = (data) => { | ... | @@ -1251,6 +1267,7 @@ const nodeClick = (data) => { |
| 1251 | showFiledsPage.value = true | 1267 | showFiledsPage.value = true |
| 1252 | nextTick(() => { | 1268 | nextTick(() => { |
| 1253 | dictFiledsRef.value.standardGuid = data.value | 1269 | dictFiledsRef.value.standardGuid = data.value |
| 1270 | dictFiledsRef.value.standardName = data.label | ||
| 1254 | dictFiledsRef.value.getFirstPageData() | 1271 | dictFiledsRef.value.getFirstPageData() |
| 1255 | }) | 1272 | }) |
| 1256 | } else { | 1273 | } else { |
| ... | @@ -1354,6 +1371,7 @@ const setDetailInfo = () => { | ... | @@ -1354,6 +1371,7 @@ const setDetailInfo = () => { |
| 1354 | drawerInfo.value.container.contents = contents.value['add'] | 1371 | drawerInfo.value.container.contents = contents.value['add'] |
| 1355 | 1372 | ||
| 1356 | drawerInfo.value.visible = true | 1373 | drawerInfo.value.visible = true |
| 1374 | setCodeOptions() | ||
| 1357 | } | 1375 | } |
| 1358 | 1376 | ||
| 1359 | const saveData = async (params) => { | 1377 | const saveData = async (params) => { |
| ... | @@ -1504,6 +1522,7 @@ onMounted(() => { | ... | @@ -1504,6 +1522,7 @@ onMounted(() => { |
| 1504 | <div class="tools_btns"> | 1522 | <div class="tools_btns"> |
| 1505 | <el-button type="primary" @click="loadDrawer" v-preReClick>新建</el-button> | 1523 | <el-button type="primary" @click="loadDrawer" v-preReClick>新建</el-button> |
| 1506 | <el-button @click="batching('delete')" v-preReClick>批量删除</el-button> | 1524 | <el-button @click="batching('delete')" v-preReClick>批量删除</el-button> |
| 1525 | <el-button @click="batching('export')" v-preReClick>批量导入</el-button> | ||
| 1507 | </div> | 1526 | </div> |
| 1508 | <el-input class="table_search_input" v-model.trim="tableSearchInput" placeholder="请输入代码名称搜索" | 1527 | <el-input class="table_search_input" v-model.trim="tableSearchInput" placeholder="请输入代码名称搜索" |
| 1509 | :suffix-icon="Search" clearable @change="val => getFirstPageData()" /> | 1528 | :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