1、API预警内容模块查询条件校验优化、修改校验优化
2、前端所有时间选择器修改成点击直接查询 3、文案网、新浪新闻爬虫数据模块查询条件校验优化
This commit is contained in:
parent
4c7b6ba667
commit
7b058766b5
|
|
@ -32,6 +32,7 @@
|
|||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleQuery"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
placeholder="请输入"
|
||||
clearable
|
||||
size="small"
|
||||
@change="handleQuery"
|
||||
style="width: 150px">
|
||||
<el-option
|
||||
v-for="index in apiName"
|
||||
|
|
@ -55,6 +56,7 @@
|
|||
placeholder="请输入"
|
||||
clearable
|
||||
size="small"
|
||||
@change="handleQuery"
|
||||
style="width: 150px">
|
||||
<el-option
|
||||
v-for="dict in dict.type.request_status"
|
||||
|
|
@ -70,6 +72,7 @@
|
|||
placeholder="请输入"
|
||||
clearable
|
||||
size="small"
|
||||
@change="handleQuery"
|
||||
style="width: 150px">
|
||||
<el-option
|
||||
v-for="dict in dict.type.request_method"
|
||||
|
|
@ -91,6 +94,7 @@
|
|||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleQuery"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
clearable
|
||||
maxlength="20"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@keyup.enter.native="handleQuery('queryForm')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="爬虫地址" prop="url">
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
clearable
|
||||
maxlength="100"
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@keyup.enter.native="handleQuery('queryForm')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="请求时间" prop="beginRequestTime">
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
maxlength="9"
|
||||
size="small"
|
||||
style="width: 90px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@keyup.enter.native="handleQuery('queryForm')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item prop="endRequestTime">
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
size="small"
|
||||
maxlength="9"
|
||||
style="width: 90px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@keyup.enter.native="handleQuery('queryForm')"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
|
@ -52,6 +52,7 @@
|
|||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
@change="handleQuery('queryForm')"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
|
|
@ -193,10 +194,10 @@ export default {
|
|||
// 表单校验
|
||||
queryRules: {
|
||||
beginRequestTime: [
|
||||
{type: 'number', message: '必须数字!', trigger: 'blur'}
|
||||
{type: 'number',min: 0, max: 200000, message: '必须数字!且数字在 0 到 200000 之间!', trigger: 'blur'}
|
||||
],
|
||||
endRequestTime: [
|
||||
{type: 'number', message: '必须数字!', trigger: 'blur'}
|
||||
{type: 'number',min: 0, max: 200000, message: '必须数字!且数字在 0 到 200000 之间!', trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
|
||||
|
|
@ -224,6 +225,8 @@ export default {
|
|||
this.webmagicLogList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}).catch(err =>{
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
//回显的时候正常回显
|
||||
|
|
@ -240,7 +243,6 @@ export default {
|
|||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -22,7 +22,12 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文案类型" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择文案类型" clearable size="small">
|
||||
<el-select
|
||||
v-model="queryParams.type"
|
||||
placeholder="请选择文案类型"
|
||||
@change="handleQuery"
|
||||
clearable
|
||||
size="small">
|
||||
<el-option
|
||||
v-for="dict in dict.type.copywriting_type"
|
||||
:key="dict.value"
|
||||
|
|
@ -42,6 +47,7 @@
|
|||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
@change="handleQuery"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
placeholder="请输入文案主题"
|
||||
clearable
|
||||
size="small"
|
||||
maxlength="50"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
placeholder="请输入文案内容"
|
||||
clearable
|
||||
size="small"
|
||||
maxlength="100"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -115,9 +117,11 @@ import {
|
|||
delCopyWritingNetwork,
|
||||
getType
|
||||
} from "@/api/business/webmagic/copywritingnetwork/copyWritingNetwork"
|
||||
import {pickerOptions} from "@/layout/mixin/PickerOptions";
|
||||
|
||||
export default {
|
||||
name: "CopyWritingNetwork",
|
||||
mixins: [pickerOptions],
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -152,48 +156,10 @@ export default {
|
|||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
|
||||
//类型集合
|
||||
typeList:[],
|
||||
|
||||
//日期组件
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '昨天',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
@ -222,22 +188,7 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
type: null,
|
||||
theme: null,
|
||||
content: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入标题"
|
||||
maxlength="100"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
|
|
@ -99,7 +100,6 @@
|
|||
<script>
|
||||
|
||||
import {listSinaNews, delSinaNews, getType} from "@/api/business/webmagic/sina/sinaNews"
|
||||
|
||||
import {pickerOptions} from "@/layout/mixin/PickerOptions"
|
||||
|
||||
export default {
|
||||
|
|
@ -136,8 +136,6 @@ export default {
|
|||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
|
||||
//检查查询范围
|
||||
daterangeCreateTime: [],
|
||||
|
|
@ -180,22 +178,7 @@ export default {
|
|||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
title: null,
|
||||
category: null,
|
||||
url: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,12 @@ import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|||
import com.xjs.copywritingNetwork.pojo.CopyWritingNetwork;
|
||||
import com.xjs.copywritingNetwork.service.CopyWritingNetworkService;
|
||||
import com.xjs.copywritingNetwork.task.CopyWritingNetworkTask;
|
||||
import com.xjs.validation.group.SelectGroup;
|
||||
import com.xjs.web.MyBaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
|
@ -62,7 +64,7 @@ public class CopyWritingNetworkController extends MyBaseController {
|
|||
@RequiresPermissions("webmagic:copyWritingNetwork:list")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询文案网列表")
|
||||
public TableDataInfo list(CopyWritingNetwork copyWritingNetwork) {
|
||||
public TableDataInfo list(@Validated({SelectGroup.class}) CopyWritingNetwork copyWritingNetwork) {
|
||||
startPage();
|
||||
List<CopyWritingNetwork> list = copyWritingNetworkService.selectCopyWritingNetworkList(copyWritingNetwork);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.xjs.validation.group.SelectGroup;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -23,14 +25,17 @@ public class CopyWritingNetwork implements Serializable {
|
|||
|
||||
/** 文案标签 */
|
||||
@Excel(name = "文案标签")
|
||||
@Size(max = 20, message = "请控制文案标签长度在20字符", groups = {SelectGroup.class})
|
||||
private String type;
|
||||
|
||||
/** 文案主题 */
|
||||
@Excel(name = "文案主题")
|
||||
@Size(max = 50, message = "请控制文案主题长度在50字符", groups = {SelectGroup.class})
|
||||
private String theme;
|
||||
|
||||
/** 文案内容 */
|
||||
@Excel(name = "文案内容")
|
||||
@Size(max = 100, message = "请控制文案内容长度在100字符", groups = {SelectGroup.class})
|
||||
private String content;
|
||||
|
||||
/** 创建时间 */
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ import com.ruoyi.common.security.annotation.RequiresPermissions;
|
|||
import com.xjs.sina.pojo.SinaNews;
|
||||
import com.xjs.sina.service.SinaNewsService;
|
||||
import com.xjs.sina.task.SinaNewsTask;
|
||||
import com.xjs.validation.group.SelectGroup;
|
||||
import com.xjs.web.MyBaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -58,7 +60,7 @@ public class SinaNewsController extends MyBaseController {
|
|||
@RequiresPermissions("webmagic:sinaNews:list")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询新浪新闻列表")
|
||||
public TableDataInfo list(SinaNews sinaNews) {
|
||||
public TableDataInfo list(@Validated({SelectGroup.class}) SinaNews sinaNews) {
|
||||
startPage();
|
||||
List<SinaNews> list = sinaNewsService.selectSinaNewsList(sinaNews);
|
||||
return getDataTable(list);
|
||||
|
|
|
|||
|
|
@ -3,12 +3,16 @@ package com.xjs.sina.pojo;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.xjs.validation.group.SelectGroup;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 新浪新闻爬虫数据实体类
|
||||
*
|
||||
* @author xiejs
|
||||
* @since 2022-02-15
|
||||
*/
|
||||
|
|
@ -24,11 +28,13 @@ public class SinaNews implements Serializable {
|
|||
/**
|
||||
* 新闻标题
|
||||
*/
|
||||
@Size(max = 100, message = "请控制新闻标题长度在100字符", groups = {SelectGroup.class})
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 新闻分类
|
||||
*/
|
||||
@Size(max = 20, message = "请控制新闻分类长度在20字符", groups = {SelectGroup.class})
|
||||
private String category;
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue