4 changed files with 79 additions and 168 deletions
@ -1,99 +0,0 @@ |
|||
<script setup lang="ts"> |
|||
import { onMounted, reactive, watch } from 'vue'; |
|||
import request from "@/api/config"; |
|||
import { ElMessage } from "element-plus"; |
|||
|
|||
const emits = defineEmits(["closeBox"]) |
|||
const props = defineProps(["uid", "user_no", "type", "value", "remark", "gold", "diamonds"]) |
|||
const data = reactive({ |
|||
form: { |
|||
id: props.uid, |
|||
cheatType: props.type, |
|||
cheatValue: props.value, |
|||
cheatRemark: props.remark, |
|||
}, |
|||
options: [ |
|||
{ value: 1, label: "1000(小输)" }, |
|||
{ value: 2, label: "2000(中输)" }, |
|||
{ value: 3, label: "3000(大输)" }, |
|||
{ value: 4, label: "4000(大杀)" }, |
|||
{ value: 5, label: "-1000(小赢)" }, |
|||
{ value: 6, label: "-2000(中赢)" }, |
|||
{ value: 7, label: "-3000(大赢)" }, |
|||
], |
|||
cheat_info: { gear: "", value: props.value } |
|||
}) |
|||
|
|||
const onSubmit = async () => { |
|||
if (props.uid == undefined) { |
|||
ElMessage.error("参数错误") |
|||
return |
|||
} |
|||
|
|||
data.form.cheatValue = parseInt(data.form.cheatValue) |
|||
const params = { ...data.form } |
|||
|
|||
const respond = await request.post("/customer/modify-user-cheat", params) |
|||
|
|||
if (respond.code != 0) { |
|||
ElMessage.error("操作失败") |
|||
return |
|||
} |
|||
|
|||
ElMessage.success("操作成功") |
|||
emits("closeBox", false) |
|||
|
|||
} |
|||
|
|||
const getGear = (newValue: number) => { |
|||
for (const item of data.options) { |
|||
if (item.value == newValue) { |
|||
data.cheat_info.gear = item.label |
|||
break |
|||
} |
|||
} |
|||
} |
|||
|
|||
watch(() => props.type, (newValue) => { |
|||
//获取挡位 |
|||
getGear(newValue) |
|||
}) |
|||
|
|||
onMounted(() => { |
|||
getGear(props.type) |
|||
}) |
|||
</script> |
|||
|
|||
|
|||
<template> |
|||
|
|||
<el-form> |
|||
<el-form-item label="玩家ID" label-width="100"> |
|||
<el-input :value="user_no" disabled></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="玩家拥有资产" label-width="100"> |
|||
<el-input :value="`金币 ${props.gold}`" disabled></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="当前作弊情况" label-width="100"> |
|||
<el-input :value="`挡位 ${data.cheat_info.gear} 剩余值 ${data.cheat_info.value}`" disabled></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="新赠作弊率" label-width="100"> |
|||
<el-select v-model="data.form.cheatType" style="width: 100%;"> |
|||
<el-option v-for="item in data.options" :key="item.label" :label="item.label" |
|||
:value="item.value"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="新赠作弊值" label-width="100"> |
|||
<el-input v-model="data.form.cheatValue" type="number" /> |
|||
</el-form-item> |
|||
<el-form-item label="操作理由" label-width="100"> |
|||
<el-input v-model="data.form.cheatRemark" type="textarea" :rows="5" /> |
|||
</el-form-item> |
|||
|
|||
<div class="paginate-center"> |
|||
<el-button type="primary" @click="$emit('closeBox', false)">取消</el-button> |
|||
<el-button type="danger" @click="onSubmit">确定</el-button> |
|||
</div> |
|||
</el-form> |
|||
|
|||
</template> |
Loading…
Reference in new issue