Commit 04fbc029 by lixinyi

iso报文bic查找弹窗调整,新增分页功能

parent 37651b0b
<template> <template>
<div> <div >
<el-table <el-table class="table-container"
ref="table" ref="table"
@select="rowSelectChange" @select="rowSelectChange"
@row-click="getCurrentRow" @row-click="getCurrentRow"
@row-dblclick="selectRow" @row-dblclick="selectRow"
@select-all="selectAll"
:header-cell-class-name="cellClass" :header-cell-class-name="cellClass"
:data="data" :data="data"
border border
...@@ -63,9 +62,6 @@ export default { ...@@ -63,9 +62,6 @@ export default {
return 'disabledCheck'; return 'disabledCheck';
} }
}, },
selectAll() {
this.$refs.table.clearSelection();
},
rowSelectChange(pageSelected, row) { rowSelectChange(pageSelected, row) {
// 取消其他行的选中状态 // 取消其他行的选中状态
this.$refs.table.clearSelection(); this.$refs.table.clearSelection();
...@@ -81,7 +77,7 @@ export default { ...@@ -81,7 +77,7 @@ export default {
}, },
currentPageChange(newPage) { currentPageChange(newPage) {
this.$emit("loadData", { this.$emit("loadData", {
currentPage: newPage, pageNum: newPage,
}); });
}, },
pageSizeChange(newPageSize) { pageSizeChange(newPageSize) {
...@@ -109,5 +105,10 @@ export default { ...@@ -109,5 +105,10 @@ export default {
line-height: 37px; line-height: 37px;
} }
.table-container {
width: 100%;
height: 300px; /* 根据需要设置高度 */
overflow-y: auto; /* 添加垂直滚动条 */
}
</style> </style>
\ No newline at end of file
...@@ -20,9 +20,27 @@ ...@@ -20,9 +20,27 @@
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
title="请选择" title="请选择"
v-if="dialogVisible" v-if="dialogVisible"
width="40%" width="80%"
append-to-body append-to-body
> >
<div>
<el-input
:disabled="disabled"
v-model="dataModel.value"
:maxlength="max"
:type="dataType"
:placeholder="vpcPlaceholder"
:show-word-limit="true"
style="width: 30%"
:class="{ inputDeep: active }"
>
</el-input>
<span class="search-btn" @click="loadData">
搜索
</span>
</div>
<s-table <s-table
ref="table" ref="table"
@selectionChange="selectionChange" @selectionChange="selectionChange"
...@@ -46,6 +64,7 @@ ...@@ -46,6 +64,7 @@
<script> <script>
import Table from "./Table.vue"; import Table from "./Table.vue";
import send from "../Service/post";
export default { export default {
components:{ components:{
...@@ -62,40 +81,27 @@ export default { ...@@ -62,40 +81,27 @@ export default {
ifaccount: false, ifaccount: false,
dialogVisible: false, dialogVisible: false,
// 最终选中的所有数据
allSelectedUserList: [],
// 最终选中的全部唯一字段列表
allUniquePropList: [],
// 唯一字段
uniqueProp: "id",
// 每次弹窗中选中的所有数据
allSelectedList: [], allSelectedList: [],
tableData: [], tableData: [],
tableConfig: { tableConfig: {
showSelect: true, showSelect: true,
selectable: (row, rowIndex) => { selectable: (row, rowIndex) => {
if (this.allUniquePropList.indexOf(row[this.uniqueProp]) === -1) {
if (rowIndex === row.index) {
return false;
} else {
return true; return true;
}
}
}, },
pageConfig: { pageConfig: {
pageSizeList: [3, 5, 10], pageSizeList: [3, 5, 10],
pageSize: 3, pageSize: 5,
currentPage: 1, pageNum: 1,
total: 0, total: 0,
}, },
itemList: [ itemList: [
{ {
label: "BIC Code", label: "BIC Code",
prop: "BIC", prop: "bic",
}, },
{ {
label: "Name", label: "Name",
prop: "NAM1", prop: "nam1",
}, },
], ],
}, },
...@@ -196,88 +202,59 @@ export default { ...@@ -196,88 +202,59 @@ export default {
// 点击选择按钮 // 点击选择按钮
choose() { choose() {
this.allUniquePropList = [];
this.allSelectedUserList.forEach((item) => {
this.allUniquePropList.push(item[this.uniqueProp]);
});
this.allSelectedList = []; this.allSelectedList = [];
this.dialogVisible = true; this.dialogVisible = true;
}, // 点击选择弹窗的确定按钮 }, // 点击选择弹窗的确定按钮
chooseConfirm() { chooseConfirm() {
console.log(this.allSelectedUserList.concat( console.log(this.allSelectedList[0].bic);
this.allSelectedList this.dataModel.value = this.allSelectedList[0].bic;
)[0].BIC)
this.dataModel.value = this.allSelectedUserList.concat(
this.allSelectedList
)[0].BIC;
this.dialogVisible = false; this.dialogVisible = false;
}, // 加载数据 }, // 加载数据
loadData(newPageConfig) { loadData(newPageConfig) {
if (newPageConfig && newPageConfig.currentPage) { console.log(newPageConfig);
this.tableConfig.pageConfig.currentPage = newPageConfig.currentPage; if (newPageConfig && newPageConfig.pageNum) {
this.tableConfig.pageConfig.pageNum = newPageConfig.pageNum;
} }
if (newPageConfig && newPageConfig.pageSize) { if (newPageConfig && newPageConfig.pageSize) {
this.tableConfig.pageConfig.pageSize = newPageConfig.pageSize; this.tableConfig.pageConfig.pageSize = newPageConfig.pageSize;
} }
const data = { const data = {
bicnam: "", bicnam: "",
biccod: "", biccod: this.dataModel.value,
currentPage: this.tableConfig.pageConfig.currentPage, pageNum: this.tableConfig.pageConfig.pageNum,
pageSize: this.tableConfig.pageConfig.pageSize, pageSize: this.tableConfig.pageConfig.pageSize,
}; };
// send.getBic(data).then((res) => { send.getBic(data).then((res) => {
// let data = res.data; let data = res.data;
// this.tableData = data.records; console.log(res);
// this.tableConfig.pageConfig.total = data.total; this.tableData = data.accountList;
// this.updateSelectedMark(); this.tableConfig.pageConfig.total = data.total;
// }); });
//调试数据 //调试数据
this.tableData = [ // this.tableData = [
{ // {
BIC: "001", // BIC: "001",
NAM1: "001", // NAM1: "001",
}, // },
{ // {
BIC: "002", // BIC: "002",
NAM1: "002", // NAM1: "002",
}, // },
] // ]
this.tableConfig.pageConfig.total = 2; // this.tableConfig.pageConfig.total = 2;
this.updateSelectedMark();
}, },
// 改变多选列的选中状态时,更新选中列表 // 改变多选列的选中状态时,更新选中列表
selectionChange(pageSelectedList) { selectionChange(pageSelectedList) {
// 当页唯一字段组成的列表 this.allSelectedList = pageSelectedList;
let uniquePropList = [];
this.tableData.forEach((row) => {
uniquePropList.push(row[this.uniqueProp]);
});
// 从全部选中的数据中,过滤掉当前页的数据,再添加当前页选中的数据
this.allSelectedList = this.allSelectedList
.filter((row) => !uniquePropList.includes(row[this.uniqueProp]))
.concat(pageSelectedList);
},
// 更新选中标记--选中数据与当页数据的交集,标记为选中状态
updateSelectedMark() {
this.$nextTick(() => {
let pageSelectedList = [];
this.allSelectedList.forEach((row1) => {
this.tableData.forEach((row2) => {
if (row1[this.uniqueProp] === row2[this.uniqueProp]) {
pageSelectedList.push(row2);
}
});
});
pageSelectedList.forEach((row) => {
this.$refs.table.toggleRowSelection(row);
});
});
}, },
}, },
mounted() { mounted() {
if("bicfi" === this.dataModel.tag){
this.loadData(); this.loadData();
}
if ("CHBHHKHHXXX"===this.dataModel.headBic) { if ("CHBHHKHHXXX"===this.dataModel.headBic) {
this.$set(this.dataModel, "value", "CHBHHKHHXXX"); this.$set(this.dataModel, "value", "CHBHHKHHXXX");
} }
...@@ -410,7 +387,7 @@ export default { ...@@ -410,7 +387,7 @@ export default {
.search-btn { .search-btn {
display: inline-block; display: inline-block;
width: 40px; width: 40px;
height: 30px; height: 33px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
background-color: #409EFF; background-color: #409EFF;
......
...@@ -613,8 +613,12 @@ export default { ...@@ -613,8 +613,12 @@ export default {
this.treeModel.treeNodeArry = jsonArry; this.treeModel.treeNodeArry = jsonArry;
//解决选择checked的但依旧置灰的错误 //解决选择checked的但依旧置灰的错误
this.changeTreeNodeStatus(this.treeModel.treeNodeArry); this.changeTreeNodeStatus(this.treeModel.treeNodeArry);
this.$nextTick(()=>{
console.log("-----初始化展开-----");
this.open();
});
console.log("cips2Json done");
}); });
console.log("mx2Json done");
}, },
parentNodeData(node) { parentNodeData(node) {
return node.parent.data; return node.parent.data;
...@@ -1008,6 +1012,11 @@ export default { ...@@ -1008,6 +1012,11 @@ export default {
}, },
mounted() { mounted() {
this.buildMsgStruct(); this.buildMsgStruct();
// 在nextTick回调函数中执行渲染完毕后的函数
this.$nextTick(()=>{
console.log("-----初始化展开-----");
this.open();
});
}, },
created(){ created(){
window.sessionStorage.clear() window.sessionStorage.clear()
......
...@@ -717,7 +717,7 @@ tag:"PlcAndNm", ...@@ -717,7 +717,7 @@ tag:"PlcAndNm",
type:"TextInput", type:"TextInput",
status:"M", status:"M",
maxLength:"350", maxLength:"350",
defaultValue:"/Document/FIToFICstmrCdtTrf/CdtTrfTxInf", defaultValue:"/Document/FICdtTrf/CdtTrfTxInf",
}, },
{ {
path:"0.1.18.1", path:"0.1.18.1",
......
package com.brilliance.mxeditor.bo;
import java.io.Serializable;
public class Account implements Serializable {
private static final long serialVersionUID = 1L;
private String BIC;
private String NAM1;
public String getBIC() {
return BIC;
}
public void setBIC(String BIC) {
this.BIC = BIC;
}
public String getNAM1() {
return NAM1;
}
public void setNAM1(String NAM1) {
this.NAM1 = NAM1;
}
public Account(String BIC, String NAM1) {
this.BIC = BIC;
this.NAM1 = NAM1;
}
public Account() {
}
}
...@@ -4,6 +4,7 @@ package com.brilliance.mxeditor.controller; ...@@ -4,6 +4,7 @@ package com.brilliance.mxeditor.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.brilliance.mxeditor.MxTransfer; import com.brilliance.mxeditor.MxTransfer;
import com.brilliance.mxeditor.bo.Account;
import com.brilliance.mxeditor.exception.SwiftException; import com.brilliance.mxeditor.exception.SwiftException;
import com.brilliance.mxeditor.interf.CommonSend; import com.brilliance.mxeditor.interf.CommonSend;
import com.brilliance.mxeditor.util.StringUtil; import com.brilliance.mxeditor.util.StringUtil;
...@@ -15,6 +16,8 @@ import com.brilliance.swift.SwiftTransfer; ...@@ -15,6 +16,8 @@ import com.brilliance.swift.SwiftTransfer;
import com.brilliance.swift.constants.Mx2MtConstants; import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.vo.SwiftTranslationErrorInfo; import com.brilliance.swift.vo.SwiftTranslationErrorInfo;
import com.brilliance.swift.vo.SwiftTranslationReport; import com.brilliance.swift.vo.SwiftTranslationReport;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.prowidesoftware.swift.model.MxId; import com.prowidesoftware.swift.model.MxId;
import com.prowidesoftware.swift.model.mx.AbstractMX; import com.prowidesoftware.swift.model.mx.AbstractMX;
import com.prowidesoftware.swift.model.mx.NamespaceReader; import com.prowidesoftware.swift.model.mx.NamespaceReader;
...@@ -29,10 +32,9 @@ import org.springframework.web.bind.annotation.*; ...@@ -29,10 +32,9 @@ import org.springframework.web.bind.annotation.*;
import java.io.File; import java.io.File;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.lang.reflect.Field;
import java.util.List; import java.lang.reflect.Type;
import java.util.Map; import java.util.*;
import java.util.Optional;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -356,7 +358,7 @@ public class MxEditorController { ...@@ -356,7 +358,7 @@ public class MxEditorController {
@RequestMapping(value = "/getBic", method = RequestMethod.POST) @RequestMapping(value = "/getBic", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public String getBic(@RequestBody AccountVo account) { public AccountVo getBic(@RequestBody AccountVo account) throws IllegalAccessException, InstantiationException {
logger.info("---->查询信息为:" + account.toString()); logger.info("---->查询信息为:" + account.toString());
Map<String, Object> map = new HashMap(); Map<String, Object> map = new HashMap();
map.put("interface", "bdTaskFive"); map.put("interface", "bdTaskFive");
...@@ -364,11 +366,60 @@ public class MxEditorController { ...@@ -364,11 +366,60 @@ public class MxEditorController {
map.put("biccod", account.getBiccod()); map.put("biccod", account.getBiccod());
map.put("bicnam", account.getBicnam()); map.put("bicnam", account.getBicnam());
Map rs = (Map) CommonSend.send(map); Map rs = (Map) CommonSend.send(map);
//测试数据
// Map<String,Object> rs = new HashMap<>();
// rs.put("retcode","0000000");
// List<Map<String,Object>> ccdlst = new ArrayList<>();
// Map<String,Object> tmpmap1 = new HashMap<>();
// tmpmap1.put("BIC","1111");
// tmpmap1.put("NAM1","1111");
// Map<String,Object> tmpmap2 = new HashMap<>();
// tmpmap2.put("BIC","2222");
// tmpmap2.put("NAM1","2222");
// ccdlst.add(tmpmap1);
// ccdlst.add(tmpmap2);
// ccdlst.add(tmpmap2);
// ccdlst.add(tmpmap2);
// ccdlst.add(tmpmap2);
// ccdlst.add(tmpmap2);
// rs.put("data",ccdlst);
String retcod = (String) rs.get("retcode"); String retcod = (String) rs.get("retcode");
if (retcod != null && retcod.endsWith("0000000")) { if (retcod != null && retcod.endsWith("0000000")) {
return (String) rs.get("data"); // PageHelper.startPage( account.getPageNum() == null ? 0 : account.getPageNum(), account.getPageSize() == null ? 10 : account.getPageSize());
List<Map<String, Object>> resMapList = (List<Map<String, Object>>) rs.get("data");
List<Account> reslist = mapListToList(resMapList,Account.class);
int startIndex = (account.getPageNum() - 1) * account.getPageSize();
int endIndex = Math.min(startIndex + account.getPageSize(), reslist.size());
List<Account> currentPageData = reslist.subList(startIndex, endIndex);
AccountVo accountVo = new AccountVo();
accountVo.setAccountList(currentPageData);
accountVo.setTotal(reslist.size());
return accountVo;
}else }else
return null; return null;
} }
public static List<Map<String, Object>> jsonToListMap(String jsonString) {
Gson gson = new Gson();
Type type = new TypeToken<ArrayList<HashMap<String, Object>>>() {}.getType();
return gson.fromJson(jsonString, type);
}
public static <T> List<T> mapListToList(List<Map<String, Object>> mapList, Class<T> clazz) throws IllegalAccessException, InstantiationException {
List<T> list = new ArrayList<>();
for (Map<String, Object> map : mapList) {
T obj = clazz.newInstance();
for (Field field : clazz.getDeclaredFields()) {
field.setAccessible(true);
if (map.containsKey(field.getName())) {
field.set(obj, map.get(field.getName()));
}
}
list.add(obj);
}
return list;
}
} }
package com.brilliance.mxeditor.vo; package com.brilliance.mxeditor.vo;
import com.brilliance.mxeditor.bo.Account;
import java.util.List;
/** /**
* @author zh * @author zh
* @create 2022-07-29 16:00 * @create 2022-07-29 16:00
...@@ -9,6 +13,46 @@ public class AccountVo { ...@@ -9,6 +13,46 @@ public class AccountVo {
private String bicnam; private String bicnam;
private Integer pageNum;
private Integer pageSize;
private Integer total;
private List<Account> accountList;//查询结果
public Integer getTotal() {
return total;
}
public void setTotal(Integer total) {
this.total = total;
}
public List<Account> getAccountList() {
return accountList;
}
public void setAccountList(List<Account> accountList) {
this.accountList = accountList;
}
public Integer getPageNum() {
return pageNum;
}
public void setPageNum(Integer pageNum) {
this.pageNum = pageNum;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public String getBiccod() { public String getBiccod() {
return biccod; return biccod;
} }
...@@ -32,4 +76,7 @@ public class AccountVo { ...@@ -32,4 +76,7 @@ public class AccountVo {
", bicnam='" + bicnam + '\'' + ", bicnam='" + bicnam + '\'' +
'}'; '}';
} }
public AccountVo() {
}
} }
<!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.e88189ab.js"></script><script defer="defer" src="js/app.79ddbfdc.js"></script><link href="css/chunk-vendors.7c88cb4c.css" rel="stylesheet"><link href="css/app.b6f65ab8.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html> <!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" href="favicon.ico"/><title>ISO手工拟报</title><script defer="defer" src="js/chunk-vendors.80ffbb63.js"></script><script defer="defer" src="js/app.e44d0563.js"></script><link href="css/chunk-vendors.7c88cb4c.css" rel="stylesheet"><link href="css/app.411c12ef.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but swiftiso-editor doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment