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
1a97dd64
Commit
1a97dd64
authored
Aug 04, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
44b84151
Show whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
43 additions
and
4185 deletions
+43
-4185
datax-gateway-dev.yml
datax-config/src/main/resources/config/datax-gateway-dev.yml
+1
-1
pom.xml
datax-modules/data-market-service-parent/pom.xml
+1
-1
MetadataChangeRecordDto.java
...ervice/data/metadata/api/dto/MetadataChangeRecordDto.java
+1
-0
dataconsole.js
datax-ui/src/api/factory/dataconsole.js
+0
-17
dataset.js
datax-ui/src/api/factory/dataset.js
+0
-62
datasource.js
datax-ui/src/api/factory/datasource.js
+0
-84
datatheme.js
datax-ui/src/api/factory/datatheme.js
+0
-54
metadata.js
datax-ui/src/api/metadata/metadata.js
+0
-16
index.js
datax-ui/src/router/index.js
+8
-2
index.vue
datax-ui/src/views/factory/console/index.vue
+0
-189
DataSetAdd.vue
datax-ui/src/views/factory/dataset/DataSetAdd.vue
+0
-390
DataSetDetail.vue
datax-ui/src/views/factory/dataset/DataSetDetail.vue
+0
-287
DataSetEdit.vue
datax-ui/src/views/factory/dataset/DataSetEdit.vue
+0
-405
DataSetList.vue
datax-ui/src/views/factory/dataset/DataSetList.vue
+0
-356
index.vue
datax-ui/src/views/factory/dataset/index.vue
+0
-48
DataSourceAdd.vue
datax-ui/src/views/factory/datasource/DataSourceAdd.vue
+0
-258
DataSourceDetail.vue
datax-ui/src/views/factory/datasource/DataSourceDetail.vue
+0
-218
DataSourceEdit.vue
datax-ui/src/views/factory/datasource/DataSourceEdit.vue
+0
-256
DataSourceList.vue
datax-ui/src/views/factory/datasource/DataSourceList.vue
+0
-356
index.vue
datax-ui/src/views/factory/datasource/index.vue
+0
-48
DataThemeAdd.vue
datax-ui/src/views/factory/datatheme/DataThemeAdd.vue
+0
-123
DataThemeDetail.vue
datax-ui/src/views/factory/datatheme/DataThemeDetail.vue
+0
-96
DataThemeEdit.vue
datax-ui/src/views/factory/datatheme/DataThemeEdit.vue
+0
-133
DataThemeList.vue
datax-ui/src/views/factory/datatheme/DataThemeList.vue
+0
-356
index.vue
datax-ui/src/views/factory/datatheme/index.vue
+0
-48
ApiMaskList.vue
datax-ui/src/views/market/apimask/ApiMaskList.vue
+0
-7
DataApiAdd.vue
datax-ui/src/views/market/dataapi/DataApiAdd.vue
+1
-1
DataApiCall.vue
datax-ui/src/views/market/dataapi/DataApiCall.vue
+1
-1
DataApiDetail.vue
datax-ui/src/views/market/dataapi/DataApiDetail.vue
+3
-3
DataApiEdit.vue
datax-ui/src/views/market/dataapi/DataApiEdit.vue
+1
-1
DataApiList.vue
datax-ui/src/views/market/dataapi/DataApiList.vue
+1
-11
ChangeRecordList.vue
...x-ui/src/views/metadata/changerecord/ChangeRecordList.vue
+0
-7
index.vue
datax-ui/src/views/metadata/datacolumn/index.vue
+2
-2
index.vue
datax-ui/src/views/metadata/datasearch/index.vue
+2
-2
DataSourceList.vue
datax-ui/src/views/metadata/datasource/DataSourceList.vue
+0
-7
board.vue
datax-ui/src/views/visual/databoard/board.vue
+15
-0
chart.vue
datax-ui/src/views/visual/datachart/chart.vue
+2
-2
make.vue
datax-ui/src/views/visual/datachart/make.vue
+0
-326
DataSetAdd.vue
datax-ui/src/views/visual/dataset/DataSetAdd.vue
+1
-1
DataSetDetail.vue
datax-ui/src/views/visual/dataset/DataSetDetail.vue
+1
-1
DataSetEdit.vue
datax-ui/src/views/visual/dataset/DataSetEdit.vue
+2
-2
DataSetList.vue
datax-ui/src/views/visual/dataset/DataSetList.vue
+0
-7
No files found.
datax-config/src/main/resources/config/datax-gateway-dev.yml
View file @
1a97dd64
...
@@ -84,7 +84,7 @@ spring:
...
@@ -84,7 +84,7 @@ spring:
args
:
args
:
name
:
dataSqlConsoleHystrix
name
:
dataSqlConsoleHystrix
fallbackUri
:
forward:/fallback
fallbackUri
:
forward:/fallback
# 数据
市场
中心
# 数据
集市
中心
-
id
:
datax-service-data-market
-
id
:
datax-service-data-market
uri
:
lb://datax-service-data-market
uri
:
lb://datax-service-data-market
predicates
:
predicates
:
...
...
datax-modules/data-market-service-parent/pom.xml
View file @
1a97dd64
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<version>
2.0.0
</version>
<version>
2.0.0
</version>
<description>
数据
市场
</description>
<description>
数据
集市
</description>
<artifactId>
data-market-service-parent
</artifactId>
<artifactId>
data-market-service-parent
</artifactId>
<modules>
<modules>
...
...
datax-modules/data-metadata-service-parent/data-metadata-service-api/src/main/java/cn/datax/service/data/metadata/api/dto/MetadataChangeRecordDto.java
View file @
1a97dd64
...
@@ -7,6 +7,7 @@ import lombok.Data;
...
@@ -7,6 +7,7 @@ import lombok.Data;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
java.io.Serializable
;
import
java.io.Serializable
;
/**
/**
* <p>
* <p>
* 元数据变更记录表 实体DTO
* 元数据变更记录表 实体DTO
...
...
datax-ui/src/api/factory/dataconsole.js
deleted
100644 → 0
View file @
44b84151
import
request
from
'@/utils/request'
export
function
runData
(
data
)
{
return
request
({
url
:
'/data/console/v1/run'
,
method
:
'post'
,
data
:
data
})
}
export
function
stopData
(
data
)
{
return
request
({
url
:
'/data/console/v1/stop'
,
method
:
'post'
,
data
:
data
})
}
datax-ui/src/api/factory/dataset.js
deleted
100644 → 0
View file @
44b84151
import
request
from
'@/utils/request'
export
function
listDataSet
(
data
)
{
return
request
({
url
:
'/data/factory/dataSets/list'
,
method
:
'get'
,
params
:
data
})
}
export
function
pageDataSet
(
data
)
{
return
request
({
url
:
'/data/factory/dataSets/page'
,
method
:
'get'
,
params
:
data
})
}
export
function
getDataSet
(
id
)
{
return
request
({
url
:
'/data/factory/dataSets/'
+
id
,
method
:
'get'
})
}
export
function
delDataSet
(
id
)
{
return
request
({
url
:
'/data/factory/dataSets/'
+
id
,
method
:
'delete'
})
}
export
function
delDataSets
(
ids
)
{
return
request
({
url
:
'/data/factory/dataSets/batch/'
+
ids
,
method
:
'delete'
})
}
export
function
addDataSet
(
data
)
{
return
request
({
url
:
'/data/factory/dataSets'
,
method
:
'post'
,
data
:
data
})
}
export
function
updateDataSet
(
data
)
{
return
request
({
url
:
'/data/factory/dataSets/'
+
data
.
id
,
method
:
'put'
,
data
:
data
})
}
export
function
sqlAnalyse
(
data
)
{
return
request
({
url
:
'/data/factory/dataSets/sql/analyse'
,
method
:
'post'
,
data
:
data
})
}
datax-ui/src/api/factory/datasource.js
deleted
100644 → 0
View file @
44b84151
import
request
from
'@/utils/request'
export
function
listDataSource
(
data
)
{
return
request
({
url
:
'/data/factory/dataSources/list'
,
method
:
'get'
,
params
:
data
})
}
export
function
pageDataSource
(
data
)
{
return
request
({
url
:
'/data/factory/dataSources/page'
,
method
:
'get'
,
params
:
data
})
}
export
function
getDataSource
(
id
)
{
return
request
({
url
:
'/data/factory/dataSources/'
+
id
,
method
:
'get'
})
}
export
function
delDataSource
(
id
)
{
return
request
({
url
:
'/data/factory/dataSources/'
+
id
,
method
:
'delete'
})
}
export
function
delDataSources
(
ids
)
{
return
request
({
url
:
'/data/factory/dataSources/batch/'
+
ids
,
method
:
'delete'
})
}
export
function
addDataSource
(
data
)
{
return
request
({
url
:
'/data/factory/dataSources'
,
method
:
'post'
,
data
:
data
})
}
export
function
updateDataSource
(
data
)
{
return
request
({
url
:
'/data/factory/dataSources/'
+
data
.
id
,
method
:
'put'
,
data
:
data
})
}
export
function
checkConnection
(
data
)
{
return
request
({
url
:
'/data/factory/dataSources/checkConnection'
,
method
:
'post'
,
data
:
data
})
}
export
function
queryByPage
(
data
)
{
return
request
({
url
:
'/data/factory/dataSources/queryByPage'
,
method
:
'post'
,
data
:
data
})
}
export
function
getDbTables
(
id
)
{
return
request
({
url
:
'/data/factory/dataSources/'
+
id
+
'/tables'
,
method
:
'get'
})
}
export
function
getDbTableColumns
(
id
,
tableName
)
{
return
request
({
url
:
'/data/factory/dataSources/'
+
id
+
'/'
+
tableName
+
'/columns'
,
method
:
'get'
})
}
datax-ui/src/api/factory/datatheme.js
deleted
100644 → 0
View file @
44b84151
import
request
from
'@/utils/request'
export
function
listDataTheme
(
data
)
{
return
request
({
url
:
'/data/factory/dataThemes/list'
,
method
:
'get'
,
params
:
data
})
}
export
function
pageDataTheme
(
data
)
{
return
request
({
url
:
'/data/factory/dataThemes/page'
,
method
:
'get'
,
params
:
data
})
}
export
function
getDataTheme
(
id
)
{
return
request
({
url
:
'/data/factory/dataThemes/'
+
id
,
method
:
'get'
})
}
export
function
delDataTheme
(
id
)
{
return
request
({
url
:
'/data/factory/dataThemes/'
+
id
,
method
:
'delete'
})
}
export
function
delDataThemes
(
ids
)
{
return
request
({
url
:
'/data/factory/dataThemes/batch/'
+
ids
,
method
:
'delete'
})
}
export
function
addDataTheme
(
data
)
{
return
request
({
url
:
'/data/factory/dataThemes'
,
method
:
'post'
,
data
:
data
})
}
export
function
updateDataTheme
(
data
)
{
return
request
({
url
:
'/data/factory/dataThemes/'
+
data
.
id
,
method
:
'put'
,
data
:
data
})
}
datax-ui/src/api/metadata/metadata.js
deleted
100644 → 0
View file @
44b84151
import
request
from
'@/utils/request'
export
function
sync
(
id
)
{
return
request
({
url
:
'/data/metadata/databases/sync/'
+
id
,
method
:
'post'
})
}
export
function
word
(
id
)
{
return
request
({
url
:
'/data/metadata/databases/word/'
+
id
,
method
:
'post'
,
responseType
:
'blob'
})
}
datax-ui/src/router/index.js
View file @
1a97dd64
...
@@ -50,8 +50,14 @@ export const constantRoutes = [
...
@@ -50,8 +50,14 @@ export const constantRoutes = [
},
},
{
{
path
:
'/chart/make'
,
path
:
'/data/chart'
,
component
:
()
=>
import
(
'@/views/chartboard/chart/make'
),
component
:
()
=>
import
(
'@/views/visual/datachart/chart'
),
hidden
:
true
},
{
path
:
'/data/board'
,
component
:
()
=>
import
(
'@/views/visual/databoard/board'
),
hidden
:
true
hidden
:
true
},
},
...
...
datax-ui/src/views/factory/console/index.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div
class=
"app-container"
>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
</div>
<div
:style=
"classCardbody"
>
<el-row>
<el-col
:span=
"24"
>
<el-select
v-model=
"sqlDataSource"
placeholder=
"请选择数据源"
>
<el-option
v-for=
"source in sourceOptions"
:key=
"source.id"
:label=
"source.sourceName"
:value=
"source.id"
:disabled=
"source.status === '0'"
></el-option>
</el-select>
<el-button
size=
"mini"
round
@
click=
"runData"
:disabled=
"sqlExecuting"
>
运行
</el-button>
<el-button
size=
"mini"
round
@
click=
"stopData"
:disabled=
"!sqlExecuting"
>
停止
</el-button>
<el-button
size=
"mini"
round
@
click=
"formaterSql"
:disabled=
"sqlExecuting"
>
格式化
</el-button>
<el-button
size=
"mini"
round
@
click=
"refreshData"
:disabled=
"sqlExecuting"
>
重置
</el-button>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"24"
>
<sql-editor
ref=
"sqleditor"
:value=
"sqlText"
@
changeTextarea=
"changeTextarea($event)"
style=
"height: 300px;margin: 20px 0;"
></sql-editor>
</el-col>
</el-row>
<el-row>
<el-col>
<div
v-if=
"sqlExecuting"
v-loading=
"sqlExecuting"
>
数据加载中...
</div>
<div
v-else
>
<div
v-if=
"sqlConsole.length > 0"
>
<el-tabs
type=
"border-card"
v-model=
"activeTabName"
>
<el-tab-pane
label=
"信息"
name=
"table0"
>
<pre>
{{
executeResultInfo
}}
</pre>
</el-tab-pane>
<el-tab-pane
v-for=
"(item,index) in sqlConsole"
:key=
"(index+1)"
:name=
"'table'+(index+1)"
:label=
"'结果'+(index+1)"
>
<el-table
:data=
"item.dataList"
stripe
border
:max-height=
"300"
style=
"width: 100%; margin: 15px 0;"
>
<el-table-column
label=
"序号"
width=
"55"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<
template
v-for=
"(column, index) in item.columnList"
>
<el-table-column
:prop=
"column"
:label=
"column"
:key=
"index"
align=
"center"
show-overflow-tooltip
/>
</
template
>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</div>
</el-col>
</el-row>
</div>
</el-card>
</div>
</template>
<
script
>
import
sqlFormatter
from
'sql-formatter'
import
SqlEditor
from
'@/components/SqlEditor'
import
{
listDataSource
}
from
'@/api/factory/datasource'
import
{
runData
,
stopData
}
from
'@/api/factory/dataconsole'
export
default
{
name
:
'SqlConsole'
,
components
:
{
SqlEditor
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'SQL工作台'
,
// 数据源数据字典
sourceOptions
:
[],
sqlDataSource
:
undefined
,
sqlText
:
undefined
,
sqlExecuting
:
false
,
activeTabName
:
'table0'
,
sqlExecutorId
:
undefined
,
sqlConsole
:
[],
executeResultInfo
:
undefined
}
},
created
()
{
this
.
getDataSourceList
()
},
methods
:
{
getDataSourceList
()
{
listDataSource
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
sourceOptions
=
response
.
data
}
})
},
runData
()
{
if
(
!
this
.
sqlDataSource
)
{
this
.
$message
.
error
(
'数据源不能为空'
)
return
}
if
(
!
this
.
sqlText
)
{
this
.
$message
.
error
(
'查询SQL不能为空'
)
return
}
this
.
sqlExecuting
=
true
this
.
sqlExecutorId
=
(
new
Date
()).
getTime
()
+
Math
.
ceil
(
Math
.
random
()
*
1000
)
this
.
sqlConsole
=
[]
let
data
=
{}
data
.
sqlKey
=
this
.
sqlExecutorId
data
.
sourceId
=
this
.
sqlDataSource
data
.
sqlText
=
this
.
sqlText
runData
(
data
).
then
(
response
=>
{
if
(
response
.
success
)
{
const
{
data
}
=
response
let
resultStr
=
''
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
let
item
=
data
[
i
]
resultStr
+=
item
.
sql
resultStr
+=
'
\
n> 状态:'
+
((
item
.
success
)
?
'成功'
:
'失败'
)
if
(
item
.
count
&&
item
.
count
>=
0
)
{
resultStr
+=
'
\
n> 影响行数:'
+
item
.
count
}
resultStr
+=
'
\
n> 耗时:'
+
(
item
.
time
||
0
)
/
1000
+
's'
resultStr
+=
'
\
n
\
n'
}
this
.
executeResultInfo
=
resultStr
this
.
sqlConsole
=
data
this
.
sqlExecuting
=
false
}
})
},
stopData
()
{
let
data
=
{}
data
.
sqlKey
=
this
.
sqlExecutorId
stopData
(
data
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
sqlExecuting
=
false
this
.
$message
.
success
(
'停止成功'
)
}
else
{
this
.
$message
.
error
(
'停止失败'
)
}
})
},
changeTextarea
(
val
)
{
this
.
sqlText
=
val
},
formaterSql
()
{
if
(
!
this
.
sqlText
)
{
return
}
this
.
$refs
.
sqleditor
.
editor
.
setValue
(
sqlFormatter
.
format
(
this
.
$refs
.
sqleditor
.
editor
.
getValue
()))
},
refreshData
()
{
if
(
!
this
.
sqlText
)
{
return
}
this
.
sqlExecuting
=
false
this
.
activeTabName
=
'table0'
this
.
sqlExecutorId
=
undefined
this
.
sqlText
=
undefined
this
.
$refs
.
sqleditor
.
editor
.
setValue
(
''
)
this
.
sqlConsole
=
[]
this
.
executeResultInfo
=
undefined
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/dataset/DataSetAdd.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-plus"
round
@
click=
"submitForm"
:loading=
"loadingOptions.loading"
:disabled=
"loadingOptions.isDisabled"
>
{{
loadingOptions
.
loadingText
}}
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"数据源"
prop=
"sourceId"
>
<el-select
v-model=
"form.sourceId"
placeholder=
"请选择数据源"
>
<el-option
v-for=
"source in sourceOptions"
:key=
"source.id"
:label=
"source.sourceName"
:value=
"source.id"
:disabled=
"source.status === '0'"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据集名称"
prop=
"setName"
>
<el-input
v-model=
"form.setName"
placeholder=
"请输入数据集名称"
/>
</el-form-item>
<el-divider
content-position=
"left"
>
数据集
</el-divider>
<el-row>
<el-col
:span=
"24"
style=
"padding: 0 20px;"
>
<sql-editor
ref=
"sqleditor"
:value=
"form.setSql"
@
changeTextarea=
"changeTextarea($event)"
style=
"height: 300px;"
></sql-editor>
</el-col>
</el-row>
<el-form-item>
<el-button
size=
"mini"
type=
"primary"
@
click=
"formaterSql"
>
Sql格式化
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"analyseSql"
>
Sql解析
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"dataPreview"
>
数据预览
</el-button>
</el-form-item>
<el-divider
content-position=
"left"
>
数据模型定义
</el-divider>
<el-row
style=
"height: 300px;padding: 0 20px;"
>
<el-col
:span=
"12"
style=
"border: 1px dashed #999;height: 100%;"
>
<div
class=
"tag-group"
>
<draggable
v-model=
"columnList"
:options=
"
{sort: false, group: {name: 'col', pull:'clone', put: false}}">
<el-tag
v-for=
"(item, index) in columnList"
:key=
"index"
class=
"draggable-tag"
>
{{
item
.
col
}}
</el-tag>
</draggable>
</div>
</el-col>
<el-col
:span=
"12"
style=
"box-shadow: 0 0 1px 1px #ccc;height: 100%;"
>
<el-row>
<el-divider
content-position=
"left"
>
维度列
</el-divider>
<el-col>
<div
style=
"height: 90px; border: 1px dashed #999; margin: 0 10px;"
>
<draggable
group=
"col"
:list=
"dimensionList"
>
<div
v-for=
"(item, index) in dimensionList"
:key=
"index"
class=
"draggable-item"
>
<el-tag>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</el-tag>
<span
class=
"draggable-item-handle"
v-if=
"item.input"
>
<el-input
size=
"mini"
placeholder=
"请输入内容"
v-model=
"item.alias"
@
blur=
"handleDelTagLabel(index, item)"
>
</el-input>
</span>
<span
class=
"draggable-item-handle"
v-else
@
click=
"handleTagLabel(index, item)"
><i
class=
"el-icon-edit-outline"
></i></span>
<span
class=
"draggable-item-handle"
@
click=
"handleDimensionTagClose(index, item)"
><i
class=
"el-icon-delete"
></i></span>
</div>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider
content-position=
"left"
>
指标列
</el-divider>
<el-col>
<div
style=
"height: 90px; border: 1px dashed #999; margin: 0 10px;"
>
<draggable
group=
"col"
:list=
"measureList"
>
<div
v-for=
"(item, index) in measureList"
:key=
"index"
class=
"draggable-item"
>
<el-tag>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</el-tag>
<span
class=
"draggable-item-handle"
v-if=
"item.input"
>
<el-input
size=
"mini"
placeholder=
"请输入内容"
v-model=
"item.alias"
@
blur=
"handleDelTagLabel(index, item)"
>
</el-input>
</span>
<span
class=
"draggable-item-handle"
v-else
@
click=
"handleTagLabel(index, item)"
><i
class=
"el-icon-edit-outline"
></i></span>
<span
class=
"draggable-item-handle"
@
click=
"handleMeasureTagClose(index, item)"
><i
class=
"el-icon-delete"
></i></span>
</div>
</draggable>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
</div>
<el-drawer
:visible
.
sync=
"drawer"
direction=
"btt"
:with-header=
"false"
>
<el-table
:data=
"previewData.dataList"
stripe
border
:max-height=
"200"
style=
"width: 100%; margin: 15px 0;"
>
<el-table-column
label=
"序号"
width=
"55"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<
template
v-for=
"(column, index) in previewData.columnList"
>
<el-table-column
:prop=
"column"
:label=
"column"
:key=
"index"
align=
"center"
show-overflow-tooltip
/>
</
template
>
</el-table>
<el-pagination
:page-sizes=
"[10, 20, 50, 100]"
layout=
"total, sizes, prev, pager, next, jumper"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"previewData.pageNum"
:page-size
.
sync=
"previewData.pageSize"
:total=
"previewData.dataTotal"
></el-pagination>
</el-drawer>
</el-card>
</div>
</template>
<
script
>
import
{
addDataSet
,
sqlAnalyse
}
from
'@/api/factory/dataset'
import
{
listDataSource
,
queryByPage
}
from
'@/api/factory/datasource'
import
sqlFormatter
from
'sql-formatter'
import
SqlEditor
from
'@/components/SqlEditor'
import
draggable
from
'vuedraggable'
export
default
{
name
:
'DataSetAdd'
,
components
:
{
SqlEditor
,
draggable
},
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据集新增'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 保存按钮
loadingOptions
:
{
loading
:
false
,
loadingText
:
'保存'
,
isDisabled
:
false
},
// 表单参数
form
:
{
id
:
undefined
,
sourceId
:
undefined
,
setSql
:
undefined
,
status
:
'1'
,
remark
:
undefined
},
// 表单校验
rules
:
{
sourceId
:
[
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'change'
}
],
setName
:
[
{
required
:
true
,
message
:
'数据集名称不能为空'
,
trigger
:
'blur'
}
]
},
// 状态数据字典
statusOptions
:
[],
// 数据源数据字典
sourceOptions
:
[],
// 解析字段
columns
:
[],
columnList
:
[],
dimensionList
:
[],
measureList
:
[],
drawer
:
false
,
previewData
:
{
dataList
:
[],
columnList
:
[],
pageNum
:
1
,
pageSize
:
20
,
dataTotal
:
0
}
}
},
created
()
{
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getDataSourceList
()
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
getDataSourceList
()
{
listDataSource
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
sourceOptions
=
response
.
data
}
})
},
// 绑定编辑器value值的变化
changeTextarea
(
val
)
{
this
.
$set
(
this
.
form
,
'setSql'
,
val
)
},
formaterSql
()
{
if
(
!
this
.
form
.
setSql
)
{
return
}
this
.
$refs
.
sqleditor
.
editor
.
setValue
(
sqlFormatter
.
format
(
this
.
$refs
.
sqleditor
.
editor
.
getValue
()))
},
analyseSql
()
{
if
(
!
this
.
form
.
setSql
)
{
return
}
let
data
=
{}
data
.
sqlText
=
this
.
form
.
setSql
sqlAnalyse
(
data
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
columns
=
response
.
data
this
.
columnList
=
this
.
columns
.
map
(
function
(
item
)
{
let
json
=
{}
json
.
col
=
item
json
.
alias
=
''
return
json
})
this
.
dimensionList
=
[]
this
.
measureList
=
[]
}
})
},
handleDimensionTagClose
(
index
,
tag
)
{
this
.
dimensionList
.
splice
(
index
,
1
)
tag
.
alias
=
''
this
.
columnList
.
push
(
tag
)
},
handleMeasureTagClose
(
index
,
tag
)
{
this
.
measureList
.
splice
(
index
,
1
)
tag
.
alias
=
''
this
.
columnList
.
push
(
tag
)
},
handleTagLabel
(
index
,
tag
)
{
this
.
$set
(
tag
,
'input'
,
true
)
},
handleDelTagLabel
(
index
,
tag
)
{
this
.
$delete
(
tag
,
'input'
)
},
dataPreview
()
{
if
(
!
this
.
form
.
sourceId
)
{
return
}
if
(
!
this
.
form
.
setSql
)
{
return
}
let
data
=
{}
data
.
dataSourceId
=
this
.
form
.
sourceId
data
.
sql
=
this
.
form
.
setSql
data
.
pageNum
=
this
.
previewData
.
pageNum
data
.
pageSize
=
this
.
previewData
.
pageSize
queryByPage
(
data
).
then
(
response
=>
{
if
(
response
.
success
)
{
const
{
data
}
=
response
let
dataList
=
data
.
data
||
[]
let
columnList
=
[]
if
(
dataList
.
length
>
0
)
{
columnList
=
Object
.
keys
(
dataList
[
0
])
}
this
.
previewData
.
dataList
=
dataList
this
.
previewData
.
columnList
=
columnList
this
.
previewData
.
dataTotal
=
data
.
total
this
.
drawer
=
true
}
})
},
handleSizeChange
(
val
)
{
this
.
previewData
.
pageNum
=
1
this
.
previewData
.
pageSize
=
val
this
.
dataPreview
()
},
handleCurrentChange
(
val
)
{
this
.
previewData
.
pageNum
=
val
this
.
dataPreview
()
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
let
schema
=
{}
schema
.
columns
=
this
.
columns
||
[]
schema
.
dimensions
=
this
.
dimensionList
||
[]
schema
.
measures
=
this
.
measureList
||
[]
this
.
form
.
schemaConfig
=
schema
this
.
loadingOptions
.
loading
=
true
this
.
loadingOptions
.
loadingText
=
'保存中...'
this
.
loadingOptions
.
isDisabled
=
true
addDataSet
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'保存成功'
)
setTimeout
(()
=>
{
// 2秒后跳转列表页
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
2000
)
}
else
{
this
.
$message
.
error
(
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
data
.
msg
||
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.draggable-tag
{
margin
:
10px
;
cursor
:
move
;
}
.draggable-item
{
cursor
:
move
;
margin
:
5px
5px
;
display
:
inline-block
;
border
:
1px
solid
#ebecef
;
height
:
32px
;
line-height
:
30px
;
border-radius
:
4px
;
.draggable-item-handle
{
background-color
:
#ecf5ff
;
border-color
:
#d9ecff
;
display
:
inline-block
;
height
:
32px
;
padding
:
0
10px
;
line-height
:
30px
;
font-size
:
12px
;
color
:
#409EFF
;
border-width
:
1px
;
border-style
:
solid
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
cursor
:
pointer
;
margin-left
:
-5px
;
}
}
</
style
>
datax-ui/src/views/factory/dataset/DataSetDetail.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<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=
"dataPreview"
>
数据预览
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"80px"
disabled
>
<el-form-item
label=
"数据源"
prop=
"sourceId"
>
<el-select
v-model=
"form.sourceId"
placeholder=
"请选择数据源"
>
<el-option
v-for=
"source in sourceOptions"
:key=
"source.id"
:label=
"source.sourceName"
:value=
"source.id"
:disabled=
"source.status === '0'"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据集名称"
prop=
"setName"
>
<el-input
v-model=
"form.setName"
placeholder=
"请输入数据集名称"
/>
</el-form-item>
<el-divider
content-position=
"left"
>
数据集
</el-divider>
<el-row>
<el-col
:span=
"24"
style=
"padding: 0 20px;"
>
<sql-editor
ref=
"sqleditor"
:value=
"form.setSql"
:readOnly=
"true"
style=
"height: 300px;"
></sql-editor>
</el-col>
</el-row>
<el-divider
content-position=
"left"
>
数据模型定义
</el-divider>
<el-row
style=
"height: 300px;padding: 0 20px;"
>
<el-col
:span=
"12"
style=
"border: 1px dashed #999;height: 100%;"
>
<div
class=
"tag-group"
>
<el-tag
v-for=
"(item, index) in columnList"
:key=
"index"
class=
"draggable-tag"
>
{{
item
.
col
}}
</el-tag>
</div>
</el-col>
<el-col
:span=
"12"
style=
"box-shadow: 0 0 1px 1px #ccc;height: 100%;"
>
<el-row>
<el-divider
content-position=
"left"
>
维度列
</el-divider>
<el-col>
<div
style=
"height: 90px; border: 1px dashed #999; margin: 0 10px;"
>
<el-tag
v-for=
"(item, index) in dimensionList"
:key=
"index"
class=
"draggable-item"
>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</el-tag>
</div>
</el-col>
</el-row>
<el-row>
<el-divider
content-position=
"left"
>
指标列
</el-divider>
<el-col>
<div
style=
"height: 90px; border: 1px dashed #999; margin: 0 10px;"
>
<el-tag
v-for=
"(item, index) in measureList"
:key=
"index"
class=
"draggable-item"
>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</el-tag>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<el-drawer
:visible
.
sync=
"drawer"
direction=
"btt"
:with-header=
"false"
>
<el-table
:data=
"previewData.dataList"
stripe
border
:max-height=
"200"
style=
"width: 100%; margin: 15px 0;"
>
<el-table-column
label=
"序号"
width=
"55"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<
template
v-for=
"(column, index) in previewData.columnList"
>
<el-table-column
:prop=
"column"
:label=
"column"
:key=
"index"
align=
"center"
show-overflow-tooltip
/>
</
template
>
</el-table>
<el-pagination
:page-sizes=
"[10, 20, 50, 100]"
layout=
"total, sizes, prev, pager, next, jumper"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"previewData.pageNum"
:page-size
.
sync=
"previewData.pageSize"
:total=
"previewData.dataTotal"
></el-pagination>
</el-drawer>
</div>
</el-card>
</div>
</template>
<
script
>
import
{
getDataSet
}
from
'@/api/factory/dataset'
import
{
listDataSource
,
queryByPage
}
from
'@/api/factory/datasource'
import
SqlEditor
from
'@/components/SqlEditor'
export
default
{
name
:
'DataSetDetail'
,
components
:
{
SqlEditor
},
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据集详情'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 表单参数
form
:
{},
// 状态数据字典
statusOptions
:
[],
// 数据源数据字典
sourceOptions
:
[],
// 解析字段
columns
:
[],
columnList
:
[],
dimensionList
:
[],
measureList
:
[],
drawer
:
false
,
previewData
:
{
dataList
:
[],
columnList
:
[],
pageNum
:
1
,
pageSize
:
20
,
dataTotal
:
0
}
}
},
created
()
{
console
.
log
(
'id:'
+
this
.
data
.
id
)
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getDataSourceList
()
},
mounted
()
{
this
.
getDataSet
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
getDataSourceList
()
{
listDataSource
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
sourceOptions
=
response
.
data
}
})
},
/** 获取详情 */
getDataSet
:
function
(
id
)
{
getDataSet
(
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
form
=
response
.
data
this
.
columns
=
this
.
form
.
schemaConfig
.
columns
||
[]
if
(
this
.
columns
&&
this
.
columns
.
length
>
0
)
{
this
.
dimensionList
=
this
.
form
.
schemaConfig
.
dimensions
||
[]
this
.
measureList
=
this
.
form
.
schemaConfig
.
measures
||
[]
this
.
columnList
=
this
.
columns
.
filter
(
x
=>
[...
this
.
dimensionList
,
...
this
.
measureList
].
every
(
y
=>
y
.
col
!==
x
)).
map
(
function
(
item
)
{
let
json
=
{}
json
.
col
=
item
json
.
alias
=
''
return
json
})
}
this
.
$refs
.
sqleditor
.
editor
.
setValue
(
this
.
form
.
setSql
)
}
})
},
dataPreview
()
{
if
(
!
this
.
form
.
sourceId
)
{
return
}
if
(
!
this
.
form
.
setSql
)
{
return
}
let
data
=
{}
data
.
dataSourceId
=
this
.
form
.
sourceId
data
.
sql
=
this
.
form
.
setSql
data
.
pageNum
=
this
.
previewData
.
pageNum
data
.
pageSize
=
this
.
previewData
.
pageSize
queryByPage
(
data
).
then
(
response
=>
{
if
(
response
.
success
)
{
const
{
data
}
=
response
let
dataList
=
data
.
data
||
[]
let
columnList
=
[]
if
(
dataList
.
length
>
0
)
{
columnList
=
Object
.
keys
(
dataList
[
0
])
}
this
.
previewData
.
dataList
=
dataList
this
.
previewData
.
columnList
=
columnList
this
.
previewData
.
dataTotal
=
data
.
total
this
.
drawer
=
true
}
})
},
handleSizeChange
(
val
)
{
this
.
previewData
.
pageNum
=
1
this
.
previewData
.
pageSize
=
val
this
.
dataPreview
()
},
handleCurrentChange
(
val
)
{
this
.
previewData
.
pageNum
=
val
this
.
dataPreview
()
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.draggable-tag
{
margin
:
10px
;
cursor
:
move
;
}
.draggable-item
{
cursor
:
move
;
margin
:
5px
5px
;
display
:
inline-block
;
border
:
1px
solid
#ebecef
;
height
:
32px
;
line-height
:
30px
;
border-radius
:
4px
;
.draggable-item-handle
{
background-color
:
#ecf5ff
;
border-color
:
#d9ecff
;
display
:
inline-block
;
height
:
32px
;
padding
:
0
10px
;
line-height
:
30px
;
font-size
:
12px
;
color
:
#409EFF
;
border-width
:
1px
;
border-style
:
solid
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
cursor
:
pointer
;
margin-left
:
-5px
;
}
}
</
style
>
datax-ui/src/views/factory/dataset/DataSetEdit.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-plus"
round
@
click=
"submitForm"
:loading=
"loadingOptions.loading"
:disabled=
"loadingOptions.isDisabled"
>
{{
loadingOptions
.
loadingText
}}
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"数据源"
prop=
"sourceId"
>
<el-select
v-model=
"form.sourceId"
placeholder=
"请选择数据源"
>
<el-option
v-for=
"source in sourceOptions"
:key=
"source.id"
:label=
"source.sourceName"
:value=
"source.id"
:disabled=
"source.status === '0'"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据集名称"
prop=
"setName"
>
<el-input
v-model=
"form.setName"
placeholder=
"请输入数据集名称"
/>
</el-form-item>
<el-divider
content-position=
"left"
>
数据集
</el-divider>
<el-row
style=
"padding: 0 20px;"
>
<el-col
:span=
"24"
>
<sql-editor
ref=
"sqleditor"
:value=
"form.setSql"
@
changeTextarea=
"changeTextarea($event)"
style=
"height: 300px;"
></sql-editor>
</el-col>
</el-row>
<el-form-item>
<el-button
size=
"mini"
type=
"primary"
@
click=
"formaterSql"
>
Sql格式化
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"analyseSql"
>
Sql解析
</el-button>
<el-button
size=
"mini"
type=
"primary"
@
click=
"dataPreview"
>
数据预览
</el-button>
</el-form-item>
<el-divider
content-position=
"left"
>
数据模型定义
</el-divider>
<el-row
style=
"height: 300px;padding: 0 20px;"
>
<el-col
:span=
"12"
style=
"border: 1px dashed #999;height: 100%;"
>
<div
class=
"tag-group"
>
<draggable
v-model=
"columnList"
:options=
"
{sort: false, group: {name: 'col', pull: true, put: false}}">
<el-tag
v-for=
"(item, index) in columnList"
:key=
"index"
class=
"draggable-tag"
>
{{
item
.
col
}}
</el-tag>
</draggable>
</div>
</el-col>
<el-col
:span=
"12"
style=
"box-shadow: 0 0 1px 1px #ccc;height: 100%;"
>
<el-row>
<el-divider
content-position=
"left"
>
维度列
</el-divider>
<el-col>
<div
style=
"height: 90px; border: 1px dashed #999; margin: 0 10px;"
>
<draggable
group=
"col"
:list=
"dimensionList"
>
<div
v-for=
"(item, index) in dimensionList"
:key=
"index"
class=
"draggable-item"
>
<el-tag>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</el-tag>
<span
class=
"draggable-item-handle"
v-if=
"item.input"
>
<el-input
size=
"mini"
placeholder=
"请输入内容"
v-model=
"item.alias"
@
blur=
"handleDelTagLabel(index, item)"
>
</el-input>
</span>
<span
class=
"draggable-item-handle"
v-else
@
click=
"handleTagLabel(index, item)"
><i
class=
"el-icon-edit-outline"
></i></span>
<span
class=
"draggable-item-handle"
@
click=
"handleDimensionTagClose(index, item)"
><i
class=
"el-icon-delete"
></i></span>
</div>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider
content-position=
"left"
>
指标列
</el-divider>
<el-col>
<div
style=
"height: 90px; border: 1px dashed #999; margin: 0 10px;"
>
<draggable
group=
"col"
:list=
"measureList"
>
<div
v-for=
"(item, index) in measureList"
:key=
"index"
class=
"draggable-item"
>
<el-tag>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</el-tag>
<span
class=
"draggable-item-handle"
v-if=
"item.input"
>
<el-input
size=
"mini"
placeholder=
"请输入内容"
v-model=
"item.alias"
@
blur=
"handleDelTagLabel(index, item)"
>
</el-input>
</span>
<span
class=
"draggable-item-handle"
v-else
@
click=
"handleTagLabel(index, item)"
><i
class=
"el-icon-edit-outline"
></i></span>
<span
class=
"draggable-item-handle"
@
click=
"handleMeasureTagClose(index, item)"
><i
class=
"el-icon-delete"
></i></span>
</div>
</draggable>
</div>
</el-col>
</el-row>
</el-col>
</el-row>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<el-drawer
:visible
.
sync=
"drawer"
direction=
"btt"
:with-header=
"false"
>
<el-table
:data=
"previewData.dataList"
stripe
border
:max-height=
"200"
style=
"width: 100%; margin: 15px 0;"
>
<el-table-column
label=
"序号"
width=
"55"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<
template
v-for=
"(column, index) in previewData.columnList"
>
<el-table-column
:prop=
"column"
:label=
"column"
:key=
"index"
align=
"center"
show-overflow-tooltip
/>
</
template
>
</el-table>
<el-pagination
:page-sizes=
"[10, 20, 50, 100]"
layout=
"total, sizes, prev, pager, next, jumper"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"previewData.pageNum"
:page-size
.
sync=
"previewData.pageSize"
:total=
"previewData.dataTotal"
></el-pagination>
</el-drawer>
</div>
</el-card>
</div>
</template>
<
script
>
import
{
getDataSet
,
updateDataSet
,
sqlAnalyse
}
from
'@/api/factory/dataset'
import
{
listDataSource
,
queryByPage
}
from
'@/api/factory/datasource'
import
sqlFormatter
from
'sql-formatter'
import
SqlEditor
from
'@/components/SqlEditor'
import
draggable
from
'vuedraggable'
export
default
{
name
:
'DataSetEdit'
,
components
:
{
SqlEditor
,
draggable
},
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据集编辑'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 保存按钮
loadingOptions
:
{
loading
:
false
,
loadingText
:
'保存'
,
isDisabled
:
false
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
sourceId
:
[
{
required
:
true
,
message
:
'数据源不能为空'
,
trigger
:
'change'
}
],
setName
:
[
{
required
:
true
,
message
:
'数据集名称不能为空'
,
trigger
:
'blur'
}
]
},
// 状态数据字典
statusOptions
:
[],
// 数据源数据字典
sourceOptions
:
[],
// 解析字段
columns
:
[],
columnList
:
[],
dimensionList
:
[],
measureList
:
[],
drawer
:
false
,
previewData
:
{
dataList
:
[],
columnList
:
[],
pageNum
:
1
,
pageSize
:
20
,
dataTotal
:
0
}
}
},
created
()
{
console
.
log
(
'id:'
+
this
.
data
.
id
)
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getDataSourceList
()
},
mounted
()
{
this
.
getDataSet
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
getDataSourceList
()
{
listDataSource
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
sourceOptions
=
response
.
data
}
})
},
/** 获取详情 */
getDataSet
:
function
(
id
)
{
getDataSet
(
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
form
=
response
.
data
this
.
columns
=
this
.
form
.
schemaConfig
.
columns
||
[]
if
(
this
.
columns
&&
this
.
columns
.
length
>
0
)
{
this
.
dimensionList
=
this
.
form
.
schemaConfig
.
dimensions
||
[]
this
.
measureList
=
this
.
form
.
schemaConfig
.
measures
||
[]
this
.
columnList
=
this
.
columns
.
filter
(
x
=>
[...
this
.
dimensionList
,
...
this
.
measureList
].
every
(
y
=>
y
.
col
!==
x
)).
map
(
function
(
item
)
{
let
json
=
{}
json
.
col
=
item
json
.
alias
=
''
return
json
})
}
this
.
$refs
.
sqleditor
.
editor
.
setValue
(
this
.
form
.
setSql
)
}
})
},
// 绑定编辑器value值的变化
changeTextarea
(
val
)
{
this
.
$set
(
this
.
form
,
'setSql'
,
val
)
},
formaterSql
()
{
this
.
$refs
.
sqleditor
.
editor
.
setValue
(
sqlFormatter
.
format
(
this
.
$refs
.
sqleditor
.
editor
.
getValue
()))
},
analyseSql
()
{
if
(
!
this
.
form
.
setSql
)
{
return
}
let
data
=
{}
data
.
sqlText
=
this
.
form
.
setSql
sqlAnalyse
(
data
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
columns
=
response
.
data
this
.
columnList
=
this
.
columns
.
map
(
function
(
item
)
{
let
json
=
{}
json
.
col
=
item
json
.
alias
=
''
return
json
})
this
.
dimensionList
=
[]
this
.
measureList
=
[]
}
})
},
handleDimensionTagClose
(
index
,
tag
)
{
this
.
dimensionList
.
splice
(
index
,
1
)
tag
.
alias
=
''
this
.
columnList
.
push
(
tag
)
},
handleMeasureTagClose
(
index
,
tag
)
{
this
.
measureList
.
splice
(
index
,
1
)
tag
.
alias
=
''
this
.
columnList
.
push
(
tag
)
},
handleTagLabel
(
index
,
tag
)
{
this
.
$set
(
tag
,
'input'
,
true
)
},
handleDelTagLabel
(
index
,
tag
)
{
this
.
$delete
(
tag
,
'input'
)
},
dataPreview
()
{
if
(
!
this
.
form
.
sourceId
)
{
return
}
if
(
!
this
.
form
.
setSql
)
{
return
}
let
data
=
{}
data
.
dataSourceId
=
this
.
form
.
sourceId
data
.
sql
=
this
.
form
.
setSql
data
.
pageNum
=
this
.
previewData
.
pageNum
data
.
pageSize
=
this
.
previewData
.
pageSize
queryByPage
(
data
).
then
(
response
=>
{
if
(
response
.
success
)
{
const
{
data
}
=
response
let
dataList
=
data
.
data
||
[]
let
columnList
=
[]
if
(
dataList
.
length
>
0
)
{
columnList
=
Object
.
keys
(
dataList
[
0
])
}
this
.
previewData
.
dataList
=
dataList
this
.
previewData
.
columnList
=
columnList
this
.
previewData
.
dataTotal
=
data
.
total
this
.
drawer
=
true
}
})
},
handleSizeChange
(
val
)
{
this
.
previewData
.
pageNum
=
1
this
.
previewData
.
pageSize
=
val
this
.
dataPreview
()
},
handleCurrentChange
(
val
)
{
this
.
previewData
.
pageNum
=
val
this
.
dataPreview
()
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
let
schema
=
{}
schema
.
columns
=
this
.
columns
||
[]
schema
.
dimensions
=
this
.
dimensionList
||
[]
schema
.
measures
=
this
.
measureList
||
[]
this
.
form
.
schemaConfig
=
schema
this
.
loadingOptions
.
loading
=
true
this
.
loadingOptions
.
loadingText
=
'保存中...'
this
.
loadingOptions
.
isDisabled
=
true
updateDataSet
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'保存成功'
)
setTimeout
(()
=>
{
// 2秒后跳转列表页
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
2000
)
}
else
{
this
.
$message
.
error
(
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
}).
catch
(
error
=>
{
this
.
$message
.
error
(
error
.
data
.
msg
||
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
})
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.draggable-tag
{
margin
:
10px
;
cursor
:
move
;
}
.draggable-item
{
cursor
:
move
;
margin
:
5px
5px
;
display
:
inline-block
;
border
:
1px
solid
#ebecef
;
height
:
32px
;
line-height
:
30px
;
border-radius
:
4px
;
.draggable-item-handle
{
background-color
:
#ecf5ff
;
border-color
:
#d9ecff
;
display
:
inline-block
;
height
:
32px
;
padding
:
0
10px
;
line-height
:
30px
;
font-size
:
12px
;
color
:
#409EFF
;
border-width
:
1px
;
border-style
:
solid
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
cursor
:
pointer
;
margin-left
:
-5px
;
}
}
</
style
>
datax-ui/src/views/factory/dataset/DataSetList.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
>
<el-form-item
label=
"数据集名称"
prop=
"setName"
>
<el-input
v-model=
"queryParams.setName"
placeholder=
"请输入数据集名称"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
type=
"flex"
justify=
"space-between"
>
<el-col
:span=
"12"
>
<el-button-group>
<el-button
type=
"primary"
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPerm=
"['factory:dataset:add']"
>
新增
</el-button>
<el-button
type=
"success"
icon=
"el-icon-edit-outline"
size=
"mini"
:disabled=
"single"
@
click=
"handleEdit"
v-hasPerm=
"['factory:dataset:edit']"
>
修改
</el-button>
<el-button
type=
"info"
icon=
"el-icon-view"
size=
"mini"
:disabled=
"single"
@
click=
"handleDetail"
v-hasPerm=
"['factory:dataset:detail']"
>
详情
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
v-hasPerm=
"['factory:dataset:remove']"
>
删除
</el-button>
</el-button-group>
</el-col>
<el-col
:span=
"12"
>
<div
class=
"right-toolbar"
>
<el-tooltip
content=
"密度"
effect=
"dark"
placement=
"top"
>
<el-dropdown
trigger=
"click"
@
command=
"handleCommand"
>
<el-button
circle
size=
"mini"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"colum-height"
/>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"medium"
>
正常
</el-dropdown-item>
<el-dropdown-item
command=
"small"
>
中等
</el-dropdown-item>
<el-dropdown-item
command=
"mini"
>
紧凑
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-tooltip>
<el-tooltip
content=
"刷新"
effect=
"dark"
placement=
"top"
>
<el-button
circle
size=
"mini"
@
click=
"handleRefresh"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"shuaxin"
/>
</el-button>
</el-tooltip>
<el-tooltip
content=
"列设置"
effect=
"dark"
placement=
"top"
>
<el-popover
placement=
"bottom"
width=
"100"
trigger=
"click"
>
<el-checkbox-group
v-model=
"checkedTableColumns"
@
change=
"handleCheckedColsChange"
>
<el-checkbox
v-for=
"(item, index) in tableColumns"
:key=
"index"
:label=
"item.prop"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
<span
slot=
"reference"
>
<el-button
circle
size=
"mini"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"shezhi"
/>
</el-button>
</span>
</el-popover>
</el-tooltip>
</div>
</el-col>
</el-row>
<el-table
v-loading=
"loading"
:data=
"dataSetList"
@
selection-change=
"handleSelectionChange"
border
tooltip-effect=
"dark"
:size=
"tableSize"
:height=
"tableHeight"
style=
"width: 100%;margin: 15px 0;"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"序号"
width=
"55"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<
template
v-for=
"(item, index) in tableColumns"
>
<el-table-column
v-if=
"item.show"
:prop=
"item.prop"
:label=
"item.label"
:key=
"index"
:formatter=
"item.formatter"
align=
"center"
show-overflow-tooltip
/>
</
template
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"left"
trigger=
"click"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['factory:dataset:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['factory:dataset:detail']"
>
详情
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['factory:dataset:remove']"
>
删除
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</
template
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes=
"[10, 20, 50, 100]"
layout=
"total, sizes, prev, pager, next, jumper"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"queryParams.pageNum"
:page-size
.
sync=
"queryParams.pageSize"
:total=
"total"
></el-pagination>
</el-card>
</div>
</template>
<
script
>
import
{
pageDataSet
,
delDataSet
,
delDataSets
}
from
'@/api/factory/dataset'
export
default
{
name
:
'DataSetList'
,
data
()
{
return
{
tableHeight
:
document
.
body
.
offsetHeight
-
340
+
'px'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 表格头
tableColumns
:
[
{
prop
:
'setName'
,
label
:
'数据集名称'
,
show
:
true
},
{
prop
:
'status'
,
label
:
'状态'
,
show
:
true
,
formatter
:
this
.
statusFormatter
},
{
prop
:
'createTime'
,
label
:
'创建时间'
,
show
:
true
}
],
// 默认选择中表格头
checkedTableColumns
:
[],
tableSize
:
'medium'
,
// 状态数据字典
statusOptions
:
[],
// 数据集表格数据
dataSetList
:
[],
// 总数据条数
total
:
0
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
20
,
setName
:
''
}
}
},
created
()
{
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getList
()
},
mounted
()
{
this
.
initCols
()
},
methods
:
{
/** 查询数据集列表 */
getList
()
{
this
.
loading
=
true
pageDataSet
(
this
.
queryParams
).
then
(
response
=>
{
this
.
loading
=
false
if
(
response
.
success
)
{
const
{
data
}
=
response
this
.
dataSetList
=
data
.
data
this
.
total
=
data
.
total
}
})
},
initCols
()
{
this
.
checkedTableColumns
=
this
.
tableColumns
.
map
(
col
=>
col
.
prop
)
},
handleCheckedColsChange
(
val
)
{
this
.
tableColumns
.
forEach
(
col
=>
{
if
(
!
this
.
checkedTableColumns
.
includes
(
col
.
prop
))
{
col
.
show
=
false
}
else
{
col
.
show
=
true
}
})
},
handleCommand
(
command
)
{
this
.
tableSize
=
command
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
this
.
getList
()
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
$refs
[
'queryForm'
].
resetFields
()
this
.
handleQuery
()
},
/** 刷新列表 */
handleRefresh
()
{
this
.
getList
()
},
/** 多选框选中数据 */
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
showOptions
.
data
=
{}
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
true
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 修改按钮操作 */
handleEdit
(
row
)
{
this
.
showOptions
.
data
.
id
=
row
.
id
||
this
.
ids
[
0
]
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
true
this
.
showOptions
.
showDetail
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 详情按钮操作 */
handleDetail
(
row
)
{
this
.
showOptions
.
data
.
id
=
row
.
id
||
this
.
ids
[
0
]
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
true
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$confirm
(
'选中数据将被永久删除, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
delDataSet
(
row
.
id
)
}).
then
(()
=>
{
this
.
$message
.
success
(
'删除成功'
)
this
.
getList
()
}).
catch
(()
=>
{
})
},
/** 批量删除按钮操作 */
handleBatchDelete
()
{
if
(
!
this
.
ids
.
length
)
{
this
.
$message
({
message
:
'请先选择需要操作的数据'
,
type
:
'warning'
})
}
this
.
$message
.
warning
(
'不支持批量删除'
)
},
handleSizeChange
(
val
)
{
console
.
log
(
`每页
${
val
}
条`
)
this
.
queryParams
.
pageNum
=
1
this
.
queryParams
.
pageSize
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
console
.
log
(
`当前页:
${
val
}
`
)
this
.
queryParams
.
pageNum
=
val
this
.
getList
()
},
statusFormatter
(
row
,
column
,
cellValue
,
index
)
{
let
dictLabel
=
this
.
selectDictLabel
(
this
.
statusOptions
,
cellValue
)
if
(
cellValue
===
'1'
)
{
return
<
el
-
tag
type
=
"success"
>
{
dictLabel
}
<
/el-tag
>
}
else
{
return
<
el
-
tag
type
=
"warning"
>
{
dictLabel
}
<
/el-tag
>
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.right-toolbar
{
float
:
right
;
}
</
style
>
datax-ui/src/views/factory/dataset/index.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div
class=
"app-container"
>
<transition
name=
"el-zoom-in-center"
>
<data-set-list
v-if=
"options.showList"
@
showCard=
"showCard"
></data-set-list>
</transition>
<transition
name=
"el-zoom-in-top"
>
<data-set-add
v-if=
"options.showAdd"
:data=
"options.data"
@
showCard=
"showCard"
></data-set-add>
</transition>
<transition
name=
"el-zoom-in-top"
>
<data-set-edit
v-if=
"options.showEdit"
:data=
"options.data"
@
showCard=
"showCard"
></data-set-edit>
</transition>
<transition
name=
"el-zoom-in-bottom"
>
<data-set-detail
v-if=
"options.showDetail"
:data=
"options.data"
@
showCard=
"showCard"
></data-set-detail>
</transition>
</div>
</
template
>
<
script
>
import
DataSetList
from
'./DataSetList'
import
DataSetAdd
from
'./DataSetAdd'
import
DataSetEdit
from
'./DataSetEdit'
import
DataSetDetail
from
'./DataSetDetail'
export
default
{
name
:
'DataSet'
,
components
:
{
DataSetList
,
DataSetAdd
,
DataSetEdit
,
DataSetDetail
},
data
()
{
return
{
options
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
}
}
},
methods
:
{
showCard
(
data
)
{
Object
.
assign
(
this
.
options
,
data
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datasource/DataSourceAdd.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-plus"
v-if=
"active == 2"
round
@
click=
"submitForm"
:loading=
"loadingOptions.loading"
:disabled=
"loadingOptions.isDisabled"
>
{{
loadingOptions
.
loadingText
}}
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-steps
:active=
"active"
finish-status=
"success"
align-center
>
<el-step
title=
"数据源信息"
></el-step>
<el-step
title=
"连接信息"
></el-step>
</el-steps>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
v-if=
"active == 1"
>
<el-form-item
label=
"数据源类型"
prop=
"dbType"
>
<el-select
v-model=
"form.dbType"
>
<el-option
v-for=
"item in dbTypeOptions"
:key=
"item.id"
:label=
"item.itemValue"
:value=
"item.itemText"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据主题"
prop=
"themeId"
>
<el-select
v-model=
"form.themeId"
placeholder=
"请选择数据主题"
>
<el-option
v-for=
"item in themeOptions"
:key=
"item.id"
:label=
"item.themeName"
:value=
"item.id"
:disabled=
"item.status === '0'"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据源名称"
prop=
"sourceName"
>
<el-input
v-model=
"form.sourceName"
placeholder=
"请输入数据源名称"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<el-form
ref=
"form2"
:model=
"form2"
:rules=
"rules2"
label-width=
"80px"
v-if=
"active == 2"
>
<el-form-item
label=
"主机"
prop=
"host"
>
<el-input
v-model=
"form2.host"
placeholder=
"请输入主机"
/>
</el-form-item>
<el-form-item
label=
"端口"
prop=
"port"
>
<el-input
v-model=
"form2.port"
placeholder=
"请输入端口"
/>
</el-form-item>
<el-form-item
label=
"服务名"
prop=
"sid"
v-if=
"form.dbType === '3' || form.dbType === '4'"
>
<el-input
v-model=
"form2.sid"
placeholder=
"请输入服务名"
/>
</el-form-item>
<el-form-item
label=
"数据库"
prop=
"dbName"
v-if=
"form.dbType !== '3' && form.dbType !== '4'"
>
<el-input
v-model=
"form2.dbName"
placeholder=
"请输入数据库"
/>
</el-form-item>
<el-form-item
label=
"用户名"
prop=
"username"
>
<el-input
v-model=
"form2.username"
placeholder=
"请输入用户名"
/>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-input
v-model=
"form2.password"
placeholder=
"请输入密码"
/>
</el-form-item>
<el-form-item>
<el-button
size=
"mini"
type=
"primary"
@
click=
"handleCheckConnection"
>
连通性检测
</el-button>
</el-form-item>
</el-form>
<el-button
style=
"margin-top: 12px;"
@
click=
"handleNextStep"
v-if=
"active == 1"
>
下一步
</el-button>
<el-button
style=
"margin-top: 12px;"
@
click=
"handleLastStep"
v-if=
"active == 2"
>
上一步
</el-button>
</div>
</el-card>
</div>
</
template
>
<
script
>
import
{
addDataSource
,
checkConnection
}
from
'@/api/factory/datasource'
import
{
listDataTheme
}
from
'@/api/factory/datatheme'
export
default
{
name
:
'DataSourceAdd'
,
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据源新增'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 保存按钮
loadingOptions
:
{
loading
:
false
,
loadingText
:
'保存'
,
isDisabled
:
false
},
active
:
1
,
// 表单参数
form
:
{
id
:
undefined
,
dbType
:
undefined
,
themeId
:
undefined
,
sourceName
:
undefined
,
dbSchema
:
{},
status
:
'1'
,
remark
:
undefined
},
// 表单校验
rules
:
{
dbType
:
[
{
required
:
true
,
message
:
'数据源类型不能为空'
,
trigger
:
'change'
}
],
themeId
:
[
{
required
:
true
,
message
:
'数据主题不能为空'
,
trigger
:
'change'
}
],
sourceName
:
[
{
required
:
true
,
message
:
'数据源名称不能为空'
,
trigger
:
'blur'
}
]
},
form2
:
{
host
:
undefined
,
port
:
undefined
,
dbName
:
undefined
,
username
:
undefined
,
password
:
undefined
,
sid
:
undefined
},
rules2
:
{
host
:
[
{
required
:
true
,
message
:
'主机不能为空'
,
trigger
:
'blur'
}
],
port
:
[
{
required
:
true
,
message
:
'端口不能为空'
,
trigger
:
'blur'
}
],
sid
:
[
{
required
:
true
,
message
:
'服务名不能为空'
,
trigger
:
'blur'
}
],
dbName
:
[
{
required
:
true
,
message
:
'数据库不能为空'
,
trigger
:
'blur'
}
],
username
:
[
{
required
:
true
,
message
:
'用户名不能为空'
,
trigger
:
'blur'
}
],
password
:
[
{
required
:
true
,
message
:
'密码不能为空'
,
trigger
:
'blur'
}
]
},
// 状态数据字典
statusOptions
:
[],
// 数据源类型数据字典
dbTypeOptions
:
[],
// 数据主题数据字典
themeOptions
:
[]
}
},
created
()
{
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getDicts
(
'data_db_type'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
dbTypeOptions
=
response
.
data
}
})
this
.
getDataThemeList
()
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
getDataThemeList
()
{
listDataTheme
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
themeOptions
=
response
.
data
}
})
},
/** 步骤条下一步 */
handleNextStep
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
active
++
}
})
},
/** 步骤条上一步 */
handleLastStep
()
{
this
.
active
--
},
/** 检测数据库连通性 */
handleCheckConnection
()
{
this
.
$refs
[
'form2'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
form
.
dbSchema
=
this
.
form2
checkConnection
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'连接成功'
)
}
})
}
})
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form2'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
form
.
dbSchema
=
this
.
form2
this
.
loadingOptions
.
loading
=
true
this
.
loadingOptions
.
loadingText
=
'保存中...'
this
.
loadingOptions
.
isDisabled
=
true
addDataSource
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'保存成功'
)
setTimeout
(()
=>
{
// 2秒后跳转列表页
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
2000
)
}
else
{
this
.
$message
.
error
(
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
})
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datasource/DataSourceDetail.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
round
@
click=
"handleSync"
>
元数据同步
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
round
@
click=
"handleWord"
>
数据库文档
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
round
@
click=
"handleCheckConnection"
v-if=
"active == 2"
>
连通性检测
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-steps
:active=
"active"
finish-status=
"success"
align-center
>
<el-step
title=
"数据源信息"
></el-step>
<el-step
title=
"连接信息"
></el-step>
</el-steps>
<el-form
ref=
"form"
:model=
"form"
label-width=
"80px"
v-if=
"active == 1"
disabled
>
<el-form-item
label=
"数据源类型"
prop=
"dbType"
>
<el-select
v-model=
"form.dbType"
>
<el-option
v-for=
"item in dbTypeOptions"
:key=
"item.id"
:label=
"item.itemValue"
:value=
"item.itemText"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据主题"
prop=
"themeId"
>
<el-select
v-model=
"form.themeId"
>
<el-option
v-for=
"item in themeOptions"
:key=
"item.id"
:label=
"item.themeName"
:value=
"item.id"
:disabled=
"item.status === '0'"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据源名称"
prop=
"sourceName"
>
<el-input
v-model=
"form.sourceName"
placeholder=
"请输入数据源名称"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<el-form
ref=
"form2"
:model=
"form2"
label-width=
"80px"
v-if=
"active == 2"
disabled
>
<el-form-item
label=
"主机"
prop=
"host"
>
<el-input
v-model=
"form2.host"
placeholder=
"请输入主机"
/>
</el-form-item>
<el-form-item
label=
"端口"
prop=
"port"
>
<el-input
v-model=
"form2.port"
placeholder=
"请输入端口"
/>
</el-form-item>
<el-form-item
label=
"服务名"
prop=
"sid"
v-if=
"form.dbType === '3' || form.dbType === '4'"
>
<el-input
v-model=
"form2.sid"
placeholder=
"请输入服务名"
/>
</el-form-item>
<el-form-item
label=
"数据库"
prop=
"dbName"
v-if=
"form.dbType !== '3' || form.dbType !== '4'"
>
<el-input
v-model=
"form2.dbName"
placeholder=
"请输入数据库"
/>
</el-form-item>
<el-form-item
label=
"用户名"
prop=
"username"
>
<el-input
v-model=
"form2.username"
placeholder=
"请输入用户名"
/>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-input
v-model=
"form2.password"
placeholder=
"请输入密码"
/>
</el-form-item>
</el-form>
<el-button
style=
"margin-top: 12px;"
@
click=
"handleNextStep"
v-if=
"active == 1"
>
下一步
</el-button>
<el-button
style=
"margin-top: 12px;"
@
click=
"handleLastStep"
v-if=
"active == 2"
>
上一步
</el-button>
</div>
</el-card>
</div>
</
template
>
<
script
>
import
{
getDataSource
,
checkConnection
}
from
'@/api/factory/datasource'
import
{
listDataTheme
}
from
'@/api/factory/datatheme'
import
{
sync
,
word
}
from
'@/api/metadata/metadata'
export
default
{
name
:
'DataSourceDetail'
,
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据源详情'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
active
:
1
,
// 表单参数
form
:
{},
form2
:
{},
// 状态数据字典
statusOptions
:
[],
// 数据源类型数据字典
dbTypeOptions
:
[],
// 数据主题数据字典
themeOptions
:
[]
}
},
created
()
{
console
.
log
(
'id:'
+
this
.
data
.
id
)
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getDicts
(
'data_db_type'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
dbTypeOptions
=
response
.
data
}
})
this
.
getDataThemeList
()
},
mounted
()
{
this
.
getDataSource
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
getDataThemeList
()
{
listDataTheme
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
themeOptions
=
response
.
data
}
})
},
/** 获取详情 */
getDataSource
:
function
(
id
)
{
getDataSource
(
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
form
=
response
.
data
this
.
form2
=
this
.
form
.
dbSchema
}
})
},
/** 步骤条下一步 */
handleNextStep
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
active
++
}
})
},
/** 步骤条上一步 */
handleLastStep
()
{
this
.
active
--
},
/** 检测数据库连通性 */
handleCheckConnection
()
{
checkConnection
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'连接成功'
)
}
})
},
/** 元数据同步 */
handleSync
()
{
sync
(
this
.
data
.
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'元数据正在后台同步中,请到元数据管理中查看结果'
)
}
})
},
/** 数据库文档 */
handleWord
()
{
word
(
this
.
data
.
id
).
then
(
response
=>
{
const
blob
=
new
Blob
([
response
])
const
fileName
=
'数据库设计文档.doc'
if
(
'download'
in
document
.
createElement
(
'a'
))
{
// 非IE下载
const
elink
=
document
.
createElement
(
'a'
)
elink
.
download
=
fileName
elink
.
style
.
display
=
'none'
elink
.
href
=
URL
.
createObjectURL
(
blob
)
document
.
body
.
appendChild
(
elink
)
elink
.
click
()
URL
.
revokeObjectURL
(
elink
.
href
)
// 释放URL 对象
document
.
body
.
removeChild
(
elink
)
}
else
{
// IE10+下载
navigator
.
msSaveBlob
(
blob
,
fileName
)
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datasource/DataSourceEdit.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-plus"
v-if=
"active == 2"
round
@
click=
"submitForm"
:loading=
"loadingOptions.loading"
:disabled=
"loadingOptions.isDisabled"
>
{{
loadingOptions
.
loadingText
}}
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-steps
:active=
"active"
finish-status=
"success"
align-center
>
<el-step
title=
"数据源信息"
></el-step>
<el-step
title=
"连接信息"
></el-step>
</el-steps>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
v-if=
"active == 1"
>
<el-form-item
label=
"数据源类型"
prop=
"dbType"
>
<el-select
v-model=
"form.dbType"
>
<el-option
v-for=
"item in dbTypeOptions"
:key=
"item.id"
:label=
"item.itemValue"
:value=
"item.itemText"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据主题"
prop=
"themeId"
>
<el-select
v-model=
"form.themeId"
placeholder=
"请选择数据主题"
>
<el-option
v-for=
"item in themeOptions"
:key=
"item.id"
:label=
"item.themeName"
:value=
"item.id"
:disabled=
"item.status === '0'"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"数据源名称"
prop=
"sourceName"
>
<el-input
v-model=
"form.sourceName"
placeholder=
"请输入数据源名称"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
<el-form
ref=
"form2"
:model=
"form2"
:rules=
"rules2"
label-width=
"80px"
v-if=
"active == 2"
>
<el-form-item
label=
"主机"
prop=
"host"
>
<el-input
v-model=
"form2.host"
placeholder=
"请输入主机"
/>
</el-form-item>
<el-form-item
label=
"端口"
prop=
"port"
>
<el-input
v-model=
"form2.port"
placeholder=
"请输入端口"
/>
</el-form-item>
<el-form-item
label=
"服务名"
prop=
"sid"
v-if=
"form.dbType === '3' || form.dbType === '4'"
>
<el-input
v-model=
"form2.sid"
placeholder=
"请输入服务名"
/>
</el-form-item>
<el-form-item
label=
"数据库"
prop=
"dbName"
v-if=
"form.dbType !== '3' && form.dbType !== '4'"
>
<el-input
v-model=
"form2.dbName"
placeholder=
"请输入数据库"
/>
</el-form-item>
<el-form-item
label=
"用户名"
prop=
"username"
>
<el-input
v-model=
"form2.username"
placeholder=
"请输入用户名"
/>
</el-form-item>
<el-form-item
label=
"密码"
prop=
"password"
>
<el-input
v-model=
"form2.password"
placeholder=
"请输入密码"
/>
</el-form-item>
<el-form-item>
<el-button
size=
"mini"
type=
"primary"
@
click=
"handleCheckConnection"
>
连通性检测
</el-button>
</el-form-item>
</el-form>
<el-button
style=
"margin-top: 12px;"
@
click=
"handleNextStep"
v-if=
"active == 1"
>
下一步
</el-button>
<el-button
style=
"margin-top: 12px;"
@
click=
"handleLastStep"
v-if=
"active == 2"
>
上一步
</el-button>
</div>
</el-card>
</div>
</
template
>
<
script
>
import
{
getDataSource
,
updateDataSource
,
checkConnection
}
from
'@/api/factory/datasource'
import
{
listDataTheme
}
from
'@/api/factory/datatheme'
export
default
{
name
:
'DataSourceEdit'
,
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据源编辑'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 保存按钮
loadingOptions
:
{
loading
:
false
,
loadingText
:
'保存'
,
isDisabled
:
false
},
active
:
1
,
// 表单参数
form
:
{},
// 表单校验
rules
:
{
dbType
:
[
{
required
:
true
,
message
:
'数据源类型不能为空'
,
trigger
:
'change'
}
],
themeId
:
[
{
required
:
true
,
message
:
'数据主题不能为空'
,
trigger
:
'change'
}
],
sourceName
:
[
{
required
:
true
,
message
:
'数据源名称不能为空'
,
trigger
:
'blur'
}
]
},
form2
:
{},
rules2
:
{
host
:
[
{
required
:
true
,
message
:
'主机不能为空'
,
trigger
:
'blur'
}
],
port
:
[
{
required
:
true
,
message
:
'端口不能为空'
,
trigger
:
'blur'
}
],
sid
:
[
{
required
:
true
,
message
:
'服务名不能为空'
,
trigger
:
'blur'
}
],
dbName
:
[
{
required
:
true
,
message
:
'数据库不能为空'
,
trigger
:
'blur'
}
],
username
:
[
{
required
:
true
,
message
:
'用户名不能为空'
,
trigger
:
'blur'
}
],
password
:
[
{
required
:
true
,
message
:
'密码不能为空'
,
trigger
:
'blur'
}
]
},
// 状态数据字典
statusOptions
:
[],
// 数据源类型数据字典
dbTypeOptions
:
[],
// 数据主题数据字典
themeOptions
:
[]
}
},
created
()
{
console
.
log
(
'id:'
+
this
.
data
.
id
)
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getDicts
(
'data_db_type'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
dbTypeOptions
=
response
.
data
}
})
this
.
getDataThemeList
()
},
mounted
()
{
this
.
getDataSource
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
getDataThemeList
()
{
listDataTheme
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
themeOptions
=
response
.
data
}
})
},
/** 获取详情 */
getDataSource
:
function
(
id
)
{
getDataSource
(
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
form
=
response
.
data
this
.
form2
=
this
.
form
.
dbSchema
}
})
},
/** 步骤条下一步 */
handleNextStep
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
active
++
}
})
},
/** 步骤条上一步 */
handleLastStep
()
{
this
.
active
--
},
/** 检测数据库连通性 */
handleCheckConnection
()
{
this
.
$refs
[
'form2'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
form
.
dbSchema
=
this
.
form2
checkConnection
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'连接成功'
)
}
})
}
})
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form2'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
form
.
dbSchema
=
this
.
form2
this
.
loadingOptions
.
loading
=
true
this
.
loadingOptions
.
loadingText
=
'保存中...'
this
.
loadingOptions
.
isDisabled
=
true
updateDataSource
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'保存成功'
)
setTimeout
(()
=>
{
// 2秒后跳转列表页
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
2000
)
}
else
{
this
.
$message
.
error
(
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
})
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datasource/DataSourceList.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
>
<el-form-item
label=
"数据源名称"
prop=
"sourceName"
>
<el-input
v-model=
"queryParams.sourceName"
placeholder=
"请输入数据源名称"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
type=
"flex"
justify=
"space-between"
>
<el-col
:span=
"12"
>
<el-button-group>
<el-button
type=
"primary"
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPerm=
"['factory:datasource:add']"
>
新增
</el-button>
<el-button
type=
"success"
icon=
"el-icon-edit-outline"
size=
"mini"
:disabled=
"single"
@
click=
"handleEdit"
v-hasPerm=
"['factory:datasource:edit']"
>
修改
</el-button>
<el-button
type=
"info"
icon=
"el-icon-view"
size=
"mini"
:disabled=
"single"
@
click=
"handleDetail"
v-hasPerm=
"['factory:datasource:detail']"
>
详情
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
v-hasPerm=
"['factory:datasource:remove']"
>
删除
</el-button>
</el-button-group>
</el-col>
<el-col
:span=
"12"
>
<div
class=
"right-toolbar"
>
<el-tooltip
content=
"密度"
effect=
"dark"
placement=
"top"
>
<el-dropdown
trigger=
"click"
@
command=
"handleCommand"
>
<el-button
circle
size=
"mini"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"colum-height"
/>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"medium"
>
正常
</el-dropdown-item>
<el-dropdown-item
command=
"small"
>
中等
</el-dropdown-item>
<el-dropdown-item
command=
"mini"
>
紧凑
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-tooltip>
<el-tooltip
content=
"刷新"
effect=
"dark"
placement=
"top"
>
<el-button
circle
size=
"mini"
@
click=
"handleRefresh"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"shuaxin"
/>
</el-button>
</el-tooltip>
<el-tooltip
content=
"列设置"
effect=
"dark"
placement=
"top"
>
<el-popover
placement=
"bottom"
width=
"100"
trigger=
"click"
>
<el-checkbox-group
v-model=
"checkedTableColumns"
@
change=
"handleCheckedColsChange"
>
<el-checkbox
v-for=
"(item, index) in tableColumns"
:key=
"index"
:label=
"item.prop"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
<span
slot=
"reference"
>
<el-button
circle
size=
"mini"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"shezhi"
/>
</el-button>
</span>
</el-popover>
</el-tooltip>
</div>
</el-col>
</el-row>
<el-table
v-loading=
"loading"
:data=
"dataSourceList"
@
selection-change=
"handleSelectionChange"
border
tooltip-effect=
"dark"
:size=
"tableSize"
:height=
"tableHeight"
style=
"width: 100%;margin: 15px 0;"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"序号"
width=
"55"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<
template
v-for=
"(item, index) in tableColumns"
>
<el-table-column
v-if=
"item.show"
:prop=
"item.prop"
:label=
"item.label"
:key=
"index"
:formatter=
"item.formatter"
align=
"center"
show-overflow-tooltip
/>
</
template
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"left"
trigger=
"click"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['factory:datasource:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['factory:datasource:detail']"
>
详情
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['factory:datasource:remove']"
>
删除
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</
template
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes=
"[10, 20, 50, 100]"
layout=
"total, sizes, prev, pager, next, jumper"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"queryParams.pageNum"
:page-size
.
sync=
"queryParams.pageSize"
:total=
"total"
></el-pagination>
</el-card>
</div>
</template>
<
script
>
import
{
pageDataSource
,
delDataSource
,
delDataSources
}
from
'@/api/factory/datasource'
export
default
{
name
:
'DataSourceList'
,
data
()
{
return
{
tableHeight
:
document
.
body
.
offsetHeight
-
340
+
'px'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 表格头
tableColumns
:
[
{
prop
:
'sourceName'
,
label
:
'数据源名称'
,
show
:
true
},
{
prop
:
'status'
,
label
:
'状态'
,
show
:
true
,
formatter
:
this
.
statusFormatter
},
{
prop
:
'createTime'
,
label
:
'创建时间'
,
show
:
true
}
],
// 默认选择中表格头
checkedTableColumns
:
[],
tableSize
:
'medium'
,
// 状态数据字典
statusOptions
:
[],
// 数据源表格数据
dataSourceList
:
[],
// 总数据条数
total
:
0
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
20
,
sourceName
:
''
}
}
},
created
()
{
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getList
()
},
mounted
()
{
this
.
initCols
()
},
methods
:
{
/** 查询数据源列表 */
getList
()
{
this
.
loading
=
true
pageDataSource
(
this
.
queryParams
).
then
(
response
=>
{
this
.
loading
=
false
if
(
response
.
success
)
{
const
{
data
}
=
response
this
.
dataSourceList
=
data
.
data
this
.
total
=
data
.
total
}
})
},
initCols
()
{
this
.
checkedTableColumns
=
this
.
tableColumns
.
map
(
col
=>
col
.
prop
)
},
handleCheckedColsChange
(
val
)
{
this
.
tableColumns
.
forEach
(
col
=>
{
if
(
!
this
.
checkedTableColumns
.
includes
(
col
.
prop
))
{
col
.
show
=
false
}
else
{
col
.
show
=
true
}
})
},
handleCommand
(
command
)
{
this
.
tableSize
=
command
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
this
.
getList
()
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
$refs
[
'queryForm'
].
resetFields
()
this
.
handleQuery
()
},
/** 刷新列表 */
handleRefresh
()
{
this
.
getList
()
},
/** 多选框选中数据 */
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
showOptions
.
data
=
{}
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
true
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 修改按钮操作 */
handleEdit
(
row
)
{
this
.
showOptions
.
data
.
id
=
row
.
id
||
this
.
ids
[
0
]
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
true
this
.
showOptions
.
showDetail
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 详情按钮操作 */
handleDetail
(
row
)
{
this
.
showOptions
.
data
.
id
=
row
.
id
||
this
.
ids
[
0
]
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
true
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$confirm
(
'选中数据将被永久删除, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
delDataSource
(
row
.
id
)
}).
then
(()
=>
{
this
.
$message
.
success
(
'删除成功'
)
this
.
getList
()
}).
catch
(()
=>
{
})
},
/** 批量删除按钮操作 */
handleBatchDelete
()
{
if
(
!
this
.
ids
.
length
)
{
this
.
$message
({
message
:
'请先选择需要操作的数据'
,
type
:
'warning'
})
}
this
.
$message
.
warning
(
'不支持批量删除'
)
},
handleSizeChange
(
val
)
{
console
.
log
(
`每页
${
val
}
条`
)
this
.
queryParams
.
pageNum
=
1
this
.
queryParams
.
pageSize
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
console
.
log
(
`当前页:
${
val
}
`
)
this
.
queryParams
.
pageNum
=
val
this
.
getList
()
},
statusFormatter
(
row
,
column
,
cellValue
,
index
)
{
let
dictLabel
=
this
.
selectDictLabel
(
this
.
statusOptions
,
cellValue
)
if
(
cellValue
===
'1'
)
{
return
<
el
-
tag
type
=
"success"
>
{
dictLabel
}
<
/el-tag
>
}
else
{
return
<
el
-
tag
type
=
"warning"
>
{
dictLabel
}
<
/el-tag
>
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.right-toolbar
{
float
:
right
;
}
</
style
>
datax-ui/src/views/factory/datasource/index.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div
class=
"app-container"
>
<transition
name=
"el-zoom-in-center"
>
<data-source-list
v-if=
"options.showList"
@
showCard=
"showCard"
></data-source-list>
</transition>
<transition
name=
"el-zoom-in-top"
>
<data-source-add
v-if=
"options.showAdd"
:data=
"options.data"
@
showCard=
"showCard"
></data-source-add>
</transition>
<transition
name=
"el-zoom-in-top"
>
<data-source-edit
v-if=
"options.showEdit"
:data=
"options.data"
@
showCard=
"showCard"
></data-source-edit>
</transition>
<transition
name=
"el-zoom-in-bottom"
>
<data-source-detail
v-if=
"options.showDetail"
:data=
"options.data"
@
showCard=
"showCard"
></data-source-detail>
</transition>
</div>
</
template
>
<
script
>
import
DataSourceList
from
'./DataSourceList'
import
DataSourceAdd
from
'./DataSourceAdd'
import
DataSourceEdit
from
'./DataSourceEdit'
import
DataSourceDetail
from
'./DataSourceDetail'
export
default
{
name
:
'DataSource'
,
components
:
{
DataSourceList
,
DataSourceAdd
,
DataSourceEdit
,
DataSourceDetail
},
data
()
{
return
{
options
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
}
}
},
methods
:
{
showCard
(
data
)
{
Object
.
assign
(
this
.
options
,
data
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datatheme/DataThemeAdd.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-plus"
round
@
click=
"submitForm"
:loading=
"loadingOptions.loading"
:disabled=
"loadingOptions.isDisabled"
>
{{
loadingOptions
.
loadingText
}}
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"主题名称"
prop=
"themeName"
>
<el-input
v-model=
"form.themeName"
placeholder=
"请输入主题名称"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
</
template
>
<
script
>
import
{
addDataTheme
}
from
'@/api/factory/datatheme'
export
default
{
name
:
'DataThemeAdd'
,
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据主题新增'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 保存按钮
loadingOptions
:
{
loading
:
false
,
loadingText
:
'保存'
,
isDisabled
:
false
},
// 表单参数
form
:
{
status
:
'1'
},
// 表单校验
rules
:
{
themeName
:
[
{
required
:
true
,
message
:
'主题名称不能为空'
,
trigger
:
'blur'
}
]
},
// 状态数据字典
statusOptions
:
[]
}
},
created
()
{
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
loadingOptions
.
loading
=
true
this
.
loadingOptions
.
loadingText
=
'保存中...'
this
.
loadingOptions
.
isDisabled
=
true
addDataTheme
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'保存成功'
)
setTimeout
(()
=>
{
// 2秒后跳转列表页
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
2000
)
}
else
{
this
.
$message
.
error
(
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
})
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datatheme/DataThemeDetail.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-form
ref=
"form"
:model=
"form"
label-width=
"80px"
disabled
>
<el-form-item
label=
"主题名称"
prop=
"themeName"
>
<el-input
v-model=
"form.themeName"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
/>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
</
template
>
<
script
>
import
{
getDataTheme
}
from
'@/api/factory/datatheme'
export
default
{
name
:
'DataThemeDetail'
,
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据主题详情'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 表单参数
form
:
{},
// 状态数据字典
statusOptions
:
[]
}
},
created
()
{
console
.
log
(
'id:'
+
this
.
data
.
id
)
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
},
mounted
()
{
this
.
getDataTheme
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 获取详情 */
getDataTheme
:
function
(
id
)
{
getDataTheme
(
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
form
=
response
.
data
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datatheme/DataThemeEdit.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-plus"
round
@
click=
"submitForm"
:loading=
"loadingOptions.loading"
:disabled=
"loadingOptions.isDisabled"
>
{{
loadingOptions
.
loadingText
}}
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</div>
<div
:style=
"classCardbody"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"主题名称"
prop=
"themeName"
>
<el-input
v-model=
"form.themeName"
placeholder=
"请输入主题名称"
/>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
v-for=
"dict in statusOptions"
:key=
"dict.id"
:label=
"dict.itemText"
>
{{
dict
.
itemValue
}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
label=
"备注"
prop=
"remark"
>
<el-input
v-model=
"form.remark"
type=
"textarea"
placeholder=
"请输入内容"
/>
</el-form-item>
</el-form>
</div>
</el-card>
</div>
</
template
>
<
script
>
import
{
getDataTheme
,
updateDataTheme
}
from
'@/api/factory/datatheme'
export
default
{
name
:
'DataThemeEdit'
,
props
:
{
data
:
{
type
:
Object
,
default
:
function
()
{
return
{}
}
}
},
data
()
{
return
{
classCardbody
:
{
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
title
:
'数据主题编辑'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 保存按钮
loadingOptions
:
{
loading
:
false
,
loadingText
:
'保存'
,
isDisabled
:
false
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
themeName
:
[
{
required
:
true
,
message
:
'主题名称不能为空'
,
trigger
:
'blur'
}
]
},
// 状态数据字典
statusOptions
:
[]
}
},
created
()
{
console
.
log
(
'id:'
+
this
.
data
.
id
)
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
},
mounted
()
{
this
.
getDataTheme
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 获取详情 */
getDataTheme
:
function
(
id
)
{
getDataTheme
(
id
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
form
=
response
.
data
}
})
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
valid
)
{
this
.
loadingOptions
.
loading
=
true
this
.
loadingOptions
.
loadingText
=
'保存中...'
this
.
loadingOptions
.
isDisabled
=
true
updateDataTheme
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
$message
.
success
(
'保存成功'
)
setTimeout
(()
=>
{
// 2秒后跳转列表页
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
2000
)
}
else
{
this
.
$message
.
error
(
'保存失败'
)
this
.
loadingOptions
.
loading
=
false
this
.
loadingOptions
.
loadingText
=
'保存'
this
.
loadingOptions
.
isDisabled
=
false
}
})
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/factory/datatheme/DataThemeList.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div>
<el-card
class=
"box-card"
shadow=
"always"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
:inline=
"true"
>
<el-form-item
label=
"主题名称"
prop=
"themeName"
>
<el-input
v-model=
"queryParams.themeName"
placeholder=
"请输入主题名称"
clearable
size=
"small"
@
keyup
.
enter
.
native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
type=
"flex"
justify=
"space-between"
>
<el-col
:span=
"12"
>
<el-button-group>
<el-button
type=
"primary"
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPerm=
"['factory:datatheme:add']"
>
新增
</el-button>
<el-button
type=
"success"
icon=
"el-icon-edit-outline"
size=
"mini"
:disabled=
"single"
@
click=
"handleEdit"
v-hasPerm=
"['factory:datatheme:edit']"
>
修改
</el-button>
<el-button
type=
"info"
icon=
"el-icon-view"
size=
"mini"
:disabled=
"single"
@
click=
"handleDetail"
v-hasPerm=
"['factory:datatheme:detail']"
>
详情
</el-button>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
v-hasPerm=
"['factory:datatheme:remove']"
>
删除
</el-button>
</el-button-group>
</el-col>
<el-col
:span=
"12"
>
<div
class=
"right-toolbar"
>
<el-tooltip
content=
"密度"
effect=
"dark"
placement=
"top"
>
<el-dropdown
trigger=
"click"
@
command=
"handleCommand"
>
<el-button
circle
size=
"mini"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"colum-height"
/>
</el-button>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
command=
"medium"
>
正常
</el-dropdown-item>
<el-dropdown-item
command=
"small"
>
中等
</el-dropdown-item>
<el-dropdown-item
command=
"mini"
>
紧凑
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</el-tooltip>
<el-tooltip
content=
"刷新"
effect=
"dark"
placement=
"top"
>
<el-button
circle
size=
"mini"
@
click=
"handleRefresh"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"shuaxin"
/>
</el-button>
</el-tooltip>
<el-tooltip
content=
"列设置"
effect=
"dark"
placement=
"top"
>
<el-popover
placement=
"bottom"
width=
"100"
trigger=
"click"
>
<el-checkbox-group
v-model=
"checkedTableColumns"
@
change=
"handleCheckedColsChange"
>
<el-checkbox
v-for=
"(item, index) in tableColumns"
:key=
"index"
:label=
"item.prop"
>
{{
item
.
label
}}
</el-checkbox>
</el-checkbox-group>
<span
slot=
"reference"
>
<el-button
circle
size=
"mini"
>
<svg-icon
class-name=
"size-icon"
icon-class=
"shezhi"
/>
</el-button>
</span>
</el-popover>
</el-tooltip>
</div>
</el-col>
</el-row>
<el-table
v-loading=
"loading"
:data=
"dataThemeList"
@
selection-change=
"handleSelectionChange"
border
tooltip-effect=
"dark"
:size=
"tableSize"
:height=
"tableHeight"
style=
"width: 100%;margin: 15px 0;"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"序号"
width=
"55"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<
template
v-for=
"(item, index) in tableColumns"
>
<el-table-column
v-if=
"item.show"
:prop=
"item.prop"
:label=
"item.label"
:key=
"index"
:formatter=
"item.formatter"
align=
"center"
show-overflow-tooltip
/>
</
template
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-popover
placement=
"left"
trigger=
"click"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['factory:datatheme:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['factory:datatheme:detail']"
>
详情
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['factory:datatheme:remove']"
>
删除
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</
template
>
</el-table-column>
</el-table>
<el-pagination
:page-sizes=
"[10, 20, 50, 100]"
layout=
"total, sizes, prev, pager, next, jumper"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"queryParams.pageNum"
:page-size
.
sync=
"queryParams.pageSize"
:total=
"total"
></el-pagination>
</el-card>
</div>
</template>
<
script
>
import
{
pageDataTheme
,
delDataTheme
,
delDataThemes
}
from
'@/api/factory/datatheme'
export
default
{
name
:
'DataThemeList'
,
data
()
{
return
{
tableHeight
:
document
.
body
.
offsetHeight
-
340
+
'px'
,
// 展示切换
showOptions
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
},
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 表格头
tableColumns
:
[
{
prop
:
'themeName'
,
label
:
'主题名称'
,
show
:
true
},
{
prop
:
'status'
,
label
:
'状态'
,
show
:
true
,
formatter
:
this
.
statusFormatter
},
{
prop
:
'createTime'
,
label
:
'创建时间'
,
show
:
true
}
],
// 默认选择中表格头
checkedTableColumns
:
[],
tableSize
:
'medium'
,
// 状态数据字典
statusOptions
:
[],
// 主题表格数据
dataThemeList
:
[],
// 总数据条数
total
:
0
,
// 查询参数
queryParams
:
{
pageNum
:
1
,
pageSize
:
20
,
themeName
:
''
}
}
},
created
()
{
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getList
()
},
mounted
()
{
this
.
initCols
()
},
methods
:
{
/** 查询主题列表 */
getList
()
{
this
.
loading
=
true
pageDataTheme
(
this
.
queryParams
).
then
(
response
=>
{
this
.
loading
=
false
if
(
response
.
success
)
{
const
{
data
}
=
response
this
.
dataThemeList
=
data
.
data
this
.
total
=
data
.
total
}
})
},
initCols
()
{
this
.
checkedTableColumns
=
this
.
tableColumns
.
map
(
col
=>
col
.
prop
)
},
handleCheckedColsChange
(
val
)
{
this
.
tableColumns
.
forEach
(
col
=>
{
if
(
!
this
.
checkedTableColumns
.
includes
(
col
.
prop
))
{
col
.
show
=
false
}
else
{
col
.
show
=
true
}
})
},
handleCommand
(
command
)
{
this
.
tableSize
=
command
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
pageNum
=
1
this
.
getList
()
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
$refs
[
'queryForm'
].
resetFields
()
this
.
handleQuery
()
},
/** 刷新列表 */
handleRefresh
()
{
this
.
getList
()
},
/** 多选框选中数据 */
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
id
)
this
.
single
=
selection
.
length
!==
1
this
.
multiple
=
!
selection
.
length
},
/** 新增按钮操作 */
handleAdd
()
{
this
.
showOptions
.
data
=
{}
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
true
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 修改按钮操作 */
handleEdit
(
row
)
{
this
.
showOptions
.
data
.
id
=
row
.
id
||
this
.
ids
[
0
]
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
true
this
.
showOptions
.
showDetail
=
false
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 详情按钮操作 */
handleDetail
(
row
)
{
this
.
showOptions
.
data
.
id
=
row
.
id
||
this
.
ids
[
0
]
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showEdit
=
false
this
.
showOptions
.
showDetail
=
true
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
this
.
$confirm
(
'选中数据将被永久删除, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
}).
then
(()
=>
{
delDataTheme
(
row
.
id
)
}).
then
(()
=>
{
this
.
$message
.
success
(
'删除成功'
)
this
.
getList
()
}).
catch
(()
=>
{
})
},
/** 批量删除按钮操作 */
handleBatchDelete
()
{
if
(
!
this
.
ids
.
length
)
{
this
.
$message
({
message
:
'请先选择需要操作的数据'
,
type
:
'warning'
})
}
this
.
$message
.
warning
(
'不支持批量删除'
)
},
handleSizeChange
(
val
)
{
console
.
log
(
`每页
${
val
}
条`
)
this
.
queryParams
.
pageNum
=
1
this
.
queryParams
.
pageSize
=
val
this
.
getList
()
},
handleCurrentChange
(
val
)
{
console
.
log
(
`当前页:
${
val
}
`
)
this
.
queryParams
.
pageNum
=
val
this
.
getList
()
},
statusFormatter
(
row
,
column
,
cellValue
,
index
)
{
let
dictLabel
=
this
.
selectDictLabel
(
this
.
statusOptions
,
cellValue
)
if
(
cellValue
===
'1'
)
{
return
<
el
-
tag
type
=
"success"
>
{
dictLabel
}
<
/el-tag
>
}
else
{
return
<
el
-
tag
type
=
"warning"
>
{
dictLabel
}
<
/el-tag
>
}
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.right-toolbar
{
float
:
right
;
}
</
style
>
datax-ui/src/views/factory/datatheme/index.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div
class=
"app-container"
>
<transition
name=
"el-zoom-in-center"
>
<data-theme-list
v-if=
"options.showList"
@
showCard=
"showCard"
></data-theme-list>
</transition>
<transition
name=
"el-zoom-in-top"
>
<data-theme-add
v-if=
"options.showAdd"
:data=
"options.data"
@
showCard=
"showCard"
></data-theme-add>
</transition>
<transition
name=
"el-zoom-in-top"
>
<data-theme-edit
v-if=
"options.showEdit"
:data=
"options.data"
@
showCard=
"showCard"
></data-theme-edit>
</transition>
<transition
name=
"el-zoom-in-bottom"
>
<data-theme-detail
v-if=
"options.showDetail"
:data=
"options.data"
@
showCard=
"showCard"
></data-theme-detail>
</transition>
</div>
</
template
>
<
script
>
import
DataThemeList
from
'./DataThemeList'
import
DataThemeAdd
from
'./DataThemeAdd'
import
DataThemeEdit
from
'./DataThemeEdit'
import
DataThemeDetail
from
'./DataThemeDetail'
export
default
{
name
:
'DataTheme'
,
components
:
{
DataThemeList
,
DataThemeAdd
,
DataThemeEdit
,
DataThemeDetail
},
data
()
{
return
{
options
:
{
data
:
{},
showList
:
true
,
showAdd
:
false
,
showEdit
:
false
,
showDetail
:
false
}
}
},
methods
:
{
showCard
(
data
)
{
Object
.
assign
(
this
.
options
,
data
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/market/apimask/ApiMaskList.vue
View file @
1a97dd64
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPerm=
"['market:apimask:add']"
>
新增
</el-button>
>
新增
</el-button>
<el-button
<el-button
type=
"success"
type=
"success"
...
@@ -33,7 +32,6 @@
...
@@ -33,7 +32,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleEdit"
@
click=
"handleEdit"
v-hasPerm=
"['market:apimask:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
type=
"info"
type=
"info"
...
@@ -41,7 +39,6 @@
...
@@ -41,7 +39,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleDetail"
@
click=
"handleDetail"
v-hasPerm=
"['market:apimask:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
type=
"danger"
type=
"danger"
...
@@ -49,7 +46,6 @@
...
@@ -49,7 +46,6 @@
size=
"mini"
size=
"mini"
:disabled=
"multiple"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
@
click=
"handleBatchDelete"
v-hasPerm=
"['market:apimask:remove']"
>
删除
</el-button>
>
删除
</el-button>
</el-button-group>
</el-button-group>
</el-col>
</el-col>
...
@@ -129,21 +125,18 @@
...
@@ -129,21 +125,18 @@
type=
"text"
type=
"text"
icon=
"el-icon-edit-outline"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['market:apimask:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-view"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['market:apimask:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['market:apimask:remove']"
>
删除
</el-button>
>
删除
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</el-popover>
...
...
datax-ui/src/views/market/dataapi/DataApiAdd.vue
View file @
1a97dd64
...
@@ -250,7 +250,7 @@
...
@@ -250,7 +250,7 @@
<
script
>
<
script
>
import
{
addDataApi
,
sqlParse
}
from
'@/api/market/dataapi'
import
{
addDataApi
,
sqlParse
}
from
'@/api/market/dataapi'
import
{
listDataSource
,
getDbTables
,
getDbTableColumns
}
from
'@/api/
factory
/datasource'
import
{
listDataSource
,
getDbTables
,
getDbTableColumns
}
from
'@/api/
metadata
/datasource'
import
SqlEditor
from
'@/components/SqlEditor'
import
SqlEditor
from
'@/components/SqlEditor'
export
default
{
export
default
{
...
...
datax-ui/src/views/market/dataapi/DataApiCall.vue
View file @
1a97dd64
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<div
slot=
"header"
class=
"clearfix"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
title
}}
</span>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-s-data"
round
@
click=
"apiDataCall"
>
执行
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-s-data"
round
@
click=
"apiDataCall"
>
接口调用
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</el-button-group>
</div>
</div>
...
...
datax-ui/src/views/market/dataapi/DataApiDetail.vue
View file @
1a97dd64
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<span>
{{
title
}}
</span>
<span>
{{
title
}}
</span>
<el-button-group
style=
"float: right;"
>
<el-button-group
style=
"float: right;"
>
<el-button
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
round
@
click=
"handleWord"
>
接口文档
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-coin"
type=
"primary"
round
@
click=
"handleWord"
>
接口文档
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-s-data"
round
@
click=
"api
Call"
>
接口调用
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-s-data"
round
@
click=
"api
Try"
>
接口示例
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
<el-button
size=
"mini"
icon=
"el-icon-back"
round
@
click=
"showCard"
>
返回
</el-button>
</el-button-group>
</el-button-group>
</div>
</div>
...
@@ -239,7 +239,7 @@
...
@@ -239,7 +239,7 @@
<
script
>
<
script
>
import
{
getDataApi
,
word
}
from
'@/api/market/dataapi'
import
{
getDataApi
,
word
}
from
'@/api/market/dataapi'
import
{
listDataSource
,
getDbTables
,
getDbTableColumns
}
from
'@/api/
factory
/datasource'
import
{
listDataSource
,
getDbTables
,
getDbTableColumns
}
from
'@/api/
metadata
/datasource'
import
SqlEditor
from
'@/components/SqlEditor'
import
SqlEditor
from
'@/components/SqlEditor'
export
default
{
export
default
{
...
@@ -426,7 +426,7 @@ export default {
...
@@ -426,7 +426,7 @@ export default {
})
||
[]
})
||
[]
}
}
},
},
api
Call
()
{
api
Try
()
{
this
.
showOptions
.
data
.
id
=
this
.
data
.
id
this
.
showOptions
.
data
.
id
=
this
.
data
.
id
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showList
=
false
this
.
showOptions
.
showAdd
=
false
this
.
showOptions
.
showAdd
=
false
...
...
datax-ui/src/views/market/dataapi/DataApiEdit.vue
View file @
1a97dd64
...
@@ -250,7 +250,7 @@
...
@@ -250,7 +250,7 @@
<
script
>
<
script
>
import
{
getDataApi
,
updateDataApi
,
sqlParse
}
from
'@/api/market/dataapi'
import
{
getDataApi
,
updateDataApi
,
sqlParse
}
from
'@/api/market/dataapi'
import
{
listDataSource
,
getDbTables
,
getDbTableColumns
}
from
'@/api/
factory
/datasource'
import
{
listDataSource
,
getDbTables
,
getDbTableColumns
}
from
'@/api/
metadata
/datasource'
import
SqlEditor
from
'@/components/SqlEditor'
import
SqlEditor
from
'@/components/SqlEditor'
export
default
{
export
default
{
...
...
datax-ui/src/views/market/dataapi/DataApiList.vue
View file @
1a97dd64
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPerm=
"['market:dataapi:add']"
>
新增
</el-button>
>
新增
</el-button>
<el-button
<el-button
type=
"success"
type=
"success"
...
@@ -33,7 +32,6 @@
...
@@ -33,7 +32,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleEdit"
@
click=
"handleEdit"
v-hasPerm=
"['market:dataapi:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
type=
"info"
type=
"info"
...
@@ -41,7 +39,6 @@
...
@@ -41,7 +39,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleDetail"
@
click=
"handleDetail"
v-hasPerm=
"['market:dataapi:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
type=
"danger"
type=
"danger"
...
@@ -49,7 +46,6 @@
...
@@ -49,7 +46,6 @@
size=
"mini"
size=
"mini"
:disabled=
"multiple"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
@
click=
"handleBatchDelete"
v-hasPerm=
"['market:dataapi:remove']"
>
删除
</el-button>
>
删除
</el-button>
</el-button-group>
</el-button-group>
</el-col>
</el-col>
...
@@ -129,42 +125,36 @@
...
@@ -129,42 +125,36 @@
type=
"text"
type=
"text"
icon=
"el-icon-edit-outline"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['market:dataapi:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-view"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['market:dataapi:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['market:dataapi:remove']"
>
删除
</el-button>
>
删除
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-copy-document"
icon=
"el-icon-copy-document"
@
click=
"handleCopy(scope.row)"
@
click=
"handleCopy(scope.row)"
v-hasPerm=
"['market:dataapi:copy']"
>
拷贝
</el-button>
>
拷贝
</el-button>
<el-button
v-if=
"scope.row.status !== '2'"
<el-button
v-if=
"scope.row.status !== '2'"
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-upload2"
icon=
"el-icon-upload2"
@
click=
"handleRegister(scope.row)"
@
click=
"handleRegister(scope.row)"
v-hasPerm=
"['market:dataapi:release']"
>
发布
</el-button>
>
发布
</el-button>
<el-button
v-if=
"scope.row.status === '2'"
<el-button
v-if=
"scope.row.status === '2'"
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-download"
icon=
"el-icon-download"
@
click=
"handleUnRegister(scope.row)"
@
click=
"handleUnRegister(scope.row)"
v-hasPerm=
"['market:dataapi:cancel']"
>
注销
</el-button>
>
注销
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</el-popover>
...
@@ -186,7 +176,7 @@
...
@@ -186,7 +176,7 @@
</template>
</template>
<
script
>
<
script
>
import
{
pageDataApi
,
delDataApi
,
delDataApis
,
copyDataApi
,
releaseDataApi
,
cancelDataApi
,
apiRegister
,
apiUnRegister
}
from
'@/api/market/dataapi'
import
{
pageDataApi
,
delDataApi
,
delDataApis
,
copyDataApi
,
releaseDataApi
,
cancelDataApi
}
from
'@/api/market/dataapi'
export
default
{
export
default
{
name
:
'DataApiList'
,
name
:
'DataApiList'
,
...
...
datax-ui/src/views/metadata/changerecord/ChangeRecordList.vue
View file @
1a97dd64
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPerm=
"['factory:datasource:add']"
>
新增
</el-button>
>
新增
</el-button>
<el-button
<el-button
type=
"success"
type=
"success"
...
@@ -33,7 +32,6 @@
...
@@ -33,7 +32,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleEdit"
@
click=
"handleEdit"
v-hasPerm=
"['factory:datasource:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
type=
"info"
type=
"info"
...
@@ -41,7 +39,6 @@
...
@@ -41,7 +39,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleDetail"
@
click=
"handleDetail"
v-hasPerm=
"['factory:datasource:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
type=
"danger"
type=
"danger"
...
@@ -49,7 +46,6 @@
...
@@ -49,7 +46,6 @@
size=
"mini"
size=
"mini"
:disabled=
"multiple"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
@
click=
"handleBatchDelete"
v-hasPerm=
"['factory:datasource:remove']"
>
删除
</el-button>
>
删除
</el-button>
</el-button-group>
</el-button-group>
</el-col>
</el-col>
...
@@ -129,21 +125,18 @@
...
@@ -129,21 +125,18 @@
type=
"text"
type=
"text"
icon=
"el-icon-edit-outline"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['factory:datasource:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-view"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['factory:datasource:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['factory:datasource:remove']"
>
删除
</el-button>
>
删除
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</el-popover>
...
...
datax-ui/src/views/metadata/datacolumn/index.vue
View file @
1a97dd64
<
template
>
<
template
>
<div
class=
"app-container"
>
<div
class=
"app-container"
>
Data
Manage
Data
Column
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'Data
Manage
'
name
:
'Data
Column
'
}
}
</
script
>
</
script
>
...
...
datax-ui/src/views/metadata/data
map
/index.vue
→
datax-ui/src/views/metadata/data
search
/index.vue
View file @
1a97dd64
...
@@ -32,14 +32,14 @@
...
@@ -32,14 +32,14 @@
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'Data
Map
'
,
name
:
'Data
Search
'
,
data
()
{
data
()
{
return
{
return
{
classCardbody
:
{
classCardbody
:
{
overflow
:
'auto'
,
overflow
:
'auto'
,
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
height
:
document
.
body
.
offsetHeight
-
240
+
'px'
},
},
title
:
'数据
地图
'
title
:
'数据
检索
'
}
}
}
}
}
}
...
...
datax-ui/src/views/metadata/datasource/DataSourceList.vue
View file @
1a97dd64
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPerm=
"['factory:datasource:add']"
>
新增
</el-button>
>
新增
</el-button>
<el-button
<el-button
type=
"success"
type=
"success"
...
@@ -33,7 +32,6 @@
...
@@ -33,7 +32,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleEdit"
@
click=
"handleEdit"
v-hasPerm=
"['factory:datasource:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
type=
"info"
type=
"info"
...
@@ -41,7 +39,6 @@
...
@@ -41,7 +39,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleDetail"
@
click=
"handleDetail"
v-hasPerm=
"['factory:datasource:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
type=
"danger"
type=
"danger"
...
@@ -49,7 +46,6 @@
...
@@ -49,7 +46,6 @@
size=
"mini"
size=
"mini"
:disabled=
"multiple"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
@
click=
"handleBatchDelete"
v-hasPerm=
"['factory:datasource:remove']"
>
删除
</el-button>
>
删除
</el-button>
</el-button-group>
</el-button-group>
</el-col>
</el-col>
...
@@ -129,21 +125,18 @@
...
@@ -129,21 +125,18 @@
type=
"text"
type=
"text"
icon=
"el-icon-edit-outline"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['factory:datasource:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-view"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['factory:datasource:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['factory:datasource:remove']"
>
删除
</el-button>
>
删除
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</el-popover>
...
...
datax-ui/src/views/visual/databoard/board.vue
0 → 100644
View file @
1a97dd64
<
template
>
<div
class=
"app-container"
>
DataBoardConfig
</div>
</
template
>
<
script
>
export
default
{
name
:
'DataBoardConfig'
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
datax-ui/src/views/
chartboard/chart/make
.vue
→
datax-ui/src/views/
visual/datachart/chart
.vue
View file @
1a97dd64
...
@@ -125,11 +125,11 @@
...
@@ -125,11 +125,11 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
getDataSet
,
listDataSet
}
from
'@/api/
factory
/dataset'
import
{
getDataSet
,
listDataSet
}
from
'@/api/
visual
/dataset'
import
draggable
from
'vuedraggable'
import
draggable
from
'vuedraggable'
export
default
{
export
default
{
name
:
'
ChartMake
'
,
name
:
'
DataChartConfig
'
,
components
:
{
components
:
{
draggable
draggable
},
},
...
...
datax-ui/src/views/visual/datachart/make.vue
deleted
100644 → 0
View file @
44b84151
<
template
>
<div
class=
"chart-container"
>
<el-container>
<el-aside
width=
"250px"
class=
"widget-field-container"
>
<el-card
class=
"box-card"
shadow=
"always"
style=
"height: 100%;"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
数据集
</span>
<el-dropdown
trigger=
"click"
@
command=
"handleCommand"
style=
"float: right; color: #499df3;"
>
<span
class=
"el-dropdown-link"
>
切换
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
</span>
<el-dropdown-menu
slot=
"dropdown"
>
<el-dropdown-item
v-for=
"item in datasetOptions"
:command=
"item.id"
>
{{
item
.
setName
}}
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div
style=
"margin: -20px;"
>
<div
class=
"field-widget-cate"
><i
class=
"icon iconfont icon-weidu"
></i><span>
维度列
</span></div>
<draggable
v-model=
"dimensions"
class=
"field-widget-tag"
:options=
"
{sort: false, ghostClass: 'ghost', group: {name: 'dimensions', pull: true, put: false}}">
<el-tag
v-for=
"(item, index) in dimensions"
:key=
"index"
class=
"field-widget-label"
><div>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</div></el-tag>
</draggable>
<div
class=
"field-widget-cate"
><i
class=
"icon iconfont icon-zhibiao"
></i><span>
指标列
</span></div>
<draggable
v-model=
"measures"
class=
"field-widget-tag"
:options=
"
{sort: false, ghostClass: 'ghost', group: {name: 'measures', pull: true, put: false}}">
<el-tag
v-for=
"(item, index) in measures"
:key=
"index"
class=
"field-widget-label"
><div>
{{
item
.
alias
?
item
.
alias
+
'('
+
item
.
col
+
')'
:
item
.
col
}}
</div></el-tag>
</draggable>
</div>
</el-card>
</el-aside>
<el-container>
<el-header
class=
"chart-action-bar"
style=
"height: 40px;text-align: right;"
>
<el-button
icon=
"el-icon-view"
type=
"text"
>
预览
</el-button>
<el-button
icon=
"el-icon-delete"
type=
"text"
>
清空
</el-button>
<el-button
icon=
"el-icon-plus"
type=
"text"
>
保存
</el-button>
<el-button
icon=
"el-icon-close"
type=
"text"
>
取消
</el-button>
</el-header>
<el-main
class=
"widget-center-container"
>
<el-row>
<el-divider
content-position=
"left"
>
行维
</el-divider>
<el-col>
<div
class=
"draggable-wrapper"
>
<draggable
group=
"dimensions"
:list=
"form.keys"
>
<el-tag
v-for=
"(item, index) in form.keys"
:key=
"index"
class=
"draggable-item"
closable
@
close=
"handleKeyTagClose(index, item)"
>
{{
item
.
alias
?
item
.
alias
:
item
.
col
}}
</el-tag>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider
content-position=
"left"
>
列维
</el-divider>
<el-col>
<div
class=
"draggable-wrapper"
>
<draggable
group=
"dimensions"
:list=
"form.groups"
>
<el-tag
v-for=
"(item, index) in form.groups"
:key=
"index"
class=
"draggable-item"
closable
@
close=
"handleGroupTagClose(index, item)"
>
{{
item
.
alias
?
item
.
alias
:
item
.
col
}}
</el-tag>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider
content-position=
"left"
>
指标
</el-divider>
<el-col>
<div
class=
"draggable-wrapper"
>
<draggable
group=
"measures"
:list=
"form.values"
@
change=
"handleValueDragChange"
>
<div
v-for=
"(item, index) in form.values"
:key=
"index"
class=
"draggable-item"
>
<el-tag>
{{
item
.
alias
?
item
.
aggregate_type
+
'('
+
item
.
col
+
') -> '
+
item
.
alias
:
item
.
aggregate_type
+
'('
+
item
.
col
+
')'
}}
</el-tag>
<span
class=
"draggable-item-handle"
v-if=
"item.radio"
>
<el-radio-group
size=
"mini"
v-model=
"item.aggregate_type"
@
change=
"((label)=>
{handleValueChangeTagType(label, index, item)})">
<el-radio
label=
"sum"
size=
"mini"
>
求和
</el-radio>
<el-radio
label=
"count"
size=
"mini"
>
计数
</el-radio>
<el-radio
label=
"avg"
size=
"mini"
>
平均值
</el-radio>
<el-radio
label=
"max"
size=
"mini"
>
最大值
</el-radio>
<el-radio
label=
"min"
size=
"mini"
>
最小值
</el-radio>
</el-radio-group>
</span>
<span
class=
"draggable-item-handle"
v-else
@
click=
"handleValueTagType(index, item)"
><i
class=
"el-icon-edit-outline"
></i></span>
<span
class=
"draggable-item-handle"
@
click=
"handleValueTagClose(index, item)"
><i
class=
"el-icon-delete"
></i></span>
</div>
</draggable>
</div>
</el-col>
</el-row>
<el-row>
<el-divider>
预览区
</el-divider>
<el-tabs
type=
"card"
>
<el-tab-pane
label=
"预览"
>
<div
class=
"data-tab-pane"
>
预览
</div>
</el-tab-pane>
<el-tab-pane
label=
"查询脚本"
>
<div
class=
"script-tab-pane"
>
查询脚本
</div>
</el-tab-pane>
</el-tabs>
<el-col>
</el-col>
</el-row>
</el-main>
</el-container>
<el-aside
width=
"300px"
class=
"widget-config-container"
>
<el-container>
<el-tabs
type=
"border-card"
stretch
style=
"width: 100%;"
>
<el-tab-pane
label=
"图表属性"
>
<el-main>
<div
class=
"chart-tab-pane"
>
图表属性
</div>
</el-main>
</el-tab-pane>
<el-tab-pane
label=
"图表配置"
>
<el-main>
<div
class=
"chart-tab-pane"
>
图表配置
</div>
</el-main>
</el-tab-pane>
</el-tabs>
</el-container>
</el-aside>
</el-container>
</div>
</
template
>
<
script
>
import
{
getDataSet
,
listDataSet
}
from
'@/api/factory/dataset'
import
draggable
from
'vuedraggable'
export
default
{
name
:
'ChartMake'
,
components
:
{
draggable
},
data
()
{
return
{
form
:
{
keys
:
[],
groups
:
[],
values
:
[]
},
dataset
:
{},
datasetOptions
:
[],
dimensions
:
[],
measures
:
[]
}
},
created
()
{
this
.
getDataSetList
()
},
methods
:
{
getDataSetList
()
{
listDataSet
().
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
datasetOptions
=
response
.
data
}
})
},
handleCommand
(
command
)
{
getDataSet
(
command
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
dataset
=
response
.
data
this
.
dimensions
=
this
.
dataset
.
schemaConfig
.
dimensions
this
.
measures
=
this
.
dataset
.
schemaConfig
.
measures
}
})
},
handleKeyTagClose
(
index
,
tag
)
{
this
.
form
.
keys
.
splice
(
index
,
1
)
this
.
dimensions
.
push
(
tag
)
},
handleGroupTagClose
(
index
,
tag
)
{
this
.
form
.
groups
.
splice
(
index
,
1
)
this
.
dimensions
.
push
(
tag
)
},
handleValueDragChange
(
tag
)
{
if
(
tag
.
added
)
{
this
.
$set
(
tag
.
added
.
element
,
'aggregate_type'
,
'sum'
)
}
},
handleValueChangeTagType
(
label
,
index
,
tag
)
{
this
.
$delete
(
tag
,
'radio'
)
},
handleValueTagType
(
index
,
tag
)
{
this
.
$set
(
tag
,
'radio'
,
true
)
},
handleValueTagClose
(
index
,
tag
)
{
this
.
form
.
values
.
splice
(
index
,
1
)
tag
.
aggregate_type
=
''
this
.
measures
.
push
(
tag
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.chart-container
{
height
:
100%
;
width
:
100%
;
margin
:
0
;
padding
:
0
;
.el-container
{
height
:
100%
;
width
:
100%
;
.widget-field-container
{
color
:
#333
;
padding
:
0
;
margin-bottom
:
0
;
background
:
#FFFFFF
;
box-shadow
:
0
0
1px
1px
#ccc
;
.el-card
>>>
.el-card__header
{
padding
:
0
;
border-bottom
:
1px
solid
#EBEEF5
;
-webkit-box-sizing
:
border-box
;
box-sizing
:
border-box
;
font-size
:
16px
;
background-color
:
lightgrey
;
}
.field-widget-cate
{
padding
:
0px
10px
;
font-size
:
13px
;
background-color
:
#f5f7fa
;
border-bottom
:
1px
solid
#e4e7ed
;
.icon
{
margin-right
:
6px
;
}
}
.field-widget-tag
{
position
:
relative
;
overflow
:
hidden
;
padding
:
10px
10px
;
margin
:
0
;
min-height
:
200px
;
.field-widget-label
{
font-size
:
12px
;
display
:
block
;
width
:
48%
;
position
:
relative
;
float
:
left
;
left
:
0
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
margin
:
1%
;
color
:
#333
;
border
:
1px
solid
#F4F6FC
;
&:hover
{
color
:
#409EFF
;
border
:
1px
dashed
#409EFF
;
}
&
>
div
{
display
:
block
;
cursor
:
move
;
text-align
:
center
;
}
}
}
}
.widget-config-container
{
color
:
#333
;
padding
:
0
;
margin-bottom
:
0
;
background
:
#FFFFFF
;
box-shadow
:
0
0
1px
1px
#ccc
;
.chart-tab-pane
{
}
}
.el-main
{
padding
:
0
;
}
.chart-action-bar
{
height
:
40px
;
line-height
:
40px
;
height
:
40px
;
text-align
:
right
;
color
:
#333
;
border-bottom
:
2px
solid
#e4e7ed
;
}
.widget-center-container
{
box-shadow
:
0
0
1px
1px
#ccc
;
border
:
1px
dashed
#999
;
.draggable-wrapper
{
height
:
40px
;
line-height
:
40px
;
border
:
1px
solid
#d7dae2
;
background
:
#f4f4f7
;
margin
:
0
10px
;
.draggable-item
{
margin
:
0
5px
;
display
:
inline-block
;
border
:
1px
solid
#ebecef
;
height
:
32px
;
line-height
:
35px
;
border-radius
:
4px
;
.draggable-item-handle
{
background-color
:
#ecf5ff
;
border-color
:
#d9ecff
;
display
:
inline-block
;
height
:
32px
;
padding
:
0
10px
;
line-height
:
30px
;
font-size
:
12px
;
color
:
#409EFF
;
border-width
:
1px
;
border-style
:
solid
;
box-sizing
:
border-box
;
white-space
:
nowrap
;
cursor
:
pointer
;
margin-left
:
-5px
;
}
}
}
.data-tab-pane
{
margin
:
10px
;
min-height
:
200px
;
}
.script-tab-pane
{
margin
:
10px
;
border
:
1px
dashed
rgb
(
153
,
153
,
153
);
min-height
:
200px
;
}
}
}
}
</
style
>
datax-ui/src/views/visual/dataset/DataSetAdd.vue
View file @
1a97dd64
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
<
script
>
<
script
>
import
{
addDataSet
,
sqlAnalyse
}
from
'@/api/visual/dataset'
import
{
addDataSet
,
sqlAnalyse
}
from
'@/api/visual/dataset'
import
{
listDataSource
,
queryByPage
}
from
'@/api/
factory
/datasource'
import
{
listDataSource
,
queryByPage
}
from
'@/api/
metadata
/datasource'
import
sqlFormatter
from
'sql-formatter'
import
sqlFormatter
from
'sql-formatter'
import
SqlEditor
from
'@/components/SqlEditor'
import
SqlEditor
from
'@/components/SqlEditor'
import
draggable
from
'vuedraggable'
import
draggable
from
'vuedraggable'
...
...
datax-ui/src/views/visual/dataset/DataSetDetail.vue
View file @
1a97dd64
...
@@ -119,7 +119,7 @@
...
@@ -119,7 +119,7 @@
<
script
>
<
script
>
import
{
getDataSet
}
from
'@/api/visual/dataset'
import
{
getDataSet
}
from
'@/api/visual/dataset'
import
{
listDataSource
,
queryByPage
}
from
'@/api/
factory
/datasource'
import
{
listDataSource
,
queryByPage
}
from
'@/api/
metadata
/datasource'
import
SqlEditor
from
'@/components/SqlEditor'
import
SqlEditor
from
'@/components/SqlEditor'
export
default
{
export
default
{
...
...
datax-ui/src/views/visual/dataset/DataSetEdit.vue
View file @
1a97dd64
...
@@ -141,8 +141,8 @@
...
@@ -141,8 +141,8 @@
</template>
</template>
<
script
>
<
script
>
import
{
getDataSet
,
updateDataSet
,
sqlAnalyse
}
from
'@/api/
factory
/dataset'
import
{
getDataSet
,
updateDataSet
,
sqlAnalyse
}
from
'@/api/
visual
/dataset'
import
{
listDataSource
,
queryByPage
}
from
'@/api/
factory
/datasource'
import
{
listDataSource
,
queryByPage
}
from
'@/api/
metadata
/datasource'
import
sqlFormatter
from
'sql-formatter'
import
sqlFormatter
from
'sql-formatter'
import
SqlEditor
from
'@/components/SqlEditor'
import
SqlEditor
from
'@/components/SqlEditor'
import
draggable
from
'vuedraggable'
import
draggable
from
'vuedraggable'
...
...
datax-ui/src/views/visual/dataset/DataSetList.vue
View file @
1a97dd64
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
icon=
"el-icon-plus"
icon=
"el-icon-plus"
size=
"mini"
size=
"mini"
@
click=
"handleAdd"
@
click=
"handleAdd"
v-hasPerm=
"['factory:dataset:add']"
>
新增
</el-button>
>
新增
</el-button>
<el-button
<el-button
type=
"success"
type=
"success"
...
@@ -33,7 +32,6 @@
...
@@ -33,7 +32,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleEdit"
@
click=
"handleEdit"
v-hasPerm=
"['factory:dataset:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
type=
"info"
type=
"info"
...
@@ -41,7 +39,6 @@
...
@@ -41,7 +39,6 @@
size=
"mini"
size=
"mini"
:disabled=
"single"
:disabled=
"single"
@
click=
"handleDetail"
@
click=
"handleDetail"
v-hasPerm=
"['factory:dataset:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
type=
"danger"
type=
"danger"
...
@@ -49,7 +46,6 @@
...
@@ -49,7 +46,6 @@
size=
"mini"
size=
"mini"
:disabled=
"multiple"
:disabled=
"multiple"
@
click=
"handleBatchDelete"
@
click=
"handleBatchDelete"
v-hasPerm=
"['factory:dataset:remove']"
>
删除
</el-button>
>
删除
</el-button>
</el-button-group>
</el-button-group>
</el-col>
</el-col>
...
@@ -129,21 +125,18 @@
...
@@ -129,21 +125,18 @@
type=
"text"
type=
"text"
icon=
"el-icon-edit-outline"
icon=
"el-icon-edit-outline"
@
click=
"handleEdit(scope.row)"
@
click=
"handleEdit(scope.row)"
v-hasPerm=
"['factory:dataset:edit']"
>
修改
</el-button>
>
修改
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-view"
icon=
"el-icon-view"
@
click=
"handleDetail(scope.row)"
@
click=
"handleDetail(scope.row)"
v-hasPerm=
"['factory:dataset:detail']"
>
详情
</el-button>
>
详情
</el-button>
<el-button
<el-button
size=
"mini"
size=
"mini"
type=
"text"
type=
"text"
icon=
"el-icon-delete"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
v-hasPerm=
"['factory:dataset:remove']"
>
删除
</el-button>
>
删除
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
<el-button
slot=
"reference"
>
操作
</el-button>
</el-popover>
</el-popover>
...
...
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