From 05fce0b12e0a697a873ae81dab9192d5bc00f0a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Mon, 21 Aug 2023 13:15:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=9B=91=E7=AE=A1=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/zongzhi/st.js | 15 ++ src/components/MyTable/index.vue | 2 +- src/store/modules/dict.js | 31 +++- src/utils/common.js | 24 ++- .../security/components/componentLeft.vue | 163 +++++++++++------- .../security/components/jianGuan.js | 92 +++++----- .../privateOrder/security/components/mock.js | 38 ++-- 7 files changed, 232 insertions(+), 133 deletions(-) diff --git a/src/api/zongzhi/st.js b/src/api/zongzhi/st.js index 08ec945..7504902 100644 --- a/src/api/zongzhi/st.js +++ b/src/api/zongzhi/st.js @@ -8,6 +8,13 @@ export function listSafetyadmin(query) { params: query }) } +export function listTown(query) { + return request({ + url: '/zongzhi/town/list', + method: 'get', + params: query + }) +} // 查询网评员列表 export function listCommentator(query) { @@ -127,3 +134,11 @@ export function listIDCunit(query) { params: query }) } +// 查询数据来源列表 +export function listSource(query) { + return request({ + url: '/zongzhi/source/list', + method: 'get', + params: query + }) +} diff --git a/src/components/MyTable/index.vue b/src/components/MyTable/index.vue index 4c077da..dc6fac0 100644 --- a/src/components/MyTable/index.vue +++ b/src/components/MyTable/index.vue @@ -18,7 +18,7 @@ > diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js index d5bebf6..c8aec86 100644 --- a/src/store/modules/dict.js +++ b/src/store/modules/dict.js @@ -1,23 +1,31 @@ import { getDictList } from '@/api/zongzhi/common.js' +import { listTown } from '@/api/zongzhi/st.js' const dict = { state: { - dictObject: {} + dictObject: {}, + townList: [] }, mutations: { SET_DICT: (state, dict) => { state.dictObject = dict + }, + SET_TOWN: (state, town) => { + state.townList = town } }, actions: { getDictType({ commit }) { return new Promise((resolve, reject) => { const query = { - list: 'sys_user_sex,tc_net_sx,tc_yq_media,tc_enter_type,tc_inlet_yewu,tc_item_type' + list: 'sys_user_sex,tc_net_sx,tc_yq_media,tc_enter_type,tc_inlet_yewu,tc_item_type,tc_net_safety_level,tc_yes_no,tc_unit_type,tc_tmt_type,tc_net_safety_level,tc_db_steam_state' } getDictList(query) .then((res) => { commit('SET_DICT', res.data) - resolve() + getownList().then((town) => { + commit('SET_TOWN', town) + resolve() + }) }) .catch((error) => { reject(error) @@ -26,5 +34,20 @@ const dict = { } } } - +// 获取各镇/村 +function getownList() { + return new Promise((resolve, reject) => { + const lsit = [] + listTown({ pageNum: 1, pageSize: 200 }) + .then((res) => { + res.rows.forEach((item) => { + lsit.push({ value: item.id, label: item.name }) + }) + resolve(lsit) + }) + .catch((error) => { + reject(error) + }) + }) +} export default dict diff --git a/src/utils/common.js b/src/utils/common.js index 2787b63..2e6be00 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -1,12 +1,24 @@ import store from '@/store' -export function filterDict(type, value) { - const dict = store.getters.dictObject - // console.log(dict, type, value) - // debugger - const result = dict[type].filter((item) => item.dictValue == value) +export function filterDict(type, value, isTown = false) { + if (isTown) { + return filterTown(value) + } else { + const dict = store.getters.dictObject + const result = dict[type].filter((item) => item.dictValue == value) + if (result.length > 0) { + return result[0].dictLabel + } else { + return '未匹配到' + } + } +} + +export function filterTown(id) { + const townList = store.state.dict.townList + const result = townList.filter((item) => item.value == id) if (result.length > 0) { - return result[0].dictLabel + return result[0].label } else { return '未匹配到' } diff --git a/src/views/privateOrder/security/components/componentLeft.vue b/src/views/privateOrder/security/components/componentLeft.vue index ec11a60..71d15bc 100644 --- a/src/views/privateOrder/security/components/componentLeft.vue +++ b/src/views/privateOrder/security/components/componentLeft.vue @@ -271,7 +271,7 @@ :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" - @pagination="getAllList" + @pagination="showAttack" /> @@ -293,7 +293,7 @@ import vueSeamlessScroll from 'vue-seamless-scroll' import ModuleTitle from '../../common/ModuleTitle.vue' import attackSituation from './attackSituation.vue' import ExcelTable from '@/components/ExcelTable' -import { listSystem, listUnit, listWeb, listIDCunit } from '@/api/zongzhi/st.js' +import { listSystem, listUnit, listWeb, listIDCunit, listSource } from '@/api/zongzhi/st.js' import { yingTanZhen, yingTanZhenKeyValue, @@ -336,7 +336,7 @@ export default { */ queryParams: { pageNum: 1, - pageSize: 1 + pageSize: 10 }, // 分页查询条件 total: 0, // 总数 @@ -569,68 +569,107 @@ export default { this.dialogStatus = true this.dialogType = '安全监测' }, + /** + * 表格参数重置 + * */ + reset() { + this.total = 0 + this.queryParams = { + pageNum: 1, + pageSize: 10 + } + this.excelData = [] + this.excelDataHeader = [] + }, + /** + * 等保系统 + */ + getDbSteam() { + listSystem(this.queryParams).then(res => { + this.excelData = res.rows + this.excelDataHeader = dbxtKeyValue + this.total = res.total + }) + }, + /** + * 等保单位 + */ + getDbUnit() { + listUnit(this.queryParams).then(res => { + this.excelData = res.rows + this.excelDataHeader = dbdwKeyValue + this.total = res.total + }) + }, + /** + * 政府网站 + */ + getZfWeb() { + listWeb(this.queryParams).then(res => { + this.excelData = res.rows + this.excelDataHeader = zfdwKeyValue + this.total = res.total + }) + }, + /** + * IDC单位 + */ + getIdcUnit() { + listIDCunit(this.queryParams).then(res => { + this.excelData = res.rows + this.excelDataHeader = IDCKeyValue + this.total = res.total + }) + }, + /** + * 监管单位 || 网站监测 || 系统监测 + */ + getJgUnit() { + listSource(this.queryParams).then(res => { + this.excelData = res.rows + this.excelDataHeader = xitongjianceKeyValue + this.total = res.total + }) + }, showAttack(item = '安全监测', total) { - this.dialogType = item - if (item === '等保系统') { + if (typeof item === 'object') { + // + } else { + this.reset() + this.dialogType = item + } + + if (this.dialogType === '等保系统') { this.dialogWidth = '4000px' - listSystem(this.queryParams).then(res => { - this.excelData = res.rows - this.excelDataHeader = dbxtKeyValue - this.total = res.total - this.dialogStatus = true - }) + this.getDbSteam() + } + if (this.dialogType === '等保单位') { + this.dialogWidth = '4000px' + this.getDbUnit() } - // this.tableTotal = total // 写这个的原因是因为总数并不能和数据完全匹配 按页面显示数字为主 - // this.dialogStatus = false - // setTimeout(() => { - // if (item === '硬探针') { - // this.dialogWidth = '1800px' - // this.excelData = yingTanZhen - // this.excelDataHeader = yingTanZhenKeyValue - // } - // if (item === '系统监测' || item === '监管单位') { - // this.dialogWidth = '2100px' - // this.excelData = xitongjiance - // this.excelDataHeader = xitongjianceKeyValue - // } - // if (item === '网站监测') { - // this.dialogWidth = '2100px' - // this.excelData = xitongjiance - // this.excelDataHeader = xitongjianceKeyValue - // } - // if (item === 'IDC单位') { - // this.dialogWidth = '1800px' - // this.excelData = IDC - // this.excelDataHeader = IDCKeyValue - // } - // if (item === '等保单位') { - // this.dialogWidth = '3300px' - // this.excelData = dbdw - // this.excelDataHeader = dbdwKeyValue - // } - // if (item === '等保系统') { - // this.dialogWidth = '4000px' - // listSystem().then(res => { - // this.excelData = res.rows - // this.excelDataHeader = dbxtKeyValue - // this.dialogStatus = true - // }) - // } - // if (item === '政府网站') { - // this.dialogWidth = '1800px' - // this.excelData = zfdw - // this.excelDataHeader = zfdwKeyValue - // } - // if (item === '软探针') { - // this.dialogWidth = '1800px' - // this.excelData = rtz - // this.excelDataHeader = rtzKeyValue - // } - // this.dialogType = item - // if (item.target?.dataset.obj) { - // this.dialogType = item.target.dataset.obj - // } - // }, 0) + if (this.dialogType === '政府网站') { + this.dialogWidth = '1800px' + this.getZfWeb() + } + if (this.dialogType === 'IDC单位') { + this.dialogWidth = '1800px' + this.getIdcUnit() + } + if (this.dialogType === '监管单位' || this.dialogType === '系统监测' || this.dialogType === '网站监测' || this.dialogType === '软探针' || this.dialogType === '硬探针') { + this.dialogWidth = '2100px' + if (this.dialogType === '软探针') { + this.queryParams.type = 4 + } else if (this.dialogType === '硬探针') { + this.queryParams.type = 3 + } else { + this.queryParams.type = 5 + } + + this.getJgUnit() + } + this.$nextTick(() => { + this.dialogStatus = true + }) }, // 数据来源数据获取 getDataSource() { diff --git a/src/views/privateOrder/security/components/jianGuan.js b/src/views/privateOrder/security/components/jianGuan.js index 47e1d46..895a32c 100644 --- a/src/views/privateOrder/security/components/jianGuan.js +++ b/src/views/privateOrder/security/components/jianGuan.js @@ -10,16 +10,17 @@ // IDC数据 const IDCKeyValue = [ { - key: 'IDC名称', - value: 'name' + name: 'IDC名称', + value: 'unitName' }, { - key: '所属区域', - value: 'region' + name: '所属区域', + value: 'areaId', + dictType: 'town' }, { - key: 'IP段信息', - value: 'IDCmsg' + name: 'IP段信息', + value: 'ipData' } ] const IDC = [ @@ -34,61 +35,63 @@ const IDC = [ const dbdwKeyValue = [ { value: 'unitName', // 单位 名称 - key: '单位名称', + name: '单位名称', width: 350 }, { - value: 'postalCode', // 邮政 编码 - key: '邮政编码' + value: 'postCode', // 邮政 编码 + name: '邮政编码' }, { - value: 'province', // 单位地址 —省 - key: '单位地址—省' + value: 'unitProvince', // 单位地址 —省 + name: '单位地址—省' }, { - value: 'city', // 单位地址 —市 - key: '单位地址—市' + value: 'unitCity', // 单位地址 —市 + name: '单位地址—市' }, { - value: 'county', // 单位地址—区 /县 - key: '单位地址—区/县' + value: 'unitCounty', // 单位地址—区 /县 + name: '单位地址—区/县' }, { - value: 'unitAdress', - key: '单位地址' + value: 'unitStreet', + name: '单位地址' }, { - value: 'regionCode', // 行政区域 代码 - key: '行政区域代码' + value: 'areaCode', // 行政区域 代码 + name: '行政区域代码' }, { - value: 'Subordination', // 隶属 关系 - key: '隶属关系', + value: 'affiliation', // 隶属 关系 + name: '隶属关系', width: 280 }, { - value: 'UnitType', // 单位 类型 - key: '单位类型' + value: 'unitType', // 单位 类型 + name: '单位类型', + dictType: 'tc_unit_type' }, { - value: 'IndustryType', // 行业 类型 - key: '行业类型' + value: 'tmtType', // 行业 类型 + name: '行业类型', + dictType: 'tc_tmt_type' }, { - value: 'unitPrincipal', // 单位责任人—姓名 - key: '单位责任人—姓名' + value: 'fuzeName', // 单位责任人—姓名 + name: '单位责任人—姓名' }, { - value: 'unitTitle', // 单位责任人—职务/职称 - key: '单位责任人—职务' + value: 'fuzeDuty', // 单位责任人—职务/职称 + name: '单位责任人—职务' }, { - value: 'unitPhone', // 单位责任人— 办公电话 - key: '单位责任人—办公电话' + value: 'fuzeTel', // 单位责任人— 办公电话 + name: '单位责任人—办公电话' }, { - value: 'unitEmail', // 单位责任人— 电子邮件 - key: '单位责任人—电子邮件' + value: 'fuzeEmail', // 单位责任人— 电子邮件 + name: '单位责任人—电子邮件' // width: 300 } // { @@ -1513,16 +1516,17 @@ const dbdw = [ // 政府网站数据 const zfdwKeyValue = [ { - key: '网址', + name: '网址', value: 'url' }, { - key: '资产名称', - value: 'name' + name: '资产名称', + value: 'assetName' }, { - key: '资产重要等级', - value: 'leave' + name: '资产重要等级', + value: 'assetLevel', + dictType: 'tc_net_safety_level' } ] @@ -5152,13 +5156,14 @@ const dbxtKeyValue = [ width: 450 }, { - value: 'recordCode', + value: 'beianNum', name: '备案编号', width: 300 }, { value: 'safetyLevel', - name: '信息系统安全保护等级' + name: '信息系统安全保护等级', + dictType: 'tc_net_safety_level' }, { value: 'unitName', @@ -5199,7 +5204,8 @@ const dbxtKeyValue = [ }, { value: 'isRate', - name: '系统是否分级' + name: '系统是否分级', + dictType: 'tc_yes_no' }, { value: 'rankTime', @@ -5212,7 +5218,8 @@ const dbxtKeyValue = [ }, { value: 'isParent', - name: '是否有主管部门' + name: '是否有主管部门', + dictType: 'tc_yes_no' }, { value: 'rankReport', @@ -5221,6 +5228,7 @@ const dbxtKeyValue = [ { value: 'systemState', name: '系统状态', + dictType: 'tc_db_steam_state', with: 300 } ] diff --git a/src/views/privateOrder/security/components/mock.js b/src/views/privateOrder/security/components/mock.js index dae30de..9d77930 100644 --- a/src/views/privateOrder/security/components/mock.js +++ b/src/views/privateOrder/security/components/mock.js @@ -83,35 +83,37 @@ const yingTanZhen = [ ] const xitongjianceKeyValue = [ { - key: '单位名称', - value: 'unitName', - width:450 + name: "单位名称", + value: "affUnit", + width: 450, }, { - key: '网站/系统名称', - value: 'systemName', - width:450 + name: "网站/系统名称", + value: "systeamName", + width: 450, }, { - key: 'URL', - value: 'URL', - width:450 + name: "URL", + value: "url", + width: 450, }, { - key: 'IP地址', - value: 'IPAddress' + name: "IP地址", + value: "ipAddress", }, { - key: '采用端口', - value: 'portName' + name: "采用端口", + value: "portName", }, { - key: '是否关注重点', - value: 'isFocus' + name: "是否关注重点", + value: "isFocus", + dictType: "tc_yes_no", }, { - key: '等保级别', - value: 'level' + name: "等保级别", + value: "level", + dictType: "tc_net_safety_level", }, // { // key: '网站联系人', @@ -133,7 +135,7 @@ const xitongjianceKeyValue = [ // key: '备注', // value: 'remarks' // } -] +]; const xitongjiance=[ { "unitName": "太仓市通源汽车检测服务有限公司", From c200de202107dfa9e00173039960096d4a2e513c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=AE=8F=E6=9D=B0?= <1943105267@qq.com> Date: Mon, 21 Aug 2023 15:03:19 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=AE=89=E5=85=A8=E7=9B=91=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/zongzhi/st.js | 38 ++++ src/store/modules/dict.js | 2 +- .../security/components/attackSituation.vue | 91 ++++---- .../security/components/componentLeft.vue | 197 +++++++++++------- 4 files changed, 220 insertions(+), 108 deletions(-) diff --git a/src/api/zongzhi/st.js b/src/api/zongzhi/st.js index 7504902..3434769 100644 --- a/src/api/zongzhi/st.js +++ b/src/api/zongzhi/st.js @@ -142,3 +142,41 @@ export function listSource(query) { params: query }) } + +export function saftyscreenSupervise() { + return request({ + url: '/zongzhi/saftyscreen/supervise', + method: 'get' + }) +} + +// 受攻击IPTop5 +export function saftyscreenUnattack() { + return request({ + url: '/zongzhi/saftyscreen/unattack', + method: 'get' + }) +} +// 安全检测数据统计 +export function saftyscreenSafety() { + return request({ + url: '/zongzhi/saftyscreen/safety', + method: 'get' + }) +} +// 查询安全检测列表 +export function listDetection(query) { + return request({ + url: '/zongzhi/detection/list', + method: 'get', + params: query + }) +} + +// 查询安全检测详细 +export function getDetection(id) { + return request({ + url: '/zongzhi/detection/' + id, + method: 'get' + }) +} diff --git a/src/store/modules/dict.js b/src/store/modules/dict.js index c8aec86..6b2d2e6 100644 --- a/src/store/modules/dict.js +++ b/src/store/modules/dict.js @@ -17,7 +17,7 @@ const dict = { getDictType({ commit }) { return new Promise((resolve, reject) => { const query = { - list: 'sys_user_sex,tc_net_sx,tc_yq_media,tc_enter_type,tc_inlet_yewu,tc_item_type,tc_net_safety_level,tc_yes_no,tc_unit_type,tc_tmt_type,tc_net_safety_level,tc_db_steam_state' + list: 'sys_user_sex,tc_net_sx,tc_yq_media,tc_enter_type,tc_inlet_yewu,tc_item_type,tc_net_safety_level,tc_yes_no,tc_unit_type,tc_tmt_type,tc_net_safety_level,tc_db_steam_state,tc_attack_type' } getDictList(query) .then((res) => { diff --git a/src/views/privateOrder/security/components/attackSituation.vue b/src/views/privateOrder/security/components/attackSituation.vue index 6cfd65c..8ffc56e 100644 --- a/src/views/privateOrder/security/components/attackSituation.vue +++ b/src/views/privateOrder/security/components/attackSituation.vue @@ -66,6 +66,7 @@