Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
69321b08
提交
69321b08
authored
6月 30, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
支持oracle
上级
99fcfe29
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
153 行增加
和
51 行删除
+153
-51
pom.xml
backend/pom.xml
+7
-0
DatasourceTypes.java
...ava/io/dataease/datasource/constants/DatasourceTypes.java
+1
-1
OracleConfigration.java
...n/java/io/dataease/datasource/dto/OracleConfigration.java
+27
-0
JdbcProvider.java
...in/java/io/dataease/datasource/provider/JdbcProvider.java
+46
-17
ProviderFactory.java
...java/io/dataease/datasource/provider/ProviderFactory.java
+4
-0
OracleDDLProvider.java
...n/java/io/dataease/provider/oracle/OracleDDLProvider.java
+26
-0
OracleQueryProvider.java
...java/io/dataease/provider/oracle/OracleQueryProvider.java
+0
-0
DataSetTableService.java
...java/io/dataease/service/dataset/DataSetTableService.java
+1
-0
ExtractDataService.java
.../java/io/dataease/service/dataset/ExtractDataService.java
+28
-8
zh.js
frontend/src/lang/zh.js
+5
-1
form.vue
frontend/src/views/system/datasource/form.vue
+8
-24
没有找到文件。
backend/pom.xml
浏览文件 @
69321b08
...
...
@@ -358,6 +358,13 @@
<artifactId>
dataease-plugin-xpack
</artifactId>
<version>
1.0
</version>
</dependency>
<dependency>
<groupId>
com.oracle.database.jdbc
</groupId>
<artifactId>
ojdbc8
</artifactId>
<version>
12.2.0.1
</version>
</dependency>
</dependencies>
<build>
...
...
backend/src/main/java/io/dataease/datasource/constants/DatasourceTypes.java
浏览文件 @
69321b08
package
io
.
dataease
.
datasource
.
constants
;
public
enum
DatasourceTypes
{
mysql
,
sqlServer
,
excel
,
doris
mysql
,
sqlServer
,
excel
,
doris
,
oracle
}
backend/src/main/java/io/dataease/datasource/dto/OracleConfigration.java
0 → 100644
浏览文件 @
69321b08
package
io
.
dataease
.
datasource
.
dto
;
import
lombok.Getter
;
import
lombok.Setter
;
@Getter
@Setter
public
class
OracleConfigration
extends
JdbcDTO
{
private
String
driver
=
"oracle.jdbc.driver.OracleDriver"
;
private
String
connectionType
;
public
String
getJdbc
()
{
// 连接参数先写死,后边要把编码、时区等参数放到数据源的设置中
if
(
getConnectionType
().
equalsIgnoreCase
(
"serviceName"
)){
return
"jdbc:oracle:thin:@HOSTNAME:PORT/DATABASE"
.
replace
(
"HOSTNAME"
,
getHost
())
.
replace
(
"PORT"
,
getPort
().
toString
())
.
replace
(
"DATABASE"
,
getDataBase
());
}
else
{
return
"jdbc:oracle:thin:@HOSTNAME:PORT:DATABASE"
.
replace
(
"HOSTNAME"
,
getHost
())
.
replace
(
"PORT"
,
getPort
().
toString
())
.
replace
(
"DATABASE"
,
getDataBase
());
}
}
}
backend/src/main/java/io/dataease/datasource/provider/JdbcProvider.java
浏览文件 @
69321b08
...
...
@@ -4,6 +4,7 @@ import com.google.gson.Gson;
import
com.mchange.v2.c3p0.ComboPooledDataSource
;
import
io.dataease.datasource.constants.DatasourceTypes
;
import
io.dataease.datasource.dto.MysqlConfigration
;
import
io.dataease.datasource.dto.OracleConfigration
;
import
io.dataease.datasource.dto.SqlServerConfigration
;
import
io.dataease.datasource.dto.TableFiled
;
import
io.dataease.datasource.request.DatasourceRequest
;
...
...
@@ -19,8 +20,8 @@ import java.util.*;
public
class
JdbcProvider
extends
DatasourceProvider
{
private
static
Map
<
String
,
ComboPooledDataSource
>
jdbcConnection
=
new
HashMap
<>();
private
static
int
initPoolSize
=
5
;
private
static
int
maxConnections
=
200
;
private
static
int
initPoolSize
=
1
;
private
static
int
maxConnections
=
1
;
@Override
public
List
<
String
[]>
getData
(
DatasourceRequest
datasourceRequest
)
throws
Exception
{
...
...
@@ -207,22 +208,16 @@ public class JdbcProvider extends DatasourceProvider {
while
(
resultSet
.
next
())
{
String
tableName
=
resultSet
.
getString
(
"TABLE_NAME"
);
String
database
=
resultSet
.
getString
(
"TABLE_CAT"
);
if
(
tableName
.
equals
(
datasourceRequest
.
getTable
())
&&
database
.
equalsIgnoreCase
(
getDatabase
(
datasourceRequest
)))
{
TableFiled
tableFiled
=
new
TableFiled
();
String
colName
=
resultSet
.
getString
(
"COLUMN_NAME"
);
tableFiled
.
setFieldName
(
colName
);
String
remarks
=
resultSet
.
getString
(
"REMARKS"
);
if
(
remarks
==
null
||
remarks
.
equals
(
""
))
{
remarks
=
colName
;
if
(
database
!=
null
){
if
(
tableName
.
equals
(
datasourceRequest
.
getTable
())
&&
database
.
equalsIgnoreCase
(
getDatabase
(
datasourceRequest
)))
{
TableFiled
tableFiled
=
getTableFiled
(
resultSet
);
list
.
add
(
tableFiled
);
}
tableFiled
.
setRemarks
(
remarks
);
tableFiled
.
setFieldSize
(
Integer
.
valueOf
(
resultSet
.
getString
(
"COLUMN_SIZE"
)));
String
dbType
=
resultSet
.
getString
(
"TYPE_NAME"
);
tableFiled
.
setFieldType
(
dbType
);
if
(
StringUtils
.
isNotEmpty
(
dbType
)
&&
dbType
.
toLowerCase
().
contains
(
"date"
)
&&
tableFiled
.
getFieldSize
()
<
50
){
tableFiled
.
setFieldSize
(
50
);
}
else
{
if
(
tableName
.
equals
(
datasourceRequest
.
getTable
()))
{
TableFiled
tableFiled
=
getTableFiled
(
resultSet
);
list
.
add
(
tableFiled
);
}
list
.
add
(
tableFiled
);
}
}
resultSet
.
close
();
...
...
@@ -238,6 +233,24 @@ public class JdbcProvider extends DatasourceProvider {
return
list
;
}
private
TableFiled
getTableFiled
(
ResultSet
resultSet
)
throws
SQLException
{
TableFiled
tableFiled
=
new
TableFiled
();
String
colName
=
resultSet
.
getString
(
"COLUMN_NAME"
);
tableFiled
.
setFieldName
(
colName
);
String
remarks
=
resultSet
.
getString
(
"REMARKS"
);
if
(
remarks
==
null
||
remarks
.
equals
(
""
))
{
remarks
=
colName
;
}
tableFiled
.
setRemarks
(
remarks
);
tableFiled
.
setFieldSize
(
Integer
.
valueOf
(
resultSet
.
getString
(
"COLUMN_SIZE"
)));
String
dbType
=
resultSet
.
getString
(
"TYPE_NAME"
);
tableFiled
.
setFieldType
(
dbType
);
if
(
StringUtils
.
isNotEmpty
(
dbType
)
&&
dbType
.
toLowerCase
().
contains
(
"date"
)
&&
tableFiled
.
getFieldSize
()
<
50
){
tableFiled
.
setFieldSize
(
50
);
}
return
tableFiled
;
}
@Override
public
void
test
(
DatasourceRequest
datasourceRequest
)
throws
Exception
{
String
queryStr
=
getTablesSql
(
datasourceRequest
);
...
...
@@ -320,7 +333,7 @@ public class JdbcProvider extends DatasourceProvider {
dataSource
.
setTestConnectionOnCheckout
(
false
);
// 在每个connection 提交是校验有效性
dataSource
.
setTestConnectionOnCheckin
(
true
);
// 取得连接的同时将校验连接的有效性
dataSource
.
setCheckoutTimeout
(
60000
);
// 从连接池获取连接的超时时间,如设为0则无限期等待。单位毫秒,默认为0
dataSource
.
setPreferredTestQuery
(
"SELECT 1"
);
//
dataSource.setPreferredTestQuery("SELECT 1");
dataSource
.
setDebugUnreturnedConnectionStackTraces
(
true
);
dataSource
.
setUnreturnedConnectionTimeout
(
3600
);
jdbcConnection
.
put
(
datasourceRequest
.
getDatasource
().
getId
(),
dataSource
);
...
...
@@ -354,6 +367,13 @@ public class JdbcProvider extends DatasourceProvider {
driver
=
sqlServerConfigration
.
getDriver
();
jdbcurl
=
sqlServerConfigration
.
getJdbc
();
break
;
case
oracle:
OracleConfigration
oracleConfigration
=
new
Gson
().
fromJson
(
datasourceRequest
.
getDatasource
().
getConfiguration
(),
OracleConfigration
.
class
);
username
=
oracleConfigration
.
getUsername
();
password
=
oracleConfigration
.
getPassword
();
driver
=
oracleConfigration
.
getDriver
();
jdbcurl
=
oracleConfigration
.
getJdbc
();
break
;
default
:
break
;
}
...
...
@@ -392,6 +412,13 @@ public class JdbcProvider extends DatasourceProvider {
dataSource
.
setPassword
(
sqlServerConfigration
.
getPassword
());
dataSource
.
setJdbcUrl
(
sqlServerConfigration
.
getJdbc
());
break
;
case
oracle:
OracleConfigration
oracleConfigration
=
new
Gson
().
fromJson
(
datasourceRequest
.
getDatasource
().
getConfiguration
(),
OracleConfigration
.
class
);
dataSource
.
setUser
(
oracleConfigration
.
getUsername
());
dataSource
.
setDriverClass
(
oracleConfigration
.
getDriver
());
dataSource
.
setPassword
(
oracleConfigration
.
getPassword
());
dataSource
.
setJdbcUrl
(
oracleConfigration
.
getJdbc
());
break
;
default
:
break
;
}
...
...
@@ -424,6 +451,8 @@ public class JdbcProvider extends DatasourceProvider {
case
sqlServer:
SqlServerConfigration
sqlServerConfigration
=
new
Gson
().
fromJson
(
datasourceRequest
.
getDatasource
().
getConfiguration
(),
SqlServerConfigration
.
class
);
return
"SELECT TABLE_NAME FROM DATABASE.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';"
.
replace
(
"DATABASE"
,
sqlServerConfigration
.
getDataBase
());
case
oracle:
return
"select TABLE_NAME from USER_TABLES"
;
default
:
return
"show tables;"
;
}
...
...
backend/src/main/java/io/dataease/datasource/provider/ProviderFactory.java
浏览文件 @
69321b08
...
...
@@ -42,6 +42,8 @@ public class ProviderFactory implements ApplicationContextAware {
return
context
.
getBean
(
"dorisQuery"
,
QueryProvider
.
class
);
case
sqlServer:
return
context
.
getBean
(
"sqlserverQuery"
,
QueryProvider
.
class
);
case
oracle:
return
context
.
getBean
(
"oracleQuery"
,
QueryProvider
.
class
);
default
:
return
context
.
getBean
(
"mysqlQuery"
,
QueryProvider
.
class
);
}
...
...
@@ -54,6 +56,8 @@ public class ProviderFactory implements ApplicationContextAware {
return
context
.
getBean
(
"mysqlDDL"
,
DDLProvider
.
class
);
case
doris:
return
context
.
getBean
(
"dorisDDL"
,
DDLProvider
.
class
);
case
oracle:
return
context
.
getBean
(
"oracleDDL"
,
DDLProvider
.
class
);
case
sqlServer:
return
context
.
getBean
(
"mysqlDDL"
,
DDLProvider
.
class
);
default
:
...
...
backend/src/main/java/io/dataease/provider/oracle/OracleDDLProvider.java
0 → 100644
浏览文件 @
69321b08
package
io
.
dataease
.
provider
.
oracle
;
import
io.dataease.provider.DDLProvider
;
import
org.springframework.stereotype.Service
;
/**
* @Author gin
* @Date 2021/5/17 4:27 下午
*/
@Service
(
"oracleDDL"
)
public
class
OracleDDLProvider
extends
DDLProvider
{
@Override
public
String
createView
(
String
name
,
String
viewSQL
)
{
return
"CREATE VIEW IF NOT EXISTS "
+
name
+
" AS ("
+
viewSQL
+
")"
;
}
@Override
public
String
dropTable
(
String
name
)
{
return
"DROP TABLE IF EXISTS "
+
name
;
}
@Override
public
String
dropView
(
String
name
)
{
return
"DROP VIEW IF EXISTS "
+
name
;
}
}
backend/src/main/java/io/dataease/provider/oracle/OracleQueryProvider.java
0 → 100644
浏览文件 @
69321b08
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java
浏览文件 @
69321b08
...
...
@@ -293,6 +293,7 @@ public class DataSetTableService {
String
table
=
dataTableInfoDTO
.
getTable
();
QueryProvider
qp
=
ProviderFactory
.
getQueryProvider
(
ds
.
getType
());
datasourceRequest
.
setQuery
(
qp
.
createQuerySQLWithPage
(
table
,
fields
,
page
,
pageSize
,
realSize
));
System
.
out
.
println
(
datasourceRequest
.
getQuery
());
try
{
data
.
addAll
(
datasourceProvider
.
getData
(
datasourceRequest
));
}
catch
(
Exception
e
)
{
...
...
backend/src/main/java/io/dataease/service/dataset/ExtractDataService.java
浏览文件 @
69321b08
...
...
@@ -12,10 +12,7 @@ import io.dataease.commons.utils.CommonBeanFactory;
import
io.dataease.commons.utils.DorisTableUtils
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.datasource.constants.DatasourceTypes
;
import
io.dataease.datasource.dto.DorisConfigration
;
import
io.dataease.datasource.dto.MysqlConfigration
;
import
io.dataease.datasource.dto.SqlServerConfigration
;
import
io.dataease.datasource.dto.TableFiled
;
import
io.dataease.datasource.dto.*
;
import
io.dataease.datasource.provider.DatasourceProvider
;
import
io.dataease.datasource.provider.JdbcProvider
;
import
io.dataease.datasource.provider.ProviderFactory
;
...
...
@@ -200,13 +197,13 @@ public class ExtractDataService {
extractData
(
datasetTable
,
"all_scope"
);
replaceTable
(
DorisTableUtils
.
dorisName
(
datasetTableId
));
saveSucessLog
(
datasetTableTaskLog
);
deleteFile
(
"all_scope"
,
datasetTableId
);
//
deleteFile("all_scope", datasetTableId);
updateTableStatus
(
datasetTableId
,
datasetTable
,
JobStatus
.
Completed
,
execTime
);
}
catch
(
Exception
e
){
saveErrorLog
(
datasetTableId
,
taskId
,
e
);
updateTableStatus
(
datasetTableId
,
datasetTable
,
JobStatus
.
Error
,
null
);
dropDorisTable
(
DorisTableUtils
.
dorisTmpName
(
DorisTableUtils
.
dorisName
(
datasetTableId
)));
deleteFile
(
"all_scope"
,
datasetTableId
);
//
deleteFile("all_scope", datasetTableId);
}
finally
{
if
(
datasetTableTask
!=
null
&&
datasetTableTask
.
getRate
().
equalsIgnoreCase
(
ScheduleType
.
SIMPLE
.
toString
()))
{
datasetTableTask
.
setRate
(
ScheduleType
.
SIMPLE_COMPLETE
.
toString
());
...
...
@@ -633,6 +630,29 @@ public class ExtractDataService {
inputStep
=
inputStep
(
transMeta
,
selectSQL
);
udjcStep
=
udjc
(
datasetTableFields
,
false
);
break
;
case
oracle:
OracleConfigration
oracleConfigration
=
new
Gson
().
fromJson
(
datasource
.
getConfiguration
(),
OracleConfigration
.
class
);
System
.
out
.
println
(
new
Gson
().
toJson
(
oracleConfigration
));
System
.
out
.
println
(
oracleConfigration
.
getConnectionType
().
equalsIgnoreCase
(
"serviceName"
));
if
(
oracleConfigration
.
getConnectionType
().
equalsIgnoreCase
(
"serviceName"
)){
String
database
=
"(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = ORACLE_HOSTNAME)(PORT = ORACLE_PORT))(CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = ORACLE_SERVICE_NAME )))"
.
replace
(
"ORACLE_HOSTNAME"
,
oracleConfigration
.
getHost
()).
replace
(
"ORACLE_PORT"
,
oracleConfigration
.
getPort
().
toString
()).
replace
(
"ORACLE_SERVICE_NAME"
,
oracleConfigration
.
getDataBase
());
dataMeta
=
new
DatabaseMeta
(
"db"
,
"ORACLE"
,
"Native"
,
""
,
database
,
"-1"
,
oracleConfigration
.
getUsername
(),
oracleConfigration
.
getPassword
());
}
else
{
dataMeta
=
new
DatabaseMeta
(
"db"
,
"ORACLE"
,
"Native"
,
oracleConfigration
.
getHost
(),
oracleConfigration
.
getDataBase
(),
oracleConfigration
.
getPort
().
toString
(),
oracleConfigration
.
getUsername
(),
oracleConfigration
.
getPassword
());
}
transMeta
.
addDatabase
(
dataMeta
);
if
(
extractType
.
equalsIgnoreCase
(
"all_scope"
))
{
if
(
datasetTable
.
getType
().
equalsIgnoreCase
(
"sql"
)){
selectSQL
=
new
Gson
().
fromJson
(
datasetTable
.
getInfo
(),
DataTableInfoDTO
.
class
).
getSql
();
}
else
{
String
tableName
=
new
Gson
().
fromJson
(
datasetTable
.
getInfo
(),
DataTableInfoDTO
.
class
).
getTable
();
QueryProvider
qp
=
ProviderFactory
.
getQueryProvider
(
datasource
.
getType
());
selectSQL
=
qp
.
createQuerySQL
(
tableName
,
datasetTableFields
);
}
}
inputStep
=
inputStep
(
transMeta
,
selectSQL
);
udjcStep
=
udjc
(
datasetTableFields
,
false
);
break
;
case
excel:
String
filePath
=
new
Gson
().
fromJson
(
datasetTable
.
getInfo
(),
DataTableInfoDTO
.
class
).
getData
();
inputStep
=
excelInputStep
(
filePath
,
datasetTableFields
);
...
...
@@ -752,7 +772,7 @@ public class ExtractDataService {
String
needToChangeColumnType
=
""
;
for
(
DatasetTableField
datasetTableField
:
datasetTableFields
)
{
if
(
datasetTableField
.
getDeExtractType
()
!=
null
&&
datasetTableField
.
getDeExtractType
()
==
4
)
{
needToChangeColumnType
=
needToChangeColumnType
+
alterColumnTypeCode
.
replace
(
"FILED"
,
datasetTableField
.
get
Origin
Name
());
needToChangeColumnType
=
needToChangeColumnType
+
alterColumnTypeCode
.
replace
(
"FILED"
,
datasetTableField
.
get
Dataease
Name
());
}
}
...
...
@@ -762,7 +782,7 @@ public class ExtractDataService {
fields
.
add
(
fieldInfo
);
userDefinedJavaClassMeta
.
setFieldInfo
(
fields
);
List
<
UserDefinedJavaClassDef
>
definitions
=
new
ArrayList
<
UserDefinedJavaClassDef
>();
String
tmp_code
=
code
.
replace
(
"alterColumnTypeCode"
,
needToChangeColumnType
).
replace
(
"Column_Fields"
,
String
.
join
(
","
,
datasetTableFields
.
stream
().
map
(
DatasetTableField:
:
get
Origin
Name
).
collect
(
Collectors
.
toList
())));
String
tmp_code
=
code
.
replace
(
"alterColumnTypeCode"
,
needToChangeColumnType
).
replace
(
"Column_Fields"
,
String
.
join
(
","
,
datasetTableFields
.
stream
().
map
(
DatasetTableField:
:
get
Dataease
Name
).
collect
(
Collectors
.
toList
())));
tmp_code
=
tmp_code
.
replace
(
"handleWraps"
,
handleWraps
);
if
(
isExcel
){
tmp_code
=
tmp_code
.
replace
(
"handleExcelIntColumn"
,
handleExcelIntColumn
);
...
...
frontend/src/lang/zh.js
浏览文件 @
69321b08
...
...
@@ -860,6 +860,7 @@ export default {
host
:
'主机名/IP地址'
,
port
:
'端口'
,
please_input_data_base
:
'请输入数据库名称'
,
please_select_oracle_type
:
'选择连接类型'
,
please_input_user_name
:
'请输入用户名'
,
please_input_password
:
'请输入密码'
,
please_input_host
:
'请输入主机'
,
...
...
@@ -871,7 +872,10 @@ export default {
delete_warning
:
'确定要删除吗?'
,
input_name
:
'请输入名称'
,
input_limit_2_25
:
'2-25字符'
,
input_limit_0_50
:
'0-50字符'
input_limit_0_50
:
'0-50字符'
,
oracle_connection_type
:
'服务名/SID'
,
oracle_sid
:
'SID'
,
oracle_service_name
:
'服务名'
,
},
pblink
:
{
key_pwd
:
'请输入密码打开链接'
,
...
...
frontend/src/views/system/datasource/form.vue
浏览文件 @
69321b08
...
...
@@ -31,6 +31,12 @@
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.data_base')"
prop=
"configuration.dataBase"
>
<el-input
v-model=
"form.configuration.dataBase"
autocomplete=
"off"
:disabled=
"formType=='modify'"
/>
</el-form-item>
<el-form-item
v-if=
"form.type=='oracle'"
:label=
"$t('datasource.oracle_connection_type')"
prop=
"configuration.connectionType"
>
<el-radio
v-model=
"form.configuration.connectionType"
label=
"sid"
>
{{ $t('datasource.oracle_sid') }}
</el-radio>
<el-radio
v-model=
"form.configuration.connectionType"
label=
"serviceName"
>
{{ $t('datasource.oracle_service_name') }}
</el-radio>
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.user_name')"
prop=
"configuration.username"
>
<el-input
v-model=
"form.configuration.username"
autocomplete=
"off"
:disabled=
"formType=='modify'"
/>
</el-form-item>
...
...
@@ -40,16 +46,6 @@
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.port')"
prop=
"configuration.port"
>
<el-input
v-model=
"form.configuration.port"
autocomplete=
"off"
/>
</el-form-item>
<!-- <el-form-item v-if="canEdit">
<el-button @click="validaDatasource">{{ $t('commons.validate') }}</el-button>
<el-button type="primary" @click="save">{{ $t('commons.save') }}</el-button>
</el-form-item>
<el-form-item v-else>
<el-button @click="validaDatasource">{{ $t('commons.validate') }}</el-button>
<el-button @click="changeEdit">{{ $t('commons.edit') }}</el-button>
</el-form-item> -->
</el-form>
<div
v-if=
"canEdit"
slot=
"footer"
class=
"dialog-footer"
>
<el-button
v-if=
"formType==='add'?true: hasDataPermission('manage',params.privileges)"
@
click=
"validaDatasource"
>
{{ $t('commons.validate') }}
</el-button>
...
...
@@ -83,25 +79,19 @@ export default {
{
min
:
2
,
max
:
25
,
message
:
this
.
$t
(
'datasource.input_limit_2_25'
,
[
2
,
25
]),
trigger
:
'blur'
}],
desc
:
[{
min
:
0
,
max
:
50
,
message
:
this
.
$t
(
'datasource.input_limit_0_50'
),
trigger
:
'blur'
}],
type
:
[{
required
:
true
,
message
:
this
.
$t
(
'datasource.please_choose_type'
),
trigger
:
'change'
}],
'configuration.dataBase'
:
[{
required
:
true
,
message
:
this
.
$t
(
'datasource.please_input_data_base'
),
trigger
:
'blur'
}],
'configuration.connectionType'
:
[{
required
:
true
,
message
:
this
.
$t
(
'datasource.please_select_oracle_type'
),
trigger
:
'blur'
}],
'configuration.username'
:
[{
required
:
true
,
message
:
this
.
$t
(
'datasource.please_input_user_name'
),
trigger
:
'blur'
}],
'configuration.password'
:
[{
required
:
true
,
message
:
this
.
$t
(
'datasource.please_input_password'
),
trigger
:
'change'
}],
'configuration.host'
:
[{
required
:
true
,
message
:
this
.
$t
(
'datasource.please_input_host'
),
trigger
:
'change'
}],
'configuration.port'
:
[{
required
:
true
,
message
:
this
.
$t
(
'datasource.please_input_port'
),
trigger
:
'change'
}]
},
allTypes
:
[{
name
:
'mysql'
,
label
:
'MySQL'
,
type
:
'jdbc'
}],
allTypes
:
[{
name
:
'mysql'
,
label
:
'MySQL'
,
type
:
'jdbc'
}
,
{
name
:
'oracle'
,
label
:
'Oracle'
,
type
:
'jdbc'
}
],
canEdit
:
false
}
},
created
()
{
// if (this.$router.currentRoute.params && this.$router.currentRoute.params.id) {
// const row = this.$router.currentRoute.params
// this.edit(row)
// } else {
// this.create()
// }
if
(
this
.
params
&&
this
.
params
.
id
)
{
const
row
=
this
.
params
this
.
edit
(
row
)
...
...
@@ -113,12 +103,6 @@ export default {
}
},
mounted
()
{
// if (this.params && this.params.type) {
// this.form.type = this.params.type
// this.$nextTick(() => {
// this.changeType()
// })
// }
},
methods
:
{
setType
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论