数据源支持多种对象存储
Showing
2 changed files
with
35 additions
and
30 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" |
| ... | @@ -285,6 +285,8 @@ const isDataProvider = computed(() => { | ... | @@ -285,6 +285,8 @@ const isDataProvider = computed(() => { |
| 285 | return localStorage.getItem('userRole') == USERROLE.PROVIDER; | 285 | return localStorage.getItem('userRole') == USERROLE.PROVIDER; |
| 286 | }) | 286 | }) |
| 287 | 287 | ||
| 288 | const objectTypesList = ref(['obs', 'minio', 'rustfs']); | ||
| 289 | |||
| 288 | const qualifiedIdentifierFloderList = ref([{ | 290 | const qualifiedIdentifierFloderList = ref([{ |
| 289 | enName: 'patient_birth_date', | 291 | enName: 'patient_birth_date', |
| 290 | chName: '患者出生日期', | 292 | chName: '患者出生日期', |
| ... | @@ -612,7 +614,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { | ... | @@ -612,7 +614,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { |
| 612 | return; | 614 | return; |
| 613 | } | 615 | } |
| 614 | let dsInfo = currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == val); | 616 | let dsInfo = currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == val); |
| 615 | if (dsInfo.databaseType == 'obs') { | 617 | if (objectTypesList.value.includes(dsInfo?.databaseType)) { |
| 616 | sampleTableFields.value = []; | 618 | sampleTableFields.value = []; |
| 617 | parseFileDataSum.value = []; | 619 | parseFileDataSum.value = []; |
| 618 | sampleTableData.value = []; | 620 | sampleTableData.value = []; |
| ... | @@ -669,7 +671,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { | ... | @@ -669,7 +671,7 @@ const handleDataSelectFormSelectChange = async (val, row, formInfo) => { |
| 669 | }); | 671 | }); |
| 670 | } else if (row.field == 'handleType') { | 672 | } else if (row.field == 'handleType') { |
| 671 | // 第一种匿名处理类型是不可以选择obs类型的。 | 673 | // 第一种匿名处理类型是不可以选择obs类型的。 |
| 672 | if (val == '01' && formInfo.dataSourceGuid && currDatasourceSelect.value.databaseType == 'obs') { | 674 | if (val == '01' && formInfo.dataSourceGuid && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 673 | formInfo.dataSourceGuid = ''; | 675 | formInfo.dataSourceGuid = ''; |
| 674 | } | 676 | } |
| 675 | setDataSelectFormItems(formInfo); | 677 | setDataSelectFormItems(formInfo); |
| ... | @@ -706,14 +708,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { | ... | @@ -706,14 +708,14 @@ const setDataSelectFormItems = (info, isDetail = false) => { |
| 706 | item.default = ''; | 708 | item.default = ''; |
| 707 | } | 709 | } |
| 708 | } else if (item.field == 'qualifiedIdentifier') { | 710 | } else if (item.field == 'qualifiedIdentifier') { |
| 709 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs'); | 711 | item.visible = info['handleType'] == '02' && info['dataSource'] != 3 && !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)); |
| 710 | if (info['dataSource'] == 3) { | 712 | if (info['dataSource'] == 3) { |
| 711 | item.options = qualifiedIdentifierFloderList.value; | 713 | item.options = qualifiedIdentifierFloderList.value; |
| 712 | } | 714 | } |
| 713 | } else if (item.field == 'tableName') { | 715 | } else if (item.field == 'tableName') { |
| 714 | item.visible = !(info['dataSourceGuid'] && currDatasourceSelect.value?.databaseType === 'obs');//数据源类型为obs的没有数据表选择 | 716 | item.visible = !(info['dataSourceGuid'] && objectTypesList.value.includes(currDatasourceSelect.value?.databaseType));//数据源类型为obs的没有数据表选择 |
| 715 | } else if (item.field == 'dataSourceGuid') { | 717 | } else if (item.field == 'dataSourceGuid') { |
| 716 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => d.databaseType !== 'obs') | 718 | item.options = info.handleType == '02' ? dataSourceList.value : dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) |
| 717 | } | 719 | } |
| 718 | }); | 720 | }); |
| 719 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; | 721 | stepsInfo.value = info.handleType == '02' ? reportStepsInfo.value : originStepsInfo.value; |
| ... | @@ -1518,12 +1520,12 @@ const changeStep = async (val) => { | ... | @@ -1518,12 +1520,12 @@ const changeStep = async (val) => { |
| 1518 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { | 1520 | formRef.value?.ruleFormRef?.validate((valid, errorItem) => { |
| 1519 | if (valid) { | 1521 | if (valid) { |
| 1520 | let dataSource = formRef.value?.formInline?.dataSource; | 1522 | let dataSource = formRef.value?.formInline?.dataSource; |
| 1521 | if (dataSource == 2 && currDatasourceSelect.value.databaseType !== 'obs' && !sampleTableFields.value?.length) { | 1523 | if (dataSource == 2 && !objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && !sampleTableFields.value?.length) { |
| 1522 | proxy.$ElMessage.error('上传文件的字段不能为空'); | 1524 | proxy.$ElMessage.error('上传文件的字段不能为空'); |
| 1523 | return; | 1525 | return; |
| 1524 | } | 1526 | } |
| 1525 | if (dataSource != 3) { | 1527 | if (dataSource != 3) { |
| 1526 | if (currDatasourceSelect.value.databaseType === 'obs' && saveParams.dataSourceGuid) { | 1528 | if (objectTypesList.value.includes(currDatasourceSelect.value?.databaseType) && saveParams.dataSourceGuid) { |
| 1527 | exec(saveParams); | 1529 | exec(saveParams); |
| 1528 | } else { | 1530 | } else { |
| 1529 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { | 1531 | dataSimpleFormRef.value?.ruleFormRef?.validate((valid) => { |
| ... | @@ -1661,7 +1663,7 @@ onBeforeMount(() => { | ... | @@ -1661,7 +1663,7 @@ onBeforeMount(() => { |
| 1661 | if (res?.code == proxy.$passCode) { | 1663 | if (res?.code == proxy.$passCode) { |
| 1662 | dataSourceList.value = res.data || []; | 1664 | dataSourceList.value = res.data || []; |
| 1663 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1665 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1664 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1666 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1665 | } else { | 1667 | } else { |
| 1666 | proxy.$ElMessage.error(res.msg); | 1668 | proxy.$ElMessage.error(res.msg); |
| 1667 | } | 1669 | } |
| ... | @@ -1670,12 +1672,12 @@ onBeforeMount(() => { | ... | @@ -1670,12 +1672,12 @@ onBeforeMount(() => { |
| 1670 | if (res?.code == proxy.$passCode) { | 1672 | if (res?.code == proxy.$passCode) { |
| 1671 | dataSourceList.value = res.data || []; | 1673 | dataSourceList.value = res.data || []; |
| 1672 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1674 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1673 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => d.databaseType !== 'obs') : dataSourceList.value); | 1675 | item && (item.options = detailInfo.value.handleType == '01' ? dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType)) : dataSourceList.value); |
| 1674 | } else { | 1676 | } else { |
| 1675 | proxy.$ElMessage.error(res.msg); | 1677 | proxy.$ElMessage.error(res.msg); |
| 1676 | } | 1678 | } |
| 1677 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); | 1679 | currDatasourceSelect.value = dataSourceList.value.find(d => d.guid == detailInfo.value.dataSourceGuid); |
| 1678 | if (currDatasourceSelect.value.databaseType != 'obs') { | 1680 | if (!objectTypesList.value.includes(currDatasourceSelect.value?.databaseType)) { |
| 1679 | const tableRes: any = await getDsTableByDs({ | 1681 | const tableRes: any = await getDsTableByDs({ |
| 1680 | pageSize: -1, | 1682 | pageSize: -1, |
| 1681 | pageIndex: 1, | 1683 | pageIndex: 1, |
| ... | @@ -1732,7 +1734,7 @@ onBeforeMount(() => { | ... | @@ -1732,7 +1734,7 @@ onBeforeMount(() => { |
| 1732 | if (res.code == proxy.$passCode) { | 1734 | if (res.code == proxy.$passCode) { |
| 1733 | dataSourceList.value = res.data || []; | 1735 | dataSourceList.value = res.data || []; |
| 1734 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); | 1736 | let item = dataSelectInfoItems.value.find(item => item.field == 'dataSourceGuid'); |
| 1735 | item && (item.options = dataSourceList.value.filter(d => d.databaseType !== 'obs')); | 1737 | item && (item.options = dataSourceList.value.filter(d => !objectTypesList.value.includes(d.databaseType))); |
| 1736 | } else { | 1738 | } else { |
| 1737 | proxy.$ElMessage.error(res.msg); | 1739 | proxy.$ElMessage.error(res.msg); |
| 1738 | } | 1740 | } | ... | ... |
| ... | @@ -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 | getAllFlowData({ dictType: "业务系统" }).then((res) => { | 1053 | getAllFlowData({ 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 | getAllFlowData({ 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