1、36壁纸页面列表显示实现
This commit is contained in:
parent
9e761fdd69
commit
2e7c457b9f
|
|
@ -26,3 +26,12 @@ export function resetSettings() {
|
||||||
method: 'put',
|
method: 'put',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取壁纸列表
|
||||||
|
export function getWallpaperList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/webmagic/_36wallpaper/list',
|
||||||
|
method: 'get',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { scrollTo } from '@/utils/scroll-to'
|
import {scrollTo} from '@/utils/scroll-to'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Pagination',
|
name: 'Pagination',
|
||||||
|
|
@ -36,7 +36,7 @@ export default {
|
||||||
pageSizes: {
|
pageSizes: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default() {
|
default() {
|
||||||
return [3,10,15, 20, 30, 50,100]
|
return [3, 10, 12, 15, 20, 30, 50, 100]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 移动端页码按钮的数量端默认值5
|
// 移动端页码按钮的数量端默认值5
|
||||||
|
|
@ -81,13 +81,13 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.$emit('pagination', { page: this.currentPage, limit: val })
|
this.$emit('pagination', {page: this.currentPage, limit: val})
|
||||||
if (this.autoScroll) {
|
if (this.autoScroll) {
|
||||||
scrollTo(0, 800)
|
scrollTo(0, 800)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.$emit('pagination', { page: val, limit: this.pageSize })
|
this.$emit('pagination', {page: val, limit: this.pageSize})
|
||||||
if (this.autoScroll) {
|
if (this.autoScroll) {
|
||||||
scrollTo(0, 800)
|
scrollTo(0, 800)
|
||||||
}
|
}
|
||||||
|
|
@ -101,6 +101,7 @@ export default {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 32px 16px;
|
padding: 32px 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination-container.hidden {
|
.pagination-container.hidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,20 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//获取参数信息
|
//获取参数信息
|
||||||
getSettings() {
|
getSettings() {
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: 'Loading',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: "#666666"
|
||||||
|
});
|
||||||
|
|
||||||
getSettings().then(res => {
|
getSettings().then(res => {
|
||||||
|
loading.close();
|
||||||
this.formData = res.data
|
this.formData = res.data
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
//恢复默认(重置)
|
//恢复默认(重置)
|
||||||
|
|
|
||||||
|
|
@ -1,65 +1,77 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="bigDiv">
|
<div class="bigDiv">
|
||||||
<el-row :gutter="20" class="el-row">
|
<el-row :gutter="20" class="el-row" >
|
||||||
<el-col :span="4">
|
<el-col :span="4" v-for="data in wallpaperList">
|
||||||
<div class="grid-content bg-purple">
|
<div class="grid-content bg-purple">
|
||||||
|
<div style="">
|
||||||
|
<el-image
|
||||||
|
style="height: 108px;width: 192px"
|
||||||
|
:src="data.pictureUrl"
|
||||||
|
:preview-src-list="[data.pictureUrl]">
|
||||||
|
</el-image>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20" class="el-row">
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="4">
|
|
||||||
<div class="grid-content bg-purple"></div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>-->
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
import {getWallpaperList} from '@/api/business/webmagic/_36wallpaper/wallpaper36'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "wallpaper_36Show"
|
name: "wallpaper_36Show",
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 12,
|
||||||
|
condition: null,
|
||||||
|
},
|
||||||
|
|
||||||
|
//总数
|
||||||
|
total:0,
|
||||||
|
|
||||||
|
//壁纸列表数据
|
||||||
|
wallpaperList:{},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
methods:{
|
||||||
|
getList() {
|
||||||
|
getWallpaperList(this.queryParams).then(response => {
|
||||||
|
this.wallpaperList = response.data.records;
|
||||||
|
this.total = response.data.total;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -73,6 +85,7 @@ export default {
|
||||||
min-height: 36px;
|
min-height: 36px;
|
||||||
max-height: 350px;
|
max-height: 350px;
|
||||||
height: 320px;
|
height: 320px;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bigDiv{
|
.bigDiv{
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ public class ApiLogAspect {
|
||||||
Object obj = joinPoint.proceed();
|
Object obj = joinPoint.proceed();
|
||||||
LocalDateTime localDateTime2 = DateUtil.date().toLocalDateTime();
|
LocalDateTime localDateTime2 = DateUtil.date().toLocalDateTime();
|
||||||
long between = ChronoUnit.MILLIS.between(localDateTime1, localDateTime2);
|
long between = ChronoUnit.MILLIS.between(localDateTime1, localDateTime2);
|
||||||
log.info("调用接口耗费时间:{}ms", between);
|
|
||||||
//执行预警切入逻辑(降级不预警)
|
//执行预警切入逻辑(降级不预警)
|
||||||
if (obj instanceof JSONObject) {
|
if (obj instanceof JSONObject) {
|
||||||
JSONObject jsonObject = (JSONObject) obj;
|
JSONObject jsonObject = (JSONObject) obj;
|
||||||
|
|
@ -82,6 +81,7 @@ public class ApiLogAspect {
|
||||||
} else {
|
} else {
|
||||||
//如果降级,接口状态修改为异常
|
//如果降级,接口状态修改为异常
|
||||||
this.demoteHandle(joinPoint);
|
this.demoteHandle(joinPoint);
|
||||||
|
log.info("降级!调用接口耗费时间:{}ms", between);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,6 +177,9 @@ public class ApiLogAspect {
|
||||||
String name = annotationInfo.get("name");
|
String name = annotationInfo.get("name");
|
||||||
String url = annotationInfo.get("url");
|
String url = annotationInfo.get("url");
|
||||||
|
|
||||||
|
log.info("调用{}接口耗费时间:{}ms",name, between);
|
||||||
|
|
||||||
|
|
||||||
//根据拿到的url和name查询数据库是否存在,存在则count+1,不存在则add
|
//根据拿到的url和name查询数据库是否存在,存在则count+1,不存在则add
|
||||||
ApiRecord apiRecord = new ApiRecord();
|
ApiRecord apiRecord = new ApiRecord();
|
||||||
apiRecord.setApiName(name);
|
apiRecord.setApiName(name);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.xjs._36wallpaper.controller;
|
package com.xjs._36wallpaper.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.xjs._36wallpaper.pojo._36wallpaper;
|
||||||
import com.xjs._36wallpaper.service._36wallpaperService;
|
import com.xjs._36wallpaper.service._36wallpaperService;
|
||||||
import com.xjs._36wallpaper.task._36wallpaperTask;
|
import com.xjs._36wallpaper.task._36wallpaperTask;
|
||||||
import com.xjs.web.MyBaseController;
|
import com.xjs.web.MyBaseController;
|
||||||
|
|
@ -23,7 +25,7 @@ import java.util.Objects;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("_36wallpaper")
|
@RequestMapping("_36wallpaper")
|
||||||
@Api(tags = "爬虫模块-36壁纸网")
|
@Api(tags = "爬虫模块-36壁纸网")
|
||||||
public class _36wallpaperController extends MyBaseController {
|
public class _36wallpaperController extends MyBaseController<_36wallpaper> {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private _36wallpaperTask wallpaperTask;
|
private _36wallpaperTask wallpaperTask;
|
||||||
|
|
@ -60,6 +62,15 @@ public class _36wallpaperController extends MyBaseController {
|
||||||
return toAjax(b);
|
return toAjax(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("list")
|
||||||
|
@ApiOperation("获取壁纸列表")
|
||||||
|
@RequiresPermissions("webmagic:_36wallpaper:list")
|
||||||
|
public AjaxResult list(_36wallpaper wallpaper) {
|
||||||
|
IPage<_36wallpaper> list=wallpaperService.selectWallpaperList(startPageMP(),wallpaper);
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------远程rpc调用---------------------------
|
//----------------------远程rpc调用---------------------------
|
||||||
@GetMapping("taskForPRC")
|
@GetMapping("taskForPRC")
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
|
import com.xjs.entity.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -16,8 +18,9 @@ import java.util.Date;
|
||||||
* @since 2022-02-20
|
* @since 2022-02-20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName("webmagic_36wallpaper")
|
@TableName("webmagic_36wallpaper")
|
||||||
public class _36wallpaper implements Serializable {
|
public class _36wallpaper extends BaseEntity implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.xjs._36wallpaper.service;
|
package com.xjs._36wallpaper.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.xjs._36wallpaper.pojo._36wallpaper;
|
import com.xjs._36wallpaper.pojo._36wallpaper;
|
||||||
|
|
||||||
|
|
@ -37,4 +39,10 @@ public interface _36wallpaperService extends IService<_36wallpaper> {
|
||||||
*/
|
*/
|
||||||
boolean resetSettings();
|
boolean resetSettings();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询壁纸列表
|
||||||
|
* @param wallpaper 实体类
|
||||||
|
* @return page
|
||||||
|
*/
|
||||||
|
IPage<_36wallpaper> selectWallpaperList(Page<_36wallpaper> page, _36wallpaper wallpaper);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.xjs._36wallpaper.service.impl;
|
package com.xjs._36wallpaper.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.ruoyi.common.core.constant.HttpStatus;
|
import com.ruoyi.common.core.constant.HttpStatus;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
|
@ -10,6 +13,7 @@ import com.xjs._36wallpaper.mapper._36wallpaperMapper;
|
||||||
import com.xjs._36wallpaper.pojo._36wallpaper;
|
import com.xjs._36wallpaper.pojo._36wallpaper;
|
||||||
import com.xjs._36wallpaper.service._36wallpaperService;
|
import com.xjs._36wallpaper.service._36wallpaperService;
|
||||||
import com.xjs.exception.BusinessException;
|
import com.xjs.exception.BusinessException;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
@ -128,6 +132,19 @@ public class _36wallpaperServiceImpl extends ServiceImpl<_36wallpaperMapper, _36
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<_36wallpaper> selectWallpaperList(Page<_36wallpaper> page, _36wallpaper wallpaper) {
|
||||||
|
String condition = wallpaper.getCondition();
|
||||||
|
QueryWrapper<_36wallpaper> wr = new QueryWrapper<>();
|
||||||
|
wr.and(StringUtils.isNotEmpty(condition), obj -> {
|
||||||
|
obj.like("picture_name", condition)
|
||||||
|
.or().like("type", condition)
|
||||||
|
.or().like("label", condition);
|
||||||
|
});
|
||||||
|
|
||||||
|
return this.page(page,wr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测是否正在运行
|
* 检测是否正在运行
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue