xiongzhu 3 år sedan
förälder
incheckning
5657e51fab

+ 32 - 0
src/main/java/com/izouma/nineth/domain/BonusGiveItem.java

@@ -0,0 +1,32 @@
+package com.izouma.nineth.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Entity;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@Entity
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class BonusGiveItem extends BaseEntity {
+
+    private Long bonusGiveId;
+
+    private Long userId;
+
+    private Long assetId;
+
+    private String assetName;
+
+    private BigDecimal bonus;
+
+    private LocalDateTime destroyTime;
+
+    private Long destroyId;
+}

+ 1 - 1
src/main/java/com/izouma/nineth/listener/OrderNotifyListener.java

@@ -17,7 +17,7 @@ import org.springframework.stereotype.Service;
         consumerGroup = "${general.order-notify-group}",
         topic = "${general.order-notify-topic}",
         consumeMode = ConsumeMode.CONCURRENTLY, consumeThreadMax = 2)
-@ConditionalOnProperty(value = "general.notify-server", havingValue = "true", matchIfMissing = true)
+@ConditionalOnProperty(value = "general.notify-server", havingValue = "true")
 public class OrderNotifyListener implements RocketMQListener<OrderNotifyEvent> {
     private OrderService        orderService;
     private MintOrderService    mintOrderService;

+ 11 - 0
src/main/java/com/izouma/nineth/repo/BonusGiveItemRepo.java

@@ -0,0 +1,11 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.BonusGiveItem;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+import java.util.List;
+
+public interface BonusGiveItemRepo extends JpaRepository<BonusGiveItem, Long>, JpaSpecificationExecutor<BonusGiveItem> {
+    List<BonusGiveItem> findByBonusGiveId(Long bonusGiveId);
+}

+ 16 - 0
src/main/java/com/izouma/nineth/repo/BonusGiveRepo.java

@@ -0,0 +1,16 @@
+package com.izouma.nineth.repo;
+
+import com.izouma.nineth.domain.BonusGive;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+
+import javax.transaction.Transactional;
+
+public interface BonusGiveRepo extends JpaRepository<BonusGive, Long>, JpaSpecificationExecutor<BonusGive> {
+    @Query("update BonusGive t set t.del = true where t.id = ?1")
+    @Modifying
+    @Transactional
+    void softDelete(Long id);
+}

+ 2 - 0
src/main/java/com/izouma/nineth/repo/DestroyRecordRepo.java

@@ -20,4 +20,6 @@ public interface DestroyRecordRepo extends JpaRepository<DestroyRecord, Long>, J
     @Query(nativeQuery = true, value = "SELECT user.avatar avatar,user.nickname nickname,sum( destroy_record.record ) num FROM destroy_record LEFT JOIN user ON destroy_record.user_id = user.id WHERE destroy_record.asset_id IN ( SELECT asset.id FROM asset LEFT JOIN blind_box_item ON asset.collection_id = blind_box_item.collection_id where blind_box_item.blind_box_id = ?1 )" +
             "and destroy_record.name like ?2 and destroy_record.name not like ?3 and destroy_record.created_at > ?4 GROUP BY destroy_record.user_id ORDER BY sum( destroy_record.record ) DESC")
     List<Map<String, String>> destroyRecordRank(Long blindBoxId, String rare, String not, LocalDateTime countDateTime);
+
+    List<DestroyRecord> findByCreatedAtBetween(LocalDateTime start, LocalDateTime end);
 }

+ 80 - 0
src/main/java/com/izouma/nineth/service/BonusGiveService.java

