新增众测菜单

main
吕天方 11 months ago
parent d05d0bc06f
commit 1f9bea81f0

@ -5,9 +5,10 @@ VUE_APP_TITLE = 数据中台系统
ENV = 'development'
# 若依管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:9035'
# VUE_APP_BASE_API = 'http://localhost:9035'
# VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api'
# VUE_APP_BASE_API = 'http://39.101.188.84:9035'
VUE_APP_BASE_API = 'http://192.168.0.109:9035'

@ -0,0 +1,60 @@
import request from '@/utils/request'
// 查询政府网站列表
export function listZczccg(query) {
return request({
url: '/tcZz/networkSecurity/zczccg/list',
method: 'get',
params: query
})
}
// 查询政府网站详细
export function getZczccg(id) {
return request({
url: '/tcZz/networkSecurity/zczccg/' + id,
method: 'get'
})
}
// 新增政府网站
export function addZczccg(data) {
return request({
url: '/tcZz/networkSecurity/zczccg',
method: 'post',
data: data
})
}
// 修改政府网站
export function updateZczccg(data) {
return request({
url: '/tcZz/networkSecurity/zczccg',
method: 'put',
data: data
})
}
// 删除政府网站
export function delZczccg(id) {
return request({
url: '/tcZz/networkSecurity/zczccg/' + id,
method: 'delete'
})
}
//批量启用禁用
export function isStatusZczccg(params) {
return request({
url: '/tcZz/networkSecurity/zczccg/isStatus',
method: 'get',
params
})
}
//通用导入信息
export function importZczccg(data) {
return request({
url: '/tcZz/networkSecurity/zczccg/common/importExcel',
method: 'post',
data
})
}

@ -0,0 +1,60 @@
import request from '@/utils/request'
// 查询政府网站列表
export function listZcdwpm(query) {
return request({
url: '/tcZz/networkSecurity/zcdwpm/list',
method: 'get',
params: query
})
}
// 查询政府网站详细
export function getZcdwpm(id) {
return request({
url: '/tcZz/networkSecurity/zcdwpm/' + id,
method: 'get'
})
}
// 新增政府网站
export function addZcdwpm(data) {
return request({
url: '/tcZz/networkSecurity/zcdwpm',
method: 'post',
data: data
})
}
// 修改政府网站
export function updateZcdwpm(data) {
return request({
url: '/tcZz/networkSecurity/zcdwpm',
method: 'put',
data: data
})
}
// 删除政府网站
export function delZcdwpm(id) {
return request({
url: '/tcZz/networkSecurity/zcdwpm/' + id,
method: 'delete'
})
}
//批量启用禁用
// export function isStatusZcdwpm(params) {
// return request({
// url: '/tcZz/networkSecurity/zcdwpm/isStatus',
// method: 'get',
// params
// })
// }
//通用导入信息
export function importZcdwpm(data) {
return request({
url: '/tcZz/networkSecurity/zcdwpm/common/importExcel',
method: 'post',
data
})
}

@ -0,0 +1,60 @@
import request from '@/utils/request'
// 查询政府网站列表
export function listZclds(query) {
return request({
url: '/tcZz/networkSecurity/zclds/list',
method: 'get',
params: query
})
}
// 查询政府网站详细
export function getZclds(id) {
return request({
url: '/tcZz/networkSecurity/zclds/' + id,
method: 'get'
})
}
// 新增政府网站
export function addZclds(data) {
return request({
url: '/tcZz/networkSecurity/zclds',
method: 'post',
data: data
})
}
// 修改政府网站
export function updateZclds(data) {
return request({
url: '/tcZz/networkSecurity/zclds',
method: 'put',
data: data
})
}
// 删除政府网站
export function delZclds(id) {
return request({
url: '/tcZz/networkSecurity/zclds/' + id,
method: 'delete'
})
}
//批量启用禁用
// export function isStatusZclds(params) {
// return request({
// url: '/tcZz/networkSecurity/zclds/isStatus',
// method: 'get',
// params
// })
// }
//通用导入信息
export function importZclds(data) {
return request({
url: '/tcZz/networkSecurity/zclds/common/importExcel',
method: 'post',
data
})
}

@ -0,0 +1,60 @@
import request from '@/utils/request'
// 查询政府网站列表
export function listZclb(query) {
return request({
url: '/tcZz/networkSecurity/zclb/list',
method: 'get',
params: query
})
}
// 查询政府网站详细
export function getZclb(id) {
return request({
url: '/tcZz/networkSecurity/zclb/' + id,
method: 'get'
})
}
// 新增政府网站
export function addZclb(data) {
return request({
url: '/tcZz/networkSecurity/zclb',
method: 'post',
data: data
})
}
// 修改政府网站
export function updateZclb(data) {
return request({
url: '/tcZz/networkSecurity/zclb',
method: 'put',
data: data
})
}
// 删除政府网站
export function delZclb(id) {
return request({
url: '/tcZz/networkSecurity/zclb/' + id,
method: 'delete'
})
}
//批量启用禁用
// export function isStatusZclb(params) {
// return request({
// url: '/tcZz/networkSecurity/zclb/isStatus',
// method: 'get',
// params
// })
// }
//通用导入信息
export function importZclb(data) {
return request({
url: '/tcZz/networkSecurity/zclb/common/importExcel',
method: 'post',
data
})
}

