[improvement](webapp) optimize filter css styles and modify menu name

Co-authored-by: williamhliu <williamhliu@tencent.com>
This commit is contained in:
jerryjzhang
2023-09-04 14:22:52 +08:00
parent fbd145fd92
commit 90e62ddccc
11 changed files with 116 additions and 88 deletions

View File

@@ -11,9 +11,8 @@ admin _1_2 70
张碧晨 _2_7 100 张碧晨 _2_7 100
程响 _2_7 100 程响 _2_7 100
Taylor#Swift _2_7 100 Taylor#Swift _2_7 100
中国 _2_4 100 内地 _2_4 100
欧美 _2_4 100 欧美 _2_4 100
港台 _2_4 100
流行 _2_6 100 流行 _2_6 100
爱情 _2_6 100 国风 _2_6 100
激情 _2_6 100
国风 _2_6 100

View File

@@ -119,12 +119,11 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
chatConfigBaseReq.setChatAggConfig(chatAggConfig); chatConfigBaseReq.setChatAggConfig(chatAggConfig);
List<RecommendedQuestionReq> recommendedQuestions = new ArrayList<>(); List<RecommendedQuestionReq> recommendedQuestions = new ArrayList<>();
RecommendedQuestionReq recommendedQuestionReq0 = new RecommendedQuestionReq("超音数访问次数"); recommendedQuestions.add(new RecommendedQuestionReq("超音数访问次数"));
RecommendedQuestionReq recommendedQuestionReq1 = new RecommendedQuestionReq("超音数访问人数"); recommendedQuestions.add(new RecommendedQuestionReq("近15天超音数访问次数汇总"));
RecommendedQuestionReq recommendedQuestionReq2 = new RecommendedQuestionReq("超音数按部门访问"); recommendedQuestions.add(new RecommendedQuestionReq("按部门统计超音数的访问"));
recommendedQuestions.add(recommendedQuestionReq0); recommendedQuestions.add(new RecommendedQuestionReq("对比alice和lucy的停留时长"));
recommendedQuestions.add(recommendedQuestionReq1); recommendedQuestions.add(new RecommendedQuestionReq("超音数访问次数最高的部门"));
recommendedQuestions.add(recommendedQuestionReq2);
chatConfigBaseReq.setRecommendedQuestions(recommendedQuestions); chatConfigBaseReq.setRecommendedQuestions(recommendedQuestions);
configService.addConfig(chatConfigBaseReq, user); configService.addConfig(chatConfigBaseReq, user);
@@ -172,11 +171,11 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
Plugin plugin1 = new Plugin(); Plugin plugin1 = new Plugin();
plugin1.setType("WEB_PAGE"); plugin1.setType("WEB_PAGE");
plugin1.setModelList(Arrays.asList(1L)); plugin1.setModelList(Arrays.asList(1L));
plugin1.setPattern("访问情况"); plugin1.setPattern("用于分析超音数的流量概况包含UV、PV等核心指标的追踪。P.S. 仅作为示例展示,无实际看板");
plugin1.setParseModeConfig(null); plugin1.setParseModeConfig(null);
plugin1.setName("访问情况"); plugin1.setName("超音数流量分析看板");
WebBase webBase = new WebBase(); WebBase webBase = new WebBase();
webBase.setUrl("www.test.com"); webBase.setUrl("www.yourbi.com");
ParamOption paramOption = new ParamOption(); ParamOption paramOption = new ParamOption();
paramOption.setKey("name"); paramOption.setKey("name");
paramOption.setParamType(ParamOption.ParamType.SEMANTIC); paramOption.setParamType(ParamOption.ParamType.SEMANTIC);
@@ -189,34 +188,55 @@ public class ConfigureDemo implements ApplicationListener<ApplicationReadyEvent>
pluginService.createPlugin(plugin1, user); pluginService.createPlugin(plugin1, user);
} }
private void addAgent() { private void addAgent1() {
Agent agent = new Agent(); Agent agent = new Agent();
agent.setId(1); agent.setId(1);
agent.setName("指标"); agent.setName("指标");
agent.setDescription("查指标"); agent.setDescription("帮助您用自然语言查询指标,支持时间限定、条件筛选、下钻维度以及聚合统计");
agent.setStatus(1); agent.setStatus(1);
agent.setEnableSearch(1); agent.setEnableSearch(1);
agent.setExamples(Lists.newArrayList("超音数访问次数", "超音数访问人数", "alice 停留时长")); agent.setExamples(Lists.newArrayList("超音数访问次数", "近15天超音数访问次数汇总",
"按部门统计超音数的访问人数", "对比alice和lucy的停留时长", "超音数访问次数最高的部门"));
AgentConfig agentConfig = new AgentConfig(); AgentConfig agentConfig = new AgentConfig();
RuleQueryTool ruleQueryTool = new RuleQueryTool(); RuleQueryTool ruleQueryTool = new RuleQueryTool();
ruleQueryTool.setType(AgentToolType.RULE); ruleQueryTool.setType(AgentToolType.RULE);
ruleQueryTool.setModelIds(Lists.newArrayList(-1L)); ruleQueryTool.setModelIds(Lists.newArrayList(-1L));
ruleQueryTool.setQueryModes(Lists.newArrayList( ruleQueryTool.setQueryModes(Lists.newArrayList(
"ENTITY_DETAIL", "ENTITY_LIST_FILTER", "ENTITY_ID", "METRIC_ENTITY", "METRIC_ENTITY", "METRIC_FILTER", "METRIC_GROUPBY",
"METRIC_FILTER", "METRIC_GROUPBY", "METRIC_MODEL", "METRIC_ORDERBY" "METRIC_MODEL", "METRIC_ORDERBY"
)); ));
agentConfig.getTools().add(ruleQueryTool); agentConfig.getTools().add(ruleQueryTool);
agent.setAgentConfig(JSONObject.toJSONString(agentConfig)); agent.setAgentConfig(JSONObject.toJSONString(agentConfig));
agentService.createAgent(agent, User.getFakeUser()); agentService.createAgent(agent, User.getFakeUser());
} }
private void addAgent2() {
Agent agent = new Agent();
agent.setId(2);
agent.setName("圈实体");
agent.setDescription("帮助您用自然语言圈选实体,支持多条件组合筛选");
agent.setStatus(1);
agent.setEnableSearch(1);
agent.setExamples(Lists.newArrayList("国风风格艺人", "港台地区的艺人", "风格为流行的艺人"));
AgentConfig agentConfig = new AgentConfig();
RuleQueryTool ruleQueryTool = new RuleQueryTool();
ruleQueryTool.setType(AgentToolType.RULE);
ruleQueryTool.setModelIds(Lists.newArrayList(-1L));
ruleQueryTool.setQueryModes(Lists.newArrayList(
"ENTITY_DETAIL", "ENTITY_LIST_FILTER", "ENTITY_ID"));
agentConfig.getTools().add(ruleQueryTool);
agent.setAgentConfig(JSONObject.toJSONString(agentConfig));
agentService.createAgent(agent, User.getFakeUser());
}
@Override @Override
public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) { public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
try { try {
addDemoChatConfig_1(); addDemoChatConfig_1();
addDemoChatConfig_2(); addDemoChatConfig_2();
addPlugin_1(); addPlugin_1();
addAgent(); addAgent1();
addAgent2();
addSampleChats(); addSampleChats();
addSampleChats2(); addSampleChats2();
} catch (Exception e) { } catch (Exception e) {

View File

@@ -11,9 +11,8 @@ admin _1_2 70
张碧晨 _2_7 100 张碧晨 _2_7 100
程响 _2_7 100 程响 _2_7 100
Taylor#Swift _2_7 100 Taylor#Swift _2_7 100
中国 _2_4 100 内地 _2_4 100
欧美 _2_4 100 欧美 _2_4 100
港台 _2_4 100
流行 _2_6 100 流行 _2_6 100
爱情 _2_6 100 国风 _2_6 100
激情 _2_6 100
国风 _2_6 100

View File

@@ -44,60 +44,53 @@ insert into s2_auth_groups (group_id, config)
values (2, '{"modelId":"1","name":"tom_sales_permission","groupId":2,"authRules":[{"metrics":["stay_hours"],"dimensions":["page"]}],"dimensionFilters":["department in (''sales'')"],"dimensionFilterDescription":"部门 in [sales]", "authorizedUsers":["tom"],"authorizedDepartmentIds":[]}'); values (2, '{"modelId":"1","name":"tom_sales_permission","groupId":2,"authRules":[{"metrics":["stay_hours"],"dimensions":["page"]}],"dimensionFilters":["department in (''sales'')"],"dimensionFilterDescription":"部门 in [sales]", "authorizedUsers":["tom"],"authorizedDepartmentIds":[]}');
-- sample data -- sample data
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '周杰伦', '中国','青花瓷','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '周杰伦', '港台','青花瓷','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '周杰伦', '中国','青花瓷','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '周杰伦', '港台','青花瓷','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '周杰伦', '中国','青花瓷','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '周杰伦', '港台','青花瓷','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '周杰伦', '中国','青花瓷','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '周杰伦', '港台','青花瓷','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '周杰伦', '中国','青花瓷','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '周杰伦', '港台','青花瓷','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '周杰伦', '中国','青花瓷','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '周杰伦', '港台','青花瓷','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '周杰伦', '中国','青花瓷','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '周杰伦', '港台','青花瓷','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '陈奕迅', '中国','爱情转移','激情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '陈奕迅', '港台','爱情转移','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '陈奕迅', '中国','爱情转移','激情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '陈奕迅', '港台','爱情转移','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '陈奕迅', '中国','爱情转移','激情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '陈奕迅', '港台','爱情转移','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '陈奕迅', '中国','爱情转移','激情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '陈奕迅', '港台','爱情转移','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '陈奕迅', '中国','爱情转移','激情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '陈奕迅', '港台','爱情转移','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '陈奕迅', '中国','爱情转移','激情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '陈奕迅', '港台','爱情转移','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '陈奕迅', '中国','爱情转移','激情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '陈奕迅', '港台','爱情转移','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '林俊杰', '中国','美人鱼','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '林俊杰', '港台','美人鱼','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '林俊杰', '中国','美人鱼','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '林俊杰', '港台','美人鱼','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '林俊杰', '中国','美人鱼','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '林俊杰', '港台','美人鱼','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '林俊杰', '中国','美人鱼','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '林俊杰', '港台','美人鱼','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '林俊杰', '中国','美人鱼','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '林俊杰', '港台','美人鱼','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '林俊杰', '中国','美人鱼','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '林俊杰', '港台','美人鱼','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '林俊杰', '中国','美人鱼','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '林俊杰', '港台','美人鱼','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '张碧晨', '中国','光的方向','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '张碧晨', '内地','光的方向','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '张碧晨', '中国','光的方向','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '张碧晨', '内地','光的方向','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '张碧晨', '中国','光的方向','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '张碧晨', '内地','光的方向','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '张碧晨', '中国','光的方向','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '张碧晨', '内地','光的方向','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '张碧晨', '中国','光的方向','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '张碧晨', '内地','光的方向','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '张碧晨', '中国','光的方向','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '张碧晨', '内地','光的方向','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '张碧晨', '中国','光的方向','流行',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '张碧晨', '内地','光的方向','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '程响', '中国','人间烟火','国风',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), '程响', '内地','人间烟火','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '程响', '中国','人间烟火','国风',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), '程响', '内地','人间烟火','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '程响', '中国','人间烟火','国风',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), '程响', '内地','人间烟火','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '程响', '中国','人间烟火','国风',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), '程响', '内地','人间烟火','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '程响', '中国','人间烟火','国风',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), '程响', '内地','人间烟火','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '程响', '中国','人间烟火','国风',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), '程响', '内地','人间烟火','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '程响', '中国','人间烟火','国风',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), '程响', '内地','人间烟火','国风',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), 'Taylor Swift INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -1, CURRENT_DATE()), 'Taylor Swift', '欧美','Love Story','流行',1000000,1000000,1000000);
', '欧美','Love Story','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), 'Taylor Swift', '欧美','Love Story','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -5, CURRENT_DATE()), 'Taylor Swift INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), 'Taylor Swift', '欧美','Love Story','流行',1000000,1000000,1000000);
', '欧美','Love Story','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), 'Taylor Swift', '欧美','Love Story','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -4, CURRENT_DATE()), 'Taylor Swift INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), 'Taylor Swift', '欧美','Love Story','流行',1000000,1000000,1000000);
', '欧美','Love Story','爱情',1000000,1000000,1000000); INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), 'Taylor Swift', '欧美','Love Story','流行',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -3, CURRENT_DATE()), 'Taylor Swift INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), 'Taylor Swift', '欧美','Love Story','流行',1000000,1000000,1000000);
', '欧美','Love Story','爱情',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -2, CURRENT_DATE()), 'Taylor Swift
', '欧美','Love Story','爱情',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -6, CURRENT_DATE()), 'Taylor Swift
', '欧美','Love Story','爱情',1000000,1000000,1000000);
INSERT INTO singer (imp_date,singer_name,act_area, song_name,genre,js_play_cnt,down_cnt,favor_cnt) VALUES (DATEADD('DAY', -7, CURRENT_DATE()), 'Taylor Swift
', '欧美','Love Story','爱情',1000000,1000000,1000000);
---demo data for semantic and chat ---demo data for semantic and chat
insert into s2_user_department (user_name, department) values ('jack','HR'); insert into s2_user_department (user_name, department) values ('jack','HR');

View File

@@ -192,4 +192,4 @@
"engines": { "engines": {
"node": ">=14.18.0" "node": ">=14.18.0"
} }
} }

