...
|
...
|
@@ -48,32 +48,32 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions |
|
|
});
|
|
|
}
|
|
|
|
|
|
let list = [
|
|
|
{
|
|
|
title:'这是漏洞名称这是漏洞名称这是漏洞名称这是漏洞名称这是漏洞名称这是漏洞名称',
|
|
|
level:'高',
|
|
|
time:'2023-12-20 18:00:00',
|
|
|
},
|
|
|
{
|
|
|
title:'这是漏洞名称这是漏洞名称这是漏洞名称这是漏洞名称这是漏洞名称这是漏洞名称',
|
|
|
level:'高',
|
|
|
time:'2023-12-20 18:00:00',
|
|
|
},
|
|
|
]
|
|
|
vulnerabilityDialog();
|
|
|
// 读取漏洞信息
|
|
|
getVulnebilityList();
|
|
|
function getVulnebilityList() {
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/vulnerabilities/unread'
|
|
|
, type: "get"
|
|
|
, async: false
|
|
|
, done: function (res) {
|
|
|
if(res.data && res.data.length > 0){
|
|
|
vulnerabilityDialog(res.data)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
//漏洞处理弹窗
|
|
|
function vulnerabilityDialog(){
|
|
|
let dom = `
|
|
|
<ul style="padding: 10px 15px;">
|
|
|
function vulnerabilityDialog(list){
|
|
|
let dom = ` <ul style="padding: 10px 15px;">
|
|
|
${
|
|
|
list.map(item=>{
|
|
|
return `<li style="padding: 20px 0px;border-bottom: 2px solid #ccc;">
|
|
|
<span style="color: #C41011;border-bottom: 1px solid;cursor: pointer;overflow: hidden;
|
|
|
text-overflow: ellipsis;white-space: nowrap;max-width: 100%;display: inline-block;"
|
|
|
class="vulnerability-name">${item.title}</span>
|
|
|
class="vulnerability-name" data-id="aaa">${item.name}</span>
|
|
|
<div style="margin-top: 20px;">
|
|
|
<span style="margin-right: 30px;">漏洞级别:<span style="padding: 4px 10px;color: white;background-color: #C41011;border-radius: 4px;">${item.level}</span></span>
|
|
|
<span>披露时间:${item.time}</span>
|
|
|
<span>披露时间:${item.createTime}</span>
|
|
|
</div>
|
|
|
</li>`
|
|
|
}).join('')
|
...
|
...
|
@@ -91,8 +91,9 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions |
|
|
btn: false,
|
|
|
move: false,
|
|
|
success:()=>{
|
|
|
let dialogIndex=layer.index;
|
|
|
let dialogIndex = layer.index;
|
|
|
$('.vulnerability-name').unbind("click").on('click',()=>{
|
|
|
console.log($(this).data("id"),"-----------")
|
|
|
layer.close(dialogIndex);
|
|
|
let detail = `
|
|
|
<form class="layui-form" style="margin-top: 15px;" lay-filter="vulnerabilityForm">
|
...
|
...
|
@@ -115,16 +116,17 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions |
|
|
<div class="layui-form-item">
|
|
|
<label class="layui-form-label"><span style="color: red;">*</span>阅读状态:</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="radio" name="readStatus" value="已读" title="已读" lay-filter="readStatus">
|
|
|
<input type="radio" name="readStatus" value="未读" title="未读" lay-filter="readStatus" checked>
|
|
|
<input type="radio" name="isRead" value="1" title="已读" lay-filter="isRead">
|
|
|
<input type="radio" name="isRead" value="0" title="未读" lay-filter="isRead" checked>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item">
|
|
|
<label class="layui-form-label"><span style="color: red;">*</span>是否涉及:</label>
|
|
|
<div class="layui-input-inline">
|
|
|
<input type="radio" name="whether" value="是" title="是" lay-filter="whether">
|
|
|
<input type="radio" name="whether" value="否" title="否" lay-filter="whether" checked>
|
|
|
<input type="radio" name="isRelated" value="1" title="是" lay-filter="isRelated">
|
|
|
<input type="radio" name="isRelated" value="0" title="否" lay-filter="isRelated" checked>
|
|
|
</div>
|
|
|
<div><input type="hidden" id="vulnerabilitiesId" name="vulnerabilitiesId" value="24r3454534s"></div>
|
|
|
</div>
|
|
|
</form>
|
|
|
`
|
...
|
...
|
@@ -143,8 +145,19 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions |
|
|
form.render();
|
|
|
},
|
|
|
yes:(index)=>{
|
|
|
console.log(form.val('vulnerabilityForm'));
|
|
|
list.splice(0,1);
|
|
|
var formData = form.val('vulnerabilityForm');
|
|
|
admin.req({
|
|
|
url: common.domainName + '/api-web/vulnerabilities/read?access_token=' + access_token
|
|
|
, data: JSON.stringify(formData)
|
|
|
, type: 'post'
|
|
|
, contentType: "application/json; charset=utf-8"
|
|
|
, done: function (res) {
|
|
|
if (!res.success) {
|
|
|
layer.msg(res.msg ? res.msg : '保存失败', {offset: '15px', icon: 7, time: 1000});
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
list = list.filter((item) => {return item.id != formData.id});
|
|
|
layer.close(index);
|
|
|
vulnerabilityDialog();
|
|
|
}
|
...
|
...
|
|