数据源支持多种对象存储
Showing
2 changed files
with
33 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" |
| ... | @@ -278,6 +278,8 @@ const { required } = useValidator(); | ... | @@ -278,6 +278,8 @@ const { required } = useValidator(); |
| 278 | const fullscreenLoading = ref(false); | 278 | const fullscreenLoading = ref(false); |
| 279 | const containerRef = ref(); | 279 | const containerRef = ref(); |
| 280 | 280 | ||
| 281 | const objectTypesList = ref(['obs', 'minio', 'rustfs']); | ||
| 282 | |||
| 281 | const qualifiedIdentifierFloderList = ref([{ | 283 | const qualifiedIdentifierFloderList = ref([{ |
| 282 | enName: 'patient_birth_date', | 284 | enName: 'patient_birth_date', |
| 283 | chName: '患者出生日期', | 285 | chName: '患者出生日期', |
| ... | @@ -605,7 +607,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { | ... | @@ -605,7 +607,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { |
| 605 | return; | 607 | return; |
| 606 | } | 608 | } |
| 607 | let dsInfo = currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == val); | 609 | let dsInfo = currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == val); |
| 608 | if (dsInfo.databaseType == 'obs') { | 610 | if (objectTypesList.value.includes(dsInfo?.databaseType)) { |
| 609 | sampleTableFields.value = []; | 611 | sampleTableFields.value = []; |
| 610 | parseFileDataSum.value = []; | 612 | parseFileDataSum.value = []; |
| 611 | sampleTableData.value = []; | 613 | sampleTableData.value = []; |
| ... | @@ -662,7 +664,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { | ... | @@ -662,7 +664,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { |
| 662 | }); | 664 | }); |
| 663 | } else if (row.field == 'handleType') { | 665 | } else if (row.field == 'handleType') { |
| 664 | // 第一种匿名处理类型是不可以选择obs类型的。 | 666 | // 第一种匿名处理类型是不可以选择obs类型的。 |
| 665 | if (val == '01' && formInfo.dataSourceGuid && currDatasourceSelect.value.databaseType == 'obs') { | 667 | if (val == '01' && formInfo.dataSourceGuid && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 666 | formInfo.dataSourceGuid = ''; | 668 | formInfo.dataSourceGuid = ''; |
| 667 | } | 669 | } |
| 668 | setDataSelectFormItems(formInfo); | 670 | setDataSelectFormItems(formInfo); |
| ... | @@ -699,14 +701,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { | ... | @@ -699,14 +701,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { |
| 699 | item.default = ''; | 701 | item.default = ''; |
| 700 | } | 702 | } |
| 701 | } else if (item.field == 'qualifiedIdentifier') { | 703 | } else if (item.field == 'qualifiedIdentifier') { |
| 702 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs'); | 704 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)); |
| 703 | if (info['dataSource'] == 3) { | 705 | if (info['dataSource'] == 3) { |
| 704 | item.options = qualifiedIdentifierFloderList.value; | 706 | item.options = qualifiedIdentifierFloderList.value; |
| 705 | } | 707 | } |
| 706 | } else if (item.field == 'tableName') { | 708 | } else if (item.field == 'tableName') { |
| 707 | item.visible = !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs');//数据源类型为obs的没有数据表选择 | 709 | item.visible = !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType));//数据源类型为obs的没有数据表选择 |
| 708 | } else if (item.field == 'dataSourceGuid') { | 710 | } else if (item.field == 'dataSourceGuid') { |
| 709 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => d.databaseType !== 'obs') | 711 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) |
| 710 | } | 712 | } |
| 711 | }); | 713 | }); |
| 712 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; | 714 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; |
| ... | @@ -1511,12 +1513,12 @@ const changeStep = async (val) => { | ... | @@ -1511,12 +1513,12 @@ const changeStep = async (val) => { |
| 1511 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { | 1513 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { |
| 1512 | if (valid) { | 1514 | if (valid) { |
| 1513 | let dataSource = formRef.value?.formInline?.dataSource; | 1515 | let dataSource = formRef.value?.formInline?.dataSource; |
| 1514 | if (dataSource == 2 && currDatasourceSelect.value.databaseType !== 'obs' && !sampleTableFields.value?.length) { | 1516 | if (dataSource == 2 && !objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && !sampleTableFields.value?.length) { |
| 1515 | proxy.$ElMessage.error('上传文件的字段不能为空'); | 1517 | proxy.$ElMessage.error('上传文件的字段不能为空'); |
| 1516 | return; | 1518 | return; |
| 1517 | } | 1519 | } |
| 1518 | if (dataSource != 3) { | 1520 | if (dataSource != 3) { |
| 1519 | if (currDatasourceSelect.value.databaseType === 'obs' && saveParams.dataSourceGuid) { | 1521 | if (objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && saveParams.dataSourceGuid) { |
| 1520 | exec(saveParams); | 1522 | exec(saveParams); |
| 1521 | } else { | 1523 | } else { |
| 1522 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { | 1524 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { |
| ... | @@ -1654,7 +1656,7 @@ onBeforeMount(() => { | ... | @@ -1654,7 +1656,7 @@ onBeforeMount(() => { |
| 1654 | if (res?.code == proxy.$passCode) { | 1656 | if (res?.code == proxy.$passCode) { |
| 1655 | dataSourceList.value = res.data || []; | 1657 | dataSourceList.value = res.data || []; |
| 1656 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1658 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1657 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1659 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1658 | } else { | 1660 | } else { |
| 1659 | proxy.$ElMessage.error(res.msg); | 1661 | proxy.$ElMessage.error(res.msg); |
| 1660 | } | 1662 | } |
| ... | @@ -1663,12 +1665,12 @@ onBeforeMount(() => { | ... | @@ -1663,12 +1665,12 @@ onBeforeMount(() => { |
| 1663 | if (res?.code == proxy.$passCode) { | 1665 | if (res?.code == proxy.$passCode) { |
| 1664 | dataSourceList.value = res.data || []; | 1666 | dataSourceList.value = res.data || []; |
| 1665 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1667 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1666 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1668 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1667 | } else { | 1669 | } else { |
| 1668 | proxy.$ElMessage.error(res.msg); | 1670 | proxy.$ElMessage.error(res.msg); |
| 1669 | } | 1671 | } |
| 1670 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); | 1672 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); |
| 1671 | if (currDatasourceSelect.value.databaseType != 'obs') { | 1673 | if (!objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 1672 | const tableRes: any = await getDsTableByDs({ | 1674 | const tableRes: any = await getDsTableByDs({ |
| 1673 | pageSize: -1, | 1675 | pageSize: -1, |
| 1674 | pageIndex: 1, | 1676 | pageIndex: 1, |
| ... | @@ -1725,7 +1727,7 @@ onBeforeMount(() => { | ... | @@ -1725,7 +1727,7 @@ onBeforeMount(() => { |
| 1725 | if (res.code == proxy.$passCode) { | 1727 | if (res.code == proxy.$passCode) { |
| 1726 | dataSourceList.value = res.data || []; | 1728 | dataSourceList.value = res.data || []; |
| 1727 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1729 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1728 | item && (item.options = dataSourceList.value.filter(d => d.databaseType !== 'obs')); | 1730 | item && (item.options = dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType))); |
| 1729 | } else { | 1731 | } else { |
| 1730 | proxy.$ElMessage.error(res.msg); | 1732 | proxy.$ElMessage.error(res.msg); |
| 1731 | } | 1733 | } | ... | ... |
| ... | @@ -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,16 @@ const getFirstPageData = () => { | ... | @@ -1051,11 +1048,16 @@ const getFirstPageData = () => { |
| 1051 | page.value.curr = 1; | 1048 | page.value.curr = 1; |
| 1052 | getTableData(); | 1049 | getTableData(); |
| 1053 | }; | 1050 | }; |
| 1054 | onMounted(() => { | 1051 | onBeforeMount(() => { |
| 1055 | getParamsList({ dictType: "业务系统" }).then((res) => { | 1052 | getParamsList({ dictType: "业务系统" }).then((res) => { |
| 1056 | flowList.value = res.data | 1053 | flowList.value = res.data |
| 1057 | contents.value.normal.items[3].options = flowList.value | 1054 | contents.value.normal.items[3].options = flowList.value |
| 1058 | }) | 1055 | }) |
| 1056 | getAllFlowData({ dictType: "数据源存储类型" }).then((res) => { | ||
| 1057 | databaseTypesList.value = res?.data || [] | ||
| 1058 | searchItemList.value[1].options = databaseTypesList.value; | ||
| 1059 | contents.value.normal.items[2].options = databaseTypesList.value; | ||
| 1060 | }) | ||
| 1059 | }) | 1061 | }) |
| 1060 | const toSearch = (val: any, clear: boolean = false) => { | 1062 | const toSearch = (val: any, clear: boolean = false) => { |
| 1061 | if (clear) { | 1063 | if (clear) { | ... | ... |
-
Please register or sign in to post a comment