..
This commit is contained in:
+15
-3
@@ -130,6 +130,18 @@
|
||||
<artifactId>nutzboot-starter-swagger</artifactId>
|
||||
<version>${nutzboot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutz-plugins-event</artifactId>
|
||||
<version>${nutz.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.nutz</groupId>
|
||||
<artifactId>nutz-plugins-apidoc</artifactId>
|
||||
<version>1.r.70-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.vdurmont</groupId>
|
||||
<artifactId>emoji-java</artifactId>
|
||||
@@ -338,9 +350,9 @@
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>always</updatePolicy>
|
||||
</snapshots>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<!-- <releases>-->
|
||||
<!-- <enabled>false</enabled>-->
|
||||
<!-- </releases>-->
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
|
||||
+7
-1
@@ -1,17 +1,23 @@
|
||||
package com.budwk.app.client.module.activity.controller;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.EventListener;
|
||||
|
||||
@IocBean
|
||||
@At("/client/home")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "客户端首页", value = "/client/home")
|
||||
public class ClientHomeController {
|
||||
|
||||
@At("")
|
||||
@Ok("re")
|
||||
public String index(){
|
||||
@ApiOperation(value = "首页", nickname = "", httpMethod = "GET")
|
||||
public String index() {
|
||||
return "beetl:/client/home/index.html";
|
||||
}
|
||||
|
||||
|
||||
+33
-10
@@ -4,9 +4,12 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.module.activity.models.ActGroup;
|
||||
import com.budwk.app.module.activity.models.Activity;
|
||||
import com.budwk.app.module.activity.models.ActivityItem;
|
||||
import com.budwk.app.module.activity.service.ActivityManageService;
|
||||
import com.budwk.app.module.activity.vo.page.ActScoreEnterPageForm;
|
||||
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
@@ -27,9 +30,9 @@ import java.util.List;
|
||||
@IocBean
|
||||
@At("/platform/activity/scoreEnter")
|
||||
@Ok("json:full")
|
||||
@Api(tags = "成绩录入", value = "/platform/activity/scoreEnter")
|
||||
public class ActScoreEnterController {
|
||||
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
@@ -50,7 +53,6 @@ public class ActScoreEnterController {
|
||||
@At()
|
||||
@SaCheckPermission("activity.scoreEnter")
|
||||
public Result pageData(ActScoreEnterPageForm pageForm) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
t1.*
|
||||
@@ -60,22 +62,43 @@ public class ActScoreEnterController {
|
||||
ORDER BY t1.sort asc
|
||||
""").setParam("id", pageForm.getActivityId());
|
||||
|
||||
return Result.success(activityService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(),sql));
|
||||
return Result.success(activityService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取分组列表
|
||||
* @param activityId
|
||||
* @return
|
||||
*/
|
||||
@At()
|
||||
@At("/list-activity")
|
||||
@SaCheckPermission("activity.scoreEnter")
|
||||
public Result getGroupList(Long activityId){
|
||||
@ApiOperation(value = "获取活动列表", nickname = "/list-activity", httpMethod = "GET")
|
||||
public Result listAct(Integer year) {
|
||||
Sql sql = Sqls.create("select id,title from activity $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(startTime)", "=", year);
|
||||
sql.setCondition(cnd);
|
||||
return Result.success(activityService.listMap(sql));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取队伍
|
||||
*/
|
||||
@At("/list-group/?")
|
||||
@SaCheckPermission("activity.scoreEnter")
|
||||
@ApiOperation(value = "获取队伍", nickname = "/list-group", httpMethod = "GET")
|
||||
public Result listGroup(Long activityId) {
|
||||
List<ActGroup> groupList = activityService.dao().query(ActGroup.class, Cnd.where(ActGroup::getActivityId, "=", activityId));
|
||||
return Result.success(groupList);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目列表
|
||||
*/
|
||||
@At("/list-item/?")
|
||||
@SaCheckPermission("activity.scoreEnter")
|
||||
@ApiOperation(value = "获取项目列表", nickname = "/list-item", httpMethod = "GET")
|
||||
public Result listItem(Long activityId) {
|
||||
List<ActivityItem> items = dao.query(ActivityItem.class, Cnd.where(ActivityItem::getActivityId, "=", activityId).asc(ActivityItem::getSort));
|
||||
return Result.success(items);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.budwk.app.module.activity.service.ActUserService;
|
||||
import com.budwk.app.module.activity.vo.page.ActSignInUserPageForm;
|
||||
import com.budwk.app.module.activity.vo.page.ActUserPageForm;
|
||||
import com.budwk.app.web.commons.slog.annotation.SLog;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
|
||||
@@ -4,30 +4,29 @@ layout("/layouts/platform_1.html"){
|
||||
<div id="app">
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
@change="getActivityOptions"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
@change="listAct"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属活动</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.activityId" placeholder="请选择活动">
|
||||
<el-select v-model="pageForm.activityId" placeholder="请选择活动" @change="activityChange">
|
||||
<el-option
|
||||
v-for="item in activityOptions"
|
||||
:key="item.id"
|
||||
:label="item.title"
|
||||
:value="item.id">
|
||||
v-for="item in activityOptions"
|
||||
:key="item.id"
|
||||
:label="item.title"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -41,70 +40,98 @@ layout("/layouts/platform_1.html"){
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt-3">
|
||||
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
|
||||
<el-table-column label="序号" prop="index" header-align="center" align="center" width="50">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目名称" prop="name"></el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<el-button type="text" @click="$refs.addOrUpdateRef.onOpen(row)">录入成绩</el-button>
|
||||
<el-table-column label="队伍" prop="groupName" header-align="center" align="center"
|
||||
width="100px"></el-table-column>
|
||||
|
||||
<el-table-column v-for="item in itemOptions" :key="item.id" :label="item.name" show-overflow-tooltip
|
||||
width="10%">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<span v-html="formatName(item.name)"></span>
|
||||
</template>
|
||||
<el-table-column label="成绩" min-width="50px"></el-table-column>
|
||||
<el-table-column label="名次" min-width="50px"></el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
<add-or-update ref="addOrUpdateRef" @refresh="doSearch"></add-or-update>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('addOrUpdate.js'){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"add-or-update": addOrUpdate,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
activityOptions: []
|
||||
activityOptions: [],
|
||||
groupOptions: [],
|
||||
itemOptions: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
columnWidth() {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getActivityOptions() {
|
||||
$.post("/platform/activity/scoreEnter/getActivityOptions", {year: this.pageForm.year}).then(res => {
|
||||
formatName(name) {
|
||||
if (!name) return ""
|
||||
return name.match(/.{1,4}/g)?.join("<br>") || ""
|
||||
},
|
||||
listAct() {
|
||||
$.get("/platform/activity/scoreEnter/list-activity", this.pageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (res.data && res.data.length > 0) {
|
||||
this.$set(this.pageForm, "activityId", res.data[0].id)
|
||||
} else {
|
||||
this.$set(this.pageForm, "activityId", "")
|
||||
this.activityOptions = res.data
|
||||
if (this.activityOptions.length > 0) {
|
||||
this.pageForm.activityId = this.activityOptions[0].id
|
||||
this.activityChange()
|
||||
}
|
||||
this.activityOptions = res.data;
|
||||
this.doSearch()
|
||||
} else {
|
||||
this.$message.error(res.msg);
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
listGroup() {
|
||||
$.get("/platform/activity/scoreEnter/list-group/" + this.pageForm.activityId).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.groupOptions = res.data
|
||||
this.buildTableData()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
listItem() {
|
||||
$.get("/platform/activity/scoreEnter/list-item/" + this.pageForm.activityId).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.itemOptions = res.data
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
activityChange() {
|
||||
this.listGroup()
|
||||
this.listItem()
|
||||
},
|
||||
buildTableData() {
|
||||
this.tableData = this.groupOptions.map((group) => {
|
||||
return{
|
||||
groupName: group.groupName
|
||||
}
|
||||
})
|
||||
console.log(this.tableData)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getActivityOptions()
|
||||
this.listAct()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -72,6 +72,12 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的活动"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/activity/rank/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "成绩查询"
|
||||
}
|
||||
}
|
||||
],
|
||||
"globalStyle": {
|
||||
|
||||
Reference in New Issue
Block a user