Commit a7fa37be8ea55ccca6d76ddb058d54d6c169fb4f

Authored by Dunfa Jiang
1 parent f27ee8c4

feat:增加任务详情删除和新增按钮权限判断

@@ -107,6 +107,13 @@ export function addScanItem(query) { @@ -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 export function editScanSpec(query) { 117 export function editScanSpec(query) {
111 return request({ 118 return request({
112 url: "/scanSpec", 119 url: "/scanSpec",
@@ -91,7 +91,7 @@ @@ -91,7 +91,7 @@
91 > 91 >
92 <el-row :gutter="10" class="mb8"> 92 <el-row :gutter="10" class="mb8">
93 <el-col :span="1.5"> 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 >新增</el-button 95 >新增</el-button
96 > 96 >
97 </el-col> 97 </el-col>
@@ -146,24 +146,23 @@ @@ -146,24 +146,23 @@
146 </template> 146 </template>
147 </el-table-column> 147 </el-table-column>
148 148
149 - <!-- <el-table-column  
150 - label="Operation" 149 + <el-table-column
  150 + label="操作"
151 fixed="right" 151 fixed="right"
152 align="center" 152 align="center"
153 class-name="small-padding fixed-width" 153 class-name="small-padding fixed-width"
154 > 154 >
155 <template #default="scope"> 155 <template #default="scope">
156 - <el-tooltip content="Detail" placement="top"> 156 + <el-tooltip content="删除" placement="top">
157 <el-button 157 <el-button
158 link 158 link
159 type="primary" 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 </el-tooltip> 163 </el-tooltip>
165 </template> 164 </template>
166 - </el-table-column> --> 165 + </el-table-column>
167 </el-table> 166 </el-table>
168 167
169 <pagination 168 <pagination
@@ -243,7 +242,7 @@ import { getToken } from "@/utils/auth"; @@ -243,7 +242,7 @@ import { getToken } from "@/utils/auth";
243 import { formatDate } from "@/utils/index"; 242 import { formatDate } from "@/utils/index";
244 243
245 import { onMounted, ref } from "vue"; 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 const router = useRouter(); 247 const router = useRouter();
249 const route = useRoute(); 248 const route = useRoute();
@@ -349,6 +348,20 @@ const addTask = () => { @@ -349,6 +348,20 @@ const addTask = () => {
349 open.value = true 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 const handleExportDiff = () => { 365 const handleExportDiff = () => {
353 proxy.download( 366 proxy.download(
354 "/scanSpec/difference/export", 367 "/scanSpec/difference/export",
Please register or login to post a comment