@@ -0,0 +1,80 @@
+package com.izouma.nineth.service;
+
+import com.izouma.nineth.domain.BonusGive;
+import com.izouma.nineth.domain.BonusGiveItem;
+import com.izouma.nineth.domain.DestroyRecord;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.enums.BalanceType;
+import com.izouma.nineth.repo.BonusGiveItemRepo;
+import com.izouma.nineth.repo.BonusGiveRepo;
+import com.izouma.nineth.repo.DestroyRecordRepo;
+import com.izouma.nineth.utils.JpaUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.stereotype.Service;
+
+import javax.transaction.Transactional;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+@Service
+@AllArgsConstructor
+public class BonusGiveService {
+
+    private BonusGiveRepo      bonusGiveRepo;
+    private BonusGiveItemRepo  bonusGiveItemRepo;
+    private DestroyRecordRepo  destroyRecordRepo;
+    private UserBalanceService userBalanceService;
+
+    public Page<BonusGive> all(PageQuery pageQuery) {
+        return bonusGiveRepo.findAll(JpaUtils.toSpecification(pageQuery, BonusGive.class), JpaUtils.toPageRequest(pageQuery));
+    }
+
+    public List<BonusGiveItem> preview(BonusGive bonusGive) {
+        Objects.requireNonNull(bonusGive, "bonusGive is null");
+        Objects.requireNonNull(bonusGive.getPattern(), "bonusGive.pattern is null");
+        Objects.requireNonNull(bonusGive.getStartTime(), "bonusGive.startTime is null");
+        Objects.requireNonNull(bonusGive.getEndTime(), "bonusGive.endTime is null");
+
+        List<DestroyRecord> destroyRecords = destroyRecordRepo.findByCreatedAtBetween(bonusGive.getStartTime(), bonusGive.getEndTime());
+        Pattern pattern = Pattern.compile(bonusGive.getPattern());
+        List<Long> ids = new ArrayList<>();
+        return destroyRecords.stream()
+                .filter(destroyRecord -> {
+                    if (ids.contains(destroyRecord.getAssetId())) {
+                        return false;
+                    }
+                    ids.add(destroyRecord.getAssetId());
+                    Matcher matcher = pattern.matcher(destroyRecord.getName());
+                    return matcher.matches();
+                })
+                .map(destroyRecord -> BonusGiveItem.builder()
+                        .bonusGiveId(bonusGive.getId())
+                        .userId(destroyRecord.getUserId())
+                        .assetId(destroyRecord.getAssetId())
+                        .assetName(destroyRecord.getName())
+                        .bonus(bonusGive.getBonus())
+                        .destroyId(destroyRecord.getId())
+                        .destroyTime(destroyRecord.getCreatedAt())
+                        .build())
+                .collect(Collectors.toList());
+    }
+
+    @Transactional
+    public BonusGive save(BonusGive bonusGive) {
+        List<BonusGiveItem> bonusGiveItems = preview(bonusGive);
+        bonusGiveRepo.save(bonusGive);
+        bonusGiveItems.forEach(bonusGiveItem -> bonusGiveItem.setBonusGiveId(bonusGive.getId()));
+        bonusGiveItemRepo.saveAll(bonusGiveItems);
+
+        bonusGiveItems.stream().parallel().forEach(bonusGiveItem -> {
+            userBalanceService.modifyBalance(bonusGiveItem.getUserId(), bonusGiveItem.getBonus(), BalanceType.BONUS, null, false, null);
+        });
+
+        return bonusGive;
+    }
+}

+ 69 - 0
src/main/java/com/izouma/nineth/web/BonusGiveController.java

@@ -0,0 +1,69 @@
+package com.izouma.nineth.web;
+
+import com.izouma.nineth.domain.BonusGive;
+import com.izouma.nineth.domain.BonusGiveItem;
+import com.izouma.nineth.repo.BonusGiveItemRepo;
+import com.izouma.nineth.service.BonusGiveService;
+import com.izouma.nineth.dto.PageQuery;
+import com.izouma.nineth.exception.BusinessException;
+import com.izouma.nineth.repo.BonusGiveRepo;
+import com.izouma.nineth.utils.ObjUtils;
+import com.izouma.nineth.utils.excel.ExcelUtils;
+import lombok.AllArgsConstructor;
+import org.springframework.data.domain.Page;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+@RestController
+@RequestMapping("/bonusGive")
+@AllArgsConstructor
+public class BonusGiveController extends BaseController {
+    private BonusGiveService  bonusGiveService;
+    private BonusGiveRepo     bonusGiveRepo;
+    private BonusGiveItemRepo bonusGiveItemRepo;
+
+    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/save")
+    public BonusGive save(@RequestBody BonusGive record) {
+        return bonusGiveService.save(record);
+    }
+
+
+    @PreAuthorize("hasRole('ADMIN')")
+    @PostMapping("/all")
+    public Page<BonusGive> all(@RequestBody PageQuery pageQuery) {
+        return bonusGiveService.all(pageQuery);
+    }
+
+    @GetMapping("/get/{id}")
+    public BonusGive get(@PathVariable Long id) {
+        return bonusGiveRepo.findById(id).orElseThrow(new BusinessException("无记录"));
+    }
+
+    @PostMapping("/del/{id}")
+    public void del(@PathVariable Long id) {
+        bonusGiveRepo.softDelete(id);
+    }
+
+    @GetMapping("/excel")
+    @ResponseBody
+    public void excel(HttpServletResponse response, PageQuery pageQuery) throws IOException {
+        List<BonusGive> data = all(pageQuery).getContent();
+        ExcelUtils.export(response, data);
+    }
+
+    @PostMapping("/preview")
+    public List<BonusGiveItem> preview(@RequestBody BonusGive bonusGive) {
+        return bonusGiveService.preview(bonusGive);
+    }
+
+    @GetMapping("/items")
+    public List<BonusGiveItem> items(Long bonusGiveId) {
+        return bonusGiveItemRepo.findByBonusGiveId(bonusGiveId);
+    }
+}
+

