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