|
|
@@ -1,28 +1,51 @@
|
|
|
<template>
|
|
|
<a-card title="数据源管理" >
|
|
|
|
|
|
- <a-row>
|
|
|
- <a-col></a-col>
|
|
|
- </a-row>
|
|
|
-
|
|
|
- <a-table
|
|
|
- style="margin-top: 10px;"
|
|
|
- :columns="columns"
|
|
|
- :data-source="state.dataSource"
|
|
|
- :loading="state.loading"
|
|
|
- :pagination="queryState"
|
|
|
- @change="changePage"
|
|
|
- >
|
|
|
- <template #bodyCell="{column, record}">
|
|
|
- <template v-if="column.key === 'action'" >
|
|
|
- </template>
|
|
|
+ <!-- :server="DataSourceController.page" -->
|
|
|
+ <table-pro
|
|
|
+
|
|
|
+ :columns="columns"
|
|
|
+ ref="tableProDom"
|
|
|
+ @add="openModal"
|
|
|
+ >
|
|
|
+ <template #search >
|
|
|
+ <a-space>
|
|
|
+ <InputTsx v-model:value="serverParams.label" ></InputTsx>
|
|
|
+ <a-select style="width: 170px;" >
|
|
|
+ <a-select-option
|
|
|
+ v-for="item in DataSourceController.dataSourceType"
|
|
|
+ :key="item"
|
|
|
+ :value="item"
|
|
|
+ >
|
|
|
+ {{item}}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <a-button type="primary" @click="search" >搜索</a-button>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
+ <template #render="{column, record}" >
|
|
|
+ <template v-if="column.key === 'action'" >
|
|
|
+ </template>
|
|
|
</template>
|
|
|
- </a-table>
|
|
|
+ </table-pro>
|
|
|
</a-card>
|
|
|
+
|
|
|
+<RealView
|
|
|
+ :open="visible"
|
|
|
+ @cancel="visible = false"
|
|
|
+ tab-key="base"
|
|
|
+ :tabs-list="[{ key: 'base', tab: '基础信息' },]"
|
|
|
+ @ok="submit"
|
|
|
+>
|
|
|
+
|
|
|
+</RealView>
|
|
|
</template>
|
|
|
<script lang='ts' setup >
|
|
|
import { DataSourceController } from '@/controller'
|
|
|
-import { reactive, onMounted } from 'vue'
|
|
|
+import { reactive, ref } from 'vue'
|
|
|
+import { InputTsx } from '@/components/MicroComponents'
|
|
|
+import { RealView } from '@/components/RealView/index'
|
|
|
+import { Form } from 'ant-design-vue'
|
|
|
|
|
|
const columns = [
|
|
|
{
|
|
|
@@ -44,32 +67,64 @@ const columns = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const queryState = reactive({
|
|
|
- page: 1,
|
|
|
- pageSize: 10,
|
|
|
- total: 0
|
|
|
+const useForm = Form.useForm
|
|
|
+
|
|
|
+const tableProDom = ref()
|
|
|
+
|
|
|
+const serverParams = ref({
|
|
|
+ label: ''
|
|
|
})
|
|
|
|
|
|
const state = reactive({
|
|
|
- loading: false,
|
|
|
- dataSource: []
|
|
|
+
|
|
|
+})
|
|
|
+
|
|
|
+const oracleConnectTypes = ['ORACLE_SERVICE_NAME', 'ORACLE_SID']
|
|
|
+
|
|
|
+const sourceState = reactive({
|
|
|
+ label: '',
|
|
|
+ description: '',
|
|
|
+ dataSourceConnectParam: {
|
|
|
+ dataSourceType: 'MYSQL',
|
|
|
+ username: '',
|
|
|
+ password: '',
|
|
|
+ address: '',
|
|
|
+ port: '',
|
|
|
+ database: '',
|
|
|
+ driverClassName: '',
|
|
|
+ validateQuery: '',
|
|
|
+ minimumIdle: 5,
|
|
|
+ maximumPoolSize: 50,
|
|
|
+ connectType: 'ORACLE_SERVICE_NAME' // ORACLE_SID
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
-const changePage = ({ current }) => {
|
|
|
- queryState.page = current
|
|
|
- getDataSource()
|
|
|
+const visible = ref<boolean>(true)
|
|
|
+
|
|
|
+const search = () => {
|
|
|
+ tableProDom.value.reload()
|
|
|
}
|
|
|
|
|
|
-const getDataSource = async () => {
|
|
|
- state.loading = true
|
|
|
- const { data } = await DataSourceController.page(queryState)
|
|
|
- state.loading = false
|
|
|
- state.dataSource = data
|
|
|
+const openModal = () => {
|
|
|
+ visible.value = true
|
|
|
}
|
|
|
|
|
|
-onMounted(() => {
|
|
|
- // getDataSource()
|
|
|
+const { resetFields, validate, validateInfos } = useForm(sourceState, {
|
|
|
+ label: [{ required: true, message: '请填写数据源名称' }],
|
|
|
+ description: [{ required: true, message: '请填写数据源描述' }],
|
|
|
+ username: [{ required: true, message: '请填写用户名' }],
|
|
|
+ password: [{ required: true, message: '请填写用户名' }],
|
|
|
+ address: [{ required: true, message: '请填写用户名' }],
|
|
|
+ port: [{ required: true, message: '请填写用户名' }],
|
|
|
+ database: [{ required: true, message: '请填写用户名' }],
|
|
|
+ driverClassName: [{ required: true, message: '请填写用户名' }],
|
|
|
+ validateQuery: [{ required: true, message: '请填写用户名' }]
|
|
|
})
|
|
|
+
|
|
|
+const submit = () => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
</script>
|
|
|
<style lang='less' scoped >
|
|
|
</style>
|