This commit is contained in:
Vinjor 2025-07-09 15:08:57 +08:00
commit ee76489951
2 changed files with 11 additions and 9 deletions

View File

@ -48,7 +48,7 @@ public class BusiCategoryServiceImpl extends ServiceImpl<BusiCategoryMapper, Bus
if (!StringUtils.isEmpty(category.getCatgName())) { if (!StringUtils.isEmpty(category.getCatgName())) {
lambdaQueryWrapper.like(BusiCategory::getCatgName, category.getCatgName()); lambdaQueryWrapper.like(BusiCategory::getCatgName, category.getCatgName());
} }
lambdaQueryWrapper.orderByDesc(BusiCategory::getSort); lambdaQueryWrapper.orderByAsc(BusiCategory::getSort);
List<BusiCategory> list = list(lambdaQueryWrapper); List<BusiCategory> list = list(lambdaQueryWrapper);
List<BusiCategoryVO> rtnList = buildCategoryTree(list); List<BusiCategoryVO> rtnList = buildCategoryTree(list);
return rtnList.stream().sorted(Comparator.comparing(BusiCategoryVO::getSort, return rtnList.stream().sorted(Comparator.comparing(BusiCategoryVO::getSort,

View File

@ -1,7 +1,7 @@
const websocket = { const websocket = {
state: { state: {
websock:null, socket:null,
message:[], message:[],
count:"0", count:"0",
notice:[] notice:[]
@ -10,11 +10,12 @@ const websocket = {
mutations: { mutations: {
WEBSOCKET_INIT(state,url){ WEBSOCKET_INIT(state,url){
console.log(url); console.log(url);
state.websock = new WebSocket(url); state.socket = new WebSocket(url);
state.websock.onopen=function () { state.socket.onopen=function () {
console.log("WebSocket连接成功"); console.log("WebSocket连接成功");
}; };
state.websock.onmessage = function (e) { state.socket.onmessage = function (e) {
console.log(e,'接受到消息')
if (e.data.startsWith("C")) { if (e.data.startsWith("C")) {
state.count = e.data; state.count = e.data;
@ -24,23 +25,24 @@ const websocket = {
console.log(state.notice); console.log(state.notice);
} }
else { else {
console.log(e.data,'消息内容')
state.message.push(JSON.parse(e.data)); state.message.push(JSON.parse(e.data));
// console.log(state.message); // console.log(state.message);
} }
}; };
state.websock.onerror= function () { state.socket.onerror= function () {
console.log("WebSocket连接发生错误"); console.log("WebSocket连接发生错误");
}; };
state.websock.onclose = function (e) { state.socket.onclose = function (e) {
console.log("connection closed (" + e.code + ")"); console.log("connection closed (" + e.code + ")");
}; };
}, },
WEBSOCKET_SEND(state,msg){ WEBSOCKET_SEND(state,msg){
state.websock.send(msg); state.socket.send(msg);
}, },
WEBSOCKET_CLOSE(state){ WEBSOCKET_CLOSE(state){
state.websock.close(); state.socket.close();
} }
}, },