+ 1 - 0
src/main/resources/genjson/BonusGive.json

@@ -0,0 +1 @@
+{"tableName":"BonusGive","className":"BonusGive","remark":"奖金发放","genTable":true,"genClass":false,"genList":false,"genForm":true,"genRouter":false,"javaPath":"/Users/drew/Projects/Java/raex_back/src/main/java/com/izouma/nineth","viewPath":"/Users/drew/Projects/Java/raex_back/src/main/vue/src/views","routerPath":"/Users/drew/Projects/Java/raex_back/src/main/vue/src","resourcesPath":"/Users/drew/Projects/Java/raex_back/src/main/resources","dataBaseType":"Mysql","fields":[{"name":"name","modelName":"name","remark":"名称","showInList":true,"showInForm":true,"formType":"singleLineText","required":true},{"name":"pattern","modelName":"pattern","remark":"正则","showInList":true,"showInForm":true,"formType":"singleLineText","required":true},{"name":"bonus","modelName":"bonus","remark":"奖金","showInList":true,"showInForm":true,"formType":"number","required":true},{"name":"startTime","modelName":"startTime","remark":"开始时间","showInList":true,"showInForm":true,"formType":"datetime","required":true},{"name":"endTime","modelName":"endTime","remark":"结束时间","showInList":true,"showInForm":true,"formType":"datetime","required":true},{"name":"assetNum","modelName":"assetNum","remark":"藏品数量","showInList":true,"showInForm":false,"formType":"singleLineText"},{"name":"totalBonus","modelName":"totalBonus","remark":"总奖金","showInList":true,"showInForm":false,"formType":"number"}],"readTable":false,"dataSourceCode":"dataSource","genJson":"","subtables":[],"update":false,"basePackage":"com.izouma.nineth","tablePackage":"com.izouma.nineth.domain.BonusGive"}

+ 1 - 1
src/main/vue/.env.development

@@ -1 +1 @@
-VUE_APP_BASE_URL=http://192.168.6.215:8080
+VUE_APP_BASE_URL=http://localhost:8080

+ 17 - 1
src/main/vue/src/router.js

@@ -931,6 +931,22 @@ const router = new Router({
                    meta: {
                       title: '用户持仓统计',
                    },
+               },
+                {
+                    path: '/bonusGiveEdit',
+                    name: 'BonusGiveEdit',
+                    component: () => import(/* webpackChunkName: "bonusGiveEdit" */ '@/views/BonusGiveEdit.vue'),
+                    meta: {
+                       title: '奖金发放编辑',
+                    },
+                },
+                {
+                    path: '/bonusGiveList',
+                    name: 'BonusGiveList',
+                    component: () => import(/* webpackChunkName: "bonusGiveList" */ '@/views/BonusGiveList.vue'),
+                    meta: {
+                       title: '奖金发放',
+                    },
                }
                 /**INSERT_LOCATION**/
             ]
@@ -991,4 +1007,4 @@ router.beforeEach((to, from, next) => {
     }
 });
 
-export default router;
+export default router;

+ 204 - 0
src/main/vue/src/views/BonusGiveEdit.vue

