Commit 92560ec3 authored by daniel's avatar daniel

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

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