@ -0,0 +1,749 @@
<template>
<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="unitNumber">
<el-input
v-model="queryParams.unitNumber"
placeholder="请输入涉及单位数"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="新增资产数" prop="addNumber">
<el-input
v-model="queryParams.addNumber"
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
type="primary"
size="mini"
@click="handleAdd()"
v-hasPermi="['tcZz/networkSecurity:zczccg:add']"
>新增</el-button
>
<el-button
type="success"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['tcZz/networkSecurity:zczccg:edit']"
>修改</el-button
>
<el-button
type="danger"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['tcZz/networkSecurity:zczccg:remove']"
>删除</el-button
>
<el-button
type="warning"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['tcZz/networkSecurity:zczccg:export']"
>导出</el-button
>
<el-button type="primary" size="mini" @click="importFiles"
>导入</el-button
>
<!-- <el-button type="success" size="mini" @click="enable" :disabled="multiple"
>启用</el-button
>
<el-button
type="danger"
size="mini"
@click="banned"
autofocus
:disabled="multiple"
>禁用</el-button
> -->
</div>
<el-table
v-loading="loading"
:data="xzzcslList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="涉及单位数" align="center" prop="unitNumber" />
<el-table-column label="新增资产数" align="center" prop="addNumber" />
<!-- <el-table-column label="处置情况" align="center" prop="czState" />
<el-table-column label="启用/禁用" align="center" prop="isStatus">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isStatus"
active-color="#ff4949"
inactive-color="#13ce66"
:active-value="2"
:inactive-value="1"
@change="alter(scope.row)"
>
</el-switch>
</template>
</el-table-column> -->
<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="['tcZz/networkSecurity:zczccg:list']"
>
查看
</el-button>
<el-button
type="success"
size="mini"
@click="handleUpdate(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zczccg:edit']"
>修改</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zczccg: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="isStatus">
<el-radio-group v-model="form.isStatus">
<el-radio :label="1">启用</el-radio>
<el-radio :label="2">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="上传文件">
<div class="updataFile">
<div class="fileHeader">
<div class="names">文件名称</div>
<div class="urls">文件路径(完整路径)</div>
</div>
<div @click="addFile" class="fileIcon">
<i class="el-icon-circle-plus-outline"></i>
</div>
</div>
<div
class="main-file"
v-for="(item, index) in fileNameS"
:key="index"
>
<div class="fileItems">
<div class="names">
<el-input
v-model="item.fileName"
placeholder="请输入文件名称"
/>
</div>
<div class="urls">
<el-input
v-model="item.fileUrl"
placeholder="请输入文件路径(完整路径)"
/>
</div>
</div>
<div @click="removeFile(index)" class="fileIcon">
<i class="el-icon-remove-outline"></i>
</div>
</div>
</el-form-item> -->
<el-form-item label="涉及单位数" prop="unitNumber">
<el-input v-model="form.unitNumber" placeholder="请输入单位名称" />
</el-form-item>
<el-form-item label="新增资产数" prop="addNumber">
<el-input v-model="form.addNumber" placeholder="请输入目标IP/域名" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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="90%"
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.unitNumber
}}</el-descriptions-item>
<el-descriptions-item label="新增资产数">{{
form.addNumber
}}</el-descriptions-item>
<el-descriptions-item label="备注">{{
form.remark
}}</el-descriptions-item>
</el-descriptions>
</el-dialog>
<!-- 导入 -->
<el-dialog
:visible.sync="fileOpen"
width="400px"
append-to-body
custom-class="dialog-box"
@close="cancelFile"
>
<div slot="title" class="dialog-title">导入</div>
<el-upload
ref="upload"
:limit="limit"
action="666"
:accept="accept"
:headers="headers"
:file-list="fileList"
:multiple="false"
:auto-upload="false"
drag
:before-upload="handleBeforeUpload"
:on-exceed="handleExceed"
:http-request="handleFile"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFile"> </el-button>
<el-button @click="cancelFile"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listZczccg,
getZczccg,
delZczccg,
addZczccg,
updateZczccg,
exportZczccg,
isStatusZczccg,
importZczccg,
} from "@/api/tcZz/networkSecurity/xzzcsl";
import { getToken } from "@/utils/auth";
export default {
name: "Zczccg",
//
dicts: ["tc_area", "tc_start"],
data() {
return {
tableHeigth: 0,
//
infoOpen: false,
//
infoTitle: "",
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
xzzcslList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
daterangeUpdateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
id: null,
unitNumber: null,
addNumber: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
},
//
form: {},
//
rules: {
unitNumber: [
{ required: true, message: "涉及单位数不能为空", trigger: "blur" },
],
addNumber: [
{ required: true, message: "新增资产数不能为空", trigger: "blur" },
],
},
fileNameS: [],
//===========
fileList: [],
limit: 1,
accept: ".xls,.xlsx",
fileOpen: false,
headers: { Authorization: "Bearer " + getToken() },
};
},
created() {
this.getList();
},
methods: {
files(e) {
console.log(e);
if (!e.fileUrl) return [];
let newA = e.fileUrl.split(",");
let newB = e.fileName.split(",");
let newC = [];
newA.forEach((value, index) => {
newC.push({
fileName: newB[index],
fileUrl: value,
});
});
console.log(newC);
return newC;
},
alter(e) {
updateZczccg(e).then(() => {
this.getList();
this.$modal.msgSuccess("修改成功");
});
},
//
importTemplate() {
this.download(
"/tcZz/networkSecurity/zczccg/importTemplate",
{},
`新增资产数量模板.xlsx`
);
},
//
importFiles() {
this.fileOpen = true;
},
submitFile() {
this.$refs.upload.submit();
},
cancelFile() {
this.fileOpen = false;
},
//
handleBeforeUpload(file) {
//
const fileName = file.name.split(".");
const fileExt = fileName[fileName.length - 1];
const isTypeOk = this.accept.includes(fileExt);
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`);
return false;
}
},
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
},
handleFile(data) {
this.$modal.loading();
let form = new FormData();
form.append("file", data.file);
importZczccg(form)
.then((res) => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$modal.msgSuccess("导入成功");
this.$refs.upload.clearFiles();
this.getList();
})
.catch(() => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$refs.upload.clearFiles();
this.getList();
});
},
//
enable(row) {
this.isStatusFuc(row, 1);
},
//
banned(row) {
this.isStatusFuc(row, 2);
},
isStatusFuc(row, e) {
const ids = row.id || this.ids.join(",");
const src = e == 1 ? "启动" : "禁用";
this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return isStatusZczccg({ ids: ids, isStatus: e });
})
.then(() => {
this.getList(e);
})
.catch(() => {});
},
//
addFile() {
if (this.fileNameS.length <= 0) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
if (
this.fileNameS[this.fileNameS.length - 1].fileUrl != "" &&
this.fileNameS[this.fileNameS.length - 1].fileName != ""
) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
this.$modal.msgError("请完整填写上一条");
}
}
},
//
removeFile(index) {
this.fileNameS.splice(index, 1);
},
/** 查询新增资产数量列表 */
getList(e) {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] =
this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
}
if (null != this.daterangeUpdateTime && "" != this.daterangeUpdateTime) {
this.queryParams.params["beginUpdateTime"] =
this.daterangeUpdateTime[0];
this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
}
listZczccg(this.queryParams).then((response) => {
this.xzzcslList = response.rows;
this.total = response.total;
this.loading = false;
if (e == 1) {
this.$modal.msgSuccess("启动成功");
} else if (e == 2) {
this.$modal.msgSuccess("禁用成功");
}
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
unitNumber: null,
addNumber: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.daterangeUpdateTime = [];
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;
getZczccg(id).then((response) => {
this.form = response.data;
this.infoOpen = true;
this.infoTitle = "查看新增资产数量详情";
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.fileNameS = [
{
fileName: "",
fileUrl: "",
},
];
this.open = true;
this.title = "添加新增资产数量";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.fileNameS = [];
const id = row.id || this.ids;
getZczccg(id).then((response) => {
this.form = response.data;
if (response.data.fileName && response.data.fileUrl) {
let arr1 = response.data.fileName.split(",");
let arr2 = response.data.fileUrl.split(",");
arr1.forEach((value, index) => {
this.fileNameS.push({
fileName: value,
fileUrl: arr2[index],
});
});
}
this.open = true;
this.title = "修改新增资产数量";
});
},
/** 提交按钮 */
submitForm() {
let arr1 = [];
let arr2 = [];
if (this.fileNameS.length > 0) {
this.fileNameS.forEach((value) => {
if (value.fileName && value.fileUrl) {
arr1.push(value.fileName);
arr2.push(value.fileUrl);
}
});
this.form.fileName = arr1.join(",");
this.form.fileUrl = arr2.join(",");
} else {
this.form.fileName = "";
this.form.fileUrl = "";
}
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateZczccg(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addZczccg(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 delZczccg(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有新增资产数量数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/tcZz/networkSecurity/zczccg/export",
{
...this.queryParams,
},
"新增资产数量_" + new Date().getTime() + ".xlsx"
);
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.updataFile {
display: flex;
}
.fileIcon {
width: 10%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
}
.main-file {
display: flex;
}
.fileHeader {
border: 1px solid #dcdfe6;
color: #515a6e;
font-weight: bold;
height: 40px;
display: flex;
background: #f8f8f9;
width: 90%;
}
.fileItems {
border: 1px solid #dcdfe6;
border-top: none;
color: #606266;
height: 40px;
display: flex;
width: 90%;
}
.names {
width: 40%;
border-right: 1px solid #dcdfe6;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .names .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
.urls {
width: 60%;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .urls .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
</style>

@ -0,0 +1,776 @@
<template>
<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="areaId">
<el-select
v-model="queryParams.areaId"
placeholder="请选择区域"
clearable
size="small"
>
<el-option
v-for="dict in dict.type.tc_area"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> -->
<!-- <el-form-item label="启用/禁用" prop="isStatus">
<el-select
v-model="queryParams.isStatus"
placeholder="请选择启用/禁用"
clearable
size="small"
>
<el-option
v-for="dict in dict.type.tc_start"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item> -->
<el-form-item label="单位名称" prop="unitName">
<el-input
v-model="queryParams.unitName"
placeholder="请输入单位名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="积分" prop="integral">
<el-input
v-model="queryParams.integral"
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
type="primary"
size="mini"
@click="handleAdd()"
v-hasPermi="['tcZz/networkSecurity:zcdwpm:add']"
>新增</el-button
>
<el-button
type="success"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['tcZz/networkSecurity:zcdwpm:edit']"
>修改</el-button
>
<el-button
type="danger"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['tcZz/networkSecurity:zcdwpm:remove']"
>删除</el-button
>
<el-button
type="warning"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['tcZz/networkSecurity:zcdwpm:export']"
>导出</el-button
>
<el-button type="primary" size="mini" @click="importFiles"
>导入</el-button
>
<!-- <el-button type="success" size="mini" @click="enable" :disabled="multiple"
>启用</el-button
>
<el-button
type="danger"
size="mini"
@click="banned"
autofocus
:disabled="multiple"
>禁用</el-button
> -->
</div>
<el-table
v-loading="loading"
:data="zcdwpmList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="区域" align="center" prop="areaId">
<template slot-scope="scope">
<dict-tag :options="dict.type.tc_area" :value="scope.row.areaId" />
</template>
</el-table-column> -->
<el-table-column label="单位名称" align="center" prop="unitName" />
<el-table-column label="积分" align="center" prop="integral" />
<!-- <el-table-column label="处置情况" align="center" prop="czState" /> -->
<!-- <el-table-column label="启用/禁用" align="center" prop="isStatus">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isStatus"
active-color="#ff4949"
inactive-color="#13ce66"
:active-value="2"
:inactive-value="1"
@change="alter(scope.row)"
>
</el-switch>
</template>
</el-table-column> -->
<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="['tcZz/networkSecurity:zcdwpm:list']"
>
查看
</el-button>
<el-button
type="success"
size="mini"
@click="handleUpdate(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zcdwpm:edit']"
>修改</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zcdwpm: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="areaId">
<el-select v-model="form.areaId" placeholder="请选择区域">
<el-option
v-for="dict in dict.type.tc_area"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item> -->
<!-- <el-form-item label="启用/禁用" prop="isStatus">
<el-radio-group v-model="form.isStatus">
<el-radio :label="1">启用</el-radio>
<el-radio :label="2">禁用</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="单位名称" prop="unitName">
<el-input v-model="form.unitName" placeholder="请输入单位名称" />
</el-form-item>
<el-form-item label="积分" prop="integral">
<el-input v-model="form.integral" placeholder="请输入积分" />
</el-form-item>
<!-- <el-form-item label="处置情况" prop="czState">
<el-input v-model="form.czState" placeholder="请输入处置情况" />
</el-form-item> -->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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="90%"
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="区域">{{
selectDictLabel(dict.type.tc_area, form.areaId)
}}</el-descriptions-item> -->
<!-- <el-descriptions-item label="启用/禁用">{{
selectDictLabel(dict.type.tc_start, form.isStatus)
}}</el-descriptions-item> -->
<el-descriptions-item label="单位名称">{{
form.unitName
}}</el-descriptions-item>
<el-descriptions-item label="积分">{{
form.integral
}}</el-descriptions-item>
<!-- <el-descriptions-item label="处置情况">{{
form.czState
}}</el-descriptions-item> -->
<el-descriptions-item label="备注">{{
form.remark
}}</el-descriptions-item>
</el-descriptions>
</el-dialog>
<!-- 导入 -->
<el-dialog
:visible.sync="fileOpen"
width="400px"
append-to-body
custom-class="dialog-box"
@close="cancelFile"
>
<div slot="title" class="dialog-title">导入</div>
<el-upload
ref="upload"
:limit="limit"
action="666"
:accept="accept"
:headers="headers"
:file-list="fileList"
:multiple="false"
:auto-upload="false"
drag
:before-upload="handleBeforeUpload"
:on-exceed="handleExceed"
:http-request="handleFile"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFile"> </el-button>
<el-button @click="cancelFile"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listZcdwpm,
getZcdwpm,
delZcdwpm,
addZcdwpm,
updateZcdwpm,
exportZcdwpm,
isStatusZcdwpm,
importZcdwpm,
} from "@/api/tcZz/networkSecurity/zcdwpm";
import { getToken } from "@/utils/auth";
export default {
name: "Zcdwpm",
//
dicts: ["tc_area", "tc_start"],
data() {
return {
tableHeigth: 0,
//
infoOpen: false,
//
infoTitle: "",
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
zcdwpmList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
daterangeUpdateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
id: null,
// areaId: null,
// isStatus: null,
unitName: null,
integral: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
},
//
form: {},
//
rules: {
// areaId: [{ required: true, message: "", trigger: "blur" }],
// isStatus: [
// { required: true, message: "/", trigger: "blur" },
// ],
unitName: [
{ required: true, message: "单位名称不能为空", trigger: "blur" },
],
integral: [
{ required: true, message: "积分不能为空", trigger: "blur" },
],
// czState: [
// { required: true, message: "", trigger: "blur" },
// ],
},
fileNameS: [],
//===========
fileList: [],
limit: 1,
accept: ".xls,.xlsx",
fileOpen: false,
headers: { Authorization: "Bearer " + getToken() },
};
},
created() {
this.getList();
},
methods: {
files(e) {
console.log(e);
if (!e.fileUrl) return [];
let newA = e.fileUrl.split(",");
let newB = e.fileName.split(",");
let newC = [];
newA.forEach((value, index) => {
newC.push({
fileName: newB[index],
fileUrl: value,
});
});
console.log(newC);
return newC;
},
alter(e) {
updateZcdwpm(e).then(() => {
this.getList();
this.$modal.msgSuccess("修改成功");
});
},
//
importTemplate() {
this.download(
"/tcZz/networkSecurity/zcdwpm/importTemplate",
{},
`众测单位排名模板.xlsx`
);
},
//
importFiles() {
this.fileOpen = true;
},
submitFile() {
this.$refs.upload.submit();
},
cancelFile() {
this.fileOpen = false;
},
//
handleBeforeUpload(file) {
//
const fileName = file.name.split(".");
const fileExt = fileName[fileName.length - 1];
const isTypeOk = this.accept.includes(fileExt);
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`);
return false;
}
},
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
},
handleFile(data) {
this.$modal.loading();
let form = new FormData();
form.append("file", data.file);
importZcdwpm(form)
.then((res) => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$modal.msgSuccess("导入成功");
this.$refs.upload.clearFiles();
this.getList();
})
.catch(() => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$refs.upload.clearFiles();
this.getList();
});
},
//
enable(row) {
this.isStatusFuc(row, 1);
},
//
banned(row) {
this.isStatusFuc(row, 2);
},
isStatusFuc(row, e) {
const ids = row.id || this.ids.join(",");
const src = e == 1 ? "启动" : "禁用";
this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return isStatusZcdwpm({ ids: ids, isStatus: e });
})
.then(() => {
this.getList(e);
})
.catch(() => {});
},
//
addFile() {
if (this.fileNameS.length <= 0) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
if (
this.fileNameS[this.fileNameS.length - 1].fileUrl != "" &&
this.fileNameS[this.fileNameS.length - 1].fileName != ""
) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
this.$modal.msgError("请完整填写上一条");
}
}
},
//
removeFile(index) {
this.fileNameS.splice(index, 1);
},
/** 查询众测单位排名列表 */
getList(e) {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] =
this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
}
if (null != this.daterangeUpdateTime && "" != this.daterangeUpdateTime) {
this.queryParams.params["beginUpdateTime"] =
this.daterangeUpdateTime[0];
this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
}
listZcdwpm(this.queryParams).then((response) => {
this.zcdwpmList = response.rows;
this.total = response.total;
this.loading = false;
if (e == 1) {
this.$modal.msgSuccess("启动成功");
} else if (e == 2) {
this.$modal.msgSuccess("禁用成功");
}
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
// areaId: null,
// isStatus: 1,
unitName: null,
integral: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.daterangeUpdateTime = [];
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;
getZcdwpm(id).then((response) => {
this.form = response.data;
this.infoOpen = true;
this.infoTitle = "查看众测单位排名";
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.fileNameS = [
{
fileName: "",
fileUrl: "",
},
];
this.open = true;
this.title = "添加众测单位排名";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.fileNameS = [];
const id = row.id || this.ids;
getZcdwpm(id).then((response) => {
this.form = response.data;
if (response.data.fileName && response.data.fileUrl) {
let arr1 = response.data.fileName.split(",");
let arr2 = response.data.fileUrl.split(",");
arr1.forEach((value, index) => {
this.fileNameS.push({
fileName: value,
fileUrl: arr2[index],
});
});
}
this.open = true;
this.title = "修改众测单位排名";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateZcdwpm(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addZcdwpm(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 delZcdwpm(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有众测单位排名数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/tcZz/networkSecurity/zcdwpm/export",
{
...this.queryParams,
},
"众测单位排名_" + new Date().getTime() + ".xlsx"
);
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.updataFile {
display: flex;
}
.fileIcon {
width: 10%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
}
.main-file {
display: flex;
}
.fileHeader {
border: 1px solid #dcdfe6;
color: #515a6e;
font-weight: bold;
height: 40px;
display: flex;
background: #f8f8f9;
width: 90%;
}
.fileItems {
border: 1px solid #dcdfe6;
border-top: none;
color: #606266;
height: 40px;
display: flex;
width: 90%;
}
.names {
width: 40%;
border-right: 1px solid #dcdfe6;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .names .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
.urls {
width: 60%;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .urls .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
</style>

@ -0,0 +1,738 @@
<template>
<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="ldLevel">
<el-select
v-model="queryParams.ldLevel"
placeholder="请选择漏洞等级"
clearable
size="small"
>
<el-option
v-for="dict in dict.type.ld_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="启用/禁用" prop="isStatus">
<el-select
v-model="queryParams.isStatus"
placeholder="请选择启用/禁用"
clearable
size="small"
>
<el-option
v-for="dict in dict.type.tc_start"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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
type="primary"
size="mini"
@click="handleAdd()"
v-hasPermi="['tcZz/networkSecurity:zclds:add']"
>新增</el-button
>
<el-button
type="success"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['tcZz/networkSecurity:zclds:edit']"
>修改</el-button
>
<el-button
type="danger"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['tcZz/networkSecurity:zclds:remove']"
>删除</el-button
>
<el-button
type="warning"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['tcZz/networkSecurity:zclds:export']"
>导出</el-button
>
<el-button type="primary" size="mini" @click="importFiles"
>导入</el-button
>
<!-- <el-button type="success" size="mini" @click="enable" :disabled="multiple"
>启用</el-button
>
<el-button
type="danger"
size="mini"
@click="banned"
autofocus
:disabled="multiple"
>禁用</el-button
> -->
</div>
<el-table
v-loading="loading"
:data="zcldsList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="漏洞等级" align="center" prop="ldLevel">
<template slot-scope="scope">
<dict-tag :options="dict.type.ld_level" :value="scope.row.ldLevel" />
</template>
</el-table-column>
<el-table-column label="漏洞数量" align="center" prop="ldNumber" />
<!-- <el-table-column label="启用/禁用" align="center" prop="isStatus">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isStatus"
active-color="#ff4949"
inactive-color="#13ce66"
:active-value="2"
:inactive-value="1"
@change="alter(scope.row)"
>
</el-switch>
</template>
</el-table-column> -->
<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="['tcZz/networkSecurity:zclds:list']"
>
查看
</el-button>
<el-button
type="success"
size="mini"
@click="handleUpdate(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zclds:edit']"
>修改</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zclds: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="ldLevel">
<el-select v-model="form.ldLevel" placeholder="请选择漏洞等级">
<el-option
v-for="dict in dict.type.ld_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="启用/禁用" prop="isStatus">
<el-radio-group v-model="form.isStatus">
<el-radio :label="1">启用</el-radio>
<el-radio :label="2">禁用</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="漏洞数量" prop="ldNumber">
<el-input v-model="form.ldNumber" placeholder="请输入漏洞数量" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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="90%"
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="漏洞等级">{{
selectDictLabel(dict.type.ld_level, form.ldLevel)
}}</el-descriptions-item>
<!-- <el-descriptions-item label="启用/禁用">{{
selectDictLabel(dict.type.tc_start, form.isStatus)
}}</el-descriptions-item> -->
<el-descriptions-item label="漏洞数量">{{
form.ldNumber
}}</el-descriptions-item>
<el-descriptions-item label="备注">{{
form.remark
}}</el-descriptions-item>
</el-descriptions>
</el-dialog>
<!-- 导入 -->
<el-dialog
:visible.sync="fileOpen"
width="400px"
append-to-body
custom-class="dialog-box"
@close="cancelFile"
>
<div slot="title" class="dialog-title">导入</div>
<el-upload
ref="upload"
:limit="limit"
action="666"
:accept="accept"
:headers="headers"
:file-list="fileList"
:multiple="false"
:auto-upload="false"
drag
:before-upload="handleBeforeUpload"
:on-exceed="handleExceed"
:http-request="handleFile"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFile"> </el-button>
<el-button @click="cancelFile"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listZclds,
getZclds,
delZclds,
addZclds,
updateZclds,
// exportZclds,
isStatusZclds,
importZclds,
} from "@/api/tcZz/networkSecurity/zclds";
import { getToken } from "@/utils/auth";
export default {
name: "Zclds",
//
dicts: ["ld_level"],
data() {
return {
tableHeigth: 0,
//
infoOpen: false,
//
infoTitle: "",
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
zcldsList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
daterangeUpdateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
id: null,
ldLevel: null,
isStatus: null,
ldNumber: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
},
//
form: {},
//
rules: {
ldLevel: [{ required: true, message: "请选择漏洞等级", trigger: "blur" }],
isStatus: [
{ required: true, message: "请选择启动/禁用", trigger: "blur" },
],
ldNumber: [
{ required: true, message: "漏洞数量不能为空", trigger: "blur" },
],
ipAddress: [
{ required: true, message: "目标IP/域名不能为空", trigger: "blur" },
],
czState: [
{ required: true, message: "处置情况不能为空", trigger: "blur" },
],
},
fileNameS: [],
//===========
fileList: [],
limit: 1,
accept: ".xls,.xlsx",
fileOpen: false,
headers: { Authorization: "Bearer " + getToken() },
};
},
created() {
this.getList();
},
methods: {
files(e) {
console.log(e);
if (!e.fileUrl) return [];
let newA = e.fileUrl.split(",");
let newB = e.fileName.split(",");
let newC = [];
newA.forEach((value, index) => {
newC.push({
fileName: newB[index],
fileUrl: value,
});
});
console.log(newC);
return newC;
},
alter(e) {
updateZclds(e).then(() => {
this.getList();
this.$modal.msgSuccess("修改成功");
});
},
//
importTemplate() {
this.download(
"/tcZz/networkSecurity/zclds/importTemplate",
{},
`众测漏洞数模板.xlsx`
);
},
//
importFiles() {
this.fileOpen = true;
},
submitFile() {
this.$refs.upload.submit();
},
cancelFile() {
this.fileOpen = false;
},
//
handleBeforeUpload(file) {
//
const fileName = file.name.split(".");
const fileExt = fileName[fileName.length - 1];
const isTypeOk = this.accept.includes(fileExt);
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`);
return false;
}
},
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
},
handleFile(data) {
this.$modal.loading();
let form = new FormData();
form.append("file", data.file);
importZclds(form)
.then((res) => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$modal.msgSuccess("导入成功");
this.$refs.upload.clearFiles();
this.getList();
})
.catch(() => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$refs.upload.clearFiles();
this.getList();
});
},
//
enable(row) {
this.isStatusFuc(row, 1);
},
//
banned(row) {
this.isStatusFuc(row, 2);
},
isStatusFuc(row, e) {
const ids = row.id || this.ids.join(",");
const src = e == 1 ? "启动" : "禁用";
this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return isStatusZclds({ ids: ids, isStatus: e });
})
.then(() => {
this.getList(e);
})
.catch(() => {});
},
//
addFile() {
if (this.fileNameS.length <= 0) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
if (
this.fileNameS[this.fileNameS.length - 1].fileUrl != "" &&
this.fileNameS[this.fileNameS.length - 1].fileName != ""
) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
this.$modal.msgError("请完整填写上一条");
}
}
},
//
removeFile(index) {
this.fileNameS.splice(index, 1);
},
/** 查询众测漏洞数列表 */
getList(e) {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] =
this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
}
if (null != this.daterangeUpdateTime && "" != this.daterangeUpdateTime) {
this.queryParams.params["beginUpdateTime"] =
this.daterangeUpdateTime[0];
this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
}
listZclds(this.queryParams).then((response) => {
this.zcldsList = response.rows;
this.total = response.total;
this.loading = false;
if (e == 1) {
this.$modal.msgSuccess("启动成功");
} else if (e == 2) {
this.$modal.msgSuccess("禁用成功");
}
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
ldLevel: null,
// isStatus: 1,
ldNumber: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.daterangeUpdateTime = [];
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;
getZclds(id).then((response) => {
this.form = response.data;
this.infoOpen = true;
this.infoTitle = "查看众测漏洞数详情";
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.fileNameS = [
{
fileName: "",
fileUrl: "",
},
];
this.open = true;
this.title = "添加众测漏洞数";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.fileNameS = [];
const id = row.id || this.ids;
getZclds(id).then((response) => {
this.form = response.data;
if (response.data.fileName && response.data.fileUrl) {
let arr1 = response.data.fileName.split(",");
let arr2 = response.data.fileUrl.split(",");
arr1.forEach((value, index) => {
this.fileNameS.push({
fileName: value,
fileUrl: arr2[index],
});
});
}
this.open = true;
this.title = "修改众测漏洞数";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateZclds(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addZclds(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 delZclds(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有众测漏洞数数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/tcZz/networkSecurity/zclds/export",
{
...this.queryParams,
},
"众测漏洞数_" + new Date().getTime() + ".xlsx"
);
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.updataFile {
display: flex;
}
.fileIcon {
width: 10%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
}
.main-file {
display: flex;
}
.fileHeader {
border: 1px solid #dcdfe6;
color: #515a6e;
font-weight: bold;
height: 40px;
display: flex;
background: #f8f8f9;
width: 90%;
}
.fileItems {
border: 1px solid #dcdfe6;
border-top: none;
color: #606266;
height: 40px;
display: flex;
width: 90%;
}
.names {
width: 40%;
border-right: 1px solid #dcdfe6;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .names .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
.urls {
width: 60%;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .urls .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
</style>

@ -0,0 +1,756 @@
<template>
<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="unit">
<el-input
v-model="queryParams.unit"
placeholder="请输入所属单位"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="资产名称" prop="zcName">
<el-input
v-model="queryParams.zcName"
placeholder="请输入资产名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="启用/禁用" prop="isStatus">
<el-select
v-model="queryParams.isStatus"
placeholder="请选择启用/禁用"
clearable
size="small"
>
<el-option
v-for="dict in dict.type.tc_start"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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
type="primary"
size="mini"
@click="handleAdd()"
v-hasPermi="['tcZz/networkSecurity:zclb:add']"
>新增</el-button
>
<el-button
type="success"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['tcZz/networkSecurity:zclb:edit']"
>修改</el-button
>
<el-button
type="danger"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['tcZz/networkSecurity:zclb:remove']"
>删除</el-button
>
<el-button
type="warning"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['tcZz/networkSecurity:zclb:export']"
>导出</el-button
>
<el-button type="primary" size="mini" @click="importFiles"
>导入</el-button
>
<!-- <el-button type="success" size="mini" @click="enable" :disabled="multiple"
>启用</el-button
>
<el-button
type="danger"
size="mini"
@click="banned"
autofocus
:disabled="multiple"
>禁用</el-button
> -->
</div>
<el-table
v-loading="loading"
:data="zclbList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="所属单位" align="center" prop="unit" />
<el-table-column label="资产名称" align="center" prop="zcName" />
<el-table-column label="资产地址" align="center" prop="zcAddress" />
<!-- <el-table-column label="启用/禁用" align="center" prop="isStatus">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isStatus"
active-color="#ff4949"
inactive-color="#13ce66"
:active-value="2"
:inactive-value="1"
@change="alter(scope.row)"
>
</el-switch>
</template>
</el-table-column> -->
<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="['tcZz/networkSecurity:zclb:list']"
>
查看
</el-button>
<el-button
type="success"
size="mini"
@click="handleUpdate(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zclb:edit']"
>修改</el-button
>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.row)"
v-hasPermi="['tcZz/networkSecurity:zclb: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="ldLevel">
<el-select v-model="form.ldLevel" placeholder="请选择漏洞等级">
<el-option
v-for="dict in dict.type.ld_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item> -->
<!-- <el-form-item label="启用/禁用" prop="isStatus">
<el-radio-group v-model="form.isStatus">
<el-radio :label="1">启用</el-radio>
<el-radio :label="2">禁用</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="所属单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入所属单位" />
</el-form-item>
<el-form-item label="资产名称" prop="zcName">
<el-input v-model="form.zcName" placeholder="请输入资产名称" />
</el-form-item>
<el-form-item label="资产地址" prop="zcAddress">
<el-input v-model="form.zcAddress" placeholder="请输入资产地址" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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="90%"
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="漏洞等级">{{
selectDictLabel(dict.type.ld_level, form.ldLevel)
}}</el-descriptions-item> -->
<!-- <el-descriptions-item label="启用/禁用">{{
selectDictLabel(dict.type.tc_start, form.isStatus)
}}</el-descriptions-item> -->
<el-descriptions-item label="所属单位">{{
form.unit
}}</el-descriptions-item>
<el-descriptions-item label="资产名称">{{
form.zcName
}}</el-descriptions-item>
<el-descriptions-item label="资产地址">{{
form.zcAddress
}}</el-descriptions-item>
<el-descriptions-item label="备注">{{
form.remark
}}</el-descriptions-item>
</el-descriptions>
</el-dialog>
<!-- 导入 -->
<el-dialog
:visible.sync="fileOpen"
width="400px"
append-to-body
custom-class="dialog-box"
@close="cancelFile"
>
<div slot="title" class="dialog-title">导入</div>
<el-upload
ref="upload"
:limit="limit"
action="666"
:accept="accept"
:headers="headers"
:file-list="fileList"
:multiple="false"
:auto-upload="false"
drag
:before-upload="handleBeforeUpload"
:on-exceed="handleExceed"
:http-request="handleFile"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板</el-link
>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFile"> </el-button>
<el-button @click="cancelFile"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listZclb,
getZclb,
delZclb,
addZclb,
updateZclb,
// exportZclb,
isStatusZclb,
importZclb,
} from "@/api/tcZz/networkSecurity/zcqk";
import { getToken } from "@/utils/auth";
export default {
name: "Zclb",
//
dicts: ["ld_level"],
data() {
return {
tableHeigth: 0,
//
infoOpen: false,
//
infoTitle: "",
//
loading: true,
//
exportLoading: false,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
zclbList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
daterangeUpdateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
id: null,
ldLevel: null,
isStatus: null,
ldNumber: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
},
//
form: {},
//
rules: {
// ldLevel: [{ required: true, message: "", trigger: "blur" }],
// isStatus: [
// { required: true, message: "/", trigger: "blur" },
// ],
unit: [
{ required: true, message: "漏洞数量不能为空", trigger: "blur" },
],
zcName: [
{ required: true, message: "目标IP/域名不能为空", trigger: "blur" },
],
zcAddress: [
{ required: true, message: "处置情况不能为空", trigger: "blur" },
],
},
fileNameS: [],
//===========
fileList: [],
limit: 1,
accept: ".xls,.xlsx",
fileOpen: false,
headers: { Authorization: "Bearer " + getToken() },
};
},
created() {
this.getList();
},
methods: {
files(e) {
console.log(e);
if (!e.fileUrl) return [];
let newA = e.fileUrl.split(",");
let newB = e.fileName.split(",");
let newC = [];
newA.forEach((value, index) => {
newC.push({
fileName: newB[index],
fileUrl: value,
});
});
console.log(newC);
return newC;
},
alter(e) {
updateZclb(e).then(() => {
this.getList();
this.$modal.msgSuccess("修改成功");
});
},
//
importTemplate() {
this.download(
"/tcZz/networkSecurity/zclb/importTemplate",
{},
`资产情况详情模板.xlsx`
);
},
//
importFiles() {
this.fileOpen = true;
},
submitFile() {
this.$refs.upload.submit();
},
cancelFile() {
this.fileOpen = false;
},
//
handleBeforeUpload(file) {
//
const fileName = file.name.split(".");
const fileExt = fileName[fileName.length - 1];
const isTypeOk = this.accept.includes(fileExt);
if (!isTypeOk) {
this.$modal.msgError(`文件格式不正确, 请上传${this.accept}格式文件!`);
return false;
}
},
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
},
handleFile(data) {
this.$modal.loading();
let form = new FormData();
form.append("file", data.file);
importZclb(form)
.then((res) => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$modal.msgSuccess("导入成功");
this.$refs.upload.clearFiles();
this.getList();
})
.catch(() => {
this.fileOpen = false;
this.$modal.closeLoading();
this.$refs.upload.clearFiles();
this.getList();
});
},
//
enable(row) {
this.isStatusFuc(row, 1);
},
//
banned(row) {
this.isStatusFuc(row, 2);
},
isStatusFuc(row, e) {
const ids = row.id || this.ids.join(",");
const src = e == 1 ? "启动" : "禁用";
this.$confirm("是否确认" + src + '编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(function () {
return isStatusZclb({ ids: ids, isStatus: e });
})
.then(() => {
this.getList(e);
})
.catch(() => {});
},
//
addFile() {
if (this.fileNameS.length <= 0) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
if (
this.fileNameS[this.fileNameS.length - 1].fileUrl != "" &&
this.fileNameS[this.fileNameS.length - 1].fileName != ""
) {
this.fileNameS.push({
fileName: "",
fileUrl: "",
});
} else {
this.$modal.msgError("请完整填写上一条");
}
}
},
//
removeFile(index) {
this.fileNameS.splice(index, 1);
},
/** 查询资产情况列表 */
getList(e) {
this.loading = true;
// this.queryParams.params = {};
// if (null != this.daterangeCreateTime && "" != this.daterangeCreateTime) {
// this.queryParams.params["beginCreateTime"] =
// this.daterangeCreateTime[0];
// this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
// }
// if (null != this.daterangeUpdateTime && "" != this.daterangeUpdateTime) {
// this.queryParams.params["beginUpdateTime"] =
// this.daterangeUpdateTime[0];
// this.queryParams.params["endUpdateTime"] = this.daterangeUpdateTime[1];
// }
listZclb(this.queryParams).then((response) => {
this.zclbList = response.rows;
this.total = response.total;
this.loading = false;
if (e == 1) {
this.$modal.msgSuccess("启动成功");
} else if (e == 2) {
this.$modal.msgSuccess("禁用成功");
}
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
unit: null,
// isStatus: 1,
zcName: null,
zcAddress: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.daterangeUpdateTime = [];
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;
getZclb(id).then((response) => {
this.form = response.data;
this.infoOpen = true;
this.infoTitle = "查看资产情况详情";
});
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.fileNameS = [
{
fileName: "",
fileUrl: "",
},
];
this.open = true;
this.title = "添加资产情况详情";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.fileNameS = [];
const id = row.id || this.ids;
getZclb(id).then((response) => {
this.form = response.data;
if (response.data.fileName && response.data.fileUrl) {
let arr1 = response.data.fileName.split(",");
let arr2 = response.data.fileUrl.split(",");
arr1.forEach((value, index) => {
this.fileNameS.push({
fileName: value,
fileUrl: arr2[index],
});
});
}
this.open = true;
this.title = "修改资产情况详情";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
updateZclb(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addZclb(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 delZclb(ids);
})
.then(() => {
this.getList();
this.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm("是否确认导出所有资产情况数据项?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.download(
"/tcZz/networkSecurity/zclb/export",
{
...this.queryParams,
},
"资产情况_" + new Date().getTime() + ".xlsx"
);
this.exportLoading = false;
})
.catch(() => {});
},
},
};
</script>
<style lang="scss" scoped>
.updataFile {
display: flex;
}
.fileIcon {
width: 10%;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
}
.main-file {
display: flex;
}
.fileHeader {
border: 1px solid #dcdfe6;
color: #515a6e;
font-weight: bold;
height: 40px;
display: flex;
background: #f8f8f9;
width: 90%;
}
.fileItems {
border: 1px solid #dcdfe6;
border-top: none;
color: #606266;
height: 40px;
display: flex;
width: 90%;
}
.names {
width: 40%;
border-right: 1px solid #dcdfe6;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .names .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
.urls {
width: 60%;
box-sizing: border-box;
padding-left: 10px;
}
::v-deep .urls .el-input__inner {
border: none !important;
padding-left: 0 !important;
}
</style>
Loading…
Cancel
Save