@@ -0,0 +1,204 @@
+<template>
+    <div class="edit-view">
+        <page-title>
+            <el-button @click="$router.go(-1)" :disabled="saving">取消</el-button>
+            <el-button @click="onDelete" :disabled="saving" type="danger" v-if="formData.id">
+                删除
+            </el-button>
+            <el-button @click="onSave" :loading="saving" type="primary">保存</el-button>
+        </page-title>
+        <div class="edit-view__content-wrapper">
+            <div class="edit-view__content-section">
+                <el-form
+                    :model="formData"
+                    :rules="rules"
+                    ref="form"
+                    label-width="80px"
+                    label-position="right"
+                    size="small"
+                    style="max-width: 500px;"
+                >
+                    <el-form-item prop="name" label="名称">
+                        <el-input v-model="formData.name"></el-input>
+                    </el-form-item>
+                    <el-form-item prop="pattern" label="正则">
+                        <el-input v-model="formData.pattern"></el-input>
+                    </el-form-item>
+                    <el-form-item prop="bonus" label="奖金">
+                        <el-input-number type="number" v-model="formData.bonus"></el-input-number>
+                    </el-form-item>
+                    <el-form-item prop="startTime" label="开始时间">
+                        <el-date-picker
+                            v-model="formData.startTime"
+                            type="datetime"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            placeholder="选择日期时间"
+                            default-time="00:00:00"
+                        >
+                        </el-date-picker>
+                    </el-form-item>
+                    <el-form-item prop="endTime" label="结束时间">
+                        <el-date-picker
+                            v-model="formData.endTime"
+                            type="datetime"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            placeholder="选择日期时间"
+                            default-time="23:59:59"
+                        >
+                        </el-date-picker>
+                    </el-form-item>
+                    <el-form-item class="form-submit">
+                        <el-button @click="preview" :loading="previewing" type="primary">
+                            预览
+                        </el-button>
+                    </el-form-item>
+                </el-form>
+            </div>
+        </div>
+        <el-dialog title="预览" :visible.sync="showPreview" top="5vh">
+            <el-table :data="previewList" height="calc(85vh - 190px)">
+                <el-table-column label="#" type="index" width="80"></el-table-column>
+                <el-table-column label="用户ID" prop="userId" width="100"></el-table-column>
+                <el-table-column label="藏品ID" prop="assetId" width="100"></el-table-column>
+                <el-table-column label="藏品名称" prop="assetName" show-overflow-tooltip></el-table-column>
+                <el-table-column label="销毁时间" prop="destroyTime" width="150"></el-table-column>
+                <el-table-column label="销毁ID" prop="destroyId" width="100"></el-table-column>
+                <el-table-column label="奖金" prop="bonus" width="100"></el-table-column>
+            </el-table>
+            <div slot="footer">
+                <el-button type="primary" @click="onSave" :loading="saving">确认</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+<script>
+export default {
+    name: 'BonusGiveEdit',
+    created() {
+        if (this.$route.query.id) {
+            this.$http
+                .get('bonusGive/get/' + this.$route.query.id)
+                .then(res => {
+                    this.formData = res;
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.$message.error(e.error);
+                });
+        }
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {},
+            rules: {
+                name: [
+                    {
+                        required: true,
+                        message: '请输入名称',
+                        trigger: 'blur'
+                    }
+                ],
+                pattern: [
+                    {
+                        required: true,
+                        message: '请输入正则',
+                        trigger: 'blur'
+                    }
+                ],
+                bonus: [
+                    {
+                        required: true,
+                        message: '请输入奖金',
+                        trigger: 'blur'
+                    }
+                ],
+                startTime: [
+                    {
+                        required: true,
+                        message: '请输入开始时间',
+                        trigger: 'blur'
+                    }
+                ],
+                endTime: [
+                    {
+                        required: true,
+                        message: '请输入结束时间',
+                        trigger: 'blur'
+                    }
+                ]
+            },
+            showPreview: false,
+            previewList: [],
+            previewing: false
+        };
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate(valid => {
+                if (valid) {
+                    this.$confirm('确定发放奖励吗?', '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        this.submit();
+                    });
+                } else {
+                    return false;
+                }
+            });
+        },
+        submit() {
+            let data = { ...this.formData };
+
+            this.saving = true;
+            this.$http
+                .post('/bonusGive/save', data, { body: 'json' })
+                .then(res => {
+                    this.saving = false;
+                    this.$message.success('成功');
+                    this.$router.go(-1);
+                })
+                .catch(e => {
+                    console.log(e);
+                    this.saving = false;
+                    this.$message.error(e.error);
+                });
+        },
+        onDelete() {
+            this.$confirm('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
+                .then(() => {
+                    return this.$http.post(`/bonusGive/del/${this.formData.id}`);
+                })
+                .then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                })
+                .catch(e => {
+                    if (e !== 'cancel') {
+                        console.log(e);
+                        this.$message.error((e || {}).error || '删除失败');
+                    }
+                });
+        },
+        preview() {
+            this.$refs.form.validate().then(() => {
+                this.previewing = true;
+                this.previewList = [];
+                this.$http
+                    .post('/bonusGive/preview', this.formData, { body: 'json' })
+                    .then(res => {
+                        this.previewing = false;
+                        this.previewList = res;
+                        this.showPreview = true;
+                    })
+                    .catch(e => {
+                        this.previewing = false;
+                    });
+            });
+        }
+    }
+};
+</script>
+<style lang="less" scoped></style>

