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
fb9168b4
Commit
fb9168b4
authored
Sep 08, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
6cd1539f
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
248 additions
and
12 deletions
+248
-12
RedisConstant.java
...ore/src/main/java/cn/datax/common/core/RedisConstant.java
+2
-0
StartedUpRunner.java
...n/datax/service/data/standard/config/StartedUpRunner.java
+28
-0
DictController.java
...atax/service/data/standard/controller/DictController.java
+11
-0
DictService.java
...a/cn/datax/service/data/standard/service/DictService.java
+2
-0
DictServiceImpl.java
...x/service/data/standard/service/impl/DictServiceImpl.java
+24
-0
datadict.js
datax-ui/src/api/standard/datadict.js
+7
-0
DataModelAdd.vue
datax-ui/src/views/masterdata/datamodel/DataModelAdd.vue
+59
-8
DataModelDetail.vue
datax-ui/src/views/masterdata/datamodel/DataModelDetail.vue
+47
-1
DataModelEdit.vue
datax-ui/src/views/masterdata/datamodel/DataModelEdit.vue
+51
-2
DataDictList.vue
datax-ui/src/views/standard/datadict/DataDictList.vue
+17
-1
No files found.
datax-common/datax-common-core/src/main/java/cn/datax/common/core/RedisConstant.java
View file @
fb9168b4
...
...
@@ -17,4 +17,6 @@ public interface RedisConstant {
String
METADATA_COLUMN_KEY
=
"data:metadata:columns"
;
String
VISUAL_SET_KEY
=
"data:visual:sets"
;
String
STANDARD_DICT_KEY
=
"data:standard:dicts"
;
}
datax-modules/data-standard-service-parent/data-standard-service/src/main/java/cn/datax/service/data/standard/config/StartedUpRunner.java
View file @
fb9168b4
package
cn
.
datax
.
service
.
data
.
standard
.
config
;
import
cn.datax.common.core.RedisConstant
;
import
cn.datax.common.redis.service.RedisService
;
import
cn.datax.service.data.standard.api.entity.DictEntity
;
import
cn.datax.service.data.standard.dao.DictDao
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.core.env.Environment
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Component
@RequiredArgsConstructor
...
...
@@ -17,6 +27,15 @@ public class StartedUpRunner implements ApplicationRunner {
private
final
ConfigurableApplicationContext
context
;
private
final
Environment
environment
;
@Autowired
private
DictDao
dictDao
;
@Autowired
private
RedisService
redisService
;
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Override
public
void
run
(
ApplicationArguments
args
)
{
if
(
context
.
isActive
())
{
...
...
@@ -26,6 +45,15 @@ public class StartedUpRunner implements ApplicationRunner {
"端口号:"
+
environment
.
getProperty
(
"server.port"
)
+
"\n"
+
"-----------------------------------------"
;
System
.
out
.
println
(
banner
);
// 项目启动时,初始化缓存
String
dictKey
=
RedisConstant
.
STANDARD_DICT_KEY
;
Boolean
hasDictKey
=
redisService
.
hasKey
(
dictKey
);
if
(!
hasDictKey
)
{
List
<
DictEntity
>
dictEntityList
=
dictDao
.
selectList
(
Wrappers
.
emptyWrapper
());
Map
<
String
,
List
<
DictEntity
>>
dictListMap
=
dictEntityList
.
stream
().
collect
(
Collectors
.
groupingBy
(
DictEntity:
:
getTypeId
));
redisTemplate
.
opsForHash
().
putAll
(
dictKey
,
dictListMap
);
}
}
}
}
datax-modules/data-standard-service-parent/data-standard-service/src/main/java/cn/datax/service/data/standard/controller/DictController.java
View file @
fb9168b4
...
...
@@ -135,4 +135,15 @@ public class DictController extends BaseController {
dictService
.
deleteDictBatch
(
ids
);
return
R
.
ok
();
}
/**
* 刷新字典缓存
*
* @return
*/
@GetMapping
(
"/refresh"
)
public
R
refreshDict
()
{
dictService
.
refreshDict
();
return
R
.
ok
();
}
}
datax-modules/data-standard-service-parent/data-standard-service/src/main/java/cn/datax/service/data/standard/service/DictService.java
View file @
fb9168b4
...
...
@@ -25,4 +25,6 @@ public interface DictService extends BaseService<DictEntity> {
void
deleteDictById
(
String
id
);
void
deleteDictBatch
(
List
<
String
>
ids
);
void
refreshDict
();
}
datax-modules/data-standard-service-parent/data-standard-service/src/main/java/cn/datax/service/data/standard/service/impl/DictServiceImpl.java
View file @
fb9168b4
package
cn
.
datax
.
service
.
data
.
standard
.
service
.
impl
;
import
cn.datax.common.core.RedisConstant
;
import
cn.datax.common.redis.service.RedisService
;
import
cn.datax.service.data.standard.api.entity.DictEntity
;
import
cn.datax.service.data.standard.api.dto.DictDto
;
import
cn.datax.service.data.standard.service.DictService
;
import
cn.datax.service.data.standard.mapstruct.DictMapper
;
import
cn.datax.service.data.standard.dao.DictDao
;
import
cn.datax.common.base.BaseServiceImpl
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* <p>
...
...
@@ -31,6 +37,12 @@ public class DictServiceImpl extends BaseServiceImpl<DictDao, DictEntity> implem
@Autowired
private
DictMapper
dictMapper
;
@Autowired
private
RedisService
redisService
;
@Autowired
private
RedisTemplate
<
String
,
Object
>
redisTemplate
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
DictEntity
saveDict
(
DictDto
dictDto
)
{
...
...
@@ -64,4 +76,16 @@ public class DictServiceImpl extends BaseServiceImpl<DictDao, DictEntity> implem
public
void
deleteDictBatch
(
List
<
String
>
ids
)
{
dictDao
.
deleteBatchIds
(
ids
);
}
@Override
public
void
refreshDict
()
{
String
dictKey
=
RedisConstant
.
STANDARD_DICT_KEY
;
Boolean
hasDictKey
=
redisService
.
hasKey
(
dictKey
);
if
(
hasDictKey
)
{
redisService
.
del
(
dictKey
);
}
List
<
DictEntity
>
dictEntityList
=
dictDao
.
selectList
(
Wrappers
.
emptyWrapper
());
Map
<
String
,
List
<
DictEntity
>>
dictListMap
=
dictEntityList
.
stream
().
collect
(
Collectors
.
groupingBy
(
DictEntity:
:
getTypeId
));
redisTemplate
.
opsForHash
().
putAll
(
dictKey
,
dictListMap
);
}
}
datax-ui/src/api/standard/datadict.js
View file @
fb9168b4
import
request
from
'@/utils/request'
export
function
refreshDict
()
{
return
request
({
url
:
'/data/standard/dicts/refresh'
,
method
:
'get'
})
}
export
function
listDataDictType
(
data
)
{
return
request
({
url
:
'/data/standard/types/list'
,
...
...
datax-ui/src/views/masterdata/datamodel/DataModelAdd.vue
View file @
fb9168b4
...
...
@@ -192,6 +192,41 @@
</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 + '.isBindDict'"
>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isBindDict"
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 + '.bindDictTypeId'"
>
<el-select
:disabled=
"scope.row.isSystem === '1' || scope.row.isBindDict === '0'"
v-model=
"scope.row.bindDictTypeId"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in dictTypeOptions"
:key=
"item.id"
:label=
"item.gbTypeName"
:value=
"item.id"
/>
</el-select>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"标准字典字段"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.bindDictColumn'"
>
<el-select
:disabled=
"scope.row.isSystem === '1' || scope.row.isBindDict === '0'"
v-model=
"scope.row.bindDictColumn"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in dictColumnOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
</
template
>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
...
...
@@ -206,6 +241,7 @@
<
script
>
import
{
addDataModel
}
from
'@/api/masterdata/datamodel'
import
{
listDataDictType
}
from
'@/api/standard/datadict'
export
default
{
name
:
'DataModelAdd'
,
...
...
@@ -269,15 +305,22 @@ export default {
queryTypeOptions
:
[],
// 显示类型数据字典
htmlTypeOptions
:
[],
// 数据标准类别数据字典
dictTypeOptions
:
[],
// 标准字典字段数据字典
dictColumnOptions
:
[
{
value
:
'gb_code'
,
label
:
'标准编码'
},
{
value
:
'gb_name'
,
label
:
'标准名称'
}
],
// 系统默认列
systemColumns
:
[
{
columnName
:
'id'
,
columnComment
:
'主键ID'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'1'
,
isRequired
:
'1'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'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'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'number'
,
isSystem
:
'1'
},
{
columnName
:
'create_by'
,
columnComment
:
'创建人'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'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'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'datetime'
,
isSystem
:
'1'
},
{
columnName
:
'create_dept'
,
columnComment
:
'创建人所属部门'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'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'
,
isDetail
:
'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'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'datetime'
,
isSystem
:
'1'
}
{
columnName
:
'id'
,
columnComment
:
'主键ID'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'1'
,
isRequired
:
'1'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
},
{
columnName
:
'status'
,
columnComment
:
'状态(0禁用,1启用)'
,
columnType
:
'tinyint'
,
columnLength
:
'0'
,
columnScale
:
'0'
,
defaultValue
:
'1'
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'number'
,
isSystem
:
'1'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
},
{
columnName
:
'create_by'
,
columnComment
:
'创建人'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
},
{
columnName
:
'create_time'
,
columnComment
:
'创建日期'
,
columnType
:
'datetime'
,
columnLength
:
'0'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'datetime'
,
isSystem
:
'1'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
},
{
columnName
:
'create_dept'
,
columnComment
:
'创建人所属部门'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
},
{
columnName
:
'update_by'
,
columnComment
:
'更新人'
,
columnType
:
'varchar'
,
columnLength
:
'20'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
,
isSystem
:
'1'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
},
{
columnName
:
'update_time'
,
columnComment
:
'更新日期'
,
columnType
:
'datetime'
,
columnLength
:
'0'
,
columnScale
:
'0'
,
defaultValue
:
''
,
isPk
:
'0'
,
isRequired
:
'0'
,
isInsert
:
'0'
,
isEdit
:
'0'
,
isDetail
:
'0'
,
isList
:
'0'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'datetime'
,
isSystem
:
'1'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
}
]
}
},
...
...
@@ -302,6 +345,11 @@ export default {
this
.
htmlTypeOptions
=
response
.
data
}
})
listDataDictType
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
dictTypeOptions
=
response
.
data
}
})
},
mounted
()
{
this
.
form
.
modelColumns
=
this
.
form
.
modelColumns
.
concat
(
this
.
systemColumns
)
...
...
@@ -327,7 +375,10 @@ export default {
isList
:
'1'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
htmlType
:
'input'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
}
this
.
form
.
modelColumns
.
push
(
item
)
},
...
...
datax-ui/src/views/masterdata/datamodel/DataModelDetail.vue
View file @
fb9168b4
...
...
@@ -185,6 +185,41 @@
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"数据标准"
align=
"center"
width=
"55"
>
<
template
slot-scope=
"scope"
>
<el-form-item>
<el-checkbox
v-model=
"scope.row.isBindDict"
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>
<el-select
v-model=
"scope.row.bindDictTypeId"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in dictTypeOptions"
:key=
"item.id"
:label=
"item.gbTypeName"
:value=
"item.id"
/>
</el-select>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"标准字典字段"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-form-item>
<el-select
v-model=
"scope.row.bindDictColumn"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in dictColumnOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
</
template
>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
...
...
@@ -195,6 +230,7 @@
<
script
>
import
{
getDataModel
,
createTable
}
from
'@/api/masterdata/datamodel'
import
{
listDataDictType
}
from
'@/api/standard/datadict'
export
default
{
name
:
'DataModelDetail'
,
...
...
@@ -224,7 +260,12 @@ export default {
activeName
:
'first'
,
columnTypeOptions
:
[],
queryTypeOptions
:
[],
htmlTypeOptions
:
[]
htmlTypeOptions
:
[],
dictTypeOptions
:
[],
dictColumnOptions
:
[
{
value
:
'gb_code'
,
label
:
'标准编码'
},
{
value
:
'gb_name'
,
label
:
'标准名称'
}
]
}
},
created
()
{
...
...
@@ -249,6 +290,11 @@ export default {
this
.
htmlTypeOptions
=
response
.
data
}
})
listDataDictType
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
dictTypeOptions
=
response
.
data
}
})
},
mounted
()
{
this
.
getDataModel
(
this
.
data
.
id
)
...
...
datax-ui/src/views/masterdata/datamodel/DataModelEdit.vue
View file @
fb9168b4
...
...
@@ -192,6 +192,41 @@
</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 + '.isBindDict'"
>
<el-checkbox
:disabled=
"scope.row.isSystem === '1'"
v-model=
"scope.row.isBindDict"
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 + '.bindDictTypeId'"
>
<el-select
:disabled=
"scope.row.isSystem === '1' || scope.row.isBindDict === '0'"
v-model=
"scope.row.bindDictTypeId"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in dictTypeOptions"
:key=
"item.id"
:label=
"item.gbTypeName"
:value=
"item.id"
/>
</el-select>
</el-form-item>
</
template
>
</el-table-column>
<el-table-column
label=
"标准字典字段"
width=
"120"
>
<
template
slot-scope=
"scope"
>
<el-form-item
:prop=
"'modelColumns.' + scope.$index + '.bindDictColumn'"
>
<el-select
:disabled=
"scope.row.isSystem === '1' || scope.row.isBindDict === '0'"
v-model=
"scope.row.bindDictColumn"
clearable
placeholder=
"请选择"
>
<el-option
v-for=
"item in dictColumnOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
</el-form-item>
</
template
>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
...
...
@@ -202,6 +237,7 @@
<
script
>
import
{
getDataModel
,
updateDataModel
}
from
'@/api/masterdata/datamodel'
import
{
listDataDictType
}
from
'@/api/standard/datadict'
export
default
{
name
:
'DataModelEdit'
,
...
...
@@ -258,7 +294,12 @@ export default {
activeName
:
'first'
,
columnTypeOptions
:
[],
queryTypeOptions
:
[],
htmlTypeOptions
:
[]
htmlTypeOptions
:
[],
dictTypeOptions
:
[],
dictColumnOptions
:
[
{
value
:
'gb_code'
,
label
:
'标准编码'
},
{
value
:
'gb_name'
,
label
:
'标准名称'
}
]
}
},
created
()
{
...
...
@@ -283,6 +324,11 @@ export default {
this
.
htmlTypeOptions
=
response
.
data
}
})
listDataDictType
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
dictTypeOptions
=
response
.
data
}
})
},
mounted
()
{
this
.
getDataModel
(
this
.
data
.
id
)
...
...
@@ -316,7 +362,10 @@ export default {
isList
:
'1'
,
isQuery
:
'0'
,
queryType
:
''
,
htmlType
:
'input'
htmlType
:
'input'
,
isBindDict
:
'0'
,
bindDictTypeId
:
''
,
bindDictColumn
:
''
}
this
.
form
.
modelColumns
.
push
(
item
)
},
...
...
datax-ui/src/views/standard/datadict/DataDictList.vue
View file @
fb9168b4
...
...
@@ -85,6 +85,12 @@
:disabled=
"multiple"
@
click=
"handleBatchDelete"
>
删除
</el-button>
<el-button
type=
"warning"
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"handleCacheRefresh"
>
刷新缓存
</el-button>
</el-button-group>
</el-col>
<el-col
:span=
"12"
>
...
...
@@ -214,7 +220,7 @@
</template>
<
script
>
import
{
listDataDictType
,
addDataDictType
,
updateDataDictType
,
delDataDictType
,
pageDataDict
,
delDataDict
}
from
'@/api/standard/datadict'
import
{
listDataDictType
,
addDataDictType
,
updateDataDictType
,
delDataDictType
,
pageDataDict
,
delDataDict
,
refreshDict
}
from
'@/api/standard/datadict'
export
default
{
name
:
'DataDictList'
,
...
...
@@ -476,6 +482,16 @@ export default {
this
.
showOptions
.
showDetail
=
true
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 刷新缓存 */
handleCacheRefresh
()
{
refreshDict
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'刷新缓存成功'
)
}
else
{
this
.
$message
.
error
(
'刷新缓存失败'
)
}
})
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$confirm
(
'选中数据将被永久删除, 是否继续?'
,
'提示'
,
{
...
...
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