Commit 7f1f3ec1 authored by daniel's avatar daniel

fix(gunRule): 枪次编辑优化

parent de376271
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
</n-gradient-text> </n-gradient-text>
</div> </div>
</n-descriptions-item> </n-descriptions-item>
</n-descriptions> </n-descriptions>
</n-card> </n-card>
<!-- 顶部的搜索框 --> <!-- 顶部的搜索框 -->
...@@ -315,7 +315,7 @@ ...@@ -315,7 +315,7 @@
</n-radio-group> </n-radio-group>
</n-form-item> </n-form-item>
<n-form-item label="组别" path="roadName"> <n-form-item label="组别" path="roadName">
<n-select :options="gunRules.map(v=>({label:v.roadName,value:v.roadName}))" v-model:value="playerFormValue.roadName"> <n-select @update:value="updateWaveOptions" :options="gunRules.map(v=>({label:v.roadName,value:v.roadName}))" v-model:value="playerFormValue.roadName">
</n-select> </n-select>
</n-form-item> </n-form-item>
<n-form-item label="枪次" v-if="gunRules.length"> <n-form-item label="枪次" v-if="gunRules.length">
...@@ -734,6 +734,11 @@ ...@@ -734,6 +734,11 @@
activeMenu.value = value activeMenu.value = value
} }
// 更新枪次选项
const updateWaveOptions = (value) => {
playerFormValue.value.waveNumber = undefined
}
// 搜索 // 搜索
const search = async (clear = false) => { const search = async (clear = false) => {
if (clear) keyword.value = '' if (clear) keyword.value = ''
...@@ -808,6 +813,7 @@ ...@@ -808,6 +813,7 @@
const downloadImportList = () => { const downloadImportList = () => {
// 在新窗口打卡 // 在新窗口打卡
window.location.href = DOWNLOAD_IMPORT_LIST window.location.href = DOWNLOAD_IMPORT_LIST
getGunRules()
} }
// 随机分配 // 随机分配
const randomAssign = async () => { const randomAssign = async () => {
...@@ -837,7 +843,7 @@ ...@@ -837,7 +843,7 @@
if (data.code !== 200) return message.error(data.message) if (data.code !== 200) return message.error(data.message)
message.success('随机分配成功') message.success('随机分配成功')
getPlayers() getGunRules()
} }
// 初始化规则 // 初始化规则
const initWaves = async () => { const initWaves = async () => {
...@@ -935,7 +941,10 @@ ...@@ -935,7 +941,10 @@
message.error(err.message) message.error(err.message)
} }
if (res.code !== 200) return message.error(res.message) if (res.code !== 200) return message.error(res.message)
gunRules.value = res.data gunRules.value = res.data.map(v => ({
...v,
startTime: v.startTime.slice(0, -2),
}))
if (res.data.length) { if (res.data.length) {
changeGunRule(ruleIndex.value === -1 ? 0 : ruleIndex.value) changeGunRule(ruleIndex.value === -1 ? 0 : ruleIndex.value)
} else { } else {
...@@ -1135,6 +1144,7 @@ ...@@ -1135,6 +1144,7 @@
onPlayerModalCancel, onPlayerModalCancel,
onPlayerSubmit, onPlayerSubmit,
waveOptions, waveOptions,
updateWaveOptions,
// 人员列表 // 人员列表
keyword, keyword,
pagination, pagination,
......
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