From c8d7a9c2c847e8459d2b8ef11e35a2f8f87f75f4 Mon Sep 17 00:00:00 2001
From: cwchen <1048842385@qq.com>
Date: Thu, 3 Apr 2025 11:55:56 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=9F=A5=E8=AF=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../backstage/SynthesisQueryMapper.xml | 6 ++++
.../js/synthesisQuery/synthesisQuery.js | 33 +++++++++++++++----
.../js/synthesisQuery/synthesisQueryAjax.js | 20 ++++++++++-
.../pages/synthesisQuery/highSearchForm.html | 2 +-
4 files changed, 52 insertions(+), 9 deletions(-)
diff --git a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml
index a239986..7295e41 100644
--- a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml
+++ b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml
@@ -104,6 +104,12 @@
AND INSTR(tcq.title,#{title}) > 0 AND tcq.upload_type = '5'
+
+ AND sfr.source_type IN
+
+ #{item}
+
+
AND tcq.pro_id IN
diff --git a/src/main/resources/static/js/synthesisQuery/synthesisQuery.js b/src/main/resources/static/js/synthesisQuery/synthesisQuery.js
index 074d5f7..c74a71e 100644
--- a/src/main/resources/static/js/synthesisQuery/synthesisQuery.js
+++ b/src/main/resources/static/js/synthesisQuery/synthesisQuery.js
@@ -155,13 +155,32 @@ function initImgData(list) {
/**收藏*/
function collectImg(that, item, type) {
if (type === 0) { // 收藏
- $(that).next().removeAttr("style");
- $(that).css({'display': 'none'})
- $(that).parent().parent().prev().find('img').eq(0).removeAttr('style')
+ let flag = collectData({
+ collectType: 1,
+ id: item.id
+ });
+ if (flag) {
+ $(that).next().removeAttr("style");
+ $(that).css({'display': 'none'})
+ $(that).parent().parent().prev().find('img').eq(0).removeAttr('style')
+ layer.msg("收藏成功",{icon:1})
+ }else{
+ layer.msg("收藏失败",{icon:2})
+ }
+
} else if (type === 1) { // 取消收藏
- $(that).prev().removeAttr("style");
- $(that).css({'display': 'none'});
- $(that).parent().parent().prev().find('img').eq(0).css({'display': 'none'})
+ let flag = collectData({
+ collectType: 2,
+ id: item.id
+ });
+ if (flag) {
+ $(that).prev().removeAttr("style");
+ $(that).css({'display': 'none'});
+ $(that).parent().parent().prev().find('img').eq(0).css({'display': 'none'})
+ layer.msg("取消收藏成功",{icon:1})
+ }else{
+ layer.msg("取消收藏失败",{icon:2})
+ }
}
}
@@ -217,7 +236,7 @@ function searchData(queryParams) {
}
/**重置基本数据*/
-function resetData(){
+function resetData() {
pageNum = 1;
$('.type-num').each(function () {
$(this).removeClass('type-num-check');
diff --git a/src/main/resources/static/js/synthesisQuery/synthesisQueryAjax.js b/src/main/resources/static/js/synthesisQuery/synthesisQueryAjax.js
index 06a7078..189ab39 100644
--- a/src/main/resources/static/js/synthesisQuery/synthesisQueryAjax.js
+++ b/src/main/resources/static/js/synthesisQuery/synthesisQueryAjax.js
@@ -16,7 +16,7 @@ function initImgNum() {
error(xhr)
});
- function setImgNum(obj){
+ function setImgNum(obj) {
$('#totalNum').html(obj.totalNum);
$('#safetyVioNum').html(obj.safetyVioNum);
$('#qualityInsNum').html(obj.qualityInsNum);
@@ -24,4 +24,22 @@ function initImgNum() {
$('#coordinatedPhotoNum').html(obj.coordinatedPhotoNum);
$('#importIssuesAndPublicityNum').html(obj.importIssuesAndPublicityNum);
}
+}
+
+/**收藏/取消收藏图片*/
+function collectData(objParams) {
+ let flag = false;
+ let url = dataUrl + "/backstage/synthesisQuery/collectData"
+ let params = {
+ encryptedData: encryptCBC(JSON.stringify(objParams))
+ }
+ ajaxRequest(url, "POST", params, false, function () {
+ }, function (result) {
+ if (result.status === 200) {
+ flag = true;
+ }
+ }, function (xhr) {
+ error(xhr)
+ });
+ return flag;
}
\ No newline at end of file
diff --git a/src/main/resources/static/pages/synthesisQuery/highSearchForm.html b/src/main/resources/static/pages/synthesisQuery/highSearchForm.html
index cf6ff25..4b87fca 100644
--- a/src/main/resources/static/pages/synthesisQuery/highSearchForm.html
+++ b/src/main/resources/static/pages/synthesisQuery/highSearchForm.html
@@ -32,7 +32,7 @@