Przeglądaj źródła

mod:修改按钮名称

weieryang 1 rok temu
rodzic
commit
0a3c2dfc86

+ 3 - 3
src/views/admin/activity.vue

@@ -22,8 +22,8 @@
22 22
           <el-input v-model="search" size="small" placeholder="请输入标题" />
23 23
         </template>
24 24
         <template #default="scope">
25
-          <el-button size="small" @click="handleEdit(scope.row)">Edit</el-button>
26
-          <el-button size="small" type="danger" @click="handleDelete(scope.row.id)">Delete</el-button>
25
+          <el-button size="small" @click="handleEdit(scope.row)">编辑</el-button>
26
+          <el-button size="small" type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
27 27
         </template>
28 28
       </el-table-column>
29 29
     </el-table>
@@ -197,7 +197,7 @@ const filterTableData = computed(() =>
197 197
 )
198 198
 
199 199
 const handleEdit = (row: Acitvity) => {
200
-  fileList.value = [];
200
+  fileList.value = [];       
201 201
   ruleForm.title = row.title;
202 202
   ruleForm.content = row.content;
203 203
   ruleForm.file = row.file.split(',');

+ 3 - 3
src/views/admin/article.vue

@@ -24,8 +24,8 @@
24 24
           <el-input v-model="search" size="small" placeholder="请输入标题" />
25 25
         </template>
26 26
         <template #default="scope">
27
-          <el-button size="small" @click="handleEdit(scope.row)">Edit</el-button>
28
-          <el-button size="small" type="danger" @click="handleDelete(scope.row.id)">Delete</el-button>
27
+          <el-button size="small" @click="handleEdit(scope.row)">编辑</el-button>
28
+          <el-button size="small" type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
29 29
         </template>
30 30
       </el-table-column>
31 31
     </el-table>
@@ -261,7 +261,7 @@ const handleEdit = (row: any) => {
261 261
 }
262 262
 const handleDelete = (id: number) => {
263 263
   ElMessageBox.confirm(
264
-    '确定删除该活动吗?',
264
+    '确定删除该文章吗?',
265 265
     'Warning',
266 266
     {
267 267
       confirmButtonText: '确定',

+ 20 - 2
src/views/admin/product.vue

@@ -29,7 +29,7 @@
29 29
 
30 30
                 <template #default="scope">
31 31
                   <el-button size="small" @click="handleEditType(scope.row, '')">修改</el-button>
32
-                  <el-button size="small" type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
32
+                  <el-button size="small" type="danger" @click="handleDeleteType(scope.row.id)">删除</el-button>
33 33
                 </template>
34 34
               </el-table-column>
35 35
             </el-table>
@@ -410,10 +410,28 @@ const handleEdit = (row: any) => {
410 410
 
411 411
 }
412 412
 
413
+const handleDeleteType = (id: number) => {
414
+  ElMessageBox.confirm(
415
+    '确定删除该产品吗?',
416
+    'Warning',
417
+    {
418
+      confirmButtonText: '确定',
419
+      cancelButtonText: '取消',
420
+      type: 'warning',
421
+    }
422
+  )
423
+    .then(async () => {
424
+
425
+      const res: any = await request.delete('/Type/type/' + id);
426
+
427
+      await alterRes(res);
428
+    });
429
+}
430
+
413 431
 
414 432
 const handleDelete = (id: number) => {
415 433
   ElMessageBox.confirm(
416
-    '确定删除该活动吗?',
434
+    '确定删除该产品吗?',
417 435
     'Warning',
418 436
     {
419 437
       confirmButtonText: '确定',