瀏覽代碼

代码功能修复

wengan01 1 月之前
父節點
當前提交
1ef3bf90f6

+ 9 - 8
src/views/system/business/tournaments/index.vue

@@ -1248,14 +1248,15 @@ const handleQuery = () => {
 
 /** 重置按钮操作 */
 const resetQuery = () => {
-  queryFormRef.value?.resetFields();
-  // 设置默认开始时间为今天
-  const today = new Date();
-  const yyyy = today.getFullYear();
-  const mm = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以+1
-  const dd = String(today.getDate()).padStart(2, '0');
-  queryParams.value.startTime = `${yyyy}-${mm}-${dd}`;
-  handleQuery();
+  // 将所有查询参数重置为空
+  queryParams.value.id = '';
+  queryParams.value.name = '';
+  queryParams.value.status = '';
+  queryParams.value.startTime = '';
+  // 重置页码
+  queryParams.value.pageNum = 1;
+  // 直接执行搜索
+  getList();
 };
 
 /** 多选框选中数据 */

+ 10 - 3
src/views/system/physical/leagueTournament/index.vue

@@ -257,7 +257,7 @@
 </template>
 
 <script setup name="LeagueTournament" lang="ts">
-import { getCurrentInstance, ref, reactive, toRefs, onMounted } from 'vue';
+import { getCurrentInstance, ref, reactive, toRefs, onMounted, nextTick } from 'vue';
 import type { ComponentInternalInstance } from 'vue';
 import {
   listLeagueTournament,
@@ -364,8 +364,15 @@ const handleQuery = () => {
 
 /** 重置按钮操作 */
 const resetQuery = () => {
-  queryFormRef.value?.resetFields();
-  handleQuery();
+  // 将所有查询参数重置为空
+  queryParams.value.title = '';
+  queryParams.value.startTime = '';
+  queryParams.value.endTime = '';
+  queryParams.value.location = '';
+  // 重置页码
+  queryParams.value.pageNum = 1;
+  // 直接执行搜索
+  getList();
 };
 
 /** 多选框选中数据 */

+ 28 - 24
src/views/system/physical/participants/index.vue

@@ -5,7 +5,7 @@
         <el-card shadow="hover">
           <el-form ref="queryFormRef" :model="queryParams" :inline="true">
             <el-row :gutter="10" class="mb8">
-              <el-form-item label="赛事ID" prop="userName">
+              <el-form-item label="赛事ID" prop="tournamentId">
                 <el-input
                   v-model="queryParams.tournamentId"
                   style="width: 300px; min-width: 300px"
@@ -16,7 +16,7 @@
               </el-form-item>
               <el-form-item label="报名用户" prop="userName">
                 <el-input
-                  v-model="queryParams.userName"
+                  v-model="queryParams.name"
                   style="width: 300px; min-width: 300px"
                   placeholder="请输入报名用户"
                   clearable
@@ -42,8 +42,9 @@
                   type="date"
                   value-format="YYYY-MM-DD"
                   placeholder="请选择报名时间"
-                />
+                ></el-date-picker>
               </el-form-item>
+
               <el-form-item>
                 <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
                 <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -57,19 +58,6 @@
     <el-card shadow="never">
       <template #header>
         <el-row :gutter="10" class="mb8">
-          <!--          <el-col :span="1.5">
-            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['physical:participants:add']">新增</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['physical:participants:edit']"
-              >修改</el-button
-            >
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['physical:participants:remove']"
-              >删除</el-button
-            >
-          </el-col>-->
           <el-col :span="1.5">
             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['physical:participants:export']">导出</el-button>
           </el-col>
@@ -101,7 +89,6 @@
 
       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
     </el-card>
-    <!-- 添加或修改线下用户报名对话框 -->
     <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
       <el-form ref="participantsFormRef" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="" prop="tournamentId">
@@ -157,6 +144,9 @@
 </template>
 
 <script setup name="Participants" lang="ts">
+import { ref, reactive, onMounted, toRefs } from 'vue';
+import { ElFormInstance } from 'element-plus';
+import { ComponentInternalInstance, getCurrentInstance } from 'vue';
 import {
   listParticipants,
   getParticipants,
@@ -167,6 +157,7 @@ import {
 } from '@/api/system/physical/participants';
 import { ParticipantsVO, ParticipantsQuery, ParticipantsForm } from '@/api/system/physical/participants/types';
 import { parseTime } from '@/utils/dateUtils';
+
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
 const participantsList = ref<ParticipantsVO[]>([]);
@@ -181,7 +172,7 @@ const total = ref(0);
 const queryFormRef = ref<ElFormInstance>();
 const participantsFormRef = ref<ElFormInstance>();
 
-const dialog = reactive<DialogOption>({
+const dialog = reactive({
   visible: false,
   title: ''
 });
@@ -201,20 +192,27 @@ const initFormData: ParticipantsForm = {
   finalRank: undefined,
   finalReward: undefined
 };
+
+interface PageData<T, Q> {
+  form: T;
+  queryParams: Q & { pageNum: number; pageSize: number; params?: {} };
+  rules: Record<string, unknown[]>;
+}
+
 const data = reactive<PageData<ParticipantsForm, ParticipantsQuery>>({
   form: { ...initFormData },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
-    tournamentId: undefined,
+    tournamentId: '',
     playerId: undefined,
-    name: undefined,
-    mobile: undefined,
+    name: '',
+    mobile: '',
     avatar: undefined,
     currentChips: undefined,
     rebuy: undefined,
     eliminatedTime: undefined,
-    registrationTime: undefined,
+    registrationTime: '',
     status: undefined,
     finalRank: undefined,
     finalReward: undefined,
@@ -260,8 +258,12 @@ const handleQuery = () => {
 
 /** 重置按钮操作 */
 const resetQuery = () => {
-  queryFormRef.value?.resetFields();
-  handleQuery();
+  queryParams.value.tournamentId = '';
+  queryParams.value.name = '';
+  queryParams.value.mobile = '';
+  queryParams.value.registrationTime = '';
+  queryParams.value.pageNum = 1;
+  getList();
 };
 
 /** 多选框选中数据 */
@@ -287,6 +289,7 @@ const handleUpdate = async (row?: ParticipantsVO) => {
   dialog.visible = true;
   dialog.title = '修改线下用户报名';
 };
+
 //晋级
 const getNextTournament = async (row?: ParticipantsVO) => {
   try {
@@ -309,6 +312,7 @@ const getNextTournament = async (row?: ParticipantsVO) => {
     }
   }
 };
+
 /** 提交按钮 */
 const submitForm = () => {
   participantsFormRef.value?.validate(async (valid: boolean) => {

File diff suppressed because it is too large
+ 291 - 653
src/views/system/physical/store/index.vue


+ 15 - 22
src/views/system/physical/tag/index.vue

@@ -39,9 +39,6 @@
               >删除</el-button
             >
           </el-col>
-          <!--          <el-col :span="1.5">
-            <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['physical:tag:export']">导出</el-button>
-          </el-col>-->
           <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
       </template>
@@ -85,13 +82,6 @@
         <el-form-item label="服务ID" prop="serviceCode">
           <el-input v-model="form.serviceCode" placeholder="请输入服务ID" />
         </el-form-item>
-<!--        <el-form-item label="背景色" prop="colorCode">
-          <el-input v-model="form.colorCode" placeholder="请输入背景色或文字色,如 #FF6B35">
-            <template #append>
-              <el-color-picker v-model="form.colorCode" />
-            </template>
-          </el-input>
-        </el-form-item>-->
         <el-form-item label="是否启用" prop="isEnabled">
           <el-select v-model="form.isEnabled" placeholder="请选择是否启用">
             <el-option label="是" value="1" />
@@ -116,6 +106,9 @@
 </template>
 
 <script setup name="Tag" lang="ts">
+import { ref, reactive, onMounted, toRefs } from 'vue';
+import { ElFormInstance } from 'element-plus';
+import { ComponentInternalInstance, getCurrentInstance } from 'vue';
 import { listTag, getTag, delTag, addTag, updateTag } from '@/api/system/physical/tag';
 import { TagVO, TagQuery, TagForm } from '@/api/system/physical/tag/types';
 
@@ -141,6 +134,7 @@ const dialog = reactive<DialogOption>({
 const initFormData: TagForm = {
   id: undefined,
   serviceName: undefined,
+  serviceCode: undefined,
   iconUrl: undefined,
   colorCode: undefined,
   isEnabled: '1',
@@ -151,12 +145,14 @@ const initFormData: TagForm = {
   createdBy: undefined,
   updatedBy: undefined
 };
+
 const data = reactive<PageData<TagForm, TagQuery>>({
   form: { ...initFormData },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
     serviceName: undefined,
+    serviceCode: undefined,
     iconUrl: undefined,
     colorCode: undefined,
     isEnabled: undefined,
@@ -193,7 +189,15 @@ const cancel = () => {
 
 /** 表单重置 */
 const reset = () => {
-  form.value = { ...initFormData };
+  // 逐个属性重置,保持响应式连接
+  form.value.id = undefined;
+  form.value.serviceName = undefined;
+  form.value.serviceCode = undefined;
+  form.value.iconUrl = undefined;
+  form.value.colorCode = undefined;
+  form.value.isEnabled = '1';
+  form.value.sortOrder = undefined;
+  form.value.remark = undefined;
   tagFormRef.value?.resetFields();
 };
 
@@ -260,17 +264,6 @@ const handleDelete = async (row?: TagVO) => {
   await getList();
 };
 
-/** 导出按钮操作 */
-const handleExport = () => {
-  proxy?.download(
-    'physical/tag/export',
-    {
-      ...queryParams.value
-    },
-    `tag_${new Date().getTime()}.xlsx`
-  );
-};
-
 onMounted(() => {
   getList();
 });

+ 12 - 4
src/views/system/physical/tournaments/index.vue

@@ -496,7 +496,7 @@ import LevelsIndex from '@/views/system/physical/blindLevels/index.vue';
 import { LeagueTournamentVO } from '@/api/system/physical/leagueTournament/types';
 import { JudgeVO } from '@/api/system/physical/judge/types';
 import { ElSelect } from 'element-plus';
-import { ref } from 'vue';
+import { ref, nextTick } from 'vue';
 import { CompetitionZoneVO } from '@/api/system/physical/competitionZone/types';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { game_variant_type, tournaments_time, physical_tournaments_type, qualifier_type } = toRefs<any>(
@@ -595,7 +595,7 @@ const data = reactive<PageData<TournamentsForm, TournamentsQuery>>({
     qualifierValue: undefined,
     params: {},
     leagueTournamentId: undefined, // ← 新增字段
-    startTimeOne: parseTime(new Date(), '{y}-{m}-{d}') // 默认今天
+    startTimeOne: ''
   },
   rules: {
     id: [{ required: true, message: '不能为空', trigger: 'blur' }],
@@ -776,10 +776,18 @@ const handleQuery = () => {
 
 /** 重置按钮操作 */
 const resetQuery = () => {
-  queryFormRef.value?.resetFields();
-  handleQuery();
+  // 将所有查询参数重置为空
+  queryParams.value.id = '';
+  queryParams.value.name = '';
+  queryParams.value.startTimeOne = '';
+  queryParams.value.tournamentType = '';
+  // 重置页码
+  queryParams.value.pageNum = 1;
+  // 直接执行搜索
+  getList();
 };
 
+
 /** 多选框选中数据 */
 const handleSelectionChange = (selection: TournamentsVO[]) => {
   ids.value = selection.map((item) => item.id);

+ 1 - 1
vite.config.ts

@@ -24,7 +24,7 @@ export default defineConfig(({ mode, command }) => {
       open: true,
       proxy: {
         [env.VITE_APP_BASE_API]: {
-          target: 'http://localhost:15103',
+          target: 'http://localhost:16103',
           changeOrigin: true,
           ws: true,
           rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '')

Some files were not shown because too many files changed in this diff