|
@@ -1,6 +1,13 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
|
+ <el-form
|
|
|
|
+ :model="queryParams"
|
|
|
|
+ ref="queryForm"
|
|
|
|
+ size="small"
|
|
|
|
+ :inline="true"
|
|
|
|
+ v-show="showSearch"
|
|
|
|
+ label-width="68px"
|
|
|
|
+ >
|
|
<el-form-item label="steamId" prop="steamId">
|
|
<el-form-item label="steamId" prop="steamId">
|
|
<el-input
|
|
<el-input
|
|
v-model="queryParams.steamId"
|
|
v-model="queryParams.steamId"
|
|
@@ -50,8 +57,16 @@
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-search"
|
|
|
|
+ size="mini"
|
|
|
|
+ @click="handleQuery"
|
|
|
|
+ >搜索</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
|
+ >重置</el-button
|
|
|
|
+ >
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
@@ -64,7 +79,8 @@
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
@click="handleAdd"
|
|
v-hasPermi="['system:count:add']"
|
|
v-hasPermi="['system:count:add']"
|
|
- >新增</el-button>
|
|
|
|
|
|
+ >新增</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
@@ -75,7 +91,8 @@
|
|
:disabled="single"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
@click="handleUpdate"
|
|
v-hasPermi="['system:count:edit']"
|
|
v-hasPermi="['system:count:edit']"
|
|
- >修改</el-button>
|
|
|
|
|
|
+ >修改</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
@@ -86,7 +103,8 @@
|
|
:disabled="multiple"
|
|
:disabled="multiple"
|
|
@click="handleDelete"
|
|
@click="handleDelete"
|
|
v-hasPermi="['system:count:remove']"
|
|
v-hasPermi="['system:count:remove']"
|
|
- >删除</el-button>
|
|
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
<el-button
|
|
@@ -96,12 +114,20 @@
|
|
size="mini"
|
|
size="mini"
|
|
@click="handleExport"
|
|
@click="handleExport"
|
|
v-hasPermi="['system:count:export']"
|
|
v-hasPermi="['system:count:export']"
|
|
- >导出</el-button>
|
|
|
|
|
|
+ >导出</el-button
|
|
|
|
+ >
|
|
</el-col>
|
|
</el-col>
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
|
+ <right-toolbar
|
|
|
|
+ :showSearch.sync="showSearch"
|
|
|
|
+ @queryTable="getList"
|
|
|
|
+ ></right-toolbar>
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="countList" @selection-change="handleSelectionChange">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="countList"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ >
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
<!--<el-table-column label="Id" align="center" prop="id" />-->
|
|
<!--<el-table-column label="Id" align="center" prop="id" />-->
|
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
|
<el-table-column type="index" label="序号" width="60" align="center" />
|
|
@@ -111,7 +137,11 @@
|
|
<el-table-column label="卡池id" align="center" prop="poolId" />
|
|
<el-table-column label="卡池id" align="center" prop="poolId" />
|
|
<el-table-column label="卡池名称" align="center" prop="poolName" />
|
|
<el-table-column label="卡池名称" align="center" prop="poolName" />
|
|
<el-table-column label="剩余抽奖次数" align="center" prop="count" />
|
|
<el-table-column label="剩余抽奖次数" align="center" prop="count" />
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="操作"
|
|
|
|
+ align="center"
|
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
|
+ >
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
@@ -119,20 +149,22 @@
|
|
icon="el-icon-edit"
|
|
icon="el-icon-edit"
|
|
@click="handleUpdate(scope.row)"
|
|
@click="handleUpdate(scope.row)"
|
|
v-hasPermi="['system:count:edit']"
|
|
v-hasPermi="['system:count:edit']"
|
|
- >修改</el-button>
|
|
|
|
|
|
+ >修改</el-button
|
|
|
|
+ >
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
icon="el-icon-delete"
|
|
icon="el-icon-delete"
|
|
@click="handleDelete(scope.row)"
|
|
@click="handleDelete(scope.row)"
|
|
v-hasPermi="['system:count:remove']"
|
|
v-hasPermi="['system:count:remove']"
|
|
- >删除</el-button>
|
|
|
|
|
|
+ >删除</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
|
<pagination
|
|
<pagination
|
|
- v-show="total>0"
|
|
|
|
|
|
+ v-show="total > 0"
|
|
:total="total"
|
|
:total="total"
|
|
:page.sync="queryParams.pageNum"
|
|
:page.sync="queryParams.pageNum"
|
|
:limit.sync="queryParams.pageSize"
|
|
:limit.sync="queryParams.pageSize"
|
|
@@ -140,7 +172,13 @@
|
|
/>
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改抽奖次数对话框 -->
|
|
<!-- 添加或修改抽奖次数对话框 -->
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ :title="title"
|
|
|
|
+ :visible.sync="open"
|
|
|
|
+ width="500px"
|
|
|
|
+ append-to-body
|
|
|
|
+ :before-close="(done) => handleDialogClose(done)"
|
|
|
|
+ >
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
<el-form-item label="steamId" prop="steamId">
|
|
<el-form-item label="steamId" prop="steamId">
|
|
<el-input v-model="form.steamId" placeholder="请输入steamId" />
|
|
<el-input v-model="form.steamId" placeholder="请输入steamId" />
|
|
@@ -170,7 +208,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { listCount, getCount, delCount, addCount, updateCount } from "@/api/system/count";
|
|
|
|
|
|
+import {
|
|
|
|
+ listCount,
|
|
|
|
+ getCount,
|
|
|
|
+ delCount,
|
|
|
|
+ addCount,
|
|
|
|
+ updateCount,
|
|
|
|
+} from "@/api/system/count";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Count",
|
|
name: "Count",
|
|
@@ -203,13 +247,12 @@ export default {
|
|
steamName: null,
|
|
steamName: null,
|
|
poolId: null,
|
|
poolId: null,
|
|
poolName: null,
|
|
poolName: null,
|
|
- count: null
|
|
|
|
|
|
+ count: null,
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
- rules: {
|
|
|
|
- }
|
|
|
|
|
|
+ rules: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -219,7 +262,7 @@ export default {
|
|
/** 查询抽奖次数列表 */
|
|
/** 查询抽奖次数列表 */
|
|
getList() {
|
|
getList() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
- listCount(this.queryParams).then(response => {
|
|
|
|
|
|
+ listCount(this.queryParams).then((response) => {
|
|
this.countList = response.rows;
|
|
this.countList = response.rows;
|
|
this.total = response.total;
|
|
this.total = response.total;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -239,7 +282,7 @@ export default {
|
|
steamName: null,
|
|
steamName: null,
|
|
poolId: null,
|
|
poolId: null,
|
|
poolName: null,
|
|
poolName: null,
|
|
- count: null
|
|
|
|
|
|
+ count: null,
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
@@ -255,9 +298,9 @@ export default {
|
|
},
|
|
},
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
- this.ids = selection.map(item => item.id)
|
|
|
|
- this.single = selection.length!==1
|
|
|
|
- this.multiple = !selection.length
|
|
|
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
|
+ this.single = selection.length !== 1;
|
|
|
|
+ this.multiple = !selection.length;
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
@@ -268,8 +311,8 @@ export default {
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
this.reset();
|
|
this.reset();
|
|
- const id = row.id || this.ids
|
|
|
|
- getCount(id).then(response => {
|
|
|
|
|
|
+ const id = row.id || this.ids;
|
|
|
|
+ getCount(id).then((response) => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
this.open = true;
|
|
this.open = true;
|
|
this.title = "修改抽奖次数";
|
|
this.title = "修改抽奖次数";
|
|
@@ -277,16 +320,16 @@ export default {
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
- this.$refs["form"].validate(valid => {
|
|
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
- updateCount(this.form).then(response => {
|
|
|
|
|
|
+ updateCount(this.form).then((response) => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
- addCount(this.form).then(response => {
|
|
|
|
|
|
+ addCount(this.form).then((response) => {
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.$modal.msgSuccess("新增成功");
|
|
this.open = false;
|
|
this.open = false;
|
|
this.getList();
|
|
this.getList();
|
|
@@ -298,19 +341,42 @@ export default {
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const ids = row.id || this.ids;
|
|
const ids = row.id || this.ids;
|
|
- this.$modal.confirm('是否确认删除抽奖次数编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
- return delCount(ids);
|
|
|
|
- }).then(() => {
|
|
|
|
- this.getList();
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
- }).catch(() => {});
|
|
|
|
|
|
+ this.$modal
|
|
|
|
+ .confirm('是否确认删除抽奖次数编号为"' + ids + '"的数据项?')
|
|
|
|
+ .then(function () {
|
|
|
|
+ return delCount(ids);
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.getList();
|
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {});
|
|
},
|
|
},
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
handleExport() {
|
|
- this.download('system/count/export', {
|
|
|
|
- ...this.queryParams
|
|
|
|
- }, `count_${new Date().getTime()}.xlsx`)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ this.download(
|
|
|
|
+ "system/count/export",
|
|
|
|
+ {
|
|
|
|
+ ...this.queryParams,
|
|
|
|
+ },
|
|
|
|
+ `count_${new Date().getTime()}.xlsx`
|
|
|
|
+ );
|
|
|
|
+ },
|
|
|
|
+ handleDialogClose(done) {
|
|
|
|
+ this.$confirm("确定要关闭弹窗吗?未保存的数据将会丢失。", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.open = false;
|
|
|
|
+ this.reset();
|
|
|
|
+ if (done) done();
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ // 用户取消,不关闭弹窗
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|