Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
buildbank-replica
Project
Project
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
姚珂
buildbank-replica
Commits
cb22f937
Commit
cb22f937
authored
Apr 30, 2026
by
黄同智
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.ruanyiit.com/yaoke/buildbank-replica
parents
33319abc
e140de0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
206 additions
and
17 deletions
+206
-17
account.html
account.html
+206
-17
No files found.
account.html
View file @
cb22f937
...
...
@@ -1088,7 +1088,7 @@
<table
class=
"tableList"
cellpadding=
"0"
cellspacing=
"0"
border=
"0"
width=
"100%"
id=
"rsTable2"
name=
"rsTable2"
>
<tbody>
<tr
class=
"tableListHead"
>
<td
nowrap=
""
style=
"width: 68px !important;"
class=
"txtLeft"
><div
id=
"lable1"
style=
"position: relative; left: 15px;"
><input
type=
"checkbox"
id=
"all_0"
onclick=
"select
all(0)"
;="
"
>
全选
</div></td>
<td
nowrap=
""
style=
"width: 68px !important;"
class=
"txtLeft"
><div
id=
"lable1"
style=
"position: relative; left: 15px;"
><input
type=
"checkbox"
id=
"all_0"
onclick=
"select
All(0)
"
>
全选
</div></td>
<td
nowrap=
""
><a
id=
"td1"
style=
"cursor: pointer;width: 164px;"
>
账号
<img
class=
"sortImgClass"
src=
"https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/sortNo.png"
style=
"vertical-align:text-bottom;_vertical-align:middle;margin-left:3px;"
></a></td>
<td
nowrap=
""
><a
id=
"td2"
style=
"cursor: pointer;width: 137.94px;"
>
账户名称
<img
class=
"sortImgClass"
src=
"https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/sortNo.png"
style=
"vertical-align:text-bottom;_vertical-align:middle;margin-left:3px;"
></a></td>
<td
nowrap=
""
><a
id=
"td3"
style=
"cursor: pointer;width: 80px;"
>
币种
<img
class=
"sortImgClass"
src=
"https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/sortNo.png"
style=
"vertical-align:text-bottom;_vertical-align:middle;margin-left:3px;"
></a></td>
...
...
@@ -1104,7 +1104,7 @@
<td
nowrap=
""
style=
"width: 26.52px;"
><a
id=
"showOrHideTableBtn"
onclick=
"setShowOrHideRsTable();parent.iFrameHeight();"
class=
"tableLink"
>
>>
</a></td>
</tr>
<tr
onmouseover=
"tdOver(this)"
onmouseout=
"tdOut(this)"
class=
"tableListBody"
>
<td><input
type=
"checkbox"
id=
"acc_42050123704500001941@156"
name=
"ACC_NO"
value=
"42050123704500001941@中科软盈(武汉)科技有限公司@中国建设银行股份有限公司武汉南湖大道支行@420237045@1@156@202004"
class=
"checkbox"
bankcode=
"202004"
></td>
<td><input
type=
"checkbox"
id=
"acc_42050123704500001941@156"
class=
"row-checkbox"
name=
"ACC_NO"
value=
"42050123704500001941@中科软盈(武汉)科技有限公司@中国建设银行股份有限公司武汉南湖大道支行@420237045@1@156@202004"
class=
"checkbox"
bankcode=
"202004"
></td>
<td><a
href=
"javaScript:getBalance('acc_42050123704500001941@156')"
>
42050123704500001941
</a>
</td>
<td
class=
"txtLeft fzWord"
onclick=
"balanceQuery('42050123704500001941@420237045@1@156@202004')"
>
中科软盈(武汉)科技有限公司
</td>
<td
nowrap=
""
onclick=
"balanceQuery('42050123704500001941@420237045@1@156@202004')"
>
人民币元
</td>
...
...
@@ -1131,7 +1131,7 @@
</div>
<!-- 表格下方的工具栏 -->
<div
class=
"table-action-bar"
>
<a
class=
"lineLeft"
><div
id=
"lable2"
style=
"position: relative; left: 10px;"
><input
type=
"checkbox"
id=
"all_1"
onclick=
"select
a
ll(1);"
>
全选
</div></a>
<a
class=
"lineLeft"
><div
id=
"lable2"
style=
"position: relative; left: 10px;"
><input
type=
"checkbox"
id=
"all_1"
onclick=
"select
A
ll(1);"
>
全选
</div></a>
<div
class=
"lineRight"
>
<div
class=
"tableLBtn_box"
>
<div
class=
"tableLBtn_active"
>
...
...
@@ -1288,27 +1288,216 @@ function balanceQuery(strAccno) {
document.getElementById('
bookBalance_
'+checkedAccno).innerHTML='
775342.62
';
}
}
//
1.
获取表头行元素
// 获取表头行元素
var headerRow = document.querySelector('
.
tableListHead
');
var lastClickedTh = null;
//
2. 绑定点击事件(利用事件冒泡)
//
点击表头进行切换
headerRow.addEventListener('
click
', function(event) {
// 获取实际被点击的元素
var target = event.target || event.srcElement;
// 3. 向上查找,直到找到包含 id 的 <a> 标签
// 因为用户可能点击的是图片(img)或者文字,我们要找到包裹它们的链接(a)
var target = event.target;
while (target && target.nodeName !== '
A
') {
target = target.parentNode;
}
// 如果找到了 <a> 标签
if (target && target.nodeName === '
A
') {
var clickedId = target.id; // 获取ID,例如 "td1", "td2"
var lastImg = clickedId.querySelector('
.
sortImgClass
');
// 4. 判断谁点击了
lastImg
if (!target || target.nodeName !== '
A
') return;
var img = target.querySelector('
.
sortImgClass
');
if (!img) return;
if (lastClickedTh && lastClickedTh !== target) {
var lastImg = lastClickedTh.querySelector('
.
sortImgClass
');
if (lastImg) {
lastImg.src = "https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/sortNo.png";
}
}
var currentSrc = img.src;
if (currentSrc.includes('
sortNo
.
png
')) {
img.src = "https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/sortUp.png";
} else if (currentSrc.includes('
sortUp
.
png
')) {
img.src = "https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/sortDn.png";
} else if (currentSrc.includes('
sortDn
.
png
')) {
img.src = "https://xc.b2bstatic3.ccb.com/V6/STY6/CN/images7/sortUp.png";
}
lastClickedTh = target;
});
// 获取所有行 checkbox
function getRowCheckboxes() {
return document.querySelectorAll('
.
row
-
checkbox
');
}
// 全选 / 取消全选
function selectAll(num) {
var isChecked;
if (num == 0) {
isChecked = document.getElementById('
all_0
').checked;
} else {
isChecked = document.getElementById('
all_1
').checked;
}
document.getElementById('
all_0
').checked = isChecked;
document.getElementById('
all_1
').checked = isChecked;
var checkboxes = getRowCheckboxes();
checkboxes.forEach(function(item) {
item.checked = isChecked;
});
}
// 反选
function invertSelection() {
var checkboxes = getRowCheckboxes();
checkboxes.forEach(function(item) {
item.checked = !item.checked;
});
updateSelectAllStatus();
}
// 单个点击时,联动“全选”
function updateSelectAllStatus() {
var checkboxes = getRowCheckboxes();
var allCheckbox = document.getElementById('
all_0
');
var allCheckboxs = document.getElementById('
all_1
');
var allChecked = true;
checkboxes.forEach(function(item) {
if (!item.checked) {
allChecked = false;
}
});
allCheckbox.checked = allChecked;
allCheckboxs.checked = allChecked;
}
// 给每个子 checkbox 绑定事件(页面加载后执行)
document.addEventListener('
DOMContentLoaded
', function() {
var checkboxes = getRowCheckboxes();
checkboxes.forEach(function(item) {
item.addEventListener('
change
', updateSelectAllStatus);
});
});
// 通用函数
function getTableData() {
var table = document.getElementById('
rsTable2
');
var rows = table.querySelectorAll('
tr
');
var data = [];
rows.forEach((tr, index) => {
if (tr.id === '
queryProcess
') return;
var cells = tr.querySelectorAll('
td
');
if (index === 0) {
cells = tr.querySelectorAll('
td
');
}
var row = [];
cells.forEach((td, i) => {
if (i === 0) return;
row.push(td.innerText.trim());
});
data.push(row);
});
return data;
}
// 下载方法
function downloadFile(content, fileName, type) {
var blob = new Blob([content], { type: type });
var link = document.createElement('
a
');
link.href = URL.createObjectURL(blob);
link.download = fileName;
link.click();
URL.revokeObjectURL(link.href);
}
function submitSelect(scope, type) {
// scope: 0 当前页 / 1 全部(你可以扩展)
// type: 1 txt 2 excel 3 csv 4 pdf
var data = getTableData();
switch (type) {
case '
1
':
downloadTXT(data);
break;
case '
2
':
downloadExcel(data);
break;
case '
3
':
downloadCSV(data);
break;
case '
4
':
downloadPDF(data);
break;
}
}
function downloadTXT(data) {
var content = data.map(row => row.join('
\
t
')).join('
\
n
');
downloadFile(content, '
活期账户列表下载
.
txt
', '
text
/
plain
');
}
function downloadCSV(data) {
var content = data.map(row => row.join('
,
')).join('
\
n
');
downloadFile(content, '
活期账户列表下载
.
csv
', '
text
/
csv
');
}
function downloadPDF(data) {
var win = window.open('', '
_blank
');
var html = `
<html>
<head><title>PDF</title></head>
<body>
<table border="1" cellspacing="0" cellpadding="5">
${data.map(row =>
`<tr>${row.map(cell => `<td>${cell}</td>`).join('')}</tr>`
).join('')}
</table>
</body>
</html>
`;
win.document.write(html);
win.document.close();
win.print();
}
function printPage(type) {
var table = document.getElementById('
rsTable2
').outerHTML;
var now = new Date();
var timeStr = now.getFullYear() + '
/
' + (now.getMonth() + 1) + '
/
' + now.getDate()
+ '
' + now.getHours() + '
:
' + now.getMinutes();
// 标题
var title = '
账户信息查询
-
活期账户
';
var win = window.open('', '
_blank
');
var html = `
<html>
<head>
<title>中国建设银行 企业网上银行</title>
<style>
body {
font-family: SimSun, Arial;
margin: 0;
}
.print-header {
display: flex;
justify-content: space-between;
font-size: 14px;
}
.print-title {
text-align: center;
font-size: 18px;
font-weight: bold;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
border: 1px solid #62a7e3;
}
td {
padding: 6px;
text-align: center;
}
td:first-child {
display: none;
}
</style>
</head>
<body>
${table}
</body>
</html>
`;
win.document.write(html);
win.document.close();
// 等渲染完成再打印
win.onload = function () {
win.print();
win.close();
};
}
</script>
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