Compare commits
2 Commits
98c831eff0
...
6385acd43b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6385acd43b | ||
|
|
c37b6d8f6f |
@@ -959,6 +959,7 @@ import {
|
|||||||
ATTACHMENT_TYPES,
|
ATTACHMENT_TYPES,
|
||||||
ATTACHMENT_TYPE_LABELS
|
ATTACHMENT_TYPE_LABELS
|
||||||
} from '@/api/martial/attachment'
|
} from '@/api/martial/attachment'
|
||||||
|
import { getToken } from '@/utils/auth'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CompetitionManagement',
|
name: 'CompetitionManagement',
|
||||||
@@ -1002,6 +1003,7 @@ export default {
|
|||||||
propsHttp: {
|
propsHttp: {
|
||||||
res: 'data',
|
res: 'data',
|
||||||
},
|
},
|
||||||
|
headers: { 'Blade-Auth': 'bearer ' + getToken() },
|
||||||
action: '/blade-resource/oss/endpoint/put-file'
|
action: '/blade-resource/oss/endpoint/put-file'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
v-for="item in competitionList"
|
v-for="item in competitionList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.competitionName"
|
:label="item.competitionName"
|
||||||
:value="item.id"
|
:value="String(item.id)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
v-for="item in projectList"
|
v-for="item in projectList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.projectName"
|
:label="item.projectName"
|
||||||
:value="item.id"
|
:value="String(item.id)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -146,14 +146,14 @@
|
|||||||
show-overflow-tooltip
|
show-overflow-tooltip
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="deductionPoints"
|
prop="deductionPoint"
|
||||||
label="扣分值(分)"
|
label="扣分值(分)"
|
||||||
width="120"
|
width="120"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag type="danger" effect="dark">
|
<el-tag type="danger" effect="dark">
|
||||||
-{{ row.deductionPoints }}
|
-{{ row.deductionPoint }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -225,7 +225,7 @@
|
|||||||
v-for="item in competitionList"
|
v-for="item in competitionList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.competitionName"
|
:label="item.competitionName"
|
||||||
:value="item.id"
|
:value="String(item.id)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
v-for="item in projectList"
|
v-for="item in projectList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.projectName"
|
:label="item.projectName"
|
||||||
:value="item.id"
|
:value="String(item.id)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -251,9 +251,9 @@
|
|||||||
maxlength="100"
|
maxlength="100"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="扣分值(分)" prop="deductionPoints">
|
<el-form-item label="扣分值(分)" prop="deductionPoint">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
v-model="form.deductionPoints"
|
v-model="form.deductionPoint"
|
||||||
:min="0.1"
|
:min="0.1"
|
||||||
:max="10"
|
:max="10"
|
||||||
:precision="1"
|
:precision="1"
|
||||||
@@ -317,7 +317,7 @@
|
|||||||
v-for="item in projectList.filter(p => p.id !== cloneForm.sourceProjectId)"
|
v-for="item in projectList.filter(p => p.id !== cloneForm.sourceProjectId)"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.projectName"
|
:label="item.projectName"
|
||||||
:value="item.id"
|
:value="String(item.id)"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -389,6 +389,7 @@ const queryParams = reactive({
|
|||||||
size: 10,
|
size: 10,
|
||||||
competitionId: null,
|
competitionId: null,
|
||||||
projectId: null,
|
projectId: null,
|
||||||
|
itemName: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
@@ -396,7 +397,8 @@ const form = reactive({
|
|||||||
id: null,
|
id: null,
|
||||||
competitionId: null,
|
competitionId: null,
|
||||||
projectId: null,
|
projectId: null,
|
||||||
deductionPoints: 0.5,
|
itemName: '',
|
||||||
|
deductionPoint: 0.5,
|
||||||
sortOrder: 0,
|
sortOrder: 0,
|
||||||
description: ''
|
description: ''
|
||||||
})
|
})
|
||||||
@@ -421,7 +423,7 @@ const rules = {
|
|||||||
{ required: true, message: '请输入扣分项名称', trigger: 'blur' },
|
{ required: true, message: '请输入扣分项名称', trigger: 'blur' },
|
||||||
{ min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur' }
|
{ min: 2, max: 100, message: '长度在 2 到 100 个字符', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
deductionPoints: [
|
deductionPoint: [
|
||||||
{ required: true, message: '请输入扣分值', trigger: 'blur' }
|
{ required: true, message: '请输入扣分值', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
sortOrder: [
|
sortOrder: [
|
||||||
@@ -504,10 +506,17 @@ const fetchData = async () => {
|
|||||||
|
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
|
// 过滤掉空字符串的参数
|
||||||
|
const params = {}
|
||||||
|
Object.keys(queryParams).forEach(key => {
|
||||||
|
if (queryParams[key] !== '' && queryParams[key] !== null && queryParams[key] !== undefined) {
|
||||||
|
params[key] = queryParams[key]
|
||||||
|
}
|
||||||
|
})
|
||||||
const res = await getDeductionList(
|
const res = await getDeductionList(
|
||||||
queryParams.current,
|
queryParams.current,
|
||||||
queryParams.size,
|
queryParams.size,
|
||||||
queryParams
|
params
|
||||||
)
|
)
|
||||||
// 根据axios响应拦截器的处理,数据在 res.data.data 中
|
// 根据axios响应拦截器的处理,数据在 res.data.data 中
|
||||||
const data = res.data?.data || {}
|
const data = res.data?.data || {}
|
||||||
@@ -535,7 +544,7 @@ const handleReset = () => {
|
|||||||
size: 10,
|
size: 10,
|
||||||
competitionId: competitionId,
|
competitionId: competitionId,
|
||||||
projectId: null,
|
projectId: null,
|
||||||
itemName: ''
|
itemName: '',
|
||||||
})
|
})
|
||||||
if (competitionId) {
|
if (competitionId) {
|
||||||
fetchData()
|
fetchData()
|
||||||
@@ -555,11 +564,22 @@ const handleAdd = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
const handleEdit = (row) => {
|
const handleEdit = async (row) => {
|
||||||
dialogTitle.value = '编辑扣分项'
|
dialogTitle.value = '编辑扣分项'
|
||||||
Object.keys(form).forEach((key) => {
|
Object.keys(form).forEach((key) => {
|
||||||
form[key] = row[key]
|
form[key] = row[key]
|
||||||
})
|
})
|
||||||
|
// Convert competitionId to string for el-select matching
|
||||||
|
if (form.competitionId) {
|
||||||
|
form.competitionId = String(form.competitionId)
|
||||||
|
}
|
||||||
|
if (form.projectId) {
|
||||||
|
form.projectId = String(form.projectId)
|
||||||
|
}
|
||||||
|
// Load project list for the competition first
|
||||||
|
if (form.competitionId) {
|
||||||
|
await loadProjectList(form.competitionId)
|
||||||
|
}
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -670,7 +690,7 @@ const resetForm = () => {
|
|||||||
competitionId: null,
|
competitionId: null,
|
||||||
projectId: null,
|
projectId: null,
|
||||||
itemName: '',
|
itemName: '',
|
||||||
deductionPoints: 0.5,
|
deductionPoint: 0.5,
|
||||||
sortOrder: 0,
|
sortOrder: 0,
|
||||||
description: ''
|
description: ''
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user