|
|
|
@@ -78,6 +78,61 @@ |
|
|
|
</select> |
|
|
|
</h4> |
|
|
|
<div id="showInfo" style="border:1px solid #e2e2e2;padding: 20px 60px;margin-top:24px"> |
|
|
|
<div class="half-table"> |
|
|
|
<span class="model_header_text">基本信息</span> |
|
|
|
<table class="tableStyle" style="margin-top:20px;"> |
|
|
|
<tbody> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">模型名称</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="ModelName" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">版本</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="Version" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">标签</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="Label" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">大小</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="Size" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">创建时间</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="CreateTime" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">模型描述</td> |
|
|
|
<td class="ti-text-form-content" ><div id="edit-td" style="display:flex"><span id="Description" title="" class="iword-elipsis"></span><i id="edit-pencil" data-id="" data-desc="" class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(this)"></div></td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
<div class="half-table"> |
|
|
|
<span class="model_header_text">模型精度</span> |
|
|
|
<table class="tableStyle" style="margin-top:20px;"> |
|
|
|
<tbody> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">准确率</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="Accuracy" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">F1</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="F1" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">精确率</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="Precision" title=""></span></td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td class="ti-text-form-label text-width80">召回率</td> |
|
|
|
<td class="ti-text-form-content word-elipsis"><span id="Recall" title=""></span></td> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
<div style="clear: both;"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@@ -91,10 +146,9 @@ function changeInfo(version){ |
|
|
|
let versionData = data.filter((item)=>{ |
|
|
|
return item.Version === version |
|
|
|
}) |
|
|
|
let initObj = transObj(versionData)[0] |
|
|
|
let initModelAcc = transObj(versionData)[1] |
|
|
|
let id= transObj(data)[2] |
|
|
|
$('#showInfo').empty() |
|
|
|
let returnArray = [] |
|
|
|
returnArray = transObj(versionData) |
|
|
|
let [initObj,initModelAcc,id] = returnArray |
|
|
|
renderInfo(initObj,initModelAcc,id) |
|
|
|
}) |
|
|
|
} |
|
|
|
@@ -105,9 +159,9 @@ function loadInfo(){ |
|
|
|
html += `<option value="${data[i].Version}">${data[i].Version}</option>` |
|
|
|
} |
|
|
|
$('#dropdown').append(html) |
|
|
|
let initObj = transObj(data)[0] |
|
|
|
let initModelAcc = transObj(data)[1] |
|
|
|
let id= transObj(data)[2] |
|
|
|
let returnArray = [] |
|
|
|
returnArray = transObj(data) |
|
|
|
let [initObj,initModelAcc,id] = returnArray |
|
|
|
renderInfo(initObj,initModelAcc,id) |
|
|
|
}) |
|
|
|
} |
|
|
|
@@ -155,12 +209,14 @@ function tranSize(value){ |
|
|
|
size=size.toFixed(2);//保留的小数位数 |
|
|
|
return size+unitArr[index]; |
|
|
|
} |
|
|
|
function editorFn(text,id){ |
|
|
|
function editorFn(context){ |
|
|
|
let id= context.dataset.id |
|
|
|
let text = context.dataset.desc |
|
|
|
$('#edit-td').replaceWith("<div id='edit-div' style='width:80%;display: inline-block;'><textarea id='textarea-value' rows='3' maxlength='255' style='width:80%;' id='edit-text'></textarea><i class='check icon' style='color: #50d4ab;' onclick='editorSure(\"" + text + "\",\"" + id + "\")'></i><i class='times icon' style='color: #f66f6a;' onclick='editorCancel(\"" + text + "\",\"" + id + "\")'></i></div>"); |
|
|
|
|
|
|
|
} |
|
|
|
function editorCancel(text,id){ |
|
|
|
$('#edit-div').replaceWith('<div id="edit-td" style="display:flex;"><span title="\'' + text + '\'" class="iword-elipsis">'+text+'</span><i class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(\'' + text + '\',\'' + id + '\')"></div>') |
|
|
|
$('#edit-div').replaceWith(`<div id="edit-td" style="display:flex;"><span id="Description" title="${text}" class="iword-elipsis">${text}</span><i id="edit-pencil" data-id="${id}" data-desc="${text}" class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(this)"></div>`) |
|
|
|
} |
|
|
|
function editorSure(text,id){ |
|
|
|
let description=$('#textarea-value').val() |
|
|
|
@@ -173,46 +229,66 @@ function editorSure(text,id){ |
|
|
|
type:'PUT', |
|
|
|
data:data |
|
|
|
}).done((res)=>{ |
|
|
|
$('#edit-div').replaceWith('<div id="edit-td" style="display:flex;"><span title="\'' + description + '\'" class="iword-elipsis">'+description+'</span><i class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(\'' + description + '\',\'' + id + '\')"></div>') |
|
|
|
$('#edit-div').replaceWith(`<div id="edit-td" style="display:flex;"><span id="Description" title="${description}" class="iword-elipsis">${description}</span><i id="edit-pencil" data-id="${id}" data-desc="${description}" class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(this)"></div>`) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
function renderInfo(obj,accObj,id){ |
|
|
|
let html = '' |
|
|
|
html += '<div class="half-table">' |
|
|
|
html += '<span class="model_header_text">基本信息</span>' |
|
|
|
html += '<table class="tableStyle" style="margin-top:20px;">' |
|
|
|
html += '<tbody>' |
|
|
|
for(let key in obj){ |
|
|
|
html += '<tr style="font-size: 12px;">' |
|
|
|
html += `<td class="ti-text-form-label text-width80">${key}</td>` |
|
|
|
if(key==="Description"){ |
|
|
|
let description = obj[key] |
|
|
|
html += '<td class="ti-text-form-content" ><div id="edit-td" style="display:flex"><span title="\'' + description + '\'" class="iword-elipsis">'+description+'</span><i class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(\'' + description + '\',\'' + id + '\')"></div></td>' |
|
|
|
$(`#${key}`).text(obj[key]) |
|
|
|
$(`#${key}`).attr("title",obj[key]) |
|
|
|
|
|
|
|
$('#edit-pencil').attr("data-id",id) |
|
|
|
$('#edit-pencil').attr("data-desc",obj[key]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
html += `<td class="ti-text-form-content word-elipsis"><span title="${obj[key]}">${obj[key]}</span></td>` |
|
|
|
$(`#${key}`).text(obj[key]) |
|
|
|
$(`#${key}`).attr("title",obj[key]) |
|
|
|
} |
|
|
|
html += '</tr>' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
html += '</tbody>' |
|
|
|
html += '</table>' |
|
|
|
html += '</div>' |
|
|
|
html += '<div class="half-table">' |
|
|
|
html += '<span class="model_header_text">模型精度</span>' |
|
|
|
html += '<table class="tableStyle" style="margin-top:20px;">' |
|
|
|
html += '<tbody>' |
|
|
|
for(let key in accObj){ |
|
|
|
html += '<tr style="font-size: 12px;">' |
|
|
|
html += `<td class="ti-text-form-label text-width80">${key}</td>` |
|
|
|
html += `<td class="ti-text-form-content word-elipsis">${accObj[key]}</td>` |
|
|
|
html += '</tr>' |
|
|
|
} |
|
|
|
html += '</tbody>' |
|
|
|
html += '</table>' |
|
|
|
html += '</div>' |
|
|
|
html += '<div style="clear: both;"></div>' |
|
|
|
$('#showInfo').append(html) |
|
|
|
$(`#${key}`).text(accObj[key]) |
|
|
|
$(`#${key}`).attr("title",accObj[key]) |
|
|
|
} |
|
|
|
// let html = '' |
|
|
|
// html += '<div class="half-table">' |
|
|
|
// html += '<span class="model_header_text">基本信息</span>' |
|
|
|
// html += '<table class="tableStyle" style="margin-top:20px;">' |
|
|
|
// html += '<tbody>' |
|
|
|
// for(let key in obj){ |
|
|
|
// html += '<tr style="font-size: 12px;">' |
|
|
|
// html += `<td class="ti-text-form-label text-width80">${key}</td>` |
|
|
|
// if(key==="Description"){ |
|
|
|
// let description = obj[key] |
|
|
|
// html += '<td class="ti-text-form-content" ><div id="edit-td" style="display:flex"><span title="\'' + description + '\'" class="iword-elipsis">'+description+'</span><i class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(\'' + description + '\',\'' + id + '\')"></div></td>' |
|
|
|
// }else{ |
|
|
|
// html += `<td class="ti-text-form-content word-elipsis"><span title="${obj[key]}">${obj[key]}</span></td>` |
|
|
|
// } |
|
|
|
// html += '</tr>' |
|
|
|
// } |
|
|
|
|
|
|
|
// html += '</tbody>' |
|
|
|
// html += '</table>' |
|
|
|
// html += '</div>' |
|
|
|
// html += '<div class="half-table">' |
|
|
|
// html += '<span class="model_header_text">模型精度</span>' |
|
|
|
// html += '<table class="tableStyle" style="margin-top:20px;">' |
|
|
|
// html += '<tbody>' |
|
|
|
// for(let key in accObj){ |
|
|
|
// html += '<tr style="font-size: 12px;">' |
|
|
|
// html += `<td class="ti-text-form-label text-width80">${key}</td>` |
|
|
|
// html += `<td class="ti-text-form-content word-elipsis">${accObj[key]}</td>` |
|
|
|
// html += '</tr>' |
|
|
|
// } |
|
|
|
// html += '</tbody>' |
|
|
|
// html += '</table>' |
|
|
|
// html += '</div>' |
|
|
|
// html += '<div style="clear: both;"></div>' |
|
|
|
// $('#showInfo').append(html) |
|
|
|
} |
|
|
|
|
|
|
|
</script> |