新增两种统计页面

lijinlong^2
许宏杰 2 years ago
parent ed5b0b795c
commit 7140557b02

@ -8,10 +8,10 @@ ENV = 'development'
# VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api'
#公司接口
VUE_APP_BASE_API = 'http://39.101.188.84:9027'
# VUE_APP_BASE_API = 'http://39.101.188.84:9027'
#局域网
# VUE_APP_BASE_API = 'http://192.168.0.108:9027'
VUE_APP_BASE_API = 'http://localhost:9027'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -0,0 +1,53 @@
import request from "@/utils/request";
// 查询数据来源统计列表
export function listSourceTj(query) {
return request({
url: "/zongzhi/sourceTj/list",
method: "get",
params: query,
});
}
// 查询数据来源统计详细
export function getSourceTj(id) {
return request({
url: "/zongzhi/sourceTj/" + id,
method: "get",
});
}
// 新增数据来源统计
export function addSourceTj(data) {
return request({
url: "/zongzhi/sourceTj",
method: "post",
data: data,
});
}
// 修改数据来源统计
export function updateSourceTj(data) {
return request({
url: "/zongzhi/sourceTj",
method: "put",
data: data,
});
}
// 删除数据来源统计
export function delSourceTj(id) {
return request({
url: "/zongzhi/sourceTj/" + id,
method: "delete",
});
}
// 导出数据来源统计
export function exportSourceTj(data) {
return request({
url: "/zongzhi/sourceTj/export",
method: "post",
data,
});
}

@ -0,0 +1,53 @@
import request from "@/utils/request";
// 查询安全监测受攻击统计列表
export function listTj(query) {
return request({
url: "/zongzhi/tj/list",
method: "get",
params: query,
});
}
// 查询安全监测受攻击统计详细
export function getTj(id) {
return request({
url: "/zongzhi/tj/" + id,
method: "get",
});
}
// 新增安全监测受攻击统计
export function addTj(data) {
return request({
url: "/zongzhi/tj",
method: "post",
data: data,
});
}
// 修改安全监测受攻击统计
export function updateTj(data) {
return request({
url: "/zongzhi/tj",
method: "put",
data: data,
});
}
// 删除安全监测受攻击统计
export function delTj(id) {
return request({
url: "/zongzhi/tj/" + id,
method: "delete",
});
}
// 导出安全监测受攻击统计
export function exportTj(data) {
return request({
url: "/zongzhi/tj/export",
method: "post",
data,
});
}

