数据产品目录
Showing
13 changed files
with
1828 additions
and
128 deletions
| ... | @@ -4,8 +4,7 @@ VITE_APP_TITLE = 可信数据空间 | ... | @@ -4,8 +4,7 @@ VITE_APP_TITLE = 可信数据空间 |
| 4 | # VITE_API_BASEURL = https://www.zgsjzc.com/api | 4 | # VITE_API_BASEURL = https://www.zgsjzc.com/api |
| 5 | # VITE_API_BASEURL = https://swzl-test.csbr.cn/api | 5 | # VITE_API_BASEURL = https://swzl-test.csbr.cn/api |
| 6 | # VITE_API_BASEURL = http://localhost:9000 | 6 | # VITE_API_BASEURL = http://localhost:9000 |
| 7 | VITE_API_BASEURL = http://192.168.9.1:58052/ | 7 | VITE_API_BASEURL = http://192.168.6.20:58052/ |
| 8 | # VITE_API_BASEURL = http://192.168.6.20:8052/ | ||
| 9 | 8 | ||
| 10 | VITE_IDASS_BASEURL = https://idaas-test.csbr.cn/login | 9 | VITE_IDASS_BASEURL = https://idaas-test.csbr.cn/login |
| 11 | 10 | ... | ... |
src/assets/images/dam-catalog-detail.png
0 → 100644
1.11 KB
src/assets/images/home-finance-product.png
0 → 100644
2.2 KB
| ... | @@ -5,6 +5,8 @@ import useUserStore from "@/store/modules/user"; | ... | @@ -5,6 +5,8 @@ import useUserStore from "@/store/modules/user"; |
| 5 | import useKeepAliveStore from '@/store/modules/keepAlive' | 5 | import useKeepAliveStore from '@/store/modules/keepAlive' |
| 6 | import { ElMessageBox, ElMessage } from "element-plus"; | 6 | import { ElMessageBox, ElMessage } from "element-plus"; |
| 7 | import { isEqual } from "lodash-es"; | 7 | import { isEqual } from "lodash-es"; |
| 8 | import useMenuStore from "@/store/modules/menu"; | ||
| 9 | import useSettingsStore from '@/store/modules/settings' | ||
| 8 | 10 | ||
| 9 | const router = useRouter(); | 11 | const router = useRouter(); |
| 10 | const route = useRoute(); | 12 | const route = useRoute(); |
| ... | @@ -38,6 +40,17 @@ watch( | ... | @@ -38,6 +40,17 @@ watch( |
| 38 | pathIndex = index | 40 | pathIndex = index |
| 39 | return item.path === newRouter.path | 41 | return item.path === newRouter.path |
| 40 | }) | 42 | }) |
| 43 | if (!newRouter?.meta.title) { | ||
| 44 | let title: any = ''; | ||
| 45 | for (const m of (useMenuStore().allMenus || [])) { | ||
| 46 | let child = m.children?.find(cc => cc.path == newRouter.fullPath); | ||
| 47 | if (child) { | ||
| 48 | title = child.meta?.title; | ||
| 49 | break; | ||
| 50 | } | ||
| 51 | } | ||
| 52 | newRouter.meta.title = title; | ||
| 53 | } | ||
| 41 | if (option) { | 54 | if (option) { |
| 42 | list.splice(pathIndex, 1, newRouter); | 55 | list.splice(pathIndex, 1, newRouter); |
| 43 | } else { | 56 | } else { |
| ... | @@ -45,9 +58,11 @@ watch( | ... | @@ -45,9 +58,11 @@ watch( |
| 45 | } | 58 | } |
| 46 | 59 | ||
| 47 | } | 60 | } |
| 61 | const settingsStore = useSettingsStore(); | ||
| 62 | settingsStore.setTitle(newRouter.meta.title); | ||
| 48 | } | 63 | } |
| 49 | tabbarList.value = list; | 64 | tabbarList.value = list; |
| 50 | tabbarActive.value = isExist[0]?.fullPath || newRouter.fullPath; | 65 | tabbarActive.value = newRouter.fullPath; |
| 51 | userStore.setTabbar(tabbarList.value); | 66 | userStore.setTabbar(tabbarList.value); |
| 52 | userStore.setActiveTabbar(combPath, newRouter.fullPath); | 67 | userStore.setActiveTabbar(combPath, newRouter.fullPath); |
| 53 | }, | 68 | }, | ... | ... |
| ... | @@ -153,7 +153,12 @@ router.afterEach((to, from) => { | ... | @@ -153,7 +153,12 @@ router.afterEach((to, from) => { |
| 153 | settingsStore.settings.app.enableProgress && (isLoading.value = false) | 153 | settingsStore.settings.app.enableProgress && (isLoading.value = false) |
| 154 | // 设置页面 title | 154 | // 设置页面 title |
| 155 | if (settingsStore.settings.app.routeBaseOn !== 'filesystem') { | 155 | if (settingsStore.settings.app.routeBaseOn !== 'filesystem') { |
| 156 | settingsStore.setTitle(to.meta.title) | 156 | let title: any = ''; |
| 157 | if (!to.meta.title) { | ||
| 158 | let child = userStore.tabbar?.find((t: any) => t.fullPath == to.fullPath); | ||
| 159 | title = child?.meta?.title; | ||
| 160 | } | ||
| 161 | settingsStore.setTitle(to.meta.title || title) | ||
| 157 | } | 162 | } |
| 158 | else { | 163 | else { |
| 159 | settingsStore.setTitle(to.meta.title) | 164 | settingsStore.setTitle(to.meta.title) | ... | ... |
| ... | @@ -7,7 +7,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -7,7 +7,7 @@ const routes: RouteRecordRaw[] = [ |
| 7 | path: '/data-asset/register-catalog', | 7 | path: '/data-asset/register-catalog', |
| 8 | component: Layout, | 8 | component: Layout, |
| 9 | meta: { | 9 | meta: { |
| 10 | title: '自有数据产品', | 10 | title: '数据产品', |
| 11 | icon: 'sidebar-videos', | 11 | icon: 'sidebar-videos', |
| 12 | }, | 12 | }, |
| 13 | children: [ | 13 | children: [ |
| ... | @@ -16,7 +16,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -16,7 +16,7 @@ const routes: RouteRecordRaw[] = [ |
| 16 | name: 'registerCatalogManagement', | 16 | name: 'registerCatalogManagement', |
| 17 | component: () => import('@/views/data_asset/registerCatalogManagement.vue'), | 17 | component: () => import('@/views/data_asset/registerCatalogManagement.vue'), |
| 18 | meta: { | 18 | meta: { |
| 19 | title: '自有数据产品', | 19 | title: '', |
| 20 | sidebar: false, | 20 | sidebar: false, |
| 21 | breadcrumb: false, | 21 | breadcrumb: false, |
| 22 | cache: true | 22 | cache: true |
| ... | @@ -27,7 +27,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -27,7 +27,7 @@ const routes: RouteRecordRaw[] = [ |
| 27 | name: 'registerCatalogCreate', | 27 | name: 'registerCatalogCreate', |
| 28 | component: () => import('@/views/data_asset/registerCatalogCreate.vue'), | 28 | component: () => import('@/views/data_asset/registerCatalogCreate.vue'), |
| 29 | meta: { | 29 | meta: { |
| 30 | title: '新建自有数据产品', | 30 | title: '新建数据产品', |
| 31 | sidebar: false, | 31 | sidebar: false, |
| 32 | breadcrumb: false, | 32 | breadcrumb: false, |
| 33 | cache: true, | 33 | cache: true, |
| ... | @@ -149,7 +149,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -149,7 +149,7 @@ const routes: RouteRecordRaw[] = [ |
| 149 | name: 'authorDataCatalogManagement', | 149 | name: 'authorDataCatalogManagement', |
| 150 | component: () => import('@/views/data_asset/authorDataCatalogManagement.vue'), | 150 | component: () => import('@/views/data_asset/authorDataCatalogManagement.vue'), |
| 151 | meta: { | 151 | meta: { |
| 152 | title: '授权数据产品', | 152 | title: '', |
| 153 | sidebar: false, | 153 | sidebar: false, |
| 154 | breadcrumb: false, | 154 | breadcrumb: false, |
| 155 | cache: true | 155 | cache: true | ... | ... |
| ... | @@ -6,6 +6,27 @@ function Layout() { | ... | @@ -6,6 +6,27 @@ function Layout() { |
| 6 | 6 | ||
| 7 | const routes: RouteRecordRaw[] = [ | 7 | const routes: RouteRecordRaw[] = [ |
| 8 | { | 8 | { |
| 9 | path: '/data-asset/data-source', | ||
| 10 | component: Layout, | ||
| 11 | meta: { | ||
| 12 | title: '数据源管理', | ||
| 13 | icon: 'sidebar-videos', | ||
| 14 | }, | ||
| 15 | children: [ | ||
| 16 | { | ||
| 17 | path: '', | ||
| 18 | name: 'dataSource', | ||
| 19 | component: () => import('@/views/data_service/dataSource.vue'), | ||
| 20 | meta: { | ||
| 21 | title: '', | ||
| 22 | sidebar: false, | ||
| 23 | breadcrumb: false, | ||
| 24 | cache: true | ||
| 25 | }, | ||
| 26 | }, | ||
| 27 | ], | ||
| 28 | }, | ||
| 29 | { | ||
| 9 | path: '/data-service/api-management', | 30 | path: '/data-service/api-management', |
| 10 | component: Layout, | 31 | component: Layout, |
| 11 | meta: { | 32 | meta: { |
| ... | @@ -18,7 +39,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -18,7 +39,7 @@ const routes: RouteRecordRaw[] = [ |
| 18 | name: 'apiManagement', | 39 | name: 'apiManagement', |
| 19 | component: () => import('@/views/data_service/apiManagement.vue'), | 40 | component: () => import('@/views/data_service/apiManagement.vue'), |
| 20 | meta: { | 41 | meta: { |
| 21 | title: '管理API', | 42 | title: '', |
| 22 | sidebar: false, | 43 | sidebar: false, |
| 23 | breadcrumb: false, | 44 | breadcrumb: false, |
| 24 | cache: true | 45 | cache: true |
| ... | @@ -90,7 +111,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -90,7 +111,7 @@ const routes: RouteRecordRaw[] = [ |
| 90 | name: 'apiTest', | 111 | name: 'apiTest', |
| 91 | component: () => import('@/views/data_service/apiTest.vue'), | 112 | component: () => import('@/views/data_service/apiTest.vue'), |
| 92 | meta: { | 113 | meta: { |
| 93 | title: '测试API', | 114 | title: '', |
| 94 | sidebar: false, | 115 | sidebar: false, |
| 95 | breadcrumb: false, | 116 | breadcrumb: false, |
| 96 | cache: true | 117 | cache: true | ... | ... |
| ... | @@ -659,7 +659,8 @@ defineExpose({ | ... | @@ -659,7 +659,8 @@ defineExpose({ |
| 659 | <span v-else>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span> | 659 | <span v-else>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span> |
| 660 | </template> | 660 | </template> |
| 661 | </el-table-column> | 661 | </el-table-column> |
| 662 | <el-table-column prop="dictionaryCode" label="关联字典" width="130px" align="left" show-overflow-tooltip> | 662 | <!-- 直接去掉这一列 --> |
| 663 | <!-- <el-table-column prop="dictionaryCode" label="关联字典" width="130px" align="left" show-overflow-tooltip> | ||
| 663 | <template #default="scope"> | 664 | <template #default="scope"> |
| 664 | <el-select v-if="scope.row['isEdit'] && !(tableCreateInfo.guid && scope.row['isPrimary'] == 'Y')" | 665 | <el-select v-if="scope.row['isEdit'] && !(tableCreateInfo.guid && scope.row['isPrimary'] == 'Y')" |
| 665 | v-model="scope.row['dictionaryCode']" placeholder="请选择" clearable filterable> | 666 | v-model="scope.row['dictionaryCode']" placeholder="请选择" clearable filterable> |
| ... | @@ -669,7 +670,7 @@ defineExpose({ | ... | @@ -669,7 +670,7 @@ defineExpose({ |
| 669 | <span v-else>{{ scope.row['dictionaryCode'] ? (paramsList.find(p => p.value == | 670 | <span v-else>{{ scope.row['dictionaryCode'] ? (paramsList.find(p => p.value == |
| 670 | scope.row['dictionaryCode'])?.label || "--") : '--' }}</span> | 671 | scope.row['dictionaryCode'])?.label || "--") : '--' }}</span> |
| 671 | </template> | 672 | </template> |
| 672 | </el-table-column> | 673 | </el-table-column> --> |
| 673 | <el-table-column prop="isPrimary" label="是否主键" width="130px" align="left" show-overflow-tooltip> | 674 | <el-table-column prop="isPrimary" label="是否主键" width="130px" align="left" show-overflow-tooltip> |
| 674 | <template #default="scope"> | 675 | <template #default="scope"> |
| 675 | <el-select v-if="scope.row['isEdit'] && !tableCreateInfo.guid" v-model="scope.row['isPrimary']" | 676 | <el-select v-if="scope.row['isEdit'] && !tableCreateInfo.guid" v-model="scope.row['isPrimary']" | ... | ... |
| ... | @@ -8,11 +8,9 @@ import { useRouter, useRoute } from "vue-router"; | ... | @@ -8,11 +8,9 @@ import { useRouter, useRoute } from "vue-router"; |
| 8 | import useUserStore from "@/store/modules/user"; | 8 | import useUserStore from "@/store/modules/user"; |
| 9 | import { | 9 | import { |
| 10 | getAreaData, | 10 | getAreaData, |
| 11 | getCurrentUserInfo | 11 | getParamsList, |
| 12 | } from "@/api/modules/queryService"; | 12 | } from "@/api/modules/queryService"; |
| 13 | import { | 13 | import { |
| 14 | getParamsList, | ||
| 15 | dataSourcesList, | ||
| 16 | registerCatalogSave, | 14 | registerCatalogSave, |
| 17 | existDamName, | 15 | existDamName, |
| 18 | getRegisterCatalogDetail, | 16 | getRegisterCatalogDetail, |
| ... | @@ -31,6 +29,8 @@ import importTableField from "./importTableField.vue"; | ... | @@ -31,6 +29,8 @@ import importTableField from "./importTableField.vue"; |
| 31 | import { useValidator } from '@/hooks/useValidator'; | 29 | import { useValidator } from '@/hooks/useValidator'; |
| 32 | import useDataAssetStore from "@/store/modules/dataAsset"; | 30 | import useDataAssetStore from "@/store/modules/dataAsset"; |
| 33 | import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common'; | 31 | import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common'; |
| 32 | import { TableColumnWidth } from '@/utils/enum'; | ||
| 33 | import { CirclePlus } from '@element-plus/icons-vue'; | ||
| 34 | 34 | ||
| 35 | const { proxy } = getCurrentInstance() as any; | 35 | const { proxy } = getCurrentInstance() as any; |
| 36 | const { required, checkExistName } = useValidator(); | 36 | const { required, checkExistName } = useValidator(); |
| ... | @@ -50,6 +50,15 @@ const getAreaDataPromise: any = ref({}); | ... | @@ -50,6 +50,15 @@ const getAreaDataPromise: any = ref({}); |
| 50 | const getAreaDatas: any = ref({}); | 50 | const getAreaDatas: any = ref({}); |
| 51 | const parentAreaData: any = ref([]); | 51 | const parentAreaData: any = ref([]); |
| 52 | 52 | ||
| 53 | /** 行业分类类型列表 */ | ||
| 54 | const industryDictList: any = ref([]); | ||
| 55 | /** 领域字典列表 */ | ||
| 56 | const domainDictList: any = ref([]); | ||
| 57 | /** 机构类型字典列表 */ | ||
| 58 | const institutionTypeDictList: any = ref([]); | ||
| 59 | /** 更新频率字典列表 */ | ||
| 60 | const updateFrequencyDictList: any = ref([]); | ||
| 61 | |||
| 53 | const getArea = (node, resolve) => { | 62 | const getArea = (node, resolve) => { |
| 54 | const { level } = node | 63 | const { level } = node |
| 55 | let params = { | 64 | let params = { |
| ... | @@ -100,30 +109,40 @@ const getArea = (node, resolve) => { | ... | @@ -100,30 +109,40 @@ const getArea = (node, resolve) => { |
| 100 | } | 109 | } |
| 101 | 110 | ||
| 102 | const baseInfoExpand = ref(true); | 111 | const baseInfoExpand = ref(true); |
| 112 | const expandServiceInfo = ref(true); | ||
| 103 | const assetTableInfoExpand = ref(true); | 113 | const assetTableInfoExpand = ref(true); |
| 104 | const importTableFieldRef = ref(); | 114 | const importTableFieldRef = ref(); |
| 105 | const rightMainTenantList: any = ref([]); //权利主体下拉列表选择 | 115 | const rightMainTenantList: any = ref([]); //权利主体下拉列表选择 |
| 106 | const catalogProductList: any = ref([]); //获取资产目录可信空间数据下拉列表 | 116 | //const catalogProductList: any = ref([]); //获取资产目录可信空间数据下拉列表 |
| 107 | const baseInfoFormRef = ref(); | 117 | const baseInfoFormRef = ref(); |
| 108 | 118 | ||
| 109 | const baseInfoFormItems = ref([ | 119 | const baseInfoFormItems = ref([ |
| 110 | { | 120 | { |
| 111 | label: '资源名称', | 121 | label: '资源名称', |
| 112 | type: 'select', | 122 | type: 'input', |
| 113 | placeholder: '请输入', | 123 | placeholder: '请输入', |
| 114 | field: 'damName', | 124 | field: 'damName', |
| 115 | maxlength: 50, | 125 | maxlength: 50, |
| 116 | default: '', | 126 | default: '', |
| 117 | required: true, | 127 | required: true |
| 118 | options: catalogProductList.value, | ||
| 119 | allowCreate: true, | ||
| 120 | filterable: true, | ||
| 121 | props: { | ||
| 122 | value: 'productId', | ||
| 123 | label: 'productName' | ||
| 124 | }, | ||
| 125 | clearable: true, | ||
| 126 | }, | 128 | }, |
| 129 | // { | ||
| 130 | // label: '资源名称', | ||
| 131 | // type: 'select', | ||
| 132 | // placeholder: '请输入', | ||
| 133 | // field: 'damName', | ||
| 134 | // maxlength: 50, | ||
| 135 | // default: '', | ||
| 136 | // required: true, | ||
| 137 | // options: catalogProductList.value, | ||
| 138 | // allowCreate: true, | ||
| 139 | // filterable: true, | ||
| 140 | // props: { | ||
| 141 | // value: 'productId', | ||
| 142 | // label: 'productName' | ||
| 143 | // }, | ||
| 144 | // clearable: true, | ||
| 145 | // }, | ||
| 127 | { | 146 | { |
| 128 | label: '资源类型', | 147 | label: '资源类型', |
| 129 | type: 'select', | 148 | type: 'select', |
| ... | @@ -151,7 +170,7 @@ const baseInfoFormItems = ref([ | ... | @@ -151,7 +170,7 @@ const baseInfoFormItems = ref([ |
| 151 | }, | 170 | }, |
| 152 | filterable: true, | 171 | filterable: true, |
| 153 | clearable: true, | 172 | clearable: true, |
| 154 | default: route.query.dataSources == '1' ? JSON.parse(userStore.userData).tenantGuid : JSON.parse(userStore.userData).tenantName, | 173 | default: route.query.dataSources == '1' ? JSON.parse(userStore.userData).tenantGuid : JSON.parse(userStore.userData).tenantName, |
| 155 | required: true, | 174 | required: true, |
| 156 | disabled: route.query.dataSources == '1' ? false : true, | 175 | disabled: route.query.dataSources == '1' ? false : true, |
| 157 | }, | 176 | }, |
| ... | @@ -166,7 +185,8 @@ const baseInfoFormItems = ref([ | ... | @@ -166,7 +185,8 @@ const baseInfoFormItems = ref([ |
| 166 | lazy: false, | 185 | lazy: false, |
| 167 | props: { | 186 | props: { |
| 168 | value: 'value', | 187 | value: 'value', |
| 169 | label: 'label' | 188 | label: 'label', |
| 189 | children: 'childDictList' | ||
| 170 | }, | 190 | }, |
| 171 | filterable: true, | 191 | filterable: true, |
| 172 | clearable: true, | 192 | clearable: true, |
| ... | @@ -174,6 +194,82 @@ const baseInfoFormItems = ref([ | ... | @@ -174,6 +194,82 @@ const baseInfoFormItems = ref([ |
| 174 | required: true | 194 | required: true |
| 175 | }, | 195 | }, |
| 176 | { | 196 | { |
| 197 | label: '行业分类', | ||
| 198 | type: 'select', | ||
| 199 | placeholder: '请选择', | ||
| 200 | field: 'industry', | ||
| 201 | default: '', | ||
| 202 | options: industryDictList.value || [], | ||
| 203 | props: { | ||
| 204 | value: 'value', | ||
| 205 | label: 'label' | ||
| 206 | }, | ||
| 207 | required: true, | ||
| 208 | filterable: true, | ||
| 209 | visible: true | ||
| 210 | }, | ||
| 211 | { | ||
| 212 | label: '机构分类', | ||
| 213 | type: 'select', | ||
| 214 | placeholder: '请选择', | ||
| 215 | field: 'institutionType', | ||
| 216 | default: '', | ||
| 217 | options: institutionTypeDictList.value || [], | ||
| 218 | props: { | ||
| 219 | value: 'value', | ||
| 220 | label: 'label' | ||
| 221 | }, | ||
| 222 | required: true, | ||
| 223 | filterable: true, | ||
| 224 | visible: true | ||
| 225 | }, | ||
| 226 | { | ||
| 227 | label: '领域', | ||
| 228 | type: 'select', | ||
| 229 | placeholder: '请选择', | ||
| 230 | field: 'domain', | ||
| 231 | default: '003', | ||
| 232 | options: domainDictList.value, | ||
| 233 | props: { | ||
| 234 | value: 'value', | ||
| 235 | label: 'label', | ||
| 236 | children: 'children' | ||
| 237 | }, | ||
| 238 | required: true, | ||
| 239 | filterable: true, | ||
| 240 | visible: true | ||
| 241 | }, { | ||
| 242 | label: '应用场景', | ||
| 243 | type: 'select', | ||
| 244 | placeholder: '请选择', | ||
| 245 | field: 'scenario', | ||
| 246 | default: '', | ||
| 247 | options: [], // 根据所选择领域显示列表 | ||
| 248 | props: { | ||
| 249 | value: 'value', | ||
| 250 | label: 'label' | ||
| 251 | }, | ||
| 252 | required: true, | ||
| 253 | filterable: true, | ||
| 254 | visible: true | ||
| 255 | }, | ||
| 256 | { | ||
| 257 | label: "更新频率", | ||
| 258 | type: "select", | ||
| 259 | placeholder: "请选择", | ||
| 260 | field: "updateFrequency", | ||
| 261 | default: '', | ||
| 262 | props: { | ||
| 263 | value: 'value', | ||
| 264 | label: 'label' | ||
| 265 | }, | ||
| 266 | multiple: false, | ||
| 267 | options: updateFrequencyDictList.value, | ||
| 268 | filterable: true, | ||
| 269 | required: true, | ||
| 270 | clearable: true, | ||
| 271 | }, | ||
| 272 | { | ||
| 177 | label: '数据覆盖地域', | 273 | label: '数据覆盖地域', |
| 178 | type: 'checkbox-select', | 274 | type: 'checkbox-select', |
| 179 | placeholder: '全国', | 275 | placeholder: '全国', |
| ... | @@ -235,28 +331,60 @@ const baseInfoFormItems = ref([ | ... | @@ -235,28 +331,60 @@ const baseInfoFormItems = ref([ |
| 235 | block: false, | 331 | block: false, |
| 236 | default: route.query.dataSources == '1' ? 1 : 2, | 332 | default: route.query.dataSources == '1' ? 1 : 2, |
| 237 | options: route.query.dataSources == '1' ? [{ //如果是授权数据则不能选择其余的 | 333 | options: route.query.dataSources == '1' ? [{ //如果是授权数据则不能选择其余的 |
| 238 | value: 1, | 334 | value: 1, |
| 239 | label: '授权数据', | 335 | label: '授权数据', |
| 240 | }]: [{ | 336 | }] : [{ |
| 241 | value: 2, | 337 | value: 2, |
| 242 | label: '自有数据', | 338 | label: '自有数据', |
| 339 | }, | ||
| 340 | { | ||
| 341 | value: 3, | ||
| 342 | label: '购买数据', | ||
| 343 | }, | ||
| 344 | { | ||
| 345 | value: 4, | ||
| 346 | label: '其他来源', | ||
| 347 | }], //dataSourcesList | ||
| 348 | required: true, | ||
| 243 | }, | 349 | }, |
| 350 | // 是否公共数据 | ||
| 244 | { | 351 | { |
| 245 | value: 3, | 352 | label: '是否公共数据', |
| 246 | label: '购买数据', | 353 | type: 'radio-group', |
| 354 | placeholder: '', | ||
| 355 | field: 'isPublicData', | ||
| 356 | block: false, | ||
| 357 | default: 'N', | ||
| 358 | options: [{ | ||
| 359 | value: 'Y', | ||
| 360 | label: '是' | ||
| 361 | }, { | ||
| 362 | value: 'N', | ||
| 363 | label: '否' | ||
| 364 | }], | ||
| 365 | required: true, | ||
| 247 | }, | 366 | }, |
| 248 | { | 367 | { |
| 249 | value: 4, | 368 | label: '是否缓存', |
| 250 | label: '其他来源', | 369 | type: 'radio-group', |
| 251 | }], //dataSourcesList | 370 | placeholder: '', |
| 371 | field: 'isCache', | ||
| 372 | block: false, | ||
| 373 | default: 'N', | ||
| 374 | options: [{ | ||
| 375 | value: 'Y', | ||
| 376 | label: '是' | ||
| 377 | }, { | ||
| 378 | value: 'N', | ||
| 379 | label: '否' | ||
| 380 | }], | ||
| 252 | required: true, | 381 | required: true, |
| 253 | }, | 382 | }, |
| 254 | // 是否公共数据 | ||
| 255 | { | 383 | { |
| 256 | label: '是否公共数据', | 384 | label: '是否加密存储', |
| 257 | type: 'radio-group', | 385 | type: 'radio-group', |
| 258 | placeholder: '', | 386 | placeholder: '', |
| 259 | field: 'isPublicData', | 387 | field: 'isEncrypField', |
| 260 | block: false, | 388 | block: false, |
| 261 | default: 'N', | 389 | default: 'N', |
| 262 | options: [{ | 390 | options: [{ |
| ... | @@ -331,6 +459,12 @@ const baseInfoFormRules = ref({ | ... | @@ -331,6 +459,12 @@ const baseInfoFormRules = ref({ |
| 331 | rightMain: [required(route.query.dataSources == '1' ? '请选择权利主体' : '请填写权利主体')], | 459 | rightMain: [required(route.query.dataSources == '1' ? '请选择权利主体' : '请填写权利主体')], |
| 332 | dataSources: [required('请选择数据来源')], | 460 | dataSources: [required('请选择数据来源')], |
| 333 | isPublicData: [required('请选择是否公共数据')], | 461 | isPublicData: [required('请选择是否公共数据')], |
| 462 | isCache: [required('请选择是否缓存')], | ||
| 463 | industry: [required('请选择行业分类')], | ||
| 464 | institutionType: [required('请选择机构分类')], | ||
| 465 | domain: [required('请选择领域')], | ||
| 466 | scenario: [required('请选择应用场景')], | ||
| 467 | updateFrequency: [required('请选择更新频率')] | ||
| 334 | }); | 468 | }); |
| 335 | 469 | ||
| 336 | const getTableFieldPromise: any = ref({}); | 470 | const getTableFieldPromise: any = ref({}); |
| ... | @@ -452,7 +586,7 @@ const assetDataTableInfo = ref({ | ... | @@ -452,7 +586,7 @@ const assetDataTableInfo = ref({ |
| 452 | let row = scope.row; | 586 | let row = scope.row; |
| 453 | router.push({ | 587 | router.push({ |
| 454 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog/import-file-dam' : '/data-asset/register-catalog/import-file-dam', | 588 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog/import-file-dam' : '/data-asset/register-catalog/import-file-dam', |
| 455 | // name: "importFileDam", | 589 | // name: "importFileDam", |
| 456 | query: { | 590 | query: { |
| 457 | bizGuid: row.guid, | 591 | bizGuid: row.guid, |
| 458 | name: row.tableChName, | 592 | name: row.tableChName, |
| ... | @@ -468,7 +602,7 @@ const assetDataTableInfo = ref({ | ... | @@ -468,7 +602,7 @@ const assetDataTableInfo = ref({ |
| 468 | let row = scope.row; | 602 | let row = scope.row; |
| 469 | router.push({ | 603 | router.push({ |
| 470 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog/damTableDataView' : '/data-asset/register-catalog/damTableDataView', | 604 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog/damTableDataView' : '/data-asset/register-catalog/damTableDataView', |
| 471 | // name: 'damTableDataView', | 605 | // name: 'damTableDataView', |
| 472 | query: { | 606 | query: { |
| 473 | guid: row.guid, | 607 | guid: row.guid, |
| 474 | name: row.tableChName, | 608 | name: row.tableChName, |
| ... | @@ -491,6 +625,9 @@ const setFormItems = (val) => { | ... | @@ -491,6 +625,9 @@ const setFormItems = (val) => { |
| 491 | if (item.children?.length) { | 625 | if (item.children?.length) { |
| 492 | item.children[0].default = val[item.children[0].field] || []; | 626 | item.children[0].default = val[item.children[0].field] || []; |
| 493 | } | 627 | } |
| 628 | if (item.field == 'scenario') { | ||
| 629 | item.options = domainDictList.value.find(s => s.value == val['domain'])?.childDictList || [] | ||
| 630 | } | ||
| 494 | }); | 631 | }); |
| 495 | } | 632 | } |
| 496 | 633 | ||
| ... | @@ -505,12 +642,9 @@ const baseSelectChange = (val, item, row) => { | ... | @@ -505,12 +642,9 @@ const baseSelectChange = (val, item, row) => { |
| 505 | setFormItems(row); | 642 | setFormItems(row); |
| 506 | } | 643 | } |
| 507 | } | 644 | } |
| 508 | } else if (item.field == 'damName') { | 645 | } else if (item.field == 'domain') { |
| 509 | let item = catalogProductList.value.find(c => c.productId == val); | 646 | row.scenario = ''; //清空下应用场景 |
| 510 | if (item?.description) { | 647 | setFormItems(row); |
| 511 | row.propertyDescription = item?.description; | ||
| 512 | setFormItems(row); | ||
| 513 | } | ||
| 514 | } | 648 | } |
| 515 | } | 649 | } |
| 516 | 650 | ||
| ... | @@ -521,6 +655,86 @@ const handleBaseInfoCheckboxChange = (val, info) => { | ... | @@ -521,6 +655,86 @@ const handleBaseInfoCheckboxChange = (val, info) => { |
| 521 | setFormItems(info); | 655 | setFormItems(info); |
| 522 | } | 656 | } |
| 523 | 657 | ||
| 658 | /** ------------------- 添加选择数据服务API表格,多选 ---------------------------- */ | ||
| 659 | const productTableRef = ref(); | ||
| 660 | const productData: any = ref([]); | ||
| 661 | |||
| 662 | const apiList: any = ref([]); | ||
| 663 | |||
| 664 | /** 基本信息的入参定义表格配置 */ | ||
| 665 | const productTableInfo = ref({ | ||
| 666 | id: "input-product-table", | ||
| 667 | height: '214px', | ||
| 668 | fields: [ | ||
| 669 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, | ||
| 670 | { label: "服务名称", field: "apiGuid", width: 180, required: true, columClass: 'edit-colum', type: 'edit' }, | ||
| 671 | { label: "API类型", field: "apiType", width: 100 }, | ||
| 672 | { label: "API地址", field: "requestUrl", width: 240 }, | ||
| 673 | { label: "描述", field: "apiDescription", width: 240 }, | ||
| 674 | ], | ||
| 675 | editInfo: { | ||
| 676 | apiGuid: { | ||
| 677 | label: '', | ||
| 678 | type: 'select', | ||
| 679 | field: 'apiGuid', | ||
| 680 | default: '', | ||
| 681 | options: apiList.value, | ||
| 682 | props: { | ||
| 683 | label: 'apiName', | ||
| 684 | value: 'guid', | ||
| 685 | disabled: 'disabled' | ||
| 686 | }, | ||
| 687 | placeholder: '请选择', | ||
| 688 | clearable: false, | ||
| 689 | filterable: true | ||
| 690 | }, | ||
| 691 | }, | ||
| 692 | STATUS: 'edit', | ||
| 693 | data: productData.value, | ||
| 694 | showPage: false, | ||
| 695 | actionInfo: { | ||
| 696 | show: true, | ||
| 697 | label: "操作", | ||
| 698 | type: "btn", | ||
| 699 | width: 60, | ||
| 700 | fixed: 'right', | ||
| 701 | btns: [ | ||
| 702 | { | ||
| 703 | label: "删除", value: "remove", click: (scope) => { | ||
| 704 | let index = scope.$index; | ||
| 705 | proxy.$openMessageBox("此操作将永久删除, 是否继续?", () => { | ||
| 706 | productData.value.splice(index, 1); | ||
| 707 | productTableInfo.value.data = productData.value; | ||
| 708 | proxy.$ElMessage.success('服务包删除成功'); | ||
| 709 | }, () => { | ||
| 710 | proxy.$ElMessage.info("已取消"); | ||
| 711 | }); | ||
| 712 | } | ||
| 713 | }, | ||
| 714 | ] | ||
| 715 | }, | ||
| 716 | loading: false | ||
| 717 | }); | ||
| 718 | |||
| 719 | /** 给表格添加一行入参定义。 */ | ||
| 720 | const addProduct = () => { | ||
| 721 | productData.value.push({ apiGuid: '' }); | ||
| 722 | productTableInfo.value.data = productData.value; | ||
| 723 | nextTick(() => { | ||
| 724 | scrollLastRowToView(productTableRef.value?.tableRef, productData.value.length); | ||
| 725 | }) | ||
| 726 | } | ||
| 727 | |||
| 728 | /** 根据下拉选择的产品带出产品相关信息 */ | ||
| 729 | const hanldeTableSelectChange = (val, scope, item) => { | ||
| 730 | let productItem = val && apiList.value.find(p => p.guid == val); | ||
| 731 | scope.row.guid = val; | ||
| 732 | scope.row.apiName = productItem?.apiName; | ||
| 733 | scope.row.apiType = productItem?.apiType; | ||
| 734 | scope.row.requestUrl = productItem?.requestUrl; | ||
| 735 | scope.row.apiDescription = productItem?.apiDescription; | ||
| 736 | } | ||
| 737 | |||
| 524 | const handleCreateTable = () => { | 738 | const handleCreateTable = () => { |
| 525 | if (assetDataTableInfo.value.data.length >= 15) { | 739 | if (assetDataTableInfo.value.data.length >= 15) { |
| 526 | proxy.$ElMessage.error('最多允许添加15张资源表'); | 740 | proxy.$ElMessage.error('最多允许添加15张资源表'); |
| ... | @@ -570,18 +784,6 @@ onBeforeMount(() => { | ... | @@ -570,18 +784,6 @@ onBeforeMount(() => { |
| 570 | detailInfo.value = res.data || {}; | 784 | detailInfo.value = res.data || {}; |
| 571 | baseInfoFormItems.value.forEach((item: any) => { | 785 | baseInfoFormItems.value.forEach((item: any) => { |
| 572 | item.default = detailInfo.value[item.field] == null ? '' : detailInfo.value[item.field]; | 786 | item.default = detailInfo.value[item.field] == null ? '' : detailInfo.value[item.field]; |
| 573 | if (item.field == 'damName') { | ||
| 574 | if (detailInfo.value?.productCode) { | ||
| 575 | let item = catalogProductList.value.find(c => c.productId == detailInfo.value?.productCode); | ||
| 576 | if (!item) { | ||
| 577 | item.default = detailInfo.value.damName; | ||
| 578 | } else { | ||
| 579 | item.default = item.productCode; | ||
| 580 | } | ||
| 581 | } else { | ||
| 582 | item.default = detailInfo.value.damName; | ||
| 583 | } | ||
| 584 | } | ||
| 585 | if (item.field == 'subjectDomain') { | 787 | if (item.field == 'subjectDomain') { |
| 586 | let tree = detailInfo.value.subjectDomainTree?.[0]; | 788 | let tree = detailInfo.value.subjectDomainTree?.[0]; |
| 587 | if (tree) { | 789 | if (tree) { |
| ... | @@ -625,6 +827,8 @@ onBeforeMount(() => { | ... | @@ -625,6 +827,8 @@ onBeforeMount(() => { |
| 625 | } | 827 | } |
| 626 | } else if (item.field == 'rightMain') { | 828 | } else if (item.field == 'rightMain') { |
| 627 | item.default = route.query.dataSources == '1' ? detailInfo.value.rightMain : detailInfo.value.rightMainName; | 829 | item.default = route.query.dataSources == '1' ? detailInfo.value.rightMain : detailInfo.value.rightMainName; |
| 830 | } else if (item.field == 'scenario') { | ||
| 831 | item.options = domainDictList.value.find(s => s.value == detailInfo.value['domain'])?.childDictList || [] | ||
| 628 | } | 832 | } |
| 629 | }); | 833 | }); |
| 630 | if (route.query.guid && route.query.foundMode == '2') { | 834 | if (route.query.guid && route.query.foundMode == '2') { |
| ... | @@ -668,34 +872,23 @@ onBeforeMount(() => { | ... | @@ -668,34 +872,23 @@ onBeforeMount(() => { |
| 668 | } | 872 | } |
| 669 | }) | 873 | }) |
| 670 | } | 874 | } |
| 671 | getRegisterCatalogProductList().then((res: any) => { | ||
| 672 | catalogProductList.value = []; | ||
| 673 | if (res.code == proxy.$passCode) { | ||
| 674 | catalogProductList.value = res.data || []; | ||
| 675 | baseInfoFormItems.value[0].options = catalogProductList.value; | ||
| 676 | if (detailInfo.value?.productCode) { | ||
| 677 | let item = catalogProductList.value.find(c => c.productId == detailInfo.value?.productCode); | ||
| 678 | if (!item) { | ||
| 679 | baseInfoFormItems.value[0].default = detailInfo.value.damName; | ||
| 680 | } | ||
| 681 | } | ||
| 682 | } else { | ||
| 683 | proxy.$ElMessage.error(res.msg); | ||
| 684 | } | ||
| 685 | }) | ||
| 686 | 875 | ||
| 687 | function replaceChildDictListKey(data) { | 876 | // getRegisterCatalogProductList().then((res: any) => { |
| 688 | if (Array.isArray(data)) { | 877 | // catalogProductList.value = []; |
| 689 | return data.map(item => replaceChildDictListKey(item)); | 878 | // if (res.code == proxy.$passCode) { |
| 690 | } else if (data && typeof data === 'object') { | 879 | // catalogProductList.value = res.data || []; |
| 691 | const { childDictList, ...rest } = data; | 880 | // baseInfoFormItems.value[0].options = catalogProductList.value; |
| 692 | return { | 881 | // if (detailInfo.value?.productCode) { |
| 693 | ...rest, | 882 | // let item = catalogProductList.value.find(c => c.productId == detailInfo.value?.productCode); |
| 694 | children: childDictList ? replaceChildDictListKey(childDictList) : undefined, | 883 | // if (!item) { |
| 695 | }; | 884 | // baseInfoFormItems.value[0].default = detailInfo.value.damName; |
| 696 | } | 885 | // } |
| 697 | return data; | 886 | // } |
| 698 | } | 887 | // } else { |
| 888 | // proxy.$ElMessage.error(res.msg); | ||
| 889 | // } | ||
| 890 | // }) | ||
| 891 | |||
| 699 | getParamsList({ | 892 | getParamsList({ |
| 700 | dictType: "资产类型", | 893 | dictType: "资产类型", |
| 701 | }).then((res: any) => { | 894 | }).then((res: any) => { |
| ... | @@ -711,13 +904,62 @@ onBeforeMount(() => { | ... | @@ -711,13 +904,62 @@ onBeforeMount(() => { |
| 711 | dictType: "数据资产目录主题名称", | 904 | dictType: "数据资产目录主题名称", |
| 712 | }).then((res: any) => { | 905 | }).then((res: any) => { |
| 713 | if (res.code == proxy.$passCode) { | 906 | if (res.code == proxy.$passCode) { |
| 714 | subjectDomainListData.value = replaceChildDictListKey(res.data) || []; | 907 | subjectDomainListData.value = res.data || []; |
| 715 | let item = baseInfoFormItems.value.find(item => item.field == 'subjectDomain'); | 908 | let item = baseInfoFormItems.value.find(item => item.field == 'subjectDomain'); |
| 716 | item && (item.options = subjectDomainListData.value); | 909 | item && (item.options = subjectDomainListData.value); |
| 717 | } else { | 910 | } else { |
| 718 | proxy.$ElMessage.error(res.msg); | 911 | proxy.$ElMessage.error(res.msg); |
| 719 | } | 912 | } |
| 720 | }) | 913 | }) |
| 914 | |||
| 915 | getParamsList({ | ||
| 916 | dictType: "行业分类", | ||
| 917 | }).then((res: any) => { | ||
| 918 | if (res.code == proxy.$passCode) { | ||
| 919 | industryDictList.value = res.data || []; | ||
| 920 | let item = baseInfoFormItems.value.find(item => item.field == 'industry'); | ||
| 921 | item && (item.options = industryDictList.value); | ||
| 922 | } else { | ||
| 923 | proxy.$ElMessage.error(res.msg); | ||
| 924 | } | ||
| 925 | }) | ||
| 926 | |||
| 927 | getParamsList({ dictType: '领域' }).then((res: any) => { | ||
| 928 | if (res.code == proxy.$passCode) { | ||
| 929 | domainDictList.value = res.data || []; | ||
| 930 | let itemIndex = baseInfoFormItems.value.findIndex(item => item.field == 'domain'); | ||
| 931 | let item = baseInfoFormItems.value[itemIndex]; | ||
| 932 | item && (item.options = domainDictList.value); | ||
| 933 | let item1 = baseInfoFormItems.value[itemIndex + 1]; | ||
| 934 | item1 && item.default && (item1.options = domainDictList.value.find(s => s.value == item.default)?.childDictList || []); | ||
| 935 | } else { | ||
| 936 | proxy.$ElMessage.error(res.msg); | ||
| 937 | } | ||
| 938 | }); | ||
| 939 | |||
| 940 | getParamsList({ | ||
| 941 | dictType: "组织机构性质", | ||
| 942 | }).then((res: any) => { | ||
| 943 | if (res.code == proxy.$passCode) { | ||
| 944 | institutionTypeDictList.value = res.data || []; | ||
| 945 | let item = baseInfoFormItems.value.find(item => item.field == 'institutionType'); | ||
| 946 | item && (item.options = institutionTypeDictList.value); | ||
| 947 | } else { | ||
| 948 | proxy.$ElMessage.error(res.msg); | ||
| 949 | } | ||
| 950 | }) | ||
| 951 | |||
| 952 | getParamsList({ | ||
| 953 | dictType: "更新周期", | ||
| 954 | }).then((res: any) => { | ||
| 955 | if (res.code == proxy.$passCode) { | ||
| 956 | updateFrequencyDictList.value = res.data || []; | ||
| 957 | let item = baseInfoFormItems.value.find(item => item.field == 'updateFrequency'); | ||
| 958 | item && (item.options = updateFrequencyDictList.value); | ||
| 959 | } else { | ||
| 960 | proxy.$ElMessage.error(res.msg); | ||
| 961 | } | ||
| 962 | }) | ||
| 721 | }); | 963 | }); |
| 722 | 964 | ||
| 723 | const cancel = () => { | 965 | const cancel = () => { |
| ... | @@ -735,28 +977,25 @@ const save = () => { | ... | @@ -735,28 +977,25 @@ const save = () => { |
| 735 | baseInfoFormRef.value?.ruleFormRef?.validate((valid, errorItem) => { | 977 | baseInfoFormRef.value?.ruleFormRef?.validate((valid, errorItem) => { |
| 736 | if (valid) { | 978 | if (valid) { |
| 737 | let params = { ...baseInfoFormRef.value.formInline }; | 979 | let params = { ...baseInfoFormRef.value.formInline }; |
| 738 | let item = catalogProductList.value.find(c => c.productId == params.damName); | 980 | let associationApiList: string[] = []; |
| 739 | if (item) { | 981 | for (const api of productData.value) { |
| 740 | params.productCode = item.productId; | 982 | if (!api.apiGuid) { |
| 741 | params.damName = item.productName; | 983 | proxy.$ElMessage.error('服务包信息未填写完整'); |
| 742 | params.foundMode = 5; | 984 | expandServiceInfo.value = true; |
| 743 | } else { | ||
| 744 | params.damName = params.damName; | ||
| 745 | if (params.damName.length > 50) { | ||
| 746 | proxy.$ElMessage.error('资源名称的长度不能超过50'); | ||
| 747 | baseInfoExpand.value = true; | ||
| 748 | return; | 985 | return; |
| 749 | } | 986 | } |
| 987 | associationApiList.push(api.apiGuid); | ||
| 750 | } | 988 | } |
| 989 | params.associationApi = associationApiList; | ||
| 751 | /** 只有数据集和api类型时,目录表必填。 */ | 990 | /** 只有数据集和api类型时,目录表必填。 */ |
| 752 | if ((params.damType == '1' || params.damType == '2') && route.query.foundMode != '2') { | 991 | if ((params.damType == '1' || params.damType == '2') && route.query.foundMode != '2') { |
| 753 | if (!params.databaseType) { | 992 | if (!params.databaseType) { |
| 754 | proxy.$ElMessage.error('资源类型为数据集或API时,数据库类型必填'); | 993 | proxy.$ElMessage.error('资源类型为数据集时,数据库类型必填'); |
| 755 | baseInfoExpand.value = true; | 994 | baseInfoExpand.value = true; |
| 756 | return; | 995 | return; |
| 757 | } | 996 | } |
| 758 | if (!assetDataTableInfo.value.data) { | 997 | if (!assetDataTableInfo.value.data) { |
| 759 | proxy.$ElMessage.error('资源类型为数据集或API时,必需添加资源表'); | 998 | proxy.$ElMessage.error('资源类型为数据集时,必需添加资源表'); |
| 760 | assetTableInfoExpand.value = true; | 999 | assetTableInfoExpand.value = true; |
| 761 | nextTick(() => { | 1000 | nextTick(() => { |
| 762 | setTimeout(() => { | 1001 | setTimeout(() => { |
| ... | @@ -787,8 +1026,8 @@ const save = () => { | ... | @@ -787,8 +1026,8 @@ const save = () => { |
| 787 | if (res.code == proxy.$passCode) { | 1026 | if (res.code == proxy.$passCode) { |
| 788 | proxy.$ElMessage.success('资源目录编辑提交成功'); | 1027 | proxy.$ElMessage.success('资源目录编辑提交成功'); |
| 789 | router.push({ | 1028 | router.push({ |
| 790 | // name: 'registerCatalogManagement' | 1029 | // name: 'registerCatalogManagement' |
| 791 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' | 1030 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' |
| 792 | }); | 1031 | }); |
| 793 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); | 1032 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); |
| 794 | assetStore.setDamCatalogRefresh(true); | 1033 | assetStore.setDamCatalogRefresh(true); |
| ... | @@ -807,13 +1046,13 @@ const save = () => { | ... | @@ -807,13 +1046,13 @@ const save = () => { |
| 807 | } else { | 1046 | } else { |
| 808 | params.rightMainName = rightMainTenantList.value.find(v => v.guid == params.rightMain)?.tenantName; | 1047 | params.rightMainName = rightMainTenantList.value.find(v => v.guid == params.rightMain)?.tenantName; |
| 809 | } | 1048 | } |
| 810 | // params.rightMain = JSON.parse(userStore.userData).tenantGuid; | 1049 | // params.rightMain = JSON.parse(userStore.userData).tenantGuid; |
| 811 | registerCatalogSave(params).then((res: any) => { | 1050 | registerCatalogSave(params).then((res: any) => { |
| 812 | fullscreenLoading.value = false; | 1051 | fullscreenLoading.value = false; |
| 813 | if (res.code == proxy.$passCode) { | 1052 | if (res.code == proxy.$passCode) { |
| 814 | proxy.$ElMessage.success('资源目录新建提交成功'); | 1053 | proxy.$ElMessage.success('资源目录新建提交成功'); |
| 815 | router.push({ | 1054 | router.push({ |
| 816 | // name: 'registerCatalogManagement' | 1055 | // name: 'registerCatalogManagement' |
| 817 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' | 1056 | path: route.query.dataSources == '1' ? '/data-asset/authordata-catalog' : '/data-asset/register-catalog' |
| 818 | }); | 1057 | }); |
| 819 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); | 1058 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); |
| ... | @@ -940,6 +1179,14 @@ const handleImportSave = (val) => { | ... | @@ -940,6 +1179,14 @@ const handleImportSave = (val) => { |
| 940 | <Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules" | 1179 | <Form ref="baseInfoFormRef" :itemList="baseInfoFormItems" formId="base-info-form" :rules="baseInfoFormRules" |
| 941 | @selectChange="baseSelectChange" @checkboxChange="handleBaseInfoCheckboxChange" col="col3" /> | 1180 | @selectChange="baseSelectChange" @checkboxChange="handleBaseInfoCheckboxChange" col="col3" /> |
| 942 | </ContentWrap> | 1181 | </ContentWrap> |
| 1182 | <ContentWrap id="product-info" title="服务包信息" expandSwicth style="margin-top: 15px" :isExpand="expandServiceInfo" | ||
| 1183 | @expand="(v) => (expandServiceInfo = v)" description="" class="mb16"> | ||
| 1184 | <Table ref="productTableRef" :tableInfo="productTableInfo" class="fiveRow-table" | ||
| 1185 | @table-select-change="hanldeTableSelectChange" /> | ||
| 1186 | <div class="row-add-btn"> | ||
| 1187 | <el-button link @click="addProduct" :icon="CirclePlus" v-preReClick>添加服务</el-button> | ||
| 1188 | </div> | ||
| 1189 | </ContentWrap> | ||
| 943 | <ContentWrap id="id-tableInfo" title="资源表" description="" :expand-swicth="true" :isExpand="assetTableInfoExpand" | 1190 | <ContentWrap id="id-tableInfo" title="资源表" description="" :expand-swicth="true" :isExpand="assetTableInfoExpand" |
| 944 | @expand="(v) => assetTableInfoExpand = v"> | 1191 | @expand="(v) => assetTableInfoExpand = v"> |
| 945 | <div v-show="assetDataTableInfo.data.length" class="tools_btns"> | 1192 | <div v-show="assetDataTableInfo.data.length" class="tools_btns"> | ... | ... |
| ... | @@ -192,6 +192,8 @@ const getDetailInfo = () => { | ... | @@ -192,6 +192,8 @@ const getDetailInfo = () => { |
| 192 | const data = res.data || {}; | 192 | const data = res.data || {}; |
| 193 | detailInfo.value = data; | 193 | detailInfo.value = data; |
| 194 | publicDataProductsMainRSVO.value = detailInfo.value.publicDataProductsMainRSVO || {}; | 194 | publicDataProductsMainRSVO.value = detailInfo.value.publicDataProductsMainRSVO || {}; |
| 195 | //TODO. 返回服务包信息 | ||
| 196 | productTableInfo.value.data = detailInfo.value.associationApiVO || []; | ||
| 195 | // detailInfo.value.damTypeName = damTypes.find(d => d.value == detailInfo.value.damType)?.label; | 197 | // detailInfo.value.damTypeName = damTypes.find(d => d.value == detailInfo.value.damType)?.label; |
| 196 | detailInfo.value.dataSourcesName = dataSourcesList.find(d => d.value == detailInfo.value.dataSources)?.label; | 198 | detailInfo.value.dataSourcesName = dataSourcesList.find(d => d.value == detailInfo.value.dataSources)?.label; |
| 197 | if (!isJSZQ.value) { | 199 | if (!isJSZQ.value) { |
| ... | @@ -320,6 +322,25 @@ const getDetailInfo = () => { | ... | @@ -320,6 +322,25 @@ const getDetailInfo = () => { |
| 320 | }) | 322 | }) |
| 321 | } | 323 | } |
| 322 | 324 | ||
| 325 | /** ----------------- 数据包信息 --------------------- */ | ||
| 326 | const productTableInfo = ref({ | ||
| 327 | id: "input-product-table", | ||
| 328 | height: '214px', | ||
| 329 | fields: [ | ||
| 330 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, | ||
| 331 | { label: "服务名称", field: "apiGuid", width: 180 }, | ||
| 332 | { label: "API类型", field: "apiType", width: 100 }, | ||
| 333 | { label: "API地址", field: "requestUrl", width: 240 }, | ||
| 334 | { label: "描述", field: "apiDescription", width: 240 }, | ||
| 335 | ], | ||
| 336 | data: [], | ||
| 337 | showPage: false, | ||
| 338 | actionInfo: { | ||
| 339 | show: false | ||
| 340 | }, | ||
| 341 | loading: false | ||
| 342 | }); | ||
| 343 | |||
| 323 | onBeforeMount(() => { | 344 | onBeforeMount(() => { |
| 324 | if (!assetStore.isRefreshDamCatalog) { | 345 | if (!assetStore.isRefreshDamCatalog) { |
| 325 | getDetailInfo(); | 346 | getDetailInfo(); |
| ... | @@ -357,11 +378,12 @@ const isTextTruncated = () => { | ... | @@ -357,11 +378,12 @@ const isTextTruncated = () => { |
| 357 | isTruncated.value = false; | 378 | isTruncated.value = false; |
| 358 | isExpanded.value = false; | 379 | isExpanded.value = false; |
| 359 | nextTick(() => { | 380 | nextTick(() => { |
| 360 | let domDesc = document.getElementsByClassName('right-main')?.[0]; | 381 | let dom = document.getElementsByClassName('right-main')?.[0]; |
| 382 | let domDesc = dom?.children?.length && dom?.children?.[dom.children.length - 1]; | ||
| 361 | if (!domDesc) { | 383 | if (!domDesc) { |
| 362 | return; | 384 | return; |
| 363 | } | 385 | } |
| 364 | if (domDesc.clientHeight > 82) { | 386 | if (domDesc.clientHeight > 21) { |
| 365 | isTruncated.value = true; | 387 | isTruncated.value = true; |
| 366 | } else { | 388 | } else { |
| 367 | isTruncated.value = false; | 389 | isTruncated.value = false; |
| ... | @@ -1210,8 +1232,23 @@ const respParamsTableInfo = ref({ | ... | @@ -1210,8 +1232,23 @@ const respParamsTableInfo = ref({ |
| 1210 | detailInfo.subjectDomain }}</div> | 1232 | detailInfo.subjectDomain }}</div> |
| 1211 | <div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div> | 1233 | <div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div> |
| 1212 | <div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div> | 1234 | <div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div> |
| 1235 | <div class="dataLabel dataLabel1" v-if="detailInfo.updateFrequency">{{ detailInfo.updateFrequencyName }}</div> | ||
| 1213 | </div> | 1236 | </div> |
| 1214 | </div> | 1237 | </div> |
| 1238 | <template v-if="detailInfo?.foundMode == 1"> | ||
| 1239 | <div class="row-extra-desc"> | ||
| 1240 | <div class="per-extra-desc">{{ '行业分类:' + (detailInfo.industryName || '--') }}</div> | ||
| 1241 | <div>{{ '机构分类:' + (detailInfo.institutionTypeName || '--') }}</div> | ||
| 1242 | </div> | ||
| 1243 | <div class="row-extra-desc"> | ||
| 1244 | <div class="per-extra-desc">{{ '领域:' + (detailInfo.domainName || '--') }}</div> | ||
| 1245 | <div>{{ '应用场景:' + (detailInfo.scenarioName || '--') }}</div> | ||
| 1246 | </div> | ||
| 1247 | <div class="row-extra-desc"> | ||
| 1248 | <div class="per-extra-desc">{{ '是否缓存:' + (detailInfo.isCache == 'Y' ? '是' : '否') }}</div> | ||
| 1249 | <div>{{ '是否加密存储:' + (detailInfo.scenario == 'Y' ? '是' : '否') }}</div> | ||
| 1250 | </div> | ||
| 1251 | </template> | ||
| 1215 | <div v-show="detailInfo.rightMainName" class="applicationScenarios">{{ '权利主体:' + detailInfo.rightMainName }} | 1252 | <div v-show="detailInfo.rightMainName" class="applicationScenarios">{{ '权利主体:' + detailInfo.rightMainName }} |
| 1216 | </div> | 1253 | </div> |
| 1217 | <div class="applicationScenarios" | 1254 | <div class="applicationScenarios" |
| ... | @@ -1300,7 +1337,7 @@ const respParamsTableInfo = ref({ | ... | @@ -1300,7 +1337,7 @@ const respParamsTableInfo = ref({ |
| 1300 | </div> | 1337 | </div> |
| 1301 | <div class="list_item is_block"> | 1338 | <div class="list_item is_block"> |
| 1302 | <span class="item_label">产品关键词:</span> | 1339 | <span class="item_label">产品关键词:</span> |
| 1303 | <span class="item_value">{{ publicDataProductsMainRSVO.productKeywords?.join(',') || '--' }}</span> | 1340 | <span class="item_value">{{ publicDataProductsMainRSVO?.productKeywords?.join(',') || '--' }}</span> |
| 1304 | </div> | 1341 | </div> |
| 1305 | <div class="list_item is_block"> | 1342 | <div class="list_item is_block"> |
| 1306 | <span class="item_label">产品描述:</span> | 1343 | <span class="item_label">产品描述:</span> |
| ... | @@ -1308,6 +1345,9 @@ const respParamsTableInfo = ref({ | ... | @@ -1308,6 +1345,9 @@ const respParamsTableInfo = ref({ |
| 1308 | </div> | 1345 | </div> |
| 1309 | </div> | 1346 | </div> |
| 1310 | </ContentWrap> | 1347 | </ContentWrap> |
| 1348 | <ContentWrap v-if="productTableInfo.data?.length" id="product-info" title="服务包信息" style="margin: 16px 16px 16px"> | ||
| 1349 | <Table ref="productTableRef" :tableInfo="productTableInfo" class="fiveRow-table" /> | ||
| 1350 | </ContentWrap> | ||
| 1311 | <ContentWrap v-if="isJSZQ" id="id-paramsInfo" title="入参出参信息" description="" style="margin: 16px 16px 16px"> | 1351 | <ContentWrap v-if="isJSZQ" id="id-paramsInfo" title="入参出参信息" description="" style="margin: 16px 16px 16px"> |
| 1312 | <el-tabs v-model="activeTabName" class="param-tabs"> | 1352 | <el-tabs v-model="activeTabName" class="param-tabs"> |
| 1313 | <el-tab-pane label="入参信息" name="reqParamList"> | 1353 | <el-tab-pane label="入参信息" name="reqParamList"> |
| ... | @@ -1355,7 +1395,7 @@ const respParamsTableInfo = ref({ | ... | @@ -1355,7 +1395,7 @@ const respParamsTableInfo = ref({ |
| 1355 | <span>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span> | 1395 | <span>{{ scope.row["fieldPrecision"] == null ? '--' : scope.row["fieldPrecision"] }}</span> |
| 1356 | </template> | 1396 | </template> |
| 1357 | </el-table-column> | 1397 | </el-table-column> |
| 1358 | <el-table-column prop="dictionaryCode" label="关联字典" width="130px" align="left" show-overflow-tooltip> | 1398 | <el-table-column v-if="detailInfo.foundMode != 1" prop="dictionaryCode" label="关联字典" width="130px" align="left" show-overflow-tooltip> |
| 1359 | <template #default="scope"> | 1399 | <template #default="scope"> |
| 1360 | <span>{{ scope.row["dictionaryName"] || '--' }}</span> | 1400 | <span>{{ scope.row["dictionaryName"] || '--' }}</span> |
| 1361 | </template> | 1401 | </template> |
| ... | @@ -1852,7 +1892,7 @@ const respParamsTableInfo = ref({ | ... | @@ -1852,7 +1892,7 @@ const respParamsTableInfo = ref({ |
| 1852 | letter-spacing: 0; | 1892 | letter-spacing: 0; |
| 1853 | line-height: 30px; | 1893 | line-height: 30px; |
| 1854 | font-weight: 600; | 1894 | font-weight: 600; |
| 1855 | max-width: calc(100% - 250px); | 1895 | max-width: calc(100% - 320px); |
| 1856 | } | 1896 | } |
| 1857 | 1897 | ||
| 1858 | .dataLabel { | 1898 | .dataLabel { |
| ... | @@ -1891,10 +1931,25 @@ const respParamsTableInfo = ref({ | ... | @@ -1891,10 +1931,25 @@ const respParamsTableInfo = ref({ |
| 1891 | .expand_btn { | 1931 | .expand_btn { |
| 1892 | position: absolute; | 1932 | position: absolute; |
| 1893 | right: 0px; | 1933 | right: 0px; |
| 1894 | top: 58px; | 1934 | bottom: 0px; |
| 1895 | font-size: 14px; | 1935 | font-size: 14px; |
| 1896 | line-height: 21px; | 1936 | line-height: 21px; |
| 1897 | } | 1937 | } |
| 1938 | |||
| 1939 | .row-extra-desc { | ||
| 1940 | width: 100%; | ||
| 1941 | display: flex; | ||
| 1942 | margin-top: 4px; | ||
| 1943 | font-size: 14px; | ||
| 1944 | color: #666666; | ||
| 1945 | letter-spacing: 0; | ||
| 1946 | line-height: 21px; | ||
| 1947 | font-weight: 400; | ||
| 1948 | |||
| 1949 | .per-extra-desc { | ||
| 1950 | width: 400px; | ||
| 1951 | } | ||
| 1952 | } | ||
| 1898 | } | 1953 | } |
| 1899 | } | 1954 | } |
| 1900 | 1955 | ... | ... |
| ... | @@ -5,9 +5,7 @@ name: registerCatalogManagement | ... | @@ -5,9 +5,7 @@ name: registerCatalogManagement |
| 5 | <script lang="ts" setup name="registerCatalogManagement"> | 5 | <script lang="ts" setup name="registerCatalogManagement"> |
| 6 | import { ref } from "vue"; | 6 | import { ref } from "vue"; |
| 7 | import TableTools from "@/components/Tools/table_tools.vue"; | 7 | import TableTools from "@/components/Tools/table_tools.vue"; |
| 8 | import { ElMessageBox } from "element-plus"; | ||
| 9 | import { useRouter, useRoute } from "vue-router"; | 8 | import { useRouter, useRoute } from "vue-router"; |
| 10 | import { MoreFilled } from "@element-plus/icons-vue"; | ||
| 11 | import { | 9 | import { |
| 12 | getParamsList, | 10 | getParamsList, |
| 13 | getDamCatalogTable, | 11 | getDamCatalogTable, |
| ... | @@ -49,7 +47,7 @@ const damTypesOptions = ref<any>([ | ... | @@ -49,7 +47,7 @@ const damTypesOptions = ref<any>([ |
| 49 | { label: "加工交付", value: 2 }, | 47 | { label: "加工交付", value: 2 }, |
| 50 | { label: "专区", value: 3 }, | 48 | { label: "专区", value: 3 }, |
| 51 | { label: "江苏专区", value: 4 }, | 49 | { label: "江苏专区", value: 4 }, |
| 52 | { label: "数据港", value: 5 }, | 50 | // { label: "数据港", value: 5 }, |
| 53 | ]) | 51 | ]) |
| 54 | const searchItemList = ref([ | 52 | const searchItemList = ref([ |
| 55 | { | 53 | { |
| ... | @@ -110,20 +108,20 @@ const searchItemList = ref([ | ... | @@ -110,20 +108,20 @@ const searchItemList = ref([ |
| 110 | label: 'label' | 108 | label: 'label' |
| 111 | } | 109 | } |
| 112 | }, | 110 | }, |
| 113 | { | 111 | // { |
| 114 | type: "select", | 112 | // type: "select", |
| 115 | label: "", | 113 | // label: "", |
| 116 | field: "isRegister", | 114 | // field: "isRegister", |
| 117 | default: "", | 115 | // default: "", |
| 118 | placeholder: "登记状态", | 116 | // placeholder: "登记状态", |
| 119 | clearable: true, | 117 | // clearable: true, |
| 120 | filterable: true, | 118 | // filterable: true, |
| 121 | options: isRegisterOptions.value, | 119 | // options: isRegisterOptions.value, |
| 122 | props: { | 120 | // props: { |
| 123 | value: 'value', | 121 | // value: 'value', |
| 124 | label: 'label' | 122 | // label: 'label' |
| 125 | } | 123 | // } |
| 126 | }, | 124 | // }, |
| 127 | ]); | 125 | ]); |
| 128 | 126 | ||
| 129 | const pageInfo = ref({ | 127 | const pageInfo = ref({ | ... | ... |
| ... | @@ -259,6 +259,14 @@ const apiManageTableBtnMap = { | ... | @@ -259,6 +259,14 @@ const apiManageTableBtnMap = { |
| 259 | /** 详情 */ | 259 | /** 详情 */ |
| 260 | DETAIL: (scope) => { | 260 | DETAIL: (scope) => { |
| 261 | let row = scope.row; | 261 | let row = scope.row; |
| 262 | const approveVO = row.approveVO || {}; | ||
| 263 | if (!approveVO && row.isApprove == 'N') { | ||
| 264 | router.push({ | ||
| 265 | name: 'apiDetail', | ||
| 266 | query: { guid: row.guid, type: 'detail' } | ||
| 267 | }); | ||
| 268 | return; | ||
| 269 | } | ||
| 262 | if (!row.approveGuid) { | 270 | if (!row.approveGuid) { |
| 263 | proxy.$ElMessage.error(`【${row.apiName}】关联流程已删除!`); | 271 | proxy.$ElMessage.error(`【${row.apiName}】关联流程已删除!`); |
| 264 | return; | 272 | return; | ... | ... |
src/views/data_service/dataSource.vue
0 → 100644
| 1 | <route lang="yaml"> | ||
| 2 | name: dataSource | ||
| 3 | </route> | ||
| 4 | |||
| 5 | <script lang="ts" setup name="dataSource"> | ||
| 6 | import { ref, onMounted } from "vue"; | ||
| 7 | import { ElMessage, ElMessageBox } from "element-plus"; | ||
| 8 | import TableTools from "@/components/Tools/table_tools.vue"; | ||
| 9 | |||
| 10 | import { | ||
| 11 | addDataSource, | ||
| 12 | getDataSourceList, | ||
| 13 | deleteDataSource, | ||
| 14 | updateDataSource, | ||
| 15 | getDataSourceDetail, | ||
| 16 | checkDataSourceConnect, | ||
| 17 | checkDataSourceConnectTest, | ||
| 18 | getAllFlowData | ||
| 19 | } from "@/api/modules/queryService"; | ||
| 20 | |||
| 21 | const { proxy } = getCurrentInstance() as any; | ||
| 22 | |||
| 23 | const searchItemList = ref([ | ||
| 24 | { | ||
| 25 | type: "select", | ||
| 26 | label: "", | ||
| 27 | field: "systemLayer", | ||
| 28 | default: "", | ||
| 29 | placeholder: "系统分层", | ||
| 30 | options: [ | ||
| 31 | { label: "业务系统", value: "业务系统" }, | ||
| 32 | { label: "数据中心", value: "数据中心" }, | ||
| 33 | ], | ||
| 34 | clearable: true, | ||
| 35 | }, | ||
| 36 | { | ||
| 37 | type: "select", | ||
| 38 | label: "", | ||
| 39 | field: "databaseType", | ||
| 40 | default: "", | ||
| 41 | placeholder: "库类型", | ||
| 42 | options: [ | ||
| 43 | { label: "mysql", value: "mysql" }, | ||
| 44 | { label: "doris", value: "doris" }, | ||
| 45 | { label: "oracle", value: "oracle" }, | ||
| 46 | ], | ||
| 47 | clearable: true, | ||
| 48 | }, | ||
| 49 | { | ||
| 50 | type: "select", | ||
| 51 | label: "", | ||
| 52 | field: "connectStatus", | ||
| 53 | default: "", | ||
| 54 | placeholder: "连通状态", | ||
| 55 | options: [ | ||
| 56 | { label: "已连通", value: "1" }, | ||
| 57 | { label: "连通失败", value: "2" }, | ||
| 58 | ], | ||
| 59 | clearable: true, | ||
| 60 | }, | ||
| 61 | { | ||
| 62 | type: "input", | ||
| 63 | label: "", | ||
| 64 | field: "databaseNameZh", | ||
| 65 | default: "", | ||
| 66 | placeholder: "数据源名称", | ||
| 67 | clearable: true, | ||
| 68 | }, | ||
| 69 | { | ||
| 70 | type: "input", | ||
| 71 | label: "", | ||
| 72 | field: "databaseNameEn", | ||
| 73 | default: "", | ||
| 74 | placeholder: "数据库名", | ||
| 75 | clearable: true, | ||
| 76 | }, | ||
| 77 | ]); | ||
| 78 | |||
| 79 | const currTableData: any = ref<Object>({}); | ||
| 80 | const page = ref({ | ||
| 81 | limit: 50, | ||
| 82 | curr: 1, | ||
| 83 | sizes: [ | ||
| 84 | { label: "10", value: 10 }, | ||
| 85 | { label: "50", value: 50 }, | ||
| 86 | { label: "100", value: 100 }, | ||
| 87 | { label: "150", value: 150 }, | ||
| 88 | { label: "200", value: 200 }, | ||
| 89 | ], | ||
| 90 | systemLayer: '', | ||
| 91 | databaseType: '', | ||
| 92 | connectStatus: '', | ||
| 93 | databaseNameZh: '', | ||
| 94 | databaseNameEn: '' | ||
| 95 | }); | ||
| 96 | const selectRowData = ref([]); | ||
| 97 | const tableInfo = ref({ | ||
| 98 | id: "data-source-table", | ||
| 99 | multiple: true, | ||
| 100 | fields: [ | ||
| 101 | { label: "序号", type: "index", width: 56, align: "center" }, | ||
| 102 | { label: "数据源名称", field: "databaseNameZh", width: 120 }, | ||
| 103 | { label: "系统分层", field: "systemLayer", width: 96 }, | ||
| 104 | { label: "库类型", field: "databaseType", width: 96 }, | ||
| 105 | { label: "数据库名", field: "databaseNameEn", width: 200 }, | ||
| 106 | { | ||
| 107 | label: "连通状态", | ||
| 108 | field: "connectStatus", | ||
| 109 | type: "tag", | ||
| 110 | width: 96, | ||
| 111 | align: "center", | ||
| 112 | }, | ||
| 113 | { label: "连通时间", field: "lastCheckTime", width: 172 }, | ||
| 114 | { label: "操作人", field: "updateUserName", width: 140 }, | ||
| 115 | { label: "更新时间", field: "updateTime", width: 172 }, | ||
| 116 | ], | ||
| 117 | data: [], | ||
| 118 | page: { | ||
| 119 | type: "normal", | ||
| 120 | rows: 0, | ||
| 121 | ...page.value, | ||
| 122 | }, | ||
| 123 | actionInfo: { | ||
| 124 | label: "操作", | ||
| 125 | type: "btn", | ||
| 126 | width: 160, | ||
| 127 | btns: [ | ||
| 128 | { label: "编辑", value: "edit" }, | ||
| 129 | { label: "连通测试", value: "test" }, | ||
| 130 | { label: "删除", value: "delete" }, | ||
| 131 | ], | ||
| 132 | }, | ||
| 133 | loading: false, | ||
| 134 | }); | ||
| 135 | |||
| 136 | const tabActiveName = ref("1"); | ||
| 137 | const tabsInfo: any = ref({ | ||
| 138 | type: "tabs", | ||
| 139 | title: "", | ||
| 140 | style: { | ||
| 141 | padding: "0 24px", | ||
| 142 | }, | ||
| 143 | tabsInfo: { | ||
| 144 | activeName: "", | ||
| 145 | tabs: [ | ||
| 146 | { label: "常规", name: "常规" }, | ||
| 147 | // { label: "SSL", name: "SSL" }, //未支持,先隐藏掉 | ||
| 148 | // { label: "SSH", name: "SSH" }, | ||
| 149 | // { label: "HTTP", name: "HTTP" }, | ||
| 150 | ], | ||
| 151 | }, | ||
| 152 | }); | ||
| 153 | const formItems: any = ref([]); | ||
| 154 | const formRules: any = ref({}); | ||
| 155 | const flowList: any = ref([]) | ||
| 156 | const formInfo: any = ref({ | ||
| 157 | type: "form", | ||
| 158 | title: "", | ||
| 159 | style: { | ||
| 160 | padding: "0 24px", | ||
| 161 | overflow: 'hidden auto' | ||
| 162 | }, | ||
| 163 | formInfo: { | ||
| 164 | id: "add-source-form", | ||
| 165 | items: formItems.value, | ||
| 166 | rules: formRules.value, | ||
| 167 | }, | ||
| 168 | }); | ||
| 169 | const contents: any = ref({ | ||
| 170 | normal: { | ||
| 171 | items: [ | ||
| 172 | { | ||
| 173 | label: "数据源名称", | ||
| 174 | type: "input", | ||
| 175 | placeholder: "请输入", | ||
| 176 | field: "databaseNameZh", | ||
| 177 | default: "", | ||
| 178 | clearable: true, | ||
| 179 | required: true, | ||
| 180 | }, | ||
| 181 | { | ||
| 182 | label: "系统分层", | ||
| 183 | type: "select", | ||
| 184 | placeholder: "请选择", | ||
| 185 | field: "systemLayer", | ||
| 186 | default: "", | ||
| 187 | options: [ | ||
| 188 | { | ||
| 189 | label: "业务系统", | ||
| 190 | value: "业务系统", | ||
| 191 | }, | ||
| 192 | { | ||
| 193 | label: "数据中心", | ||
| 194 | value: "数据中心", | ||
| 195 | }, | ||
| 196 | ], | ||
| 197 | clearable: true, | ||
| 198 | required: true, | ||
| 199 | }, | ||
| 200 | { | ||
| 201 | label: "库类型", | ||
| 202 | type: "select", | ||
| 203 | placeholder: "请选择", | ||
| 204 | field: "databaseType", | ||
| 205 | default: "", | ||
| 206 | options: [ | ||
| 207 | { label: "mysql", value: "mysql" }, | ||
| 208 | { label: "doris", value: "doris" }, | ||
| 209 | { label: "oracle", value: "oracle" }, | ||
| 210 | ], | ||
| 211 | clearable: true, | ||
| 212 | required: true, | ||
| 213 | }, | ||
| 214 | { | ||
| 215 | label: "业务系统", | ||
| 216 | type: "select", | ||
| 217 | placeholder: "请选择", | ||
| 218 | field: "bizSystem", | ||
| 219 | default: "", | ||
| 220 | options: [], | ||
| 221 | clearable: true, | ||
| 222 | required: true, | ||
| 223 | }, | ||
| 224 | { | ||
| 225 | label: "集群信息", | ||
| 226 | type: "textarea-group", | ||
| 227 | placeholder: "请输入", | ||
| 228 | field: "jqxx", | ||
| 229 | default: "", | ||
| 230 | tooltipContent: | ||
| 231 | "格式:doris-fe-zs.doris:8030,doris-fe-zs.doris:8090 多个地址用英文半角逗号分隔", | ||
| 232 | children: [ | ||
| 233 | { | ||
| 234 | label: "feLoadUrl", | ||
| 235 | type: "textarea", | ||
| 236 | placeholder: "请输入", | ||
| 237 | field: "feLoadUrl", | ||
| 238 | default: "", | ||
| 239 | clearable: true, | ||
| 240 | required: true, | ||
| 241 | block: true, | ||
| 242 | }, | ||
| 243 | { | ||
| 244 | label: "beLoadUrl", | ||
| 245 | type: "textarea", | ||
| 246 | placeholder: "请输入", | ||
| 247 | field: "beLoadUrl", | ||
| 248 | default: "", | ||
| 249 | clearable: true, | ||
| 250 | required: true, | ||
| 251 | block: true, | ||
| 252 | }, | ||
| 253 | { | ||
| 254 | label: "dorisJdbcUrl", | ||
| 255 | type: "textarea", | ||
| 256 | placeholder: "请输入", | ||
| 257 | field: "dorisJdbcUrl", | ||
| 258 | default: "", | ||
| 259 | clearable: true, | ||
| 260 | required: true, | ||
| 261 | block: true, | ||
| 262 | }, | ||
| 263 | ], | ||
| 264 | block: true, | ||
| 265 | visible: false, | ||
| 266 | }, | ||
| 267 | { | ||
| 268 | label: "服务器", | ||
| 269 | type: "input", | ||
| 270 | placeholder: "请输入", | ||
| 271 | field: "host", | ||
| 272 | default: "", | ||
| 273 | clearable: true, | ||
| 274 | required: true, | ||
| 275 | }, | ||
| 276 | { | ||
| 277 | label: "端口", | ||
| 278 | type: "input", | ||
| 279 | placeholder: "请输入", | ||
| 280 | field: "port", | ||
| 281 | default: "", | ||
| 282 | clearable: true, | ||
| 283 | required: true, | ||
| 284 | }, | ||
| 285 | { | ||
| 286 | label: "用户名", | ||
| 287 | type: "input", | ||
| 288 | placeholder: "请输入", | ||
| 289 | field: "logonUser", | ||
| 290 | default: "", | ||
| 291 | clearable: true, | ||
| 292 | required: true, | ||
| 293 | autocompleteSetting: { | ||
| 294 | autocomplete: "off", | ||
| 295 | readonly: true, | ||
| 296 | }, | ||
| 297 | }, | ||
| 298 | { | ||
| 299 | label: "密码", | ||
| 300 | type: "password", | ||
| 301 | placeholder: "请输入", | ||
| 302 | field: "password", | ||
| 303 | default: "", | ||
| 304 | clearable: true, | ||
| 305 | required: true, | ||
| 306 | autocompleteSetting: { | ||
| 307 | autocomplete: "off", | ||
| 308 | readonly: true, | ||
| 309 | }, | ||
| 310 | }, | ||
| 311 | { | ||
| 312 | label: "数据库名", | ||
| 313 | type: "input", | ||
| 314 | placeholder: "请输入", | ||
| 315 | field: "databaseNameEn", | ||
| 316 | default: "", | ||
| 317 | clearable: true, | ||
| 318 | required: true, | ||
| 319 | }, | ||
| 320 | { | ||
| 321 | label: "连接属性", | ||
| 322 | type: "textarea-tips", | ||
| 323 | placeholder: "请输入", | ||
| 324 | field: "linkage", | ||
| 325 | default: "", | ||
| 326 | tips: { | ||
| 327 | type: "table", | ||
| 328 | size: 400, | ||
| 329 | placement: "right", | ||
| 330 | offset: 12, | ||
| 331 | tableInfo: { | ||
| 332 | id: "", | ||
| 333 | fields: [ | ||
| 334 | { label: "数据库", field: "jsmc", width: 120 }, | ||
| 335 | { label: "连接属性", field: "sx", width: 200 }, | ||
| 336 | ], | ||
| 337 | data: [ | ||
| 338 | { | ||
| 339 | jsmc: "MYSQL8.0", | ||
| 340 | sx: "列出支持的连接属性,并给出解释和范例,多个属性用;分割", | ||
| 341 | cjsj: "2022-12-12 08:12:12", | ||
| 342 | }, | ||
| 343 | { | ||
| 344 | jsmc: "MYSQL8.0", | ||
| 345 | sx: "服务器的时区:serverTimezone=Asia/Shanghai;", | ||
| 346 | cjsj: "2022-12-12 08:12:12", | ||
| 347 | }, | ||
| 348 | { | ||
| 349 | jsmc: "MYSQL8.0", | ||
| 350 | sx: "useUnicode=utf8;", | ||
| 351 | cjsj: "2022-12-12 08:12:12", | ||
| 352 | }, | ||
| 353 | { | ||
| 354 | jsmc: "MYSQL8.0", | ||
| 355 | sx: "characterEncoding=utf8;", | ||
| 356 | cjsj: "2022-12-12 08:12:12", | ||
| 357 | }, | ||
| 358 | { | ||
| 359 | jsmc: "MYSQL8.0", | ||
| 360 | sx: "useSSL=false", | ||
| 361 | cjsj: "2022-12-12 08:12:12", | ||
| 362 | }, | ||
| 363 | ], | ||
| 364 | showPage: false, | ||
| 365 | tableTool: [], | ||
| 366 | actionInfo: { | ||
| 367 | show: false, | ||
| 368 | }, | ||
| 369 | btn: { | ||
| 370 | label: "", | ||
| 371 | value: "QuestionFilled", | ||
| 372 | }, | ||
| 373 | }, | ||
| 374 | }, | ||
| 375 | clearable: true, | ||
| 376 | required: false, | ||
| 377 | block: true, | ||
| 378 | }, | ||
| 379 | ], | ||
| 380 | rules: { | ||
| 381 | databaseNameZh: [ | ||
| 382 | { | ||
| 383 | validator: (rule: any, value: any, callback: any) => { | ||
| 384 | if (value === "") { | ||
| 385 | callback(new Error("请填写数据源名称")); | ||
| 386 | } else { | ||
| 387 | if ( | ||
| 388 | dialogInfo.value.type == "edit" && | ||
| 389 | value == currTableData.value.databaseNameZh | ||
| 390 | ) { | ||
| 391 | callback(); | ||
| 392 | return; | ||
| 393 | } | ||
| 394 | callback(); | ||
| 395 | // let params: any = { | ||
| 396 | // dataPermissionName: value, | ||
| 397 | // }; | ||
| 398 | // if (dialogInfo.value.type == 'edit') { | ||
| 399 | // params.guid = currTableData.value.guid | ||
| 400 | // } | ||
| 401 | // checkPermissionDict(params) | ||
| 402 | // .then((res: any) => { | ||
| 403 | // if (res.code == proxy.$passCode) { | ||
| 404 | // if (res.data) { | ||
| 405 | // callback(new Error("该名称已存在,请填写其他名称")); | ||
| 406 | // } else { | ||
| 407 | // callback(); | ||
| 408 | // } | ||
| 409 | // } else { | ||
| 410 | // callback(new Error(res.msg)); | ||
| 411 | // } | ||
| 412 | // }) | ||
| 413 | // .catch((xhr) => { | ||
| 414 | // callback(new Error(xhr.msg)); | ||
| 415 | // }); | ||
| 416 | } | ||
| 417 | }, | ||
| 418 | trigger: "blur", | ||
| 419 | }, | ||
| 420 | ], | ||
| 421 | bizSystem: [{ | ||
| 422 | required: true, | ||
| 423 | message: "请选择业务系统", | ||
| 424 | trigger: "change", | ||
| 425 | }], | ||
| 426 | systemLayer: [ | ||
| 427 | { | ||
| 428 | required: true, | ||
| 429 | message: "请选择系统分层", | ||
| 430 | trigger: "change", | ||
| 431 | }, | ||
| 432 | ], | ||
| 433 | databaseType: [ | ||
| 434 | { | ||
| 435 | required: true, | ||
| 436 | message: "请选择库类型", | ||
| 437 | trigger: "change", | ||
| 438 | }, | ||
| 439 | ], | ||
| 440 | host: [ | ||
| 441 | { | ||
| 442 | required: true, | ||
| 443 | message: "请填写服务器ip地址", | ||
| 444 | trigger: "blur", | ||
| 445 | }, | ||
| 446 | ], | ||
| 447 | port: [ | ||
| 448 | { | ||
| 449 | required: true, | ||
| 450 | message: "请填写端口号", | ||
| 451 | trigger: "blur", | ||
| 452 | }, | ||
| 453 | ], | ||
| 454 | logonUser: [ | ||
| 455 | { | ||
| 456 | required: true, | ||
| 457 | message: "请填写用户名", | ||
| 458 | trigger: "blur", | ||
| 459 | }, | ||
| 460 | ], | ||
| 461 | password: [ | ||
| 462 | { | ||
| 463 | required: true, | ||
| 464 | message: "请填写密码", | ||
| 465 | trigger: "blur", | ||
| 466 | }, | ||
| 467 | ], | ||
| 468 | databaseNameEn: [ | ||
| 469 | { | ||
| 470 | required: true, | ||
| 471 | message: "请填写数据库名", | ||
| 472 | trigger: "blur", | ||
| 473 | }, | ||
| 474 | ], | ||
| 475 | feLoadUrl: [ | ||
| 476 | { | ||
| 477 | validator: (rule: any, value: any, callback: any) => { | ||
| 478 | if (value === "") { | ||
| 479 | callback(new Error("请填写feLoadUrl")); | ||
| 480 | } else { | ||
| 481 | if ( | ||
| 482 | dialogInfo.value.type == "edit" && | ||
| 483 | value == currTableData.value.feLoadUrl | ||
| 484 | ) { | ||
| 485 | callback(); | ||
| 486 | return; | ||
| 487 | } | ||
| 488 | callback(); | ||
| 489 | } | ||
| 490 | }, | ||
| 491 | trigger: "blur", | ||
| 492 | }, | ||
| 493 | ], | ||
| 494 | beLoadUrl: [ | ||
| 495 | { | ||
| 496 | validator: (rule: any, value: any, callback: any) => { | ||
| 497 | if (value === "") { | ||
| 498 | callback(new Error("请填写beLoadUrl")); | ||
| 499 | } else { | ||
| 500 | if ( | ||
| 501 | dialogInfo.value.type == "edit" && | ||
| 502 | value == currTableData.value.beLoadUrl | ||
| 503 | ) { | ||
| 504 | callback(); | ||
| 505 | return; | ||
| 506 | } | ||
| 507 | callback(); | ||
| 508 | } | ||
| 509 | }, | ||
| 510 | trigger: "blur", | ||
| 511 | }, | ||
| 512 | ], | ||
| 513 | dorisJdbcUrl: [ | ||
| 514 | { | ||
| 515 | validator: (rule: any, value: any, callback: any) => { | ||
| 516 | if (value === "") { | ||
| 517 | callback(new Error("请填写dorisJdbcUrl")); | ||
| 518 | } else { | ||
| 519 | if ( | ||
| 520 | dialogInfo.value.type == "edit" && | ||
| 521 | value == currTableData.value.dorisJdbcUrl | ||
| 522 | ) { | ||
| 523 | callback(); | ||
| 524 | return; | ||
| 525 | } | ||
| 526 | callback(); | ||
| 527 | } | ||
| 528 | }, | ||
| 529 | trigger: "blur", | ||
| 530 | }, | ||
| 531 | ], | ||
| 532 | }, | ||
| 533 | }, | ||
| 534 | ssl: { | ||
| 535 | items: [ | ||
| 536 | { | ||
| 537 | label: "", | ||
| 538 | type: "checkbox", | ||
| 539 | col: "margin_b_0", | ||
| 540 | placeholder: "使用SSL", | ||
| 541 | field: "useSsl", | ||
| 542 | required: false, | ||
| 543 | block: true, | ||
| 544 | }, | ||
| 545 | { | ||
| 546 | label: "", | ||
| 547 | type: "checkbox-panel", | ||
| 548 | placeholder: "使用验证", | ||
| 549 | field: "yz", | ||
| 550 | children: [ | ||
| 551 | { | ||
| 552 | label: "客户端秘钥", | ||
| 553 | type: "file-upload", | ||
| 554 | placeholder: "选择文件上传", | ||
| 555 | field: "khdmy", | ||
| 556 | disabled: true, | ||
| 557 | required: true, | ||
| 558 | block: true, | ||
| 559 | }, | ||
| 560 | { | ||
| 561 | label: "客户端证书", | ||
| 562 | type: "file-upload", | ||
| 563 | placeholder: "选择文件上传", | ||
| 564 | field: "khdzs", | ||
| 565 | disabled: true, | ||
| 566 | required: true, | ||
| 567 | block: true, | ||
| 568 | }, | ||
| 569 | { | ||
| 570 | label: "CA证书", | ||
| 571 | type: "file-upload", | ||
| 572 | placeholder: "选择文件上传", | ||
| 573 | field: "cazs", | ||
| 574 | disabled: true, | ||
| 575 | required: true, | ||
| 576 | block: true, | ||
| 577 | }, | ||
| 578 | { | ||
| 579 | label: "指定密码检索表", | ||
| 580 | type: "append-empty", | ||
| 581 | placeholder: "请输入", | ||
| 582 | field: "khdzs", | ||
| 583 | disabled: true, | ||
| 584 | required: true, | ||
| 585 | block: true, | ||
| 586 | }, | ||
| 587 | ], | ||
| 588 | required: false, | ||
| 589 | block: true, | ||
| 590 | }, | ||
| 591 | ], | ||
| 592 | rules: {}, | ||
| 593 | }, | ||
| 594 | ssh: { | ||
| 595 | items: [ | ||
| 596 | { | ||
| 597 | label: "", | ||
| 598 | type: "checkbox-panel", | ||
| 599 | placeholder: "使用SSH", | ||
| 600 | field: "yz", | ||
| 601 | children: [ | ||
| 602 | { | ||
| 603 | label: "主机名或IP地址", | ||
| 604 | type: "input", | ||
| 605 | placeholder: "请输入", | ||
| 606 | field: "khdmy", | ||
| 607 | required: false, | ||
| 608 | disabled: true, | ||
| 609 | }, | ||
| 610 | { | ||
| 611 | label: "端口", | ||
| 612 | type: "input", | ||
| 613 | placeholder: "请输入", | ||
| 614 | field: "khdzs", | ||
| 615 | required: false, | ||
| 616 | disabled: true, | ||
| 617 | }, | ||
| 618 | { | ||
| 619 | label: "用户名", | ||
| 620 | type: "input", | ||
| 621 | placeholder: "请输入", | ||
| 622 | field: "cazs", | ||
| 623 | required: false, | ||
| 624 | disabled: true, | ||
| 625 | }, | ||
| 626 | { | ||
| 627 | label: "验证方法", | ||
| 628 | type: "select", | ||
| 629 | placeholder: "请选择", | ||
| 630 | field: "yzfs", | ||
| 631 | options: [ | ||
| 632 | { label: "密码", value: "pwd" }, | ||
| 633 | { label: "手机号", value: "tel" }, | ||
| 634 | ], | ||
| 635 | required: false, | ||
| 636 | disabled: true, | ||
| 637 | }, | ||
| 638 | { | ||
| 639 | label: "密码", | ||
| 640 | type: "input", | ||
| 641 | placeholder: "请输入", | ||
| 642 | field: "pwd", | ||
| 643 | required: false, | ||
| 644 | disabled: true, | ||
| 645 | }, | ||
| 646 | { | ||
| 647 | label: "", | ||
| 648 | type: "checkbox", | ||
| 649 | placeholder: "保存密码", | ||
| 650 | field: "savePwd", | ||
| 651 | required: false, | ||
| 652 | }, | ||
| 653 | ], | ||
| 654 | required: false, | ||
| 655 | block: true, | ||
| 656 | }, | ||
| 657 | ], | ||
| 658 | rules: {}, | ||
| 659 | }, | ||
| 660 | http: { | ||
| 661 | items: [ | ||
| 662 | { | ||
| 663 | label: "", | ||
| 664 | type: "checkbox-input", | ||
| 665 | placeholder: "使用HTTP通道", | ||
| 666 | field: "tddz", | ||
| 667 | children: [ | ||
| 668 | { | ||
| 669 | label: "", | ||
| 670 | type: "input", | ||
| 671 | placeholder: "通道地址", | ||
| 672 | field: "khdmy", | ||
| 673 | required: false, | ||
| 674 | disabled: true, | ||
| 675 | }, | ||
| 676 | ], | ||
| 677 | block: true, | ||
| 678 | }, | ||
| 679 | { | ||
| 680 | label: "", | ||
| 681 | type: "tabs-panel-card", | ||
| 682 | placeholder: "用base64编码传出查询", | ||
| 683 | field: "basebm", | ||
| 684 | tabsInfo: { | ||
| 685 | type: "card", | ||
| 686 | activeName: "yz", | ||
| 687 | col: "border", | ||
| 688 | tabs: [ | ||
| 689 | { | ||
| 690 | label: "验证", | ||
| 691 | name: "yz", | ||
| 692 | pane: { | ||
| 693 | type: "form", | ||
| 694 | title: "", | ||
| 695 | formInfo: { | ||
| 696 | id: "", | ||
| 697 | items: [ | ||
| 698 | { | ||
| 699 | label: "", | ||
| 700 | type: "checkbox-panel", | ||
| 701 | col: "margin_b_0 border_none col_3", | ||
| 702 | placeholder: "使用密码验证", | ||
| 703 | field: "mmyz", | ||
| 704 | children: [ | ||
| 705 | { | ||
| 706 | label: "", | ||
| 707 | type: "input", | ||
| 708 | placeholder: "用户名", | ||
| 709 | field: "cazs", | ||
| 710 | required: false, | ||
| 711 | disabled: true, | ||
| 712 | }, | ||
| 713 | { | ||
| 714 | label: "", | ||
| 715 | type: "input", | ||
| 716 | placeholder: "密码", | ||
| 717 | field: "pwd", | ||
| 718 | required: false, | ||
| 719 | disabled: true, | ||
| 720 | }, | ||
| 721 | { | ||
| 722 | label: "", | ||
| 723 | type: "checkbox", | ||
| 724 | placeholder: "保存密码", | ||
| 725 | field: "savePwd", | ||
| 726 | required: false, | ||
| 727 | }, | ||
| 728 | ], | ||
| 729 | required: false, | ||
| 730 | block: true, | ||
| 731 | }, | ||
| 732 | { | ||
| 733 | label: "", | ||
| 734 | type: "checkbox-panel", | ||
| 735 | col: "border_none", | ||
| 736 | placeholder: "使用证书验证", | ||
| 737 | field: "zsyz", | ||
| 738 | children: [ | ||
| 739 | { | ||
| 740 | label: "客户端秘钥", | ||
| 741 | type: "file-upload", | ||
| 742 | placeholder: "选择文件上传", | ||
| 743 | field: "khdmy", | ||
| 744 | disabled: true, | ||
| 745 | required: true, | ||
| 746 | block: true, | ||
| 747 | }, | ||
| 748 | { | ||
| 749 | label: "客户端证书", | ||
| 750 | type: "file-upload", | ||
| 751 | placeholder: "选择文件上传", | ||
| 752 | field: "khdzs", | ||
| 753 | disabled: true, | ||
| 754 | required: true, | ||
| 755 | block: true, | ||
| 756 | }, | ||
| 757 | { | ||
| 758 | label: "CA证书", | ||
| 759 | type: "file-upload", | ||
| 760 | placeholder: "选择文件上传", | ||
| 761 | field: "cazs", | ||
| 762 | disabled: true, | ||
| 763 | required: true, | ||
| 764 | block: true, | ||
| 765 | }, | ||
| 766 | { | ||
| 767 | label: "密码短语", | ||
| 768 | type: "append-empty", | ||
| 769 | placeholder: "请输入", | ||
| 770 | field: "khdzs", | ||
| 771 | disabled: true, | ||
| 772 | required: true, | ||
| 773 | block: true, | ||
| 774 | }, | ||
| 775 | ], | ||
| 776 | required: false, | ||
| 777 | block: true, | ||
| 778 | }, | ||
| 779 | ], | ||
| 780 | }, | ||
| 781 | }, | ||
| 782 | }, | ||
| 783 | { | ||
| 784 | label: "代理服务器", | ||
| 785 | name: "dl", | ||
| 786 | pane: { | ||
| 787 | type: "form", | ||
| 788 | title: "", | ||
| 789 | formInfo: { | ||
| 790 | id: "", | ||
| 791 | items: [ | ||
| 792 | { | ||
| 793 | label: "", | ||
| 794 | type: "checkbox-panel", | ||
| 795 | col: "border_none", | ||
| 796 | placeholder: "使用代理服务器", | ||
| 797 | field: "yz", | ||
| 798 | children: [ | ||
| 799 | { | ||
| 800 | label: "主机名或IP地址", | ||
| 801 | type: "input", | ||
| 802 | placeholder: "请输入", | ||
| 803 | field: "khdmy", | ||
| 804 | required: false, | ||
| 805 | disabled: true, | ||
| 806 | }, | ||
| 807 | { | ||
| 808 | label: "端口", | ||
| 809 | type: "input", | ||
| 810 | placeholder: "请输入", | ||
| 811 | field: "khdzs", | ||
| 812 | required: false, | ||
| 813 | disabled: true, | ||
| 814 | }, | ||
| 815 | { | ||
| 816 | label: "用户名", | ||
| 817 | type: "input", | ||
| 818 | placeholder: "请输入", | ||
| 819 | field: "cazs", | ||
| 820 | required: false, | ||
| 821 | disabled: true, | ||
| 822 | }, | ||
| 823 | { | ||
| 824 | label: "验证方法", | ||
| 825 | type: "select", | ||
| 826 | placeholder: "请选择", | ||
| 827 | field: "yzfs", | ||
| 828 | options: [ | ||
| 829 | { label: "密码", value: "pwd" }, | ||
| 830 | { label: "手机号", value: "tel" }, | ||
| 831 | ], | ||
| 832 | required: false, | ||
| 833 | disabled: true, | ||
| 834 | }, | ||
| 835 | { | ||
| 836 | label: "密码", | ||
| 837 | type: "input", | ||
| 838 | placeholder: "请输入", | ||
| 839 | field: "pwd", | ||
| 840 | required: false, | ||
| 841 | disabled: true, | ||
| 842 | }, | ||
| 843 | { | ||
| 844 | label: "", | ||
| 845 | type: "checkbox", | ||
| 846 | placeholder: "保存密码", | ||
| 847 | field: "savePwd", | ||
| 848 | required: false, | ||
| 849 | }, | ||
| 850 | ], | ||
| 851 | required: false, | ||
| 852 | block: true, | ||
| 853 | }, | ||
| 854 | ], | ||
| 855 | }, | ||
| 856 | }, | ||
| 857 | }, | ||
| 858 | ], | ||
| 859 | }, | ||
| 860 | children: [ | ||
| 861 | { | ||
| 862 | label: "主机名或IP地址", | ||
| 863 | type: "input", | ||
| 864 | placeholder: "请输入", | ||
| 865 | field: "khdmy", | ||
| 866 | required: false, | ||
| 867 | }, | ||
| 868 | { | ||
| 869 | label: "端口", | ||
| 870 | type: "input", | ||
| 871 | placeholder: "请输入", | ||
| 872 | field: "khdzs", | ||
| 873 | required: false, | ||
| 874 | }, | ||
| 875 | { | ||
| 876 | label: "用户名", | ||
| 877 | type: "input", | ||
| 878 | placeholder: "请输入", | ||
| 879 | field: "cazs", | ||
| 880 | required: false, | ||
| 881 | }, | ||
| 882 | { | ||
| 883 | label: "验证方法", | ||
| 884 | type: "select", | ||
| 885 | placeholder: "请选择", | ||
| 886 | field: "yzfs", | ||
| 887 | default: "pwd", | ||
| 888 | options: [ | ||
| 889 | { label: "密码", value: "pwd" }, | ||
| 890 | { label: "手机号", value: "tel" }, | ||
| 891 | ], | ||
| 892 | required: false, | ||
| 893 | }, | ||
| 894 | { | ||
| 895 | label: "密码", | ||
| 896 | type: "input", | ||
| 897 | placeholder: "请输入", | ||
| 898 | field: "pwd", | ||
| 899 | required: false, | ||
| 900 | }, | ||
| 901 | { | ||
| 902 | label: "", | ||
| 903 | type: "checkbox", | ||
| 904 | placeholder: "保存密码", | ||
| 905 | field: "savePwd", | ||
| 906 | required: false, | ||
| 907 | }, | ||
| 908 | ], | ||
| 909 | required: false, | ||
| 910 | block: true, | ||
| 911 | }, | ||
| 912 | ], | ||
| 913 | rules: {}, | ||
| 914 | }, | ||
| 915 | }); | ||
| 916 | |||
| 917 | const dialogRef = ref(); | ||
| 918 | const dialogInfo = ref({ | ||
| 919 | visible: false, | ||
| 920 | size: 700, | ||
| 921 | direction: "column", | ||
| 922 | height: '440px', | ||
| 923 | header: { | ||
| 924 | title: "", | ||
| 925 | }, | ||
| 926 | type: "", | ||
| 927 | readonly: false, | ||
| 928 | contents: [], | ||
| 929 | footer: { | ||
| 930 | btns: [ | ||
| 931 | { type: "default", label: "取消", value: "cancel" }, | ||
| 932 | { type: "primary", label: "确定", value: "submit" }, | ||
| 933 | ], | ||
| 934 | textBtns: [{ type: "primary", label: "连通测试", value: "connect" }], | ||
| 935 | }, | ||
| 936 | }); | ||
| 937 | |||
| 938 | const setFormItems = (name, info: any = null) => { | ||
| 939 | let contentFormInfo: any = {}; | ||
| 940 | if (name == "常规") { | ||
| 941 | tabActiveName.value = "1"; | ||
| 942 | contentFormInfo = contents.value["normal"]; | ||
| 943 | } else if (name == "SSL") { | ||
| 944 | tabActiveName.value = "2"; | ||
| 945 | contentFormInfo = contents.value["ssl"]; | ||
| 946 | } else if (name == "SSH") { | ||
| 947 | tabActiveName.value = "3"; | ||
| 948 | contentFormInfo = contents.value["ssh"]; | ||
| 949 | } else if (name == "HTTP") { | ||
| 950 | tabActiveName.value = "4"; | ||
| 951 | contentFormInfo = contents.value["http"]; | ||
| 952 | } | ||
| 953 | |||
| 954 | tabsInfo.value.tabsInfo.activeName = name; | ||
| 955 | formItems.value = contentFormInfo.items; | ||
| 956 | formRules.value = contentFormInfo.rules; | ||
| 957 | |||
| 958 | if (info !== null) { | ||
| 959 | const type = dialogInfo.value.type; | ||
| 960 | formItems.value.map((item) => { | ||
| 961 | if ( | ||
| 962 | item.field == "host" || | ||
| 963 | item.field == "port" || | ||
| 964 | item.field == "logonUser" || | ||
| 965 | item.field == "password" | ||
| 966 | ) { | ||
| 967 | if (type == "edit" || type == "detail") { | ||
| 968 | item.default = info?.[item.field] ?? ""; | ||
| 969 | } else { | ||
| 970 | item.default = info[item.field] ?? ""; | ||
| 971 | } | ||
| 972 | if (item.field == "logonUser" || item.field == "password") { | ||
| 973 | item.autocompleteSetting.readonly = true; | ||
| 974 | } | ||
| 975 | } else if (item.field == "jqxx") { | ||
| 976 | item.visible = info.databaseType == "doris"; | ||
| 977 | item.children.map((child) => { | ||
| 978 | if (type == 'edit' || type == 'detail') { | ||
| 979 | child.default = info?.[child.field] ?? ""; | ||
| 980 | } else { | ||
| 981 | child.default = info[child.field] ?? ""; | ||
| 982 | } | ||
| 983 | }); | ||
| 984 | } else if (item.field == 'bizSystem') { | ||
| 985 | item.visible = info.systemLayer == '业务系统'; | ||
| 986 | item.default = info[item.field] || ""; | ||
| 987 | } | ||
| 988 | else { | ||
| 989 | item.default = info[item.field] || ""; | ||
| 990 | } | ||
| 991 | }); | ||
| 992 | } else { | ||
| 993 | formItems.value.map((item) => { | ||
| 994 | if (item.field == "logonUser" || item.field == "password") { | ||
| 995 | item.autocompleteSetting.readonly = true; | ||
| 996 | } | ||
| 997 | }); | ||
| 998 | } | ||
| 999 | |||
| 1000 | formInfo.value.formInfo.items = formItems.value; | ||
| 1001 | formInfo.value.formInfo.rules = formRules.value; | ||
| 1002 | |||
| 1003 | const content: any = [tabsInfo.value, formInfo.value]; | ||
| 1004 | dialogInfo.value.contents = content; | ||
| 1005 | }; | ||
| 1006 | |||
| 1007 | const getFirstPageData = () => { | ||
| 1008 | page.value.curr = 1; | ||
| 1009 | getTableData(); | ||
| 1010 | }; | ||
| 1011 | onMounted(() => { | ||
| 1012 | getAllFlowData({ dictType: "业务系统" }).then((res) => { | ||
| 1013 | flowList.value = res.data | ||
| 1014 | contents.value.normal.items[3].options = flowList.value | ||
| 1015 | }) | ||
| 1016 | }) | ||
| 1017 | const toSearch = (val: any, clear: boolean = false) => { | ||
| 1018 | if (clear) { | ||
| 1019 | searchItemList.value.map((item) => (item.default = "")); | ||
| 1020 | page.value.systemLayer = ""; | ||
| 1021 | page.value.databaseType = ""; | ||
| 1022 | page.value.connectStatus = ""; | ||
| 1023 | page.value.databaseNameZh = ""; | ||
| 1024 | page.value.databaseNameEn = ""; | ||
| 1025 | } else { | ||
| 1026 | page.value.systemLayer = val.systemLayer; | ||
| 1027 | page.value.databaseType = val.databaseType; | ||
| 1028 | page.value.connectStatus = val.connectStatus; | ||
| 1029 | page.value.databaseNameZh = val.databaseNameZh; | ||
| 1030 | page.value.databaseNameEn = val.databaseNameEn; | ||
| 1031 | } | ||
| 1032 | getTableData(); | ||
| 1033 | }; | ||
| 1034 | |||
| 1035 | const getTableData = () => { | ||
| 1036 | tableInfo.value.loading = true; | ||
| 1037 | getDataSourceList({ | ||
| 1038 | pageIndex: page.value.curr, | ||
| 1039 | pageSize: page.value.limit, | ||
| 1040 | systemLayer: page.value.systemLayer, | ||
| 1041 | databaseType: page.value.databaseType, | ||
| 1042 | connectStatus: page.value.connectStatus, | ||
| 1043 | databaseNameZh: page.value.databaseNameZh, | ||
| 1044 | databaseNameEn: page.value.databaseNameEn | ||
| 1045 | }) | ||
| 1046 | .then((res: any) => { | ||
| 1047 | if (res.code == proxy.$passCode) { | ||
| 1048 | const data = res.data || {}; | ||
| 1049 | tableInfo.value.data = data.records || []; | ||
| 1050 | tableInfo.value.page.limit = data.pageSize; | ||
| 1051 | tableInfo.value.page.curr = data.pageIndex; | ||
| 1052 | tableInfo.value.page.rows = data.totalRows; | ||
| 1053 | } else { | ||
| 1054 | ElMessage({ | ||
| 1055 | type: "error", | ||
| 1056 | message: res.msg, | ||
| 1057 | }); | ||
| 1058 | } | ||
| 1059 | tableInfo.value.loading = false; | ||
| 1060 | }) | ||
| 1061 | .catch((xhr) => { | ||
| 1062 | tableInfo.value.loading = false; | ||
| 1063 | }); | ||
| 1064 | }; | ||
| 1065 | |||
| 1066 | const tableSelectionChange = (val) => { | ||
| 1067 | selectRowData.value = val.map((item) => item.guid); | ||
| 1068 | }; | ||
| 1069 | |||
| 1070 | const tablePageChange = (info) => { | ||
| 1071 | page.value.curr = Number(info.curr); | ||
| 1072 | page.value.limit = Number(info.limit); | ||
| 1073 | getTableData(); | ||
| 1074 | }; | ||
| 1075 | |||
| 1076 | const tabChange = (tabName) => { | ||
| 1077 | // TODO.等添加了tab切换之后再保留旧值. | ||
| 1078 | setFormItems(tabName); | ||
| 1079 | }; | ||
| 1080 | |||
| 1081 | /** 表单修改时的原始值 */ | ||
| 1082 | const originValue: any = ref({}); | ||
| 1083 | |||
| 1084 | const formSelectChange = (val, row, info) => { | ||
| 1085 | console.log(row, info) | ||
| 1086 | if (row.field == "databaseType" || row.field == 'systemLayer') { | ||
| 1087 | if (tabsInfo.value.tabsInfo.activeName == "常规") { | ||
| 1088 | let newInfo = originValue.value = Object.assign(originValue.value, info); | ||
| 1089 | setFormItems("常规", newInfo); | ||
| 1090 | } | ||
| 1091 | } | ||
| 1092 | }; | ||
| 1093 | |||
| 1094 | const tableBtnClick = (scope, btn) => { | ||
| 1095 | const type = btn.value; | ||
| 1096 | const row = scope.row; | ||
| 1097 | currTableData.value = row; | ||
| 1098 | if (type == "edit") { | ||
| 1099 | dialogInfo.value.type = type; | ||
| 1100 | dialogInfo.value.header.title = "编辑数据源"; | ||
| 1101 | const guid = row.guid; | ||
| 1102 | getDataSourceDetail(guid).then((res: any) => { | ||
| 1103 | if (res.code == proxy.$passCode && res.data) { | ||
| 1104 | const data = res.data; | ||
| 1105 | currTableData.value = data; | ||
| 1106 | setDetailInfo(); | ||
| 1107 | } else { | ||
| 1108 | ElMessage({ | ||
| 1109 | type: "error", | ||
| 1110 | message: res.msg, | ||
| 1111 | }); | ||
| 1112 | } | ||
| 1113 | }); | ||
| 1114 | } else if (type == "test") { | ||
| 1115 | checkConnect({}); | ||
| 1116 | } else if (type == "delete") { | ||
| 1117 | open("此操作将永久删除, 是否继续?", "warning"); | ||
| 1118 | } | ||
| 1119 | }; | ||
| 1120 | |||
| 1121 | const open = (msg, type, isBatch = false) => { | ||
| 1122 | ElMessageBox.confirm(msg, "提示", { | ||
| 1123 | confirmButtonText: "确定", | ||
| 1124 | cancelButtonText: "取消", | ||
| 1125 | type: type, | ||
| 1126 | }).then(() => { | ||
| 1127 | let guids = [currTableData.value.guid]; | ||
| 1128 | if (isBatch) { | ||
| 1129 | guids = selectRowData.value; | ||
| 1130 | } | ||
| 1131 | deleteDataSource(guids).then((res: any) => { | ||
| 1132 | if (res.code == proxy.$passCode) { | ||
| 1133 | getTableData(); | ||
| 1134 | ElMessage({ | ||
| 1135 | type: "success", | ||
| 1136 | message: "删除成功", | ||
| 1137 | }); | ||
| 1138 | } else { | ||
| 1139 | ElMessage({ | ||
| 1140 | type: "error", | ||
| 1141 | message: res.msg, | ||
| 1142 | }); | ||
| 1143 | } | ||
| 1144 | }); | ||
| 1145 | }); | ||
| 1146 | }; | ||
| 1147 | |||
| 1148 | const setDetailInfo = async () => { | ||
| 1149 | let info = Object.assign({}, currTableData.value, currTableData.value.dataConfigure || {}); | ||
| 1150 | let newInfo = originValue.value = Object.assign(originValue.value, info); | ||
| 1151 | setFormItems("常规", newInfo); | ||
| 1152 | dialogInfo.value.visible = true; | ||
| 1153 | }; | ||
| 1154 | |||
| 1155 | const checkConnect = (val) => { | ||
| 1156 | let params = { guid: currTableData.value.guid }; | ||
| 1157 | checkDataSourceConnect(params).then((res: any) => { | ||
| 1158 | if (res.code == proxy.$passCode && res.data && res.data == "1") { | ||
| 1159 | getTableData(); | ||
| 1160 | ElMessage({ | ||
| 1161 | type: "success", | ||
| 1162 | message: "连通成功", | ||
| 1163 | }); | ||
| 1164 | } else { | ||
| 1165 | getTableData(); | ||
| 1166 | ElMessage({ | ||
| 1167 | type: "error", | ||
| 1168 | message: "连通失败", | ||
| 1169 | }); | ||
| 1170 | } | ||
| 1171 | }); | ||
| 1172 | }; | ||
| 1173 | |||
| 1174 | const loadDialog = async () => { | ||
| 1175 | dialogInfo.value.type = "add"; | ||
| 1176 | dialogInfo.value.header.title = "添加数据源"; | ||
| 1177 | originValue.value = {}; | ||
| 1178 | setFormItems("常规", {}); | ||
| 1179 | dialogInfo.value.visible = true; | ||
| 1180 | }; | ||
| 1181 | |||
| 1182 | const batching = (type) => { | ||
| 1183 | if (type == "delete") { | ||
| 1184 | if (selectRowData.value.length == 0) { | ||
| 1185 | ElMessage({ | ||
| 1186 | type: "error", | ||
| 1187 | message: "请选择需要删除的数据", | ||
| 1188 | }); | ||
| 1189 | return; | ||
| 1190 | } | ||
| 1191 | open("此操作将永久删除, 是否继续?", "warning", true); | ||
| 1192 | } | ||
| 1193 | }; | ||
| 1194 | |||
| 1195 | const dialogBtnClick = (btn, info) => { | ||
| 1196 | if (btn.value == "submit") { | ||
| 1197 | // dialogInfo.value.footer.btns.map((item: any) => item.disabled = true) | ||
| 1198 | const params = { ...info }; | ||
| 1199 | delete params.host; | ||
| 1200 | delete params.port; | ||
| 1201 | delete params.logonUser; | ||
| 1202 | delete params.password; | ||
| 1203 | delete params.feLoadUrl; | ||
| 1204 | delete params.beLoadUrl; | ||
| 1205 | delete params.dorisJdbcUrl; | ||
| 1206 | params.dataConnectionContract = tabActiveName.value; | ||
| 1207 | if (dialogInfo.value.type == "add") { | ||
| 1208 | params.dataConfigureAddDTO = { | ||
| 1209 | host: info.host, | ||
| 1210 | port: info.port, | ||
| 1211 | logonUser: info.logonUser, | ||
| 1212 | password: info.password, | ||
| 1213 | feLoadUrl: info.feLoadUrl, | ||
| 1214 | beLoadUrl: info.beLoadUrl, | ||
| 1215 | dorisJdbcUrl: info.dorisJdbcUrl | ||
| 1216 | }; | ||
| 1217 | addDataSource(params) | ||
| 1218 | .then((res: any) => { | ||
| 1219 | if (res.code == proxy.$passCode) { | ||
| 1220 | getFirstPageData(); | ||
| 1221 | ElMessage({ | ||
| 1222 | type: "success", | ||
| 1223 | message: "添加数据源成功", | ||
| 1224 | }); | ||
| 1225 | dialogInfo.value.visible = false; | ||
| 1226 | } else { | ||
| 1227 | ElMessage({ | ||
| 1228 | type: "error", | ||
| 1229 | message: res.msg, | ||
| 1230 | }); | ||
| 1231 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) | ||
| 1232 | } | ||
| 1233 | }) | ||
| 1234 | .catch(() => { | ||
| 1235 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) | ||
| 1236 | }); | ||
| 1237 | } else { | ||
| 1238 | params.dataConfigureUpdateDTO = { | ||
| 1239 | guid: currTableData.value.dataConfigure.guid, | ||
| 1240 | host: info.host, | ||
| 1241 | port: info.port, | ||
| 1242 | logonUser: info.logonUser, | ||
| 1243 | password: | ||
| 1244 | info.password == "******" | ||
| 1245 | ? currTableData.value.dataConfigure.password | ||
| 1246 | : info.password, | ||
| 1247 | feLoadUrl: info.feLoadUrl, | ||
| 1248 | beLoadUrl: info.beLoadUrl, | ||
| 1249 | dorisJdbcUrl: info.dorisJdbcUrl | ||
| 1250 | }; | ||
| 1251 | params.guid = currTableData.value.guid; | ||
| 1252 | updateDataSource(params) | ||
| 1253 | .then((res: any) => { | ||
| 1254 | if (res.code == proxy.$passCode) { | ||
| 1255 | getTableData(); | ||
| 1256 | ElMessage({ | ||
| 1257 | type: "success", | ||
| 1258 | message: "修改数据源成功", | ||
| 1259 | }); | ||
| 1260 | dialogInfo.value.visible = false; | ||
| 1261 | } else { | ||
| 1262 | ElMessage({ | ||
| 1263 | type: "error", | ||
| 1264 | message: res.msg, | ||
| 1265 | }); | ||
| 1266 | } | ||
| 1267 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) | ||
| 1268 | }) | ||
| 1269 | .catch(() => { | ||
| 1270 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) | ||
| 1271 | }); | ||
| 1272 | } | ||
| 1273 | } else if (btn.value == "connect") { | ||
| 1274 | const params = { | ||
| 1275 | databaseType: info.databaseType, | ||
| 1276 | databaseNameEn: info.databaseNameEn, | ||
| 1277 | host: info.host, | ||
| 1278 | port: info.port, | ||
| 1279 | logonUser: info.logonUser, | ||
| 1280 | password: info.password, | ||
| 1281 | linkage: info.linkage, | ||
| 1282 | }; | ||
| 1283 | checkDataSourceConnectTest(params).then((res: any) => { | ||
| 1284 | if (res.code == proxy.$passCode) { | ||
| 1285 | if (res.data && res.data == "1") { | ||
| 1286 | ElMessage({ | ||
| 1287 | type: "success", | ||
| 1288 | message: "连通成功", | ||
| 1289 | }); | ||
| 1290 | } else { | ||
| 1291 | ElMessage({ | ||
| 1292 | type: "error", | ||
| 1293 | message: "连通失败", | ||
| 1294 | }); | ||
| 1295 | } | ||
| 1296 | } else { | ||
| 1297 | ElMessage({ | ||
| 1298 | type: "error", | ||
| 1299 | message: res.msg, | ||
| 1300 | }); | ||
| 1301 | } | ||
| 1302 | }); | ||
| 1303 | } else if (btn.value == "cancel") { | ||
| 1304 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) | ||
| 1305 | nextTick(() => { | ||
| 1306 | dialogInfo.value.visible = false; | ||
| 1307 | }); | ||
| 1308 | } | ||
| 1309 | }; | ||
| 1310 | </script> | ||
| 1311 | |||
| 1312 | <template> | ||
| 1313 | <div class="container_wrap"> | ||
| 1314 | <div class="table_tool_wrap has_search"> | ||
| 1315 | <TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" /> | ||
| 1316 | <div class="tools_btns"> | ||
| 1317 | <el-button type="primary" @click="loadDialog" v-preReClick>新建</el-button> | ||
| 1318 | <el-button @click="batching('delete')" v-preReClick>批量删除</el-button> | ||
| 1319 | </div> | ||
| 1320 | </div> | ||
| 1321 | <div class="table_panel_wrap"> | ||
| 1322 | <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" | ||
| 1323 | @tableSelectionChange="tableSelectionChange" /> | ||
| 1324 | </div> | ||
| 1325 | |||
| 1326 | <Dialog ref="dialogRef" :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @tableBtnClick="tableBtnClick" | ||
| 1327 | @selectChange="formSelectChange" @tabChange="tabChange" /> | ||
| 1328 | </div> | ||
| 1329 | </template> | ||
| 1330 | |||
| 1331 | <style lang="scss" scoped> | ||
| 1332 | .container_wrap { | ||
| 1333 | overflow: hidden auto; | ||
| 1334 | } | ||
| 1335 | |||
| 1336 | .table_tool_wrap { | ||
| 1337 | width: 100%; | ||
| 1338 | height: 84px !important; | ||
| 1339 | padding: 0 8px; | ||
| 1340 | |||
| 1341 | .tools_btns { | ||
| 1342 | padding: 8px 0 0; | ||
| 1343 | } | ||
| 1344 | } | ||
| 1345 | |||
| 1346 | .table_panel_wrap { | ||
| 1347 | width: 100%; | ||
| 1348 | height: calc(100% - 84px); | ||
| 1349 | padding: 8px 8px 0; | ||
| 1350 | } | ||
| 1351 | </style> |
-
Please register or sign in to post a comment