Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
d22c8094
提交
d22c8094
authored
8月 03, 2021
作者:
taojinlong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 允许修改数据源
上级
cbf8c94f
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
37 行增加
和
16 行删除
+37
-16
en.js
frontend/src/lang/en.js
+3
-1
tw.js
frontend/src/lang/tw.js
+3
-1
zh.js
frontend/src/lang/zh.js
+5
-2
message.js
frontend/src/utils/message.js
+2
-2
form.vue
frontend/src/views/system/datasource/form.vue
+24
-10
没有找到文件。
frontend/src/lang/en.js
浏览文件 @
d22c8094
...
...
@@ -334,7 +334,9 @@ export default {
input_pwd
:
'Please input password'
,
message_box
:
{
alert
:
'Alert'
,
confirm
:
'Confirm'
confirm
:
'Confirm'
,
ok
:
'Confirm'
,
cancel
:
'Cancel'
}
},
documentation
:
{
...
...
frontend/src/lang/tw.js
浏览文件 @
d22c8094
...
...
@@ -334,7 +334,9 @@ export default {
input_pwd
:
'請輸入密碼'
,
message_box
:
{
alert
:
'警告'
,
confirm
:
'確認'
confirm
:
'確認'
,
ok
:
'確認'
,
cancel
:
'取消'
}
},
documentation
:
{
...
...
frontend/src/lang/zh.js
浏览文件 @
d22c8094
...
...
@@ -334,7 +334,9 @@ export default {
input_pwd
:
'请输入密码'
,
message_box
:
{
alert
:
'警告'
,
confirm
:
'确认'
confirm
:
'确认'
,
ok
:
'确认'
,
cancel
:
'取消'
}
},
documentation
:
{
...
...
@@ -1025,7 +1027,8 @@ export default {
oracle_service_name
:
'服务名'
,
get_schema
:
'获取 Schema'
,
schema
:
'数据库 Schema'
,
please_choose_schema
:
'请选择数据库 Schema'
please_choose_schema
:
'请选择数据库 Schema'
,
edit_datasource_msg
:
'修改数据源信息,可能会导致改数据源下的数据集不可用,确认修改?'
},
pblink
:
{
key_pwd
:
'请输入密码打开链接'
,
...
...
frontend/src/utils/message.js
浏览文件 @
d22c8094
...
...
@@ -9,8 +9,8 @@ export const $alert = (message, callback, options) => {
export
const
$confirm
=
(
message
,
callback
,
options
=
{})
=>
{
const
defaultOptions
=
{
confirmButtonText
:
i18n
.
t
(
'common
.button
.ok'
),
cancelButtonText
:
i18n
.
t
(
'common
.button
.cancel'
),
confirmButtonText
:
i18n
.
t
(
'common
s.message_box
.ok'
),
cancelButtonText
:
i18n
.
t
(
'common
s.message_box
.cancel'
),
type
:
'warning'
,
...
options
}
...
...
frontend/src/views/system/datasource/form.vue
浏览文件 @
d22c8094
...
...
@@ -26,10 +26,10 @@
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.host')"
prop=
"configuration.host"
>
<el-input
v-model=
"form.configuration.host"
autocomplete=
"off"
:disabled=
"formType=='modify'"
/>
<el-input
v-model=
"form.configuration.host"
autocomplete=
"off"
/>
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.data_base')"
prop=
"configuration.dataBase"
>
<el-input
v-model=
"form.configuration.dataBase"
autocomplete=
"off"
:disabled=
"formType=='modify'"
/>
<el-input
v-model=
"form.configuration.dataBase"
autocomplete=
"off"
/>
</el-form-item>
<el-form-item
v-if=
"form.type=='oracle'"
:label=
"$t('datasource.oracle_connection_type')"
prop=
"configuration.connectionType"
>
...
...
@@ -38,7 +38,7 @@
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.user_name')"
prop=
"configuration.username"
>
<el-input
v-model=
"form.configuration.username"
autocomplete=
"off"
:disabled=
"formType=='modify'"
/>
<el-input
v-model=
"form.configuration.username"
autocomplete=
"off"
/>
</el-form-item>
<el-form-item
v-if=
"form.configuration.dataSourceType=='jdbc'"
:label=
"$t('datasource.password')"
prop=
"configuration.password"
>
<el-input
v-model=
"form.configuration.password"
autocomplete=
"off"
show-password
/>
...
...
@@ -53,7 +53,7 @@
</el-form-item>
<el-form-item
v-if=
"form.type=='oracle'"
:label=
"$t('datasource.schema')"
>
<el-select
filterable
v-model=
"form.configuration.schema"
:placeholder=
"$t('datasource.please_choose_schema')"
class=
"select-width"
:disabled=
"formType=='modify'"
>
<el-select
filterable
v-model=
"form.configuration.schema"
:placeholder=
"$t('datasource.please_choose_schema')"
class=
"select-width"
>
<el-option
v-for=
"item in schemas"
:key=
"item"
...
...
@@ -79,6 +79,8 @@
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
{
addDs
,
editDs
,
getSchema
,
validateDs
}
from
'@/api/system/datasource'
import
{
$confirm
}
from
'@/utils/message'
export
default
{
name
:
'DsForm'
,
components
:
{
LayoutContent
},
...
...
@@ -105,7 +107,8 @@ export default {
},
allTypes
:
[{
name
:
'mysql'
,
label
:
'MySQL'
,
type
:
'jdbc'
},
{
name
:
'oracle'
,
label
:
'Oracle'
,
type
:
'jdbc'
}],
schemas
:
[],
canEdit
:
false
canEdit
:
false
,
originConfiguration
:
{}
}
},
...
...
@@ -140,6 +143,7 @@ export default {
edit
(
row
)
{
this
.
formType
=
'modify'
this
.
form
=
Object
.
assign
({},
row
)
this
.
originConfiguration
=
this
.
form
.
configuration
this
.
form
.
configuration
=
JSON
.
parse
(
this
.
form
.
configuration
)
},
...
...
@@ -156,11 +160,21 @@ export default {
const
method
=
this
.
formType
===
'add'
?
addDs
:
editDs
const
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
))
form
.
configuration
=
JSON
.
stringify
(
form
.
configuration
)
method
(
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
refreshTree
()
this
.
backToList
()
})
if
(
this
.
formType
!==
'add'
&&
this
.
originConfiguration
!==
form
.
configuration
)
{
$confirm
(
this
.
$t
(
'datasource.edit_datasource_msg'
),
()
=>
{
method
(
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
refreshTree
()
this
.
backToList
()
})
})
}
else
{
method
(
form
).
then
(
res
=>
{
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
this
.
refreshTree
()
this
.
backToList
()
})
}
}
else
{
return
false
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论