index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div style="max-width: 1700px;">
  3. <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="70px" class="demo-ruleForm"
  4. :size="formSize">
  5. <el-form-item :inline="true" class="inputStyle">
  6. <el-form-item label="玩家ID" prop="id">
  7. <el-input v-model="ruleForm.id" :disabled="true" />
  8. </el-form-item>
  9. <el-form-item label="账号ID" prop="aId">
  10. <el-input v-model="ruleForm.aId" :disabled="true" />
  11. </el-form-item>
  12. <el-form-item label="角色名" prop="nm">
  13. <el-input v-model="ruleForm.nm" />
  14. </el-form-item>
  15. <el-form-item label="游戏服" prop="gId">
  16. <el-input v-model="ruleForm.gId" :disabled="true" />
  17. </el-form-item>
  18. <el-form-item label="等级" prop="lv">
  19. <el-input v-model="ruleForm.lv" />
  20. </el-form-item>
  21. <el-form-item label="vip等级" prop="vLv">
  22. <el-input v-model="ruleForm.vLv" :disabled="true" />
  23. </el-form-item>
  24. <el-form-item label="战斗力" prop="tmp">
  25. <el-input v-model="ruleForm.tmp" :disabled="true" />
  26. </el-form-item>
  27. <el-form-item label="总充值" prop="atu">
  28. <el-input v-model="ruleForm.atu" :disabled="true" />
  29. </el-form-item>
  30. <el-form-item label="公会" prop="gld">
  31. <el-input v-model="ruleForm.gld" :disabled="true" />
  32. </el-form-item>
  33. <el-form-item label="封号截至" prop="btm">
  34. <el-input v-model="ruleForm.btm" :disabled="true" />
  35. </el-form-item>
  36. <el-form-item label="封号理由" prop="btn">
  37. <el-input v-model="ruleForm.btn" :disabled="true" />
  38. </el-form-item>
  39. <el-form-item label="禁言截止" prop="stm">
  40. <el-input v-model="ruleForm.stm" :disabled="true" />
  41. </el-form-item>
  42. <el-form-item label="禁言理由" prop="stn">
  43. <el-input v-model="ruleForm.stn" :disabled="true" />
  44. </el-form-item>
  45. <el-form-item label="深渊层数" prop="aby">
  46. <el-input v-model="ruleForm.aby" :disabled="true" />
  47. </el-form-item>
  48. <el-form-item label="注册时间" prop="ctm">
  49. <el-input v-model="ruleForm.ctm" :disabled="true" />
  50. </el-form-item>
  51. <el-form-item label="最近登录" prop="llTm">
  52. <el-input v-model="ruleForm.llTm" :disabled="true" />
  53. </el-form-item>
  54. <el-form-item label="最近登出" prop="luTm">
  55. <el-input v-model="ruleForm.luTm" :disabled="true" />
  56. </el-form-item>
  57. </el-form-item>
  58. <el-form-item>
  59. <el-button type="primary" class="saveButton" @click="submitForm()" round>保存信息</el-button>
  60. </el-form-item>
  61. </el-form>
  62. </div>
  63. </template>
  64. <script lang="ts" setup name="inline-table">
  65. import { ElMessage } from 'element-plus';
  66. import { reactive, ref } from 'vue'
  67. import playerApi from '@/api/player'
  68. const rules = reactive({
  69. });
  70. let props = defineProps({
  71. ruleForm: Object
  72. });
  73. const submitForm = () => {
  74. let data = {
  75. playerId: props.ruleForm.id,
  76. name: props.ruleForm.nm,
  77. playerLv: props.ruleForm.lv,
  78. srvId:props.ruleForm.gId
  79. }
  80. playerApi.editPlayerInfo(data).then((resp) => {
  81. let result = resp.data.result + "";
  82. let jsonData = JSON.parse(result);
  83. if (jsonData.msg === '修改角色信息失败' || jsonData.msg === '参数错误') {
  84. ElMessage({
  85. message: jsonData.msg + "",
  86. type: 'error',
  87. duration: 3000
  88. });
  89. } else {
  90. ElMessage({
  91. message: jsonData.msg + "",
  92. type: 'success',
  93. duration: 3000
  94. });
  95. }
  96. });
  97. }
  98. const formSize = ref('default')
  99. </script>
  100. <style>
  101. .inputStyle .el-input {
  102. margin-bottom: 10px;
  103. width: 155px;
  104. }
  105. .saveButton {
  106. position: absolute;
  107. right: 50px;
  108. }
  109. </style>