|
|
@ -41,12 +41,13 @@ interface FormData { |
|
|
|
vip_status: number |
|
|
|
vip_values: number | string |
|
|
|
channel_status: number |
|
|
|
channel_values: number |
|
|
|
point_gear: string |
|
|
|
channel_values: Array<string> |
|
|
|
point_gear: number | string |
|
|
|
point_coin: number | string |
|
|
|
lower_rate: number | string |
|
|
|
upper_rate: number | string |
|
|
|
loop_times: number | string |
|
|
|
refresh_status: number |
|
|
|
refresh_times: number | string |
|
|
|
remark: string |
|
|
|
} |
|
|
|
|
|
|
@ -62,6 +63,7 @@ const data = reactive({ |
|
|
|
remark: [{ required: true, message: '数值不能为空', trigger: 'blur' }], |
|
|
|
point_coin: [{ required: true, message: '数值不能为空', trigger: 'blur' }], |
|
|
|
lower_rate: [{ required: true, message: '数值不能为空', trigger: 'blur' }], |
|
|
|
refresh_times: [{ required: true, message: '数值不能为空', trigger: 'blur' }], |
|
|
|
}, |
|
|
|
options: { |
|
|
|
new_register: [ |
|
|
@ -76,6 +78,7 @@ const data = reactive({ |
|
|
|
{ label: '小于等于', value: 4 }, |
|
|
|
], |
|
|
|
point: optionsPointControl, |
|
|
|
channel: [] as any, |
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
@ -96,6 +99,20 @@ const getRecord = async (page: number = 1) => { |
|
|
|
data.result = respond.data |
|
|
|
} |
|
|
|
|
|
|
|
const getChannelList = async () => { |
|
|
|
const respond: any = await request.post('/person/channelList') |
|
|
|
|
|
|
|
if (respond.code != 0) { |
|
|
|
ElMessage.error(respond.msg) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
data.options.channel = [] |
|
|
|
for (const item of respond.data) { |
|
|
|
data.options.channel.push({ label: item.name, value: item.p_token + '|' + item.ad_token }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const addBox = (action: number, item: any) => { |
|
|
|
data.form = { |
|
|
|
id: 0, |
|
|
@ -134,12 +151,13 @@ const addBox = (action: number, item: any) => { |
|
|
|
vip_status: 0, |
|
|
|
vip_values: 0, |
|
|
|
channel_status: 0, |
|
|
|
channel_values: 0, |
|
|
|
point_gear: '1000', |
|
|
|
channel_values: [], |
|
|
|
point_gear: 1000, |
|
|
|
point_coin: '', |
|
|
|
lower_rate: '', |
|
|
|
upper_rate: '', |
|
|
|
loop_times: 0, |
|
|
|
refresh_status: 0, |
|
|
|
refresh_times: '', |
|
|
|
remark: '', |
|
|
|
} as FormData |
|
|
|
|
|
|
@ -149,7 +167,54 @@ const addBox = (action: number, item: any) => { |
|
|
|
} |
|
|
|
|
|
|
|
const editBox = (action: number, item: any) => { |
|
|
|
data.form = item |
|
|
|
const current = JSON.parse(JSON.stringify(item)) |
|
|
|
|
|
|
|
data.form = { |
|
|
|
id: current.id, |
|
|
|
new_register_status: decodeStatus(current.new_register_status).status, |
|
|
|
new_register_type: decodeStatus(current.new_register_status).type, |
|
|
|
today_winlose_status: decodeStatus(current.today_winlose_status).status, |
|
|
|
today_winlose_type: decodeStatus(current.today_winlose_status).type, |
|
|
|
today_winlose_values: current.today_winlose_values, |
|
|
|
total_winlose_status: decodeStatus(current.total_winlose_status).status, |
|
|
|
total_winlose_type: decodeStatus(current.total_winlose_status).type, |
|
|
|
total_winlose_values: current.total_winlose_values, |
|
|
|
today_deposit_status: decodeStatus(current.today_deposit_status).status, |
|
|
|
today_deposit_type: decodeStatus(current.today_deposit_status).type, |
|
|
|
today_deposit_values: current.today_deposit_values, |
|
|
|
total_deposit_status: decodeStatus(current.total_deposit_status).status, |
|
|
|
total_deposit_type: decodeStatus(current.total_deposit_status).type, |
|
|
|
total_deposit_values: current.total_deposit_values, |
|
|
|
today_withdraw_status: decodeStatus(current.today_withdraw_status).status, |
|
|
|
today_withdraw_type: decodeStatus(current.today_withdraw_status).type, |
|
|
|
today_withdraw_values: current.today_withdraw_values, |
|
|
|
total_withdraw_status: decodeStatus(current.total_withdraw_status).status, |
|
|
|
total_withdraw_type: decodeStatus(current.total_withdraw_status).type, |
|
|
|
total_withdraw_values: current.total_withdraw_values, |
|
|
|
today_surplus_status: decodeStatus(current.today_surplus_status).status, |
|
|
|
today_surplus_type: decodeStatus(current.today_surplus_status).type, |
|
|
|
today_surplus_values: current.today_surplus_values, |
|
|
|
total_surplus_status: decodeStatus(current.total_surplus_status).status, |
|
|
|
total_surplus_type: decodeStatus(current.total_surplus_status).type, |
|
|
|
total_surplus_values: current.total_surplus_values, |
|
|
|
device_num_status: decodeStatus(current.device_num_status).status, |
|
|
|
device_num_type: decodeStatus(current.device_num_status).type, |
|
|
|
device_num_values: current.device_num_values, |
|
|
|
ip_num_status: decodeStatus(current.ip_num_status).status, |
|
|
|
ip_num_type: decodeStatus(current.ip_num_status).type, |
|
|
|
ip_num_values: current.ip_num_values, |
|
|
|
vip_status: current.vip_status, |
|
|
|
vip_values: current.vip_values, |
|
|
|
channel_status: current.channel_status, |
|
|
|
channel_values: JSON.parse(current.channel_values), |
|
|
|
point_gear: current.point_gear, |
|
|
|
point_coin: current.point_coin, |
|
|
|
lower_rate: current.lower_rate, |
|
|
|
upper_rate: current.upper_rate, |
|
|
|
refresh_status: current.refresh_status, |
|
|
|
refresh_times: current.refresh_times, |
|
|
|
remark: current.remark, |
|
|
|
} as FormData |
|
|
|
|
|
|
|
data.dialog = true |
|
|
|
data.request.action = action |
|
|
@ -174,14 +239,27 @@ const submitData = async () => { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//小于等于4为输 |
|
|
|
if ((data.form.point_gear as number) > 0 && parseInt(data.form.point_coin as string) > 0) { |
|
|
|
ElMessage.error('点控输作弊值必须小于0') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//大于4赢 |
|
|
|
if ((data.form.point_gear as number) < 0 && parseInt(data.form.point_coin as string) < 0) { |
|
|
|
ElMessage.error('点控赢作弊值必须大于0') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const params = { |
|
|
|
id: data.form.id, |
|
|
|
remark: data.form.remark, |
|
|
|
point_gear: data.form.point_gear, |
|
|
|
point_gear: parseInt(data.form.point_gear as string), |
|
|
|
point_coin: parseInt(data.form.point_coin as string), |
|
|
|
lower_rate: parseInt(data.form.lower_rate as string), |
|
|
|
upper_rate: parseInt(data.form.upper_rate as string), |
|
|
|
loop_times: parseInt(data.form.loop_times as string), |
|
|
|
refresh_status: data.form.refresh_status, |
|
|
|
refresh_times: parseInt(data.form.refresh_times as string), |
|
|
|
new_register_status: encodeStatus(data.form.new_register_status, data.form.new_register_type), |
|
|
|
today_winlose_status: encodeStatus(data.form.today_winlose_status, data.form.today_winlose_type), |
|
|
|
today_winlose_values: parseInt(data.form.today_winlose_values as string), |
|
|
@ -205,7 +283,23 @@ const submitData = async () => { |
|
|
|
ip_num_values: parseInt(data.form.ip_num_values as string), |
|
|
|
vip_status: data.form.vip_status, |
|
|
|
vip_values: parseInt(data.form.vip_values as string), |
|
|
|
channel_status: encodeStatus(data.form.channel_status, data.form.channel_values), |
|
|
|
channel_status: data.form.channel_status, |
|
|
|
channel_values: JSON.stringify(data.form.channel_values), |
|
|
|
} as any |
|
|
|
|
|
|
|
//数值不能小于0 |
|
|
|
let isTrue = true |
|
|
|
Object.keys(params).forEach((key) => { |
|
|
|
if (key.includes('values') && key != 'vip_values' && key != 'channel_values') { |
|
|
|
if (params[key] < 0) { |
|
|
|
isTrue = false |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!isTrue || params.refresh_times < 0) { |
|
|
|
ElMessage.error('数值不能小于0') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const respond = await request.post(data.request.url, params) |
|
|
@ -233,6 +327,7 @@ const decodeStatus = (combinedValue: number) => { |
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
getRecord() |
|
|
|
getChannelList() |
|
|
|
}) |
|
|
|
</script> |
|
|
|
|
|
|
@ -250,14 +345,13 @@ onMounted(async () => { |
|
|
|
<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 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 align="center" prop="refresh_status" label="每天刷新"> |
|
|
|
<template #default="item">{{ item.row.refresh_status == 1 ? '是' : '否' }}</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column align="center" prop="refresh_times" label="生效次数" /> |
|
|
|
<el-table-column align="center" prop="option" label="操作"> |
|
|
|
<template #default="item"> |
|
|
|
<el-button type="warning" size="small" @click="editBox(1, item.row)">编辑</el-button> |
|
|
@ -297,11 +391,18 @@ onMounted(async () => { |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</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> |
|
|
|
<el-form-item label="每天刷新" label-width="130" prop="refresh_times"> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.refresh_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="10"> |
|
|
|
<el-input v-model="data.form.refresh_times" type="number" placeholder="生效次数,0: 不生效"></el-input> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否新用户" label-width="130" prop=""> |
|
|
|
<el-form-item label="新注册用户" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.new_register_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -316,10 +417,9 @@ onMounted(async () => { |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-col> |
|
|
|
<el-col :span="10"></el-col> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户今日输赢" label-width="130" prop=""> |
|
|
|
<el-form-item label="今日输赢" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.today_winlose_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -342,7 +442,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户总输赢" label-width="130" prop=""> |
|
|
|
<el-form-item label="总输赢" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.total_winlose_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -364,7 +464,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户今日充值" label-width="130" prop=""> |
|
|
|
<el-form-item label="今日充值" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.today_deposit_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -386,7 +486,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户总充值" label-width="130" prop=""> |
|
|
|
<el-form-item label="总充值" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.total_deposit_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -408,7 +508,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户今日提现" label-width="130" prop=""> |
|
|
|
<el-form-item label="今日提现" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.today_withdraw_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -430,7 +530,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户总提现" label-width="130" prop=""> |
|
|
|
<el-form-item label="总提现" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.total_withdraw_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -452,7 +552,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="今日中冲提差" label-width="130" prop=""> |
|
|
|
<el-form-item label="今日充提差" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.today_surplus_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -474,7 +574,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户总冲提差" label-width="130" prop=""> |
|
|
|
<el-form-item label="总提差" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.total_surplus_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -541,7 +641,7 @@ onMounted(async () => { |
|
|
|
</template> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户VIP等级" label-width="130" prop=""> |
|
|
|
<el-form-item label="VIP等级" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.vip_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
@ -554,16 +654,16 @@ onMounted(async () => { |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户进入渠道" label-width="130" prop=""> |
|
|
|
<el-form-item label="来源渠道" label-width="130" prop=""> |
|
|
|
<el-row class="full-select" justify="space-between"> |
|
|
|
<el-col :span="3"> |
|
|
|
<el-switch v-model="data.form.channel_status" :active-value="1" :inactive-value="0"></el-switch> |
|
|
|
</el-col> |
|
|
|
<template v-if="data.form.channel_status == 1"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-select v-model="data.form.channel_values" class="full-select"> |
|
|
|
<el-select v-model="data.form.channel_values" class="full-select" multiple clearable> |
|
|
|
<el-option |
|
|
|
v-for="item in data.options.section" |
|
|
|
v-for="item in data.options.channel" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|