diff --git a/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.html b/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.html index 0670642..3c9cfef 100644 --- a/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.html +++ b/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.html @@ -70,9 +70,9 @@ v-show = "userVulnRole != 'manufacturer' "> <i class="el-icon-delete"></i> </span> - <!--<span class="icon-bg"@click="handleDownload(scope.row)">--> - <!-- <i class="el-icon-download" title="下载"></i>--> - <!--</span>--> + <span class="icon-bg"@click="handleDownload(scope.row)"> + <i class="el-icon-download" title="下载"></i> + </span> </div> </template> </cm-table-page> @@ -113,7 +113,21 @@ <!--<el-form-item label="修复建议" prop="repairSuggestions">--> <!-- <el-input type="textarea" v-model="docForm.repairSuggestions"></el-input>--> <!--</el-form-item>--> - + <el-form-item label="" prop="remark"> + <el-upload + ref="upload" + action="#" + :limit="1" + :on-exceed="handleExceed" + :auto-upload="false" + accept=".doc,.docx,.txt,.xls,.xlsx,.pdf" + :on-change="handleUploadChange" + > + <template #trigger> + <el-button type="primary">上 传 附 件</el-button> + </template> + </el-upload> + </el-form-item> <el-form-item> <el-button :size="$global.elementConfig.size.button" @click="addFolder('ruleForm')" type="primary"> diff --git a/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js b/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js index f6685f9..61cf68a 100644 --- a/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js +++ b/hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js @@ -63,11 +63,13 @@ export default { level:'', remark:'', impactSite:'', - repairSuggestions:'' + repairSuggestions:'', + file:'' } } // 保存漏洞 const addFolder = ()=>{ + // console.log(docForm.value); ruleForm.value.validate((validate)=>{ if (validate){ proxy.$http.post('/api-web/vulnerabilities/save', docForm.value, function (res) { @@ -78,11 +80,23 @@ export default { docForm.value.remark = ''; docForm.value.impactSite = ''; docForm.value.repairSuggestions = ''; + docForm.value.file = ""; }) } }) } + let upload = Vue.ref(); + //文件选中时自动替换上一个文件 + const handleExceed = (files)=>{ + upload.value.clearFiles() + const file = files[0] + upload.value.handleStart(file) + } + const handleUploadChange = (uploadFile)=>{ + docForm.value.file = uploadFile.raw; + } + let docForm = Vue.ref({ name:'', level:'', @@ -90,6 +104,7 @@ export default { remark:'', impactSite:'', repairSuggestions:'', + file:'' }) let docRulesForm = Vue.ref({ name:[ @@ -200,6 +215,11 @@ export default { } + // 下载文件 + const handleDownload = (row)=>{ + + } + // 获取当前登陆人所属厂商 const getManufacturer = ()=>{ proxy.$http.get('/api-web/vulnerabilities/manufacturer',{}, function (res) { @@ -259,9 +279,13 @@ export default { handleQuery, viewDrawer, detail, - userVulnRole + userVulnRole, // defaultSolveTime, // defaultSolveDate + handleExceed, + upload, + handleUploadChange, + handleDownload, }; }, }