fix: 修改文件名大小写
This commit is contained in:
		| @@ -1,5 +1,138 @@ | ||||
| <script setup> | ||||
| import { ref, onMounted } from 'vue' | ||||
| import axios from 'axios' | ||||
|  | ||||
| // 第一个卡片:表单数据 | ||||
| const form = ref({ | ||||
|   playerName: '', | ||||
|   item: '', | ||||
|   recharge: '' | ||||
| }) | ||||
| const items = ref(['物品1', '物品2', '物品3']) | ||||
| const recharges = ref(['充值1', '充值2', '充值3']) | ||||
|  | ||||
| // 第二个卡片:角色表格数据 | ||||
| const roleList = ref([]) | ||||
| const roleSearch = ref('') | ||||
| const fetchRoleList = async () => { | ||||
|   try { | ||||
|     const response = await axios.get('/api/role', { | ||||
|       params: { search: roleSearch.value } | ||||
|     }) | ||||
|     roleList.value = response.data | ||||
|   } catch (error) { | ||||
|     console.error('获取角色列表失败:', error) | ||||
|   } | ||||
| } | ||||
|  | ||||
| // 第三个卡片:充值流水表格数据 | ||||
| const rechargeList = ref([]) | ||||
| const rechargeSearch = ref('') | ||||
| const fetchRechargeList = async () => { | ||||
|   try { | ||||
|     const response = await axios.get('/api/recharge', { | ||||
|       params: { search: rechargeSearch.value } | ||||
|     }) | ||||
|     rechargeList.value = response.data | ||||
|   } catch (error) { | ||||
|     console.error('获取充值流水失败:', error) | ||||
|   } | ||||
| } | ||||
|  | ||||
| // 页面加载时初始化数据 | ||||
| onMounted(() => { | ||||
|   fetchRoleList() | ||||
|   fetchRechargeList() | ||||
| }) | ||||
|  | ||||
| // 提交表单 | ||||
| const submitForm = () => { | ||||
|   console.log('提交表单:', form.value) | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <div class="home-container"> | ||||
|     <!-- 第一个卡片:表单 --> | ||||
|     <el-card class="card-item"> | ||||
|       <template #header> | ||||
|         <div class="card-header"> | ||||
|           <span>GM操作台</span> | ||||
|           <el-button type="primary" @click="submitForm">提交</el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|       <el-form :model="form" label-width="100px"> | ||||
|         <el-row :gutter="20"> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="玩家角色名"> | ||||
|               <el-input v-model="form.playerName" placeholder="请输入玩家角色名"></el-input> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="物品道具"> | ||||
|               <el-select v-model="form.item" placeholder="请选择物品"> | ||||
|                 <el-option v-for="item in items" :key="item" :label="item" :value="item"></el-option> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|           <el-col :span="8"> | ||||
|             <el-form-item label="充值"> | ||||
|               <el-select v-model="form.recharge" placeholder="请选择充值"> | ||||
|                 <el-option v-for="recharge in recharges" :key="recharge" :label="recharge" :value="recharge"></el-option> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|           </el-col> | ||||
|         </el-row> | ||||
|       </el-form> | ||||
|     </el-card> | ||||
|  | ||||
|     <!-- 第二个卡片:角色表格 --> | ||||
|     <el-card class="card-item"> | ||||
|       <template #header> | ||||
|         <div class="card-header"> | ||||
|           <span>角色列表</span> | ||||
|           <el-input class="w-60" v-model="roleSearch" placeholder="请输入角色名称或ID" @input="fetchRoleList"></el-input> | ||||
|         </div> | ||||
|       </template> | ||||
|       <el-table :data="roleList" style="width: 100%"> | ||||
|         <el-table-column prop="id" label="ID" width="180"></el-table-column> | ||||
|         <el-table-column prop="name" label="角色名称" width="180"></el-table-column> | ||||
|         <el-table-column prop="level" label="等级"></el-table-column> | ||||
|       </el-table> | ||||
|     </el-card> | ||||
|  | ||||
|     <!-- 第三个卡片:充值流水表格 --> | ||||
|     <el-card class="card-item"> | ||||
|       <template #header> | ||||
|         <div class="card-header"> | ||||
|           <span>充值流水</span> | ||||
|           <el-input class="w-60" v-model="rechargeSearch" placeholder="请输入角色名称或流水单号" @input="fetchRechargeList"></el-input> | ||||
|         </div> | ||||
|       </template> | ||||
|       <el-table :data="rechargeList" style="width: 100%"> | ||||
|         <el-table-column prop="id" label="流水单号" width="180"></el-table-column> | ||||
|         <el-table-column prop="roleName" label="角色名称" width="180"></el-table-column> | ||||
|         <el-table-column prop="amount" label="充值金额"></el-table-column> | ||||
|         <el-table-column prop="time" label="充值时间"></el-table-column> | ||||
|       </el-table> | ||||
|     </el-card> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <style scoped> | ||||
| .home-container { | ||||
|   width: 100%; | ||||
|   display: flex; | ||||
|   flex-direction: column; | ||||
|   gap: 20px; | ||||
|   padding: 20px; | ||||
| } | ||||
| .card-item { | ||||
|   width: 100%; | ||||
| } | ||||
| .card-header { | ||||
|   display: flex; | ||||
|   justify-content: space-between; | ||||
|   align-items: center; | ||||
| } | ||||
| </style> | ||||
		Reference in New Issue
	
	Block a user