Commit 92560ec3 authored by daniel's avatar daniel

feat(gunRule): 新增预约组别状态控制+文件上传控制

parent b913b05e
......@@ -248,6 +248,18 @@
</template>
</n-input-number>
</n-form-item>
<n-form-item label="开启预约" >
<n-switch v-model:value="gunRuleValue.isOpen"
checked-value="1"
unchecked-value="0" >
<template #checked>
开启
</template>
<template #unchecked>
关闭
</template>
</n-switch>
</n-form-item>
</n-form>
</n-card>
<n-card title="枪次规则" :bordered="false" v-if="gunRuleValue.roadName&&activeMenu==menuOptions[0].value">
......@@ -270,11 +282,12 @@
</n-button>
<n-upload
v-if="gunRuleValue?.id"
:disabled="gunRuleValue.isOpen!=='1'"
@change="onFileUpload"
v-model:file-list="fileList"
>
<n-button type="primary">
导入选手名单
<n-button :type="gunRuleValue.isOpen==='1'?'primary':'error'">
{{gunRuleValue.isOpen==='1'?'导入选手名单':'预约已开始,无法导入选手名单,请先关闭预约再导入.'}}
</n-button>
</n-upload>
</n-space>
......@@ -760,6 +773,8 @@
// 更新菜单
const updateMenu = (value) => {
activeMenu.value = value
// 重新设置 gunRunValue
changeGunRule(ruleIndex.value)
getGunRulesStats()
}
......@@ -918,7 +933,8 @@
roadName: "", // 组别名
details: [], // 枪次
id: undefined,
cutOffTime: 10 // 关门时间
cutOffTime: 10, // 关门时间
isOpen: '0',// 是否开启预约
}
// 选号规则
const gunRuleValue = ref(initialValue)
......@@ -950,7 +966,7 @@
// 分类切换,刷新table
const changeGunRule = (index) => {
ruleIndex.value = index
gunRuleValue.value = gunRules.value[index]
gunRuleValue.value = { ...gunRules.value[index] }
getPlayers()
if (!isFirst.value) return
getGunRulesStats()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment