Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄营
datax-cloud
Commits
b0437b7e
Commit
b0437b7e
authored
Sep 02, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
68449eaa
Hide whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
609 additions
and
103 deletions
+609
-103
ModelColumnDto.java
...datax/service/data/masterdata/api/dto/ModelColumnDto.java
+2
-1
ModelColumnEntity.java
...service/data/masterdata/api/entity/ModelColumnEntity.java
+10
-5
ModelEntity.java
...datax/service/data/masterdata/api/entity/ModelEntity.java
+5
-0
MysqlDataTypeEnum.java
.../service/data/masterdata/api/enums/MysqlDataTypeEnum.java
+37
-0
OracleDataTypeEnum.java
...service/data/masterdata/api/enums/OracleDataTypeEnum.java
+1
-1
ColumnParser.java
...atax/service/data/masterdata/api/parser/ColumnParser.java
+5
-3
MysqlBigintDataType.java
...data/masterdata/api/parser/mysql/MysqlBigintDataType.java
+11
-0
MysqlBlobDataType.java
...e/data/masterdata/api/parser/mysql/MysqlBlobDataType.java
+11
-0
MysqlCharDataType.java
...e/data/masterdata/api/parser/mysql/MysqlCharDataType.java
+13
-0
MysqlColumnParser.java
...e/data/masterdata/api/parser/mysql/MysqlColumnParser.java
+51
-0
MysqlDateDataType.java
...e/data/masterdata/api/parser/mysql/MysqlDateDataType.java
+11
-0
MysqlDatetimeDataType.java
...ta/masterdata/api/parser/mysql/MysqlDatetimeDataType.java
+11
-0
MysqlDecimalDataType.java
...ata/masterdata/api/parser/mysql/MysqlDecimalDataType.java
+13
-0
MysqlDoubleDataType.java
...data/masterdata/api/parser/mysql/MysqlDoubleDataType.java
+13
-0
MysqlFloatDataType.java
.../data/masterdata/api/parser/mysql/MysqlFloatDataType.java
+13
-0
MysqlIntDataType.java
...ce/data/masterdata/api/parser/mysql/MysqlIntDataType.java
+11
-0
MysqlTextDataType.java
...e/data/masterdata/api/parser/mysql/MysqlTextDataType.java
+11
-0
MysqlTimeDataType.java
...e/data/masterdata/api/parser/mysql/MysqlTimeDataType.java
+11
-0
MysqlTinyintDataType.java
...ata/masterdata/api/parser/mysql/MysqlTinyintDataType.java
+11
-0
MysqlVarcharDataType.java
...ata/masterdata/api/parser/mysql/MysqlVarcharDataType.java
+13
-0
MysqlYearDataType.java
...e/data/masterdata/api/parser/mysql/MysqlYearDataType.java
+11
-0
OracleColumnParser.java
...data/masterdata/api/parser/oracle/OracleColumnParser.java
+10
-3
ModelColumnVo.java
...n/datax/service/data/masterdata/api/vo/ModelColumnVo.java
+1
-0
ModelVo.java
...java/cn/datax/service/data/masterdata/api/vo/ModelVo.java
+1
-0
ModelColumnController.java
...ice/data/masterdata/controller/ModelColumnController.java
+6
-6
ModelController.java
...x/service/data/masterdata/controller/ModelController.java
+12
-6
MysqlDynamicDao.java
...cn/datax/service/data/masterdata/dao/MysqlDynamicDao.java
+20
-0
ModelColumnMapstruct.java
...rvice/data/masterdata/mapstruct/ModelColumnMapstruct.java
+1
-1
ModelMapstruct.java
...tax/service/data/masterdata/mapstruct/ModelMapstruct.java
+1
-1
ModelService.java
...n/datax/service/data/masterdata/service/ModelService.java
+2
-0
ModelColumnServiceImpl.java
.../data/masterdata/service/impl/ModelColumnServiceImpl.java
+4
-4
ModelServiceImpl.java
...ervice/data/masterdata/service/impl/ModelServiceImpl.java
+22
-4
ModelColumnMapper.xml
...a-service/src/main/resources/mapper/ModelColumnMapper.xml
+2
-1
ModelMapper.xml
...terdata-service/src/main/resources/mapper/ModelMapper.xml
+2
-1
MysqlDynamicMapper.xml
...-service/src/main/resources/mapper/MysqlDynamicMapper.xml
+56
-0
OracleDynamicMapper.xml
...service/src/main/resources/mapper/OracleDynamicMapper.xml
+1
-12
datamodel.js
datax-ui/src/api/masterdata/datamodel.js
+7
-0
ApiMaskAdd.vue
datax-ui/src/views/market/apimask/ApiMaskAdd.vue
+1
-2
ApiMaskEdit.vue
datax-ui/src/views/market/apimask/ApiMaskEdit.vue
+1
-2
DataApiAdd.vue
datax-ui/src/views/market/dataapi/DataApiAdd.vue
+1
-2
DataApiEdit.vue
datax-ui/src/views/market/dataapi/DataApiEdit.vue
+1
-2
DataServiceAdd.vue
datax-ui/src/views/market/dataservice/DataServiceAdd.vue
+4
-0
DataServiceEdit.vue
datax-ui/src/views/market/dataservice/DataServiceEdit.vue
+4
-0
DataModelAdd.vue
datax-ui/src/views/masterdata/datamodel/DataModelAdd.vue
+39
-20
DataModelDetail.vue
datax-ui/src/views/masterdata/datamodel/DataModelDetail.vue
+12
-2
DataModelEdit.vue
datax-ui/src/views/masterdata/datamodel/DataModelEdit.vue
+25
-20
ChangeRecordAdd.vue
datax-ui/src/views/metadata/changerecord/ChangeRecordAdd.vue
+4
-0
ChangeRecordEdit.vue
...x-ui/src/views/metadata/changerecord/ChangeRecordEdit.vue
+4
-0
DataSourceAdd.vue
datax-ui/src/views/metadata/datasource/DataSourceAdd.vue
+4
-0
DataSourceEdit.vue
datax-ui/src/views/metadata/datasource/DataSourceEdit.vue
+4
-0
JobAdd.vue
datax-ui/src/views/scheduler/job/JobAdd.vue
+4
-0
JobEdit.vue
datax-ui/src/views/scheduler/job/JobEdit.vue
+4
-0
DataDictAdd.vue
datax-ui/src/views/standard/datadict/DataDictAdd.vue
+4
-0
DataDictEdit.vue
datax-ui/src/views/standard/datadict/DataDictEdit.vue
+4
-0
ConfigAdd.vue
datax-ui/src/views/system/config/ConfigAdd.vue
+4
-0
ConfigEdit.vue
datax-ui/src/views/system/config/ConfigEdit.vue
+4
-0
DeptAdd.vue
datax-ui/src/views/system/dept/DeptAdd.vue
+4
-0
DeptEdit.vue
datax-ui/src/views/system/dept/DeptEdit.vue
+4
-0
DictAdd.vue
datax-ui/src/views/system/dict/DictAdd.vue
+4
-0
DictEdit.vue
datax-ui/src/views/system/dict/DictEdit.vue
+4
-0
DictItemAdd.vue
datax-ui/src/views/system/dict/item/DictItemAdd.vue
+4
-0
DictItemEdit.vue
datax-ui/src/views/system/dict/item/DictItemEdit.vue
+4
-0
MenuAdd.vue
datax-ui/src/views/system/menu/MenuAdd.vue
+4
-0
MenuEdit.vue
datax-ui/src/views/system/menu/MenuEdit.vue
+4
-0
PostAdd.vue
datax-ui/src/views/system/post/PostAdd.vue
+4
-0
PostEdit.vue
datax-ui/src/views/system/post/PostEdit.vue
+4
-0
RoleAdd.vue
datax-ui/src/views/system/role/RoleAdd.vue
+4
-0
RoleEdit.vue
datax-ui/src/views/system/role/RoleEdit.vue
+4
-0
UserAdd.vue
datax-ui/src/views/system/user/UserAdd.vue
+4
-0
UserEdit.vue
datax-ui/src/views/system/user/UserEdit.vue
+4
-0
DataSetAdd.vue
datax-ui/src/views/visual/dataset/DataSetAdd.vue
+1
-2
DataSetEdit.vue
datax-ui/src/views/visual/dataset/DataSetEdit.vue
+1
-2
No files found.
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/dto/ModelColumnDto.java
View file @
b0437b7e
...
...
@@ -6,7 +6,6 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
...
...
@@ -41,6 +40,8 @@ public class ModelColumnDto implements Serializable {
private
String
columnScale
;
@ApiModelProperty
(
value
=
"列默认值"
)
private
String
defaultValue
;
@ApiModelProperty
(
value
=
"是否系统默认(0否,1是)"
)
private
String
isSystem
;
@ApiModelProperty
(
value
=
"是否主键(0否,1是)"
)
private
String
isPk
;
@ApiModelProperty
(
value
=
"是否必填(0否,1是)"
)
...
...
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/entity/ModelColumnEntity.java
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
entity
;
import
cn.datax.service.data.masterdata.api.enums.
Oracle
DataTypeEnum
;
import
cn.datax.service.data.masterdata.api.enums.
Mysql
DataTypeEnum
;
import
cn.datax.service.data.masterdata.api.parser.ColumnParser
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
import
cn.datax.service.data.masterdata.api.parser.
oracle.Oracle
ColumnParser
;
import
cn.datax.service.data.masterdata.api.parser.
mysql.Mysql
ColumnParser
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
cn.datax.common.base.BaseEntity
;
...
...
@@ -63,6 +63,11 @@ public class ModelColumnEntity extends BaseEntity {
private
String
defaultValue
;
/**
* 是否系统默认(0否,1是)
*/
private
String
isSystem
;
/**
* 是否主键(0否,1是)
*/
private
String
isPk
;
...
...
@@ -128,9 +133,9 @@ public class ModelColumnEntity extends BaseEntity {
@TableField
(
exist
=
false
)
private
String
columnDefinition
;
public
String
getColumnDefinition
()
throws
Exception
{
ColumnParser
columnParser
=
new
Oracle
ColumnParser
();
DataType
parse
=
columnParser
.
parse
(
OracleDataTypeEnum
.
match
(
this
.
columnType
,
OracleDataTypeEnum
.
CHAR
));
public
String
getColumnDefinition
()
{
ColumnParser
columnParser
=
new
Mysql
ColumnParser
();
DataType
parse
=
columnParser
.
mysqlParse
(
MysqlDataTypeEnum
.
match
(
this
.
columnType
,
MysqlDataTypeEnum
.
VAR
CHAR
));
return
parse
.
fillTypeString
(
this
.
columnLength
,
this
.
columnScale
);
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/entity/ModelEntity.java
View file @
b0437b7e
...
...
@@ -40,6 +40,11 @@ public class ModelEntity extends DataScopeBaseEntity {
*/
private
String
modelPhysicalTable
;
/**
* 是否建模(0否,1是)
*/
private
String
isSync
;
@TableField
(
exist
=
false
)
private
List
<
ModelColumnEntity
>
modelColumns
;
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/enums/MysqlDataTypeEnum.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
enums
;
public
enum
MysqlDataTypeEnum
{
TINYINT
(
"tinyint"
,
"tinyint整型"
),
INT
(
"int"
,
"int整型"
),
BIGINT
(
"bigint"
,
"bigint整型"
),
FLOAT
(
"float"
,
"单精度"
),
DOUBLE
(
"double"
,
"双精度"
),
DECIMAL
(
"decimal"
,
"定点数"
),
CHAR
(
"char"
,
"定长字符串"
),
VARCHAR
(
"varchar"
,
"变长字符串"
),
TEXT
(
"text"
,
"长文本"
),
DATE
(
"date"
,
"date日期"
),
TIME
(
"time"
,
"time日期"
),
YEAR
(
"year"
,
"year日期"
),
DATETIME
(
"datetime"
,
"datetime日期"
),
BLOB
(
"blob"
,
"二进制"
);
private
String
value
;
private
String
title
;
MysqlDataTypeEnum
(
String
value
,
String
title
)
{
this
.
value
=
value
;
this
.
title
=
title
;
}
public
String
getValue
()
{
return
value
;
}
public
String
getTitle
()
{
return
title
;
}
public
static
MysqlDataTypeEnum
match
(
String
value
,
MysqlDataTypeEnum
defaultItem
)
{
if
(
value
!=
null
)
{
for
(
MysqlDataTypeEnum
item:
MysqlDataTypeEnum
.
values
())
{
if
(
item
.
getValue
().
equals
(
value
))
{
return
item
;
}
}
}
return
defaultItem
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/enums/OracleDataTypeEnum.java
View file @
b0437b7e
...
...
@@ -2,7 +2,7 @@ package cn.datax.service.data.masterdata.api.enums;
public
enum
OracleDataTypeEnum
{
CHAR
(
"char"
,
"字符串"
),
NUMBER
(
"number"
,
"数值"
),
DATE
(
"date"
,
"日期"
),
CLOB
(
"clob"
,
"
大
文本"
),
BLOB
(
"blob"
,
"二进制"
);
CHAR
(
"char"
,
"字符串"
),
NUMBER
(
"number"
,
"数值"
),
DATE
(
"date"
,
"日期"
),
CLOB
(
"clob"
,
"
长
文本"
),
BLOB
(
"blob"
,
"二进制"
);
private
String
value
;
private
String
title
;
...
...
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/ColumnParser.java
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
;
import
cn.datax.service.data.masterdata.api.enums.MysqlDataTypeEnum
;
import
cn.datax.service.data.masterdata.api.enums.OracleDataTypeEnum
;
public
interface
ColumnParser
{
public
abstract
class
ColumnParser
{
DataType
parse
(
OracleDataTypeEnum
dataTypeEnum
)
throws
Exception
;
public
abstract
DataType
oracleParse
(
OracleDataTypeEnum
dataTypeEnum
);
public
abstract
DataType
mysqlParse
(
MysqlDataTypeEnum
dataTypeEnum
);
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlBigintDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlBigintDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"bigint"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlBlobDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlBlobDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"blob"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlCharDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
import
java.util.Optional
;
public
class
MysqlCharDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"char("
+
Optional
.
ofNullable
(
columnLength
).
orElse
(
"1"
)
+
")"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlColumnParser.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.common.exception.DataException
;
import
cn.datax.service.data.masterdata.api.enums.MysqlDataTypeEnum
;
import
cn.datax.service.data.masterdata.api.enums.OracleDataTypeEnum
;
import
cn.datax.service.data.masterdata.api.parser.ColumnParser
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlColumnParser
extends
ColumnParser
{
@Override
public
DataType
oracleParse
(
OracleDataTypeEnum
dataTypeEnum
)
{
return
null
;
}
@Override
public
DataType
mysqlParse
(
MysqlDataTypeEnum
dataTypeEnum
)
{
switch
(
dataTypeEnum
)
{
case
TINYINT:
return
new
MysqlTinyintDataType
();
case
INT:
return
new
MysqlIntDataType
();
case
BIGINT:
return
new
MysqlBigintDataType
();
case
FLOAT:
return
new
MysqlFloatDataType
();
case
DOUBLE:
return
new
MysqlDoubleDataType
();
case
DECIMAL:
return
new
MysqlDecimalDataType
();
case
CHAR:
return
new
MysqlCharDataType
();
case
VARCHAR:
return
new
MysqlVarcharDataType
();
case
TEXT:
return
new
MysqlTextDataType
();
case
DATE:
return
new
MysqlDateDataType
();
case
TIME:
return
new
MysqlTimeDataType
();
case
YEAR:
return
new
MysqlYearDataType
();
case
DATETIME:
return
new
MysqlDatetimeDataType
();
case
BLOB:
return
new
MysqlBlobDataType
();
default
:
throw
new
DataException
(
"字段数据类型错误"
);
}
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlDateDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlDateDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"date"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlDatetimeDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlDatetimeDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"datetime"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlDecimalDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
import
java.util.Optional
;
public
class
MysqlDecimalDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"decimal("
+
Optional
.
ofNullable
(
columnLength
).
orElse
(
"10"
)
+
", "
+
Optional
.
ofNullable
(
columnScale
).
orElse
(
"2"
)
+
")"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlDoubleDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
import
java.util.Optional
;
public
class
MysqlDoubleDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"double("
+
Optional
.
ofNullable
(
columnLength
).
orElse
(
"5"
)
+
", "
+
Optional
.
ofNullable
(
columnScale
).
orElse
(
"2"
)
+
")"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlFloatDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
import
java.util.Optional
;
public
class
MysqlFloatDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"float("
+
Optional
.
ofNullable
(
columnLength
).
orElse
(
"5"
)
+
", "
+
Optional
.
ofNullable
(
columnScale
).
orElse
(
"2"
)
+
")"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlIntDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlIntDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"int"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlTextDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlTextDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"text"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlTimeDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlTimeDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"time"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlTinyintDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlTinyintDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"tinyint"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlVarcharDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
import
java.util.Optional
;
public
class
MysqlVarcharDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"varchar("
+
Optional
.
ofNullable
(
columnLength
).
orElse
(
"255"
)
+
")"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/mysql/MysqlYearDataType.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
mysql
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
MysqlYearDataType
implements
DataType
{
@Override
public
String
fillTypeString
(
String
columnLength
,
String
columnScale
)
{
return
"year"
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/parser/oracle/OracleColumnParser.java
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
api
.
parser
.
oracle
;
import
cn.datax.common.exception.DataException
;
import
cn.datax.service.data.masterdata.api.enums.MysqlDataTypeEnum
;
import
cn.datax.service.data.masterdata.api.enums.OracleDataTypeEnum
;
import
cn.datax.service.data.masterdata.api.parser.ColumnParser
;
import
cn.datax.service.data.masterdata.api.parser.DataType
;
public
class
OracleColumnParser
implement
s
ColumnParser
{
public
class
OracleColumnParser
extend
s
ColumnParser
{
@Override
public
DataType
parse
(
OracleDataTypeEnum
dataTypeEnum
)
throws
Exception
{
public
DataType
oracleParse
(
OracleDataTypeEnum
dataTypeEnum
)
{
switch
(
dataTypeEnum
)
{
case
CHAR:
return
new
OracleCharDataType
();
...
...
@@ -20,7 +21,13 @@ public class OracleColumnParser implements ColumnParser {
return
new
OracleClobDataType
();
case
BLOB:
return
new
OracleBlobDataType
();
default
:
throw
new
DataException
(
"字段数据类型错误"
);
}
throw
new
DataException
(
"字段数据类型错误"
);
}
@Override
public
DataType
mysqlParse
(
MysqlDataTypeEnum
dataTypeEnum
)
{
return
null
;
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/vo/ModelColumnVo.java
View file @
b0437b7e
...
...
@@ -30,6 +30,7 @@ public class ModelColumnVo implements Serializable {
private
String
columnLength
;
private
String
columnScale
;
private
String
defaultValue
;
private
String
isSystem
;
private
String
isPk
;
private
String
isRequired
;
private
String
isInsert
;
...
...
datax-modules/data-masterdata-service-parent/data-masterdata-service-api/src/main/java/cn/datax/service/data/masterdata/api/vo/ModelVo.java
View file @
b0437b7e
...
...
@@ -27,5 +27,6 @@ public class ModelVo implements Serializable {
private
String
modelName
;
private
String
modelLogicTable
;
private
String
modelPhysicalTable
;
private
String
isSync
;
private
List
<
ModelColumnVo
>
modelColumns
;
}
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/controller/ModelColumnController.java
View file @
b0437b7e
...
...
@@ -7,7 +7,7 @@ import cn.datax.service.data.masterdata.api.dto.ModelColumnDto;
import
cn.datax.service.data.masterdata.api.entity.ModelColumnEntity
;
import
cn.datax.service.data.masterdata.api.vo.ModelColumnVo
;
import
cn.datax.service.data.masterdata.api.query.ModelColumnQuery
;
import
cn.datax.service.data.masterdata.mapstruct.ModelColumnMap
per
;
import
cn.datax.service.data.masterdata.mapstruct.ModelColumnMap
struct
;
import
cn.datax.service.data.masterdata.service.ModelColumnService
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -43,7 +43,7 @@ public class ModelColumnController extends BaseController {
private
ModelColumnService
modelColumnService
;
@Autowired
private
ModelColumnMap
per
modelColumnMapper
;
private
ModelColumnMap
struct
modelColumnMapstruct
;
/**
* 通过ID查询信息
...
...
@@ -56,7 +56,7 @@ public class ModelColumnController extends BaseController {
@GetMapping
(
"/{id}"
)
public
R
getModelColumnById
(
@PathVariable
String
id
)
{
ModelColumnEntity
modelColumnEntity
=
modelColumnService
.
getModelColumnById
(
id
);
return
R
.
ok
().
setData
(
modelColumnMap
per
.
toVO
(
modelColumnEntity
));
return
R
.
ok
().
setData
(
modelColumnMap
struct
.
toVO
(
modelColumnEntity
));
}
/**
...
...
@@ -75,7 +75,7 @@ public class ModelColumnController extends BaseController {
queryWrapper
.
eq
(
StrUtil
.
isNotBlank
(
modelColumnQuery
.
getModelId
()),
"model_id"
,
modelColumnQuery
.
getModelId
());
queryWrapper
.
like
(
StrUtil
.
isNotBlank
(
modelColumnQuery
.
getColumnName
()),
"column_name"
,
modelColumnQuery
.
getColumnName
());
IPage
<
ModelColumnEntity
>
page
=
modelColumnService
.
page
(
new
Page
<>(
modelColumnQuery
.
getPageNum
(),
modelColumnQuery
.
getPageSize
()),
queryWrapper
);
List
<
ModelColumnVo
>
collect
=
page
.
getRecords
().
stream
().
map
(
modelColumnMap
per
:
:
toVO
).
collect
(
Collectors
.
toList
());
List
<
ModelColumnVo
>
collect
=
page
.
getRecords
().
stream
().
map
(
modelColumnMap
struct
:
:
toVO
).
collect
(
Collectors
.
toList
());
JsonPage
<
ModelColumnVo
>
jsonPage
=
new
JsonPage
<>(
page
.
getCurrent
(),
page
.
getSize
(),
page
.
getTotal
(),
collect
);
return
R
.
ok
().
setData
(
jsonPage
);
}
...
...
@@ -90,7 +90,7 @@ public class ModelColumnController extends BaseController {
@PostMapping
()
public
R
saveModelColumn
(
@RequestBody
@Validated
({
ValidationGroups
.
Insert
.
class
})
ModelColumnDto
modelColumn
)
{
ModelColumnEntity
modelColumnEntity
=
modelColumnService
.
saveModelColumn
(
modelColumn
);
return
R
.
ok
().
setData
(
modelColumnMap
per
.
toVO
(
modelColumnEntity
));
return
R
.
ok
().
setData
(
modelColumnMap
struct
.
toVO
(
modelColumnEntity
));
}
/**
...
...
@@ -106,7 +106,7 @@ public class ModelColumnController extends BaseController {
@PutMapping
(
"/{id}"
)
public
R
updateModelColumn
(
@PathVariable
String
id
,
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
ModelColumnDto
modelColumn
)
{
ModelColumnEntity
modelColumnEntity
=
modelColumnService
.
updateModelColumn
(
modelColumn
);
return
R
.
ok
().
setData
(
modelColumnMap
per
.
toVO
(
modelColumnEntity
));
return
R
.
ok
().
setData
(
modelColumnMap
struct
.
toVO
(
modelColumnEntity
));
}
/**
...
...
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/controller/ModelController.java
View file @
b0437b7e
...
...
@@ -7,7 +7,7 @@ import cn.datax.service.data.masterdata.api.dto.ModelDto;
import
cn.datax.service.data.masterdata.api.entity.ModelEntity
;
import
cn.datax.service.data.masterdata.api.vo.ModelVo
;
import
cn.datax.service.data.masterdata.api.query.ModelQuery
;
import
cn.datax.service.data.masterdata.mapstruct.ModelMap
per
;
import
cn.datax.service.data.masterdata.mapstruct.ModelMap
struct
;
import
cn.datax.service.data.masterdata.service.ModelService
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
...
...
@@ -43,7 +43,7 @@ public class ModelController extends BaseController {
private
ModelService
modelService
;
@Autowired
private
ModelMap
per
modelMapper
;
private
ModelMap
struct
modelMapstruct
;
/**
* 通过ID查询信息
...
...
@@ -56,7 +56,7 @@ public class ModelController extends BaseController {
@GetMapping
(
"/{id}"
)
public
R
getModelById
(
@PathVariable
String
id
)
{
ModelEntity
modelEntity
=
modelService
.
getModelById
(
id
);
return
R
.
ok
().
setData
(
modelMap
per
.
toVO
(
modelEntity
));
return
R
.
ok
().
setData
(
modelMap
struct
.
toVO
(
modelEntity
));
}
/**
...
...
@@ -74,7 +74,7 @@ public class ModelController extends BaseController {
QueryWrapper
<
ModelEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
like
(
StrUtil
.
isNotBlank
(
modelQuery
.
getModelName
()),
"model_name"
,
modelQuery
.
getModelName
());
IPage
<
ModelEntity
>
page
=
modelService
.
page
(
new
Page
<>(
modelQuery
.
getPageNum
(),
modelQuery
.
getPageSize
()),
queryWrapper
);
List
<
ModelVo
>
collect
=
page
.
getRecords
().
stream
().
map
(
modelMap
per
:
:
toVO
).
collect
(
Collectors
.
toList
());
List
<
ModelVo
>
collect
=
page
.
getRecords
().
stream
().
map
(
modelMap
struct
:
:
toVO
).
collect
(
Collectors
.
toList
());
JsonPage
<
ModelVo
>
jsonPage
=
new
JsonPage
<>(
page
.
getCurrent
(),
page
.
getSize
(),
page
.
getTotal
(),
collect
);
return
R
.
ok
().
setData
(
jsonPage
);
}
...
...
@@ -89,7 +89,7 @@ public class ModelController extends BaseController {
@PostMapping
()
public
R
saveModel
(
@RequestBody
@Validated
({
ValidationGroups
.
Insert
.
class
})
ModelDto
model
)
{
ModelEntity
modelEntity
=
modelService
.
saveModel
(
model
);
return
R
.
ok
().
setData
(
modelMap
per
.
toVO
(
modelEntity
));
return
R
.
ok
().
setData
(
modelMap
struct
.
toVO
(
modelEntity
));
}
/**
...
...
@@ -105,7 +105,7 @@ public class ModelController extends BaseController {
@PutMapping
(
"/{id}"
)
public
R
updateModel
(
@PathVariable
String
id
,
@RequestBody
@Validated
({
ValidationGroups
.
Update
.
class
})
ModelDto
model
)
{
ModelEntity
modelEntity
=
modelService
.
updateModel
(
model
);
return
R
.
ok
().
setData
(
modelMap
per
.
toVO
(
modelEntity
));
return
R
.
ok
().
setData
(
modelMap
struct
.
toVO
(
modelEntity
));
}
/**
...
...
@@ -133,4 +133,10 @@ public class ModelController extends BaseController {
modelService
.
deleteModelBatch
(
ids
);
return
R
.
ok
();
}
@PostMapping
(
"/table/{id}"
)
public
R
createTable
(
@PathVariable
String
id
)
{
modelService
.
createTable
(
id
);
return
R
.
ok
();
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/dao/MysqlDynamicDao.java
0 → 100644
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
dao
;
import
cn.datax.service.data.masterdata.api.entity.ModelDataEntity
;
import
cn.datax.service.data.masterdata.api.entity.ModelEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
MysqlDynamicDao
{
void
createTable
(
ModelEntity
modelEntity
);
void
dropTable
(
@Param
(
"tableName"
)
String
tableName
);
void
insertData
(
ModelDataEntity
modelDataEntity
);
void
updateData
(
ModelDataEntity
modelDataEntity
);
void
deleteData
(
ModelDataEntity
modelDataEntity
);
}
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/mapstruct/ModelColumnMap
per
.java
→
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/mapstruct/ModelColumnMap
struct
.java
View file @
b0437b7e
...
...
@@ -15,6 +15,6 @@ import org.mapstruct.Mapper;
* @since 2020-08-26
*/
@Mapper
(
componentModel
=
"spring"
)
public
interface
ModelColumnMap
per
extends
EntityMapper
<
ModelColumnDto
,
ModelColumnEntity
,
ModelColumnVo
>
{
public
interface
ModelColumnMap
struct
extends
EntityMapper
<
ModelColumnDto
,
ModelColumnEntity
,
ModelColumnVo
>
{
}
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/mapstruct/ModelMap
per
.java
→
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/mapstruct/ModelMap
struct
.java
View file @
b0437b7e
...
...
@@ -15,6 +15,6 @@ import org.mapstruct.Mapper;
* @since 2020-08-26
*/
@Mapper
(
componentModel
=
"spring"
)
public
interface
ModelMap
per
extends
EntityMapper
<
ModelDto
,
ModelEntity
,
ModelVo
>
{
public
interface
ModelMap
struct
extends
EntityMapper
<
ModelDto
,
ModelEntity
,
ModelVo
>
{
}
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/service/ModelService.java
View file @
b0437b7e
...
...
@@ -25,4 +25,6 @@ public interface ModelService extends BaseService<ModelEntity> {
void
deleteModelById
(
String
id
);
void
deleteModelBatch
(
List
<
String
>
ids
);
void
createTable
(
String
id
);
}
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/service/impl/ModelColumnServiceImpl.java
View file @
b0437b7e
...
...
@@ -3,7 +3,7 @@ package cn.datax.service.data.masterdata.service.impl;
import
cn.datax.service.data.masterdata.api.entity.ModelColumnEntity
;
import
cn.datax.service.data.masterdata.api.dto.ModelColumnDto
;
import
cn.datax.service.data.masterdata.service.ModelColumnService
;
import
cn.datax.service.data.masterdata.mapstruct.ModelColumnMap
per
;
import
cn.datax.service.data.masterdata.mapstruct.ModelColumnMap
struct
;
import
cn.datax.service.data.masterdata.dao.ModelColumnDao
;
import
cn.datax.common.base.BaseServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -29,12 +29,12 @@ public class ModelColumnServiceImpl extends BaseServiceImpl<ModelColumnDao, Mode
private
ModelColumnDao
modelColumnDao
;
@Autowired
private
ModelColumnMap
per
modelColumnMapper
;
private
ModelColumnMap
struct
modelColumnMapstruct
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ModelColumnEntity
saveModelColumn
(
ModelColumnDto
modelColumnDto
)
{
ModelColumnEntity
modelColumn
=
modelColumnMap
per
.
toEntity
(
modelColumnDto
);
ModelColumnEntity
modelColumn
=
modelColumnMap
struct
.
toEntity
(
modelColumnDto
);
modelColumnDao
.
insert
(
modelColumn
);
return
modelColumn
;
}
...
...
@@ -42,7 +42,7 @@ public class ModelColumnServiceImpl extends BaseServiceImpl<ModelColumnDao, Mode
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ModelColumnEntity
updateModelColumn
(
ModelColumnDto
modelColumnDto
)
{
ModelColumnEntity
modelColumn
=
modelColumnMap
per
.
toEntity
(
modelColumnDto
);
ModelColumnEntity
modelColumn
=
modelColumnMap
struct
.
toEntity
(
modelColumnDto
);
modelColumnDao
.
updateById
(
modelColumn
);
return
modelColumn
;
}
...
...
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/java/cn/datax/service/data/masterdata/service/impl/ModelServiceImpl.java
View file @
b0437b7e
package
cn
.
datax
.
service
.
data
.
masterdata
.
service
.
impl
;
import
cn.datax.common.core.DataConstant
;
import
cn.datax.common.exception.DataException
;
import
cn.datax.service.data.masterdata.api.entity.ModelColumnEntity
;
import
cn.datax.service.data.masterdata.api.entity.ModelEntity
;
import
cn.datax.service.data.masterdata.api.dto.ModelDto
;
import
cn.datax.service.data.masterdata.dao.ModelColumnDao
;
import
cn.datax.service.data.masterdata.dao.MysqlDynamicDao
;
import
cn.datax.service.data.masterdata.mapstruct.ModelMapstruct
;
import
cn.datax.service.data.masterdata.service.ModelService
;
import
cn.datax.service.data.masterdata.mapstruct.ModelMapper
;
import
cn.datax.service.data.masterdata.dao.ModelDao
;
import
cn.datax.common.base.BaseServiceImpl
;
import
cn.hutool.core.collection.CollUtil
;
...
...
@@ -36,15 +39,19 @@ public class ModelServiceImpl extends BaseServiceImpl<ModelDao, ModelEntity> imp
private
ModelDao
modelDao
;
@Autowired
private
ModelMap
per
modelMapper
;
private
ModelMap
struct
modelMapstruct
;
@Autowired
private
ModelColumnDao
modelColumnDao
;
@Autowired
private
MysqlDynamicDao
dynamicDao
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ModelEntity
saveModel
(
ModelDto
modelDto
)
{
ModelEntity
model
=
modelMapper
.
toEntity
(
modelDto
);
ModelEntity
model
=
modelMapstruct
.
toEntity
(
modelDto
);
model
.
setIsSync
(
DataConstant
.
TrueOrFalse
.
FALSE
.
getKey
());
model
.
setModelPhysicalTable
(
"dynamic_"
+
DateUtil
.
format
(
new
Date
(),
DatePattern
.
PURE_DATETIME_PATTERN
));
modelDao
.
insert
(
model
);
String
modelId
=
model
.
getId
();
...
...
@@ -61,7 +68,7 @@ public class ModelServiceImpl extends BaseServiceImpl<ModelDao, ModelEntity> imp
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ModelEntity
updateModel
(
ModelDto
modelDto
)
{
ModelEntity
model
=
modelMap
per
.
toEntity
(
modelDto
);
ModelEntity
model
=
modelMap
struct
.
toEntity
(
modelDto
);
modelDao
.
updateById
(
model
);
String
modelId
=
model
.
getId
();
modelColumnDao
.
delete
(
Wrappers
.<
ModelColumnEntity
>
lambdaQuery
()
...
...
@@ -97,4 +104,15 @@ public class ModelServiceImpl extends BaseServiceImpl<ModelDao, ModelEntity> imp
.
in
(
ModelColumnEntity:
:
getModelId
,
ids
));
modelDao
.
deleteBatchIds
(
ids
);
}
@Override
public
void
createTable
(
String
id
)
{
ModelEntity
modelEntity
=
super
.
getById
(
id
);
if
(
DataConstant
.
TrueOrFalse
.
TRUE
.
getKey
().
equals
(
modelEntity
.
getIsSync
()))
{
throw
new
DataException
(
"重复建模"
);
}
dynamicDao
.
createTable
(
modelEntity
);
modelEntity
.
setIsSync
(
DataConstant
.
TrueOrFalse
.
TRUE
.
getKey
());
modelDao
.
updateById
(
modelEntity
);
}
}
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/resources/mapper/ModelColumnMapper.xml
View file @
b0437b7e
...
...
@@ -18,6 +18,7 @@
<result
column=
"column_length"
property=
"columnLength"
/>
<result
column=
"column_scale"
property=
"columnScale"
/>
<result
column=
"default_value"
property=
"defaultValue"
/>
<result
column=
"is_system"
property=
"isSystem"
/>
<result
column=
"is_pk"
property=
"isPk"
/>
<result
column=
"is_required"
property=
"isRequired"
/>
<result
column=
"is_insert"
property=
"isInsert"
/>
...
...
@@ -41,7 +42,7 @@
update_by,
update_time,
remark,
model_id, column_name, column_comment, column_type, column_length, column_scale, default_value, is_pk, is_required, is_insert, is_edit, is_list, is_query, query_type, is_bind_dict, bind_dict_type_id, bind_dict_column, html_type, sort
model_id, column_name, column_comment, column_type, column_length, column_scale, default_value, is_
system, is_
pk, is_required, is_insert, is_edit, is_list, is_query, query_type, is_bind_dict, bind_dict_type_id, bind_dict_column, html_type, sort
</sql>
</mapper>
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/resources/mapper/ModelMapper.xml
View file @
b0437b7e
...
...
@@ -15,6 +15,7 @@
<result
column=
"model_name"
property=
"modelName"
/>
<result
column=
"model_logic_table"
property=
"modelLogicTable"
/>
<result
column=
"model_physical_table"
property=
"modelPhysicalTable"
/>
<result
column=
"is_sync"
property=
"isSync"
/>
</resultMap>
<resultMap
id=
"ExtendResultMap"
type=
"cn.datax.service.data.masterdata.api.entity.ModelEntity"
extends=
"BaseResultMap"
>
...
...
@@ -31,7 +32,7 @@
update_by,
update_time,
remark,
model_name, model_logic_table, model_physical_table
model_name, model_logic_table, model_physical_table
, is_sync
</sql>
<select
id=
"getModelColumnList"
resultType=
"cn.datax.service.data.masterdata.api.entity.ModelColumnEntity"
>
...
...
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/resources/mapper/MysqlDynamicMapper.xml
0 → 100644
View file @
b0437b7e
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.datax.service.data.masterdata.dao.MysqlDynamicDao"
>
<insert
id=
"createTable"
parameterType=
"cn.datax.service.data.masterdata.api.entity.ModelEntity"
>
CREATE TABLE `${modelPhysicalTable}` (
<foreach
collection=
"modelColumns"
item=
"column"
separator=
","
>
`${column.columnName}` ${column.columnDefinition}
<if
test=
"column.defaultValue != null and column.defaultValue != ''"
>
DEFAULT #{column.defaultValue}
</if>
<if
test=
"column.isRequired != null and column.isRequired == '1'.toString()"
>
NOT NULL
</if>
<if
test=
"column.columnComment != null and column.columnComment != ''"
>
comment #{column.columnComment}
</if>
</foreach>
, PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC
<if
test=
"modelName != null and modelName != ''"
>
comment=#{modelName}
</if>
</insert>
<!-- 验证表是否存在 -->
<update
id=
"dropTable"
parameterType=
"java.lang.String"
>
DROP TABLE IF EXISTS ${tableName}
</update>
<!-- 插入数据 -->
<insert
id=
"insertData"
parameterType=
"cn.datax.service.data.masterdata.api.entity.ModelDataEntity"
>
INSERT INTO ${tableName}
<foreach
collection=
"datas.keys"
item=
"key"
open=
"("
close=
")"
separator=
","
>
${key}
</foreach>
VALUES
<foreach
collection=
"datas.values"
item=
"value"
open=
"("
close=
")"
separator=
","
>
#{value}
</foreach>
</insert>
<!-- 更新数据 -->
<update
id=
"updateData"
parameterType=
"cn.datax.service.data.masterdata.api.entity.ModelDataEntity"
>
UPDATE ${tableName} SET
<foreach
collection=
"datas.keys"
index=
"key"
item=
"value"
separator=
","
>
${key} = #{value}
</foreach>
WHERE ID = #{datas[id]}
</update>
<!-- 删除数据 -->
<delete
id=
"deleteData"
parameterType=
"cn.datax.service.data.masterdata.api.entity.ModelDataEntity"
>
DELETE FROM ${tableName} WHERE id = #{datas[id]}
</delete>
</mapper>
datax-modules/data-masterdata-service-parent/data-masterdata-service/src/main/resources/mapper/OracleDynamicMapper.xml
View file @
b0437b7e
...
...
@@ -3,15 +3,7 @@
<mapper
namespace=
"cn.datax.service.data.masterdata.dao.OracleDynamicDao"
>
<insert
id=
"createTable"
parameterType=
"cn.datax.service.data.masterdata.api.entity.ModelEntity"
>
CREATE TABLE ${modelLogicTable} (
ID VARCHAR2(20) NOT NULL PRIMARY KEY,
STATUS NUMBER(1, 0) DEFAULT '1' NOT NULL,
CREATE_BY VARCHAR2(20),
CREATE_TIME DATE,
CREATE_DEPT VARCHAR2(20),
UPDATE_BY VARCHAR2(20),
UPDATE_TIME DATE,
REMARK VARCHAR2(2000),
CREATE TABLE ${modelPhysicalTable} (
<foreach
collection=
"modelColumns"
item=
"column"
separator=
","
>
${column.columnName} ${column.columnDefinition}
<if
test=
"column.defaultValue != null and column.defaultValue != ''"
>
...
...
@@ -20,9 +12,6 @@
<if
test=
"column.isRequired != null and column.isRequired == '1'.toString()"
>
NOT NULL
</if>
<if
test=
"column.isPk != null and column.isPk == '1'.toString()"
>
PRIMARY KEY
</if>
</foreach>
)
</insert>
...
...
datax-ui/src/api/masterdata/datamodel.js
View file @
b0437b7e
...
...
@@ -44,3 +44,10 @@ export function updateDataModel(data) {
data
:
data
})
}
export
function
createTable
(
id
)
{
return
request
({
url
:
'/data/masterdata/models/table/'
+
id
,
method
:
'post'
})
}
datax-ui/src/views/market/apimask/ApiMaskAdd.vue
View file @
b0437b7e
...
...
@@ -283,8 +283,7 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
data
.
msg
||
'保存失败'
)
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
...
...
datax-ui/src/views/market/apimask/ApiMaskEdit.vue
View file @
b0437b7e
...
...
@@ -322,8 +322,7 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
data
.
msg
||
'保存失败'
)
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
...
...
datax-ui/src/views/market/dataapi/DataApiAdd.vue
View file @
b0437b7e
...
...
@@ -556,8 +556,7 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
||
'保存失败'
)
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
...
...
datax-ui/src/views/market/dataapi/DataApiEdit.vue
View file @
b0437b7e
...
...
@@ -587,8 +587,7 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
||
'保存失败'
)
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
...
...
datax-ui/src/views/market/dataservice/DataServiceAdd.vue
View file @
b0437b7e
...
...
@@ -185,6 +185,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/market/dataservice/DataServiceEdit.vue
View file @
b0437b7e
...
...
@@ -195,6 +195,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/masterdata/datamodel/DataModelAdd.vue
View file @
b0437b7e
...
...
@@ -39,21 +39,21 @@
<el-table-column
label=
"列名称"
>
<template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnName'"
:rules=
"rules.columnName"
>
<el-input
v-model=
"scope.row.columnName"
clearable
placeholder=
"请输入列名称"
/>
<el-input
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnName"
clearable
placeholder=
"请输入列名称"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"列描述"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnComment'"
:rules=
"rules.columnComment"
>
<el-input
v-model=
"scope.row.columnComment"
clearable
placeholder=
"请输入列描述"
/>
<el-input
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnComment"
clearable
placeholder=
"请输入列描述"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"列类型"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnType'"
:rules=
"rules.columnType"
>
<el-select
v-model=
"scope.row.columnType"
clearable
placeholder=
"请选择"
>
<el-select
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnType"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in columnTypeOptions"
:key=
"item.value"
...
...
@@ -67,70 +67,70 @@
<el-table-column
label=
"长度"
width=
"70"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnLength'"
>
<el-input-number
v-model=
"scope.row.columnLength"
style=
"width: 50px;"
:controls=
"false"
/>
<el-input-number
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnLength"
style=
"width: 50px;"
:controls=
"false"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"小数位"
width=
"70"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnScale'"
>
<el-input-number
v-model=
"scope.row.columnScale"
style=
"width: 50px;"
:controls=
"false"
/>
<el-input-number
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnScale"
style=
"width: 50px;"
:controls=
"false"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"默认值"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.defaultValue'"
>
<el-input
v-model=
"scope.row.defaultValue"
clearable
placeholder=
"请输入默认值"
/>
<el-input
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.defaultValue"
clearable
placeholder=
"请输入默认值"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"主键"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isPk'"
>
<el-checkbox
v-model=
"scope.row.isPk"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isPk"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"必填"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isRequired'"
>
<el-checkbox
v-model=
"scope.row.isRequired"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isRequired"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"插入"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isInsert'"
>
<el-checkbox
v-model=
"scope.row.isInsert"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isInsert"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"编辑"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isEdit'"
>
<el-checkbox
v-model=
"scope.row.isEdit"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isEdit"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"列表"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isList'"
>
<el-checkbox
v-model=
"scope.row.isList"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isList"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"查询"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isQuery'"
>
<el-checkbox
v-model=
"scope.row.isQuery"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isQuery"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"查询方式"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.queryType'"
>
<el-select
v-model=
"scope.row.queryType"
clearable
placeholder=
"请选择"
>
<el-select
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.queryType"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in queryTypeOptions"
:key=
"item.value"
...
...
@@ -144,7 +144,7 @@
<el-table-column
label=
"显示类型"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.htmlType'"
:rules=
"rules.htmlType"
>
<el-select
v-model=
"scope.row.htmlType"
clearable
placeholder=
"请选择"
>
<el-select
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.htmlType"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in htmlTypeOptions"
:key=
"item.value"
...
...
@@ -158,9 +158,9 @@
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-form-item>
<el-button
:disabled=
"scope.
$index === 0"
@
click=
"upRow(scope.$index)"
icon=
"el-icon-arrow-up"
circle
></el-button
>
<el-button
:disabled=
"scope.
$index === (form.modelColumns.length - 1)"
@
click=
"downRow(scope.$index)"
icon=
"el-icon-arrow-down"
circle
></el-button
>
<el-button
@
click=
"delRow(scope.$index)"
icon=
"el-icon-delete"
circle
></el-button
>
<el-button
:disabled=
"scope.
row.isSystem === '1' || scope.$index
<
=
8
"
icon=
"el-icon-arrow-up"
circle
@
click=
"upRow(scope.$index)"
/
>
<el-button
:disabled=
"scope.
row.isSystem === '1' || scope.$index === (form.modelColumns.length - 1)"
icon=
"el-icon-arrow-down"
circle
@
click=
"downRow(scope.$index)"
/
>
<el-button
:disabled=
"scope.row.isSystem === '1'"
icon=
"el-icon-delete"
circle
@
click=
"delRow(scope.$index)"
/
>
</el-form-item>
</
template
>
</el-table-column>
...
...
@@ -240,7 +240,18 @@ export default {
// 查询方式数据字典
queryTypeOptions
:
[],
// 显示类型数据字典
htmlTypeOptions
:
[]
htmlTypeOptions
:
[],
// 系统默认列
systemColumns
:
[
{
columnName
:
'id'
,
columnComment
:
'主键ID'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'1'
,
isRequired
:
'1'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
},
{
columnName
:
'status'
,
columnComment
:
'状态(0禁用,1启用)'
,
columnType
:
'tinyint'
,
columnLength
:
'0'
,
columnScale
:
'0'
,
defaultValue
:
'1'
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
},
{
columnName
:
'create_by'
,
columnComment
:
'创建人'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
},
{
columnName
:
'create_time'
,
columnComment
:
'创建日期'
,
columnType
:
'datetime'
,
columnLength
:
'0'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
},
{
columnName
:
'create_dept'
,
columnComment
:
'创建人所属部门'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
},
{
columnName
:
'update_by'
,
columnComment
:
'更新人'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
},
{
columnName
:
'update_time'
,
columnComment
:
'更新日期'
,
columnType
:
'datetime'
,
columnLength
:
'0'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
},
{
columnName
:
'remark'
,
columnComment
:
'备注'
,
columnType
:
'varchar'
,
columnLength
:
'2000'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
}
]
}
},
created
()
{
...
...
@@ -249,7 +260,7 @@ export default {
this
.
statusOptions
=
response
.
data
}
})
this
.
getDicts
(
'data_type_
oracle
'
).
then
(
response
=>
{
this
.
getDicts
(
'data_type_
mysql
'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
columnTypeOptions
=
response
.
data
}
...
...
@@ -265,6 +276,9 @@ export default {
}
})
},
mounted
()
{
this
.
form
.
modelColumns
=
this
.
form
.
modelColumns
.
concat
(
this
.
systemColumns
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
...
...
@@ -273,10 +287,11 @@ export default {
const
item
=
{
columnName
:
''
,
columnComment
:
''
,
columnType
:
'char'
,
columnType
:
'
var
char'
,
columnLength
:
'255'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isSystem
:
'0'
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
...
...
@@ -331,6 +346,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/masterdata/datamodel/DataModelDetail.vue
View file @
b0437b7e
...
...
@@ -3,6 +3,7 @@
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-s-data"
round
@
click=
"createTable"
>
建模
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
...
...
@@ -162,7 +163,7 @@
</template>
<
script
>
import
{
getDataModel
}
from
'@/api/masterdata/datamodel'
import
{
getDataModel
,
createTable
}
from
'@/api/masterdata/datamodel'
export
default
{
name
:
'DataModelDetail'
,
...
...
@@ -202,7 +203,7 @@ export default {
this
.
statusOptions
=
response
.
data
}
})
this
.
getDicts
(
'data_type_
oracle
'
).
then
(
response
=>
{
this
.
getDicts
(
'data_type_
mysql
'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
columnTypeOptions
=
response
.
data
}
...
...
@@ -232,6 +233,15 @@ export default {
this
.
form
=
response
.
data
}
})
},
createTable
()
{
createTable
(
this
.
data
.
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
error
(
'建模成功'
)
}
else
{
this
.
$message
.
error
(
'建模失败'
)
}
})
}
}
}
...
...
datax-ui/src/views/masterdata/datamodel/DataModelEdit.vue
View file @
b0437b7e
...
...
@@ -39,21 +39,21 @@
<el-table-column
label=
"列名称"
>
<template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnName'"
:rules=
"rules.columnName"
>
<el-input
v-model=
"scope.row.columnName"
clearable
placeholder=
"请输入列名称"
/>
<el-input
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnName"
clearable
placeholder=
"请输入列名称"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"列描述"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnComment'"
:rules=
"rules.columnComment"
>
<el-input
v-model=
"scope.row.columnComment"
clearable
placeholder=
"请输入列描述"
/>
<el-input
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnComment"
clearable
placeholder=
"请输入列描述"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"列类型"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnType'"
:rules=
"rules.columnType"
>
<el-select
v-model=
"scope.row.columnType"
clearable
placeholder=
"请选择"
>
<el-select
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnType"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in columnTypeOptions"
:key=
"item.value"
...
...
@@ -64,73 +64,73 @@
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"长度"
width=
"
9
0"
>
<el-table-column
label=
"长度"
width=
"
7
0"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnLength'"
>
<el-input-number
v-model=
"scope.row.columnLength"
style=
"width: 7
0px;"
:controls=
"false"
/>
<el-input-number
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnLength"
style=
"width: 5
0px;"
:controls=
"false"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"小数位"
width=
"70"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.columnScale'"
>
<el-input-number
v-model=
"scope.row.columnScale"
style=
"width: 50px;"
:controls=
"false"
/>
<el-input-number
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.columnScale"
style=
"width: 50px;"
:controls=
"false"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"默认值"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.defaultValue'"
>
<el-input
v-model=
"scope.row.defaultValue"
clearable
placeholder=
"请输入默认值"
/>
<el-input
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.defaultValue"
clearable
placeholder=
"请输入默认值"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"主键"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isPk'"
>
<el-checkbox
v-model=
"scope.row.isPk"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isPk"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"必填"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isRequired'"
>
<el-checkbox
v-model=
"scope.row.isRequired"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isRequired"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"插入"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isInsert'"
>
<el-checkbox
v-model=
"scope.row.isInsert"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isInsert"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"编辑"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isEdit'"
>
<el-checkbox
v-model=
"scope.row.isEdit"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isEdit"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"列表"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isList'"
>
<el-checkbox
v-model=
"scope.row.isList"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isList"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"查询"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.isQuery'"
>
<el-checkbox
v-model=
"scope.row.isQuery"
true-label=
"1"
false-label=
"0"
/>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isQuery"
true-label=
"1"
false-label=
"0"
/>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"查询方式"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.queryType'"
>
<el-select
v-model=
"scope.row.queryType"
clearable
placeholder=
"请选择"
>
<el-select
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.queryType"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in queryTypeOptions"
:key=
"item.value"
...
...
@@ -144,7 +144,7 @@
<el-table-column
label=
"显示类型"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.htmlType'"
:rules=
"rules.htmlType"
>
<el-select
v-model=
"scope.row.htmlType"
clearable
placeholder=
"请选择"
>
<el-select
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.htmlType"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in htmlTypeOptions"
:key=
"item.value"
...
...
@@ -158,9 +158,9 @@
<el-table-column
label=
"操作"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-form-item>
<el-button
:disabled=
"scope.
$index === 0"
@
click=
"upRow(scope.$index)"
icon=
"el-icon-arrow-up"
circle
></el-button
>
<el-button
:disabled=
"scope.
$index === (form.modelColumns.length - 1)"
@
click=
"downRow(scope.$index)"
icon=
"el-icon-arrow-down"
circle
></el-button
>
<el-button
@
click=
"delRow(scope.$index)"
icon=
"el-icon-delete"
circle
></el-button
>
<el-button
:disabled=
"scope.
row.isSystem === '1' || scope.$index
<
=
8
"
icon=
"el-icon-arrow-up"
circle
@
click=
"upRow(scope.$index)"
/
>
<el-button
:disabled=
"scope.
row.isSystem === '1' || scope.$index === (form.modelColumns.length - 1)"
icon=
"el-icon-arrow-down"
circle
@
click=
"downRow(scope.$index)"
/
>
<el-button
:disabled=
"scope.row.isSystem === '1'"
icon=
"el-icon-delete"
circle
@
click=
"delRow(scope.$index)"
/
>
</el-form-item>
</
template
>
</el-table-column>
...
...
@@ -240,7 +240,7 @@ export default {
this
.
statusOptions
=
response
.
data
}
})
this
.
getDicts
(
'data_type_
oracle
'
).
then
(
response
=>
{
this
.
getDicts
(
'data_type_
mysql
'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
columnTypeOptions
=
response
.
data
}
...
...
@@ -275,10 +275,11 @@ export default {
const
item
=
{
columnName
:
''
,
columnComment
:
''
,
columnType
:
'char'
,
columnType
:
'
var
char'
,
columnLength
:
'255'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isSystem
:
'0'
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
...
...
@@ -333,6 +334,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/metadata/changerecord/ChangeRecordAdd.vue
View file @
b0437b7e
...
...
@@ -128,6 +128,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/metadata/changerecord/ChangeRecordEdit.vue
View file @
b0437b7e
...
...
@@ -151,6 +151,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/metadata/datasource/DataSourceAdd.vue
View file @
b0437b7e
...
...
@@ -214,6 +214,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/metadata/datasource/DataSourceEdit.vue
View file @
b0437b7e
...
...
@@ -212,6 +212,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/scheduler/job/JobAdd.vue
View file @
b0437b7e
...
...
@@ -125,6 +125,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/scheduler/job/JobEdit.vue
View file @
b0437b7e
...
...
@@ -135,6 +135,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/standard/datadict/DataDictAdd.vue
View file @
b0437b7e
...
...
@@ -115,6 +115,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/standard/datadict/DataDictEdit.vue
View file @
b0437b7e
...
...
@@ -126,6 +126,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/config/ConfigAdd.vue
View file @
b0437b7e
...
...
@@ -116,6 +116,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/config/ConfigEdit.vue
View file @
b0437b7e
...
...
@@ -126,6 +126,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/dept/DeptAdd.vue
View file @
b0437b7e
...
...
@@ -151,6 +151,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/dept/DeptEdit.vue
View file @
b0437b7e
...
...
@@ -159,6 +159,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/dict/DictAdd.vue
View file @
b0437b7e
...
...
@@ -114,6 +114,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/dict/DictEdit.vue
View file @
b0437b7e
...
...
@@ -124,6 +124,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/dict/item/DictItemAdd.vue
View file @
b0437b7e
...
...
@@ -120,6 +120,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/dict/item/DictItemEdit.vue
View file @
b0437b7e
...
...
@@ -127,6 +127,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/menu/MenuAdd.vue
View file @
b0437b7e
...
...
@@ -203,6 +203,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/menu/MenuEdit.vue
View file @
b0437b7e
...
...
@@ -208,6 +208,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/post/PostAdd.vue
View file @
b0437b7e
...
...
@@ -104,6 +104,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/post/PostEdit.vue
View file @
b0437b7e
...
...
@@ -114,6 +114,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/role/RoleAdd.vue
View file @
b0437b7e
...
...
@@ -222,6 +222,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/role/RoleEdit.vue
View file @
b0437b7e
...
...
@@ -247,6 +247,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/user/UserAdd.vue
View file @
b0437b7e
...
...
@@ -231,6 +231,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/system/user/UserEdit.vue
View file @
b0437b7e
...
...
@@ -232,6 +232,10 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
...
...
datax-ui/src/views/visual/dataset/DataSetAdd.vue
View file @
b0437b7e
...
...
@@ -341,8 +341,7 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
data
.
msg
||
'保存失败'
)
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
...
...
datax-ui/src/views/visual/dataset/DataSetEdit.vue
View file @
b0437b7e
...
...
@@ -360,8 +360,7 @@ export default {
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
data
.
msg
||
'保存失败'
)
}).
catch
(()
=>
{
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment