From 44c1c744eb294197ee3f6fc33b5567ad41887ba2 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Thu, 23 May 2024 17:52:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyPublic.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/SrcJyPublic.js b/SrcJyPublic.js index cf57e9a6..cc9a9fc0 100644 --- a/SrcJyPublic.js +++ b/SrcJyPublic.js @@ -117,6 +117,14 @@ function dataEnable(lx, data, input) { clearMyVar('SrcJu_duoselect'); return sm; } +// 获取接口对应的显示标题 +function getDataTitle(data) { + if(data.url){ + return data.name + ' ('+data.type+')' + (data.group&&data.group!=data.type?' [' + data.group + ']':""); + }else{ + return data.sort+'-'+data.name+'-'+data.parse; + } +} //接口管理多选方法 function duoselect(datas){ let datalist = []; @@ -130,7 +138,7 @@ function duoselect(datas){ let id = data.url?data.url:data.parse; if(!duoselect.some(item => id==(item.url?item.url:item.parse))){ duoselect.push(data); - updateItem(id, {title:''+data.name + (data.parse ? " [主页源]" : "") + (data.erparse ? " [搜索源]" : "")}); + updateItem(id, {title:''+getDataTitle(data)}); }else{ for(var i = 0; i < duoselect.length; i++) { if(id == (duoselect[i].url?duoselect[i].url:duoselect[i].parse)) { @@ -138,7 +146,7 @@ function duoselect(datas){ break; } } - updateItem(id, {title:(data.stop?``:"") + data.name + (data.parse ? " [主页源]" : "") + (data.erparse ? " [搜索源]" : "") + (data.stop?``:"")}); + updateItem(id, {title:(data.stop?``:"") + getDataTitle(data)}); } }) storage0.putMyVar('SrcJu_duoselect',duoselect);