Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
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
platform
hp-smart
Commits
9afb54a8
Commit
9afb54a8
authored
Jun 25, 2024
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报屏链接获取bugfix
parent
e7723a96
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
309 additions
and
0 deletions
+309
-0
BEXP00.js
src/main/webapp/BE/XP/BEXP00.js
+239
-0
BEXP00.jsp
src/main/webapp/BE/XP/BEXP00.jsp
+70
-0
No files found.
src/main/webapp/BE/XP/BEXP00.js
0 → 100644
View file @
9afb54a8
var
relationalDsOperationType
=
0
;
// 定义操作类型 0:新增 1:修改 2:删除 3:测试连接 4:调试数据源
var
relationalDsModifyParam
=
{};
// 用于存储修改关系型数据源的参数信息
// 确定当前操作类型
function
getDsOperationType
(
operationType
,
dsType
)
{
switch
(
dsType
)
{
case
0
:
// 关系型数据源
relationalDsOperationType
=
operationType
;
break
;
case
1
:
// 时序型数据源
tsdbDsOperationType
=
operationType
;
break
;
case
2
:
// 时序型数据源
microServiceDsOperationType
=
operationType
;
break
;
default
:
break
;
}
};
// 初始化调试结果表格
function
loadEmptyGrid
()
{
document
.
querySelector
(
"#result_grid"
).
innerHTML
=
""
;
var
gridParam
=
{
height
:
300
,
editable
:
false
,
selectable
:
false
,
columns
:
[]
};
for
(
var
i
=
0
;
i
<
5
;
i
++
)
{
gridParam
.
columns
.
push
({
field
:
""
,
title
:
" "
,
});
}
var
grid
=
$
(
"#result_grid"
).
kendoGrid
(
gridParam
).
data
(
"kendoGrid"
);
for
(
i
=
0
;
i
<
1
;
i
++
)
{
grid
.
dataSource
.
add
({
foo
:
""
});
}
}
// 渲染调试结果数据表数据
function
loadDbGrid
(
ei
)
{
var
block
=
ei
.
getBlock
(
"result"
);
var
dataItems
=
block
.
getRows
();
var
data
=
[];
data
=
$
.
extend
(
true
,
data
,
dataItems
);
var
colCount
=
block
.
meta
.
colCount
;
var
length
=
block
.
rows
.
length
;
var
meta
=
block
.
meta
.
toJSON
();
var
rows
=
block
.
rows
;
if
(
length
===
0
)
{
IPLAT
.
NotificationUtil
(
"没有查询到数据!"
,
"warning"
);
return
;
}
document
.
querySelector
(
"#result_grid"
).
innerHTML
=
""
;
var
gridParam
=
{
dataBound
:
function
()
{
for
(
var
i
=
0
;
i
<
this
.
columns
.
length
;
i
++
)
{
this
.
autoFitColumn
(
i
);
}
},
height
:
300
,
width
:
"initial"
,
scrollable
:
{
virtual
:
true
,
},
editable
:
false
,
selectable
:
false
,
columns
:
[]
};
var
column_options
=
null
;
for
(
var
i
=
0
;
i
<
colCount
;
i
++
)
{
column_options
=
{
field
:
meta
.
columns
[
i
].
name
};
gridParam
.
columns
.
push
(
column_options
);
}
var
grid_data
=
[],
row
;
for
(
i
=
0
;
i
<
length
;
i
++
)
{
row
=
{};
for
(
var
j
=
0
;
j
<
colCount
;
j
++
)
{
row
[
meta
.
columns
[
j
].
name
]
=
rows
[
i
][
j
];
}
grid_data
.
push
(
row
);
}
gridParam
.
dataSource
=
new
kendo
.
data
.
DataSource
({
data
:
grid_data
,
pageSize
:
10
,
});
var
grid
=
$
(
"#result_grid"
).
kendoGrid
(
gridParam
).
data
(
"kendoGrid"
);
IPLAT
.
NotificationUtil
(
"本次查询返回 "
+
grid_data
.
length
+
" 条数据"
);
}
$
(
function
(){
$
(
"#QUERY"
).
on
(
"click"
,
function
(
e
)
{
resultGrid
.
dataSource
.
page
(
1
);
});
IPLATUI
.
EFGrid
=
{
"result"
:
{
beforeAdd
:
function
(
e
)
{
// 阻止默认操作
e
.
preventDefault
();
relationalDsOperationType
=
0
;
relationalDsModifyParam
=
{};
window
.
localStorage
.
setItem
(
"relationalDsOperationType"
,
JSON
.
stringify
(
relationalDsOperationType
));
window
.
localStorage
.
setItem
(
"relationalDsModifyParam"
,
JSON
.
stringify
(
relationalDsModifyParam
));
window
.
localStorage
.
setItem
(
"tsdbDsOperationType"
,
"0"
);
// 避免rdb和tsdb其中一者新增时因另一者操作类型为修改而跳过类型选择页面
window
.
relationalDBConfigWindow
.
open
().
center
();
},
toolbarConfig
:{
delete
:
false
},
columns
:
[
{
field
:
"operation"
,
enable
:
false
,
template
:
function
(
item
)
{
return
'<div style="text-align: center;margin: 0 auto">'
+
'<button onclick="getDsOperationType(1,0)" style="background:transparent;border-width:0px;outline:none;" title="编辑数据源"><span><i class="fa fa-pencil fa-lg databutton" aria-hidden="true"></i></span></button>'
+
'<button onclick="getDsOperationType(2,0)" style="background:transparent;border-width:0px;outline:none;" title="删除数据源"><span><i class="fa fa-trash fa-lg databutton" aria-hidden="true"></i></span></button>'
+
'<button onclick="getDsOperationType(3,0)" style="background:transparent;border-width:0px;outline:none;" title="测试连接数据源"><span><i class="fa fa-link fa-lg databutton" aria-hidden="true"></i></span></button>'
+
'<button onclick="getDsOperationType(4,0)" style="background:transparent;border-width:0px;outline:none;" title="关系型数据源调试"><span><i class="fa fa-play-circle-o fa-lg databutton" aria-hidden="true"></i></span></button>'
+
'</div>'
;
}
}
],
onRowClick
:
function
(
e
)
{
if
(
relationalDsOperationType
==
2
)
{
// 执行删除操作
let
uuid
=
e
.
model
.
uuid
;
let
dbName
=
e
.
model
.
dbName
;
let
model
=
e
.
model
;
IPLAT
.
confirm
({
message
:
'<b>确定删除此数据源吗?此操作会删除关联的所有数据集</b>'
,
okFn
:
function
(
e
)
{
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"result"
,
0
,
"uuid"
,
uuid
);
inInfo
.
set
(
"result"
,
0
,
"dbName"
,
dbName
);
EiCommunicator
.
send
(
"BEXP00"
,
"delete"
,
inInfo
,
{
onSuccess
:
function
(
response
)
{
if
(
response
.
status
<
0
)
{
NotificationUtil
(
response
.
msg
,
"error"
);
}
else
{
NotificationUtil
(
response
.
msg
);
resultGrid
.
removeRows
(
model
);
}
updateDataSourceCache
(
"relationalDataSource"
);
},
// 服务调用失败后的回调函数 onFail
onFail
:
function
(
errorMsg
,
status
,
e
)
{
/* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
// 调用发生异常
console
.
log
(
errorMsg
);
}
},
{
async
:
true
});
},
cancelFn
:
function
(
e
)
{},
title
:
'删除'
,
minWidth
:
400
});
}
else
if
(
relationalDsOperationType
==
3
)
{
// 执行测试连接操作
var
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"result"
,
0
,
"dbName"
,
e
.
model
.
dbName
);
inInfo
.
set
(
"result"
,
0
,
"dbType"
,
e
.
model
.
dbType
);
inInfo
.
set
(
"result"
,
0
,
"dbAddress"
,
e
.
model
.
dbAddress
.
trim
());
inInfo
.
set
(
"result"
,
0
,
"dbUsername"
,
e
.
model
.
dbUsername
);
inInfo
.
set
(
"result"
,
0
,
"dbPassword"
,
e
.
model
.
dbPassword
);
EiCommunicator
.
send
(
"BEXP00"
,
"testDbConnection"
,
inInfo
,
{
onSuccess
:
function
(
response
)
{
if
(
response
.
status
<
0
)
{
NotificationUtil
(
response
.
msg
,
"error"
);
IPLAT
.
alert
({
message
:
'<b>连接测试失败!</b>'
,
title
:
'提示'
,
minWidth
:
400
});
}
else
{
NotificationUtil
(
response
.
msg
,
"success"
);
IPLAT
.
alert
({
message
:
'<b>连接测试成功!</b>'
,
title
:
'提示'
,
minWidth
:
400
});
}
},
// 服务调用失败后的回调函数 onFail
onFail
:
function
(
errorMsg
,
status
,
e
)
{
/* errorMsg 是平台格式化后的异常消息, status, e的含义和$.ajax的含义相同,请参考jQuery文档 */
// 调用发生异常
console
.
log
(
errorMsg
);
}
},
{
async
:
true
});
}
else
{
relationalDsModifyParam
.
uuid
=
e
.
model
.
uuid
;
relationalDsModifyParam
.
dbName
=
e
.
model
.
dbName
;
relationalDsModifyParam
.
dbType
=
e
.
model
.
dbType
;
relationalDsModifyParam
.
dbDesc
=
e
.
model
.
dbDesc
;
relationalDsModifyParam
.
dbAddress
=
e
.
model
.
dbAddress
;
relationalDsModifyParam
.
host
=
e
.
model
.
host
;
relationalDsModifyParam
.
port
=
e
.
model
.
port
;
relationalDsModifyParam
.
rdb
=
e
.
model
.
rdb
;
relationalDsModifyParam
.
param
=
e
.
model
.
param
;
relationalDsModifyParam
.
dbUsername
=
e
.
model
.
dbUsername
;
relationalDsModifyParam
.
dbPassword
=
e
.
model
.
dbPassword
;
relationalDsModifyParam
.
dbCapacity
=
e
.
model
.
dbCapacity
;
window
.
localStorage
.
setItem
(
"relationalDsOperationType"
,
JSON
.
stringify
(
relationalDsOperationType
));
window
.
localStorage
.
setItem
(
"relationalDsModifyParam"
,
JSON
.
stringify
(
relationalDsModifyParam
));
if
(
relationalDsOperationType
==
1
)
{
// 执行修改操作
window
.
relationalDBConfigWindow
.
open
().
center
();
}
if
(
relationalDsOperationType
==
4
)
{
// 执行调试数据源操作
window
.
relationalDBTestWindow
.
open
().
center
();
}
relationalDsOperationType
=
5
;
}
}
}
};
IPLATUI
.
EFWindow
=
{
"relationalDBConfig"
:
{
close
:
function
(
e
)
{
resultGrid
.
dataSource
.
page
(
1
);
}
}
};
});
\ No newline at end of file
src/main/webapp/BE/XP/BEXP00.jsp
0 → 100644
View file @
9afb54a8
<%--
Created by IntelliJ IDEA.
User: situchenguang
Date: 2022/5/20
Time: 9:13
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="关系型数据源">
<jsp:attribute name="header">
<style type="text/css">
.i-theme-ant .databutton{
color: #3088F4;
}
.i-theme-antlarge .databutton{
color: #3088F4;
}
.i-theme-deepblue .databutton{
color: white;
}
.i-theme-deepbluelarge .databutton{
color: white;
}
</style>
</jsp:attribute>
<jsp:body>
<%-- <script src="${ctx}/BE/XP/BEXP01.js"></script>--%>
<EF:EFWindow id="relationalDBConfig" url="${ctx}/web/BEXP0001" width="80%" height="635px" title="关系型数据源配置" lazyload="true" refresh="true"/>
<EF:EFWindow id="relationalDBTest" url="${ctx}/web/BEXP0002" width="80%" height="80%" title="关系型数据源调试" lazyload="true" refresh="true"/>
<div class="row">
<div class="col-md-12">
<EF:EFRegion title="查询区" id="inqu">
<div class="row">
<EF:EFInput ename="inqu_status-0-dbName" cname="数据源名称" ratio="2:8" colWidth="6"/>
<EF:EFSelect ename="inqu_status-0-dbType" cname="数据库类型" ratio="2:8" colWidth="6">
<EF:EFOption label="" value=""/>
<EF:EFOption label="Oracle" value="Oracle"/>
<EF:EFOption label="DB2" value="DB2"/>
<EF:EFOption label="MySql" value="MySQL"/>
<EF:EFOption label="SqlServer" value="SqlServer"/>
<EF:EFOption label="PostgreSQL" value="PostgreSQL"/>
</EF:EFSelect>
</div>
</EF:EFRegion>
<EF:EFRegion title="关系型数据源列表" id="result" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no">
<EF:EFColumn ename="dbName" cname="名称" required ="true" readonly="true"/>
<EF:EFColumn ename="dbDesc" cname="描述" readonly="true"/>
<EF:EFColumn ename="dbType" cname="数据库类型" required ="true" readonly="true"/>
<EF:EFColumn ename="dbAddress" cname="地址" required ="true" readonly="true"/>
<EF:EFColumn ename="host" cname="主机" hidden="true" required ="true"/>
<EF:EFColumn ename="port" cname="端口" hidden="true" required ="true"/>
<EF:EFColumn ename="rdb" cname="数据库" hidden="true" required ="true"/>
<EF:EFColumn ename="param" cname="自定义参数" hidden="true"/>
<EF:EFColumn ename="dbUsername" cname="用户名" hidden="true" required ="true"/>
<EF:EFColumn ename="dbPassword" cname="密码" hidden="true"/>
<EF:EFColumn ename="dbCapacity" cname="数据容量(MB)" readonly="true"/>
<EF:EFColumn ename="operation" cname="操作"/>
</EF:EFGrid>
</EF:EFRegion>
</div>
</div>
</jsp:body>
</EF:EFPage>
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