This commit is contained in:
Paidax
2024-12-09 08:49:40 +08:00
parent f7dd11b067
commit 1211e93a26
5 changed files with 528 additions and 457 deletions
@@ -1,8 +1,8 @@
package io.v.nutz.sys.controllers.platform.sys;
import io.v.nutz.base.enums.Env;
import io.v.nutz.base.result.Result;
import io.v.nutz.base.utils.LoginUtil;
import io.v.nutz.base.enums.Env;
import io.v.nutz.sys.models.Sys_log;
import io.v.nutz.sys.models.Sys_role;
import io.v.nutz.sys.models.Sys_unit;
@@ -24,7 +24,10 @@ import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.*;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.LockedAccountException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.crypto.hash.Sha256Hash;
import org.apache.shiro.session.SessionException;
@@ -189,11 +192,7 @@ public class SysLoginController {
public Object doLogin(@Attr("platformLoginToken") AuthenticationToken token,String loginType, HttpServletRequest req, HttpSession session) {
int errCount = NumberUtils.toInt(Strings.sNull(SecurityUtils.getSubject().getSession(true).getAttribute("platformErrCount")));
try {
if ("SMS_CODE".equals(loginType)){
loginUtil.doLogin(token, req, session, LoginUtil.LoginOrigin.SMS_CODE);
} else {
loginUtil.doLogin(token, req, session, LoginUtil.LoginOrigin.WEB);
}
loginUtil.doLogin(token, req, session, LoginUtil.LoginOrigin.WEB);
return Result.success("login.success");
} catch (CaptchaIncorrectException e) {
return Result.error(1, "login.error.captcha");
@@ -208,7 +207,7 @@ public class SysLoginController {
} catch (AuthenticationException e) {
errCount++;
SecurityUtils.getSubject().getSession(true).setAttribute("platformErrCount", errCount);
return Result.error(5, e.getMessage());
return Result.error(5, "login.error.user");
} catch (Exception e) {
errCount++;
SecurityUtils.getSubject().getSession(true).setAttribute("platformErrCount", errCount);
@@ -2,17 +2,17 @@ package io.v.nutz.sys.controllers.platform.sys;
import cn.wizzer.framework.base.Result;
import io.v.nutz.base.annontation.ViReturn;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.base.dao.CndPlus;
import io.v.nutz.base.query.PageForm;
import io.v.nutz.zhgh.proposal.models.ProposalConfig;
import io.v.nutz.zhgh.proposal.models.ProposalUndertake;
import io.v.nutz.base.service.AsyncService;
import io.v.nutz.base.service.ViService;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.Sys_unit;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysUnitClassService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.zhgh.proposal.models.ProposalConfig;
import io.v.nutz.zhgh.proposal.models.ProposalUndertake;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
@@ -195,7 +195,7 @@ public class SysUnitMangeController {
try {
List list = new ArrayList();
Sys_unit school = sysUnitService.fetch("1");
Sys_unit school = sysUnitService.fetch("100");
school.setChild(child(school.getId()));
list.add(school);
@@ -326,7 +326,7 @@
<div v-else>
<h3 style="text-align: center; letter-spacing: 6px">工会会员登记表</h3>
<div style="text-align: right; letter-spacing: 2px">填表日期:{{ moment(formData.applyTime).format("YYYY年MM月DD日") }}</div>
<!-- <div style="text-align: right; letter-spacing: 2px">填表日期:{{ moment(formData.applyTime).format("YYYY年MM月DD日") }}</div>-->
<el-descriptions :column="3" border class="descriptions-form">
<el-descriptions-item label="姓名">{{ formData.username }}</el-descriptions-item>
@@ -7,11 +7,8 @@ layout("/layouts/platform.html"){
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="search">
@@ -19,20 +16,25 @@ layout("/layouts/platform.html"){
<div class="search-item-label">年&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年度"
type="year" style="width: 100%"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
placeholder="选择年度"
type="year"
style="width: 100%"
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-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
clearable
style="width: 100%" v-model="pageForm.name">
</el-input>
<el-input
@keyup.enter.native="doSearch"
clearable
placeholder="请输入内容"
clearable
style="width: 100%"
v-model="pageForm.name"
></el-input>
</div>
</div>
<div class="search-query">
@@ -47,25 +49,53 @@ layout("/layouts/platform.html"){
</template>
</table-tool>
<el-table :data="tableData" :size="tableSize">
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号" type="index"
width="80px"></el-table-column>
<el-table-column
:index="indexMethod"
align="center"
header-align="center"
label="序号"
type="index"
width="80px"
></el-table-column>
<el-table-column label="社团名称" prop="name" sortable align="center" header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="社团类型" prop="typeName" sortable align="center" header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="申请时间" prop="create_time" sortable align="center" header-align="center"
show-overflow-tooltip>
<el-table-column
label="社团名称"
prop="name"
sortable
align="center"
header-align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="社团类型"
prop="typeName"
sortable
align="center"
header-align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column label="申请时间" prop="create_time" sortable align="center" header-align="center" show-overflow-tooltip>
<template slot-scope="{row}">
<span>{{ moment(row.create_time).format('YYYY-MM-DD') }}</span>
</template>
</el-table-column>
<el-table-column label="联系人" prop="fzrName" sortable align="center" header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="发起人" prop="sponsorName" sortable align="center" header-align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="状态" prop="stateName" sortable align="center" header-align="center"
show-overflow-tooltip>
<el-table-column
label="联系人"
prop="fzrName"
sortable
align="center"
header-align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="发起人"
prop="sponsorName"
sortable
align="center"
header-align="center"
show-overflow-tooltip
></el-table-column>
<el-table-column label="状态" prop="stateName" sortable align="center" header-align="center" show-overflow-tooltip>
<template slot-scope="{row}">
<span :style="'color: ' + row.stateColor">{{ row.stateName }}</span>
</template>
@@ -74,10 +104,19 @@ layout("/layouts/platform.html"){
<el-table-column label="操作" width="300px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button :disabled="![800,820,850,880].includes(row.state)" @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button v-if="${@shiro.hasRole('sysadmin')} || ${@shiro.hasRole('A06')} || ${@shiro.hasRole('xxhgly')}"
@click="deleteDo(row)" size="mini" type="danger">删除</el-button>
<el-button v-else :disabled="![800,820,850,880].includes(row.state)" @click="deleteDo(row)" size="mini" type="danger">删除</el-button>
<!-- <el-button :disabled="![800,820,850,880].includes(row.state)" @click="openEdit(row)" size="mini" type="primary">编辑</el-button>-->
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button
v-if="${@shiro.hasRole('sysadmin')} || ${@shiro.hasRole('A06')} || ${@shiro.hasRole('xxhgly')}"
@click="deleteDo(row)"
size="mini"
type="danger"
>
删除
</el-button>
<el-button v-else :disabled="![800,820,850,880].includes(row.state)" @click="deleteDo(row)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column>
</el-table>
@@ -88,26 +127,23 @@ layout("/layouts/platform.html"){
<template #view>
<club-regist-info ref="info"></club-regist-info>
</template>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
components: {
'club-regist-info': httpVueLoader('/components/club/clubRegistInfo.vue'),
"club-regist-info": httpVueLoader("/components/club/clubRegistInfo.vue")
},
data() {
return {
pageForm: {
name: ''
name: ""
},
tableData: [],
schoolAudit: false,
schoolAudit: false
}
},
methods: {
@@ -116,42 +152,42 @@ layout("/layouts/platform.html"){
this.pageData()
},
openAdd() {
sublime.jumpPagePjax('/platform/sys/club/clubRegistApply')
sublime.jumpPagePjax("/platform/sys/club/clubRegistApply")
},
openView(row) {
const {id} = row
const { id } = row
this.$refs.guava.view()
this.$nextTick(() => {
this.$refs.info.getInfo(id)
})
},
openEdit(row) {
sublime.jumpPagePjax('/platform/sys/club/clubRegistApply?id=' + row.id)
sublime.jumpPagePjax("/platform/sys/club/clubRegistApply?id=" + row.id)
},
async deleteDo(row) {
const confirm = await this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
const confirm = await this.$confirm("此操作将永久删除, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
const resp = await $.post('/platform/sys/club/clubMyApply/doDelete', {id: row.id})
const resp = await $.post("/platform/sys/club/clubMyApply/doDelete", { id: row.id })
this.notifySuccess("删除成功")
this.doSearch()
}
},
async pageData() {
const resp = await $.post("/platform/sys/club/clubMyApply/pageData", this.pageForm);
const resp = await $.post("/platform/sys/club/clubMyApply/pageData", this.pageForm)
if (resp.code === 0) {
this.tableData = resp.data.list;
this.pageForm.totalCount = resp.data.totalCount;
this.tableData = resp.data.list
this.pageForm.totalCount = resp.data.totalCount
} else {
this.$message({
message: resp.msg,
type: 'error'
});
type: "error"
})
}
},
}
},
async created() {
await this.pageData()
File diff suppressed because it is too large Load Diff