From ec99bc5b11d3e1ac0bffaf070f416650fad0345e Mon Sep 17 00:00:00 2001 From: maxmon <541182180@qq.com> Date: Wed, 14 Jul 2021 23:39:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fe/src/components/home/index.vue | 38 ++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/fe/src/components/home/index.vue b/fe/src/components/home/index.vue index d2a40d2..5d4ba7a 100644 --- a/fe/src/components/home/index.vue +++ b/fe/src/components/home/index.vue @@ -52,6 +52,7 @@

(请选择包含文本文件的zip、tar文件)

+

@@ -122,6 +123,30 @@ export default { setType (ev) { this.projectType = ev.target.value }, + del () { + // 删除项目 + const that = this + if (prompt(`请输入${this.projectName}来确认删除。`) === this.projectName) { + get(`/v1/project/delete_program?projectName=${this.projectName}`, function () { + that.init() + }) + } else { + alert('输入错误,删除失败') + } + }, + init () { + // 初始化主页列表 + const that = this + that.type = '' + that.projectName = '' + // 查询项目信息 + get('/v1/index', function (info) { + that.$set(that, 'projects', info) + that.projectName = '' + that.projectType = '' + that.page = 'list' + }) + }, submit () { const that = this const newEntityTypes = that.typeList.map((type) => { @@ -136,15 +161,7 @@ export default { projectType: that.projectType, entityTypes: JSON.stringify(newEntityTypes) }, function () { - that.type = '' - that.projectName = '' - // 查询项目信息 - get('/v1/index', function (info) { - that.$set(that, 'projects', info) - that.projectName = '' - that.projectType = '' - that.page = 'list' - }) + that.init() // 如果有上传文件就更新文件 const fileInputElement = document.getElementById('file-input') if (fileInputElement.files[0]) { @@ -281,6 +298,9 @@ export default { border: 1px solid #ccc; padding: 5px 10px; } +.button.danger { + background-color: #ff0000; +} .project-box-titile { margin: auto; width: 500px;