Showing
2 changed files
with
29 additions
and
9 deletions
| ... | ... | @@ -107,6 +107,13 @@ export function addScanItem(query) { | 
| 107 | 107 | }); | 
| 108 | 108 | } | 
| 109 | 109 | |
| 110 | +export function deleteScanItem(id) { | |
| 111 | + return request({ | |
| 112 | + url: "/scanItem/" + id, | |
| 113 | + method: "DELETE", | |
| 114 | + }); | |
| 115 | +} | |
| 116 | + | |
| 110 | 117 | export function editScanSpec(query) { | 
| 111 | 118 | return request({ | 
| 112 | 119 | url: "/scanSpec", | ... | ... | 
| ... | ... | @@ -91,7 +91,7 @@ | 
| 91 | 91 | > | 
| 92 | 92 | <el-row :gutter="10" class="mb8"> | 
| 93 | 93 | <el-col :span="1.5"> | 
| 94 | - <el-button type="primary" plain icon="Plus" @click="addTask" | |
| 94 | + <el-button type="primary" plain :disabled="detailData.status !== 'ONGOING'" icon="Plus" @click="addTask" | |
| 95 | 95 | >新增</el-button | 
| 96 | 96 | > | 
| 97 | 97 | </el-col> | 
| ... | ... | @@ -146,24 +146,23 @@ | 
| 146 | 146 | </template> | 
| 147 | 147 | </el-table-column> | 
| 148 | 148 | |
| 149 | - <!-- <el-table-column | |
| 150 | - label="Operation" | |
| 149 | + <el-table-column | |
| 150 | + label="操作" | |
| 151 | 151 | fixed="right" | 
| 152 | 152 | align="center" | 
| 153 | 153 | class-name="small-padding fixed-width" | 
| 154 | 154 | > | 
| 155 | 155 | <template #default="scope"> | 
| 156 | - <el-tooltip content="Detail" placement="top"> | |
| 156 | + <el-tooltip content="删除" placement="top"> | |
| 157 | 157 | <el-button | 
| 158 | 158 | link | 
| 159 | 159 | type="primary" | 
| 160 | - @click="enterDetail(scope.row)" | |
| 161 | - v-hasPermi="['system:role:edit']" | |
| 162 | - >Detail</el-button | |
| 160 | + @click="delItem(scope.row)" | |
| 161 | + >删除</el-button | |
| 163 | 162 | > | 
| 164 | 163 | </el-tooltip> | 
| 165 | 164 | </template> | 
| 166 | - </el-table-column> --> | |
| 165 | + </el-table-column> | |
| 167 | 166 | </el-table> | 
| 168 | 167 | |
| 169 | 168 | <pagination | 
| ... | ... | @@ -243,7 +242,7 @@ import { getToken } from "@/utils/auth"; | 
| 243 | 242 | import { formatDate } from "@/utils/index"; | 
| 244 | 243 | |
| 245 | 244 | import { onMounted, ref } from "vue"; | 
| 246 | -import { addScanItem, scanTaskdetal, scanTaskQueryList, } from "@/api/system/scan"; | |
| 245 | +import { addScanItem, scanTaskdetal, scanTaskQueryList,deleteScanItem } from "@/api/system/scan"; | |
| 247 | 246 | |
| 248 | 247 | const router = useRouter(); | 
| 249 | 248 | const route = useRoute(); | 
| ... | ... | @@ -349,6 +348,20 @@ const addTask = () => { | 
| 349 | 348 | open.value = true | 
| 350 | 349 | } | 
| 351 | 350 | |
| 351 | +const delItem = (row) => { | |
| 352 | + proxy.$modal | |
| 353 | + .confirm("确认删除?") | |
| 354 | + .then(() => { | |
| 355 | + deleteScanItem(row.id).then((response) => { | |
| 356 | + proxy.$modal.msgSuccess("删除成功!"); | |
| 357 | + getList(); | |
| 358 | + }); | |
| 359 | + }) | |
| 360 | + .catch(() => { | |
| 361 | + proxy.$modal.msgWarning("已取消"); | |
| 362 | + }); | |
| 363 | +}; | |
| 364 | + | |
| 352 | 365 | const handleExportDiff = () => { | 
| 353 | 366 | proxy.download( | 
| 354 | 367 | "/scanSpec/difference/export", | ... | ... | 
Please
register
or
login
to post a comment