View File

@@ -49,7 +49,7 @@ export type FilterItemType = {
bizName: string; bizName: string;
operator: string; operator: string;
type: string; type: string;
value: string; value: any;
}; };
export type ModelType = { export type ModelType = {

View File

@@ -4,6 +4,7 @@ import { FilterItemType } from '../../common/type';
import { useEffect, useMemo, useRef, useState } from 'react'; import { useEffect, useMemo, useRef, useState } from 'react';
import { queryDimensionValues } from '../../service'; import { queryDimensionValues } from '../../service';
import debounce from 'lodash/debounce'; import debounce from 'lodash/debounce';
import isArray from 'lodash/isArray';
type Props = { type Props = {
modelId: number; modelId: number;
@@ -60,10 +61,13 @@ const FilterItem: React.FC<Props> = ({ modelId, filters, filter, onFiltersChange
return debounce(loadOptions, 800); return debounce(loadOptions, 800);
}, [queryDimensionValues]); }, [queryDimensionValues]);
const onChange = (value: string) => { const onChange = (value: string | string[]) => {
if (isArray(value) && value.length === 0) {
return;
}
const newFilters = filters.map(item => { const newFilters = filters.map(item => {
if (item.bizName === filter.bizName) { if (item.bizName === filter.bizName) {
item.value = `${value}`; item.value = isArray(value) ? value : `${value}`;
} }
return item; return item;
}); });
@@ -72,20 +76,20 @@ const FilterItem: React.FC<Props> = ({ modelId, filters, filter, onFiltersChange
return ( return (
<span className={prefixCls}> <span className={prefixCls}>
{typeof filter.value === 'string' ? ( {typeof filter.value === 'string' || isArray(filter.value) ? (
<Select <Select
bordered={false} bordered={false}
value={filter.value} value={filter.value}
options={options} options={options}
className={`${prefixCls}-select-control`} className={`${prefixCls}-select-control`}
popupClassName={`${prefixCls}-select-popup`}
onSearch={debounceFetcher} onSearch={debounceFetcher}
notFoundContent={loading ? <Spin size="small" /> : null} notFoundContent={loading ? <Spin size="small" /> : null}
onChange={onChange} onChange={onChange}
mode={isArray(filter.value) ? 'multiple' : undefined}
showSearch showSearch
/> />
) : ( ) : (
<span>{filter.value}</span> <span className={`${prefixCls}-filter-value`}>{filter.value}</span>
)} )}
</span> </span>
); );

View File

@@ -96,7 +96,9 @@ const ParseTip: React.FC<Props> = ({
<div className={`${prefixCls}-tip-item-option`}> <div className={`${prefixCls}-tip-item-option`}>
<span> <span>
<span className={`${prefixCls}-tip-item-filter-name`}>{filter.name}</span> <span className={`${prefixCls}-tip-item-filter-name`}>{filter.name}</span>
{filter.operator !== '=' ? ` ${filter.operator} ` : ''} {filter.operator !== '=' && filter.operator !== 'IN'
? ` ${filter.operator} `
: ''}
</span> </span>
{queryMode !== 'DSL' && !filter.bizName?.includes('_id') ? ( {queryMode !== 'DSL' && !filter.bizName?.includes('_id') ? (
<FilterItem <FilterItem

View File

@@ -297,10 +297,21 @@
.@{filter-item-prefix-cls} { .@{filter-item-prefix-cls} {
&-select-control { &-select-control {
min-width: 120px; min-width: 120px;
background-color: #f5f8fb;
border-radius: 6px;
} }
.ant-select-selection-item { .ant-select-selection-item {
color: var(--chat-blue); color: var(--chat-blue);
font-weight: 500; font-weight: 500;
} }
.ant-select-multiple .ant-select-selection-item {
background-color: var(--light-blue-background);
}
&-filter-value {
color: var(--chat-blue);
font-weight: 500;
}
} }

View File

@@ -28,12 +28,6 @@ const ROUTES = [
name: 'chatSetting', name: 'chatSetting',
envEnableList: [ENV_KEY.CHAT], envEnableList: [ENV_KEY.CHAT],
}, },
{
path: '/chatPlugin',
name: 'chatPlugin',
component: './ChatPlugin',
envEnableList: [ENV_KEY.CHAT],
},
{ {
path: '/agent', path: '/agent',
name: 'agent', name: 'agent',
@@ -79,6 +73,12 @@ const ROUTES = [
component: './SemanticModel/Metric', component: './SemanticModel/Metric',
envEnableList: [ENV_KEY.SEMANTIC], envEnableList: [ENV_KEY.SEMANTIC],
}, },
{
path: '/plugin',
name: 'plugin',
component: './ChatPlugin',
envEnableList: [ENV_KEY.CHAT],
},
{ {
path: '/login', path: '/login',
name: 'login', name: 'login',

View File

@@ -13,7 +13,7 @@ export default {
'menu.metric': '指标市场', 'menu.metric': '指标市场',
'menu.database': '数据库连接', 'menu.database': '数据库连接',
'menu.chatSetting': '问答设置', 'menu.chatSetting': '问答设置',
'menu.chatPlugin': '第三方插件', 'menu.plugin': '插件市场',
'menu.login': '登录', 'menu.login': '登录',
'menu.chat': '问答对话', 'menu.chat': '问答对话',
'menu.agent': '智能助理', 'menu.agent': '智能助理',