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
9d8e74b3
Commit
9d8e74b3
authored
Jul 31, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
523413ac
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1063 additions
and
0 deletions
+1063
-0
ChangeRecordAdd.vue
datax-ui/src/views/metadata/changerecord/ChangeRecordAdd.vue
+233
-0
ChangeRecordDetail.vue
...ui/src/views/metadata/changerecord/ChangeRecordDetail.vue
+195
-0
ChangeRecordEdit.vue
...x-ui/src/views/metadata/changerecord/ChangeRecordEdit.vue
+231
-0
ChangeRecordList.vue
...x-ui/src/views/metadata/changerecord/ChangeRecordList.vue
+356
-0
index.vue
datax-ui/src/views/metadata/changerecord/index.vue
+48
-0
No files found.
datax-ui/src/views/metadata/changerecord/ChangeRecordAdd.vue
0 → 100644
View file @
9d8e74b3
<
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=
"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/metadata/datasource'
export
default
{
name
:
'ChangeRecordAdd'
,
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'
}
],
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
:
[]
}
},
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
}
})
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 步骤条下一步 */
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/metadata/changerecord/ChangeRecordDetail.vue
0 → 100644
View file @
9d8e74b3
<
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=
"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
,
sync
,
word
}
from
'@/api/metadata/datasource'
export
default
{
name
:
'ChangeRecordDetail'
,
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
:
[]
}
},
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
}
})
},
mounted
()
{
this
.
getDataSource
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 获取详情 */
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/metadata/changerecord/ChangeRecordEdit.vue
0 → 100644
View file @
9d8e74b3
<
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=
"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/metadata/datasource'
export
default
{
name
:
'ChangeRecordEdit'
,
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'
}
],
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
:
[]
}
},
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
}
})
},
mounted
()
{
this
.
getDataSource
(
this
.
data
.
id
)
},
methods
:
{
showCard
()
{
this
.
$emit
(
'showCard'
,
this
.
showOptions
)
},
/** 获取详情 */
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/metadata/changerecord/ChangeRecordList.vue
0 → 100644
View file @
9d8e74b3
<
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/metadata/datasource'
export
default
{
name
:
'ChangeRecordList'
,
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/metadata/changerecord/index.vue
0 → 100644
View file @
9d8e74b3
<
template
>
<div
class=
"app-container"
>
<transition
name=
"el-zoom-in-center"
>
<change-record-list
v-if=
"options.showList"
@
showCard=
"showCard"
></change-record-list>
</transition>
<transition
name=
"el-zoom-in-top"
>
<change-record-add
v-if=
"options.showAdd"
:data=
"options.data"
@
showCard=
"showCard"
></change-record-add>
</transition>
<transition
name=
"el-zoom-in-top"
>
<change-record-edit
v-if=
"options.showEdit"
:data=
"options.data"
@
showCard=
"showCard"
></change-record-edit>
</transition>
<transition
name=
"el-zoom-in-bottom"
>
<change-record-detail
v-if=
"options.showDetail"
:data=
"options.data"
@
showCard=
"showCard"
></change-record-detail>
</transition>
</div>
</
template
>
<
script
>
import
ChangeRecordList
from
'./ChangeRecordList'
import
ChangeRecordAdd
from
'./ChangeRecordAdd'
import
ChangeRecordEdit
from
'./ChangeRecordEdit'
import
ChangeRecordDetail
from
'./ChangeRecordDetail'
export
default
{
name
:
'ChangeRecord'
,
components
:
{
ChangeRecordList
,
ChangeRecordAdd
,
ChangeRecordEdit
,
ChangeRecordDetail
},
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
>
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