+ 181 - 0
src/main/vue/src/views/BonusGiveList.vue

@@ -0,0 +1,181 @@
+<template>
+    <div  class="list-view">
+        <page-title>
+            <el-button @click="addRow" type="primary" icon="el-icon-plus" :disabled="fetchingData || downloading" class="filter-item">
+                新增
+            </el-button>
+            <el-button @click="download" icon="el-icon-upload2" :loading="downloading" :disabled="fetchingData" class="filter-item">
+                导出
+            </el-button>
+        </page-title>
+        <div class="filters-container">
+            <el-input
+                    placeholder="搜索..."
+                    v-model="search"
+                    clearable
+                    class="filter-item search"
+                    @keyup.enter.native="getData"
+            >
+                <el-button @click="getData" slot="append" icon="el-icon-search"> </el-button>
+            </el-input>
+        </div>
+        <el-table :data="tableData" row-key="id" ref="table"
+                  header-row-class-name="table-header-row"
+                  header-cell-class-name="table-header-cell"
+                  row-class-name="table-row" cell-class-name="table-cell"
+                  :height="tableHeight" v-loading="fetchingData">
+            <el-table-column v-if="multipleMode" align="center" type="selection"
+                             width="50">
+            </el-table-column>
+            <el-table-column prop="id" label="ID" width="100">
+            </el-table-column>
+                                <el-table-column prop="name" label="名称"
+>
+                    </el-table-column>
+                    <el-table-column prop="pattern" label="正则"
+>
+                    </el-table-column>
+                    <el-table-column prop="bonus" label="奖金"
+>
+                    </el-table-column>
+                    <el-table-column prop="startTime" label="开始时间"
+>
+                    </el-table-column>
+                    <el-table-column prop="endTime" label="结束时间"
+>
+                    </el-table-column>
+                    <el-table-column prop="assetNum" label="藏品数量"
+>
+                    </el-table-column>
+                    <el-table-column prop="totalBonus" label="总奖金"
+>
+                    </el-table-column>
+            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    width="150">
+                <template slot-scope="{row}">
+                    <el-button @click="editRow(row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <!-- <div class="multiple-mode-wrapper">
+                <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button @click="operation1">批量操作1</el-button>
+                    <el-button @click="operation2">批量操作2</el-button>
+                    <el-button @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div> -->
+            <el-pagination background @size-change="onSizeChange"
+                           @current-change="onCurrentChange" :current-page="page"
+                           :page-sizes="[10, 20, 30, 40, 50]" :page-size="pageSize"
+                           layout="total, sizes, prev, pager, next, jumper"
+                           :total="totalElements">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+<script>
+    import { mapState } from "vuex";
+    import pageableTable from "@/mixins/pageableTable";
+
+    export default {
+        name: 'BonusGiveList',
+        mixins: [pageableTable],
+        data() {
+            return {
+                multipleMode: false,
+                search: "",
+                url: "/bonusGive/all",
+                downloading: false,
+            }
+        },
+        computed: {
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            beforeGetData() {
+                return { search: this.search, query: { del: false } };
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            addRow() {
+                this.$router.push({
+                    path: "/bonusGiveEdit",
+                    query: {
+                        ...this.$route.query
+                    }
+                });
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: "/bonusGiveEdit",
+                    query: {
+                    id: row.id
+                    }
+                });
+            },
+            download() {
+                this.downloading = true;
+                this.$axios
+                    .get("/bonusGive/excel", { 
+                        responseType: "blob",
+                        params: { size: 10000 }
+                    })
+                    .then(res => {
+                        console.log(res);
+                        this.downloading = false;
+                        const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
+                        const link = document.createElement("a");
+                        link.href = downloadUrl;
+                        link.setAttribute(
+                            "download",
+                            res.headers["content-disposition"].split("filename=")[1]
+                        );
+                        document.body.appendChild(link);
+                        link.click();
+                        link.remove();
+                    })
+                    .catch(e => {
+                        console.log(e);
+                        this.downloading = false;
+                        this.$message.error(e.error);
+                    });
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post(`/bonusGive/del/${row.id}`)
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(e => {
+                    if (e !== 'cancel') {
+                        this.$message.error(e.error);
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>