diff --git a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml
index 9272ada..ad1f98c 100644
--- a/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml
+++ b/src/main/resources/mappers/backstage/SynthesisQueryMapper.xml
@@ -91,6 +91,9 @@
#{proId}
+
+ AND tcq.pro_id = #{id}
+
GROUP BY tcq.upload_type
@@ -137,9 +140,9 @@
- AND(
- SUBSTRING(sfr.source_type_name, LOCATE('-', sfr.source_type_name) + 1) = #{keyWord} OR
- INSTR(tcq.title,#{keyWord}) > 0
+ AND (
+ SUBSTRING(sfr.source_type_name, LOCATE('-', sfr.source_type_name) + 1) = #{keyWord} OR
+ INSTR(tcq.title,#{keyWord}) > 0
)
@@ -206,6 +209,9 @@
#{proId}
+
+ AND tcq.pro_id = #{id}
+
AND tcq.is_active = '1'
ORDER BY sfr.create_time DESC
@@ -236,6 +242,9 @@
#{proId}
+
+ AND tcq.pro_id = #{id}
+
AND tcq.is_active = '1'
GROUP BY tcq.upload_type, tcq.pro_id
diff --git a/src/main/resources/static/js/synthesisQuery/highSearchForm.js b/src/main/resources/static/js/synthesisQuery/highSearchForm.js
index 9a88822..1ad3272 100644
--- a/src/main/resources/static/js/synthesisQuery/highSearchForm.js
+++ b/src/main/resources/static/js/synthesisQuery/highSearchForm.js
@@ -2,6 +2,10 @@ let form, laydate, layer, highSearchData = {};
function setParams(obj) {
highSearchData = JSON.parse(obj);
+ let type = highSearchData.type;
+ if(type){
+ $('#pro-item').remove();
+ }
layui.use(["form", 'laydate', 'layer'], function () {
form = layui.form;
laydate = layui.laydate;
diff --git a/src/main/resources/static/js/synthesisQuery/photoView.js b/src/main/resources/static/js/synthesisQuery/photoView.js
index 71fd32c..b392071 100644
--- a/src/main/resources/static/js/synthesisQuery/photoView.js
+++ b/src/main/resources/static/js/synthesisQuery/photoView.js
@@ -82,7 +82,7 @@ function initImgData(list) {
"
" +
"
" +
"
" +
- "
" +
+ "
" +
setCollectImg(item) +
"
" +
" ");
diff --git a/src/main/resources/static/js/synthesisQuery/proClassifyStatisticsDetail.js b/src/main/resources/static/js/synthesisQuery/proClassifyStatisticsDetail.js
index 4f609dd..3886e22 100644
--- a/src/main/resources/static/js/synthesisQuery/proClassifyStatisticsDetail.js
+++ b/src/main/resources/static/js/synthesisQuery/proClassifyStatisticsDetail.js
@@ -1,24 +1,32 @@
let form, laydate, flow, layer, rightPopup;
let pageNum = 1, pageSize = 15; // 图片定义分页
let pageNum2 = 1, pageSize2 = 2; // 列表定义分页
-let queryType = 1; // 默认图片
+let queryType = 2; // 默认图片
+let objParams = {},highSearchData = {};
function setParams(obj) {
+ objParams = JSON.parse(obj);
layui.config({
base: "../../js/layui-v2.9.14/layui/", //此处路径请自行处理, 可以使用绝对路径
}).extend({
- rightPopup: "rightPopup2",
+ rightPopup: "rightPopup",
}).use(["form", 'laydate', 'flow', 'layer', 'rightPopup'], function () {
form = layui.form;
laydate = layui.laydate;
flow = layui.flow;
layer = layui.layer;
rightPopup = layui.rightPopup;
- dataFlow();
+ initImgNum(objParams.proId);
+ dataFlow({
+ pageNum: pageNum,
+ pageSize: pageSize,
+ queryType: queryType,
+ id:objParams.proId
+ });
});
}
/**数据流加载*/
-function dataFlow() {
+function dataFlow(queryParams) {
flow.load({
elem: '#ID-flow-demo', // 流加载容器
scrollElem: '#ID-flow-demo', // 滚动条所在元素,一般不用填,此处只是演示需要。
@@ -27,16 +35,15 @@ function dataFlow() {
done: function (page, next) { // 执行下一页的回调
pageNum = page;
let lis = [];
- let returnData = loadData();
+ let returnData = loadData(queryParams);
if (returnData != null) {
- if (queryType === 1) { // 图片
+ if (queryType === 2) { // 图片
lis = initImgData(returnData.data.list)
} else { // 列表
lis = initListData(returnData.data.list)
-
}
- next(lis.join(''), page < returnData.data.total / (queryType === 1 ? pageSize : pageSize2));
- if (queryType === 1) {
+ next(lis.join(''), page < returnData.data.total / (queryType === 2 ? pageSize : pageSize2));
+ if (queryType === 2) {
$('.img-info').on('mouseenter', function () {
this.querySelector('.hidden-actions').style.display = 'block';
});
@@ -57,17 +64,15 @@ function dataFlow() {
}
/**加载图片数据*/
-function loadData() {
+function loadData(queryParams) {
let returnData = null;
- let url = dataUrl + "/backstage/synthesisQuery/getImgList"
+ let url = null;
let obj = {}
- if (queryType === 1) { // 图片
- obj = {
- pageNum: pageNum,
- pageSize: pageSize,
- queryType: queryType
- }
+ if (queryType === 2) { // 图片
+ url = dataUrl + "/backstage/synthesisQuery/getImgList";
+ obj = queryParams
} else { // 列表
+ url = dataUrl + "/backstage/synthesisQuery/getImgList";
obj = {
pageNum: pageNum2,
pageSize: pageSize2,
@@ -96,22 +101,23 @@ function initImgData(list) {
let htmlArr = [];
if (list && list.length > 0) {
$.each(list, function (index, item) {
+ let filePath = imgUrl + item.compressFilePath + "?token=" + tokens
htmlArr.push("" +
"
\n" +
- "

" +
+ "

" +
"
" +
"
" +
"
" + item.uploadTime + "
" +
"
" + item.uploadTypeName + "
" +
"
" +
"
" +
- "
" + item.sourceTypeName + "
" +
+ "
" + setSourceTypeName(item) + "
" +
setCollectData(item) +
"
" +
"
" +
"
" +
- "
" +
- "
" +
+ "
" +
+ "
" +
setCollectImg(item) +
"
" +
"
");
@@ -139,6 +145,15 @@ function initImgData(list) {
return "
";
}
+ // 设置标题
+ function setSourceTypeName(item) {
+ if (item.sourceType === '9') {
+ return item.title;
+ } else {
+ return item.sourceTypeName.split('-')[1];
+ }
+ }
+
}
/**1.图片 2.列表*/
@@ -156,16 +171,6 @@ function changeType(that, type) {
$('#ID-flow-demo').empty();
dataFlow();
}
-
-
-/*图片类型查询*/
-function queryByType(that, type) {
- $('.type-num').each(function () {
- $(this).removeClass('type-num-check');
- })
- $(that).addClass('type-num-check');
-}
-
/**渲染列表图片*/
function initListData(list) {
let htmlArr = [];
@@ -271,8 +276,8 @@ function initListData(list) {
"
" +
"" +
"
" +
- "
" +
- "
" +
+ "
" +
+ "
" +
setCollectImg(item) +
"
" +
"";
@@ -310,49 +315,101 @@ function initListData(list) {
}
-
-/**放大*/
-function viewImg(item) {
- layer.photos({
- shade: 0.5,
- footer: false,
- photos: {
- "title": "图片预览",
- "start": 0,
- "data": [
- {
- "pid": 1,
- "src": "../../img/synthesisQuery/7.jpg",
- }
- ]
- },
- });
-}
-
-/**放大*/
-function imgDownLoad(item) {
- alert(item.id)
-}
-
-/**水印下载*/
-function waterImgDownLoad(item) {
- alert(item.id)
-}
-
/**收藏*/
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})
+ }
}
}
/**高级筛选*/
function highSearch() {
- rightPopup.rightPopupLayer("../../pages/synthesisQuery/highSearchForm.html", JSON.stringify({}), ["50%", "100%"]);
+ highSearchData.type = 1;
+ rightPopup.rightPopupLayer("../../pages/synthesisQuery/highSearchForm.html", JSON.stringify(highSearchData), ["50%", "100%"]);
+}
+
+/**标题查询*/
+function titleSearch() {
+ highSearchData = {};
+ resetData();
+ let queryParams = {
+ pageNum: pageNum,
+ pageSize: pageSize,
+ queryType: queryType,
+ searchType: 1,
+ keyWord: $('#keyWord').val(),
+ id:objParams.proId
+ }
+ searchData(queryParams);
+}
+
+
+/*图片类型查询*/
+function queryByType(that, type) {
+ resetData();
+ if(queryType === 2){
+ highSearchData = {};
+ $(that).addClass('type-num-check');
+ let queryParams = {
+ pageNum: pageNum,
+ pageSize: pageSize,
+ queryType: queryType,
+ searchType: 2,
+ uploadType: type,
+ id:objParams.proId
+ }
+ searchData(queryParams);
+ }
+}
+
+/**高级筛选数据*/
+function highSearchValue(obj) {
+ resetData();
+ highSearchData = JSON.parse(obj);
+ let queryParams = Object.assign(highSearchData, {})
+ queryParams.pageNum = pageNum;
+ queryParams.pageSize = pageSize;
+ queryParams.queryType = queryType;
+ queryParams.searchType = 3;
+ queryParams.id = objParams.proId;
+ dataFlow(queryParams);
+}
+
+// 查询数据
+function searchData(queryParams) {
+ $('#ID-flow-demo').empty();
+ dataFlow(queryParams);
+}
+
+/**重置基本数据*/
+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 83c3928..b0bc84d 100644
--- a/src/main/resources/static/js/synthesisQuery/synthesisQueryAjax.js
+++ b/src/main/resources/static/js/synthesisQuery/synthesisQueryAjax.js
@@ -1,7 +1,9 @@
// 获取图片数量
-function initImgNum() {
+function initImgNum(objParams) {
let url = dataUrl + "/backstage/synthesisQuery/getImgNum"
- let obj = {}
+ let obj = {
+ id: objParams || null
+ }
let params = {
encryptedData: encryptCBC(JSON.stringify(obj))
}
diff --git a/src/main/resources/static/pages/synthesisQuery/highSearchForm.html b/src/main/resources/static/pages/synthesisQuery/highSearchForm.html
index 52a1980..1efd63e 100644
--- a/src/main/resources/static/pages/synthesisQuery/highSearchForm.html
+++ b/src/main/resources/static/pages/synthesisQuery/highSearchForm.html
@@ -38,7 +38,7 @@
-