|
|
@ -2,7 +2,7 @@ |
|
|
|
import { onMounted, reactive, ref } from 'vue' |
|
|
|
import request from '@/api/config' |
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
import { optionsPointControl } from '@/api/module/common_params' |
|
|
|
import { initPage, optionsPointControl } from '@/api/module/common_params' |
|
|
|
|
|
|
|
interface FormData { |
|
|
|
id: number |
|
|
@ -51,6 +51,7 @@ interface FormData { |
|
|
|
} |
|
|
|
|
|
|
|
const data = reactive({ |
|
|
|
page: initPage, |
|
|
|
result: [] as any, |
|
|
|
form: {} as FormData, |
|
|
|
loading: false, |
|
|
@ -80,15 +81,19 @@ const data = reactive({ |
|
|
|
|
|
|
|
const form = ref() |
|
|
|
|
|
|
|
const getRecord = async () => { |
|
|
|
const respond = await request.post('/person/configs/pointConfig') |
|
|
|
const getRecord = async (page: number = 1) => { |
|
|
|
const params = { |
|
|
|
page: page, |
|
|
|
limit: data.page.size, |
|
|
|
} |
|
|
|
const respond = await request.post('/person/configs/pointConfig', params) |
|
|
|
|
|
|
|
if (respond.code != 0) { |
|
|
|
ElMessage.error(respond.msg) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
data.result = respond.data as FormData |
|
|
|
data.result = respond.data |
|
|
|
} |
|
|
|
|
|
|
|
const addBox = (action: number, item: any) => { |
|
|
@ -240,9 +245,19 @@ onMounted(async () => { |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-card class="mx-n10"> |
|
|
|
<el-table height="600" :data="data.result" v-loading="data.loading"> |
|
|
|
<el-table height="600" :data="data.result.data" v-loading="data.loading"> |
|
|
|
<el-table-column align="center" prop="id" label="ID" width="100" /> |
|
|
|
<el-table-column align="center" prop="remark" label="策略名称" /> |
|
|
|
<el-table-column align="center" prop="point_gear" label="控制挡位" /> |
|
|
|
<el-table-column align="center" prop="point_coin" label="控制金额" /> |
|
|
|
<el-table-column align="center" prop="lower_rate" label="浮动区间" > |
|
|
|
<template #default="item"> |
|
|
|
{{ item.row.lower_rate }}% - {{ item.row.upper_rate }}% |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" prop="loop_times" label="循环次数"> |
|
|
|
<template #default="item">{{ item.row.loop_times == -1 ? '∞' : item.row.loop_times }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" prop="option" label="操作"> |
|
|
|
<template #default="item"> |
|
|
|
<el-button type="warning" size="small" @click="editBox(1, item.row)">编辑</el-button> |
|
|
@ -250,6 +265,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<CustomPaginate :size="data.page.size" :total="data.result.total" @new-page="(v: number) => getRecord(v)" /> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<!-- 添加 --> |
|
|
@ -283,7 +299,7 @@ onMounted(async () => { |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="循环次数" label-width="130" prop="loop_times"> |
|
|
|
<el-input v-model="data.form.loop_times" type="number"></el-input> |
|
|
|
<p style="color: red; font-size: 12px;">-1:不限; 0:不循环; >0循环次数</p> |
|
|
|
<p style="color: red; font-size: 12px">-1:不限; 0:不循环; >0循环次数</p> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否新用户" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|