Commit 7f1f3ec1 authored by daniel's avatar daniel

fix(gunRule): 枪次编辑优化

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