数据源支持多种对象存储
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" |
| ... | @@ -286,6 +286,8 @@ const { required } = useValidator(); | ... | @@ -286,6 +286,8 @@ const { required } = useValidator(); |
| 286 | const fullscreenLoading = ref(false); | 286 | const fullscreenLoading = ref(false); |
| 287 | const containerRef = ref(); | 287 | const containerRef = ref(); |
| 288 | 288 | ||
| 289 | const objectTypesList = ref(['obs', 'minio', 'rustfs']); | ||
| 290 | |||
| 289 | const qualifiedIdentifierFloderList = ref([{ | 291 | const qualifiedIdentifierFloderList = ref([{ |
| 290 | enName: 'patient_birth_date', | 292 | enName: 'patient_birth_date', |
| 291 | chName: '患者出生日期', | 293 | chName: '患者出生日期', |
| ... | @@ -615,7 +617,7 @@ const dataSelectFormSelectChangeHandlers = { | ... | @@ -615,7 +617,7 @@ const dataSelectFormSelectChangeHandlers = { |
| 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 = []; |
| ... | @@ -674,7 +676,7 @@ const dataSelectFormSelectChangeHandlers = { | ... | @@ -674,7 +676,7 @@ const dataSelectFormSelectChangeHandlers = { |
| 674 | }, | 676 | }, |
| 675 | handleType: (val, row, formInfo) => { | 677 | handleType: (val, row, formInfo) => { |
| 676 | // 第一种匿名处理类型是不可以选择obs类型的。 | 678 | // 第一种匿名处理类型是不可以选择obs类型的。 |
| 677 | if (val == '01' && formInfo.dataSourceGuid && currDatasourceSelect.value.databaseType == 'obs') { | 679 | if (val == '01' && formInfo.dataSourceGuid && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 678 | formInfo.dataSourceGuid = ''; | 680 | formInfo.dataSourceGuid = ''; |
| 679 | } | 681 | } |
| 680 | setDataSelectFormItems(formInfo); | 682 | setDataSelectFormItems(formInfo); |
| ... | @@ -715,14 +717,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { | ... | @@ -715,14 +717,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { |
| 715 | item.default = ''; | 717 | item.default = ''; |
| 716 | } | 718 | } |
| 717 | } else if (item.field == 'qualifiedIdentifier') { | 719 | } else if (item.field == 'qualifiedIdentifier') { |
| 718 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs'); | 720 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)); |
| 719 | if (info['dataSource'] == 3) { | 721 | if (info['dataSource'] == 3) { |
| 720 | item.options = qualifiedIdentifierFloderList.value; | 722 | item.options = qualifiedIdentifierFloderList.value; |
| 721 | } | 723 | } |
| 722 | } else if (item.field == 'tableName') { | 724 | } else if (item.field == 'tableName') { |
| 723 | item.visible = !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs');//数据源类型为obs的没有数据表选择 | 725 | item.visible = !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType));//数据源类型为obs的没有数据表选择 |
| 724 | } else if (item.field == 'dataSourceGuid') { | 726 | } else if (item.field == 'dataSourceGuid') { |
| 725 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => d.databaseType !== 'obs') | 727 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) |
| 726 | } | 728 | } |
| 727 | }); | 729 | }); |
| 728 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; | 730 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; |
| ... | @@ -1502,12 +1504,12 @@ const changeStepHandlers = { | ... | @@ -1502,12 +1504,12 @@ const changeStepHandlers = { |
| 1502 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { | 1504 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { |
| 1503 | if (valid) { | 1505 | if (valid) { |
| 1504 | let dataSource = formRef.value?.formInline?.dataSource; | 1506 | let dataSource = formRef.value?.formInline?.dataSource; |
| 1505 | if (dataSource == 2 && currDatasourceSelect.value.databaseType !== 'obs' && !sampleTableFields.value?.length) { | 1507 | if (dataSource == 2 && !objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && !sampleTableFields.value?.length) { |
| 1506 | proxy.$ElMessage.error('上传文件的字段不能为空'); | 1508 | proxy.$ElMessage.error('上传文件的字段不能为空'); |
| 1507 | return; | 1509 | return; |
| 1508 | } | 1510 | } |
| 1509 | if (dataSource != 3) { | 1511 | if (dataSource != 3) { |
| 1510 | if (currDatasourceSelect.value.databaseType === 'obs' && saveParams.dataSourceGuid) { | 1512 | if (objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && saveParams.dataSourceGuid) { |
| 1511 | exec(saveParams); | 1513 | exec(saveParams); |
| 1512 | } else { | 1514 | } else { |
| 1513 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { | 1515 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { |
| ... | @@ -1647,7 +1649,7 @@ onBeforeMount(() => { | ... | @@ -1647,7 +1649,7 @@ onBeforeMount(() => { |
| 1647 | if (res?.code == proxy.$passCode) { | 1649 | if (res?.code == proxy.$passCode) { |
| 1648 | dataSourceList.value = res.data || []; | 1650 | dataSourceList.value = res.data || []; |
| 1649 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1651 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1650 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1652 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1651 | } else { | 1653 | } else { |
| 1652 | proxy.$ElMessage.error(res.msg); | 1654 | proxy.$ElMessage.error(res.msg); |
| 1653 | } | 1655 | } |
| ... | @@ -1656,12 +1658,12 @@ onBeforeMount(() => { | ... | @@ -1656,12 +1658,12 @@ onBeforeMount(() => { |
| 1656 | if (res?.code == proxy.$passCode) { | 1658 | if (res?.code == proxy.$passCode) { |
| 1657 | dataSourceList.value = res.data || []; | 1659 | dataSourceList.value = res.data || []; |
| 1658 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1660 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1659 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1661 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1660 | } else { | 1662 | } else { |
| 1661 | proxy.$ElMessage.error(res.msg); | 1663 | proxy.$ElMessage.error(res.msg); |
| 1662 | } | 1664 | } |
| 1663 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); | 1665 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); |
| 1664 | if (currDatasourceSelect.value.databaseType != 'obs') { | 1666 | if (!objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 1665 | const tableRes: any = await getDsTableByDs({ | 1667 | const tableRes: any = await getDsTableByDs({ |
| 1666 | pageSize: -1, | 1668 | pageSize: -1, |
| 1667 | pageIndex: 1, | 1669 | pageIndex: 1, |
| ... | @@ -1718,7 +1720,7 @@ onBeforeMount(() => { | ... | @@ -1718,7 +1720,7 @@ onBeforeMount(() => { |
| 1718 | if (res.code == proxy.$passCode) { | 1720 | if (res.code == proxy.$passCode) { |
| 1719 | dataSourceList.value = res.data || []; | 1721 | dataSourceList.value = res.data || []; |
| 1720 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1722 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1721 | item && (item.options = dataSourceList.value.filter(d => d.databaseType !== 'obs')); | 1723 | item && (item.options = dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType))); |
| 1722 | } else { | 1724 | } else { |
| 1723 | proxy.$ElMessage.error(res.msg); | 1725 | proxy.$ElMessage.error(res.msg); |
| 1724 | } | 1726 | } | ... | ... |
| ... | @@ -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