From 235c6d6f960eda543a348038ec1f0856c980ce27 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sun, 1 Sep 2024 10:32:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJySet.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJySet.js | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/SrcJySet.js b/SrcJySet.js index 54050027..7266a35a 100644 --- a/SrcJySet.js +++ b/SrcJySet.js @@ -641,13 +641,33 @@ function jiekou(data) { return'toast://已选择类型:' + input; }) }); + //获取类型名称数组 + function getGroupNames() { + let gnames = []; + getDatas("jk", 1).forEach(it => { + if (it.group && gnames.indexOf(it.group) == -1) { + gnames.push(it.group); + } + }) + return gnames; + } + let groupNames = getGroupNames(); + groupNames.push("自定义"); d.push({ - title:'分组名称:' + getMyVar('apigroup', ''), + title: '分组名称:' + getMyVar('apigroup', ''), col_type: 'text_1', - url:$(getMyVar('apigroup', ''),"输入分组名称,为空则取类型").input(()=>{ - putMyVar('apigroup', input); - refreshPage(true); - return "toast://"+input; + url: $(groupNames,2,"搜索分组:").select(() => { + if(input=="自定义"){ + return $(getMyVar('apigroup', ''), "输入分组名称,为空则取类型").input(() => { + putMyVar('apigroup', input); + refreshPage(false); + return 'toast://分组已设置为:' + input; + }) + }else{ + putMyVar('apigroup', input); + refreshPage(false); + } + return 'toast://分组已设置为:' + input; }) }); d.push({