From a6ee2d4bcd897839ef6401d7b5cff22adb1184f7 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Mon, 6 Dec 2021 18:37:50 +0800 Subject: [PATCH] fix issue --- templates/repo/modelmanage/showinfo.tmpl | 54 +++++++++++++++++++++--- web_src/js/components/Model.vue | 6 +-- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/templates/repo/modelmanage/showinfo.tmpl b/templates/repo/modelmanage/showinfo.tmpl index 6c4799373..a4ef84ebc 100644 --- a/templates/repo/modelmanage/showinfo.tmpl +++ b/templates/repo/modelmanage/showinfo.tmpl @@ -24,6 +24,7 @@ .ti-text-form-content { line-height: 30px; padding-bottom: 20px; + width: 100%; } .change-version{ min-width: auto !important; @@ -48,6 +49,13 @@ width:100%; table-layout: fixed; } + .iword-elipsis{ + display: inline-block; + width: 80%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + }

@@ -80,9 +88,10 @@ function changeInfo(version){ }) let initObj = transObj(versionData)[0] let initModelAcc = transObj(versionData)[1] + let id= transObj(data)[2] console.log("=======",initObj,initModelAcc) $('#showInfo').empty() - renderInfo(initObj,initModelAcc) + renderInfo(initObj,initModelAcc,id) }) } function loadInfo(){ @@ -94,11 +103,12 @@ function loadInfo(){ $('#dropdown').append(html) let initObj = transObj(data)[0] let initModelAcc = transObj(data)[1] - renderInfo(initObj,initModelAcc) + let id= transObj(data)[2] + renderInfo(initObj,initModelAcc,id) }) } function transObj(data){ - let {Name,Version,Label,Size,Description,CreatedUnix,Accuracy} = data[0] + let {ID,Name,Version,Label,Size,Description,CreatedUnix,Accuracy} = data[0] let modelAcc = JSON.parse(Accuracy) let size = tranSize(Size) let time = transTime(CreatedUnix) @@ -116,7 +126,7 @@ function transObj(data){ Precision:modelAcc.Precision || '--', Recall: modelAcc.Recall || '--' } - return [initObj,initModelAcc] + return [initObj,initModelAcc,ID] } function transTime(time){ @@ -141,7 +151,33 @@ function tranSize(value){ size=size.toFixed(2);//保留的小数位数 return size+unitArr[index]; } -function renderInfo(obj,accObj){ +function editorFn(text,id){ + console.log("----",text,id) + $('#edit-td').replaceWith("
"); + +} +function editorCancel(text){ + $('#edit-div').replaceWith(''+text+'') +} +function editorSure(text,id){ + console.log("-------text,id",id) + + let description=$('#textarea-value').val() + let data = { + ID:id, + Description:description + } + // $.put(`${url}show_model_info_api?name=${ID}`,(data)={ + + // }) + $.ajax({ + url:`${url}modify_model`, + type:'PUT', + data:data + }).done((res)=>{console.log(res)}) + +} +function renderInfo(obj,accObj,id){ let html = '' html += '
' html += '基本信息' @@ -150,7 +186,13 @@ function renderInfo(obj,accObj){ for(let key in obj){ html += '' html += `${key}` - html += `${obj[key]}` + if(key==="Description"){ + let description = obj[key] + html += ''+description+'' + // html += '' + }else{ + html += `${obj[key]}` + } html += '' } diff --git a/web_src/js/components/Model.vue b/web_src/js/components/Model.vue index 49fa6a349..c2839fddb 100644 --- a/web_src/js/components/Model.vue +++ b/web_src/js/components/Model.vue @@ -103,9 +103,9 @@