From 642348c09e39eda8725060def87d7ef415a8de3c Mon Sep 17 00:00:00 2001
From: xjs <1294405880@qq.com>
Date: Thu, 12 May 2022 14:39:47 +0800
Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=9F=8E=E6=9C=8D=E5=8A=A1es=E6=A3=80?=
=?UTF-8?q?=E7=B4=A2=E5=AE=9E=E7=8E=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
ruoyi-ui/src/plugins/tab.js | 133 +-
.../src/main/java/com/xjs/consts/EsConst.java | 8 +-
.../static/index/js/catalogLoader.js | 4 +-
.../src/main/resources/templates/index.html | 6 +-
.../search/controller/SearchController.java | 37 +
.../search/service/MallSearchService.java | 19 +
.../service/impl/MallSearchServiceImpl.java | 370 ++
.../com/xjs/mall/search/vo/SearchParam.java | 64 +
.../com/xjs/mall/search/vo/SearchResult.java | 120 +
.../src/main/resources/es/DSL.json | 99 +
.../resources/{ => es}/product-mapping.json | 25 +-
.../src/main/resources/templates/index.html | 3677 -----------------
.../src/main/resources/templates/list.html | 1957 +++++++++
13 files changed, 2753 insertions(+), 3766 deletions(-)
create mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/java/com/xjs/mall/search/controller/SearchController.java
create mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/java/com/xjs/mall/search/service/MallSearchService.java
create mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/java/com/xjs/mall/search/service/impl/MallSearchServiceImpl.java
create mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/java/com/xjs/mall/search/vo/SearchParam.java
create mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/java/com/xjs/mall/search/vo/SearchResult.java
create mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/resources/es/DSL.json
rename xjs-business/xjs-project-mall/mall-search/src/main/resources/{ => es}/product-mapping.json (69%)
delete mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/resources/templates/index.html
create mode 100644 xjs-business/xjs-project-mall/mall-search/src/main/resources/templates/list.html
diff --git a/ruoyi-ui/src/plugins/tab.js b/ruoyi-ui/src/plugins/tab.js
index 95a3848b..f5d7a3e0 100644
--- a/ruoyi-ui/src/plugins/tab.js
+++ b/ruoyi-ui/src/plugins/tab.js
@@ -1,66 +1,67 @@
-import store from '@/store'
-import router from '@/router';
-
-export default {
- // 刷新当前tab页签
- refreshPage(obj) {
- const { path, matched } = router.currentRoute;
- if (obj === undefined) {
- matched.forEach((m) => {
- if (m.components && m.components.default && m.components.default.name) {
- if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
- obj = { name: m.components.default.name, path: path };
- }
- }
- });
- }
- return store.dispatch('tagsView/delCachedView', obj).then(() => {
- const { path } = obj
- router.replace({
- path: '/redirect' + path
- })
- })
- },
- // 关闭当前tab页签,打开新页签
- closeOpenPage(obj) {
- store.dispatch("tagsView/delView", router.currentRoute);
- if (obj !== undefined) {
- return router.push(obj);
- }
- },
- // 关闭指定tab页签
- closePage(obj) {
- if (obj === undefined) {
- return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => {
- return router.push(lastPath || '/');
- });
- }
- return store.dispatch('tagsView/delView', obj);
- },
- // 关闭所有tab页签
- closeAllPage() {
- return store.dispatch('tagsView/delAllViews');
- },
- // 关闭左侧tab页签
- closeLeftPage(obj) {
- return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute);
- },
- // 关闭右侧tab页签
- closeRightPage(obj) {
- return store.dispatch('tagsView/delRightTags', obj || router.currentRoute);
- },
- // 关闭其他tab页签
- closeOtherPage(obj) {
- return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute);
- },
- // 添加tab页签
- openPage(title, url) {
- var obj = { path: url, meta: { title: title } }
- store.dispatch('tagsView/addView', obj);
- return router.push(url);
- },
- // 修改tab页签
- updatePage(obj) {
- return store.dispatch('tagsView/updateVisitedView', obj);
- }
-}
+import store from '@/store'
+import router from '@/router';
+
+export default {
+ // 刷新当前tab页签
+ refreshPage(obj) {
+ const { path, query, matched } = router.currentRoute;
+ if (obj === undefined) {
+ matched.forEach((m) => {
+ if (m.components && m.components.default && m.components.default.name) {
+ if (!['Layout', 'ParentView'].includes(m.components.default.name)) {
+ obj = { name: m.components.default.name, path: path, query: query };
+ }
+ }
+ });
+ }
+ return store.dispatch('tagsView/delCachedView', obj).then(() => {
+ const { path, query } = obj
+ router.replace({
+ path: '/redirect' + path,
+ query: query
+ })
+ })
+ },
+ // 关闭当前tab页签,打开新页签
+ closeOpenPage(obj) {
+ store.dispatch("tagsView/delView", router.currentRoute);
+ if (obj !== undefined) {
+ return router.push(obj);
+ }
+ },
+ // 关闭指定tab页签
+ closePage(obj) {
+ if (obj === undefined) {
+ return store.dispatch('tagsView/delView', router.currentRoute).then(({ lastPath }) => {
+ return router.push(lastPath || '/');
+ });
+ }
+ return store.dispatch('tagsView/delView', obj);
+ },
+ // 关闭所有tab页签
+ closeAllPage() {
+ return store.dispatch('tagsView/delAllViews');
+ },
+ // 关闭左侧tab页签
+ closeLeftPage(obj) {
+ return store.dispatch('tagsView/delLeftTags', obj || router.currentRoute);
+ },
+ // 关闭右侧tab页签
+ closeRightPage(obj) {
+ return store.dispatch('tagsView/delRightTags', obj || router.currentRoute);
+ },
+ // 关闭其他tab页签
+ closeOtherPage(obj) {
+ return store.dispatch('tagsView/delOthersViews', obj || router.currentRoute);
+ },
+ // 添加tab页签
+ openPage(title, url) {
+ var obj = { path: url, meta: { title: title } }
+ store.dispatch('tagsView/addView', obj);
+ return router.push(url);
+ },
+ // 修改tab页签
+ updatePage(obj) {
+ return store.dispatch('tagsView/updateVisitedView', obj);
+ }
+}
diff --git a/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/EsConst.java b/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/EsConst.java
index 98d53326..58638f29 100644
--- a/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/EsConst.java
+++ b/xjs-business/xjs-business-common/src/main/java/com/xjs/consts/EsConst.java
@@ -2,6 +2,7 @@ package com.xjs.consts;
/**
* ES常量
+ *
* @author xiejs
* @since 2022-04-06
*/
@@ -9,5 +10,10 @@ public class EsConst {
/**
* sku数据在ES中的索引
*/
- public static final String PRODUCT_INDEX = "product";
+ public static final String PRODUCT_INDEX = "xjs_product";
+
+
+ public static final int PRODUCT_PAGESIZE = 2;
+
+
}
diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/resources/static/index/js/catalogLoader.js b/xjs-business/xjs-project-mall/mall-product/src/main/resources/static/index/js/catalogLoader.js
index 60b51f01..3e5a1a3c 100644
--- a/xjs-business/xjs-project-mall/mall-product/src/main/resources/static/index/js/catalogLoader.js
+++ b/xjs-business/xjs-project-mall/mall-product/src/main/resources/static/index/js/catalogLoader.js
@@ -19,7 +19,7 @@ $(function(){
var ctg3List=ctg2["catalog3List"];
var len=0;
$.each(ctg3List,function (i,ctg3) {
- var cata3link = $("" + ctg3.name + "");
+ var cata3link = $("" + ctg3.name + "");
li.append(cata3link);
len=len+1+ctg3.name.length;
});
@@ -40,4 +40,4 @@ $(function(){
}
});
});
-});
\ No newline at end of file
+});
diff --git a/xjs-business/xjs-project-mall/mall-product/src/main/resources/templates/index.html b/xjs-business/xjs-project-mall/mall-product/src/main/resources/templates/index.html
index c17bb6e7..430e8925 100644
--- a/xjs-business/xjs-project-mall/mall-product/src/main/resources/templates/index.html
+++ b/xjs-business/xjs-project-mall/mall-product/src/main/resources/templates/index.html
@@ -115,7 +115,7 @@
-
+
特色主题
-行业频道
-购物车中还没有商品,赶紧选购吧!
-特色主题
+行业频道
+购物车中还没有商品,赶紧选购吧!
+