Commit f2b71c1e authored by daniel's avatar daniel

feat(markNoSelect): 优化规则,使用组别名进行上传

parent fef78062
...@@ -158,7 +158,7 @@ public class CommonController { ...@@ -158,7 +158,7 @@ public class CommonController {
@PostMapping("uploadSelectMarkNoBg") @PostMapping("uploadSelectMarkNoBg")
@ApiOperation(value = "选号背景上传") @ApiOperation(value = "选号背景上传")
public Result<?> uploadSelectMarkNoBg(@RequestPart @RequestParam("file") MultipartFile file,@RequestParam(value = "gCmptId") Integer gCmptId,@RequestParam(value = "roadId") Integer roadId) { public Result<?> uploadSelectMarkNoBg(@RequestPart @RequestParam("file") MultipartFile file,@RequestParam(value = "gCmptId") Integer gCmptId,@RequestParam(value = "roadId") String roadId) {
try { try {
// 检查文件大小是否超过1MB // 检查文件大小是否超过1MB
long maxFileSize = 5 * 1024 * 1024; // 1MB long maxFileSize = 5 * 1024 * 1024; // 1MB
......
...@@ -159,12 +159,12 @@ ...@@ -159,12 +159,12 @@
:remote="true"/> :remote="true"/>
<n-space v-else> <n-space v-else>
<!-- 只允许上传png --> <!-- 只允许上传png -->
<n-card > <n-card v-if="roadNames?.length">
<div class="flex flex-col gap-y-3"> <div class="flex flex-col gap-y-3">
<h4>组别信息</h4> <h4>组别信息</h4>
<!-- 组别 --> <!-- 组别 -->
<n-tag @click="changeRoad(index)" :type="roadIndex===index?'success':'default'" :key="road.id" v-for="(road,index) in cmptInfo?.roads"> <n-tag @click="changeRoad(index)" :type="roadIndex===index?'success':'default'" :key="roadName" v-for="(roadName,index) in roadNames">
{{road.name}} {{roadName}}
</n-tag> </n-tag>
<n-alert title="图片要求" type="warning"> <n-alert title="图片要求" type="warning">
建议上传350x350png (1:1)格式 2MB以内 建议上传350x350png (1:1)格式 2MB以内
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
</n-upload> </n-upload>
</div> </div>
</n-card> </n-card>
<n-card title="选号底图" > <n-card title="选号底图">
<n-alert title="未上传" v-if="!certExit" type="warning"> <n-alert title="未上传" v-if="!certExit" type="warning">
</n-alert> </n-alert>
<n-image <n-image
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
const uploadUrl = window.location.origin + '/api-common/v1/upload?folder=' + 'gk/invoice' + '&cmptId=' + getCId() const uploadUrl = window.location.origin + '/api-common/v1/upload?folder=' + 'gk/invoice' + '&cmptId=' + getCId()
const BASE_ECC_URL = "https://ecc.geexek.com" const BASE_ECC_URL = "https://ecc.geexek.com"
// const BASE_ECC_URL = "http://localhost:8081"
// 人员列表 // 人员列表
const PLAYERS_URL = BASE_ECC_URL + '/api-pick/v1/enroll-page' const PLAYERS_URL = BASE_ECC_URL + '/api-pick/v1/enroll-page'
const PLAYERS_EXPORT_URL = BASE_ECC_URL + '/api-pick/v1/export-markno-enroll?cmptId=' + getCId() const PLAYERS_EXPORT_URL = BASE_ECC_URL + '/api-pick/v1/export-markno-enroll?cmptId=' + getCId()
...@@ -248,6 +249,8 @@ ...@@ -248,6 +249,8 @@
// 获取赛事信息 // 获取赛事信息
const GET_CMPT_URL = "https://timerbackend.geexek.com/getCmpt.do?cmptId=" + getCId() const GET_CMPT_URL = "https://timerbackend.geexek.com/getCmpt.do?cmptId=" + getCId()
// 获取组别信息
const GET_CMPT_ROADNAME_URL = BASE_ECC_URL + "/api-pick/v1/distinct-road-names/" + getCId()
const MyApp = defineComponent({ const MyApp = defineComponent({
name: 'MyApp', name: 'MyApp',
...@@ -258,6 +261,7 @@ ...@@ -258,6 +261,7 @@
const loading = ref(false) const loading = ref(false)
// 赛事信息 // 赛事信息
const cmptInfo = ref() const cmptInfo = ref()
const roadNames = ref([])
/***----------------选手名单相关 start -----------------*/ /***----------------选手名单相关 start -----------------*/
const tabIndex = ref(1) const tabIndex = ref(1)
const isPlayerList = computed(() => tabIndex.value === 1) const isPlayerList = computed(() => tabIndex.value === 1)
...@@ -396,7 +400,8 @@ ...@@ -396,7 +400,8 @@
if (value !== 3) { if (value !== 3) {
fetchData() fetchData()
} else { } else {
getCmptInfo() // getCmptInfo()
getRoadNames()
} }
} }
// 上传完成 // 上传完成
...@@ -559,7 +564,7 @@ ...@@ -559,7 +564,7 @@
// 图片地址 // 图片地址
const bgFileList = ref([]) const bgFileList = ref([])
// 组别id // 组别id
const roadId = computed(() => cmptInfo.value?.roads ? cmptInfo.value.roads[roadIndex.value].id : '') const roadId = computed(() => roadNames.value?.[roadIndex.value] || 'unknown')
// 时间值 // 时间值
const t = ref(0) const t = ref(0)
// 选号地址 // 选号地址
...@@ -627,6 +632,24 @@ ...@@ -627,6 +632,24 @@
message.error(res.message) message.error(res.message)
} }
} }
// 获取赛事信息
const getRoadNames = async () => {
loading.value = true
const [err, res] = await to(fetch(GET_CMPT_ROADNAME_URL, {
method: "GET",
}).then(res => res.json()))
loading.value = false
if (err) {
message.error(err)
return
}
if (res.code === 200) {
roadNames.value = res.data
checkCert()
} else {
message.error(res.message)
}
}
/***---------------- 自助选号背景 end -----------------*/ /***---------------- 自助选号背景 end -----------------*/
onMounted(() => { onMounted(() => {
fetchData() fetchData()
...@@ -668,6 +691,7 @@ ...@@ -668,6 +691,7 @@
certExit, certExit,
bgFileList, bgFileList,
bgImage, bgImage,
roadNames,
changeRoad, changeRoad,
onFileUploadBg, onFileUploadBg,
beforeUploadBg beforeUploadBg
......
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