数据源支持多种对象存储
Showing
2 changed files
with
34 additions
and
29 deletions
| ... | @@ -18,7 +18,7 @@ | ... | @@ -18,7 +18,7 @@ |
| 18 | @uploadFileChange="uploadFileChange" @checkboxChange="handleDataSelectFormCheckboxChange" /> | 18 | @uploadFileChange="uploadFileChange" @checkboxChange="handleDataSelectFormCheckboxChange" /> |
| 19 | </ContentWrap> | 19 | </ContentWrap> |
| 20 | <!-- 抽样预览的表单填写配置,及表格展示 --> | 20 | <!-- 抽样预览的表单填写配置,及表格展示 --> |
| 21 | <ContentWrap v-show="formRef?.formInline?.dataSource != 3 && !(formRef?.formInline?.dataSourceGuid && currDatasourceSelect?.databaseType === 'obs')" id="id-previewData" title="数据抽样预览" description="" | 21 | <ContentWrap v-show="formRef?.formInline?.dataSource != 3 && !(formRef?.formInline?.dataSourceGuid && objectTypesList.includes(currDatasourceSelect?.databaseType))" id="id-previewData" title="数据抽样预览" description="" |
| 22 | style="margin-top: 16px;"> | 22 | style="margin-top: 16px;"> |
| 23 | <!-- 选择抽样预览的表单设置 --> | 23 | <!-- 选择抽样预览的表单设置 --> |
| 24 | <Form ref="dataSimpleFormRef" :itemList="dataSimpleFormItems" :rules="dataSimpleFormRules" | 24 | <Form ref="dataSimpleFormRef" :itemList="dataSimpleFormItems" :rules="dataSimpleFormRules" |
| ... | @@ -288,6 +288,8 @@ const { required } = useValidator(); | ... | @@ -288,6 +288,8 @@ const { required } = useValidator(); |
| 288 | const fullscreenLoading = ref(false); | 288 | const fullscreenLoading = ref(false); |
| 289 | const containerRef = ref(); | 289 | const containerRef = ref(); |
| 290 | 290 | ||
| 291 | const objectTypesList = ref(['obs', 'minio', 'rustfs']); | ||
| 292 | |||
| 291 | const qualifiedIdentifierFloderList = ref([{ | 293 | const qualifiedIdentifierFloderList = ref([{ |
| 292 | enName: 'patient_birth_date', | 294 | enName: 'patient_birth_date', |
| 293 | chName: '患者出生日期', | 295 | chName: '患者出生日期', |
| ... | @@ -615,7 +617,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { | ... | @@ -615,7 +617,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { |
| 615 | return; | 617 | return; |
| 616 | } | 618 | } |
| 617 | let dsInfo = currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == val); | 619 | let dsInfo = currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == val); |
| 618 | if (dsInfo.databaseType == 'obs') { | 620 | if (objectTypesList.value.includes(dsInfo?.databaseType)) { |
| 619 | sampleTableFields.value = []; | 621 | sampleTableFields.value = []; |
| 620 | parseFileDataSum.value = []; | 622 | parseFileDataSum.value = []; |
| 621 | sampleTableData.value = []; | 623 | sampleTableData.value = []; |
| ... | @@ -672,7 +674,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { | ... | @@ -672,7 +674,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { |
| 672 | }); | 674 | }); |
| 673 | } else if (row.field == 'handleType') { | 675 | } else if (row.field == 'handleType') { |
| 674 | // 第一种匿名处理类型是不可以选择obs类型的。 | 676 | // 第一种匿名处理类型是不可以选择obs类型的。 |
| 675 | if (val == '01' && formInfo.dataSourceGuid && currDatasourceSelect.value.databaseType == 'obs') { | 677 | if (val == '01' && formInfo.dataSourceGuid && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 676 | formInfo.dataSourceGuid = ''; | 678 | formInfo.dataSourceGuid = ''; |
| 677 | } | 679 | } |
| 678 | setDataSelectFormItems(formInfo); | 680 | setDataSelectFormItems(formInfo); |
| ... | @@ -709,14 +711,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { | ... | @@ -709,14 +711,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { |
| 709 | item.default = ''; | 711 | item.default = ''; |
| 710 | } | 712 | } |
| 711 | } else if (item.field == 'qualifiedIdentifier') { | 713 | } else if (item.field == 'qualifiedIdentifier') { |
| 712 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs'); | 714 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)); |
| 713 | if (info['dataSource'] == 3) { | 715 | if (info['dataSource'] == 3) { |
| 714 | item.options = qualifiedIdentifierFloderList.value; | 716 | item.options = qualifiedIdentifierFloderList.value; |
| 715 | } | 717 | } |
| 716 | } else if (item.field == 'tableName') { | 718 | } else if (item.field == 'tableName') { |
| 717 | item.visible = !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs');//数据源类型为obs的没有数据表选择 | 719 | item.visible = !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType));//数据源类型为obs的没有数据表选择 |
| 718 | } else if (item.field == 'dataSourceGuid') { | 720 | } else if (item.field == 'dataSourceGuid') { |
| 719 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => d.databaseType !== 'obs') | 721 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) |
| 720 | } | 722 | } |
| 721 | }); | 723 | }); |
| 722 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; | 724 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; |
| ... | @@ -1543,12 +1545,12 @@ const changeStep = async (val) => { | ... | @@ -1543,12 +1545,12 @@ const changeStep = async (val) => { |
| 1543 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { | 1545 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { |
| 1544 | if (valid) { | 1546 | if (valid) { |
| 1545 | let dataSource = formRef.value?.formInline?.dataSource; | 1547 | let dataSource = formRef.value?.formInline?.dataSource; |
| 1546 | if (dataSource == 2 && currDatasourceSelect.value.databaseType !== 'obs' && !sampleTableFields.value?.length) { | 1548 | if (dataSource == 2 && !objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && !sampleTableFields.value?.length) { |
| 1547 | proxy.$ElMessage.error('上传文件的字段不能为空'); | 1549 | proxy.$ElMessage.error('上传文件的字段不能为空'); |
| 1548 | return; | 1550 | return; |
| 1549 | } | 1551 | } |
| 1550 | if (dataSource != 3) { | 1552 | if (dataSource != 3) { |
| 1551 | if (currDatasourceSelect.value.databaseType === 'obs' && saveParams.dataSourceGuid) { | 1553 | if (objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && saveParams.dataSourceGuid) { |
| 1552 | exec(saveParams); | 1554 | exec(saveParams); |
| 1553 | } else { | 1555 | } else { |
| 1554 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { | 1556 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { |
| ... | @@ -1686,7 +1688,7 @@ onBeforeMount(() => { | ... | @@ -1686,7 +1688,7 @@ onBeforeMount(() => { |
| 1686 | if (res?.code == proxy.$passCode) { | 1688 | if (res?.code == proxy.$passCode) { |
| 1687 | dataSourceList.value = res.data || []; | 1689 | dataSourceList.value = res.data || []; |
| 1688 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1690 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1689 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1691 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1690 | } else { | 1692 | } else { |
| 1691 | proxy.$ElMessage.error(res.msg); | 1693 | proxy.$ElMessage.error(res.msg); |
| 1692 | } | 1694 | } |
| ... | @@ -1695,12 +1697,12 @@ onBeforeMount(() => { | ... | @@ -1695,12 +1697,12 @@ onBeforeMount(() => { |
| 1695 | if (res?.code == proxy.$passCode) { | 1697 | if (res?.code == proxy.$passCode) { |
| 1696 | dataSourceList.value = res.data || []; | 1698 | dataSourceList.value = res.data || []; |
| 1697 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1699 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1698 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1700 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1699 | } else { | 1701 | } else { |
| 1700 | proxy.$ElMessage.error(res.msg); | 1702 | proxy.$ElMessage.error(res.msg); |
| 1701 | } | 1703 | } |
| 1702 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); | 1704 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); |
| 1703 | if (currDatasourceSelect.value.databaseType != 'obs') { | 1705 | if (!objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 1704 | const tableRes: any = await getDsTableByDs({ | 1706 | const tableRes: any = await getDsTableByDs({ |
| 1705 | pageSize: -1, | 1707 | pageSize: -1, |
| 1706 | pageIndex: 1, | 1708 | pageIndex: 1, |
| ... | @@ -1757,7 +1759,7 @@ onBeforeMount(() => { | ... | @@ -1757,7 +1759,7 @@ onBeforeMount(() => { |
| 1757 | if (res.code == proxy.$passCode) { | 1759 | if (res.code == proxy.$passCode) { |
| 1758 | dataSourceList.value = res.data || []; | 1760 | dataSourceList.value = res.data || []; |
| 1759 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1761 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1760 | item && (item.options = dataSourceList.value.filter(d => d.databaseType !== 'obs')); | 1762 | item && (item.options = dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType))); |
| 1761 | } else { | 1763 | } else { |
| 1762 | proxy.$ElMessage.error(res.msg); | 1764 | proxy.$ElMessage.error(res.msg); |
| 1763 | } | 1765 | } | ... | ... |
| ... | @@ -21,12 +21,9 @@ import { | ... | @@ -21,12 +21,9 @@ import { |
| 21 | const { proxy } = getCurrentInstance() as any; | 21 | const { proxy } = getCurrentInstance() as any; |
| 22 | 22 | ||
| 23 | /** 数据库类型下拉列表 */ | 23 | /** 数据库类型下拉列表 */ |
| 24 | const databaseTypesList = ref([ | 24 | const databaseTypesList = ref([]); |
| 25 | { label: "mysql", value: "mysql" }, | 25 | |
| 26 | { label: "doris", value: "doris" }, | 26 | const objectTypesList = ref(['obs', 'minio', 'rustfs']); |
| 27 | { label: "oracle", value: "oracle" }, | ||
| 28 | { label: "华为云obs", value: "obs" }, | ||
| 29 | ]); | ||
| 30 | 27 | ||
| 31 | const searchItemList = ref([ | 28 | const searchItemList = ref([ |
| 32 | { | 29 | { |
| ... | @@ -1008,7 +1005,7 @@ const setFormItems = (name, info: any = null) => { | ... | @@ -1008,7 +1005,7 @@ const setFormItems = (name, info: any = null) => { |
| 1008 | } | 1005 | } |
| 1009 | }); | 1006 | }); |
| 1010 | } else if (item.field == 'isHttpsProtocol') { | 1007 | } else if (item.field == 'isHttpsProtocol') { |
| 1011 | item.visible = info.databaseType == "obs"; | 1008 | item.visible = objectTypesList.value.includes(info.databaseType); |
| 1012 | item.default = info[item.field] || "Y"; | 1009 | item.default = info[item.field] || "Y"; |
| 1013 | } else if (item.field == 'bizSystem') { | 1010 | } else if (item.field == 'bizSystem') { |
| 1014 | item.visible = info.systemLayer == '业务系统'; | 1011 | item.visible = info.systemLayer == '业务系统'; |
| ... | @@ -1017,19 +1014,19 @@ const setFormItems = (name, info: any = null) => { | ... | @@ -1017,19 +1014,19 @@ const setFormItems = (name, info: any = null) => { |
| 1017 | item.default = info[item.field] || ""; | 1014 | item.default = info[item.field] || ""; |
| 1018 | } | 1015 | } |
| 1019 | if (item.field == 'host') { | 1016 | if (item.field == 'host') { |
| 1020 | item.label = info.databaseType == "obs" ? "地址" : "服务器"; | 1017 | item.label = objectTypesList.value.includes(info.databaseType) ? "地址" : "服务器"; |
| 1021 | contentFormInfo.rules.host[0].message = info.databaseType == "obs" ? "请填写地址" : "请填写服务器IP地址"; | 1018 | contentFormInfo.rules.host[0].message = objectTypesList.value.includes(info.databaseType) ? "请填写地址" : "请填写服务器IP地址"; |
| 1022 | } else if (item.field == 'port') { | 1019 | } else if (item.field == 'port') { |
| 1023 | item.visible = info.databaseType != "obs"; | 1020 | item.visible = !objectTypesList.value.includes(info.databaseType); |
| 1024 | } else if (item.field == 'logonUser') { | 1021 | } else if (item.field == 'logonUser') { |
| 1025 | item.label = info.databaseType == "obs" ? "凭证ID" : "用户名"; | 1022 | item.label = objectTypesList.value.includes(info.databaseType) ? "凭证ID" : "用户名"; |
| 1026 | contentFormInfo.rules.logonUser[0].message = info.databaseType == "obs" ? "请填写凭证ID" : "请填写用户名"; | 1023 | contentFormInfo.rules.logonUser[0].message = objectTypesList.value.includes(info.databaseType) ? "请填写凭证ID" : "请填写用户名"; |
| 1027 | } else if (item.field == 'password') { | 1024 | } else if (item.field == 'password') { |
| 1028 | item.label = info.databaseType == "obs" ? "凭证Key" : "密码"; | 1025 | item.label = objectTypesList.value.includes(info.databaseType) ? "凭证Key" : "密码"; |
| 1029 | contentFormInfo.rules.password[0].message = info.databaseType == "obs" ? "请填写凭证Key" : "请填写密码"; | 1026 | contentFormInfo.rules.password[0].message = objectTypesList.value.includes(info.databaseType) ? "请填写凭证Key" : "请填写密码"; |
| 1030 | } else if (item.field == 'databaseNameEn') { | 1027 | } else if (item.field == 'databaseNameEn') { |
| 1031 | item.label = info.databaseType == "obs" ? "桶名称" : "数据库名"; | 1028 | item.label = objectTypesList.value.includes(info.databaseType) ? "桶名称" : "数据库名"; |
| 1032 | contentFormInfo.rules.databaseNameEn[0].message = info.databaseType == "obs" ? "请填写桶名称" : "请填写数据库名"; | 1029 | contentFormInfo.rules.databaseNameEn[0].message = objectTypesList.value.includes(info.databaseType) ? "请填写桶名称" : "请填写数据库名"; |
| 1033 | } | 1030 | } |
| 1034 | }); | 1031 | }); |
| 1035 | } else { | 1032 | } else { |
| ... | @@ -1051,11 +1048,17 @@ const getFirstPageData = () => { | ... | @@ -1051,11 +1048,17 @@ const getFirstPageData = () => { |
| 1051 | page.value.curr = 1; | 1048 | page.value.curr = 1; |
| 1052 | getTableData(); | 1049 | getTableData(); |
| 1053 | }; | 1050 | }; |
| 1054 | onMounted(() => { | 1051 | |
| 1052 | onBeforeMount(() => { | ||
| 1055 | getParamsList({ dictType: "业务系统" }).then((res) => { | 1053 | getParamsList({ dictType: "业务系统" }).then((res) => { |
| 1056 | flowList.value = res?.data || [] | 1054 | flowList.value = res?.data || [] |
| 1057 | contents.value.normal.items[3].options = flowList.value | 1055 | contents.value.normal.items[3].options = flowList.value |
| 1058 | }) | 1056 | }) |
| 1057 | getParamsList({ dictType: "数据源存储类型" }).then((res) => { | ||
| 1058 | databaseTypesList.value = res?.data || [] | ||
| 1059 | searchItemList.value[1].options = databaseTypesList.value; | ||
| 1060 | contents.value.normal.items[2].options = databaseTypesList.value; | ||
| 1061 | }) | ||
| 1059 | }) | 1062 | }) |
| 1060 | const toSearch = (val: any, clear: boolean = false) => { | 1063 | const toSearch = (val: any, clear: boolean = false) => { |
| 1061 | if (clear) { | 1064 | if (clear) { | ... | ... |
-
Please register or sign in to post a comment