fix: 修改文件名大小写

This commit is contained in:
2025-04-24 17:13:51 +08:00
parent 0ca6cae01a
commit f4d57d8e1c
7 changed files with 671 additions and 131 deletions

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<title>飘渺儒仙GM后台</title>
</head>
<body>
<div id="app"></div>

View File

@@ -10,7 +10,9 @@
"format": "prettier --write src/"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.4",
"element-plus": "^2.9.8",
"tailwindcss": "^4.1.4",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},

View File

@@ -7,60 +7,4 @@ import { RouterView } from 'vue-router';
</template>
<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}
nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
}
nav a.router-link-exact-active {
color: var(--color-text);
}
nav a.router-link-exact-active:hover {
background-color: transparent;
}
nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}
nav a:first-of-type {
border: 0;
}
@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}
.logo {
margin: 0 2rem 0 0;
}
header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}
nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;
padding: 1rem 0;
margin-top: 1rem;
}
}
</style>

View File

@@ -1,5 +1,5 @@
@import './base.css';
@import 'tailwindcss';
#app {
max-width: 1280px;
margin: 0 auto;
@@ -20,16 +20,3 @@ a,
background-color: hsla(160, 100%, 37%, 0.2);
}
}
@media (min-width: 1024px) {
body {
display: flex;
place-items: center;
}
#app {
display: grid;
grid-template-columns: 1fr 1fr;
padding: 0 2rem;
}
}

View File

@@ -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>

View File

@@ -4,11 +4,11 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import vueDevTools from 'vite-plugin-vue-devtools'
import tailwindcss from '@tailwindcss/vite'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx(), vueDevTools()],
plugins: [vue(), vueJsx(), vueDevTools(), tailwindcss()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
@@ -20,10 +20,9 @@ export default defineConfig({
// 新增正向代理配置
proxy: {
'/api': {
target: 'http://127.0.0.1:8080/api',
target: 'http://127.0.0.1:8080',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
})
})