@ -1,9 +1,378 @@
<template>
<div>统计</div>
<div class="container-main" ref="main">
<div class="search-hearder" ref="topSearch">
<!-- <el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="auto"
>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form> -->
</div>
<div class="layui-table-tool" ref="tableTool">
<el-button
v-show="sourceTjList.length == 0"
type="primary"
size="mini"
@click="handleAdd()"
v-hasPermi="['zongzhi:sourceTj:add']"
>新增</el-button
>
<el-button
type="success"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['zongzhi:sourceTj:edit']"
>修改</el-button
>
<el-button
type="danger"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['zongzhi:sourceTj:remove']"
>删除</el-button
>
<el-button
type="warning"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['zongzhi:sourceTj:export']"
>导出</el-button
>
</div>
<el-table
v-loading="loading"
:data="sourceTjList"
:height="tableHeigth"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="云端监测(G)" align="center" prop="lable1" />
<el-table-column label="APT(M)" align="center" prop="lable2" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
@click="handleInfo(scope.row)"
v-hasPermi="['zongzhi:sourceTj:list']"
>
查看
</el-button>
<el-button
type="success"
size="mini"
@click="handleUpdate(scope.row)"
v-hasPermi="['zongzhi:sourceTj:edit']"
>修改</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)"
v-hasPermi="['zongzhi:sourceTj:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改数据来源统计对话框 -->
<el-dialog
:visible.sync="open"
width="500px"
append-to-body
custom-class="dialog-box"
>
<div slot="title" class="dialog-title">{{ title }}</div>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="auto"
class="dialog-from"
>
<el-form-item label="云端监测(G)" prop="lable1">
<el-input v-model="form.lable1" placeholder="请输入云端监测(G)" />
</el-form-item>
<el-form-item label="APT(M)" prop="lable2">
<el-input v-model="form.lable2" placeholder="请输入APT(M)" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--查看数据来源统计详情页-->
<el-dialog
:visible.sync="infoOpen"
width="1200px"
append-to-body
:close-on-click-modal="false"
:destroy-on-close="true"
custom-class="dialog-box"
>
<div slot="title" class="dialog-title">{{ infoTitle }}</div>
<el-descriptions
title="数据来源统计"
:column="2"
border
labelClassName="desLable"
>
<el-descriptions-item label="云端监测(G)">{{
form.lable1
}}</el-descriptions-item>
<el-descriptions-item label="APT(M)">{{
form.lable2
}}</el-descriptions-item>
</el-descriptions>
</el-dialog>
</div>
</template>
<script>
export default {};
</script>
import { mapGetters } from "vuex";
import {
listSourceTj,
getSourceTj,
delSourceTj,
addSourceTj,
updateSourceTj,
exportSourceTj,
} from "@/api/zongzhi/netSecurity/DataSourceTj/index.js";
export default {
computed: {
...mapGetters(["townList"]),
},
name: "SourceTj",
//
data() {
return {
tableHeigth: 0,
//
infoOpen: false,
//
infoTitle: "",
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
sourceTjList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
},
//
form: {},
//
rules: {},
};
},
created() {
// //
this.$nextTick(() => {
this.tableHeigth =
this.$refs.main.offsetHeight -
(this.$refs.topSearch.offsetHeight +
this.$refs.tableTool.offsetHeight) -
46;
this.getList();
});
},
methods: {
/** 查询数据来源统计列表 */
getList() {
this.loading = true;
listSourceTj(this.queryParams).then((response) => {
this.sourceTjList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
areaId: null,
lable1: null,
lable2: null,
<style></style>
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/**查看按钮操作 */
handleInfo(row) {
this.reset();
const id = row.id || this.ids;
getSourceTj(id).then((response) => {
this.form = response.data;
this.infoOpen = true;
this.infoTitle = "查看数据来源统计详情";
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加数据来源统计";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getSourceTj(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改数据来源统计";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateSourceTj(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSourceTj(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除数据来源统计编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delSourceTj(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有数据来源统计数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/zongzhi/sourceTj/export",
{
...this.queryParams,
},
"数据来源统计_" + new Date().getTime() + ".xlsx"
);
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>

@ -1,9 +1,420 @@
<template>
<div>受攻击统计</div>
<div class="container-main" ref="main">
<div class="search-hearder" ref="topSearch">
<!-- <el-form
:model="queryParams"
ref="queryForm"
:inline="true"
v-show="showSearch"
label-width="auto"
>
<el-form-item label="网络攻击" prop="totalSum">
<el-input
v-model="queryParams.totalSum"
placeholder="请输入网络攻击"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="入侵攻击" prop="rqSum">
<el-input
v-model="queryParams.rqSum"
placeholder="请输入入侵攻击"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form> -->
</div>
<div class="layui-table-tool" ref="tableTool">
<el-button
v-show="tjList.length == 0"
type="primary"
size="mini"
@click="handleAdd()"
v-hasPermi="['zongzhi:tj:add']"
>新增</el-button
>
<el-button
type="success"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['zongzhi:tj:edit']"
>修改</el-button
>
<el-button
type="danger"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['zongzhi:tj:remove']"
>删除</el-button
>
<el-button
type="warning"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['zongzhi:tj:export']"
>导出</el-button
>
</div>
<el-table
v-loading="loading"
:data="tjList"
:height="tableHeigth"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="网络攻击" align="center" prop="totalSum" />
<el-table-column label="入侵攻击" align="center" prop="rqSum" />
<el-table-column label="恶意扫描" align="center" prop="eySum" />
<el-table-column label="僵木蠕病毒" align="center" prop="jmrSum" />
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
width="200"
fixed="right"
>
<template slot-scope="scope">
<el-button
size="mini"
@click="handleInfo(scope.row)"
v-hasPermi="['zongzhi:tj:list']"
>
查看
</el-button>
<el-button
type="success"
size="mini"
@click="handleUpdate(scope.row)"
v-hasPermi="['zongzhi:tj:edit']"
>修改</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)"
v-hasPermi="['zongzhi:tj:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改安全监测受攻击统计对话框 -->
<el-dialog
:visible.sync="open"
width="500px"
append-to-body
custom-class="dialog-box"
>
<div slot="title" class="dialog-title">{{ title }}</div>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="auto"
class="dialog-from"
>
<el-form-item label="网络攻击" prop="totalSum">
<el-input v-model="form.totalSum" placeholder="请输入网络攻击" />
</el-form-item>
<el-form-item label="入侵攻击" prop="rqSum">
<el-input v-model="form.rqSum" placeholder="请输入入侵攻击" />
</el-form-item>
<el-form-item label="恶意扫描" prop="eySum">
<el-input v-model="form.eySum" placeholder="请输入恶意扫描" />
</el-form-item>
<el-form-item label="僵木蠕病毒" prop="jmrSum">
<el-input v-model="form.jmrSum" placeholder="请输入僵木蠕病毒" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!--查看安全监测受攻击统计详情页-->
<el-dialog
:visible.sync="infoOpen"
width="1200px"
append-to-body
:close-on-click-modal="false"
:destroy-on-close="true"
custom-class="dialog-box"
>
<div slot="title" class="dialog-title">{{ infoTitle }}</div>
<el-descriptions
title="安全监测受攻击统计"
:column="2"
border
labelClassName="desLable"
>
<el-descriptions-item label="网络攻击">{{
form.totalSum
}}</el-descriptions-item>
<el-descriptions-item label="入侵攻击">{{
form.rqSum
}}</el-descriptions-item>
<el-descriptions-item label="恶意扫描">{{
form.eySum
}}</el-descriptions-item>
<el-descriptions-item label="僵木蠕病毒">{{
form.jmrSum
}}</el-descriptions-item>
</el-descriptions>
</el-dialog>
</div>
</template>
<script>
export default {};
</script>
import { mapGetters } from "vuex";
import {
listTj,
getTj,
delTj,
addTj,
updateTj,
exportTj,
} from "@/api/zongzhi/netSecurity/sgjtj/index.js";
export default {
computed: {
...mapGetters(["townList"]),
},
name: "Tj",
//
data() {
return {
tableHeigth: 0,
//
infoOpen: false,
//
infoTitle: "",
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tjList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
totalSum: null,
rqSum: null,
},
//
form: {},
//
rules: {},
};
},
created() {
// //
this.$nextTick(() => {
this.tableHeigth =
this.$refs.main.offsetHeight -
(this.$refs.topSearch.offsetHeight +
this.$refs.tableTool.offsetHeight) -
46;
this.getList();
});
},
methods: {
/** 查询安全监测受攻击统计列表 */
getList() {
this.loading = true;
listTj(this.queryParams).then((response) => {
this.tjList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
townId: null,
villageId: null,
totalSum: null,
<style></style>
rqSum: null,
eySum: null,
jmrSum: null,
createId: null,
createBy: null,
createTime: null,
updateId: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/**查看按钮操作 */
handleInfo(row) {
this.reset();
const id = row.id || this.ids;
getTj(id).then((response) => {
this.form = response.data;
this.infoOpen = true;
this.infoTitle = "查看安全监测受攻击统计详情";
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加安全监测受攻击统计";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getTj(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = "修改安全监测受攻击统计";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateTj(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTj(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm(
'是否确认删除安全监测受攻击统计编号为"' + ids + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delTj(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有安全监测受攻击统计数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/zongzhi/tj/export",
{
...this.queryParams,
},
"安全监测受攻击统计_" + new Date().getTime() + ".xlsx"
);
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>

Loading…
Cancel
Save