This commit is contained in:
2024-07-30 08:49:57 +08:00
parent e67b63616e
commit 048a7c13b3
88 changed files with 7218 additions and 7011 deletions
@@ -4,9 +4,10 @@ package io.v.nutz.hd.controller.ca;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.FileService;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.dao.CndPlus;
import io.v.nutz.hd.models.Hd_ca_sbxx;
import io.v.nutz.hd.services.*;
import io.v.nutz.modules.models.PageForm;
@@ -18,7 +19,6 @@ import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.cri.Static;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
@@ -31,15 +31,8 @@ import org.nutz.mvc.annotation.Param;
import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
@IocBean
@At("/platform/hd/childhd/sczp")
@@ -65,6 +58,9 @@ public class HdChildAddZpController {
@Inject
private BaseService baseService;
@Inject
private FileService fileService;
@At("")
@Ok("beetl:/platform/hd/ca/zpMange.html")
@RequiresPermissions("hd.child.sczp")
@@ -76,21 +72,13 @@ public class HdChildAddZpController {
* 获取当前人的工会name
*/
@At
@RequiresPermissions("hd.child.sczp")
public String getGhname() {
Sql sql = Sqls.create("SELECT\n" +
"\tgh.unionname AS ghname \n" +
"FROM\n" +
"\tsys_user u\n" +
"\tLEFT JOIN sys_unit dw ON dw.id = u.unitid\n" +
"\tLEFT JOIN sys_union gh ON gh.id = dw.unionid \n" +
"WHERE\n" +
"\tu.id = @userid");
sql.setParam("userid", ShiroUtil.getPrincipalProperty("id"));
List<Record> list = baseService.list(sql);
return list.size() > 0 ? list.get(0).getString("ghname") : "";
return Optional.ofNullable(Vi.getUnion()).map(v -> v.getUnionname()).orElse(null);
}
@At
@RequiresPermissions("hd.child.sczp")
public Object initformHdxxlist() {
try {
Sql sql = Sqls.create("select * from hd_wm_xx where hdtype =2 and hdflag = 1 and hdkssj<=NOW() and hdjssj >=NOW()");
@@ -101,52 +89,59 @@ public class HdChildAddZpController {
}
@At
public Object pageData(PageForm page, @Param("searchKeyword") String searchKeyword, @Param("searchName") String searchName, String hdid, String hdlb, String zplb, String unionId, String unitId,
String pageOrderName, String pageOrderBy, String year) {
@ViReturn
public Object pageData(PageForm page,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "hdlb", required = false) String hdlb,
@Param(value = "zplb", required = false) String zplb,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "year", required = false) String year) {
try {
Cnd cnd = CndPlus.create();
Sql sql = Sqls.create("SELECT\n" +
"\txx.*,\n" +
"\tsbr.username AS sbrname,\n" +
"\tsbr.loginname,\n" +
"\thd.hdname,\n" +
"\thd.hdkssj,\n" +
"\thd.hdjssj,\n" +
"\tzplb.zname as zplbname,\n" +
"\tlb.lname as hdlbname,\n" +
"\tdw.name as dwname,\n" +
"\tgh.unionname as ghname\n" +
"FROM\n" +
"\thd_ca_sbxx xx\n" +
"\tLEFT JOIN sys_user sbr ON sbr.id = xx.sbr\n" +
"\tleft join sys_unit dw on dw.id = sbr.unitid\n" +
"\tLEFT JOIN sys_union gh ON gh.id = dw.unionid\n" +
"\tleft join hd_wm_xx hd on hd.hdid = xx.hdid\n" +
"\tleft join hd_wm_zplb zplb on zplb.zid = xx.zplb\n" +
"\tleft join hd_wm_lb lb on lb.lid = xx.hdlb $condition");
cnd.and(new Static("1=1 and xx.hdid in (select hdid from hd_wm_xx where hdtype =2)"));
Sql sql = Sqls.create("""
SELECT
xx.*,
sbr.username AS sbrname,
sbr.loginname,
hd.hdname,
hd.hdkssj,
hd.hdjssj,
zplb.zname as zplbname,
lb.lname as hdlbname,
dw.name as dwname,
gh.unionname as ghname
FROM
hd_ca_sbxx xx
LEFT JOIN sys_user sbr ON sbr.id = xx.sbr
left join sys_unit dw on dw.id = sbr.unitid
LEFT JOIN sys_union gh ON gh.id = dw.unionid
left join hd_wm_xx hd on hd.hdid = xx.hdid
left join hd_wm_zplb zplb on zplb.zid = xx.zplb
left join hd_wm_lb lb on lb.lid = xx.hdlb
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("xx.hdid", "in", Sqls.create("select hdid from hd_wm_xx where hdtype =2"));
if (!ShiroUtil.hasAnyRoles("H04,sysadmin")) {
Vi.cndPlus(cnd, "xx.sbr", "=", ShiroUtil.getPrincipalProperty("id"));
cnd.and("xx.sbr", "=", ShiroUtil.getPrincipalProperty("id"));
}
Vi.cndPlus(cnd, "xx.hdid", "=", hdid);
Vi.cndPlus(cnd, "xx.hdlb", "=", hdlb);
Vi.cndPlus(cnd, "xx.zplb", "=", zplb);
Vi.cndPlus(cnd, "dw.id", "=", unitId);
Vi.cndPlus(cnd, "gh.id", "=", unionId);
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdlb", "=", hdlb);
cnd.andEX("xx.zplb", "=", zplb);
cnd.andEX("dw.id", "=", unitId);
cnd.andEX("gh.id", "=", unionId);
cnd.andEX("YEAR(xx.sbsj)", "=", year);
if (Strings.isNotBlank(page.getSearchName()) && Strings.isNotBlank(page.getSearchKeyword())) {
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
}
if (Strings.isNotBlank(year)) {
Vi.cndPlus(cnd, "YEAR(xx.sbsj)", "=", year);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderBy)) {
cnd.orderBy(pageOrderName, pageOrderBy.equals("asc") ? "asc" : "desc");
if (Strings.isNotBlank(page.getPageOrderName()) && Strings.isNotBlank(page.getPageOrderBy())) {
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
} else {
cnd.desc("sbr.username");
cnd.desc("gh.unionname");
cnd.desc("dw.name");
}
sql.setCondition(cnd);
Pagination pagination = baseService.listPage(page.getPageNumber(), page.getPageSize(), sql);
return Result.success().addData(pagination);
@@ -156,12 +151,10 @@ public class HdChildAddZpController {
}
}
@Inject
private FileService fileService;
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doSubmit(@Param("data") String data, @Param("file") TempFile[] files) {
@RequiresPermissions("hd.child.sczp")
public Object doSubmit(@Param("data") String data, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
try {
Hd_ca_sbxx sbxx = Json.fromJson(Hd_ca_sbxx.class, data);
sbxx.setSbr(ShiroUtil.getPrincipalProperty("id").toString());
@@ -179,7 +172,8 @@ public class HdChildAddZpController {
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doEdit(@Param("data") String data, String readytodelfile, @Param("file") TempFile[] files) {
@RequiresPermissions("hd.child.sczp")
public Object doEdit(@Param("data") String data, String readytodelfile, @Param(value = "file", required = false) TempFile[] files) {
try {
Hd_ca_sbxx sbxx = Json.fromJson(Hd_ca_sbxx.class, data);
hdCasbxxService.updateIgnoreNull(sbxx);
@@ -198,6 +192,8 @@ public class HdChildAddZpController {
}
@At
@ViReturn
@RequiresPermissions("hd.child.sczp")
public Object findOne(String id) {
try {
Hd_ca_sbxx sbxx = hdCasbxxService.fetch(id);
@@ -236,26 +232,4 @@ public class HdChildAddZpController {
return Result.error();
}
}
@At
@Ok("void")
public void previewPhoto(String url, HttpServletResponse response) {
try {
String canonicalPath = new File("").getCanonicalPath();
File file = new File(canonicalPath + "/" + url);
FileInputStream fis = new FileInputStream(file);
OutputStream out = response.getOutputStream();
byte[] bs = new byte[1024];
while ((fis.read(bs) != -1)) {
out.write(bs);
}
out.flush();
out.close();
out = null;
fis.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -3,10 +3,13 @@ package io.v.nutz.hd.controller.ca;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.ExcelUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.util.ShiroUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
@@ -15,6 +18,7 @@ import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
@@ -26,57 +30,53 @@ import java.util.List;
@Ok("json:full")
public class HdChildHjxxController {
@Inject
private BaseService baseService;
@At("")
@Ok("re")
@Ok("beetl:/platform/hd/ca/hjxxyl.html")
@RequiresPermissions("hd.child.hjxx")
public String index() {
return "beetl:/platform/hd/ca/hjxxyl.html";
public void index() {
}
@At
public Object pageData(String union, String unit, Integer pageNumber, Integer pageSize, String hdid, String searchName, String searchKeyword) {
@RequiresPermissions("hd.child.hjxx")
@ViReturn
public Object pageData(@Param(value = "union", required = false) String union,
@Param(value = "unit", required = false) String unit,
Integer pageNumber,
Integer pageSize,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword) {
try {
StringBuffer sb = new StringBuffer();
sb.append("select DISTINCT(xx.sbr),sbr.loginname,sbr.username,dw.name as dwname,gh.unionname as ghname,\n" +
"(SELECT COUNT(DISTINCT(a.zplb)) FROM hd_ca_sbxx a WHERE a.sbr = xx.sbr AND a.hdid = @hdid) as hjcount\n" +
"from hd_ca_sbxx xx\n" +
"left join sys_user sbr on sbr.id = xx.sbr\n" +
"left join sys_unit dw on dw.id = sbr.unitid\n" +
"LEFT JOIN sys_union gh ON gh.id = dw.unionid\n" +
"where xx.hdid in (select hdid from hd_wm_xx where hdtype =2)");
sb.append("\tand xx.hdid = @hdid");
Sql sql = Sqls.create("""
select DISTINCT(xx.sbr),
sbr.loginname,
sbr.username,
dw.name as dwname,
gh.unionname as ghname,
(SELECT COUNT(DISTINCT(a.zplb)) FROM hd_ca_sbxx a WHERE a.sbr = xx.sbr AND a.hdid = @hdid) as hjcount
FROM hd_ca_sbxx xx
LEFT JOIN sys_user sbr on sbr.id = xx.sbr
LEFT JOIN sys_unit dw on dw.id = sbr.unitid
LEFT JOIN sys_union gh ON gh.id = dw.unionid
$condition
""").setParam("hdid", hdid);
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
sb.append("\tAND gh.id IN (\n" +
"\tSELECT\n" +
"\t\tgh.id \n" +
"\tFROM\n" +
"\t\tsys_user u\n" +
"\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
"\tLEFT JOIN sys_union gh ON gh.id = n.unionid where u.id = @cuserid)");
cnd.and("gh.id", "=", Vi.getUnionId());
}
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
sb.append("\tand\t" + searchName + "\tlike @searchKeyword");
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (Strings.isNotBlank(union)) {
sb.append(" AND dw.unionid = @union");
}
if (Strings.isNotBlank(unit)) {
sb.append(" AND dw.id = @unit");
}
sb.append(" ORDER BY sbr.username,dw.name,gh.unionname");
Sql sql = Sqls.create(sb.toString());
sql.setParam("hdid", hdid);
sql.setParam("union", union);
sql.setParam("unit", unit);
sql.setParam("searchKeyword", "%" + searchKeyword + "%");
sql.setParam("cuserid", ShiroUtil.getPrincipalProperty("id"));
cnd.and("xx.hdid", "=", hdid);
cnd.andEX("dw.unionid", "=", union);
cnd.andEX("dw.id", "=", unit);
cnd.asc("sbr.username").asc("gh.unioncode").asc("dw.unitcode");
sql.setCondition(cnd);
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
} catch (Exception e) {
@@ -86,6 +86,8 @@ public class HdChildHjxxController {
@At
@Ok("void")
@RequiresPermissions("hd.child.hjxx")
@ViReturn
public void exportExcel(int num, String hdid, HttpServletResponse response) {
HSSFWorkbook wb = null;
String fileName = "";
@@ -1,25 +1,30 @@
package io.v.nutz.hd.controller.ca;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.ExcelUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.hd.services.HdCasbxxFjService;
import io.v.nutz.hd.services.HdWmsbxxService;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.util.ShiroUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
@@ -39,13 +44,13 @@ public class HdChildZpxxController {
@Inject
private BaseService baseService;
@Inject
private Dao dao;
@Inject
private HdCasbxxFjService hdCasbxxFjService;
@At("")
@Ok("beetl:/platform/hd/ca/zpxx.html")
@RequiresPermissions("hd.child.zpxx")
@@ -54,6 +59,9 @@ public class HdChildZpxxController {
}
@At
@RequiresPermissions("hd.child.zpxx")
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object dodelete(String id) {
try {
baseService.clear("hd_ca_sbxx", Cnd.where("id", "=", id));
@@ -65,9 +73,15 @@ public class HdChildZpxxController {
}
@At
@RequiresPermissions("hd.child.zpxx")
@ViReturn
public Object initHdxxlist() {
try {
List<Record> list = baseService.list(Sqls.create("select *,year(hdcjsj) year from hd_wm_xx where hdtype=2 order by hdcjsj"));
String isSysadmin = " and hdcjr is not null";
if (!ShiroUtil.hasRole("sysadmin")) {
isSysadmin = "and hdcjr = '" + ShiroUtil.getUserId() + "'";
}
List<Record> list = baseService.list(Sqls.create("select *,year(hdcjsj) year from hd_wm_xx where hdtype=2 %s order by hdcjsj DESC".formatted(isSysadmin)));
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
Map<Integer, List<Record>> listMap = list.stream().collect(Collectors.groupingBy(v -> v.getInt("year")));
@@ -89,6 +103,8 @@ public class HdChildZpxxController {
}
@At
@RequiresPermissions("hd.child.zpxx")
@ViReturn
public Object gethdlblist(String id) {
try {
List list = baseService.list(Sqls.create("select * from hd_wm_lb where lhdid = @id").setParam("id", id));
@@ -99,6 +115,8 @@ public class HdChildZpxxController {
}
@At
@RequiresPermissions("hd.child.zpxx")
@ViReturn
public Object gethdzplblist(String id) {
try {
List list = baseService.list(Sqls.create("select * from hd_wm_zplb where zlid = @id").setParam("id", id));
@@ -109,72 +127,59 @@ public class HdChildZpxxController {
}
@At
public Object pageData(String union, String unit, Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String hdid, String hdlb, String zplb,
String year) {
@RequiresPermissions("hd.child.zpxx")
@ViReturn
public Object pageData(@Param(value = "union", required = false) String union,
@Param(value = "unit", required = false) String unit,
Integer pageNumber,
Integer pageSize,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "hdlb", required = false) String hdlb,
@Param(value = "zplb", required = false) String zplb,
@Param(value = "year", required = false) String year) {
try {
StringBuffer sb = new StringBuffer();
sb.append("SELECT\n" +
"\txx.*,\n" +
"\tsbr.username AS sbrname,\n" +
"\tsbr.loginname,\n" +
"\thd.hdname,\n" +
"\thd.hdkssj,\n" +
"\thd.hdjssj,\n" +
"\tzplb.zname as zplbname,\n" +
"\tlb.lname as hdlbname,\n" +
"\tdw.name as dwname,\n" +
"\tgh.unionname as ghname\n" +
"FROM\n" +
"\thd_ca_sbxx xx\n" +
"\tLEFT JOIN sys_user sbr ON sbr.id = xx.sbr\n" +
"\tleft join sys_unit dw on dw.id = sbr.unitid\n" +
"\tLEFT JOIN sys_union gh ON gh.id = dw.unionid\n" +
"\tleft join hd_wm_xx hd on hd.hdid = xx.hdid\n" +
"\tleft join hd_wm_zplb zplb on zplb.zid = xx.zplb\n" +
"\tleft join hd_wm_lb lb on lb.lid = xx.hdlb where 1=1");
sb.append("\tand xx.hdid in (select hdid from hd_wm_xx where hdtype =2)");
Sql sql = Sqls.create("""
SELECT
xx.*,
sbr.username AS sbrname,
sbr.loginname,
hd.hdname,
hd.hdkssj,
hd.hdjssj,
zplb.zname as zplbname,
lb.lname as hdlbname,
dw.name as dwname,
gh.unionname as ghname
FROM
hd_ca_sbxx xx
LEFT JOIN sys_user sbr ON sbr.id = xx.sbr
left join sys_unit dw on dw.id = sbr.unitid
LEFT JOIN sys_union gh ON gh.id = dw.unionid
left join hd_wm_xx hd on hd.hdid = xx.hdid
left join hd_wm_zplb zplb on zplb.zid = xx.zplb
left join hd_wm_lb lb on lb.lid = xx.hdlb
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("xx.hdid", "in", Sqls.create("select hdid from hd_wm_xx where hdtype =2"));
cnd.andEX("dw.unionid", "=", union);
cnd.andEX("dw.id", "=", unit);
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdlb", "=", hdlb);
cnd.andEX("xx.zplb", "=", zplb);
cnd.andEX("YEAR(xx.sbsj)", "=", year);
if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
sb.append("\tand gh.id in (select gh.id from sys_user u \n" +
"left join sys_unit n on n.id = u.unitid\n" +
"left join sys_union gh ON gh.id = n.unionid\n" +
"where u.id = @cuserid)");
cnd.and("gh.id", "=", Vi.getUnionId());
}
if (Strings.isNotBlank(union)) {
sb.append(" AND dw.unionid = @union");
}
if (Strings.isNotBlank(unit)) {
sb.append(" AND dw.id = @unit");
}
if (Strings.isNotBlank(hdid)) {
sb.append("\tand xx.hdid = @hdid");
}
if (Strings.isNotBlank(hdlb)) {
sb.append("\tand xx.hdlb = @hdlb");
}
if (Strings.isNotBlank(zplb)) {
sb.append("\tand xx.zplb = @zplb");
}
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
sb.append("\tand\t" + searchName + "\tlike @searchKeyword");
cnd.and(Cnd.likeEX(searchName, searchKeyword));
}
if (Strings.isNotBlank(year)) {
sb.append("""
\tand YEAR(xx.sbsj) = @year
""");
}
sb.append("\tORDER BY sbr.username,gh.unionname,dw.name");
Sql sql = Sqls.create(sb.toString());
sql.setParam("union", union);
sql.setParam("unit", unit);
sql.setParam("cuserid", ShiroUtil.getPrincipalProperty("id"));
sql.setParam("hdid", hdid);
sql.setParam("hdlb", hdlb);
sql.setParam("zplb", zplb);
sql.setParam("year", year);
sql.setParam("searchKeyword", "%" + searchKeyword + "%");
cnd.asc("sbr.username").asc("gh.unioncode").asc("dw.unitcode");
sql.setCondition(cnd);
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
} catch (Exception e) {
@@ -184,6 +189,8 @@ public class HdChildZpxxController {
}
@At
@RequiresPermissions("hd.child.zpxx")
@ViReturn
public Object findOneById(String id) {
List<Record> fjList = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
return Result.success().addData(fjList);
@@ -191,6 +198,8 @@ public class HdChildZpxxController {
@At("/exportExcel")
@Ok("void")
@RequiresPermissions("hd.child.zpxx")
@ViReturn
public void exportExcel(HttpServletResponse response, String hdid, String hdname) {
StringBuffer sb = new StringBuffer();
sb.append("SELECT\n" +
@@ -2,13 +2,10 @@ package io.v.nutz.hd.controller.ca;
import io.v.nutz.hd.services.*;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import java.text.SimpleDateFormat;
/**
@@ -27,6 +24,7 @@ public class HdCnMangeController {
@At
@Ok("beetl:/platform/hd/ca/mobileBox.html")
@RequiresPermissions("hd.ca.hdmange")
public void mobileBox() {
}
@@ -5,9 +5,10 @@ import cn.wizzer.framework.base.Result;
import io.v.nutz.hd.models.Hd_ca_sbxx;
import io.v.nutz.hd.models.Hd_ca_sbxx_fj;
import io.v.nutz.hd.services.HdCasbxxFjService;
import io.v.nutz.service.ViService;
import io.v.nutz.hd.services.HdCasbxxService;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.service.ViService;
import org.apache.commons.io.FilenameUtils;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Sqls;
@@ -15,7 +16,6 @@ import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Files;
import org.nutz.lang.random.R;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
@@ -25,11 +25,8 @@ import org.nutz.mvc.upload.TempFile;
import org.nutz.mvc.upload.UploadAdaptor;
import javax.servlet.http.HttpSession;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Author: V
@@ -3,6 +3,8 @@ package io.v.nutz.hd.controller.wmhd;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.FileService;
import io.v.nutz.hd.models.Hd_wm_sbxx;
import io.v.nutz.hd.services.HdWmLbService;
@@ -10,7 +12,6 @@ import io.v.nutz.hd.services.HdWmZplbService;
import io.v.nutz.hd.services.HdWmsbxxService;
import io.v.nutz.hd.services.HdWmsbxxfjService;
import io.v.nutz.util.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
@@ -20,7 +21,6 @@ import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.AdaptBy;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
@@ -37,7 +37,6 @@ import java.util.Map;
@IocBean
@At("/platform/hd/jzghd/sczp")
@Ok("json:full")
@RequiresAuthentication
public class HdJzgAddZpController {
@Inject
@@ -67,11 +66,12 @@ public class HdJzgAddZpController {
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doSubmit(@Param("data") String data, @Param("file") TempFile[] files) {
public Object doSubmit(@Param("data") String data, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
try {
Hd_wm_sbxx sbxx = Json.fromJson(Hd_wm_sbxx.class, data);
sbxx.setHdsbrid(ShiroUtil.getPrincipalProperty("id").toString());
sbxx.setHdsbsj(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
sbxx.setHdsbsj(DateUtil.getDateTime());
sbxx.setAuditState(flag ? "4400" : "3999");
Hd_wm_sbxx insert = hdWmsbxxService.insert(sbxx);
for (TempFile file : files) {
@@ -86,14 +86,15 @@ public class HdJzgAddZpController {
@At
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
public Object doEdit(@Param("data") String data, String readytodelfile, @Param("file") TempFile[] files) {
public Object doEdit(@Param("data") String data, String readytodelfile, @Param(value = "file", required = false) TempFile[] files, boolean flag) {
try {
Hd_wm_sbxx sbxx = Json.fromJson(Hd_wm_sbxx.class, data);
sbxx.setAuditState(flag ? "4400" : "3999");
hdWmsbxxService.updateIgnoreNull(sbxx);
List<String> dellist = Json.fromJsonAsList(String.class, readytodelfile);
for (String f : dellist) {
fileService.delete(f, null);
fileService.delete(f, f);
}
for (TempFile file : files) {
fileService.upload(file, sbxx.getId(), "/hd/hdwm/");
@@ -106,46 +107,47 @@ public class HdJzgAddZpController {
@At
public Object pageData(Integer pageNumber, Integer pageSize, String hdid, String hdlb, String zplb) {
@ViReturn
public Object pageData(Integer pageNumber,
Integer pageSize,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "hdlb", required = false) String hdlb,
@Param(value = "zplb", required = false) String zplb) {
try {
StringBuffer sb = new StringBuffer();
sb.append("SELECT\n" +
"\txx.*,\n" +
"\tsbr.username AS sbrname,\n" +
"\tsbr.loginname,\n" +
"\thd.hdname,\n" +
"\thd.hdkssj,\n" +
"\thd.hdjssj,\n" +
"\tdw.name as dwname,\n" +
"\tgh.unionname as ghname,\n" +
"\thdlb.lname as hdlbname,\n" +
"\tzplb.zname as zplbname\n" +
"FROM\n" +
"\thd_wm_sbxx xx\n" +
"\tLEFT JOIN sys_user sbr ON sbr.id = xx.hdsbrid\n" +
"\tleft join sys_unit dw on dw.id = sbr.unitid\n" +
"\tLEFT JOIN sys_union gh ON gh.id = dw.unionid\n" +
"\tLEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx\n" +
"\tLEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2\n" +
"\tleft join hd_wm_xx hd on hd.hdid = xx.hdid\n" +
"\twhere 1=1");
sb.append("\tand xx.hdid in (select hdid from hd_wm_xx where hdtype =1)");
sb.append("\tand xx.hdsbrid = @userid");
if (Strings.isNotBlank(hdid)) {
sb.append("\tand xx.hdid = @hdid");
}
if (Strings.isNotBlank(hdlb)) {
sb.append("\tand xx.hdzplx = @hdlb");
}
if (Strings.isNotBlank(zplb)) {
sb.append("\tand xx.hdzplx2 = @zplb");
}
sb.append("\tORDER BY sbr.username,gh.unionname,dw.name");
Sql sql = Sqls.create(sb.toString());
sql.setParam("userid", ShiroUtil.getPrincipalProperty("id"));
sql.setParam("hdid", hdid);
sql.setParam("hdlb", hdlb);
sql.setParam("zplb", zplb);
Sql sql = Sqls.create("""
SELECT
xx.*,
sbr.username AS sbrname,
sbr.loginname,
hd.hdname,
hd.hdkssj,
hd.hdjssj,
dw.name as dwname,
gh.unionname as ghname,
hdlb.lname as hdlbname,
zplb.zname as zplbname,
state.stateColor,
state.stateName,
( SELECT COUNT( dz.id )FROM hd_wm_dz_xx dz WHERE dz.zpid = xx.id ) dz_znum
FROM
hd_wm_sbxx xx
LEFT JOIN sys_user sbr ON sbr.id = xx.hdsbrid
left join sys_unit dw on dw.id = sbr.unitid
LEFT JOIN sys_union gh ON gh.id = dw.unionid
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
left join hd_wm_xx hd on hd.hdid = xx.hdid
LEFT JOIN audit_state state ON state.stateId = xx.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.and("xx.hdid", "in", Sqls.create("select hdid from hd_wm_xx where hdtype =1"));
cnd.and("xx.hdsbrid", "=", ShiroUtil.getPrincipalProperty("id"));
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdlb", "=", hdlb);
cnd.andEX("xx.zplb", "=", zplb);
cnd.desc("sbr.username").desc("gh.unionname").desc("dw.name");
sql.setCondition(cnd);
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
} catch (Exception e) {
@@ -189,5 +191,14 @@ public class HdJzgAddZpController {
}
}
@At
public Object gethdzplblist(String id) {
try {
return Result.success().addData(hdWmZplbService.query(Cnd.where("zlid", "=", id)));
} catch (Exception e) {
return Result.error();
}
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.hd.controller.wmhd;
import cn.hutool.core.date.DateUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.FileService;
@@ -7,14 +8,18 @@ import io.v.nutz.hd.models.Hd_wm_lb;
import io.v.nutz.hd.models.Hd_wm_xx;
import io.v.nutz.hd.models.Hd_wm_zplb;
import io.v.nutz.hd.services.*;
import io.v.nutz.sys.services.SysMsgService;
import io.v.nutz.util.ShiroUtil;
import io.v.nutz.web.commons.slog.annotation.SLog;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
@@ -59,6 +64,7 @@ public class HdMangeController {
@At
@Ok("beetl:/platform/hd/wmhd/mobileBox.html")
@RequiresPermissions("hd.wmhd.hdmange")
public void mobileBox() {
}
@@ -74,12 +80,18 @@ public class HdMangeController {
@Inject
private FtpService ftpService;
@Inject
private SysMsgService sysMsgService;
@At
@Ok("json")
@ViReturn
@RequiresAuthentication
@SLog(type = "wmhd", tag = "教工作品/亲自作品征集", msg = "教工作品/亲自作品征集新增")
@RequiresPermissions("hd.wmhd.hdmange")
public Object doAdd(@Param("hdxx") Hd_wm_xx hdWmXx) {
Trans.exec(() -> {
hdWmXx.setHdcjr(ShiroUtil.getPrincipalProperty("id").toString());
hdWmXx.setHdcjsj(sdf.format(new Date()));
hdWmXx.setHdflag(false);
@@ -97,13 +109,15 @@ public class HdMangeController {
hdWmZplbService.insert(zplbs.get(j));
}
}
});
return null;
}
@At
@Ok("json")
public Object data(String hdname, Integer hdtype, int pageNumber, int pageSize, Integer year) {
public Object data(@Param(value = "hdname", required = false) String hdname, @Param(value = "hdtype", required = false) Integer hdtype, @Param(value = "year", required = false) Integer year, int pageNumber, int pageSize) {
try {
Sql sql = Sqls.create("SELECT hd.*,u.`username` cjr FROM hd_wm_xx hd LEFT JOIN sys_user u ON hd.hdcjr = u.`id` $condition");
Cnd cnd = Cnd.NEW();
@@ -114,6 +128,9 @@ public class HdMangeController {
if (year != null) {
cnd.and("YEAR(hdcjsj)", "=", year);
}
if (!ShiroUtil.hasRole("sysadmin")) {
cnd.and("hd.hdcjr", "=", ShiroUtil.getUserId());
}
cnd.desc("hdcjsj");
sql.setCondition(cnd);
return Result.success().addData(hdWmxxService.listPage(pageNumber, pageSize, sql));
@@ -124,10 +141,12 @@ public class HdMangeController {
@At
@Ok("json")
@Aop(TransAop.READ_COMMITTED)
@SLog(type = "wmhd", tag = "教工作品/亲自作品征集", msg = "教工作品/亲自作品征集删除")
@RequiresPermissions("hd.wmhd.hdmange")
public Object delete(String hdid) {
try {
String path = new File("").getCanonicalPath();
hdWmZplbService.execute(Sqls.create("DELETE FROM `hd_wm_zplb` WHERE zlid IN (SELECT lb.`lid` FROM hd_wm_lb lb WHERE lb.`lhdid`=@hdid)").setParam("hdid", hdid));
hdWmLbService.clear(Cnd.where("lhdid", "=", hdid));
@@ -145,7 +164,7 @@ public class HdMangeController {
hdWmsbxxService.execute(Sqls.create("DELETE FROM `hd_wm_sbxx` WHERE `hdid`=@hdid").setParam("hdid", hdid));
hdWmxxService.delete(hdid);
sysMsgService.deleteMsg(hdid);
return Result.success();
} catch (Exception e) {
e.printStackTrace();
@@ -155,6 +174,8 @@ public class HdMangeController {
@At
@Ok("json")
@RequiresPermissions("hd.wmhd.hdmange")
public Object changeStatus(String hdid, Boolean flag) {
try {
Hd_wm_xx hdWmXx = hdWmxxService.fetch(hdid);
@@ -184,10 +205,12 @@ public class HdMangeController {
@At
@Ok("json")
@RequiresAuthentication
@SLog(type = "wmhd", tag = "教工作品/亲自作品征集", msg = "教工作品/亲自作品征集修改")
@RequiresPermissions("hd.wmhd.hdmange")
@ViReturn
public Object doEdit(@Param("hdxx") Hd_wm_xx hdWmXx) {
Trans.exec(() -> {
hdWmxxService.update(hdWmXx);
List<String> lbids = new ArrayList<>();
List<String> zpLbids = new ArrayList<>();
@@ -226,8 +249,29 @@ public class HdMangeController {
hdWmZplbService.insertOrUpdate(zplbs.get(j));
}
}
});
return null;
}
@At
@Ok("json")
@ViReturn
@RequiresAuthentication
public Object getUserActivityGroup() {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT * FROM hd_wm_xx WHERE activityGroupId in (SELECT groupId FROM `activity_user_scope` $condition)
""");
if (!ShiroUtil.hasRole("sysadmin")) {
cnd.and("userId", "=", ShiroUtil.getUserId());
}
cnd.and("hdkssj","<=", DateUtil.now());
cnd.and("hdjssj",">=", DateUtil.now());
sql.setCondition(cnd);
return hdWmsbxxService.listMap(sql);
}
}
@@ -2,7 +2,6 @@ package io.v.nutz.hd.controller.wmhd;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
@@ -22,9 +21,9 @@ import org.nutz.lang.Strings;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
@@ -45,7 +44,14 @@ public class HdWmHjInfoController {
@At("/pageData")
@Ok("json")
@ViReturn
public Object pageData(String year, String union, String unit, PageForm pageForm, String hdid, String searchName, String searchKeyword) {
@RequiresPermissions("hd.wmhd.hjxx1")
public Object pageData(@Param(value = "year", required = false) String year,
@Param(value = "union", required = false) String union,
@Param(value = "unit", required = false) String unit,
PageForm pageForm,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "searchName", required = false) String searchName,
@Param(value = "searchKeyword", required = false) String searchKeyword) {
try {
Sql sql = Sqls.create("""
SELECT DISTINCT
@@ -54,7 +60,7 @@ public class HdWmHjInfoController {
u.loginname,
n.NAME AS dwname,
gh.unionname AS ghname,
( SELECT COUNT( DISTINCT ( a.hdzplx )) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid` and a.hdid = @hdid ) AS hjcount
( SELECT COUNT( DISTINCT ( a.hdzplx )) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid` and a.hdid = @hdid AND auditState=4400) AS hjcount
FROM
hd_wm_sbxx xx
LEFT JOIN sys_user u ON u.id = xx.hdsbrid
@@ -66,7 +72,8 @@ public class HdWmHjInfoController {
Cnd cnd = Cnd.NEW();
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
cnd.andEX("xx.auditState", "=", 4400);
if (!ShiroUtil.hasRole("H10") && !ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
cnd.andEX("gh.id", "=", Vi.getUnionId());
}
cnd.andEX("n.unionid", "=", union);
@@ -84,9 +91,8 @@ public class HdWmHjInfoController {
@At("/exportExcel")
@Ok("void")
@RequiresPermissions("hd.wmhd.hjxx1")
public void exportExcel(Integer num, String hdid, HttpServletResponse response) {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
if (num == 1) {
Sql sql = Sqls.create("""
@@ -96,7 +102,7 @@ public class HdWmHjInfoController {
u.loginname,
n.NAME AS dwname,
gh.unionname AS ghname,
( SELECT COUNT( DISTINCT ( a.hdzplx )) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid` and a.hdid = @hdid ) AS hjcount
( SELECT COUNT( DISTINCT ( a.hdzplx )) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid` and a.hdid = @hdid AND a.auditState=4400) AS hjcount
FROM
hd_wm_sbxx xx
LEFT JOIN sys_user u ON u.id = xx.hdsbrid
@@ -107,6 +113,7 @@ public class HdWmHjInfoController {
sql.setParam("hdid", hdid);
Cnd cnd = Cnd.NEW();
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.auditState", "=", 4400);
cnd.asc("u.username").asc("n.name").asc("gh.unionname");
sql.setCondition(cnd);
List<NutMap> winnerList = hdWmsbxxService.listMap(sql);
@@ -119,8 +126,8 @@ public class HdWmHjInfoController {
exportEntities.add(new ExcelExportEntity("获奖次数", "hjcount", 20));
try {
ViTool.excelResponse(response, "获奖人员名单.xlsx");
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, winnerList);
ViTool.excelResponse(response, "获奖人员名单.xls");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, winnerList);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
@@ -136,9 +143,11 @@ public class HdWmHjInfoController {
LEFT JOIN `user` u ON u.unionid = gh.id
LEFT JOIN hd_wm_sbxx sbxx ON sbxx.hdsbrid = u.id
AND sbxx.hdid = @hdid
AND sbxx.auditState = @auditState
$condition
""");
sql.setParam("hdid", hdid);
sql.setParam("auditState", 4400);
Cnd cnd = Cnd.NEW();
cnd.groupBy("gh.id");
cnd.asc("gh.unioncode");
@@ -150,128 +159,13 @@ public class HdWmHjInfoController {
exportEntities.add(new ExcelExportEntity("应发奖品数", "prizeNum", 20));
try {
ViTool.excelResponse(response, "分工会获奖信息.xlsx");
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, unionList);
ViTool.excelResponse(response, "分工会获奖信息.xls");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, unionList);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
// HSSFWorkbook wb = null;
// String fileName = "";
// if (num == 1) {
// StringBuffer sbsql = new StringBuffer();
// sbsql.append("SELECT DISTINCT ( xx.hdsbrid ),u.username,u.loginname,n.NAME AS dwname,gh.unionname AS ghname,\n" +
// "(SELECT COUNT(DISTINCT(a.hdzplx)) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid`) as hjcount\n" +
// "FROM hd_wm_sbxx xx LEFT JOIN sys_user u ON u.id = xx.hdsbrid\n" +
// " LEFT JOIN sys_unit n ON n.id = u.unitid\n" +
// " LEFT JOIN sys_union gh ON gh.id = n.unionid\n" +
// " WHERE 1=1 ");
// sbsql.append("\tand xx.hdid = @hdid");
// if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
// sbsql.append("\tAND gh.id IN (\n" +
// "\tSELECT\n" +
// "\t\tgh.id \n" +
// "\tFROM\n" +
// "\t\tsys_user u\n" +
// "\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
// "\tLEFT JOIN sys_union gh ON gh.id = n.unionid where u.id = @cuserid)");
// }
// sbsql.append(" ORDER BY u.username,n.name,gh.unionname");
// Sql sql = Sqls.create(sbsql.toString());
// sql.setParam("hdid", hdid);
// sql.setParam("cuserid", ShiroUtil.getPrincipalProperty("id"));
// List<Record> list = hdWmsbxxService.list(sql);
// fileName = "获奖人员名单";
// String[] title = {"姓名", "工资号", "单位", "分工会", "获奖次数"};
// String[][] content = new String[list.size()][title.length];
// for (int i = 0; i < list.size(); i++) {
// Record r = list.get(i);
// content[i][0] = r.getString("username");
// content[i][1] = r.getString("loginname");
// content[i][2] = r.getString("dwname");
// content[i][3] = r.getString("ghname");
// content[i][4] = String.valueOf(r.getInt("hjcount"));
// }
// wb = ExcelUtil.getHSSFWorkbook(fileName, title, content, null);
// } else {
// String ghtjstr = "SELECT\n" +
// "\tfgh.unionname,\n" +
// "\t(\n" +
// "\tSELECT\n" +
// "\t\tcount( DISTINCT ( xx.hdsbrid ) ) \n" +
// "\tFROM\n" +
// "\t\thd_wm_sbxx xx\n" +
// "\t\tLEFT JOIN sys_user u ON u.id = xx.hdsbrid\n" +
// "\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
// "\t\tLEFT JOIN sys_union ghx ON ghx.id = n.unionid \n" +
// "\tWHERE\n" +
// "\t\tghx.id = fgh.id \n" +
// "\t) AS cjrsCount,\n" +
// "\t(\n" +
// "\tSELECT\n" +
// "\t\tSUM( c ) \n" +
// "\tFROM\n" +
// "\t\t(\n" +
// "\t\tSELECT\n" +
// "\t\t\tgh.`id`,\n" +
// "\t\t\t( SELECT COUNT( DISTINCT ( a.hdzplx ) ) FROM hd_wm_sbxx a WHERE a.hdsbrid = xx.`hdsbrid` ) c \n" +
// "\t\tFROM\n" +
// "\t\t\thd_wm_sbxx xx\n" +
// "\t\t\tLEFT JOIN sys_user u ON u.id = xx.hdsbrid\n" +
// "\t\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
// "\t\t\tLEFT JOIN sys_union gh ON gh.id = n.unionid \n" +
// "\t\tGROUP BY\n" +
// "\t\t\txx.hdsbrid \n" +
// "\t\t) tab \n" +
// "\tWHERE\n" +
// "\t\ttab.id = fgh.`id` \n" +
// "\t) jpCount \n" +
// "FROM\n" +
// "\tsys_union fgh";
// Sql ghtjsql = Sqls.create(ghtjstr.toString());
// List<Record> ghtjList = hdWmsbxxService.list(ghtjsql);
// fileName = "分工会奖品统计";
// String[] title = {"分工会", "参加人数", "应发奖品数"};
// String[][] content = new String[ghtjList.size()][title.length];
// for (int i = 0; i < ghtjList.size(); i++) {
// Record r = ghtjList.get(i);
// content[i][0] = r.getString("unionname");
// content[i][1] = r.getString("cjrsCount");
// content[i][2] = r.getString("jpCount") == null ? "0" : r.getString("jpCount");
// }
// wb = ExcelUtil.getHSSFWorkbook(fileName, title, content, null);
// }
// try {
// this.setResponseHeader(response, fileName + ".xls");
// OutputStream os = response.getOutputStream();
// wb.write(os);
// os.flush();
// os.close();
// } catch (Exception e) {
// e.printStackTrace();
// }
}
public void setResponseHeader(HttpServletResponse response, String fileName) {
try {
try {
fileName = new String(fileName.getBytes(), "ISO8859-1");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.setContentType("application/octet-stream;charset=ISO8859-1");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
response.addHeader("Pargam", "no-cache");
response.addHeader("Cache-Control", "no-cache");
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
@@ -2,34 +2,38 @@ package io.v.nutz.hd.controller.wmhd;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Office2Pdf;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.hd.models.Hd_wm_sbxx;
import io.v.nutz.hd.services.HdWmLbService;
import io.v.nutz.hd.services.HdWmZplbService;
import io.v.nutz.hd.services.HdWmsbxxService;
import io.v.nutz.hd.services.HdWmsbxxfjService;
import io.v.nutz.modules.models.Audit;
import io.v.nutz.modules.models.AuditState;
import io.v.nutz.modules.models.PageForm;
import io.v.nutz.sys.models.Sys_file;
import io.v.nutz.util.ShiroUtil;
import io.v.nutz.util.ViTool;
import io.v.nutz.web.commons.utils.FileUtil;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.util.IOUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.boot.starter.ftp.FtpService;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
@@ -38,18 +42,23 @@ import org.nutz.lang.random.R;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.awt.image.BufferedImage;
import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
@IocBean
@Ok("json:full")
@At("/platform/hd/wmhd")
public class HdWmInfoController {
@@ -71,6 +80,9 @@ public class HdWmInfoController {
@Inject
private HdWmsbxxfjService hdWmsbxxfjService;
@Inject
protected PropertiesProxy conf;
private static final String imgnewdir = "upload/hd/hdwm/new/";
private String path = new File("").getCanonicalPath();
@@ -105,7 +117,7 @@ public class HdWmInfoController {
@At("/getVideo")
@Ok("void")
@RequiresAuthentication
@RequiresPermissions("hd.wmhd.zpxx1")
public void getVideo(HttpServletRequest request, HttpServletResponse response, String filepath) {
try {
File file = new File(path + "\\" + filepath);
@@ -148,7 +160,7 @@ public class HdWmInfoController {
*/
@At("/getNewImg")
@Ok("void")
@RequiresAuthentication
@RequiresPermissions("hd.wmhd.zpxx1")
public void getNewImg(HttpServletResponse response, String filepath) throws IOException {
//图片格式
String imgformat = filepath.substring(filepath.lastIndexOf(".") + 1, filepath.length());
@@ -174,81 +186,71 @@ public class HdWmInfoController {
@At("/pageData")
@Ok("json")
@RequiresAuthentication
public Object pageData(String union, String unit, Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String hdid, String hdlb, String zplb,
String year) {
try {
StringBuffer sbsql = new StringBuffer();
sbsql.append("SELECT\n" +
"\txx.id,\n" +
"\txx.hdsbsj,\n" +
"\txx.hdsbzpzt,\n" +
"\txx.hdsbzpms,\n" +
"\txx.hdzplx,\n" +
"\txx.hdid,\n" +
"\tu.username,\n" +
"\tu.loginname,\n" +
"\tu.mobile,\n" +
"\tn.NAME AS 'dwname',\n" +
"\tgh.unionname AS 'ghname',\n" +
"\thdlb.lname as hdlbname,\n" +
"\tzplb.zname as zplbname\n" +
"FROM\n" +
"\thd_wm_sbxx xx\n" +
"\tLEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx\n" +
"\tLEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2\n" +
"\tLEFT JOIN sys_user u ON u.id = xx.hdsbrid\n" +
"\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
"\tLEFT JOIN sys_union gh ON gh.id = n.unionid where 1=1");
if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
sbsql.append("\tAND gh.id IN (\n" +
"\tSELECT\n" +
"\t\tgh.id \n" +
"\tFROM\n" +
"\t\tsys_user u\n" +
"\t\tLEFT JOIN sys_unit n ON n.id = u.unitid\n" +
"\tLEFT JOIN sys_union gh ON gh.id = n.unionid where u.id = @cuserid)");
}
if (Strings.isNotBlank(union)) {
sbsql.append(" AND n.unionid = @union");
}
if (Strings.isNotBlank(unit)) {
sbsql.append(" AND n.id = @unit");
}
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
sbsql.append("\tand " + searchName + " like '%" + searchKeyword + "%'");
}
if (Strings.isNotBlank(hdid)) {
sbsql.append("\tand xx.hdid = @hdid");
}
if (Strings.isNotBlank(hdlb)) {
sbsql.append("\tand xx.hdzplx = @hdzplx");
}
if (Strings.isNotBlank(zplb)) {
sbsql.append("\tand xx.hdzplx2 = @hdzplx2");
}
if (Strings.isNotBlank(year)) {
sbsql.append("\tand YEAR(xx.hdsbsj) = @year");
}
sbsql.append("\tORDER BY xx.hdsbsj desc,gh.unionname,n.name,u.username,xx.hdzplx");
Sql sql = Sqls.create(sbsql.toString());
sql.setParam("union", union);
sql.setParam("unit", unit);
sql.setParam("hdid", hdid);
sql.setParam("hdzplx", hdlb);
sql.setParam("hdzplx2", zplb);
sql.setParam("cuserid", ShiroUtil.getPrincipalProperty("id"));
sql.setParam("year", year);
Pagination pagination = hdWmsbxxfjService.listPage(pageNumber, pageSize, sql);
return Result.success().addData(pagination);
} catch (Exception e) {
return Result.error();
@ViReturn
@RequiresPermissions("hd.wmhd.zpxx1")
public Object pageData(@Param(value = "union", required = false) String union,
@Param(value = "unit", required = false) String unit,
PageForm pageForm,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "hdlb", required = false) String hdlb,
@Param(value = "zplb", required = false) String zplb,
@Param(value = "year", required = false) String year,
@Param(value = "isExcellent", required = false) Integer isExcellent,
@Param(value = "stateId", required = false) Integer stateId) {
Sql sql = Sqls.create("""
SELECT
xx.id,
xx.hdsbsj,
xx.hdsbzpzt,
xx.hdsbzpms,
xx.hdzplx,
xx.hdid,
xx.isExcellent,
wmxx.hdname,
u.username,
u.loginname,
u.mobile,
u.unitname AS 'dwname',
u.unionname AS 'ghname',
hdlb.lname AS hdlbname,
zplb.zname AS zplbname,
state.stateColor,
state.stateName,
( SELECT COUNT( dz.id )FROM hd_wm_dz_xx dz WHERE dz.zpid = xx.id) dz_num
FROM
hd_wm_sbxx xx
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
LEFT JOIN `user` u ON u.id = xx.hdsbrid
LEFT JOIN audit_state state ON state.stateId = xx.auditState
LEFT JOIN hd_wm_xx wmxx ON wmxx.hdid = xx.hdid
$condition
""");
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.and("u.unionid", "=", Vi.getUnionId());
}
cnd.andEX("u.unionid", "=", union);
cnd.andEX("u.unitid", "=", unit);
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdzplx", "=", hdlb);
cnd.andEX("xx.hdzplx2", "=", zplb);
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
cnd.andEX("xx.auditState", "=", stateId);
cnd.andEX("xx.isExcellent", "=", isExcellent);
if (Strings.isNotBlank(pageForm.getSearchName()) && Strings.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (Strings.isNotBlank(pageForm.getPageOrderName()) && Strings.isNotBlank(pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), PageUtil.getOrder(pageForm.getPageOrderBy()));
} else {
cnd.desc("dz_num").desc("xx.hdsbsj").asc("xx.auditState").asc("unioncode");
}
sql.setCondition(cnd);
return hdWmsbxxfjService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@@ -259,8 +261,6 @@ public class HdWmInfoController {
* @return
*/
@At("/findOneById")
@Ok("json:full")
@RequiresAuthentication
public Object findOneById(String id) {
try {
// List<Hd_wm_sbxx_fj> fjList = hdWmsbxxfjService.query(Cnd.where("hdsbid", "=", id));
@@ -272,20 +272,65 @@ public class HdWmInfoController {
}
}
@At("/findxxById")
@ViReturn
public Object findxxById(String id) {
Sql sql = Sqls.create("""
SELECT
xx.*,
u.username,
u.loginname,
u.unitname AS 'dwname',
u.unionname AS 'ghname',
hdlb.lname AS hdlbname,
zplb.zname AS zplbname,
zplb.*,
zt.hdname,
state.stateColor,
state.stateName
FROM
hd_wm_sbxx xx
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
LEFT JOIN hd_wm_xx zt ON zt.hdid = xx.hdid
LEFT JOIN `user` u ON u.id = xx.hdsbrid
LEFT JOIN audit_state state ON state.stateId = xx.auditState
WHERE xx.id=@id
""").setParam("id", id);
List<NutMap> list = baseService.listMap(sql);
if (list.size() > 0) {
NutMap map = list.get(0);
map.setv("union", Strings.isNotBlank(map.getString("unionAuditId")) ? baseService.dao().fetch(Audit.class, map.getString("unionAuditId")) : null);
map.setv("school", Strings.isNotBlank(map.getString("schoolAuditId")) ? baseService.dao().fetch(Audit.class, map.getString("schoolAuditId")) : null);
return map;
}
return null;
}
@At("/exportExcel")
@At("/exportWork")
@Ok("void")
@RequiresAuthentication
public void exportExcel(HttpServletResponse response, String hdid, String hdname) {
@RequiresPermissions("hd.wmhd.zpxx1")
public void exportWork(HttpServletResponse response,
String hdid,
String hdlb,
String hdname,
String zplb,
String union,
String unit,
Integer isExcellent,
String stateId) {
Sql sql = Sqls.create("""
SELECT
xx.id,
xx.hdsbzpzt,
xx.hdzplx,
xx.hdsbzpms,
xx.hdsbsj,
u.username,
u.sex,
u.loginname,
n.NAME AS dwname,
gh.unionname AS ghname,
u.unitname AS dwname,
u.unionname AS ghname,
hd.hdname as hdname,
hdlb.lname as hdlbname,
zplb.zname as zplbname
@@ -294,62 +339,190 @@ public class HdWmInfoController {
LEFT JOIN hd_wm_xx hd ON hd.hdid = xx.hdid
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
LEFT JOIN sys_user u ON u.id = xx.hdsbrid
LEFT JOIN sys_unit n ON n.id = u.unitid
LEFT JOIN sys_union gh ON gh.id = n.unionid
LEFT JOIN `user` u ON u.id = xx.hdsbrid
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdzplx", "=", hdlb);
cnd.andEX("xx.hdzplx2", "=", zplb);
cnd.andEX("u.unionid", "=", union);
cnd.andEX("u.unitid", "=", unit);
cnd.andEX("xx.auditState", "=", 4400);
cnd.andEX("xx.isExcellent", "=", isExcellent);
if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
if (ShiroUtil.hasRole("H04")) {
cnd.andEX("gh.id", "=", Vi.getUnionId());
cnd.andEX("u.unionid", "=", Vi.getUnionId());
}
}
cnd.asc("gh.unionname").asc("n.name").asc("u.username").asc("xx.hdzplx");
cnd.asc("u.unionname").asc("u.unitname").asc("u.username").asc("xx.hdzplx");
sql.setCondition(cnd);
List<NutMap> list = hdWmsbxxService.listMap(sql);
try {
response.reset();
response.setContentType("application/x-msdownload;charset=utf-8");
/**
* 创建临时文件夹
*/
String tmpPath = "tmp/" + R.UU32();
File tmpDir = new File(tmpPath + "/" + hdname);
tmpDir.mkdirs();
for (NutMap item : list) {
List<Sys_file> fileList = dao.query(Sys_file.class, Cnd.where("reid", "=", item.getString("id")));
/**
* 创建临时文件夹
*/
/* File tDir = new File(tmpDir + "/" + fileName.replaceAll(" ", "-"));
tDir.mkdirs();*/
if (Lang.isNotEmpty(fileList)) {
for (Sys_file file : fileList) {
String fileName = item.getString("username") + "【" + item.getString("zplbname") + "】——" + file.getFilename();
if (Lang.isNotEmpty(file)) {
FileOutputStream outputStream = new FileOutputStream(tmpDir.getPath() + "/" + fileName);
ftpService.download(file.getFilepath(), outputStream);
outputStream.close();
}
}
}
}
String aimsDir = "zipTmp/" + R.UU32();
String aimsName = hdname + ".zip";
String aimsPath = aimsDir + "/" + aimsName;
FileUtil.compressToZip(tmpDir.getPath(), aimsDir, aimsName);
response.setHeader("content-disposition", "attachment;filename="
+ URLEncoder.encode(aimsName, "UTF-8"));
File aimsFile = new File(aimsPath);
FileInputStream inputStream = new FileInputStream(aimsFile);
org.apache.commons.io.IOUtils.copy(inputStream, response.getOutputStream());
inputStream.close();
aimsFile.delete();
FileUtil.deleteDir(new File(tmpPath));
FileUtil.deleteDir(new File(aimsDir));
} catch (Exception e) {
e.printStackTrace();
}
/* //连接ftp
FTPClient ftpClient = new FTPClient();
ftpClient.connect(conf.get(PROP_SERVER_HOST, ""), conf.getInt(PROP_SERVER_PORT, 21));
ftpClient.login(conf.get(PROP_SERVER_USERNAME, ""), conf.get(PROP_SERVER_PASSWORD, ""));
ftpClient.enterLocalPassiveMode();
ZipOutputStream zipOutputStream = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
list.forEach(item -> {
List<Sys_file> fileList = dao.query(Sys_file.class, Cnd.where("reid", "=", item.getString("id")));
if (Lang.isNotEmpty(fileList)) {
for (int i = 0; i < fileList.size(); i++) {
Sys_file file = fileList.get(i);
try {
String extension = file.getFilename().substring(file.getFilename().lastIndexOf("."));
String newFileName = "";
if (fileList.size() > 1) {
newFileName = item.getString("hdsbzpms").replaceAll("\n", "") + (i + 1) + extension;
} else {
newFileName = item.getString("hdsbzpms").replaceAll("\n", "") + extension;
}
String entryName = item.getString("ghname") + "/" + "【" + item.getString("username") + "】" + newFileName;
zipOutputStream.putNextEntry(new ZipEntry(entryName));
//读取ftp文件
InputStream inputStream = ftpClient.retrieveFileStream(file.getFilepath());
org.apache.commons.io.IOUtils.copy(inputStream, zipOutputStream);
inputStream.close();
zipOutputStream.closeEntry();
ftpClient.completePendingCommand();
response.flushBuffer();
} catch (Exception e) {
e.printStackTrace();
}
}
}
});
zipOutputStream.flush();
zipOutputStream.close();
ftpClient.logout();*/
}
@At("/exportExcel")
@Ok("void")
@RequiresPermissions("hd.wmhd.zpxx1")
public void exportExcel(HttpServletResponse response,
String hdid,
String hdname,
String hdlb,
String zplb,
String union,
String unit,
Integer isExcellent,
String stateId) {
Sql sql = Sqls.create("""
SELECT
xx.id,
xx.hdzplx,
xx.hdsbzpms,
u.username,
u.sex,
u.loginname,
u.unitname AS dwname,
u.unionname AS ghname,
hd.hdname as hdname,
hdlb.lname as hdlbname,
zplb.zname as zplbname,
( SELECT COUNT( dz.id )FROM hd_wm_dz_xx dz WHERE dz.zpid = xx.id) dz_num
FROM
hd_wm_sbxx xx
LEFT JOIN hd_wm_xx hd ON hd.hdid = xx.hdid
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
LEFT JOIN `user` u ON u.id = xx.hdsbrid
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdzplx", "=", hdlb);
cnd.andEX("xx.hdzplx2", "=", zplb);
cnd.andEX("u.unionid", "=", union);
cnd.andEX("u.unitid", "=", unit);
cnd.andEX("xx.isExcellent", "=", isExcellent);
cnd.andEX("xx.auditState", "=", 4400);
if (!ShiroUtil.hasRole("A06") && !ShiroUtil.hasRole("sysadmin")) {
if (ShiroUtil.hasRole("H04")) {
cnd.andEX("u.unionid", "=", Vi.getUnionId());
}
}
cnd.asc("u.unionname").asc("u.unitname").asc("u.username").asc("xx.hdzplx");
sql.setCondition(cnd);
List<NutMap> list = hdWmsbxxService.listMap(sql);
List<ExcelExportEntity> exportEntities = new ArrayList<>();
exportEntities.add(new ExcelExportEntity("姓名", "username", 20));
exportEntities.add(new ExcelExportEntity("工号", "loginname", 20));
exportEntities.add(new ExcelExportEntity("性别", "sex", 20));
exportEntities.add(new ExcelExportEntity("单位", "dwname", 20));
exportEntities.add(new ExcelExportEntity("分工会", "ghname", 20));
exportEntities.add(new ExcelExportEntity("作品主题", "hdname", 20));
exportEntities.add(new ExcelExportEntity("活动类别", "hdlbname", 20));
// exportEntities.add(new ExcelExportEntity("作品类别", "zplbname", 20));
// exportEntities.add(new ExcelExportEntity("作品主题", "hdsbzpzt", 20));
exportEntities.add(new ExcelExportEntity("作品类别", "zplbname", 20));
exportEntities.add(new ExcelExportEntity("创作说明", "hdsbzpms", 200));
exportEntities.add(new ExcelExportEntity("点赞次数", "dz_num", 20));
try {
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
ViTool.excelResponse(response, hdname + ".xlsx");
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
ViTool.excelResponse(response, hdname + ".xls");
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), exportEntities, list);
workbook.write(response.getOutputStream());
} catch (Exception e) {
e.printStackTrace();
}
}
//发送响应流方法
public void setResponseHeader(HttpServletResponse response, String fileName) {
try {
try {
fileName = new String(fileName.getBytes(), "ISO8859-1");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.setContentType("application/octet-stream;charset=ISO8859-1");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
response.addHeader("Pargam", "no-cache");
response.addHeader("Cache-Control", "no-cache");
} catch (Exception ex) {
ex.printStackTrace();
}
}
@Inject
@@ -365,7 +538,7 @@ public class HdWmInfoController {
*/
@At("/downLoad")
@Ok("void")
@RequiresAuthentication
@RequiresPermissions("hd.wmhd.zpxx1")
public void download(String filepath, String filename, String username, HttpServletResponse response) {
try {
response.setContentType("application/octet-stream");
@@ -387,7 +560,7 @@ public class HdWmInfoController {
*/
@At("/YlDoc")
@Ok("void")
@RequiresAuthentication
@RequiresPermissions("hd.wmhd.zpxx1")
public void viewFJ(String fjurl, HttpServletRequest request, HttpServletResponse response) throws Exception {
String destFile = "";
try {
@@ -430,11 +603,15 @@ public class HdWmInfoController {
}
@At
@Ok("json:full")
@RequiresAuthentication
public Object initHdxxlist() {
try {
List<Record> list = hdWmsbxxService.list(Sqls.create("select *,year(hdcjsj) year from hd_wm_xx where hdtype=1 order by hdcjsj desc"));
String isSysadmin = " and hdcjr is not null";
if (ShiroUtil.hasRole("H10")) {
isSysadmin = "and hdcjr = '" + ShiroUtil.getUserId() + "'";
}
Sql sql = Sqls.create("select *,year(hdcjsj) year from hd_wm_xx where hdtype=1 and hdflag = true %s order by hdcjsj desc".formatted(isSysadmin));
List<Record> list = hdWmsbxxService.list(sql);
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
@@ -443,7 +620,14 @@ public class HdWmInfoController {
listMap.forEach((k, v) -> {
List<Map<String, Object>> children = new ArrayList<>();
v.forEach(x -> {
children.add(Map.of("value", x.getString("hdid"), "label", x.getString("hdname")));
/* children.add(Map.of("value", x.getString("hdid"),
"label", x.getString("hdname"),
"dzkssj", x.getString("dzkssj"),
"dzjssj", x.getString("dzjssj"),
"dzNum", x.getInt("dzNum")
));*/
children.add(Map.of("value", x.getString("hdid"),
"label", x.getString("hdname")));
});
Map<String, Object> parent = Map.of("value", k, "label", k, "children", children);
@@ -458,8 +642,6 @@ public class HdWmInfoController {
@At
@Ok("json:full")
@RequiresAuthentication
public Object findOne(String id) {
try {
Hd_wm_sbxx sbxx = hdWmsbxxService.fetch(id);
@@ -497,14 +679,38 @@ public class HdWmInfoController {
@At
@POST
@ViReturn
@Ok("json:full")
@RequiresAuthentication
@RequiresPermissions("hd.wmhd.zpxx1")
public Object doDelete(String id) {
dao.clear(Hd_wm_sbxx.class, Cnd.where("id", "=", id));
dao.clear(Sys_file.class, Cnd.where("reid", "=", id));
return null;
}
@At
@ViReturn
@RequiresPermissions("hd.wmhd.zpxx1")
public Object getAuditStateByModule() {
return baseService.dao().query(AuditState.class, Cnd.where("module", "=", "hdwm"));
}
@At
@ViReturn
@RequiresPermissions("hd.wmhd.zpxx1")
public Object doExcellent(String id) {
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("isExcellent", true), Cnd.where("id", "=", id));
return null;
}
@At
@ViReturn
@RequiresPermissions("hd.wmhd.zpxx1")
public Object cancelExcellent(String id) {
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("isExcellent", false), Cnd.where("id", "=", id));
return null;
}
}
@@ -0,0 +1,125 @@
package io.v.nutz.hd.controller.wmhd;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.hd.models.Hd_wm_sbxx;
import io.v.nutz.modules.models.Audit;
import io.v.nutz.modules.models.PageForm;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* TODO
*
* @Author zhf
* @Date 2022/11/24 15:07
*/
@IocBean
@At("/platform/hd/wmhd/school/audit")
@Ok("json:full")
public class HdWmSchoolAuditController {
@At("")
@Ok("beetl:/platform/hd/wmhd/schoolAudit.html")
@RequiresPermissions("hd.wmhd.schoolAudit")
public void index() {
}
@Inject
private BaseService baseService;
@At
@ViReturn
@RequiresPermissions("hd.wmhd.schoolAudit")
public Object pageData(@Param(value = "stateId", required = false) String stateId,
String isAudit,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
PageForm page,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "hdlb", required = false) String hdlb,
@Param(value = "zplb", required = false) String zplb,
@Param(value = "year", required = false) String year) {
Sql sql = Sqls.create("""
SELECT
xx.*,
u.username,
u.loginname,
u.unitname AS 'dwname',
u.unionname AS 'ghname',
hdlb.lname AS hdlbname,
zplb.zname AS zplbname,
zt.hdname,
state.stateColor,
state.stateName
FROM
hd_wm_sbxx xx
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
LEFT JOIN hd_wm_xx zt ON zt.hdid = xx.hdid
LEFT JOIN `user` u ON u.id = xx.hdsbrid
LEFT JOIN audit_state state ON state.stateId = xx.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdzplx", "=", hdlb);
cnd.andEX("xx.hdzplx2", "=", zplb);
cnd.andEX("xx.auditState", "=", stateId);
if (Strings.isNotBlank(page.getSearchKeyword()) && Strings.isNotBlank(page.getSearchName())) {
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
}
if (Strings.isNotBlank(isAudit)) {
cnd.and("xx.auditState", isAudit.equals("true") ? ">" : "=", "4200");
} else {
cnd.and("xx.auditState", ">=", "4200");
}
if (Strings.isNotBlank(page.getPageOrderName()) && Strings.isNotBlank(page.getPageOrderBy())) {
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
} else {
cnd.desc("xx.hdsbsj").asc("xx.auditState").asc("unioncode");
}
sql.setCondition(cnd);
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object doReview(@Param(value = "id", required = false) String id,
@Param(value = "ids", required = false) String[] ids,
Integer pass,
Audit audit) {
String auditState = (pass == 1 ? "4300" : pass == 2 ? "4250" : "4400");
baseService.insert(audit);
if (Lang.isNotEmpty(ids)) {
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("schoolAuditId", audit.getId()), Cnd.where("id", "in", ids));
} else {
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("schoolAuditId", audit.getId()), Cnd.where("id", "=", id));
}
return null;
}
}
@@ -0,0 +1,139 @@
package io.v.nutz.hd.controller.wmhd;
import cn.hutool.core.util.StrUtil;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.hd.models.Hd_wm_sbxx;
import io.v.nutz.modules.models.Audit;
import io.v.nutz.modules.models.PageForm;
import io.v.nutz.util.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* TODO
*
* @Author zhf
* @Date 2022/11/24 10:53
*/
@IocBean
@At("/platform/hd/wmhd/union/audit")
@Ok("json:full")
public class HdWmUnionAuditController {
@At("")
@Ok("beetl:/platform/hd/wmhd/unionAudit.html")
@RequiresPermissions("hd.wmhd.unionAudit")
public void index() {
}
@Inject
private BaseService baseService;
@At
@ViReturn
@RequiresPermissions("hd.wmhd.unionAudit")
public Object pageData(@Param(value = "stateId", required = false) String stateId,
String isAudit,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
PageForm page,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "hdlb", required = false) String hdlb,
@Param(value = "zplb", required = false) String zplb,
@Param(value = "year", required = false) String year) {
Sql sql = Sqls.create("""
SELECT
xx.*,
u.username,
u.loginname,
u.unitname AS 'dwname',
u.unionname AS 'ghname',
hdlb.lname AS hdlbname,
zplb.zname AS zplbname,
zt.hdname,
state.stateColor,
state.stateName
FROM
hd_wm_sbxx xx
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
LEFT JOIN hd_wm_xx zt ON zt.hdid = xx.hdid
LEFT JOIN `user` u ON u.id = xx.hdsbrid
LEFT JOIN audit_state state ON state.stateId = xx.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
cnd.andEX("u.unionid", "=", unionId);
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
cnd.andEX("u.unionid", "=", Vi.getUnionId());
}
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("xx.hdid", "=", hdid);
cnd.andEX("xx.hdzplx", "=", hdlb);
cnd.andEX("xx.hdzplx2", "=", zplb);
cnd.andEX("xx.auditState", "=", stateId);
if (Strings.isNotBlank(page.getSearchKeyword()) && Strings.isNotBlank(page.getSearchName())) {
cnd.and(Cnd.likeEX(page.getSearchName(), page.getSearchKeyword()));
}
if (Strings.isNotBlank(isAudit)) {
cnd.and("xx.auditState", isAudit.equals("true") ? ">" : "=", "4000");
} else {
cnd.and("xx.auditState", ">=", "4000");
}
if (Strings.isNotBlank(page.getPageOrderName()) && Strings.isNotBlank(page.getPageOrderBy())) {
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
} else {
cnd.desc("xx.hdsbsj").asc("xx.auditState").asc("unioncode");
}
sql.setCondition(cnd);
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("hd.wmhd.unionAudit")
@Aop(TransAop.READ_COMMITTED)
public Object doReview(@Param(value = "id", required = false) String id,
@Param(value = "ids", required = false)String[] ids,
Integer pass,
Audit audit) {
if (StrUtil.isBlank(id) && Lang.isEmptyArray(ids)) {
return Result.error("参数错误");
}
String auditState = (pass == 1 ? "4150" : pass == 2 ? "4100" : "4200");
baseService.insert(audit);
if (Lang.isNotEmpty(ids)) {
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("unionAuditId", audit.getId()), Cnd.where("id", "in", ids));
} else {
baseService.dao().update(Hd_wm_sbxx.class, Chain.make("auditState", auditState).add("unionAuditId", audit.getId()), Cnd.where("id", "=", id));
}
return null;
}
}
@@ -79,14 +79,14 @@ public class StaffActivitiesCon {
@Ok("json")
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
@RequiresAuthentication
public Object doSubmit(@Param("..") Hd_wm_sbxx sbxx, @Param("files") TempFile[] files) {
public Object doSubmit(@Param("..") Hd_wm_sbxx sbxx, @Param("files") TempFile[] files, boolean flag) {
try {
String path = new File("").getCanonicalPath();
sbxx.setAuditState(flag ? "4400" : "3999");
Hd_wm_sbxx insert = hdWmsbxxService.insert(sbxx);
for (TempFile file : files) {
fileService.upload(file,insert.getId(),"/hd/hdwm/");
fileService.upload(file, insert.getId(), "/hd/hdwm/");
}
@@ -1,96 +0,0 @@
package io.v.nutz.hd.controller.zxdt;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.hd.models.Hd_papers;
import io.v.nutz.hd.models.Hd_subject_reply;
import io.v.nutz.hd.services.HdPaperService;
import io.v.nutz.hd.services.HdSubjectAnswerService;
import io.v.nutz.hd.services.HdSubjectReplyService;
import io.v.nutz.hd.services.HdSubjectService;
import io.v.nutz.util.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @author: Aaron
* @create: 2020-10-23 09:24
* @description: 开始答题
**/
@At("/platform/hd/zxdt/answer")
@Ok("json:full")
@IocBean
@RequiresAuthentication
public class AnswerController {
@Inject
private HdSubjectAnswerService hdSubjectAnswerService;
@Inject
private HdPaperService hdPaperService;
@Inject
private HdSubjectService hdSubjectService;
@Inject
private HdSubjectReplyService hdSubjectReplyService;
@At("")
@Ok("beetl:/platform/hd/zxdt/answer.html")
@RequiresPermissions("hd.zxdt.ksdt")
public void index() {
}
@At
@ViReturn
public Object pageData(Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("SELECT id, `name`, explain_txt, answer_num, fraction, answer_start_time, answer_end_time, create_time FROM hd_papers $condition");
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
} else {
cnd.desc("create_time").desc("answer_start_time");
}
sql.setCondition(cnd);
return hdPaperService.listPage(pageNumber, pageSize, sql);
}
@At
public Object doAdd(@Param("replyList") Hd_subject_reply[] replyList) {
try {
hdSubjectAnswerService.doAdd(replyList, (String) ShiroUtil.getPrincipalProperty("loginname"));
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
public Object findOne(String id) {
try {
Hd_papers hd_papers = (Hd_papers) hdSubjectAnswerService.findOne(id, (String) ShiroUtil.getPrincipalProperty("loginname"));
return Result.success().addData(hd_papers);
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
}
@@ -1,162 +0,0 @@
package io.v.nutz.hd.controller.zxdt;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.hd.models.Hd_papers;
import io.v.nutz.hd.models.Hd_subject;
import io.v.nutz.hd.services.HdPaperService;
import io.v.nutz.hd.services.HdSubjectService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
/**
* @author: Aaron
* @create: 2020-10-21 09:45
* @description: 试卷管理
**/
@At("/platform/hd/zxdt/papers")
@Ok("json:full")
@IocBean
@RequiresAuthentication
public class PapersController {
@Inject
private BaseService baseService;
@Inject
private HdPaperService hdPaperService;
@Inject
private HdSubjectService hdSubjectService;
@At("")
@Ok("beetl:/platform/hd/zxdt/papers.html")
@RequiresPermissions("hd.zxdt.sj")
public void index() {
}
@At
@ViReturn
public Object pageData(Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("SELECT id, `name`, explain_txt, answer_num, fraction, answer_start_time, answer_end_time, create_time FROM hd_papers $condition");
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
} else {
cnd.desc("create_time");
}
sql.setCondition(cnd);
return hdPaperService.listPage(pageNumber, pageSize, sql);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object doAdd(@Param("papers") Hd_papers papers, @Param("subject") Hd_subject[] subject) {
papers.setCreate_time(DateUtil.getDate());
ArrayList<Hd_subject> hd_subject = new ArrayList<>();
for (Hd_subject hdSubject : subject) {
hd_subject.add(hdSubject);
}
papers.setSubjects(hd_subject);
hdPaperService.insertRelation(hdPaperService.insert(papers), "subjects");
return null;
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object doEdit(@Param("papers") Hd_papers papers, @Param("subject") Hd_subject[] subject) {
baseService.clear("hd_papers_subject", Cnd.where("pid", "=", papers.getId()));
papers.setCreate_time(DateUtil.getDate());
hdPaperService.updateIgnoreNull(papers);
ArrayList<Hd_subject> hd_subject = new ArrayList<>();
for (Hd_subject hdSubject : subject) {
hd_subject.add(hdSubject);
}
papers.setSubjects(hd_subject);
hdPaperService.insertRelation(papers, "subjects");
return null;
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object delete(String id) {
hdPaperService.delete(id);
baseService.clear("hd_papers_subject", Cnd.where("pid", "=", id));
return null;
}
@At
@ViReturn
public Object findOne(String id) {
Hd_papers hd_papers = hdPaperService.fetchLinks(hdPaperService.fetch(id), "subjects", Cnd.NEW().asc("location"));
List<Hd_subject> subjects = new ArrayList<>();
hd_papers.getSubjects().forEach(v -> {
subjects.add(hdSubjectService.fetchLinks(hdSubjectService.fetch(v.getId()), "answer", Cnd.NEW().asc("location")));
});
hd_papers.setSubjects(subjects);
return hd_papers;
}
@At
@ViReturn
public Object findSubject(Integer pageNumber, Integer pageSize, String type, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("SELECT\n" +
"\tsub.id,\n" +
"\tsub.`name`,\n" +
"\tsub.type,\n" +
"\tGROUP_CONCAT(ans.option_txt separator '、') option_txt\n" +
"FROM\n" +
"\thd_subject sub\n" +
"\tLEFT JOIN hd_subject_answer ans ON ans.subject_id = sub.id \n" +
"\tAND ans.is_yes = TRUE $condition");
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Strings.isNotBlank(type)) {
cnd.where().and("sub.type", "=", type);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
} else {
cnd.desc("sub.location");
}
cnd.groupBy("sub.id");
sql.setCondition(cnd);
return hdSubjectService.listPage(pageNumber, pageSize, sql);
}
}
@@ -1,111 +0,0 @@
package io.v.nutz.hd.controller.zxdt;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.hd.models.Hd_papers;
import io.v.nutz.hd.models.Hd_subject;
import io.v.nutz.hd.services.HdPaperService;
import io.v.nutz.hd.services.HdSubjectReplyService;
import io.v.nutz.hd.services.HdSubjectService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author: Aaron
* @create: 2020-10-24 08:48
* @description: 统计分析
**/
@At("/platform/hd/zxdt/result")
@Ok("json:full")
@IocBean
@RequiresAuthentication
public class ResultController {
@Inject
private HdPaperService hdPaperService;
@Inject
private HdSubjectService hdSubjectService;
@Inject
private HdSubjectReplyService hdSubjectReplyService;
@At("")
@Ok("beetl:/platform/hd/zxdt/result.html")
@RequiresPermissions("hd.zxdt.tj")
public void index() {
}
@At
@ViReturn
public Object pageData(Integer pageNumber, Integer pageSize, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("SELECT id, `name`, explain_txt, answer_num, fraction, answer_start_time, answer_end_time, create_time FROM hd_papers $condition");
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
} else {
cnd.desc("create_time");
}
sql.setCondition(cnd);
return hdPaperService.listPage(pageNumber, pageSize, sql);
}
@At
@ViReturn
public Object findOne(String id) {
Map result = new HashMap();
Hd_papers hd_papers = hdPaperService.fetchLinks(hdPaperService.fetch(id), "subjects", Cnd.NEW().asc("location"));
List<Hd_subject> subjects = new ArrayList<>();
hd_papers.getSubjects().forEach(v -> {
subjects.add(hdSubjectService.fetchLinks(hdSubjectService.fetch(v.getId()), "answer", Cnd.NEW().asc("location")));
});
hd_papers.setSubjects(subjects);
result.put("hd_papers", hd_papers);
hd_papers.getSubjects().forEach(subject -> {
Map map = new HashMap();
Sql yxs = Sqls.create("SELECT COUNT(DISTINCT reply.unique_id) \n" +
"FROM hd_subject_reply reply\n" +
"WHERE reply.answer_id IN (SELECT ans.id FROM hd_subject_answer ans WHERE ans.subject_id = @subject_id)\n" +
"AND reply.papers_id = @papers_id").setParam("subject_id", subject.getId()).setParam("papers_id", id);
Sql sql = Sqls.create("SELECT answer_id,count(DISTINCT unique_id) num \n" +
"FROM hd_subject_reply \n" +
"WHERE subject_id = @subject_id \n" +
"AND papers_id = @papers_id \n" +
"GROUP BY answer_id").setParam("subject_id", subject.getId()).setParam("papers_id", id);
hdSubjectReplyService.list(sql).forEach(v -> {
map.put(v.getString("answer_id"), v.getInt("num"));
});
map.put("yxs", hdSubjectReplyService.count(yxs));
result.put(subject.getId(), map);
});
return result;
}
}
@@ -1,149 +0,0 @@
package io.v.nutz.hd.controller.zxdt;
import cn.wizzer.framework.base.Result;
import cn.wizzer.framework.base.service.BaseService;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.base.utils.PageUtil;
import io.v.nutz.hd.models.Hd_subject;
import io.v.nutz.hd.models.Hd_subject_answer;
import io.v.nutz.hd.services.HdPaperService;
import io.v.nutz.hd.services.HdSubjectAnswerService;
import io.v.nutz.hd.services.HdSubjectService;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Strings;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
/**
* @author: Aaron
* @create: 2020-10-21 09:45
* @description: 题库管理
**/
@At("/platform/hd/zxdt/subject")
@Ok("json:full")
@IocBean
@RequiresAuthentication
public class SubjectController {
@Inject
private BaseService baseService;
@Inject
private HdPaperService hdPaperService;
@Inject
private HdSubjectService hdSubjectService;
@Inject
private HdSubjectAnswerService hdSubjectAnswerService;
@At("")
@Ok("beetl:/platform/hd/zxdt/subject.html")
@RequiresPermissions("hd.zxdt.tk")
public void index() {
}
@At
@ViReturn
public Object pageData(Integer pageNumber, Integer pageSize, String type, String searchName, String searchKeyword, String pageOrderName, String pageOrderBy) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("SELECT id, `name`, type, create_time FROM hd_subject $condition");
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
cnd.where().andLike(searchName, searchKeyword);
}
if (Strings.isNotBlank(type)) {
cnd.where().and("type", "=", type);
}
if (Strings.isNotBlank(pageOrderName) && Strings.isNotBlank(pageOrderName)) {
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
} else {
cnd.desc("location");
}
sql.setCondition(cnd);
return hdSubjectService.listPage(pageNumber, pageSize, sql);
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object doAdd(@Param("subject") Hd_subject subject) {
String time = DateUtil.getDate();
subject.setCreate_time(time);
for (Hd_subject_answer answer : subject.getAnswer()) {
answer.setCreate_time(time);
}
hdSubjectService.insertWith(subject, "answer");
return null;
}
@At
@ViReturn
@Aop(TransAop.READ_COMMITTED)
public Object doEdit(@Param("subject") Hd_subject subject, String[] delOption) {
if (delOption.length > 0) {
for (String s : delOption) {
hdSubjectAnswerService.delete(s);
}
}
String time = DateUtil.getDate();
for (Hd_subject_answer answer : subject.getAnswer()) {
if (Strings.isBlank(answer.getSubject_id()) && Strings.isBlank(answer.getId())) {
answer.setCreate_time(time);
answer.setSubject_id(subject.getId());
hdSubjectAnswerService.insert(answer);
}
}
hdSubjectService.updateWith(subject, "answer");
return null;
}
@At
@Aop(TransAop.READ_COMMITTED)
public Object delete(String id) {
try {
List<Record> records = hdPaperService.list(Sqls.create("SELECT `name` FROM hd_papers WHERE id IN (SELECT pid FROM `hd_papers_subject` WHERE sid = @sid )").setParam("sid", id));
List<String> name = new ArrayList<>();
if (records.size() > 0) {
records.forEach(v -> {
name.add(v.getString("name"));
});
return Result.error().addMsg("试卷 " + name + " 正在使用该题");
}
hdSubjectService.delete(id);
hdSubjectAnswerService.clear(Cnd.where("subject_id", "=", id));
return Result.success();
} catch (Exception e) {
return Result.error();
}
}
@At
@ViReturn
public Object findOne(String id) {
return hdSubjectService.fetchLinks(hdSubjectService.fetch(id), "answer", Cnd.NEW().asc("location"));
}
}
@@ -1,72 +0,0 @@
package io.v.nutz.hd.controller.zxdt.mobile;
import cn.wizzer.framework.base.Result;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.hd.models.Hd_papers;
import io.v.nutz.hd.models.Hd_subject_reply;
import io.v.nutz.hd.services.HdSubjectAnswerService;
import io.v.nutz.hd.services.HdSubjectReplyService;
import io.v.nutz.hd.services.HdSubjectService;
import io.v.nutz.util.ShiroUtil;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Attr;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
/**
* @author: Aaron
* @create: 2020-10-23 09:24
* @description: 手机端答题
**/
@At("/platform/hd/zxdt/mobile/answer")
@Ok("json:full")
@IocBean
public class MobileAnswerController {
@Inject
private HdSubjectAnswerService hdSubjectAnswerService;
@Inject
private HdSubjectService hdSubjectService;
@Inject
private HdSubjectReplyService hdSubjectReplyService;
@Inject
private Vi vi;
@At("")
@Ok("beetl:/platform/hd/zxdt/mobile/mobile_answer.html")
public void index(String papers_id, HttpSession session) {
session.setAttribute("papers_id", papers_id);
}
@At
@ViReturn
public Object doAdd(@Param("replyList") Hd_subject_reply[] replyList, HttpServletRequest request) {
try {
hdSubjectAnswerService.doAdd(replyList, String.valueOf(Vi.getCookie(request, "sid")));
return Result.success();
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
@At
public Object findOne(@Attr("papers_id") String papers_id) {
try {
Hd_papers hd_papers = (Hd_papers) hdSubjectAnswerService.findOne(papers_id, (String) ShiroUtil.getPrincipalProperty("loginname"));
return Result.success().addData(hd_papers);
} catch (Exception e) {
e.printStackTrace();
return Result.error();
}
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
@@ -10,6 +11,7 @@ import java.util.List;
* @Date 2022/4/22
* @Description 打卡签到活动
*/
@Data
@Table("hd_checkin")
public class HdCheckIn implements Serializable {
@@ -96,139 +98,4 @@ public class HdCheckIn implements Serializable {
private List<HdCheckinFile> files;
public List<HdCheckinFile> getFiles() {
return files;
}
public void setFiles(List<HdCheckinFile> files) {
this.files = files;
}
public String getRate() {
return rate;
}
public void setRate(String rate) {
this.rate = rate;
}
public List<Hd_wm_bgi> getBgis() {
return bgis;
}
public void setBgis(List<Hd_wm_bgi> bgis) {
this.bgis = bgis;
}
public String getHdid() {
return hdid;
}
public void setHdid(String hdid) {
this.hdid = hdid;
}
public String getHdname() {
return hdname;
}
public void setHdname(String hdname) {
this.hdname = hdname;
}
public String getHdjs() {
return hdjs;
}
public void setHdjs(String hdjs) {
this.hdjs = hdjs;
}
public String getHdcjry() {
return hdcjry;
}
public void setHdcjry(String hdcjry) {
this.hdcjry = hdcjry;
}
public String getHdjlfs() {
return hdjlfs;
}
public void setHdjlfs(String hdjlfs) {
this.hdjlfs = hdjlfs;
}
public String getHdnr() {
return hdnr;
}
public void setHdnr(String hdnr) {
this.hdnr = hdnr;
}
public String getHdlxr() {
return hdlxr;
}
public void setHdlxr(String hdlxr) {
this.hdlxr = hdlxr;
}
public String getHdother() {
return hdother;
}
public void setHdother(String hdother) {
this.hdother = hdother;
}
public String getHdkssj() {
return hdkssj;
}
public void setHdkssj(String hdkssj) {
this.hdkssj = hdkssj;
}
public String getHdjssj() {
return hdjssj;
}
public void setHdjssj(String hdjssj) {
this.hdjssj = hdjssj;
}
public Boolean getHdflag() {
return hdflag;
}
public void setHdflag(Boolean hdflag) {
this.hdflag = hdflag;
}
public String getHdcjr() {
return hdcjr;
}
public void setHdcjr(String hdcjr) {
this.hdcjr = hdcjr;
}
public String getHdcjsj() {
return hdcjsj;
}
public void setHdcjsj(String hdcjsj) {
this.hdcjsj = hdcjsj;
}
public String getHdcolor() {
return hdcolor;
}
public void setHdcolor(String hdcolor) {
this.hdcolor = hdcolor;
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
@@ -9,6 +10,7 @@ import java.io.Serializable;
* @Date 2022/4/22
* @Description
*/
@Data
@Table("hd_checkin_zan")
public class HdCheckZan implements Serializable {
@@ -36,35 +38,4 @@ public class HdCheckZan implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userid;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getHdid() {
return hdid;
}
public void setHdid(String hdid) {
this.hdid = hdid;
}
public String getContentId() {
return contentId;
}
public void setContentId(String contentId) {
this.contentId = contentId;
}
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
@@ -9,6 +10,7 @@ import java.io.Serializable;
* @Date 2022/4/22
* @Description
*/
@Data
@Table("hd_checkin_content")
public class HdCheckinContent implements Serializable {
@@ -46,51 +48,4 @@ public class HdCheckinContent implements Serializable {
@ColDefine(type = ColType.BOOLEAN)
private Boolean isOpen;
public String getUserid() {
return userid;
}
public void setUserid(String userid) {
this.userid = userid;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getHdid() {
return hdid;
}
public void setHdid(String hdid) {
this.hdid = hdid;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Boolean getOpen() {
return isOpen;
}
public void setOpen(Boolean open) {
isOpen = open;
}
}
@@ -1,5 +1,6 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
@@ -9,6 +10,7 @@ import java.io.Serializable;
* @Date 2022/4/22
* @Description
*/
@Data
@Table("hd_checkin_file")
public class HdCheckinFile implements Serializable {
@@ -41,43 +43,4 @@ public class HdCheckinFile implements Serializable {
@ColDefine(type = ColType.VARCHAR,width = 100)
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getHdid() {
return hdid;
}
public void setHdid(String hdid) {
this.hdid = hdid;
}
public String getContentId() {
return contentId;
}
public void setContentId(String contentId) {
this.contentId = contentId;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
@@ -1,65 +0,0 @@
package io.v.nutz.hd.models;
import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.integration.json4excel.annotation.J4EIgnore;
import java.util.List;
/**
* @author: Aaron
* @create: 2020-10-21 16:43
* @description: 试卷
**/
@Data
@Table("hd_papers")
public class Hd_papers extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("试卷名称")
@J4EIgnore
@ColDefine(type = ColType.TEXT)
private String name;
@Column
@Comment("说明")
@ColDefine(type = ColType.TEXT)
private String explain_txt;
@Column
@Comment("分数")
@ColDefine(type = ColType.INT, width = 3)
private Integer fraction;
@Column
@Comment("每日可答次数")
@ColDefine(type = ColType.INT, width = 2)
private Integer answer_num;
@Column
@Comment("每日开始答题时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String answer_start_time;
@Column
@Comment("每日结束答题时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String answer_end_time;
@Column
@Comment("创建时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String create_time;
@ManyMany(relation = "hd_papers_subject", from = "pid", to = "sid")
private List<Hd_subject> subjects;
}
@@ -1,55 +0,0 @@
package io.v.nutz.hd.models;
import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import org.nutz.integration.json4excel.annotation.J4EIgnore;
import java.util.List;
/**
* @author: Aaron
* @create: 2020-10-21 09:56
* @description: 题目
**/
@Data
@Table("hd_subject")
public class Hd_subject extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("题名")
@J4EIgnore
@ColDefine(type = ColType.TEXT)
private String name;
@Column
@Comment("题型 (1.单选 2.多选 3.填空)")
@J4EIgnore
@ColDefine(type = ColType.INT, width = 2)
private Integer type;
@Column
@Comment("创建时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String create_time;
@Column
@Comment("排序字段")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM hd_subject"),
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM hd_subject")
})
private Integer location;
@Many(field = "subject_id")
private List<Hd_subject_answer> answer;
}
@@ -1,59 +0,0 @@
package io.v.nutz.hd.models;
import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import org.nutz.integration.json4excel.annotation.J4EIgnore;
/**
* @author: Aaron
* @create: 2020-10-21 10:04
* @description: 答案
**/
@Data
@Table("hd_subject_answer")
public class Hd_subject_answer extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("所属题目")
@J4EIgnore
@ColDefine(type = ColType.VARCHAR, width = 32)
private String subject_id;
@Column
@Comment("选项文字")
@J4EIgnore
@ColDefine(type = ColType.VARCHAR, width = 200)
private String option_txt;
@Column
@Comment("是否正确答案")
@J4EIgnore
@ColDefine(type = ColType.BOOLEAN)
private Boolean is_yes;
@Column
@Comment("创建时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String create_time;
@Column
@Comment("排序字段")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM hd_subject_answer"),
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM hd_subject_answer")
})
private Integer location;
@One(field = "subject_id", key = "id")
private Hd_subject subject;
}
@@ -1,57 +0,0 @@
package io.v.nutz.hd.models;
import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
/**
* @author: Aaron
* @create: 2020-10-23 09:30
* @description: 提交的试卷
**/
@Data
@Table("hd_subject_reply")
public class Hd_subject_reply extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
@Column
@Comment("所属试卷")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String papers_id;
@Column
@Comment("所属题目")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String subject_id;
@Column
@Comment("所选答案")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String answer_id;
@Column
@Comment("唯一id")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String unique_id;
@Column
@Comment("提交时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String submit_time;
@Column
@Comment("排序字段")
@Prev({
@SQL(db = DB.MYSQL, value = "SELECT IFNULL(MAX(location),0)+1 FROM Hd_subject_reply"),
@SQL(db = DB.ORACLE, value = "SELECT COALESCE(MAX(location),0)+1 FROM Hd_subject_reply")
})
private Integer location;
}
@@ -0,0 +1,43 @@
package io.v.nutz.zhgh.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
/**
* @ClassName Hd_wm_dz_xx
* @Description 作品征集点赞信息
* @Author zhf
* @Date 2024/6/3 10:41
*/
@Data
@Table
public class Hd_wm_dz_xx implements Serializable {
@Column
@Name
@Comment("ID")
@Prev(els = {@EL("uuid()")})
@ColDefine(type = ColType.VARCHAR, width = 32)
private String id;
@Column
@Comment("作品id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String zpid;
@Column
@Comment("hdid")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String hdid;
@Column
@Comment("点赞人id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userid;
@Column
@Comment("点赞日期")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String applyDate;
}
@@ -1,5 +1,6 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
@@ -9,6 +10,7 @@ import java.util.List;
* Created by lyw on 2020/3/13 11:10
* 三八活动类别
*/
@Data
@Table("Hd_wm_lb")
public class Hd_wm_lb implements Serializable {
@@ -36,43 +38,4 @@ public class Hd_wm_lb implements Serializable {
private List<Hd_wm_zplb> zplbs;
public List<Hd_wm_zplb> getZplbs() {
return zplbs;
}
public void setZplbs(List<Hd_wm_zplb> zplbs) {
this.zplbs = zplbs;
}
public String getLid() {
return lid;
}
public void setLid(String lid) {
this.lid = lid;
}
public String getLhdid() {
return lhdid;
}
public void setLhdid(String lhdid) {
this.lhdid = lhdid;
}
public String getLname() {
return lname;
}
public void setLname(String lname) {
this.lname = lname;
}
public int getLlocation() {
return llocation;
}
public void setLlocation(int llocation) {
this.llocation = llocation;
}
}
@@ -1,9 +1,11 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
@Data
@Table("Hd_wm_sbxx")
@TableIndexes({@Index(name = "INDEX_HDWMSB_HBSBRID", fields = {"hdsbrid"}, unique = false)})
public class Hd_wm_sbxx implements Serializable {
@@ -22,14 +24,6 @@ public class Hd_wm_sbxx implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 32)
private String hdid;
public String getHdid() {
return hdid;
}
public void setHdid(String hdid) {
this.hdid = hdid;
}
@Column
@Comment("上报人id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@@ -52,9 +46,14 @@ public class Hd_wm_sbxx implements Serializable {
@Column
@Comment("作品描述")
@ColDefine(type = ColType.VARCHAR, width = 100)
@ColDefine(type = ColType.TEXT)
private String hdsbzpms;
@Column
@Comment("作品名称")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zpmc;
@Column
@Comment("上报时间")
@ColDefine(type = ColType.VARCHAR, width = 20)
@@ -65,67 +64,29 @@ public class Hd_wm_sbxx implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 20)
private String mobile;
public String getId() {
return id;
}
@Column
@Comment("状态")
@ColDefine(type = ColType.VARCHAR, width = 20)
private String auditState;
public void setId(String id) {
this.id = id;
}
@Column
@Comment("分工会审核id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionAuditId;
public String getHdsbrid() {
return hdsbrid;
}
@Column
@Comment("校工会审核id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String schoolAuditId;
public void setHdsbrid(String hdsbrid) {
this.hdsbrid = hdsbrid;
}
@Column
@Comment("是否发送系统消息")
@ColDefine(type = ColType.BOOLEAN)
private Boolean xlFlag;
public String getHdsbsj() {
return hdsbsj;
}
@Column
@Comment("是否优秀作品")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isExcellent;
public void setHdsbsj(String hdsbsj) {
this.hdsbsj = hdsbsj;
}
public String getHdsbzpzt() {
return hdsbzpzt;
}
public void setHdsbzpzt(String hdsbzpzt) {
this.hdsbzpzt = hdsbzpzt;
}
public String getHdsbzpms() {
return hdsbzpms;
}
public void setHdsbzpms(String hdsbzpms) {
this.hdsbzpms = hdsbzpms;
}
public String getHdzplx() {
return hdzplx;
}
public void setHdzplx(String hdzplx) {
this.hdzplx = hdzplx;
}
public String getHdzplx2() {
return hdzplx2;
}
public void setHdzplx2(String hdzplx2) {
this.hdzplx2 = hdzplx2;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
}
@@ -1,9 +1,11 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
@Data
@Table("Hd_wm_sbxx_fj")
@TableIndexes({@Index(name = "INDEX_HDWMSB_FJ_HBSBID", fields = {"hdsbid"}, unique = false)})
public class Hd_wm_sbxx_fj implements Serializable {
@@ -31,35 +33,4 @@ public class Hd_wm_sbxx_fj implements Serializable {
@ColDefine(type = ColType.VARCHAR,width = 100)
private String fjname;
public String getFjid() {
return fjid;
}
public void setFjid(String fjid) {
this.fjid = fjid;
}
public String getHdsbid() {
return hdsbid;
}
public void setHdsbid(String hdsbid) {
this.hdsbid = hdsbid;
}
public String getFjurl() {
return fjurl;
}
public void setFjurl(String fjurl) {
this.fjurl = fjurl;
}
public String getFjname() {
return fjname;
}
public void setFjname(String fjname) {
this.fjname = fjname;
}
}
@@ -65,6 +65,21 @@ public class Hd_wm_xx implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 50)
private String hdjssj;
@Column
@Comment("点赞开始时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dzkssj;
@Column
@Comment("点赞结束时间")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String dzjssj;
@Column
@Comment("每人每日点赞次数")
@ColDefine(type = ColType.INT)
private Integer dzNum;
@Column
@Comment("活动状态 (开启 关闭)")
@ColDefine(type = ColType.BOOLEAN)
@@ -84,21 +99,21 @@ public class Hd_wm_xx implements Serializable {
@Comment("配色")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String hdcolor;
@Column
@Comment("活动范围Id")
@ColDefine(type = ColType.INT, width = 32)
private Integer activityGroupId;
@Column
@Comment("活动范围名称")
@ColDefine(type = ColType.VARCHAR, width = 40)
private String activityGroupName;
@Column
@Comment("活动类型(1 教工 2 亲子)")
@ColDefine(type = ColType.INT, width = 1)
private Integer hdtype;
public Integer getHdtype() {
return hdtype;
}
public void setHdtype(Integer hdtype) {
this.hdtype = hdtype;
}
private List<Hd_wm_lb> lbs;
private List<Hd_wm_bgi> bgis;
@@ -109,5 +124,26 @@ public class Hd_wm_xx implements Serializable {
@ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> files;
@Column
@Comment("是否发送系统消息")
@ColDefine(type = ColType.BOOLEAN)
private Boolean xlFlag;
@Column
@Comment("是否推送移动端首页")
@ColDefine(type = ColType.INT)
private Integer isPushHome;
@Column
@Comment("是否启用积分系统")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isIntegral;
@Column
@Comment("任务id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String taskId;
}
@@ -1,13 +1,16 @@
package io.v.nutz.hd.models;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
import java.util.List;
/**
* Created by lyw on 2020/3/13 11:10
* 三八活动作品类别
*/
@Data
@Table("Hd_wm_zplb")
public class Hd_wm_zplb implements Serializable {
@@ -28,40 +31,54 @@ public class Hd_wm_zplb implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 100)
private String zname;
@Column
@Comment("作品介绍最多字数")
@ColDefine(type = ColType.INT, width = 20)
private Integer maxWordCount;
@Column
@Comment("是否上传图片")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isUploadPhoto;
@Column
@Comment("上传图片数量")
@ColDefine(type = ColType.INT, width = 10)
private Integer photoNum;
@Column
@Comment("上传图片格式")
@ColDefine(type = ColType.MYSQL_JSON)
private List<String> photoType;
@Column
@Comment("每张图片大小")
@ColDefine(type = ColType.INT, width = 10)
private Integer photoSize;
@Column
@Comment("是否上传音/视频、文档")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isUploadOther;
@Column
@Comment("上传音/视频、文档数量")
@ColDefine(type = ColType.INT, width = 10)
private Integer otherFileNum;
@Column
@Comment("上传音/视频、文档格式")
@ColDefine(type = ColType.MYSQL_JSON)
private List<String> otherType;
@Column
@Comment("每个音/视频、文档大小")
@ColDefine(type = ColType.INT, width = 10)
private Integer otherSize;
@Column
@Comment("排序")
@ColDefine(type = ColType.INT, width = 4)
private int zlocation;
public String getZid() {
return zid;
}
public void setZid(String zid) {
this.zid = zid;
}
public String getZlid() {
return zlid;
}
public void setZlid(String zlid) {
this.zlid = zlid;
}
public String getZname() {
return zname;
}
public void setZname(String zname) {
this.zname = zname;
}
public int getZlocation() {
return zlocation;
}
public void setZlocation(int zlocation) {
this.zlocation = zlocation;
}
}
@@ -1,8 +0,0 @@
package io.v.nutz.hd.services;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.hd.models.Hd_papers;
public interface HdPaperService extends BaseService<Hd_papers> {
}
@@ -1,12 +0,0 @@
package io.v.nutz.hd.services;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.hd.models.Hd_subject_answer;
import io.v.nutz.hd.models.Hd_subject_reply;
public interface HdSubjectAnswerService extends BaseService<Hd_subject_answer> {
void doAdd(Hd_subject_reply[] replyList, String unique_id) throws Exception;
Object findOne(String id, String unique_id) throws Exception;
}
@@ -1,8 +0,0 @@
package io.v.nutz.hd.services;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.hd.models.Hd_subject_reply;
public interface HdSubjectReplyService extends BaseService<Hd_subject_reply> {
}
@@ -1,8 +0,0 @@
package io.v.nutz.hd.services;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.hd.models.Hd_subject;
public interface HdSubjectService extends BaseService<Hd_subject> {
}
@@ -1,20 +0,0 @@
package io.v.nutz.hd.services.impl;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.hd.models.Hd_papers;
import io.v.nutz.hd.services.HdPaperService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* @author: Aaron
* @create: 2020-10-21 10:39
* @description:
**/
@IocBean(args = {"refer:dao"})
public class HdPaperServiceImpl extends BaseServiceImpl<Hd_papers> implements HdPaperService {
public HdPaperServiceImpl(Dao dao) {
super(dao);
}
}
@@ -1,91 +0,0 @@
package io.v.nutz.hd.services.impl;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.base.utils.DateUtil;
import io.v.nutz.hd.models.Hd_papers;
import io.v.nutz.hd.models.Hd_subject;
import io.v.nutz.hd.models.Hd_subject_answer;
import io.v.nutz.hd.models.Hd_subject_reply;
import io.v.nutz.hd.services.HdPaperService;
import io.v.nutz.hd.services.HdSubjectAnswerService;
import io.v.nutz.hd.services.HdSubjectReplyService;
import io.v.nutz.hd.services.HdSubjectService;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.ArrayList;
import java.util.List;
/**
* @author: Aaron
* @create: 2020-10-21 10:39
* @description:
**/
@IocBean(args = {"refer:dao"})
public class HdSubjectAnswerServiceImpl extends BaseServiceImpl<Hd_subject_answer> implements HdSubjectAnswerService {
public HdSubjectAnswerServiceImpl(Dao dao) {
super(dao);
}
@Inject
private HdPaperService hdPaperService;
@Inject
private HdSubjectService hdSubjectService;
@Inject
private HdSubjectReplyService hdSubjectReplyService;
@Override
@Aop(TransAop.READ_COMMITTED)
public void doAdd(Hd_subject_reply[] replyList, String unique_id) throws Exception {
String time = DateUtil.getDateTime();
for (Hd_subject_reply reply : replyList) {
reply.setSubmit_time(time);
reply.setUnique_id(unique_id);
hdSubjectReplyService.insert(reply);
}
}
@Override
public Object findOne(String id, String unique_id) {
Sql sql = Sqls.create("SELECT\n" +
"\t(\n" +
"\tSELECT\n" +
"\t\tcount( DISTINCT sr.papers_id ) \n" +
"\tFROM\n" +
"\t\t`hd_subject_reply` sr \n" +
"\tWHERE\n" +
"\t\tsr.papers_id = @papers_id \n" +
"\t\tAND sr.unique_id = @unique_id \n" +
"\t\tAND sr.submit_time = @submit_time \n" +
"\t) >= p.answer_num flag\n" +
"FROM\n" +
"\t`hd_papers` p\n" +
"\tLEFT JOIN hd_subject_reply sr ON p.id = sr.papers_id \n" +
"GROUP BY\n" +
"\tsr.papers_id").setParam("papers_id", id)
.setParam("unique_id", unique_id)
.setParam("submit_time", DateUtil.getDate());
Record record = hdPaperService.list(sql).get(0);
if (record.getInt("flag") > 0) {
return null;
}
Hd_papers hd_papers = hdPaperService.fetchLinks(hdPaperService.fetch(id), "subjects", Cnd.NEW().asc("location"));
List<Hd_subject> subjects = new ArrayList<>();
hd_papers.getSubjects().forEach(v -> {
subjects.add(hdSubjectService.fetchLinks(hdSubjectService.fetch(v.getId()), "answer", Cnd.NEW().asc("location")));
});
hd_papers.setSubjects(subjects);
return hd_papers;
}
}
@@ -1,20 +0,0 @@
package io.v.nutz.hd.services.impl;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.hd.models.Hd_subject_reply;
import io.v.nutz.hd.services.HdSubjectReplyService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* @author: Aaron
* @create: 2020-10-21 10:39
* @description:
**/
@IocBean(args = {"refer:dao"})
public class HdSubjectReplyServiceImpl extends BaseServiceImpl<Hd_subject_reply> implements HdSubjectReplyService {
public HdSubjectReplyServiceImpl(Dao dao) {
super(dao);
}
}
@@ -1,20 +0,0 @@
package io.v.nutz.hd.services.impl;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.hd.models.Hd_subject;
import io.v.nutz.hd.services.HdSubjectService;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
/**
* @author: Aaron
* @create: 2020-10-21 10:39
* @description:
**/
@IocBean(args = {"refer:dao"})
public class HdSubjectServiceImpl extends BaseServiceImpl<Hd_subject> implements HdSubjectService {
public HdSubjectServiceImpl(Dao dao) {
super(dao);
}
}
@@ -55,16 +55,7 @@ public class ApplyController {
@ViReturn
public Object doAdd(@Param("activityBx") ActivityBx activityBx, @Param("sign") String sign) {
activityBx.setYear(Calendar.getInstance().get(Calendar.YEAR));
if (ShiroUtil.hasAnyRoles(new String[]{"xghhdwy", "A06"}) && activityBx.getActivity_type().equals(2)) {
activityBx.setState_id("1020");
activityBx.setActivity_type(2);
} else if (ShiroUtil.hasAnyRoles(new String[]{"H02"}) && activityBx.getActivity_type().equals(3)) {
activityBx.setState_id("1020");
activityBx.setActivity_type(3);
} else {
activityBx.setState_id("1010");
activityBx.setActivity_type(1);
}
activityBx.setState_id("1020");
activityBx.setApply_time(DateUtil.getDate());
activityBx.setUser_id(ShiroUtil.getPrincipalProperty("id").toString());
if (Strings.isNotBlank(sign)) {
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
*/
@IocBean
@Ok("json")
@At("/platform/jf/activity_bx/recording")
@At("/platform/jf/activity_bx/reimbursement")
public class ReimbursementCon {
@@ -68,8 +68,8 @@ public class ReimbursementCon {
private ActivityFileService activityFileService;
@At("")
@Ok("beetl:/platform/jf/activitybx/recording.html")
@RequiresPermissions("sys.jf.activity_bx.recording")
@Ok("beetl:/platform/jf/activitybx/reimbursement.html")
@RequiresPermissions("sys.jf.activity_bx.reimbursement")
public void index() {
}
@@ -120,91 +120,16 @@ public class ReimbursementCon {
bxr.unionname bxr_unionname,
bxr.unioncode,
state.state_name,
state.state_color,(
CASE
state.state_id
WHEN @state1 THEN
(
SELECT
GROUP_CONCAT( u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role1
)
WHEN @state2 THEN
(
SELECT
GROUP_CONCAT( u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.unionid = bxr.unionid
AND sur.roleId = @role2
)
WHEN @state3 THEN
(
SELECT
GROUP_CONCAT( u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role3
)
WHEN @state4 THEN
(
SELECT
GROUP_CONCAT( u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role4
)
WHEN @state5 THEN
(
SELECT
GROUP_CONCAT( u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role5
)
WHEN @state6 THEN
(
SELECT
GROUP_CONCAT( u.username )
FROM
sys_user_role sur
LEFT JOIN sys_user u ON sur.userId = u.id
WHERE
sur.roleId = @role6
) ELSE NULL
END
) shrname
state.state_color,
abs.`name` absName
FROM
activity_bx bx
LEFT JOIN `user` bxr ON bx.user_id = bxr.id
LEFT JOIN state state ON state.state_id = bx.state_id $condition
LEFT JOIN state state ON state.state_id = bx.state_id
LEFT JOIN activity_basic_settings abs ON abs.`code` = bx.projectTypeCode
$condition
""");
sql.setParam("role1", Roles.CLUB_FZR);
sql.setParam("role2", Roles.UNION_MANGER);
sql.setParam("role3", Roles.XGHKJ);
sql.setParam("role4", Roles.GH_WYH_FZX);
sql.setParam("role5", Roles.GH_WYH_CWFZX);
sql.setParam("role6", Roles.XGHCN);
sql.setParam("state1", 1000);
sql.setParam("state2", 1010);
sql.setParam("state3", 1020);
sql.setParam("state4", 1030);
sql.setParam("state5", 1040);
sql.setParam("state6", 1050);
Cnd cnd = Cnd.NEW();
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
@@ -30,11 +30,22 @@ public class ActivityBx {
@ColDefine(type = ColType.VARCHAR, width = 200)
private String user_name;
@Column
@Comment("联系方式")
@ColDefine(type = ColType.VARCHAR, width = 200)
private String mobile;
@Column
@Comment("申请时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String apply_time;
@Column
@Comment("申请类型(1.经费申报2.报销申请)")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String apply_type;
@Column
@Comment("用户id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@@ -75,6 +86,11 @@ public class ActivityBx {
@ColDefine(type = ColType.TEXT)
private String activity_content;
@Column
@Comment("活动安排")
@ColDefine(type = ColType.TEXT)
private String activity_arrange;
@Column
@Comment("报销事由")
@ColDefine(type = ColType.TEXT)
@@ -1,6 +1,12 @@
package io.v.nutz.mobile.cahd;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.modules.models.PageForm;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
@@ -20,11 +26,29 @@ public class CahdApplyController {
@At("")
@Ok("beetl:/mobile/cahd/applyList.html")
@RequiresAuthentication
public void index() {
}
@At()
@ViReturn
public Object pageData(Integer year, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
xx.*,
u.username
FROM
hd_wm_xx xx
LEFT JOIN sys_user u ON u.id = xx.hdcjr
WHERE
activityGroupId IN ( SELECT groupId FROM `activity_user_scope` $condition)
AND YEAR ( hdkssj )= @year and xx.hdflag=true and xx.hdtype=2
""").setParam("year", year);
sql.setCondition(cnd);
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
}
}
@@ -1,6 +1,13 @@
package io.v.nutz.mobile.wmhd;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.modules.models.PageForm;
import io.v.nutz.util.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
@@ -22,9 +29,30 @@ public class WmhdApplyController {
@At("")
@Ok("beetl:/mobile/wmhd/applyList.html")
@RequiresAuthentication
public void index() {
}
@At()
@ViReturn
public Object pageData(Integer year, PageForm page) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT
xx.*,
u.username
FROM
hd_wm_xx xx
LEFT JOIN sys_user u ON u.id = xx.hdcjr
WHERE
activityGroupId IN ( SELECT groupId FROM `activity_user_scope` $condition)
AND YEAR ( hdkssj )= @year and xx.hdflag=true and xx.hdtype=1
""").setParam("year", year);
if (!ShiroUtil.hasRole("sysadmin")) {
cnd.and("userId", "=", ShiroUtil.getUserId());
}
sql.setCondition(cnd);
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
}
}
@@ -0,0 +1,113 @@
package io.v.nutz.mobile.wmhd;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* TODO
*
* @Author zhf
* @Date 2022/11/24 17:16
*/
@IocBean
@At("/mobile/wmhd/audit")
@Ok("json:full")
public class WmhdAuditController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/mobile/wmhd/auditList.html")
public void index() {
}
@At("/unionAudit")
@Ok("beetl:/mobile/wmhd/unionAudit.html")
public void unionAudit() {
}
@At
@ViReturn
public Object pageData(@Param(value = "hdid", required = false) String hdid,
@Param(value = "isAudit", required = false) boolean isAudit,
@Param(value = "year", required = false) Integer year,
@Param(value = "unionId", required = false) String unionId,
@Param(value = "unitId", required = false) String unitId,
@Param(value = "lx", required = false) Integer lx,
Integer pageNumber,
Integer pageSize) {
Sql sql = Sqls.create("""
SELECT
xx.*,
u.username,
u.loginname,
u.unitname AS 'dwname',
u.unionname AS 'ghname',
hdlb.lname AS hdlbname,
zplb.zname AS zplbname,
zt.hdname,
state.stateColor,
state.stateName
FROM
hd_wm_sbxx xx
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
LEFT JOIN hd_wm_xx zt ON zt.hdid = xx.hdid
LEFT JOIN `user` u ON u.id = xx.hdsbrid
LEFT JOIN audit_state state ON state.stateId = xx.auditState
$condition
""");
Cnd cnd = Cnd.NEW();
cnd.andEX("YEAR(xx.hdsbsj)", "=", year);
cnd.andEX("u.unionid", "=", unionId);
cnd.andEX("u.unitid", "=", unitId);
cnd.andEX("xx.hdid", "=", hdid);
if (!ShiroUtil.hasRole("sysadmin")) {
if (ShiroUtil.hasAnyRoles("H10")) {
cnd.and("xx.auditState", "in", isAudit ? "4250,4300,4400" : "4200");
} else {
cnd.and("u.unionid", "=", Vi.getUnionId());
cnd.and("xx.auditState", "in", isAudit ? "4100,4150,4200" : "4000");
}
} else {
cnd.and("xx.auditState", "in", isAudit ? "4100,4150,4250,4300,4400" : "4000,4200");
}
cnd.desc("xx.hdsbsj");
cnd.desc("u.unionname");
sql.setCondition(cnd);
return baseService.listPageMap(pageNumber, pageSize, sql);
}
@At("/auditHtml")
@Ok("re")
public String auditHtml(Integer auditState) {
if (auditState == 4000 || auditState == 4250) {
return "beetl:/mobile/wmhd/unionAudit.html";
} else if (auditState == 4200) {
return "beetl:/mobile/wmhd/schoolAudit.html";
}
return "beetl:/mobile/wmhd/viewInfo.html";
}
}
@@ -49,7 +49,7 @@ public class WmhdListController {
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
WHERE xx.id=@id
""").setParam("id",id);
""").setParam("id", id);
return baseService.listMap(sql);
}
@@ -0,0 +1,167 @@
package io.v.nutz.mobile.wmhd;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.page.Pagination;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import io.v.nutz.zhgh.hd.models.Hd_wm_dz_xx;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.entity.Record;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @ClassName WmhdStatisticsController
* @Description TODO
* @Author zhf
* @Date 2024/6/3 9:58
*/
@IocBean
@At("/mobile/wmhd/statistics")
@Ok("json:full")
@RequiresAuthentication
public class WmhdStatisticsController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/mobile/wmhd/statistics.html")
@RequiresAuthentication
public void index() {
}
@At
@ViReturn
public Object pageData(Integer pageNumber,
Integer pageSize,
@Param(value = "hdid", required = false) String hdid,
@Param(value = "hdlb", required = false) String hdlb) {
if (StrUtil.isBlank(hdid)) {
return null;
}
Sql sql = Sqls.create("""
SELECT
xx.*,
sbr.username AS sbrname,
sbr.loginname,
hd.hdname,
hd.dzkssj,
hd.dzjssj,
hd.hdkssj,
hd.hdjssj,
dw.name as dwname,
gh.unionname as ghname,
hdlb.lname as hdlbname,
zplb.zname as zplbname,
state.stateColor,
state.stateName,
( SELECT COUNT( dz.id )FROM hd_wm_dz_xx dz WHERE dz.zpid = xx.id AND dz.userid=@userid AND applyDate=@applyDate) dz_num,
( SELECT COUNT( dz.id )FROM hd_wm_dz_xx dz WHERE dz.zpid = xx.id ) dz_znum
FROM
hd_wm_sbxx xx
LEFT JOIN sys_user sbr ON sbr.id = xx.hdsbrid
left join sys_unit dw on dw.id = sbr.unitid
LEFT JOIN sys_union gh ON gh.id = dw.unionid
LEFT JOIN hd_wm_lb hdlb ON hdlb.lid = xx.hdzplx
LEFT JOIN hd_wm_zplb zplb ON zplb.zid = xx.hdzplx2
left join hd_wm_xx hd on hd.hdid = xx.hdid
LEFT JOIN audit_state state ON state.stateId = xx.auditState
$condition
""").setParam("userid", ShiroUtil.getUserId())
.setParam("applyDate", DateUtil.today());
Cnd cnd = Cnd.NEW();
cnd.and("xx.hdid", "=", hdid);
cnd.andEX("xx.hdzplx", "=", hdlb);
cnd.andEX("xx.auditState", "=", "4400");
cnd.desc("xx.hdsbsj").asc("xx.auditState").asc("unioncode");
sql.setCondition(cnd);
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
List<Record> list = pagination.getList();
list.forEach(map->{
List<Record> fjList = baseService.dao().query("sys_file", Cnd.where("reid", "=", map.getString("id")));
map.set("files", fjList);
});
pagination.setList(list);
return pagination;
}
@At
@ViReturn
public Object doDz(String id, String hdid) {
Hd_wm_dz_xx xx = new Hd_wm_dz_xx();
xx.setZpid(id);
xx.setHdid(hdid);
xx.setApplyDate(DateUtil.today());
xx.setUserid(ShiroUtil.getUserId());
return baseService.insert(xx);
}
@At
@ViReturn
public Object findDzNum(String hdid) {
Cnd cnd = Cnd.NEW();
cnd.and("hdid", "=", hdid);
cnd.and("userid", "=", ShiroUtil.getUserId());
cnd.and("applyDate", "=", DateUtil.today());
return baseService.dao().count(Hd_wm_dz_xx.class, cnd);
}
@At
@ViReturn
public Object findDzByZpId(String id) {
Cnd cnd = Cnd.NEW();
cnd.and("zpid", "=", id);
cnd.and("userid", "=", ShiroUtil.getUserId());
cnd.and("applyDate", "=", DateUtil.today());
return baseService.dao().count(Hd_wm_dz_xx.class, cnd);
}
@At
@ViReturn
public Object initHdxxlist() {
String isSysadmin = " and hdcjr is not null";
Sql sql = Sqls.create("select *,year(hdcjsj) year from hd_wm_xx where hdtype=1 and hdflag = true %s order by hdcjsj desc".formatted(isSysadmin));
List<Record> list = baseService.list(sql);
List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
Map<Integer, List<Record>> listMap = list.stream().collect(Collectors.groupingBy(v -> v.getInt("year")));
listMap.forEach((k, v) -> {
List<Map<String, Object>> children = new ArrayList<>();
v.forEach(x -> {
children.add(Map.of("value", x.getString("hdid"),
"label", x.getString("hdname"),
"dzkssj", x.getString("dzkssj"),
"dzjssj", x.getString("dzjssj"),
"dzNum", x.getInt("dzNum")
));
});
Map<String, Object> parent = Map.of("value", k, "label", k, "children", children);
result.add(parent);
});
return result;
}
}
@@ -48,5 +48,7 @@ public class SysEntranceModule extends BaseModel {
@Comment("排序编号")
@ColDefine(type = ColType.INT)
private int sortNum;
private List<Sys_menu> menus;
}
@@ -3,12 +3,15 @@ package io.v.nutz.sys.models;
import io.v.nutz.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang.StringUtils;
import org.nutz.dao.DB;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by wizzer on 2016/6/21.
@@ -86,6 +89,12 @@ public class Sys_menu extends BaseModel implements Serializable {
@ColDefine(type = ColType.VARCHAR, width = 255)
private String note;
@Column
@Comment("操作指南")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> description;
@Column
@Comment("排序字段")
@Prev({
@@ -100,4 +109,27 @@ public class Sys_menu extends BaseModel implements Serializable {
private List<Sys_menu> buttons;
private List<Sys_menu> children = new ArrayList<Sys_menu>();
private String parentName;
/**
* 前端菜单数据
*
* @param menus
* @param parentId
* @return
*/
public static List<Sys_menu> createTreeMenus(List<Sys_menu> menus, String parentId) {
List<Sys_menu> filterMenus = menus.stream().filter(v -> StringUtils.defaultString(v.getParentId(), "").equals(StringUtils.defaultString(parentId, ""))).collect(Collectors.toList());
for (Sys_menu menu : filterMenus) {
// if (menu.isHasChildren()) {
List<Sys_menu> childMenus = createTreeMenus(menus, menu.getId());
menu.setChildren(childMenus);
// }
}
return new ArrayList<>(filterMenus);
}
}
@@ -603,4 +603,13 @@ public class Sys_user extends BaseModel implements Serializable {
/**
* 2021-05-18 end
*/
/**
* 前端菜单
*/
private List<Sys_menu> treeMenus;
private List<SysEntranceModule> moduleMenus;
}
@@ -42,6 +42,22 @@ public interface SysUserService extends BaseService<Sys_user> {
*/
Sys_user fillMenu(Sys_user user);
/**
* 绑定模块及模块下的菜单到用户
*
* @param user
* @return
*/
Sys_user fillModuleMenus(Sys_user user);
/**
* 绑定用户单位 分工会信息
*
* @param user
* @return
*/
Sys_user fillUnitUnion(Sys_user user);
/**
* 通过用户ID删除用户
*
@@ -79,6 +95,15 @@ public interface SysUserService extends BaseService<Sys_user> {
* @param userId
*/
void deleteCache(String userId);
/**
* 清除一个用户的缓存并更新主体信息
* 清除当前用户缓存
*
* @param userId
*/
void deleteCacheAndUpdate(String userId);
/**
* 清空缓存
*/
@@ -1,20 +1,26 @@
package io.v.nutz.sys.services.impl;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.base.constant.RedisConstant;
import io.v.nutz.base.service.impl.BaseServiceImpl;
import io.v.nutz.sys.models.Sys_menu;
import io.v.nutz.sys.models.Sys_role;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.*;
import io.v.nutz.sys.services.SysMenuService;
import io.v.nutz.sys.services.SysRoleService;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.web.commons.utils.ShiroUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.SimplePrincipalCollection;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.plugins.wkcache.annotation.CacheDefaults;
import org.nutz.plugins.wkcache.annotation.CacheRemove;
@@ -25,6 +31,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created by wizzer on 2016/12/22.
@@ -39,6 +46,12 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
@Inject
private SysMenuService sysMenuService;
@Inject
private SysRoleService sysRoleService;
@Inject
private RedisService redisService;
/**
* 查询用户角色code列表
*
@@ -86,6 +99,54 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
return user;
}
@CacheResult(cacheKey = "${args[0].id}_fillModuleMenus")
public Sys_user fillModuleMenus(Sys_user user) {
//获取用户所有的菜单
List<Sys_menu> menus = getMenus(user.getId());
user.setMenus(menus);
//一级菜单
List<Sys_menu> firstMenus = menus.stream().filter(v -> StrUtil.isBlank(v.getParentId()) && v.getPath().length() == 4).collect(Collectors.toList());
List<String> firstMenuIds = firstMenus.stream().map(v -> v.getId()).collect(Collectors.toList());
//设置菜单tree结构
List<Sys_menu> treeMenus = Sys_menu.createTreeMenus(menus, null);
user.setTreeMenus(treeMenus);
//获取所有的模块
List<SysEntranceModule> modules = dao().query(SysEntranceModule.class, Cnd.NEW().asc("sortNum"));
modules.forEach(v -> {
List<String> containsMenus = v.getContainsMenu();
for (String containsMenu : containsMenus) {
if (firstMenuIds.contains(containsMenu)) {
List<Sys_menu> collect = treeMenus.stream().filter(x -> x.getId().equals(containsMenu)).collect(Collectors.toList());
if (Lang.isEmpty(v.getMenus())) {
v.setMenus(collect);
} else {
v.getMenus().addAll(collect);
}
}
}
});
List<SysEntranceModule> filterModules = modules.stream().filter(v -> Lang.isNotEmpty(v.getMenus())).collect(Collectors.toList());
user.setModuleMenus(filterModules);
return user;
}
@Override
public Sys_user fillUnitUnion(Sys_user user) {
if (user.getUnit() != null) {
if (Strings.isNotBlank(user.getUnit().getUnionid())) {
Sys_union union = dao().fetch(Sys_union.class, user.getUnit().getUnionid());
user.setUnion(union);
}
}
return user;
}
/**
* 查询用户菜单权限
*
@@ -198,7 +259,27 @@ public class SysUserServiceImpl extends BaseServiceImpl<Sys_user> implements Sys
@CacheRemove(cacheKey = "${args[0]}_*")
//可以通过el表达式加 * 通配符来批量删除一批缓存
public void deleteCache(String userId) {
//查询用户最新的菜单、角色信息
sysRoleService.clearCache();
}
@Override
public void deleteCacheAndUpdate(String userId) {
//删除sys_user_*,sys_role_*所有缓存
this.deleteCache(userId);
sysRoleService.clearCache();
//查询用户最新的菜单、角色信息
Sys_user user = fetch(Cnd.where("id", "=", ShiroUtil.getUserId()));
fetchLinks(user, null);
user = fillModuleMenus(user);
user = fillUnitUnion(user);
//更新principal信息
PrincipalCollection principals = SecurityUtils.getSubject().getPrincipals();
String realm = principals.getRealmNames().iterator().next();
SimplePrincipalCollection simplePrincipalCollection = new SimplePrincipalCollection(user, realm);
SecurityUtils.getSubject().runAs(simplePrincipalCollection);
}
@CacheRemoveAll
@@ -1,8 +1,17 @@
package io.v.nutz.web.commons.utils;
import io.v.nutz.base.utils.Roles;
import io.v.nutz.sys.models.Sys_menu;
import io.v.nutz.sys.models.Sys_user;
import io.v.nutz.sys.models.Sys_user_role;
import io.v.nutz.sys.services.SysUserService;
import io.v.nutz.sys.services.impl.SysUserServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.mvc.Mvcs;
import org.slf4j.Logger;
@@ -13,11 +22,13 @@ import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by wizzer on 2017/1/16.
*/
public class ShiroUtil {
public class ShiroUtil extends io.v.nutz.util.ShiroUtil {
private static final String ROLE_NAMES_DELIMETER = ",";
private static final String PERMISSION_NAMES_DELIMETER = ",";
@@ -378,4 +389,31 @@ public class ShiroUtil {
Subject subject = SecurityUtils.getSubject();
return (String) subject.getSession().getId();
}
}
/**
* 获取当前用户信息 json
*
* @return
*/
public static String getUser() {
Sys_user user = (Sys_user) getPrincipal();
return Json.toJson(user);
}
/**
* 用户模块菜单
*
* @return {@link String}
*/
public static String userModuleMenus() {
List<Sys_menu> menus = (List<Sys_menu>) getPrincipalProperty("moduleMenus");
if (Lang.isEmpty(menus)) {
SysUserService sysUserService = Mvcs.getIoc().get(SysUserServiceImpl.class);
sysUserService.deleteCacheAndUpdate(getUserId());
menus = (List<Sys_menu>) getPrincipalProperty("moduleMenus");
}
return Json.toJson(menus);
}
}
@@ -1,5 +1,7 @@
package io.v.nutz.web.controllers.platform.sys;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.result.Result;
import io.v.nutz.sys.models.Sys_menu;
import io.v.nutz.sys.services.SysMenuService;
@@ -12,6 +14,7 @@ import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
@@ -53,7 +56,7 @@ public class SysMenuController {
@At("/child")
@Ok("json")
@RequiresAuthentication
public Object child(@Param("pid") String pid, HttpServletRequest req) {
public Object child(@Param("pid") String pid, @Param(value = "menuName", required = false) String menuName, HttpServletRequest req) {
List<Sys_menu> list = new ArrayList<>();
List<NutMap> treeList = new ArrayList<>();
Cnd cnd = Cnd.NEW();
@@ -62,6 +65,9 @@ public class SysMenuController {
} else {
cnd.and("parentId", "=", pid);
}
if (StrUtil.isNotBlank(menuName)) {
cnd.where().andLike("name", menuName);
}
cnd.asc("location").asc("path");
list = sysMenuService.query(cnd);
for (Sys_menu menu : list) {
@@ -69,8 +75,8 @@ public class SysMenuController {
menu.setHasChildren(true);
}
NutMap map = Lang.obj2nutmap(menu);
map.addv("expanded", false);
map.addv("children", new ArrayList<>());
map.setv("expanded", false);
map.setv("children", new ArrayList<>());
treeList.add(map);
}
return Result.success().addData(treeList);
@@ -306,6 +312,10 @@ public class SysMenuController {
if (list1 == null) {
list1 = new ArrayList<>();
}
if (StrUtil.isNotBlank(unit.getParentId())) {
Sys_menu parentMenu = list.stream().filter(o -> o.getId().equals(unit.getParentId())).findFirst().orElse(null);
unit.setParentName(parentMenu.getName());
}
list1.add(unit);
menuMap.put(unit.getParentId(), list1);
}
@@ -351,4 +361,46 @@ public class SysMenuController {
return Result.error();
}
}
@At
@ViReturn
@Ok("json")
public Object getDescription(String url) {
if (StrUtil.isBlank(url)) {
return null;
}
Sys_menu sysMenu = sysMenuService.fetch(Cnd.where("href", "=", url));
return Lang.isEmpty(sysMenu) ? null : sysMenu.getDescription();
}
/**
* 模糊查询菜单选项
*
* @param keyword 关键字
* @return {@link Object}
*/
@At
@ViReturn
@Ok("json")
@RequiresAuthentication
public Object menuOption(String keyword) {
Sql menuSql = Sqls.create("""
select menuId from sys_role_menu where roleId in (
select roleId from sys_user_role where userId = @userId
)
""").setParam("userId", ShiroUtil.getPrincipalProperty("id"));
Cnd cnd = Cnd.NEW();
cnd.andEX("name", "like", "%" + keyword + "%");
cnd.andEX("hasChildren", "=", 0);
cnd.and("showit", "=", 1);
cnd.and("disabled", "=", 0);
cnd.and("type", "=", "menu");
cnd.and("id", "in", menuSql);
cnd.asc("location");
List<Sys_menu> list = sysMenuService.query(cnd);
return list;
}
}
@@ -0,0 +1,481 @@
<template>
<div>
<el-tabs tab-position="top" v-model="activeName" v-loading="loading">
<el-tab-pane label="申请信息" name="1">
<table style="width: 100%">
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">姓名</td>
<td class="tpb">{{ viewData.username }}</td>
<td class="tpa">工号</td>
<td class="tpb">{{ viewData.loginname }}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">单位</td>
<td class="tpb">{{ viewData.dwname }}</td>
<td class="tpa">工会</td>
<td class="tpb">{{ viewData.ghname }}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">活动类别</td>
<td class="tpb">
<span>{{ viewData.hdlbname }}</span>
</td>
<template v-if="viewData.zplbname">
<td class="tpa">类别</td>
<td class="tpb">
<span>{{ viewData.zplbname }}</span>
</td>
</template>
<template v-else>
<td class="tpa">健步走步数</td>
<td class="tpb">
<span>{{ viewData.step_count }}</span>
</td>
</template>
</tr>
<!-- <tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品主题</td>
<td class="tpb" colspan="3">{{viewData.hdsbzpzt}}</td>
</tr>-->
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">标题</td>
<td class="tpb" colspan="3">{{ viewData.zpmc }}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">创作说明</td>
<td class="tpb" colspan="3">{{ viewData.hdsbzpms }}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);" v-if="viewData.isUploadPhoto||viewData.isUploadOther">
<td class="tpa">作品信息</td>
<td class="tpb" colspan="3">
<el-row v-if="viewData.isUploadPhoto">
<el-divider>照片&emsp;<i class="el-icon-picture-outline"></i></el-divider>
<file-upload view :files="img2List"></file-upload>
</el-row>
<!-- <div v-if="viewData.isUploadOther">
<el-row>
<el-divider>视频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="videoList.length>0">
<div v-for="item in videoList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{ item.fjname }}</div>
<div class="view-myvideo-tab">
<div class="video-toggle-i"
@click="playVideo1(APP_DOMAIN + '/file_server/fileStreamPreview?id=' + item.id)">
<i class="el-icon-video-camera-solid"></i>
<i class="el-icon-video-play"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="APP_DOMAIN+'/file_server/download?filepath=' + item.filepath + '&filename=' + item.filename">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有视频。
</div>
</el-row>
<el-row>
<el-divider>音频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="audioList.length>0">
<div v-for="item in audioList">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
&lt;!&ndash; <source :src="'${AppFileDomain!}'+item.filepath"/>&ndash;&gt;
<source :src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + item.id"/>
</audio>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div>
</el-row>
<el-row>
<el-divider>文档&emsp;<i class="el-icon-document-copy"></i></el-divider>
<div style="text-align: left;" v-if="docList.length>0">
&lt;!&ndash; <div v-for="item in docList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{ item.fjname }}</div>
<div class="view-myvideo-tab" style="background-color: #f6f6f6">
<div class="video-toggle-i" @click="dd3s.preview(item.filepath,item.id)">
<i class="el-icon-document"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="APP_DOMAIN+'/file_server/download?filepath=' + item.filepath + '&filename=' + item.filename">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>&ndash;&gt;
<file-upload v-if="docList&&docList.length"
:files="docList"
:view="true"></file-upload>
<span v-else>暂无</span>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档。
</div>
</el-row>
</div>-->
</td>
</tr>
</table>
</el-tab-pane>
<el-tab-pane label="分工会审核信息" name="2" v-if="viewData.union">
<el-form label-width="130px" label-suffix=":" style="padding: 20px 0">
<vi-title title="审核信息"></vi-title>
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人员">
{{ viewData.union.username }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
{{ viewData.union.auditTime }}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审核意见">
<div class="textarea-div">{{ viewData.union.auditOpinion ? viewData.union.auditOpinion : '暂无' }}</div>
</el-form-item>
<el-form-item label="签&emsp;&emsp;字">
<el-image v-if="viewData.union.auditSign"
style="width: 300px; height: 100px"
:src="viewData.union.auditSign"
fit="contain"></el-image>
<span v-else>暂无</span>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="校工会审核信息" name="3" v-if="viewData.school">
<el-form label-width="130px" label-suffix=":" style="padding: 20px 0">
<vi-title title="审核信息"></vi-title>
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人员">
{{ viewData.school.username }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
{{ viewData.school.auditTime }}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="审核意见">
<div class="textarea-div">{{ viewData.school.auditOpinion ? viewData.school.auditOpinion : '暂无' }}</div>
</el-form-item>
<el-form-item label="签&emsp;&emsp;字">
<el-image v-if="viewData.school.auditSign"
style="width: 300px; height: 100px"
:src="viewData.school.auditSign"
fit="contain"></el-image>
<span v-else>暂无</span>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane v-if="handle" :label="label" name="999">
<slot name="handle"></slot>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
module.exports = {
props: {
handle: {
type: Boolean,
default: false,
},
label: {
type: String,
default: '审核'
},
panes: {
type: Array,
default: []
},
},
data() {
return {
activeName: "1",
viewData: {},
loading: true,
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
doctype: ['doc', 'docx', 'xlsx', 'xls', 'txt'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
prevImgList: [],
img2List: [],
videoList: [],
docList: [],
audioList: [],
imgShow: false,
fileDialogVisible: false
}
},
components: {
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
},
methods: {
hasPane(name) {
if (!this.handle) {
return true
}
return this.panes.includes(name)
},
async getInfo(id) {
this.img2List = [];
this.prevImgList = [];
this.videoList = [];
this.audioList = [];
this.docList = [];
$.post(base + '/platform/hd/wmhd/findOneById', {id: id}).then(data => {
if (data.code == 0) {
data.data.forEach(val => {
val.fjname = val.filename
val.fjurl = val.filepath
val.url = '${AppFileDomain!}' + val.filepath
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val);
} else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push('${AppFileDomain!}' + val.filepath)
this.img2List.push(val);
} else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val);
} else if (this.audiotype.indexOf(filetype) > -1) {
this.audioList.push(val);
}
});
}
});
const {data} = await $.post("/platform/hd/wmhd/findxxById", {id: id})
this.viewData = data
this.activeName = this.handle ? "999" : "1"
this.loading = false
},
playVideo1(fjurl) {
this.$emit("playvideo", fjurl)
},
filedialogClose() {
//关闭的时候需要销毁video 但是随之dom元素也会被删除!!!!
this.imgShow = false;
this.videoShow = false;
videojs('my-video').dispose();
},
},
async created() {
}
}
</script>
<style>
.tpa {
padding: 10px;
text-align: center;
width: 12%;
color: #a0a9b4;
background-color: rgb(250, 250, 250);
border: 1px solid rgb(220, 220, 220);
}
.tpb {
padding: 10px;
text-align: center;
color: #4f576b;
width: 15%;
border: 1px solid rgb(220, 220, 220);
}
input[type=file] {
display: none;
}
.filedialog .el-dialog__header i {
font-size: 30px;
}
.filedialog .el-dialog__body {
padding: 20px 0 0 0;
}
/*video{
width: 100%!important;
height: 500px!important;
outline:none;
}*/
.video-js {
width: 100%;
height: 450px;
outline: none;
}
.vjs-tech, .video-js button {
outline: none;
}
#app .el-table th.gutter {
display: table-cell !important
}
.filedialog .el-dialog {
min-height: 500px;
}
.video-js .vjs-big-play-button { /* 中间大的播放按钮 */
font-size: 2.5em;
line-height: 2.3em;
height: 2.5em;
width: 2.5em;
-webkit-border-radius: 2.5em;
-moz-border-radius: 2.5em;
border-radius: 2.5em;
background-color: rgba(115, 133, 159, .5);
border-width: 0.12em;
margin-top: -1.25em;
margin-left: -1.75em;
}
.video-js.vjs-paused .vjs-big-play-button { /* 视频暂停时显示播放按钮 */
display: block;
}
.video-js.vjs-error .vjs-big-play-button { /* 视频加载出错时隐藏播放按钮 */
display: none;
}
.vjs-loading-spinner { /* 加载圆圈 */
font-size: 2.5em;
width: 2em;
height: 2em;
border-radius: 1em;
margin-top: -1em;
margin-left: -1.5em;
}
.el-image {
margin-right: 10px;
}
.el-divider__text {
color: #abc5df;
}
.el-divider {
background-color: #e5edf6;
}
.view-myvideo-tab {
width: 100px;
height: 100px;
background-color: #C0C4CC;
text-align: center;
cursor: pointer;
}
.video-toggle-i:hover .el-icon-video-camera-solid {
display: none;
}
.video-toggle-i:hover .el-icon-video-play {
display: inline-block;
}
.view-myvideo-tab .el-icon-video-camera-solid, .view-myvideo-tab .el-icon-video-play, .view-myvideo-tab .el-icon-document {
color: #000000;
line-height: 80px;
font-size: 40px;
}
.view-myvideo-tab .el-icon-download {
width: 100px;
}
.el-icon-video-play {
display: none;
}
.ckdialogclass .el-dialog__body {
padding-top: 10px;
}
.el-icon-download {
color: white;
}
.file-down-span {
background: black;
opacity: 0.5;
z-index: 1000;
width: 100px;
text-align: center;
/*position: absolute;*/
position: relative;
bottom: -100px;
cursor: pointer;
}
.file-down-span:hover {
opacity: 0.9;
}
.ckdialogclass .el-icon-circle-close {
color: white;
}
.form-item-container {
display: flex;
}
.form-item-container .el-form-item {
width: 50%;
}
.el-upload--picture-card {
width: 100px;
height: 100px;
line-height: 98px;
}
.el-upload-list--picture-card .el-upload-list__item {
width: 100px;
height: 100px;
}
.el-loading-mask.is-fullscreen .el-loading-spinner {
font-size: 40px;
}
</style>
@@ -0,0 +1,229 @@
/**
*Desc:
*Create by: jug
*Create time:2024/1/24/16:40
*/
<template>
<div>
<div ref="editorDom"></div>
<input type="file" style="display: none;">
</div>
</template>
<script src="/assets/platform/plugins/jquery/jquery-1.11.1.min.js"></script>
<script>
const {$, BtnMenu, DropListMenu, PanelMenu, DropList, Panel, Tooltip} = wangEditor
class AlertMenu extends BtnMenu {
constructor(editor) {
const $elem = wangEditor.$(
`<div class="w-e-menu" data-title="上传word">
word
</div>`
)
super($elem, editor)
}
clickHandler() {
const _this = this
const inputFileElement = document.querySelector('#' + this.editor.textElemId).parentElement.parentElement.nextElementSibling
inputFileElement.click()
inputFileElement.addEventListener('change', function () {
const file = this.files[0];
const fileName = file.name
if (!fileName.toLowerCase().endsWith('.doc') && !fileName.toLowerCase().endsWith('.docx')) {
alert('请上传doc或者docx的文件')
_this.clearInputFile()
return
}
const formData = new FormData()
formData.append('file', file, file.name)
axios.post('/file_server/word2Html', formData, {}).then(response => {
console.log(response.data)
if (response.data.code === 0) {
_this.editor.txt.html(response.data.data)
} else {
alert(response.data.msg + ',上传word失败,请联系管理员!')
_this.clearInputFile()
}
}).catch(error => {
console.log(error)
_this.clearInputFile()
alert('上传word失败,请联系管理员!')
});
});
}
clearInputFile() {
const obj = document.getElementById('fileInput');
obj.outerHTML = obj.outerHTML
}
tryChangeActive() {
this.active()
}
}
wangEditor.registerMenu('alertMenuKey', AlertMenu)
module.exports = {
name: "textEditor",
props: {
// 定义值属性,用于接收父组件传递的值
value: {
type: String,
default: ''
},
height: {
type: Number,
default: 300
},
menus: {
type: Array,
default: () => {
return [
'head',//标题
'bold',//加粗
'fontSize',//字号
'fontName',//字体
'italic',//斜体
'underline',//下划线
'strikeThrough',//删除线
'indent',//缩进
'lineHeight',//行高
'foreColor',//文字颜色
'backColor',//背景颜色
//'link',//链接
'list',//序列
'todo',//待办
'justify',//对齐
'quote',//引用
// 'emoticon',//表情
'image',
//'video',
'table',
//'code',
'splitLine',//分割线
'undo',
'redo',
]
}
}
},
data() {
return {
editor: null
}
},
mounted() {
this.initEditor()
},
watch: {
value: {
handler: function (newValue) {
this.$nextTick(() => {
this.editor.txt.html(newValue);
// this.editor.config.focus = true
})
// const _this = this
// const waitUntilEditorNotNull = () => {
// if (_this.editor != null) {
// _this.editor.txt.html(newValue);
// } else {
// setTimeout(waitUntilEditorNotNull, 100); // 每隔100毫秒检查一次
// }
// }
// waitUntilEditorNotNull();
},
immediate: true
}
},
methods: {
initEditor() {
let _this = this
this.editor = new wangEditor(this.$refs.editorDom)
// this.editor.config.focus = false // 取消光标自动定位
//内容change回调
this.editor.config.onchange = function (newHtml) {
let content = _this.editor.txt.html()
let text = _this.editor.txt.text()
// 对于一键格式化后的内容,空内容可能会出现<p></br></p>标签,此处进行判断
// if (_this.isEmptyEditor()) {
// content = ''
// }
_this.$emit('input', content)
_this.$emit('catchData', content, text)
}
//配置图片上传
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
Promise.all(_this.uploadFiles(resultFiles)).then(res => {
res.forEach(v => {
if (v.code === 0) {
insertImgFn(CREATE_PREVIEW_URL(v.data.filepath))
} else {
ELEMENT.message.warning('图片上传失败')
}
})
})
}
//粘贴过滤
this.editor.config.pasteFilterStyle = false
//高度
this.editor.config.height = this.height
//菜单
this.editor.config.menus = this.menus
this.editor.create()
},
isEmptyEditor() {
const children = this.editor.$textElem.children()
for (let i = 0; i < children.elems.length; i++) {
const node = children.elems[i]
if (node && node.nodeType === Node.TEXT_NODE && node.textContent.trim().length !== '') {
return false
}
if (node && node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'p' && node.innerText.trim() !== '') {
return false
}
}
return true
},
uploadFiles(resultFiles) {
return resultFiles.map(async file => {
const formData = new FormData()
formData.append('file', file, file.name)
formData.append("folderPath", "/wangEditorImg/")
return jQuery.ajax({
url: '/file_server/uploadFile',
type: 'post',
data: formData,
processData: false,
contentType: false
})
})
}
},
created() {
}
}
</script>
<style scoped>
</style>
@@ -130,6 +130,8 @@
Vue.component('guava', httpVueLoader('/components/plugins/Guava.vue'))
Vue.component('sign', httpVueLoader('/components/sign/sign.vue?v=2.0.0'))
Vue.component('file-upload', httpVueLoader('/components/plugins/FileUpload.vue'))
Vue.component('text-editor', httpVueLoader('/components/plugins/textEditor.vue'))
</script>
<script>
@@ -232,6 +232,10 @@ layout("/mobile/platform.html"){
<image src="/assets/mobile/icon/activity/bm.png"></image>
<span class="icon_text">校活动报名</span>
</van-grid-item>
<van-grid-item url="/mobile/wmhd/apply">
<image src="/assets/mobile/svg/wmhd/apply.svg"></image>
<span class="icon_text">教工作品征集</span>
</van-grid-item>
<!--<van-grid-item @click="toWxJsz">
<image src="/assets/mobile/svg/activity/jsz.svg"></image>
<span class="icon_text">健身走</span>
@@ -247,6 +251,8 @@ layout("/mobile/platform.html"){
<image src="/assets/mobile/icon/question/dati.png"></image>
<span class="icon_text">在线调查</span>
</van-grid-item>
<van-grid-item url="/mobile/question/h5/list?type=2">
<image src="/assets/mobile/icon/question/zxdc.png"></image>
<span class="icon_text">知识竞答</span>
@@ -10,16 +10,17 @@ layout("/mobile/platform.html"){
left-arrow
placeholder
fixed
@click-left="history.back()"
@click-left="history.go(-1)"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearOption" @change="yearChange"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.year" :options="yearOption"
@change="yearChange"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<div style="margin: 60px auto">
<van-list
v-model="mLoading"
:finished="finished"
@@ -28,7 +29,8 @@ layout("/mobile/platform.html"){
<div v-for="o in tableData" class="list-card" @click="openView(o)">
<van-cell-group inset>
<van-cell title="主题" :border="false">{{o.hdname}}</van-cell>
<van-cell :border="false" title="创建人">{{o.cjr}}</van-cell>
<van-cell :border="false" title="创建人">{{o.username}}</van-cell>
<van-cell :border="false" title="开启状态">{{o.hdflag?'已开启':'未开启'}}</van-cell>
<van-cell :border="false" title="创建时间">{{o.hdcjsj}}</van-cell>
<van-cell :border="false" title="开始时间">{{o.hdkssj}}</van-cell>
<van-cell :border="false" title="结束时间">{{o.hdjssj}}</van-cell>
@@ -43,6 +45,14 @@ layout("/mobile/platform.html"){
></van-empty>
</div>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/mobile/wmhd/apply">教工作品征集</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/list">我的教工作品</van-tabbar-item>
<!-- <van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/statistics">点赞教工作品</van-tabbar-item>-->
</van-tabbar>
</div>
</div>
<script>
@@ -51,6 +61,7 @@ layout("/mobile/platform.html"){
mixins: [mobileMixins],
data() {
return {
tarBarActive: 0,
yearOption: [],
pageForm: {
year: '',
@@ -67,7 +78,7 @@ layout("/mobile/platform.html"){
},
async onLoad() {
this.mLoading = true
$.post('/platform/hd/wmhdMange/data', this.pageForm).then(res => {
$.post('/mobile/wmhd/apply/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
@@ -80,11 +91,15 @@ layout("/mobile/platform.html"){
})
},
openView(o) {
const {hdid, hdjssj, hdkssj} = o
if (moment().format("YYYY-MM-DD HH:mm:ss") <= hdkssj) {
const {hdid, hdjssj, hdkssj, hdflag} = o
if (!hdflag) {
vant.Toast('活动暂未开启!')
return;
}
if (moment().format("YYYY-MM-DD HH:mm:ss") < hdkssj) {
vant.Toast('报名暂未开始!')
return
} else if (moment().format("YYYY-MM-DD HH:mm:ss") >= hdjssj) {
} else if (moment().format("YYYY-MM-DD HH:mm:ss") > hdjssj) {
vant.Toast('报名已结束!')
return
}
@@ -103,4 +118,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->
@@ -0,0 +1,165 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar
title="我的审核"
left-arrow
placeholder
fixed
@click-left="history.go(-1)"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="RGB(8,23,118)">
<van-dropdown-item v-model="pageForm.year" @change="yearChange"
:options="yearList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.isAudit" @change="yearChange"
:options="auditList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.unionId" @change="yearChange"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')||@shiro.hasRole('H10')}"
:options="mCommon.unionList"></van-dropdown-item>
<van-dropdown-item v-model="pageForm.unitId" @change="yearChange"
:options="mCommon.unitList"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 70px auto 0">
<van-list
v-model="mLoading"
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
<div v-for="o in tableData" class="list-card" @click="openView(o)">
<van-cell-group inset>
<van-cell :border="false" title="姓名">{{o.username}}</van-cell>
<van-cell :border="false" title="工号">{{o.loginname}}</van-cell>
<van-cell :border="false" title="单位">{{o.dwname}}</van-cell>
<van-cell :border="false" title="工会">{{o.ghname}}</van-cell>
<van-cell :border="false" title="活动类别">{{o.hdlbname}}</van-cell>
<van-cell :border="false" title="作品类别" v-if="o.zplbname">{{o.zplbname}}
</van-cell>
<van-cell :border="false" title="上传时间">{{o.hdsbsj}}</van-cell>
<van-cell :border="false" title="审核状态">
<span :style="'color:'+o.stateColor">{{o.stateName}}</span>
</van-cell>
</van-cell-group>
</div>
</van-list>
<van-empty
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
></van-empty>
</div>
<van-popup v-model="viewShow" position="right"
:style="{ height: '100%',width:'100%' }">
<van-nav-bar title="详细信息" left-arrow placeholder fixed
@click-left="viewShow=false"></van-nav-bar>
<mobile-wmhd-info ref="minfo"></mobile-wmhd-info>
</van-popup>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
viewShow: false,
pageForm: {
year: new Date().getFullYear(),
isAudit: false,
},
unitList: [],
unionList: [],
yearList: [],
auditList: [
{text: '未审核', value: false},
{text: '已审核', value: true},
],
}
},
components: {
'mobile-wmhd-info': httpVueLoader('/components/mobile/wmhd/info.vue?v=' + new Date().getTime()),
},
methods: {
yearChange() {
this.pageForm.pageNumber = 1
this.tableData = []
this.finished = false
this.flushUnits()
this.onLoad()
},
async onLoad() {
this.mLoading = true
$.post('/mobile/wmhd/audit/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.mLoading = false
})
},
openView(o) {
if (o.auditState === '4000' || o.auditState === '4200') {
window.location.href = "/mobile/wmhd/audit/auditHtml?id=" + o.id + "&auditState=" + o.auditState
} else {
this.viewShow = true
setTimeout(() => {
this.$refs.minfo.getInfo(o.id)
}, 100)
}
},
async flushUnits() {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('wyh03')||@shiro.hasRole('wyh02')||@shiro.hasRole('H03')}" === 'true') {
await mCommon.getUnitList(this.pageForm.unionId)
} else {
await mCommon.getUnitList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
}, async init() {
let nowYear = new Date().getFullYear()
for (let i = nowYear; i >= nowYear - 9; i--) {
this.yearList.push({text: i, value: i})
}
await mCommon.getUnionList()
if (mCommon.unionList && mCommon.unionList.length > 0) {
this.$set(this.pageForm, "unionId", mCommon.unionList[0].value)
}
if (mCommon.unitList && mCommon.unitList.length > 0) {
this.$set(this.pageForm, "unitId", mCommon.unitList[0].value)
}
}
},
async created() {
this.flushUnits()
this.init()
}
})
window.addEventListener('pageshow', e => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.flushUnits()
vue.init()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,124 @@
<!--#
layout("/mobile/platform.html"){
#-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/video/css/video-js.min.css">
<script src="${base!}/assets/platform/plugins/video/js/video.min.js"></script>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="校工会审核" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<mobile-wmhd-info ref="minfo" :id.sync="id" title="校工会审核" :handle="handle">
<template #handle>
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">校工会审核
</div>
</div>
<van-form>
<van-field
readonly
value="${@shiro.getPrincipalProperty('username')}"
name="username"
label="审核人员"
></van-field>
<van-field v-model="formData.auditTime" label="审核时间" readonly></van-field>
<van-field v-model="formData.auditOpinion"
required
rows="1"
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<van-field label="签字" required style="flex-flow: column">
<template #label>
<div class="mb10">签&emsp;&emsp;字</div>
</template>
<template #input>
<mobile-sign ref="signature"
:my_sign.sync="formData.auditSign"></mobile-sign>
</template>
</van-field>
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="8">
<van-button block @click="doAudit(1)">拒 绝
</van-button>
</van-col>
<van-col span="8">
<van-button block @click="doAudit(2)" type="warning">返回修改
</van-button>
</van-col>
<van-col span="8">
<van-button block @click="doAudit(3)" type="info">通 过
</van-button>
</van-col>
</van-row>
</van-form>
</template>
</mobile-wmhd-info>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
formData: {},
id: GetQueryString('id'),
handle: true,
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
'mobile-wmhd-info': httpVueLoader('/components/mobile/wmhd/info.vue?v=' + new Date().getTime()),
},
methods: {
async doAudit(pass) {
if (!this.formData.auditOpinion) {
this.$toast.fail('请填写审核意见');
return
}
this.$refs.signature.submitSign()
await this.$refs.signature.updateSign()
this.formData.pass = pass
const resp = await $.post("/platform/hd/wmhd/school/audit/doReview", this.formData)
if (resp.code === 0) {
this.$toast.success('审核成功');
setTimeout(() => {
window.history.go(-1)
}, 1000)
} else {
this.$toast.fail('审核失败');
}
},
},
async created() {
this.mLoading = true
const id = GetQueryString("id")
setTimeout(() => {
this.$refs.minfo.getInfo(id)
}, 500)
this.formData = {
id: id,
username: "${@shiro.getPrincipalProperty('username')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: "通过",
auditSign: ""
}
this.mLoading = false
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,321 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
.register-icon {
position: absolute;
bottom: 8px;
right: 16px;
z-index: 1;
}
</style>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
title="作品列表"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item :options="yearOption" @change="yearChange"
v-model="pageForm.year"></van-dropdown-item>
<van-dropdown-item :options="hdxxlist" @change="hdlbchange();"
v-model="pageForm.hdid"></van-dropdown-item>
<van-dropdown-item :options="hdlblist" @change="onRefresh()"
v-model="pageForm.hdlb"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto">
<van-list
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad"
v-model="mLoading">
<div class="list-card" v-for="o in tableData">
<van-cell-group inset>
<van-cell :border="false" title="姓名">{{o.sbrname}}</van-cell>
<van-cell :border="false" title="工号">{{o.loginname}}</van-cell>
<van-cell :border="false" title="单位">{{o.dwname}}</van-cell>
<van-cell :border="false" title="工会">{{o.ghname}}</van-cell>
<van-cell :border="false" title="活动类别">{{o.hdlbname}}</van-cell>
<van-cell :border="false" title="作品类别" v-if="o.zplbname">{{o.zplbname}}
</van-cell>
<van-cell :border="false" title="上传时间">{{o.hdsbsj}}</van-cell>
<van-cell :border="false" title="总点赞数">{{o.dz_znum}}次</van-cell>
<van-field readonly :value="o.hdsbzpms" label="创作说明"
input-align="left"
style="flex-flow: column"
rows="2" type="textarea" show-word-limit autosize></van-field>
<van-field label="作品" style="flex-flow: column" input-align="left">
<template #input>
<vant-file-upload :files.sync="o.files" view :del="false"
v-if="o.files&&o.files.length>0"></vant-file-upload>
<div v-if="o.files.length===0"
style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片。
</div>
</template>
</van-field>
<!-- <van-cell :border="false" title="审核状态">
<span :style="'color:'+o.statecolor">{{o.statename}}</span>
</van-cell>-->
<van-cell>
<div style="display: flex;justify-content: flex-end;">
<van-button :color="themeColor" round disabled
style="width: 90px;height: 30px;" v-if="o.dz_num>0">
已点赞
</van-button>
<div style="display: flex;justify-content: center;"
v-if="o.dzjssj&&moment().valueOf()>moment(o.dzkssj).valueOf()&&moment().valueOf()<moment(o.dzjssj).valueOf()">
<van-button :color="themeColor" round @click.stop="doDz(o.id)"
style="width: 90px;height: 30px;" v-if="o.dz_num<=0">
点赞
</van-button>
</div>
<van-button :color="themeColor" @click.stop="openView(o)" round
style="width: 90px;height: 30px;margin-left: 5px">
查看
</van-button>
</div>
</van-cell>
</van-cell-group>
</div>
</van-list>
<van-empty
class="custom-image"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<van-popup :style="{ height: '100%',width:'100%' }" position="right"
v-model="viewShow">
<van-nav-bar @click-left="viewShow=false" fixed left-arrow placeholder
title="详细信息"></van-nav-bar>
<mobile-wmhd-info handle ref="minfo">
<template #handle>
<div style="display: flex;justify-content: center;"
v-if="zpData.dzjssj&&moment().valueOf()>moment(zpData.dzkssj).valueOf()&&moment().valueOf()<moment(zpData.dzjssj).valueOf()">
<van-button :color="themeColor" @click.stop="doDz" round
style="width: 80%" v-if="zpData.zpDzNum<1">
点赞
</van-button>
<van-button :color="themeColor" disabled round
style="width: 80%" v-else>
已点赞
</van-button>
</div>
</template>
</mobile-wmhd-info>
</van-popup>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/mobile/wmhd/apply">教工作品征集</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/list">我的教工作品
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/statistics">点赞教工作品
</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
let vue = new Vue({
el: '#app',
mixins: [mobileMixins],
data() {
return {
viewShow: false,
tarBarActive: 2,
yearOption: [],
pageForm: {
pageNumber: 1,
pageSize: 5,
year: '',
hdtype: 1,
},
yearActivityList: [],
hdxxlist: [],
hdlblist: [],
zpData: {}
}
},
components: {
'mobile-wmhd-info': httpVueLoader('/components/mobile/wmhd/info.vue?v=' + new Date().getTime()),
},
methods: {
async doDz(id) {
const toast1 = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '加载中...',
})
if ("${@shiro.getPrincipalProperty('loginname')}" === this.zpData.loginname) {
vant.Dialog.alert({
title: '温馨提示',
message: '自己暂时不能给自己点赞哦!',
}).then(() => {
// on close
});
return
}
const hd = this.hdxxlist.find(h => h.value === this.pageForm.hdid)
const dzNum = await this.findDzNum(hd.value)
toast1.clear()
if (dzNum >= hd.dzNum) {
vant.Dialog.alert({
title: '温馨提示',
message: '您当前活动,今日点赞次数已满' + hd.dzNum + '次,请明日在进行点赞',
}).then(() => {
// on close
});
return
}
vant.Dialog.confirm({
title: '温馨提示',
message: '点赞后不能取消,您确定要给当前作品点赞吗?',
}).then(async () => {
const toast = vant.Toast.loading({
duration: 0,
forbidClick: true,
overlay: true,
message: '努力提交中',
})
const resp = await $.post('/mobile/wmhd/statistics/doDz', {
id: this.zpData.id ? this.zpData.id : id,
hdid: hd.value
})
if (resp.code === 0) {
await this.findDzByZpId(this.zpData.id)
this.tableData.map(t => {
if (t.id === (this.zpData.id ? this.zpData.id : id)) {
t.dz_num = 1
t.dz_znum = t.dz_znum + 1
}
})
setTimeout(async () => {
toast.clear()
vant.Toast.success('点赞成功');
}, 700)
} else {
vant.Toast.fail(resp.msg);
}
})
},
async findDzNum(hdid) {
const resp = await $.post('/mobile/wmhd/statistics/findDzNum', {hdid})
return resp.data
},
async findDzByZpId(id) {
const resp = await $.post('/mobile/wmhd/statistics/findDzByZpId', {id})
this.$set(this.zpData, "zpDzNum", resp.data)
},
async onRefresh() {
this.tableData = []
this.refreshing = true;
this.finished = false;
this.pageForm.pageNumber = 1
this.loading = true;
await this.onLoad();
},
async yearChange() {
const activityList = this.yearActivityList.find(y => y.value === this.pageForm.year)
if (activityList && activityList.children.length > 0) {
activityList.children.map(h => {
h.text = h.label
})
this.hdxxlist = activityList.children
this.$set(this.pageForm, "hdid", this.hdxxlist[0].value)
} else {
this.hdxxlist = []
this.$set(this.pageForm, "hdid", null)
}
await this.onRefresh()
},
async onLoad() {
this.mLoading = true
$.post('/mobile/wmhd/statistics/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
}
this.mLoading = false
})
},
async openView(o) {
this.zpData = o
await this.findDzByZpId(o.id)
this.viewShow = true
setTimeout(() => {
this.$refs.minfo.getInfo(o.id)
}, 300)
},
async initHdxxlist() {
const data = await $.post('/mobile/wmhd/statistics/initHdxxlist')
if (data.code == 0) {
this.yearActivityList = data.data
}
},
async hdlbchange() {
this.$set(this.pageForm, 'zplb', '');
const data = await $.post('/platform/hd/childhd/zpxx/gethdlblist', {id: this.pageForm.hdid})
if (data.code === 0) {
data.data.map(h => {
h.text = h.lname
h.value = h.lid
})
this.hdlblist = data.data;
}
},
},
async created() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearOption.unshift({value: i, text: i + '年'},)
}
this.$set(this.pageForm, "year", this.yearOption[0].value)
setTimeout(async () => {
await this.initHdxxlist()
this.yearChange()
this.hdlbchange()
}, 300)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,125 @@
<!--#
layout("/mobile/platform.html"){
#-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/video/css/video-js.min.css">
<script src="${base!}/assets/platform/plugins/video/js/video.min.js"></script>
<div id="app" v-cloak>
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar title="分工会审核" left-arrow placeholder fixed
@click-left="history.go(-1)"></van-nav-bar>
<mobile-wmhd-info ref="minfo" :id.sync="id" title="分工会审核" :handle="handle">
<template #handle>
<div class="van-cell-group__title">
<div class="van-sidebar-item van-sidebar-item--select">
分工会审核
</div>
</div>
<van-form>
<van-field
readonly
value="${@shiro.getPrincipalProperty('username')}"
name="username"
label="审核人员"
></van-field>
<van-field v-model="formData.auditTime" label="审核时间" readonly></van-field>
<van-field v-model="formData.auditOpinion"
required
rows="1"
autosize
label="审核意见"
type="textarea"
placeholder="请输入审核意见"
></van-field>
<van-field label="签字" required style="flex-flow: column">
<template #label>
<div class="mb10">签&emsp;&emsp;字</div>
</template>
<template #input>
<mobile-sign ref="signature"
:my_sign.sync="formData.auditSign"></mobile-sign>
</template>
</van-field>
<van-row gutter="20" style="margin-top: 30px;padding: 0 25px">
<van-col span="8">
<van-button block @click="doAudit(1)">拒 绝
</van-button>
</van-col>
<van-col span="8">
<van-button block @click="doAudit(2)" type="warning">返回修改
</van-button>
</van-col>
<van-col span="8">
<van-button block @click="doAudit(3)" type="info">通 过
</van-button>
</van-col>
</van-row>
</van-form>
</template>
</mobile-wmhd-info>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
formData: {},
id: GetQueryString('id'),
handle: true,
}
},
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
'mobile-wmhd-info': httpVueLoader('/components/mobile/wmhd/info.vue?v=' + new Date().getTime()),
},
methods: {
async doAudit(pass) {
if (!this.formData.auditOpinion) {
this.$toast.fail('请填写审核意见');
return
}
this.$refs.signature.submitSign()
await this.$refs.signature.updateSign()
this.formData.pass = pass
const resp = await $.post("/platform/hd/wmhd/union/audit/doReview", this.formData)
if (resp.code === 0) {
this.$toast.success('审核成功');
setTimeout(() => {
window.history.go(-1)
}, 1000)
} else {
this.$toast.fail('审核失败');
}
},
},
async created() {
this.mLoading = true
const id = GetQueryString("id")
setTimeout(() => {
this.$refs.minfo.getInfo(id)
}, 500)
this.formData = {
id: id,
username: "${@shiro.getPrincipalProperty('username')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: "通过",
auditSign: ""
}
this.mLoading = false
}
})
</script>
<!--#
}
#-->
@@ -15,44 +15,53 @@ layout("/mobile/platform.html"){
<m-page-loading v-if="mLoading"></m-page-loading>
<van-nav-bar
title="作品列表"
@click-left="history.go(-1)"
fixed
left-arrow
placeholder
fixed
@click-left="history.back()"
title="作品列表"
></van-nav-bar>
<div class="search-fixed">
<van-dropdown-menu active-color="#1989fa">
<van-dropdown-item v-model="pageForm.year" :options="yearOption" @change="yearChange"></van-dropdown-item>
<van-dropdown-item :options="yearOption" @change="yearChange"
v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
</div>
<div style="margin: 60px auto 0 auto">
<div style="margin: 60px auto">
<van-notice-bar mode="closeable">左滑可删除作品。</van-notice-bar>
<van-list
v-model="mLoading"
:finished="finished"
:finished-text="tableData.length>0?'没有更多了':''"
@load="onLoad">
@load="onLoad"
v-model="mLoading">
<div v-for="o in tableData" class="list-card" @click.stop="openView(o)">
<van-swipe-cell>
<div @click.stop="openView(o)" class="list-card" v-for="o in tableData">
<van-swipe-cell :disabled="o.auditstate!=='3999'">
<van-cell-group inset>
<image class="register-icon" src="/assets/mobile/svg/wmhd/bianji.svg"
@click.stop="openEdit(o.id,o.hdid)"></image>
<van-cell :border="false" title="姓名">{{o.username}}</van-cell>
<image @click.stop="openEdit(o.id,o.hdid)" class="register-icon"
src="/assets/mobile/svg/wmhd/bianji.svg"
v-if="o.auditstate==='3999'||o.auditstate==='4100'||o.auditstate==='4250'"></image>
<van-cell :border="false" title="姓名">{{o.sbrname}}</van-cell>
<van-cell :border="false" title="工号">{{o.loginname}}</van-cell>
<van-cell :border="false" title="单位">{{o.dwname}}</van-cell>
<van-cell :border="false" title="工会">{{o.ghname}}</van-cell>
<van-cell :border="false" title="活动类别">{{o.hdlbname}}</van-cell>
<van-cell :border="false" title="作品类别" v-if="o.zplbname">{{o.zplbname}}</van-cell>
<van-cell :border="false" title="作品类别" v-if="o.zplbname">{{o.zplbname}}
</van-cell>
<!-- <van-cell :border="false" title="主题">{{o.hdsbzpzt}}</van-cell>-->
<van-cell :border="false" title="上传时间">{{o.hdsbsj}}</van-cell>
<!-- <van-cell :border="false" title="审核状态">
<span :style="'color:'+o.statecolor">{{o.statename}}</span>
</van-cell>--><!--
<van-cell :border="false" title="总点赞数">
{{o.dz_znum}}次
</van-cell>-->
</van-cell-group>
<template #right>
<van-button square text="删除" type="danger" @click="doDelete(o.id)"
style="height: 100%;"></van-button>
<van-button @click="doDelete(o.id)" square style="height: 100%;" text="删除"
type="danger"></van-button>
</template>
</van-swipe-cell>
</div>
@@ -60,11 +69,30 @@ layout("/mobile/platform.html"){
</van-list>
<van-empty
v-if="mLoading==false&&tableData.length==0"
class="custom-image"
image="/none.svg"
description="暂无数据"
image="/none.svg"
v-if="mLoading==false&&tableData.length==0"
></van-empty>
</div>
<van-popup :style="{ height: '100%',width:'100%' }" position="right"
v-model="viewShow">
<van-nav-bar @click-left="viewShow=false" fixed left-arrow placeholder
title="详细信息"></van-nav-bar>
<mobile-wmhd-info ref="minfo"></mobile-wmhd-info>
</van-popup>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/mobile/wmhd/apply">教工作品征集</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/list">我的教工作品
</van-tabbar-item><!--
<van-tabbar-item icon="manager-o" replace url="/mobile/wmhd/statistics">点赞教工作品
</van-tabbar-item>-->
</van-tabbar>
</div>
</div>
@@ -75,6 +103,8 @@ layout("/mobile/platform.html"){
mixins: [mobileMixins],
data() {
return {
viewShow: false,
tarBarActive: 1,
yearOption: [],
pageForm: {
year: '',
@@ -82,7 +112,9 @@ layout("/mobile/platform.html"){
}
}
},
components: {
'mobile-wmhd-info': httpVueLoader('/components/mobile/wmhd/info.vue?v=' + new Date().getTime()),
},
methods: {
openEdit(id, hdid) {
window.location.href = '/platform/staffActivities?client=mobile&id=' + hdid + '&zpid=' + id
@@ -108,7 +140,7 @@ layout("/mobile/platform.html"){
},
async onLoad() {
this.mLoading = true
$.post('/platform/hd/wmhd/pageData', this.pageForm).then(res => {
$.post('/platform/hd/jzghd/sczp/pageData', this.pageForm).then(res => {
if (res.code === 0) {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
@@ -121,7 +153,10 @@ layout("/mobile/platform.html"){
})
},
openView(o) {
window.location.href = '/mobile/wmhd/list/view?id=' + o.id
this.viewShow = true
setTimeout(() => {
this.$refs.minfo.getInfo(o.id)
}, 100)
}
},
async created() {
@@ -136,4 +171,4 @@ layout("/mobile/platform.html"){
<!--#
}
#-->
#-->
File diff suppressed because it is too large Load Diff
@@ -4,33 +4,34 @@ layout("/layouts/platform.html"){
<div id="app">
<guava>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-date-picker @change="yearChange"
<el-date-picker :clearable="false"
@change="yearChange"
placeholder="年度"
type="year"
v-model="pageForm.year"
value-format="yyyy"></el-date-picker>
</div>
<div class="btn-group tool-button">
<el-select clearable v-model="pageForm.hdid">
<el-select :clearable="false" v-model="pageForm.hdid">
<el-option :key="i.value"
:label="i.label"
:value="i.value"
v-for="i in hdxxlist"></el-option>
</el-select>
<!-- <el-cascader placeholder="请选择活动主题"-->
<!-- filterable-->
<!-- v-model="pageForm.hdid" :options="hdxxlist"-->
<!-- @change="(v)=>{ pageForm.hdid = clone(v).pop() }"-->
<!-- clearable></el-cascader>-->
<!-- <el-cascader :options="hdxxlist"
@change="(v)=>{ pageForm.hdid = clone(v).pop() }"
clearable filterable
placeholder="请选择活动主题"
v-model="pageForm.hdids"></el-cascader>-->
</div>
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch" clearable>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 120px;"
clearable>
<el-input @keyup.enter.native="doSearch" clearable
placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select clearable placeholder="查询类型" slot="prepend"
style="width: 120px;"
v-model="pageForm.searchName">
<!-- <el-option v-if="hasSuperAdminOrXghRole" label="分工会" value="gh.unionname"></el-option>-->
<!-- <el-option label="单位" value="dw.name"></el-option>-->
<el-option label="教职工姓名" value="sbr.username"></el-option>
@@ -40,63 +41,70 @@ layout("/layouts/platform.html"){
</div>
<el-row class="btn-group tool-button">
<el-select v-if="hasSuperAdminOrXghRole" placeholder="所属工会" v-model="pageForm.union"
<el-select @change="unionChange" clearable="true" filterable="true"
placeholder="所属工会"
style="width: 200px;"
clearable="true"
filterable="true" @change="unionChange">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
v-if="hasSuperAdminOrXghRole" v-model="pageForm.union">
<el-option :label="item.unionname" :value="item.id"
v-for="item in unions"></el-option>
</el-select>
</el-row>
<el-row class="btn-group tool-button">
<el-select placeholder="所属单位" v-model="pageForm.unit" style="width: 200px;" clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 200px;"
v-model="pageForm.unit">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</el-row>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="btn-group tool-button mt5">
<el-button size="medium" @click="exportExcel(1)">
<div class="pull-right offscreen-right">
<el-button @click="exportExcel(1)" size="medium">
<i class="el-icon-tickets"></i>
导出获奖人员名单
</el-button>
<el-button size="medium" @click="exportExcel(2)" v-if="hasSuperAdminOrXghRole">
<el-button @click="exportExcel(2)" size="medium" v-if="hasSuperAdminOrXghRole">
<i class="el-icon-tickets"></i>
导出分工会获奖信息
</el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-card class="mt20" shadow="never">
<el-table :data="tableData">
<el-table-column label="序号" type="index" header-align="center" align="center" width="50">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="50">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="username" label="姓名" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="姓名" prop="username"
sortable></el-table-column>
<el-table-column prop="loginname" label="工资号" header-align="center" align="center"></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center" show-overflow-tooltip
<el-table-column align="center" header-align="center" label="工资号"
prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" label="单位" prop="dwname"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center" show-overflow-tooltip
<el-table-column align="center" header-align="center" label="分工会" prop="ghname"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="hjcount" label="获奖次数" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="获奖次数" prop="hjcount"
show-overflow-tooltip></el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
@@ -107,83 +115,31 @@ layout("/layouts/platform.html"){
<script>
const vue = new Vue({
el: '#app',
data: function () {
mixins: [initTableMixins],
data() {
return {
unions: [],
units: [],
hasSuperAdminOrXghRole: "${@shiro.hasAnyRoles('sysadmin','A06')}" === 'true' ? true : false,
hasSuperAdminOrXghRole: "${@shiro.hasAnyRoles('sysadmin,A06',',')}" === 'true' ? true : false,
pageForm: {
year: new Date().getFullYear() + '',
pageNumber: 1,
pageSize: 10,
totalCount: 0,
hdid: null,
searchName: 'sbr.username',
year: new Date().getFullYear().toString()
searchName: 'sbr.username'
},
tableData: [],
hdxxlist: []
}
},
methods: {
yearChange(val) {
this.pageForm.hdid = null
if (val) {
this.hdxxlist = this.yearActivityList.filter(v => v.value === parseInt(val)).map(v => v.children).reduce((a, b) => [...a, ...b], [])
} else {
this.hdxxlist = this.yearActivityList.map(v => v.children).reduce((a, b) => [...a, ...b], [])
}
if (this.hdxxlist && this.hdxxlist.length > 0) {
this.pageForm.hdid = this.hdxxlist[0].value
}
this.doSearch()
// this.$nextTick(() => {
// this.hdxxlist = []
// })
// this.$set(this.pageForm, "hdid", "")
// let activityList = []
// console.log(val)
// if (val === null) {
// this.yearActivityList.map(v => {
// activityList = activityList.concat(v.children)
// })
// } else {
// let enen = this.yearActivityList.filter(v => v.value == val)
// enen.map(v => {
// activityList = activityList.concat(v.children)
// })
// }
// this.$nextTick(() => {
// this.hdxxlist = activityList
// })
// this.doSearch()
},
async unionChange() {
this.$set(this.pageForm, "unit", null)
this.units = await getUnits(this.pageForm.union)
},
pageData: function () {
var self = this;
sublime.showLoadingbar();
$.post(base + "/platform/hd/childhd/hjxx/pageData", self.pageForm, function (data) {
sublime.closeLoadingbar();
if (data.code == 0) {
self.tableData = data.data.list;
self.pageForm.totalCount = data.data.totalCount;
}
});
},
pageSizeChange: function (val) {
this.pageForm.pageSize = val;
this.pageData();
},
pageNumberChange: function (val) {
this.pageForm.pageNumber = val;
this.pageData();
},
exportExcel: function (num) {
var self = this;
var hdid = self.pageForm.hdid;
@@ -197,25 +153,42 @@ layout("/layouts/platform.html"){
this.pageForm.pageNumber = 1;
this.pageData();
},
initHdxxlist() {
$.post(base + '/platform/hd/childhd/zpxx/initHdxxlist').then(data => {
if (data.code == 0) {
this.yearActivityList = data.data
let activityList = []
data.data.map(v => {
activityList = activityList.concat(v.children)
})
this.hdxxlist = activityList
this.$set(this.pageForm, 'hdid', this.hdxxlist ? this.hdxxlist[0].value : []);
}
});
async initHdxxlist() {
const data = await $.post(base + '/platform/hd/childhd/zpxx/initHdxxlist')
if (data.code == 0) {
this.yearActivityList = data.data
let activityList = []
data.data.map(v => {
activityList = activityList.concat(v.children)
})
this.hdxxlist = activityList
}
},
yearChange(val) {
let activityList = []
if (val === null) {
this.yearActivityList.map(v => {
activityList = activityList.concat(v.children)
})
} else {
let enen = this.yearActivityList.filter(v => v.value == val)
enen.map(v => {
activityList = activityList.concat(v.children)
})
}
this.hdxxlist = activityList
if (this.hdxxlist && this.hdxxlist.length > 0) {
this.$set(this.pageForm, 'hdid', this.hdxxlist[0].value);
} else {
this.$set(this.pageForm, 'hdid', null);
}
this.doSearch()
}
},
async created() {
$.ajaxSettings.async = false;
this.initHdxxlist();
this.pageData();
$.ajaxSettings.async = true;
await this.initHdxxlist()
await this.yearChange(new Date().getFullYear() + '');
this.unions = await getUnions()
this.units = await getUnits()
}
@@ -223,4 +196,4 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
#-->
@@ -88,19 +88,28 @@
.van-swipe-cell__wrapper {
border: none;
}
.van-nav-bar__content {
background-color: #081776;
}
.van-nav-bar__title, .van-icon-arrow-left::before {
color: white;
}
</style>
<body>
<div v-clock id="app" v-if="showPage">
<van-nav-bar title="亲子作品征集" fixed placeholder safe-area-inset-top @click-left="history.back()"
:left-arrow="leftArrow"></van-nav-bar>
<div>
<van-swipe v-if="boxData.bgis.length>0" class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="bgi in boxData.bgis">
<van-swipe v-if="boxData.files&&boxData.files.length>0" class="my-swipe" :autoplay="3000"
indicator-color="white">
<van-swipe-item v-for="bgi in boxData.files">
<van-image
width="100%"
height="200px"
fit="cover"
:src="FILE_DOMAIN+bgi.iurl"
:src="FILE_DOMAIN+'/fileStreamPreview?id='+bgi.id"
></van-image>
</van-swipe-item>
</van-swipe>
@@ -311,7 +320,7 @@
(如同时参加以下多个活动,或有多个主题,请分别提交)</p>
</div>
<van-tabs v-model="formData.hdlb_i" :color="boxData.hdcolor" type="line">
<van-tab v-for="lb,i in boxData.lbs" :name="i" :title="lb.lname">
<van-tab v-for="(lb,i) in boxData.lbs" :name="i" :title="lb.lname">
<div v-if="formData.hdlb_i==i">
<van-field style="padding-top: 30px" maxlength="15"
:rules="[{ required: true, message: '请填写作品主题' }]"
@@ -347,30 +356,31 @@
<van-field label="图&emsp;&emsp;片" disabled placeholder="(左滑删除单个文件)"
style="border: none;"
input-align="right"></van-field>
<van-swipe-cell v-for="img,idx in fd[i].imgList"
<van-swipe-cell v-for="(img,idx) in fd[i].imgList"
style="border: none;padding-top: 20px;">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
v-if="img.id"
width="100%"
height="25vw"
fit="cover"
:src="FILE_DOMAIN+'/fileStreamPreview?id='+img.id"
></van-image>
<van-image
v-else
width="100%"
height="25vw"
fit="cover"
:src="img.content"
></van-image>
</van-col>
<van-col :span="18">
<van-field style="width: 100%;height: 25vm;padding-right: 0;" autosize
v-model="img.ms"
type="textarea" rows="2"
maxlength="50"
:show-word-limit="!isNull(img.ms)"
placeholder="请输入描述信息"></van-field>
</van-col>
</van-row>
<van-button
native-type="button"
@click="fd[i].imgList.splice(idx,1)"
@click="imgDelete(idx,i,img.filepath)"
slot="right"
square
text="删除"
@@ -403,23 +413,17 @@
<i class="van-icon van-icon-description van-uploader__file-icon">
<!----></i>
<div class="van-uploader__file-name van-ellipsis">
{{video.file.name}}
{{video.filename ? video.filename : video.file.name }}
</div>
</template>
</van-image>
</van-col>
<van-col :span="18">
<van-field style="width: 100%;padding-right: 0;" autosize v-model="video.ms"
type="textarea" rows="2"
maxlength="50"
:show-word-limit="!isNull(video.ms)"
placeholder="请输入描述信息"></van-field>
</van-col>
</van-row>
<van-button
native-type="button"
@click="fd[i].videoList.splice(idx,1)"
@click="videoDelete(idx,i,video.filepath)"
slot="right"
square
text="删除"
@@ -505,6 +509,7 @@
el: "#app",
data: function () {
return {
readytodelfile: [],
leftArrow: false,
zngxArr: ['父亲', '母亲', '第三代'],
boxData: {},
@@ -536,6 +541,14 @@
}
},
methods: {
imgDelete(idx, i, filepath) {
this.fd[i].imgList.splice(idx, 1)
this.readytodelfile.push(filepath);
},
videoDelete(idx, i, filepath) {
this.fd[i].videoList.splice(idx, 1)
this.readytodelfile.push(filepath);
},
onConfirm: function (value) {
this.formData.hdzplx2 = value.zname;
this.showPicker = false;
@@ -564,7 +577,7 @@
}
}
},
doSubmit: function () {
async doSubmit() {
if (vue.isNull(vue.formData.userid)) {
vue.$toast.fail("请正确填写您的工资号!")
return
@@ -576,94 +589,180 @@
return
}
vue.$dialog.confirm({
const confirm = await vue.$dialog.confirm({
title: '提醒',
message: '您当前选择的是“' + vue.boxData.lbs[i].lname + '”,是否确认上传?上传后您将不能对已上传的作品进行更改'
}).then(function (value) {
setTimeout(function () {
vue.showMsg = true
vue.showPlan = true
vue.percent = 0
vue.msg = ''
})
if (confirm === "confirm") {
setTimeout(() => {
this.showMsg = true
this.showPlan = true
this.percent = 0
this.msg = ''
let formData1 = {}
let formData2 = new FormData();
if (!this.isNull(this.formData.id)) {
this.$set(formData1, "id", getQueryVariable("zpid"))
this.$set(formData1, "hdid", getQueryVariable("id"))
this.$set(formData1, "sbr", this.formData.userid)
this.$set(formData1, "mobile", this.formData.mobile)
this.$set(formData1, "hdlb", this.boxData.lbs[i].lid)
this.$set(formData1, "znxm", this.formData.znxm)
this.$set(formData1, "znnl", this.formData.znnl)
this.$set(formData1, "znxb", this.formData.znxb)
this.$set(formData1, "zngx", this.formData.zngx)
this.$set(formData1, "zplb", this.fd[i].zplb)
this.$set(formData1, "zpzt", this.fd[i].zpzt)
this.$set(formData1, "zpms", this.fd[i].zpms)
this.$set(formData1, "sbsj", moment().format('YYYY-MM-DD HH:mm:ss'))
var formdata = new FormData();
formdata.append("hdid", getQueryVariable("id"))
} else {
formData2.append("hdid", getQueryVariable("id"))
formdata.append("sbr", vue.isNull(vue.formData.userid) ? '' : vue.formData.userid);
formdata.append("mobile", vue.isNull(vue.formData.mobile) ? '' : vue.formData.mobile);
formdata.append("hdlb", vue.isNull(vue.boxData.lbs[i].lid) ? '' : vue.boxData.lbs[i].lid)
formData2.append("sbr", this.isNull(this.formData.userid) ? '' : this.formData.userid);
formData2.append("mobile", vue.isNull(vue.formData.mobile) ? '' : this.formData.mobile);
formData2.append("hdlb", vue.isNull(vue.boxData.lbs[i].lid) ? '' : this.boxData.lbs[i].lid)
formdata.append("znxm", vue.isNull(vue.formData.znxm) ? '' : vue.formData.znxm);
formdata.append("znnl", vue.isNull(vue.formData.znnl) ? '' : vue.formData.znnl);
formdata.append("znxb", vue.isNull(vue.formData.znxb) ? '' : vue.formData.znxb);
formdata.append("zngx", vue.isNull(vue.formData.zngx) ? '' : vue.formData.zngx);
formData2.append("znxm", this.isNull(this.formData.znxm) ? '' : this.formData.znxm);
formData2.append("znnl", this.isNull(this.formData.znnl) ? '' : this.formData.znnl);
formData2.append("znxb", this.isNull(this.formData.znxb) ? '' : this.formData.znxb);
formData2.append("zngx", this.isNull(this.formData.zngx) ? '' : this.formData.zngx);
formdata.append("zplb", vue.isNull(vue.fd[i].zplb) ? '' : vue.fd[i].zplb);
formdata.append("zpzt", vue.isNull(vue.fd[i].zpzt) ? '' : vue.fd[i].zpzt);
formdata.append("zpms", vue.isNull(vue.fd[i].zpms) ? '' : vue.fd[i].zpms);
formdata.append("sbsj", moment().format('YYYY-MM-DD HH:mm:ss'));
formData2.append("zplb", this.isNull(this.fd[i].zplb) ? '' : this.fd[i].zplb);
formData2.append("zpzt", this.isNull(this.fd[i].zpzt) ? '' : this.fd[i].zpzt);
formData2.append("zpms", this.isNull(this.fd[i].zpms) ? '' : this.fd[i].zpms);
formData2.append("sbsj", moment().format('YYYY-MM-DD HH:mm:ss'));
vue.fd[i].imgList.forEach(function (val) {
formdata.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
vue.fd[i].videoList.forEach(function (val) {
formdata.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
$.ajax({
url: "/childrenActivities/doSubmit",
type: "post",
data: formdata,
processData: false,
contentType: false,
xhr: xhrOnProgress(function (e) {
if (e.total == 0) {
vue.percent = 0
} else {
vue.percent = ((e.loaded / e.total) * 100).toFixed(0);//文件上传百分比
}
}),
success: function (data) {
if (data.code === 0) {
vue.formData.znxm = ''
vue.formData.znnl = ''
vue.formData.znxb = ''
vue.formData.zngx = ''
vue.fd[i].zplb = ''
vue.fd[i].zplb_name = ''
vue.fd[i].zpzt = ''
vue.fd[i].zpms = ''
vue.fd[i].sbsj = ''
vue.fd[i].imgList = []
vue.fd[i].videoList = []
vue.fd[i].audioList = []
Cookies.remove('ca_formData');
vue.msg = '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>'
vue.flag = true
} else {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
}
vue.showPlan = false
},
error: function (data) {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
vue.showPlan = false
vue.fd[i].imgList.forEach(function (val) {
formData2.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
vue.fd[i].videoList.forEach(function (val) {
formData2.append("files", val.file, vue.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
}
});
}, 500)
}).catch(function (reason) {
if (!this.isNull(this.formData.id)) {
formData2.append("data", JSON.stringify(formData1));
formData2.append("readytodelfile", JSON.stringify(this.readytodelfile));
this.fd[i].imgList.forEach(val => {
formData2.append("file", val.file);
});
this.fd[i].videoList.forEach(val => {
formData2.append("file", val.file);
});
$.ajax({
url: "/platform/hd/childhd/sczp/doEdit",
type: "post",
data: formData2,
processData: false,
contentType: false,
xhr: xhrOnProgress(function (e) {
if (e.total == 0) {
vue.percent = 0
} else {
vue.percent = ((e.loaded / e.total) * 100).toFixed(0);//文件上传百分比
}
}),
success: function (data) {
if (data.code === 0) {
vue.formData.znxm = ''
vue.formData.znnl = ''
vue.formData.znxb = ''
vue.formData.zngx = ''
vue.fd[i].zplb = ''
vue.fd[i].zplb_name = ''
vue.fd[i].zpzt = ''
vue.fd[i].zpms = ''
vue.fd[i].sbsj = ''
vue.fd[i].imgList = []
vue.fd[i].videoList = []
vue.fd[i].audioList = []
Cookies.remove('ca_formData');
vue.msg = '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>'
vue.flag = true
} else {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
}
vue.showPlan = false
window.history.back()
},
error: function (data) {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
vue.showPlan = false
}
});
} else {
$.ajax({
url: "/childrenActivities/doSubmit",
type: "post",
data: formData2,
processData: false,
contentType: false,
xhr: xhrOnProgress(function (e) {
if (e.total == 0) {
vue.percent = 0
} else {
vue.percent = ((e.loaded / e.total) * 100).toFixed(0);//文件上传百分比
}
}),
success: function (data) {
if (data.code === 0) {
vue.formData.znxm = ''
vue.formData.znnl = ''
vue.formData.znxb = ''
vue.formData.zngx = ''
vue.fd[i].zplb = ''
vue.fd[i].zplb_name = ''
vue.fd[i].zpzt = ''
vue.fd[i].zpms = ''
vue.fd[i].sbsj = ''
vue.fd[i].imgList = []
vue.fd[i].videoList = []
vue.fd[i].audioList = []
Cookies.remove('ca_formData');
vue.msg = '<p class="weui-msg__desc">我们已收到您的作品!<br/>非常感谢您的支持!</p>'
vue.flag = true
} else {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
}
vue.showPlan = false
},
error: function (data) {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
vue.flag = false
vue.showPlan = false
}
});
}
}
,
500
)
}
});
},
// 返回布尔值
beforeReadImg: function (file) {
@@ -684,11 +783,14 @@
return true;
},
},
created() {
GetQueryString("client") == "mobile" ? this.leftArrow = true : this.leftArrow = false
async created() {
const loginname = "${@shiro.getPrincipalProperty('loginname')}"
this.$set(this.formData, "loginname", loginname)
this.doInput(loginname)
const zpid = GetQueryString("zpid")
GetQueryString("client") == "mobile" ? this.leftArrow = true : this.leftArrow = false
this.$set(this.formData, "loginname", loginname)
this.doInput(loginname)
var self = this
if (window.innerWidth > 800) {
self.$notify({type: 'warning', message: '当前窗口宽度过大!部分区域显示会出现大小偏差'});
@@ -725,15 +827,36 @@
})
}
if (Cookies.get("ca_formData") != undefined) {
self.formData = JSON.parse(Cookies.get("ca_formData"))
Cookies.remove('ca_formData');
if (!this.isNull(zpid)) {
const {data, code, msg} = await $.get("/platform/hd/wmhd/findOneById", {id: zpid})
const refs = await $.get("/mobile/cahd/list/findOne", {id: zpid})
this.$set(this.formData, "id", refs[0].id)
this.$set(this.formData, "hdid", refs[0].id)
this.$set(this.formData, "userid", refs[0].sbr)
this.$set(this.formData, "mobile", refs[0].mobile)
this.$set(this.boxData.lbs[this.formData.hdlb_i], "lid", refs[0].hdlb)
this.$set(this.formData, "znxm", refs[0].znxm)
this.$set(this.formData, "znnl", refs[0].znnl)
this.$set(this.formData, "znxb", refs[0].znxb)
this.$set(this.formData, "zngx", refs[0].zngx)
this.$set(this.fd[this.formData.hdlb_i], "zplb", refs[0].zplb)
this.$set(this.fd[this.formData.hdlb_i], "zpzt", refs[0].zpzt)
this.$set(this.fd[this.formData.hdlb_i], "zpms", refs[0].zpms)
this.$set(this.fd[this.formData.hdlb_i], "zplb_name", refs[0].zname)
data.forEach((v, i) => {
v.filename = v.filename
v.fjurl = v.filepath
v.url = FILE_DOMAIN + v.filepath
v.content = FILE_DOMAIN + v.filepath
const filetype = v.filename.substring(v.filename.lastIndexOf(".") + 1)
const aa = this.audiotype.concat(this.videotype)
if (this.imgtype.indexOf(filetype) > -1) {
this.fd[this.formData.hdlb_i].imgList.push(v)
} else if (aa.indexOf(filetype) > -1) {
this.fd[this.formData.hdlb_i].videoList.push(v);
}
})
}
setInterval(function () {
Cookies.set("ca_formData", JSON.stringify(self.formData))
}, 1000)
}
})
@@ -13,8 +13,8 @@
<!-- 引入 Vue 和 Vant 的 JS 文件 -->
<script src="https://cdn.staticfile.org/vue/2.6.9/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vant/2.12.5/vant.js"></script>
<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.js"></script>
<script src="https://cdn.staticfile.org/vant/2.12.5/vant.min.js"></script>
<script src="https://cdn.staticfile.org/jquery/1.11.1/jquery.min.js"></script>
<script src="/assets/platform/plugins/moment/moment.min.js"></script>
</head>
@@ -93,13 +93,13 @@
<body>
<div v-clock id="app">
<div>
<van-swipe v-if="boxData.fileList.length>0" class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="url in boxData.fileList">
<van-swipe v-if="boxData.files&&boxData.files.length>0" class="my-swipe" :autoplay="3000" indicator-color="white">
<van-swipe-item v-for="url in boxData.files">
<van-image
width="100%"
height="200px"
fit="cover"
:src="url"
:src="'${AppFileDomain!}/fileStreamPreview?id='+url.id"
></van-image>
</van-swipe-item>
</van-swipe>
File diff suppressed because it is too large Load Diff
+139 -139
View File
@@ -310,148 +310,148 @@ layout("/layouts/platform.html"){
</el-card>
</template>
<!-- <template #view>
<table style="width: 100%">
<tr style="border: 1px solid rgb(220, 220, 220);">
<td colspan="4"
style="text-align: center;padding: 10px;background-color: #0e78c5;color: white;font-size: 18px;font-weight:500">
作品信息
</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">姓名</td>
<td class="tpb">{{viewData.sbrname}}</td>
<td class="tpa">工资号</td>
<td class="tpb">{{viewData.loginname}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">单位</td>
<td class="tpb">{{viewData.dwname}}</td>
<td class="tpa">工会</td>
<td class="tpb">{{viewData.ghname}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">子女姓名</td>
<td class="tpb">{{viewData.znxm}}</td>
<td class="tpa">子女年龄</td>
<td class="tpb">{{viewData.znnl}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">子女性别</td>
<td class="tpb">{{viewData.znxb}}</td>
<td class="tpa">关系</td>
<td class="tpb">{{viewData.zngx}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">活动类别</td>
<td class="tpb">
<span>{{viewData.hdlbname}}</span>
</td>
<td class="tpa">作品类别</td>
<td class="tpb">
<span>{{viewData.zplbname}}</span>
</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品主题</td>
<td class="tpb" colspan="3">{{viewData.zpzt}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品描述</td>
<td class="tpb" colspan="3">{{viewData.zpms}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品信息</td>
<td class="tpb" colspan="3">
<el-row>
<el-divider>照片&emsp;<i class="el-icon-picture-outline"></i></el-divider>
<div style="text-align: left;" v-if="img2List.length>0">
<div v-for="item in img2List"
style="display: inline-block;width: 100px;margin-right:10px">
<el-image lazy :z-index="999999999"
style="width: 100px;height: 100px;"
:src="item.url"
:preview-src-list="prevImgList">
</el-image>
</div>
<!-- <template #view>
<table style="width: 100%">
<tr style="border: 1px solid rgb(220, 220, 220);">
<td colspan="4"
style="text-align: center;padding: 10px;background-color: #0e78c5;color: white;font-size: 18px;font-weight:500">
作品信息
</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">姓名</td>
<td class="tpb">{{viewData.sbrname}}</td>
<td class="tpa">工资号</td>
<td class="tpb">{{viewData.loginname}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">单位</td>
<td class="tpb">{{viewData.dwname}}</td>
<td class="tpa">工会</td>
<td class="tpb">{{viewData.ghname}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">子女姓名</td>
<td class="tpb">{{viewData.znxm}}</td>
<td class="tpa">子女年龄</td>
<td class="tpb">{{viewData.znnl}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">子女性别</td>
<td class="tpb">{{viewData.znxb}}</td>
<td class="tpa">关系</td>
<td class="tpb">{{viewData.zngx}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">活动类别</td>
<td class="tpb">
<span>{{viewData.hdlbname}}</span>
</td>
<td class="tpa">作品类别</td>
<td class="tpb">
<span>{{viewData.zplbname}}</span>
</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品主题</td>
<td class="tpb" colspan="3">{{viewData.zpzt}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品描述</td>
<td class="tpb" colspan="3">{{viewData.zpms}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品信息</td>
<td class="tpb" colspan="3">
<el-row>
<el-divider>照片&emsp;<i class="el-icon-picture-outline"></i></el-divider>
<div style="text-align: left;" v-if="img2List.length>0">
<div v-for="item in img2List"
style="display: inline-block;width: 100px;margin-right:10px">
<el-image lazy :z-index="999999999"
style="width: 100px;height: 100px;"
:src="item.url"
:preview-src-list="prevImgList">
</el-image>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片。
</div>
</el-row>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片。
</div>
</el-row>
<el-row>
<el-divider>视频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="videoList.length>0">
<div v-for="item in videoList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab">
<div class="video-toggle-i"
@click="playVideo('${AppFileDomain!}'+item.filepath)">
<i class="el-icon-video-camera-solid"></i>
<i class="el-icon-video-play"></i>
</div>
<el-row>
<el-divider>视频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="videoList.length>0">
<div v-for="item in videoList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab">
<div class="video-toggle-i"
@click="playVideo('${AppFileDomain!}'+item.filepath)">
<i class="el-icon-video-camera-solid"></i>
<i class="el-icon-video-play"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="dd3s.download(item.filepath,item.filename)">
<i class="el-icon-download"></i>
</span>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="dd3s.download(item.filepath,item.filename)">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有视频。
</div>
</el-row>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有视频。
</div>
</el-row>
<el-row>
<el-divider>音频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="audioList.length>0">
<div v-for="item in audioList">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
<source :src="'${AppFileDomain!}'+item.filepath"/>
</audio>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div>
</el-row>
<el-row>
<el-divider>音频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="audioList.length>0">
<div v-for="item in audioList">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
<source :src="'${AppFileDomain!}'+item.filepath"/>
</audio>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div>
</el-row>
<el-row>
<el-divider>文档&emsp;<i class="el-icon-document-copy"></i></el-divider>
<div style="text-align: left;" v-if="docList.length>0">
<div v-for="item in docList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab" style="background-color: #f6f6f6">
<div class="video-toggle-i" @click="dd3s.preview(item.filepath,item.id)">
<i class="el-icon-document"></i>
</div>
<el-row>
<el-divider>文档&emsp;<i class="el-icon-document-copy"></i></el-divider>
<div style="text-align: left;" v-if="docList.length>0">
<div v-for="item in docList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab" style="background-color: #f6f6f6">
<div class="video-toggle-i" @click="dd3s.preview(item.filepath,item.id)">
<i class="el-icon-document"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="dd3s.download(item.filepath,item.filename)">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档。
</div>
</el-row>
</td>
</tr>
</table>
</template>-->
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="dd3s.download(item.filepath,item.filename)">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档。
</div>
</el-row>
</td>
</tr>
</table>
</template>-->
<template #view>
<el-form label-suffix=":" label-position="left" style="padding: 40px" label-width="110px">
@@ -522,7 +522,7 @@ layout("/layouts/platform.html"){
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab">
<div class="video-toggle-i"
@click="playVideo('${AppFileDomain!}'+item.filepath)">
@click="playVideo(item.url)">
<i class="el-icon-video-camera-solid"></i>
<i class="el-icon-video-play"></i>
</div>
@@ -550,7 +550,7 @@ layout("/layouts/platform.html"){
<div v-for="item in audioList">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
<!-- <source :src="https://cdn.moefe.org/music/mp3/thing.mp3" />-->
<source :src="'${AppFileDomain!}'+item.filepath"/>
<source :src="item.url"/>
</audio>
</div>
</div>
@@ -602,7 +602,7 @@ layout("/layouts/platform.html"){
</div>
<script>
window.vm = new Vue({
const vue = new Vue({
el: "#app",
data() {
return {
@@ -706,12 +706,12 @@ layout("/layouts/platform.html"){
data.data.forEach(val => {
val.fjname = val.filename
val.fjurl = val.filepath
val.url = '${AppFileDomain!}' + val.filepath
val.url = FILE_DOMAIN+'/fileStreamPreview?id='+val.id
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val);
} else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push('${AppFileDomain!}' + val.filepath)
this.prevImgList.push(FILE_DOMAIN+'/fileStreamPreview?id='+val.id)
this.img2List.push(val);
} else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val);
@@ -178,116 +178,133 @@ layout("/layouts/platform.html"){
.ViewDialogClass .el-form-item {
margin-bottom: 20px;
}
</style>
<script src="${base!}/assets/platform/js/jquery.qrcode.min.js"></script>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-date-picker
v-model="pageForm.year"
placeholder="按年度查询"
type="year"
value-format="yyyy"
placeholder="按年度查询">
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.hdname" clearable>
<el-input clearable placeholder="请输入内容" v-model="pageForm.hdname">
<template slot="prepend">活动主题</template>
</el-input>
</div>
<div class="btn-group tool-button">
<el-button icon="el-icon-search" @click="doSearch"
style="background-color:#409eff;color: white;"></el-button>
</div>
<div class="pull-right offscreen-right">
<el-button size="medium" @click="openAdd"><i class="ti-plus"></i> 创建活动</el-button>
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-card class="mt20" shadow="never">
<vi-title2 title="活动列表">
<template #func>
<el-button @click="openAdd" size="small" type="primary"><i
class="ti-plus"></i>
创建活动
</el-button>
</template>
</vi-title2>
<el-table
:data="tableData"
header-align="center"
style="width: 100%"
>
<el-table-column
align="center"
header-align="center"
label="序号"
type="index"
header-align="center"
align="center"
>
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
prop="hdname"
align="center"
header-align="center"
label="主题"
header-align="center"
show-overflow-tooltip="true"
align="center">
prop="hdname"
show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="cjr"
align="center"
header-align="center"
label="创建人"
header-align="center"
align="center">
prop="cjr">
</el-table-column>
<el-table-column
prop="hdcjsj"
align="center"
header-align="center"
label="创建时间"
header-align="center"
align="center">
prop="hdcjsj">
</el-table-column>
<el-table-column
prop="time"
label="活动时间"
align="center"
header-align="center"
width="300px"
align="center">
label="活动时间"
prop="time"
width="300px">
<template slot-scope="scope">
{{scope.row.hdkssj}} -- {{scope.row.hdjssj}}
</template>
</el-table-column>
<el-table-column
prop="hdflag"
label="状态"
align="center"
header-align="center"
align="center">
label="状态"
prop="hdflag">
<template slot-scope="scope">
<i v-if="!scope.row.hdflag"
class="fa fa-circle text-danger ml5"></i>
<i v-if="scope.row.hdflag"
class="fa fa-circle text-success ml5"></i>
<i class="fa fa-circle text-danger ml5"
v-if="!scope.row.hdflag"></i>
<i class="fa fa-circle text-success ml5"
v-if="scope.row.hdflag"></i>
</template>
</el-table-column>
<el-table-column
label="操作"
width="300"
align="center"
header-align="center"
align="center">
label="操作"
width="380">
<template slot-scope="scope">
<el-button v-if="scope.row.hdflag==false" type="success" size="mini"
@click="changeStatus(scope.row.hdid,true)">开启
<el-button @click="changeStatus(scope.row.hdid,true)" size="mini"
type="success"
v-if="scope.row.hdflag==false">开启
</el-button>
<el-button v-else type="info" size="mini" @click="changeStatus(scope.row.hdid,false)">关闭
<el-button @click="changeStatus(scope.row.hdid,false)" size="mini"
type="info"
v-else>关闭
</el-button>
<el-button @click="sendMsg(scope.row)" size="mini" type="primary">通知
</el-button>
<el-button @click="openCode(scope.row.hdid)" size="mini" type="primary">
二维码
</el-button>
<el-button @click="openEdit(scope.row.hdid)" size="mini" type="primary">
编辑
</el-button>
<el-button @click="doDelete(scope.row.hdid)" size="mini" type="danger">
删除
</el-button>
<el-button size="mini" type="primary" @click="openCode(scope.row.hdid)">二维码</el-button>
<el-button type="primary" size="mini" @click="openEdit(scope.row.hdid)">编辑</el-button>
<el-button type="danger" size="mini" @click="doDelete(scope.row.hdid)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
@@ -297,157 +314,220 @@ layout("/layouts/platform.html"){
<el-col :span="9" style="position: relative;text-align: center">
<div class="iphonex_box">
<div class="box_title">{{formData.hdname}}</div>
<iframe class="new_frame" id="myIframe" scrolling="auto" frameborder="none;"
<iframe class="new_frame" frameborder="none;" id="myIframe" scrolling="auto"
src="/platform/hd/wmhdMange/mobileBox">
</iframe>
</div>
<el-button type="info" style="margin-top: 10px" icon="el-icon-refresh" @click="refreshBox"
round>刷新
<el-button @click="refreshBox" icon="el-icon-refresh" round
style="margin-top: 10px"
type="info">刷新
</el-button>
</el-col>
<el-col :span="14" offset="1">
<el-form :model="formData" style="padding-top: 20px;padding-right: 10px" ref="addForm"
label-position="left" :rules="formRules" size="medium"
label-width="90px">
<el-form-item prop="hdname" label="活动主题">
<el-form :model="formData" :rules="formRules"
label-position="left"
label-width="130px" ref="addForm" size="medium"
style="padding-top: 20px;padding-right: 10px">
<el-form-item label="活动主题" prop="hdname">
<el-input placeholder="请输入活动主题" v-model="formData.hdname"></el-input>
</el-form-item>
<el-row>
<el-col :span="24">
<el-form-item prop="time" label="活动时间">
<el-form-item label="活动时间" prop="time">
<el-date-picker
style="width: 100%"
v-model="formData.time"
type="datetimerange"
start-placeholder="开始时间"
:default-time="['00:00:00']"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00']">
start-placeholder="开始时间"
style="width: 100%"
type="datetimerange"
v-model="formData.time"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
<!-- <el-col :span="24">
<el-form-item label="点赞时间" prop="time2">
<el-date-picker
:default-time="['00:00:00']"
end-placeholder="结束时间"
start-placeholder="开始时间"
style="width: 100%"
type="datetimerange"
v-model="formData.time2"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
</el-col>
-->
<!-- <el-col :span="24">
<el-form-item label="每人每日点赞次数" prop="dzNum">
<el-input-number min="0" placeholder="请输入每人每日点赞次数" style="width: 100%"
v-model="formData.dzNum"></el-input-number>
</el-form-item>
</el-col>-->
</el-row>
<el-form-item prop="hdlb" label="活动类别">
<el-row v-for="lb,idx in formData.lbs" style="padding-bottom: 5px">
<el-form-item label="活动类别" prop="hdlb">
<el-row style="padding-bottom: 5px" v-for="lb,idx in formData.lbs">
<el-col :span="20">
<el-input placeholder="请输入名称" v-model="lb.lname"></el-input>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="warning" icon="el-icon-plus" circle
@click="formData.lbs.splice(idx+1,0,{zplbs:[{}]})"></el-button>
<el-button @click="addZp(idx)" circle icon="el-icon-plus"
type="warning"></el-button>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="danger" :disabled="idx==0" icon="el-icon-delete" circle
@click="formData.lbs.splice(idx,1)"></el-button>
<el-button :disabled="idx==0"
@click="formData.lbs.splice(idx,1)"
circle icon="el-icon-delete"
type="danger"></el-button>
</el-col>
<el-col style="padding: 5px 0">
<el-row v-for="zplb,idx2 in lb.zplbs" style="padding-bottom: 5px">
<el-col :span="20">
<el-col :span="4"><span v-if="idx2==0"
class="el-form-item__label">作品类别</span><span
<el-row style="padding-bottom: 5px"
v-for="zplb,idx2 in lb.zplbs">
<el-col :span="18">
<el-col :span="4"><span class="el-form-item__label"
v-if="idx2==0">作品类别</span><span
v-else>&nbsp;</span>
</el-col>
<el-col :span="20">
<el-input placeholder="请输入名称" v-model="zplb.zname"></el-input>
<el-input placeholder="请输入名称"
v-model="zplb.zname"></el-input>
</el-col>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="warning" icon="el-icon-plus" circle
@click="lb.zplbs.splice(idx2+1,0,{})"></el-button>
<el-button @click="openSetting(zplb)" circle
icon="el-icon-s-tools"
type="primary"></el-button>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="danger" icon="el-icon-delete"
circle
@click="lb.zplbs.splice(idx2,1)"></el-button>
<el-button @click="addZplb(lb, idx2)" circle
icon="el-icon-plus"
type="warning"></el-button>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button @click="lb.zplbs.splice(idx2,1)" circle
icon="el-icon-delete"
type="danger"></el-button>
</el-col>
</el-row>
</el-col>
</el-row>
</el-form-item>
<el-form-item prop="hdjs" label="活动介绍">
<el-form-item label="面向对象" prop="joinCnd">
<div style="display: flex; justify-content: space-between">
<div style="width: 99%">
<el-select clearable
filterable placeholder="请选择参加人员范围"
style="width: 99%"
v-model="formData.activityGroupId">
<el-option :label="item.groupName"
:value="item.groupId"
v-for="item in activityGroupList"></el-option>
</el-select>
</div>
<div>
<el-button @click="$refs.drawerUserScope.userScopeDialog = true"
type="primary">设置
</el-button>
</div>
</div>
</el-form-item>
<!-- <el-form-item label="是否推送移动端" prop="isPushHome">
<el-radio-group size="medium" v-model="formData.isPushHome">
<el-radio-button :label="0">不推送</el-radio-button>
<el-radio-button :label="1">推送列表</el-radio-button>
<el-radio-button :label="2">推送大图</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="是否启用积分系统" prop="isIntegral">
<el-radio-group size="medium" v-model="formData.isIntegral">
<el-radio-button :label="false">不启用</el-radio-button>
<el-radio-button :label="true">启用</el-radio-button>
</el-radio-group>
</el-form-item>-->
<el-form-item label="活动介绍" prop="hdjs">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb" style="margin-left: 5px"></i>
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="hdjsEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdcjry" label="参加人员">
<el-form-item label="参加人员" prop="hdcjry">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb" style="margin-left: 5px"></i>
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="cjryEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdjlfs" label="奖励方式">
<el-form-item label="奖励方式" prop="hdjlfs">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb" style="margin-left: 5px"></i>
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="jlfsEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdnr" label="活动内容">
<el-form-item label="活动内容" prop="hdnr">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb" style="margin-left: 5px"></i>
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="hdnrEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdlxr" label="联系人">
<el-form-item label="联系人" prop="hdlxr">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb" style="margin-left: 5px"></i>
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="lxrEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdother" label="其他">
<el-form-item label="其他" prop="hdother">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb" style="margin-left: 5px"></i>
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="otherEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item label="活动封面">
<!-- <el-upload-->
<!-- accept="image/*"-->
<!-- action="****"-->
<!-- list-type="picture-card"-->
<!-- :on-preview="handlePictureCardPreview"-->
<!-- :on-remove="handleRemove"-->
<!-- :on-change="handleChange"-->
<!-- :auto-upload="false"-->
<!-- limit="4"-->
<!-- :file-list="fileList">-->
<!-- <i class="el-icon-plus"></i>-->
<!-- </el-upload>-->
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
<el-form-item label="配色">
<ul class="style_box old_stylebox clearfix" style="display: block;padding-left: 0;">
<li class="style_every" v-for="color,idx in colorList" @click="colorChange(color)"
:style="'background: '+color">
<img src="https://www.qmwtp.com/assets/www/ActivityPc2/img/duihao.png"
:style="'display: '+(formData.hdcolor==color?'block':'none')">
<input type="radio" name="sex" checked="checked" value="1">
<ul class="style_box old_stylebox clearfix"
style="display: block;padding-left: 0;">
<li :style="'background: '+color" @click="colorChange(color)"
class="style_every"
v-for="color,idx in colorList">
<img :style="'display: '+(formData.hdcolor==color?'block':'none')"
src="https://www.qmwtp.com/assets/www/ActivityPc2/img/duihao.png">
<input checked="checked" name="sex" type="radio" value="1">
</li>
</ul>
</el-form-item>
@@ -457,104 +537,105 @@ layout("/layouts/platform.html"){
<el-row style="margin: 40px 0;text-align: right">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="success" v-show="!formData.hdid" @click="save">保 存</el-button>
<el-button type="primary" @click="doSubmit">确 定</el-button>
<!-- <el-button type="success" v-show="!formData.hdid" @click="doSubmit(false)">保 存
</el-button>-->
<el-button @click="doSubmit" type="primary">确 定</el-button>
</el-row>
</template>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
<img :src="dialogImageUrl" alt="" width="100%">
</el-dialog>
<el-dialog
title="活动二维码"
:visible.sync="codeDialogVisible"
:close-on-click-modal="false"
width="40%">
<div style="width: 100%;">
<div id="qrcode" style="width: 70%;left: 0;right: 0;margin: auto"></div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="codeDialogVisible = false">关 闭</el-button>
<el-button type="primary" @click="share">分 享</el-button>
<el-button type="primary" onclick="dwn('活动二维码')">下 载</el-button>
</span>
</el-dialog>
</guava>
<drawer-user-scope
:group_id.sync="formData.activityGroupId"
@group_change="getActivityGroup"
ref="drawerUserScope"
></drawer-user-scope>
<send-msg :mobile_url="mobileUrl" :url="sendMsgUrl" ref="sendMsg"></send-msg>
<open-qr-code :url="sendMsgUrl" ref="openQRCode"></open-qr-code>
<el-dialog
:close-on-click-modal="false"
:visible.sync="settingDialogVisible"
title="更多设置"
top="4%" width="40%">
<el-form :model="currentZplb" label-width="160px" size="small">
<el-form-item label="作品介绍最多字数">
<el-input-number :max="10000" :min="1" style="width: 100%"
v-model="currentZplb.maxWordCount"></el-input-number>
</el-form-item>
<vi-title title="上传图片设置"></vi-title>
<el-form-item label="是否上传图片">
<el-radio :label="true" border v-model="currentZplb.isUploadPhoto">上传</el-radio>
<el-radio :label="false" border v-model="currentZplb.isUploadPhoto">不上传</el-radio>
</el-form-item>
<template v-if="currentZplb.isUploadPhoto === true">
<el-form-item label="上传图片数量">
<el-input-number :max="5" :min="1" style="width: 100%"
v-model="currentZplb.photoNum"></el-input-number>
</el-form-item>
<el-form-item label="上传图片格式">
<el-checkbox-group v-model="currentZplb.photoType">
<el-checkbox border key="jpg" label="jpg">jpg</el-checkbox>
<el-checkbox border key="png" label="png">png</el-checkbox>
<el-checkbox border key="jpeg" label="jpeg">jpeg</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="每张图片大小">
<el-input placeholder="请填写每张图片大小" type="number" v-model="currentZplb.photoSize">
<template slot="append">Mb</template>
</el-input>
</el-form-item>
</template>
<vi-title title="上传音/视频、文档设置"></vi-title>
<el-form-item label="是否上传音/视频、文档">
<el-radio :label="true" border v-model="currentZplb.isUploadOther">上传</el-radio>
<el-radio :label="false" border v-model="currentZplb.isUploadOther">不上传</el-radio>
</el-form-item>
<template v-if="currentZplb.isUploadOther === true">
<el-form-item label="文件上传数量">
<el-input-number :max="5" :min="1" style="width: 100%"
v-model="currentZplb.otherFileNum"></el-input-number>
</el-form-item>
<el-form-item label="上传文件格式">
<el-checkbox-group v-model="currentZplb.otherType">
<el-checkbox key="mp3" label="mp3">mp3</el-checkbox>
<el-checkbox key="mp4" label="mp4">mp4</el-checkbox>
<el-checkbox key="docx" label="docx">docx</el-checkbox>
<el-checkbox key="xlsx" label="xlsx">xlsx</el-checkbox>
<el-checkbox key="pdf" label="pdf">pdf</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="每个文件大小">
<el-input placeholder="请填写每个文件大小" type="number" v-model="currentZplb.otherSize">
<template slot="append">Mb</template>
</el-input>
</el-form-item>
</template>
</el-form>
<el-row class="mt20" justify="end" type="flex">
<el-button @click="settingDialogVisible=false">取消</el-button>
<el-button @click="doSetting" type="primary">确定</el-button>
</el-row>
</el-dialog>
</div>
<script>
/*下载二维码*/
function dwn(name) {
var type = 'png';
// var dataurl = $("canvas").get(0).toDataURL('image/png').replace("image/png", "image/octet-stream");
// var filename = name + '_' + (new Date()).getTime() + '.' + type;
// saveFile(dataurl, filename);
alert(IEVersion())
if (IEVersion() != -1) {
var blob = $("canvas").get(0).msToBlob();
window.navigator.msSaveBlob(blob, name + '_' + (new Date()).getTime() + '.' + type);
} else {
$('#download').attr({
href: $("canvas").get(0).toDataURL('image/png').replace("image/png", "image/octet-stream"),
download: name + '_' + (new Date()).getTime() + '.' + type
}).get(0).click();
}
}
function IEVersion() {
var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
if (isIE) {
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if (fIEVersion == 7) {
return 7;
} else if (fIEVersion == 8) {
return 8;
} else if (fIEVersion == 9) {
return 9;
} else if (fIEVersion == 10) {
return 10;
} else {
return 6;//IE版本<=7
}
} else if (isEdge) {
return 'edge';//edge
} else if (isIE11) {
return 11; //IE11
} else {
return -1;//不是ie浏览器
}
}
/**
    * 在本地进行文件保存
    * @param  {String} data     要保存到本地的图片数据
    * @param  {String} filename 文件名
    */
var saveFile = function (data, filename) {
var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
save_link.href = data;
save_link.download = filename;
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
save_link.dispatchEvent(event);
};
const HOST_URL = function () {
return location.protocol + "//" + location.host;
}();
const editor = {
hdjsEditor: null,
cjryEditor: null,
@@ -585,6 +666,8 @@ layout("/layouts/platform.html"){
callback()
};
return {
currentZplb: {},
settingDialogVisible: false,
codeDialogVisible: false,
selected: '',
colorList: ['#081776', '#31cab1', '#e54242', '#ff8939', '#ffb712', '#1dc47b', '#4495f7', '#ff5e8b', '#5d6e7f'],
@@ -606,15 +689,17 @@ layout("/layouts/platform.html"){
},
formData: {
hdtype: 1,
isPushHome: 0,
isIntegral: false,
},
addDialogVisible: false,
editDialogVisible: false,
dialogVisible: false,
formRules: {
hdname: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdjs: [{required: true, message: '必填', trigger: ['blur', 'change']}],
//hdjs: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdcjry: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdjlfs: [{required: true, message: '必填', trigger: ['blur', 'change']}],
//hdjlfs: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdnr: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdlxr: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// hdother: [{required: true, message: '必填', trigger: ['blur', 'change']}],
@@ -628,12 +713,65 @@ layout("/layouts/platform.html"){
return false
},
id: '',
activityGroupList: [],
userScopeDialog: false,
sendMsgUrl: null,
mobileUrl: null
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
},
watch: {
'formData.activityGroupId': {
async handler(newVal, oldVal) {
this.activityGroupList = await getActivityGroup()
this.userScopeDialog = false
},
deep: true
},
},
methods: {
addZp(idx) {
let item = {}
this.initData(item)
this.formData.lbs.splice(idx + 1, 0, {zplbs: [item]})
},
addZplb(lb, idx2) {
let item = {}
this.initData(item)
lb.zplbs.splice(idx2 + 1, 0, item)
},
doSetting() {
this.settingDialogVisible = false
},
openSetting(zplb) {
this.currentZplb = zplb
this.settingDialogVisible = true
},
sendMsg(row) {
const {hdname, hdid} = row
this.mobileUrl = "/platform/staffActivities?client=mobile&id=" + hdid
this.sendMsgUrl = "/platform/hd/jzghd/sczp"
this.$refs.sendMsg.openDialog(row.activitygroupid, "教工作品征集")
},
openUserScope() {
this.userScopeDialog = true
},
changeActivity(val) {
if (val) {
const group = this.activityGroupList.find(v => v.groupId === val)
this.$set(this.formData, "activityGroupName", group.groupName)
} else {
this.$set(this.formData, "activityGroupName", "全部教职工")
}
},
share() {
const id = this.id
$.get("/platform/hd/wmhdMange/findOne", {hdid: id}, function (data) {
@@ -644,20 +782,7 @@ layout("/layouts/platform.html"){
)
},
openCode(id) {
var self = this
self.id = id
self.codeDialogVisible = true
vue.$nextTick(function () {
$("#qrcode").html("")
$("#qrcode").qrcode({ //设置css
render: "canvas", //二维码的生成方式
width: $("#qrcode").width(), //生成二维码的宽度
height: $("#qrcode").width(), //生成二维码的高度
text: APP_DOMAIN + "/platform/staffActivities?id=" + id,
correctLevel: 3 //容错级别,默认为2,最高为3,为了让用户扫码最快,容错级别应当设为最低
});
})
console.log(APP_DOMAIN + "/platform/staffActivities?id=" + id)
this.$refs.openQRCode.openCode("/platform/staffActivities?id=" + id)
},
doSubmit() {
if (!this.formData.hdid) {
@@ -667,7 +792,10 @@ layout("/layouts/platform.html"){
}
},
changeStatus(hdid, flag) {
$.post(base + "/platform/hd/wmhdMange/changeStatus", {hdid: hdid, flag: flag}, function (data) {
$.post(base + "/platform/hd/wmhdMange/changeStatus", {
hdid: hdid,
flag: flag
}, function (data) {
if (data.code == 0) {
vue.$message({
message: data.msg,
@@ -749,7 +877,7 @@ layout("/layouts/platform.html"){
});
},
async openEdit(id) {
this.formData = {};
this.formData = {}
this.fileList = []
this.delFiles = []
@@ -757,8 +885,16 @@ layout("/layouts/platform.html"){
this.$refs["addForm"].resetFields();
const data = await $.get("/platform/hd/wmhdMange/findOne", {hdid: id})
if (data.code == 0) {
if (data.data.dzkssj) {
data.data.time2 = [data.data.dzkssj, data.data.dzjssj]
}
data.data.time = [data.data.hdkssj, data.data.hdjssj]
this.formData = data.data
this.formData.lbs.forEach(item => {
item.zplbs.forEach(o => {
this.initData(o)
})
})
this.$refs.guava.edit()
this.$nextTick(() => {
E = window.wangEditor
@@ -789,7 +925,10 @@ layout("/layouts/platform.html"){
this.changeFormEditorData()
this.formData.hdkssj = this.formData.time[0]
this.formData.hdjssj = this.formData.time[1]
if (this.formData.time2 && this.formData.time2.length > 0) {
this.formData.dzkssj = this.formData.time2[0]
this.formData.dzjssj = this.formData.time2[1]
}
let loading = this.$loading({
lock: true,
text: '数据正在提交中,请稍后...',
@@ -816,7 +955,10 @@ layout("/layouts/platform.html"){
this.changeFormEditorData()
this.formData.hdkssj = this.formData.time[0]
this.formData.hdjssj = this.formData.time[1]
if (this.formData.time2 && this.formData.time2.length > 0) {
this.formData.dzkssj = this.formData.time[0]
this.formData.dzjssj = this.formData.time[1]
}
let loading = this.$loading({
lock: true,
text: '数据正在提交中,请稍后...',
@@ -850,16 +992,21 @@ layout("/layouts/platform.html"){
username: "${@shiro.getPrincipalProperty('username')}",
hdcjsj: moment().format('YYYY-MM-DD'),
lbs: [{zplbs: [{}]}],
};
}
this.initData(this.formData.lbs[0].zplbs[0])
}
} else {
this.formData = {
hdtype: 1,
dzNum: 0,
isPushHome: 0,
isIntegral: false,
hdcolor: this.colorList[0],
username: "${@shiro.getPrincipalProperty('username')}",
hdcjsj: moment().format('YYYY-MM-DD'),
lbs: [{zplbs: [{}]}],
};
}
this.initData(this.formData.lbs[0].zplbs[0])
}
this.$refs.guava.edit()
this.fileList = []
@@ -888,6 +1035,18 @@ layout("/layouts/platform.html"){
}
})
},
initData(zplb) {
this.$set(zplb, 'maxWordCount', zplb.maxWordCount ? zplb.maxWordCount : 100)
this.$set(zplb, 'isUploadPhoto', zplb.isUploadPhoto ? zplb.isUploadPhoto : false)
this.$set(zplb, 'photoType', zplb.photoType ? zplb.photoType : ['jpg'])
this.$set(zplb, 'photoNum', zplb.photoNum ? zplb.photoNum : 1)
this.$set(zplb, 'photoSize', zplb.photoSize ? zplb.photoSize : 2)
this.$set(zplb, 'isUploadOther', zplb.isUploadOther ? zplb.isUploadOther : false)
this.$set(zplb, 'otherType', zplb.otherType ? zplb.otherType : ['mp4', 'docx'])
this.$set(zplb, 'otherFileNum', zplb.otherFileNum ? zplb.otherFileNum : 1)
this.$set(zplb, 'otherSize', zplb.otherSize ? zplb.otherSize : 2)
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
@@ -930,7 +1089,8 @@ layout("/layouts/platform.html"){
}, "json");
},
},
created: function () {
async created() {
this.activityGroupList = await getActivityGroup()
this.pageData();
},
mounted() {
@@ -940,4 +1100,4 @@ layout("/layouts/platform.html"){
<!--#
}
#-->
#-->
@@ -26,18 +26,21 @@ layout("/layouts/platform.html"){
</el-select>
</el-col>
<el-col :span="6">
<el-select v-if="hasSuperAdminOrXghRole" placeholder="所属工会" v-model="pageForm.union"
<el-col :span="6" v-if="hasSuperAdminOrXghRole">
<el-select placeholder="所属工会" v-model="pageForm.union"
style="width: 200px;"
clearable="true"
filterable="true" @change="unionChange">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-select placeholder="所属单位" v-model="pageForm.unit" style="width: 200px;" clearable="true"
<el-select placeholder="所属单位" v-model="pageForm.unit" style="width: 200px;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
<el-option v-for="item in units" :label="item.name"
:value="item.id"></el-option>
</el-select>
</el-col>
@@ -45,50 +48,55 @@ layout("/layouts/platform.html"){
<el-row type="flex" :gutter="20" class="mt20">
<el-col :span="6">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword" @keyup.enter.native="doSearch"
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch"
clearable>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型" style="width: 120px;"
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 120px;"
clearable>
<el-option label="姓名" value="u.username"></el-option>
<el-option label="工资号" value="u.loginname"></el-option>
<el-option label="工号" value="u.loginname"></el-option>
</el-select>
</el-input>
</el-col>
<el-col :span="6">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</el-col>
<el-col :span="12" class="text-right" style="white-space: nowrap;overflow: hidden">
<el-button size="medium" @click="exportExcel(1)">
<i class="el-icon-tickets"></i>
导出获奖人员名单
</el-button>
<el-button size="medium" @click="exportExcel(2)" v-if="hasSuperAdminOrXghRole">
<i class="el-icon-tickets"></i>
导出分工会获奖信息
</el-button>
</el-col>
</el-row>
<!-- <div class="btn-group tool-button ">-->
<!-- <el-cascader placeholder="请选择活动主题"-->
<!-- v-model="pageForm.hdids" :options="hdxxlist"-->
<!-- @change="(v)=>{pageForm.hdid=clone(v).pop()}" clearable></el-cascader>-->
<!-- </div>-->
</el-card>
<el-card class="mt20" shadow="never">
<vi-title2 title="获奖列表">
<template #func>
<el-button size="medium" @click="exportExcel(1)" type="primary">
<i class="el-icon-tickets"></i>
导出获奖人员名单
</el-button>
<el-button size="medium" @click="exportExcel(2)" v-if="hasSuperAdminOrXghRole"
type="primary">
<i class="el-icon-tickets"></i>
导出分工会获奖信息
</el-button>
</template>
</vi-title2>
<el-table :data="tableData">
<el-table-column label="序号" type="index" header-align="center" align="center" width="50">
<el-table-column label="序号" type="index" header-align="center" align="center"
width="50">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="username" label="姓名" header-align="center" align="center"
sortable></el-table-column>
<el-table-column prop="loginname" label="工资号" header-align="center" align="center"></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center" show-overflow-tooltip
<el-table-column prop="loginname" label="工号" header-align="center"
align="center"></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center" show-overflow-tooltip
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
show-overflow-tooltip
sortable></el-table-column>
<el-table-column prop="hjcount" label="获奖次数" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
@@ -118,6 +126,7 @@ layout("/layouts/platform.html"){
hasSuperAdminOrXghRole: "${@shiro.hasAnyRoles('sysadmin','A06')}" === 'true' ? true : false,
pageForm: {
year: new Date().getFullYear() + '',
searchName: "u.username",
pageNumber: 1,
pageSize: 10,
@@ -221,4 +230,4 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
#-->
@@ -2,14 +2,14 @@
<html lang="en" xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<!-- 在 head 标签中添加 meta 标签,并设置 viewport-fit=cover 值 -->
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
name="viewport">
<title></title>
<!-- 引入样式文件 -->
<link rel="stylesheet" href="https://cdn.staticfile.org/vant/2.12.5/index.css">
<link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.2.0/weui.min.css">
<link href="https://cdn.staticfile.org/vant/2.12.5/index.css" rel="stylesheet">
<link href="https://res.wx.qq.com/open/libs/weui/2.2.0/weui.min.css" rel="stylesheet">
<!-- 引入 Vue 和 Vant 的 JS 文件 -->
<script src="https://cdn.staticfile.org/vue/2.6.9/vue.min.js"></script>
@@ -102,32 +102,33 @@
}
</style>
<body>
<div v-clock id="app" v-if="showPage">
<van-nav-bar title="教工作品征集" fixed placeholder safe-area-inset-top @click-left="history.back()"
:left-arrow="leftArrow"></van-nav-bar>
<div id="app" v-clock v-if="showPage">
<van-nav-bar :left-arrow="leftArrow" @click-left="history.back()" fixed placeholder
safe-area-inset-top
title="教工作品征集"></van-nav-bar>
<div>
<van-swipe v-if="boxData.files&&boxData.files.length>0" class="my-swipe" :autoplay="3000"
indicator-color="white">
<van-swipe :autoplay="3000" class="my-swipe" indicator-color="white"
v-if="boxData.files&&boxData.files.length>0">
<van-swipe-item v-for="bgi in boxData.files">
<van-image
width="100%"
height="200px"
fit="cover"
:src="FILE_DOMAIN+'/fileStreamPreview?id='+bgi.id"
fit="cover"
height="200px"
width="100%"
></van-image>
</van-swipe-item>
</van-swipe>
<van-image
fit="cover"
height="200px"
src="***"
v-else
width="100%"
height="200px"
fit="cover"
src="***"
>
<template v-slot:error>封面图片</template>
</van-image>
</div>
<div v-if="active==0" class="page-v">
<div class="page-v" v-if="active==0">
<div class="detail-v">
<div class="title-v p15">
<h3 :style="'color: '+boxData.hdcolor">活动介绍</h3>
@@ -179,28 +180,29 @@
<div class="van-hairline--top"></div>
<br/>
</div>
<div class="p15" style="line-height:24pt;" v-if="!isNull(boxData.hdother.replace(/<.*?>/g,''))">
<div class="p15" style="line-height:24pt;"
v-if="!isNull(boxData.hdother.replace(/<.*?>/g,''))">
<div v-html="boxData.hdother"></div>
</div>
</div>
</div>
<div v-if="active==1" class="page-v">
<div class="page-v" v-if="active==1">
<div class="detail-v" style="margin-top: 0">
<div class="weui-msg" v-if="showMsg">
<div class="weui-msg__icon-area">
<van-circle
layer-color="rgb(240,240,240)"
:clockwise="false"
:rate="percent"
:text="percent+' %'"
color="#07c160"
layer-color="rgb(240,240,240)"
stroke-width="50"
v-if="showPlan"
v-model="percent"
:rate="percent"
:clockwise="false"
:text="percent+' %'"
></van-circle>
<span v-if="showPlan==false">
<i v-if="flag" class="weui-icon-success weui-icon_msg"></i>
<i v-if="!flag" class="weui-icon-warn weui-icon_msg"></i>
<i class="weui-icon-success weui-icon_msg" v-if="flag"></i>
<i class="weui-icon-warn weui-icon_msg" v-if="!flag"></i>
</span>
</div>
@@ -212,55 +214,58 @@
</div>
<div class="weui-msg__opr-area">
<p class="weui-btn-area">
<a v-if="!showPlan" @click="showMsg=false"
:class="flag?'weui-btn weui-btn_primary':'weui-btn weui-btn_warn'">{{flag ? '确定' : '返回'}}</a>
<a :class="flag?'weui-btn weui-btn_primary':'weui-btn weui-btn_warn'"
@click="showMsg=false"
v-if="!showPlan">{{flag ? '确定' : '返回'}}</a>
</p>
</div>
</div>
<div class="form-v" v-else>
<van-form @submit="doSubmit">
<van-form>
<div style="width: 100%;padding: 16px 0;">
<h2 class="van-doc-demo-block__title" :style="'font-weight: bolder;color: '+boxData.hdcolor">
<h2 :style="'font-weight: bolder;color: '+boxData.hdcolor"
class="van-doc-demo-block__title">
基本信息</h2>
</div>
<van-cell-group>
<van-field
v-model="formData.loginname"
label="工号"
name="工号"
placeholder="工号"
readonly
name="工资号"
label="工资号"
placeholder="工资号"
v-model="formData.loginname"
></van-field>
<van-field
label="姓&emsp;&emsp;名"
name="姓名"
readonly
v-model="formData.username"
name="姓名"
label="姓&emsp;&emsp;名"
></van-field>
<van-field
label="所属单位"
name="所属单位"
readonly
v-model="formData.unitname"
name="所属单位"
label="所属单位"
></van-field>
<van-field
required
v-model="formData.mobile"
name="mobile"
label="手机号码" type="tel"
placeholder="手机号码"
:rules="[{ required: true, message: '请填写手机号码' }]"
label="手机号码"
name="mobile"
placeholder="手机号码" required
type="tel"
v-model="formData.mobile"
></van-field>
</van-cell-group>
</van-cell-group>
<div style="width: 100%;padding: 16px 0;">
<span class="van-doc-demo-block__title" :style="'font-weight: bolder;color: '+boxData.hdcolor">
<span :style="'font-weight: bolder;color: '+boxData.hdcolor"
class="van-doc-demo-block__title">
作品信息</span>
<p class="van-doc-demo-block__title" style="margin-top: 5px;color: red">
(如同时参加以下多个活动,或有多个主题,请分别提交)</p>
</div>
<van-tabs v-model="formData.hdlb_i" :color="boxData.hdcolor" type="line">
<van-tab v-for="lb,i in boxData.lbs" :name="i" :title="lb.lname">
<van-tabs :color="boxData.hdcolor" type="card" v-model="formData.hdlb_i">
<van-tab :name="i" :title="lb.lname" v-for="lb,i in boxData.lbs">
<div v-if="formData.hdlb_i==i">
<!-- <van-field style="padding-top: 30px" maxlength="15"
:rules="[{ required: true, message: '请填写作品主题' }]"
@@ -269,133 +274,182 @@
show-word-limit
label="作品主题" placeholder="主题"></van-field>-->
<van-field
v-if="lb.zplbs&&lb.zplbs.length>0"
required
readonly
clickable
name="picker"
:rules="[{ required: true, message: '请选择类别' }]"
:value="fd[i].zplb_name"
label="作品类别"
placeholder="点击选择作品类别"
@click="showPicker = true"
:rules="[{ required: true, message: '请选择作品类别' }]"
clickable
label="类别"
name="picker"
placeholder="点击选择类别"
readonly
required
v-if="lb.zplbs&&lb.zplbs.length>0"
></van-field>
<van-popup v-model="showPicker" position="bottom">
<van-popup position="bottom" v-model="showPicker">
<van-picker
:columns="lb.zplbs"
@cancel="showPicker = false"
@confirm="(val) => {zplbClick(val, fd, i)}"
show-toolbar
value-key="zname"
:columns="lb.zplbs"
@confirm="function(val){fd[i].zplb=val.zid;fd[i].zplb_name=val.zname;showPicker=false}"
@cancel="showPicker = false"
></van-picker>
</van-popup>
<van-field
:rules="[{ required: true, message: '请填写标题' }]"
label="标题"
name="zpmc"
placeholder="请填写标题"
required
v-model="fd[i].zpmc"
></van-field>
<van-field type="textarea" show-word-limit maxlength="100" autosize
v-model="fd[i].zpms"
label="作品介绍"
placeholder="介绍"></van-field>
<van-field type="digit" show-word-limit maxlength="10" autosize
v-model="fd[i].step_count"
v-if="lb.lname==='健步走'"
label="健步走步数"
<van-field
:maxlength="chooseLb.maxWordCount ? chooseLb.maxWordCount : 100"
:rules="[{ required: true, message: '请填写创作说明' }]" autosize
label="创作说明"
placeholder="请填写创作说明"
required
show-word-limit
type="textarea"
v-model="fd[i].zpms"></van-field>
<van-field :rules="[{ required: true, message: '请填写健步走步数' }]"
autosize label="健步走步数" maxlength="10"
placeholder="健步走步数"
:rules="[{ required: true, message: '请填写健步走步数' }]"></van-field>
show-word-limit
type="digit"
v-if="lb.lname==='健步走'"
v-model="fd[i].step_count"></van-field>
<van-field label="图&emsp;&emsp;片" disabled placeholder="(左滑删除单个文件)"
style="border: none;"
input-align="right" v-if="lb.lname==='健步走'"></van-field>
<van-swipe-cell v-for="img,idx in fd[i].imgList"
style="border: none;padding-top: 20px;" v-if="lb.lname==='健步走'">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
width="100%"
height="25vw"
fit="cover"
:src="img.content"
></van-image>
</van-col>
</van-row>
<template v-if="chooseLb.isUploadPhoto === true">
<van-field input-align="right" label="图&emsp;&emsp;片"
placeholder="(左滑删除单个文件)"
readonly required
style="border: none;"></van-field>
<van-swipe-cell style="border: none;padding-top: 20px;"
v-for="img,idx in fd[i].imgList">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
:src="img.content"
fit="cover"
height="25vw"
width="100%"
></van-image>
</van-col>
</van-row>
<van-button
native-type="button"
@click="imgDelete(idx,i,img.filepath)"
slot="right"
square
text="删除"
type="danger"
class="delete-button"
></van-button>
</van-swipe-cell>
<van-field v-if="lb.lname==='健步走'">
<template #input>
<van-uploader multiple :preview-image="false" :before-read="beforeReadImg"
accept="image/*"
:max-count="5"
v-model="fd[i].imgList">
</van-uploader>
</template>
</van-field>
<van-field label-width="150" label="音/视频、文档" disabled style="border: none;"
input-align="right" v-if="lb.lname!=='健步走'"></van-field>
<van-swipe-cell v-for="video,idx in fd[i].videoList"
style="border: none;padding-top: 20px;" v-if="lb.lname!=='健步走'">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
width="100%"
height="25vw"
fit="cover"
src="1"
>
<template v-slot:error>
<i class="van-icon van-icon-description van-uploader__file-icon">
<!----></i>
<div class="van-uploader__file-name van-ellipsis">
<van-button
@click="imgDelete(idx,i,img.filepath)"
class="delete-button"
native-type="button"
slot="right"
square
text="删除"
type="danger"
></van-button>
</van-swipe-cell>
<van-field>
<template #input>
<van-uploader :before-read="beforeReadImg"
:max-count="chooseLb.photoNum"
:max-size="chooseLb.photoSize * 1048576"
:preview-image="false"
@oversize="$toast('图片大小不能超过' + chooseLb.photoSize + 'M')"
accept="image/*"
multiple
v-model="fd[i].imgList">
</van-uploader>
</template>
</van-field>
<div style="margin-top: 10px;padding-left: 20px;font-size: 12px;color: rgb(160,160,160)">
注意:图片最多{{ chooseLb.photoNum }}张,每张不超过{{ chooseLb.photoSize
}}M,格式为{{chooseLb.photoType.toString()}}。
</div>
</template>
{{video.filename ? video.filename : video.file.name }}
</div>
</template>
</van-image>
</van-col>
<!-- <van-col :span="18">
<van-field style="width: 100%;padding-right: 0;" autosize v-model="video.ms"
type="textarea" rows="2"
maxlength="50"
:show-word-limit="!isNull(video.ms)"
placeholder="请输入描述信息"></van-field>
</van-col>-->
</van-row>
<template v-if="chooseLb.isUploadOther === true">
<van-field input-align="right" label="音/视频、文档" label-width="150"
readonly required
style="border: none;"></van-field>
<van-swipe-cell style="border: none;padding-top: 20px;"
v-for="(video,idx) in fd[i].videoList">
<van-row style="padding: 0 15px">
<van-col :span="6">
<van-image
fit="cover"
height="25vw"
src="1"
width="100%"
>
<template v-slot:error>
<i class="van-icon van-icon-description van-uploader__file-icon">
<!----></i>
<div class="van-uploader__file-name van-ellipsis">
{{video.filename ? video.filename : video.file.name
}}
</div>
</template>
</van-image>
</van-col>
</van-row>
<van-button
@click="videoDelete(idx,i,video.filepath)"
class="delete-button"
native-type="button"
slot="right"
square
text="删除"
type="danger"
></van-button>
</van-swipe-cell>
<van-field v-if="lb.lname!=='健步走'">
<template #input>
<van-uploader :before-read="beforeReadVideo"
:max-count="chooseLb.otherFileNum"
:max-size="chooseLb.otherSize * 1048576"
:preview-image="false"
@oversize="$toast('文件大小不能超过' + chooseLb.otherSize + 'M')"
accept="*"
result-type="file"
v-model="fd[i].videoList"></van-uploader>
</template>
</van-field>
<div style="margin-top: 10px;padding-left: 20px;font-size: 12px;color: rgb(160,160,160)">
注意:文件最多{{ chooseLb.otherFileNum
}}个,每个不超过{{ chooseLb.otherSize
}}M,格式为{{chooseLb.otherType.toString()}}。
</div>
</template>
<van-button
native-type="button"
@click="videoDelete(idx,i,video.filepath)"
slot="right"
square
text="删除"
type="danger"
class="delete-button"
></van-button>
</van-swipe-cell>
<van-field v-if="lb.lname!=='健步走'">
<template #input>
<van-uploader :preview-image="false" result-type="file"
@oversize="this.$toast.fail('文件大小不能超过200M!')"
:max-size="209715200"
:before-read="beforeReadVideo" accept="*" :max-count="2"
v-model="fd[i].videoList"></van-uploader>
</template>
</van-field>
</div>
</van-tab>
</van-tabs>
<span style="padding-left: 15px;font-size: 12px;color: rgb(160,160,160)">(注意:图片最多5张,视频最大200M。)</span>
<div style="margin: 16px;">
<van-button :disabled="subDis" round block :color="boxData.hdcolor" type="info"
native-type="submit">
提交
</van-button>
<van-row gutter="20">
<van-col span="12">
<van-button :color="boxData.hdcolor" :disabled="subDis"
@click="doSubmit(false)" block
plain
round
type="info">
保存
</van-button>
</van-col>
<van-col span="12">
<van-button :color="boxData.hdcolor" :disabled="subDis"
@click="doSubmit(true)" block
round
type="info">
提交
</van-button>
</van-col>
</van-row>
</div>
</van-form>
</div>
@@ -404,13 +458,14 @@
<van-tabbar
:active-color="boxData.hdcolor"
@change="activeChange"
inactive-color="#000"
style="max-width: 600px;position: fixed;left: 0;bottom: 0;right: 0;margin: auto"
v-model="active"
:active-color="boxData.hdcolor"
inactive-color="#000"
>
<van-tabbar-item icon="label-o">介绍</van-tabbar-item>
<van-tabbar-item icon="edit">报名</van-tabbar-item>
<van-tabbar-item icon="edit">参加活动</van-tabbar-item>
</van-tabbar>
<van-number-keyboard safe-area-inset-bottom/>
</div>
@@ -478,11 +533,24 @@
},
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
doctype: ['doc', 'docx', 'txt'],
doctype: ['doc', 'docx', 'xlsx', 'xls', 'txt'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg', 'quicktime'],
chooseLb: {},
}
},
methods: {
zplbClick(val, fd, i) {
this.chooseLb = val
fd[i].zplb = val.zid;
fd[i].zplb_name = val.zname;
this.showPicker = false
},
activeChange() {
if (this.subDis) {
this.active = 0
this.$toast.fail("不在活动时间范围内!");
}
},
imgDelete(idx, i, filepath) {
this.fd[i].imgList.splice(idx, 1)
this.readytodelfile.push(filepath);
@@ -499,7 +567,7 @@
,
getPlaceholder(formData, key) {
if (this.isNull(formData.userid)) {
return "输入工资号后自动匹配"
return "输入工号后自动匹配"
} else {
if (this.isNull(formData[key])) {
return '暂无'
@@ -517,22 +585,36 @@
this.$set(this.formData, 'username', userName)
this.$set(this.formData, 'unitname', unitName)
this.$set(this.formData, 'userid', userId)
this.$set(this.formData, 'mobile', "${@shiro.getPrincipalProperty('mobile')}")
},
async doSubmit() {
async doSubmit(flag) {
if (this.isNull(this.formData.userid)) {
this.$toast.fail("请正确填写您的工资号!")
this.$toast.fail("请正确填写您的工号!")
return
}
const i = this.formData.hdlb_i
if (this.fd[i].videoList.length == 0 && this.fd[i].imgList.length == 0) {
this.$toast.fail("请您选择要上传的作品!")
return
if (flag === true) {
if (this.fd[i].imgList.length === 0) {
this.$toast.fail("请您选择要上传的作品!")
return
}
if (!this.fd[i].zplb || !this.fd[i].zpmc || !this.fd[i].zpms) {
this.$toast.fail("请您填写完整再提交!")
return
}
/* if (this.chooseLb.isUploadPhoto === true || this.chooseLb.isUploadOther === true) {
if (this.fd[i].videoList.length == 0 || this.fd[i].imgList.length == 0) {
this.$toast.fail("请您选择要上传的作品!")
return
}
}*/
}
const msg = '您当前选择的是“' + this.boxData.lbs[i].lname + '”,是否确认上传?' + (flag ? '上传后您将不能对已上传的作品进行更改' : '保存后如需提交请到我的作品进行提交')
const confirm = await this.$dialog.confirm({
title: '提醒',
message: '您当前选择的是“' + this.boxData.lbs[i].lname + '”,是否确认上传?上传后您将不能对已上传的作品进行更改'
message: msg
})
if (confirm === "confirm") {
setTimeout(() => {
@@ -543,7 +625,8 @@
let formData1 = {}
let formData2 = new FormData();
formData1.flag = flag
formData2.append("flag", flag)
if (this.formData.id) {
this.$set(formData1, "id", getQueryVariable("zpid"))
@@ -551,32 +634,34 @@
this.$set(formData1, "hdsbrid", this.isNull(this.formData.userid) ? '' : this.formData.userid)
this.$set(formData1, "mobile", this.isNull(this.formData.mobile) ? '' : this.formData.mobile)
this.$set(formData1, "step_count", this.isNull(this.fd[i].step_count) ? '' : this.fd[i].step_count)
this.$set(formData1, "zpmc", this.isNull(this.fd[i].zpmc) ? '' : this.fd[i].zpmc)
this.$set(formData1, "hdzplx", this.isNull(this.boxData.lbs[i].lid) ? '' : this.boxData.lbs[i].lid)
this.$set(formData1, "hdzplx2", this.isNull(this.fd[i].zplb) ? '' : this.fd[i].zplb)
this.$set(formData1, "hdsbzpzt", this.isNull(this.fd[i].zpzt) ? '' : this.fd[i].zpzt)
this.$set(formData1, "hdsbzpms", this.isNull(this.fd[i].zpms) ? '' : this.fd[i].zpms)
this.$set(formData1, "hdsbsj", moment().format('YYYY-MM-DD HH:mm:ss'))
//this.$set(formData1, "hdsbsj", moment().format('YYYY-MM-DD HH:mm:ss'))
} else {
formData2.append("hdid", getQueryVariable("id"))
formData2.append("hdsbrid", this.isNull(this.formData.userid) ? '' : this.formData.userid);
formData2.append("mobile", this.isNull(this.formData.mobile) ? '' : this.formData.mobile);
formData2.append("step_count", this.isNull(this.fd[i].step_count) ? '' : this.fd[i].step_count);
formData2.append("zpmc", this.isNull(this.fd[i].zpmc) ? '' : this.fd[i].zpmc);
formData2.append("hdzplx", this.isNull(this.boxData.lbs[i].lid) ? '' : this.boxData.lbs[i].lid)
formData2.append("hdzplx2", this.isNull(this.fd[i].zplb) ? '' : this.fd[i].zplb);
formData2.append("hdsbzpzt", this.isNull(this.fd[i].zpzt) ? '' : this.fd[i].zpzt);
formData2.append("hdsbzpms", this.isNull(this.fd[i].zpms) ? '' : this.fd[i].zpms);
formData2.append("hdsbsj", moment().format('YYYY-MM-DD HH:mm:ss'));
this.fd[i].imgList.forEach(val => {
formData2.append("files", val.file, this.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
this.fd[i].videoList.forEach(val => {
formData2.append("files", val.file, this.isNull(val.ms) ? val.file.name : val.ms + getSuffix(val.file.name));
});
})
formData2.append("hdsbsj", moment().format('YYYY-MM-DD HH:mm:ss'));
}
if (!this.isNull(this.formData.id)) {
formData2.append("data", JSON.stringify(formData1));
formData2.append("flag", flag);
formData2.append("readytodelfile", JSON.stringify(this.readytodelfile));
this.fd[i].imgList.forEach(val => {
formData2.append("file", val.file);
@@ -604,6 +689,7 @@
vue.fd[i].zpzt = ''
vue.fd[i].zpms = ''
vue.fd[i].step_count = ''
vue.fd[i].zpmc = ''
vue.fd[i].sbsj = ''
vue.fd[i].imgList = []
vue.fd[i].videoList = []
@@ -621,7 +707,7 @@
this.flag = false
}
vue.showPlan = false
window.history.back()
location.href = '/mobile/wmhd/list'
},
error: function (data) {
vue.msg = '<p class="weui-msg__desc">非常抱歉对您造成的不便!<br/>请联系系统管理员进行修复!</p>'
@@ -652,6 +738,7 @@
vue.fd[i].zpzt = ''
vue.fd[i].zpms = ''
vue.fd[i].step_count = ''
vue.fd[i].zpmc = ''
vue.fd[i].sbsj = ''
vue.fd[i].imgList = []
vue.fd[i].videoList = []
@@ -686,22 +773,32 @@
,
// 返回布尔值
beforeReadImg: function (file) {
return true;
var suffix = getSuffix(file.name)
if (suffix == null) {
this.$toast('获取不到后缀名!')
return false
}
const suf = file.name.split('.').pop().toLowerCase()
if (this.chooseLb.photoType.indexOf(suf) === -1) {
this.$toast('支持的图片类型:' + this.chooseLb.photoType.toString())
return false
}
return true
}
,
// 返回布尔值
beforeReadVideo: function (file, detail) {
var suffix = getSuffix(file.name)
if (suffix == null) {
this.$toast('获取不到后缀名!');
return false;
this.$toast('获取不到后缀名!')
return false
}
// var type = suffix.toString().substring(suffix.lastIndexOf(".") + 2)
// if (this.videotype.indexOf(type) == -1 && this.audiotype.indexOf(type) == -1 && this.doctype.indexOf(type) == -1) {
// this.$toast('不支持的文件类型!');
// return false;
// }
return true;
const suf = file.name.split('.').pop().toLowerCase()
if (this.chooseLb.otherType.indexOf(suf) === -1) {
this.$toast('支持的文件类型:' + this.chooseLb.otherType.toString())
return false
}
return true
}
,
},
@@ -752,11 +849,15 @@
this.$set(this.formData, "mobile", refs[0].mobile)
this.$set(this.formData, "hdlb_i", refs[0].llocation - 1)
this.$set(this.fd[refs[0].llocation - 1], "step_count", this.isNull(refs[0].step_count) ? "" : refs[0].step_count)
this.$set(this.fd[refs[0].llocation - 1], "zpmc", this.isNull(refs[0].zpmc) ? "" : refs[0].zpmc)
this.$set(this.boxData.lbs[refs[0].llocation - 1], "lid", refs[0].hdzplx)
this.$set(this.fd[refs[0].llocation - 1], "zplb", refs[0].hdzplx2)
this.$set(this.fd[refs[0].llocation - 1], "zplb_name", refs[0].zname)
this.$set(this.fd[refs[0].llocation - 1], "zpzt", refs[0].hdsbzpzt)
this.$set(this.fd[refs[0].llocation - 1], "hdsbsj", refs[0].hdsbsj)
this.$set(this.fd[refs[0].llocation - 1], "zpms", refs[0].hdsbzpms)
const o = this.boxData.lbs[refs[0].llocation - 1].zplbs.find(o => o.zid === refs[0].hdzplx2)
this.chooseLb = o !== undefined ? o : {}
data.forEach((v, i) => {
v.filename = v.filename
v.fjurl = v.filepath
@@ -764,10 +865,13 @@
v.content = FILE_DOMAIN + "/fileStreamPreview?id=" + v.id
const filetype = v.filename.substring(v.filename.lastIndexOf(".") + 1)
const aa = this.audiotype.concat(this.videotype)
const bb = this.doctype.concat(this.doctype)
if (this.imgtype.indexOf(filetype) > -1) {
this.fd[refs[0].llocation - 1].imgList.push(v)
} else if (aa.indexOf(filetype) > -1) {
this.fd[refs[0].llocation - 1].videoList.push(v);
} else if (bb.indexOf(filetype) > -1) {
this.fd[refs[0].llocation - 1].videoList.push(v);
}
})
@@ -794,4 +898,4 @@
}
</script>
</body>
</html>
</html>
@@ -228,10 +228,10 @@
@input="doInput"
required
v-model="formData.loginname"
name="工资号"
name="工号"
label="工&emsp;&emsp;号"
placeholder="工资号"
:rules="[{ required: true, message: '请填写工资号' }]"
placeholder="工号"
:rules="[{ required: true, message: '请填写工号' }]"
></van-field>
<van-field
disabled
@@ -609,7 +609,7 @@
},
getPlaceholder: function (formData, key) {
if (vue.isNull(formData.userid)) {
return "输入工资号后自动匹配"
return "输入工号后自动匹配"
} else {
if (vue.isNull(formData[key])) {
return '暂无'
@@ -633,7 +633,7 @@
},
doSubmit: function () {
if (vue.isNull(vue.formData.userid)) {
vue.$toast.fail("请正确填写您的工资号!")
vue.$toast.fail("请正确填写您的工号!")
return
}
if (vue.hdzplx == 1 && vue.formData.videoList.length == 0 && vue.formData.imgList.length == 0) {
@@ -826,4 +826,4 @@
})
</script>
</body>
</html>
</html>
@@ -214,10 +214,10 @@
@input="doInput"
required
v-model="formData.loginname"
name="工资号"
name="工号"
label="工&emsp;&emsp;号"
placeholder="工资号"
:rules="[{ required: true, message: '请填写工资号' }]"
placeholder="工号"
:rules="[{ required: true, message: '请填写工号' }]"
></van-field>
<van-field
disabled
@@ -463,7 +463,7 @@
},
getPlaceholder: function (formData, key) {
if (vue.isNull(formData.userid)) {
return "输入工资号后自动匹配"
return "输入工号后自动匹配"
} else {
if (vue.isNull(formData[key])) {
return '暂无'
@@ -487,7 +487,7 @@
},
doSubmit: function () {
if (vue.isNull(vue.formData.userid)) {
vue.$toast.fail("请正确填写您的工资号!")
vue.$toast.fail("请正确填写您的工号!")
return
}
if (vue.hdzplx == 1 && vue.formData.videoList.length == 0 && vue.formData.imgList.length == 0) {
@@ -553,4 +553,4 @@
})
</script>
</body>
</html>
</html>
@@ -1,7 +1,7 @@
<!--#
layout("/layouts/platform.html"){
#-->
<link rel="stylesheet" href="${base!}/assets/platform/plugins/video/css/video-js.min.css">
<link href="${base!}/assets/platform/plugins/video/css/video-js.min.css" rel="stylesheet">
<script src="${base!}/assets/platform/plugins/video/js/video.min.js"></script>
<style>
@@ -151,255 +151,220 @@ layout("/layouts/platform.html"){
<guava ref="guava">
<template>
<el-card shadow="never">
<el-row type="flex" :gutter="20">
<el-col :span="22">
<el-row type="flex" :gutter="20">
<el-col :span="6">
<!-- <el-cascader placeholder="请选择活动主题"-->
<!-- v-model="pageForm.hdids" :options="hdxxlist" @change="hdchange"-->
<!-- clearable></el-cascader>-->
<el-date-picker v-model="pageForm.year"
placeholder="年度"
type="year"
@change="yearChange"
value-format="yyyy"></el-date-picker>
</el-col>
<el-col :span="6">
<el-select v-model="pageForm.hdid" @change="hdchange" clearable placeholder="请选择活动主题">
<el-option v-for="i in hdxxlist"
:key="i.value"
:label="i.label"
:value="i.value"></el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-select v-model="pageForm.hdlb" placeholder="请选择活动类型" clearable @change="hdlbchange">
<el-option v-for="o in hdlblist" :label="o.lname" :value="o.lid"></el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-select v-model="pageForm.zplb" placeholder="请选择作品类型" clearable>
<el-option v-for="o in hdzplblist" :label="o.zname" :value="o.zid"></el-option>
</el-select>
</el-col>
</el-row>
<el-row type="flex" :gutter="20" class="mt20">
<el-col :span="6">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch"
clearable>
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 120px;"
clearable>
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker @change="yearChange" placeholder="年度"
style="width: 100%"
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 @change="hdchange" clearable placeholder="请选择活动主题"
style="width: 100%" v-model="pageForm.hdid">
<el-option :key="i.value"
:label="i.label"
:value="i.value"
v-for="i in hdxxlist"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">活动类别:</div>
<div class="search-item-option">
<el-select @change="hdlbchange" clearable placeholder="请选择活动类别"
style="width: 100%" v-model="pageForm.hdlb">
<el-option :label="o.lname" :value="o.lid"
v-for="o in hdlblist"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">作品类别:</div>
<div class="search-item-option">
<el-select clearable placeholder="请选择作品类别" style="width: 100%"
v-model="pageForm.zplb">
<el-option :label="o.zname" :value="o.zid"
v-for="o in hdzplblist"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">是否优秀:</div>
<div class="search-item-option">
<el-radio-group v-model="pageForm.isExcellent">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="1">优秀</el-radio-button>
<el-radio-button label="0">普通</el-radio-button>
</el-radio-group>
</div>
</div>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">姓名/工号:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable
placeholder="请输入内容"
v-model="pageForm.searchKeyword">
<el-select clearable placeholder="查询类型"
slot="prepend"
style="width: 100px;"
v-model="pageForm.searchName">
<el-option label="姓名" value="u.username"></el-option>
<el-option label="工资号" value="u.loginname"></el-option>
<el-option label="工号" value="u.loginname"></el-option>
</el-select>
</el-input>
</el-col>
<el-col :span="6">
<el-select v-if="hasSuperAdminOrXghRole" placeholder="所属工会" v-model="pageForm.union"
style="width: 200px;" clearable="true"
filterable="true" @change="unionChange">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-select placeholder="所属单位" v-model="pageForm.unit" style="width: 200px;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-col>
<el-col :span="6">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</el-col>
</el-row>
</el-col>
<el-col :span="2">
<div class="">
<el-button size="medium" @click="exportExcel">
<i class="el-icon-tickets"></i>
导出Excel
</el-button>
</div>
</div>
</el-col>
</el-row>
<div class="search-item">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="unionChange" clearable filterable="true"
placeholder="所属工会"
style="width: 100%" v-model="pageForm.union">
<el-option :label="item.unionname" :value="item.id"
v-for="item in unions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select clearable="true" filterable placeholder="所属单位"
style="width: 100%"
style="width: 200px;"
v-model="pageForm.unit">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</div>
</div>
</template>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<el-table :data="tableData">
<el-table-column label="序号" type="index" header-align="center" align="center" width="50">
<el-card class="mt20" shadow="never">
<vi-title2 title="作品列表">
<template #func>
<el-button @click="exportExcel" size="small" type="primary">
<i class="el-icon-tickets"></i>
导出Excel
</el-button>
<el-button @click="exportWork" size="small" type="primary">
<i class="el-icon-tickets"></i>
导出作品
</el-button>
</template>
</vi-title2>
<el-table :data="tableData" @sort-change="pageOrder">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="50">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="username" label="姓名" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="姓名" prop="username"
sortable></el-table-column>
<el-table-column prop="loginname" label="工资号" header-align="center"
align="center"></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center" sortable
show-overflow-tooltip></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center" sortable
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdlbname" label="活动类别" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="工号"
prop="loginname"></el-table-column>
<el-table-column align="center" header-align="center" label="单位" prop="dwname"
show-overflow-tooltip
sortable></el-table-column>
<!-- <el-table-column prop="zplbname" label="作品类别" header-align="center" align="center"
sortable></el-table-column>-->
<!-- <el-table-column prop="hdsbzpzt" label="主题" header-align="center" align="center"></el-table-column>-->
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center">
<template scope="scope">
{{scope.row.hdsbsj|date}}
</template>
<el-table-column align="center" header-align="center" label="分工会" prop="ghname"
show-overflow-tooltip
sortable></el-table-column><!--
<el-table-column align="center" header-align="center" label="活动主题"
prop="hdname"></el-table-column>-->
<el-table-column align="center" header-align="center" label="活动类别"
prop="hdlbname"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="作品类别"
prop="zplbname"
sortable></el-table-column>
<el-table-column align="center" header-align="center" label="上传时间"
prop="hdsbsj"
show-overflow-tooltip>
</el-table-column>
<!-- <el-table-column prop="mobile" label="手机号" header-align="center" align="center"></el-table-column>-->
<el-table-column align="center" header-align="center" label="操作" width="200">
<el-table-column align="center" header-align="center" label="是否优秀作品"
prop="isExcellent"
show-overflow-tooltip>
<template slot-scope="{row}">
{{row.isExcellent?'优秀':'普通'}}
</template>
</el-table-column><!--
<el-table-column align="center" header-align="center" label="点赞次数(次)"
prop="dz_num">
</el-table-column>--><!--
<el-table-column align="center" prop="auditState" header-align="center"
label="审核状态" sortable>
<template scope="scope">
<span :style="'color:'+scope.row.statecolor">{{scope.row.statename}}</span>
</template>
</el-table-column>-->
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-scope="scope">
<el-button @click="viewInfo(scope)" size="mini" type="primary">查看</el-button>
<el-button @click="doDelete(scope.row.id)" size="mini" type="danger">删除</el-button>
<el-button @click="viewInfo(scope)" size="mini" type="primary">查看
</el-button>
<el-button @click="doExcellent(scope.row.id)" size="mini" type="primary"
v-if="!scope.row.isExcellent">设为优秀
</el-button>
<el-button @click="cancelExcellent(scope.row.id)" size="mini"
type="danger"
v-if="scope.row.isExcellent">
取消优秀
</el-button>
<el-button @click="doDelete(scope.row.id)" size="mini" type="danger">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
</template>
<template #view>
<el-form label-suffix=":" label-position="left" style="padding: 40px" label-width="110px">
<el-form-item class="item-center"></el-form-item>
<el-row gutter="60">
<vi-title title="基础信息"></vi-title>
<el-col :span="12">
<el-form-item label="姓名">{{viewData.username}}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工资号">{{viewData.loginname}}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位">{{viewData.dwname}}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工会">{{viewData.ghname}}</el-form-item>
</el-col>
</el-row>
<el-row gutter="60">
<vi-title title="作品信息"></vi-title>
<el-col :span="12">
<el-form-item label="作品主题">{{viewData.hdsbzpzt}}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动类别">{{viewData.hdlbname}}</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="作品类别">{{viewData.zplbname}}</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="简介">{{viewData.hdsbzpms}}</el-form-item>
</el-col>
</el-row>
<el-row gutter="60">
<vi-title title="照片"></vi-title>
<file-upload v-if="img2List&&img2List.length>0" view :files="img2List"></file-upload>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片。
</div>
</el-row>
<el-row gutter="60">
<vi-title title="视频"></vi-title>
<div style="text-align: left;" v-if="videoList.length>0">
<div v-for="item in videoList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab">
<div class="video-toggle-i"
@click="playVideo(APP_DOMAIN + '/file_server/fileStreamPreview?id=' + item.id)">
<i class="el-icon-video-camera-solid"></i>
<i class="el-icon-video-play"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="location.href='/file_server/download?filepath=' + item.filepath + '&filename=' + item.filename">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有视频。
</div>
</el-ol>
</el-row>
<el-row gutter="60">
<vi-title title="音频"></vi-title>
<div style="text-align: left;" v-if="audioList.length>0">
<div v-for="item in audioList">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
<source :src="'${AppFileDomain!}'+item.filepath"/>
</audio>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div>
</el-row>
<el-row gutter="60">
<vi-title title="文档"></vi-title>
<div style="text-align: left;" v-if="docList.length>0">
<div v-for="item in docList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab" style="background-color: #f6f6f6">
<div class="video-toggle-i" @click="dd3s.preview(item.filepath,item.id)">
<i class="el-icon-document"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="dd3s.download(item.filepath,item.filename)">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档。
</div>
</el-row>
</el-form>
<info @playvideo="playvideo" ref="info"></info>
</template>
</guava>
<el-dialog :visible.sync="fileDialogVisible" class="filedialog" @close="filedialogClose"
:close-on-click-modal="false">
<el-dialog :close-on-click-modal="false" :visible.sync="fileDialogVisible"
@close="filedialogClose"
class="filedialog">
<div id="videoContainer"></div>
</el-dialog>
@@ -413,7 +378,7 @@ layout("/layouts/platform.html"){
return {
units: [],
unions: [],
hasSuperAdminOrXghRole: "${@shiro.hasAnyRoles('sysadmin','A06')}" === 'true' ? true : false,
hasSuperAdminOrXghRole: "${@shiro.hasAnyRoles('sysadmin','A06','H10')}" === 'true' ? true : false,
audio: {
name: '东西(Cover:林俊呈)',
artist: '纳豆',
@@ -423,6 +388,7 @@ layout("/layouts/platform.html"){
},
tableData: [],
pageForm: {
year: new Date().getFullYear() + '',
searchName: "u.username",
pageNumber: 1,
pageSize: 10,
@@ -430,6 +396,10 @@ layout("/layouts/platform.html"){
hdid: '',
hdlb: '',
zplb: '',
stateId: '',
unit: '',
union: '',
isExcellent: '',
},
hdxxlist: [],
videoSrc: '',
@@ -450,19 +420,41 @@ layout("/layouts/platform.html"){
ckusername: '',//当前查看的人的姓名 下载的时候一起传过去,
hdlblist: [],
hdzplblist: [],
yearActivityList: []
yearActivityList: [],
auditStateList: [],
}
},
watch: {
'pageForm.hdid'(val) {
this.$set(this.pageForm, "hdlb", null)
this.$set(this.pageForm, "zplb", null)
this.$set(this.pageForm, "hdlb", '')
this.$set(this.pageForm, "zplb", '')
},
'pageForm.hdlb'(val) {
this.$set(this.pageForm, "zplb", null)
this.$set(this.pageForm, "zplb", '')
}
},
components: {
'info': httpVueLoader('/components/hd/hdwmInfo.vue'),
},
methods: {
async doExcellent(id) {
const resp = await $.post("/platform/hd/wmhd/doExcellent", {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch();
} else {
this.notifyError(resp.msg)
}
},
async cancelExcellent(id) {
const resp = await $.post("/platform/hd/wmhd/cancelExcellent", {id: id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch();
} else {
this.notifyError(resp.msg)
}
},
yearChange(val) {
let activityList = []
if (val === null) {
@@ -475,14 +467,13 @@ layout("/layouts/platform.html"){
activityList = activityList.concat(v.children)
})
}
this.hdxxlist = activityList
this.$set(this.pageForm, "hdid", null)
this.$set(this.pageForm, "hdlb", null)
this.$set(this.pageForm, "zplb", null)
this.$set(this.pageForm, "hdid", '')
this.$set(this.pageForm, "hdlb", '')
this.$set(this.pageForm, "zplb", '')
},
async unionChange() {
this.$set(this.pageForm, "unit", null)
this.$set(this.pageForm, "unit", '')
this.units = await getUnits(this.pageForm.union)
},
@@ -523,36 +514,13 @@ layout("/layouts/platform.html"){
this.pageData();
},
async viewInfo(scope) {
this.img2List = [];
this.prevImgList = [];
this.videoList = [];
this.audioList = [];
this.docList = [];
this.viewData = scope.row;
this.ckusername = scope.row.username;
const data = await $.post(base + '/platform/hd/wmhd/findOneById', {id: scope.row.id})
if (data.code == 0) {
data.data.forEach(val => {
val.fjname = val.filename
val.fjurl = val.filepath
val.url = '${AppFileDomain!}' + val.filepath
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val);
} else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push('${AppFileDomain!}' + val.filepath)
this.img2List.push(val);
} else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val);
} else if (this.audiotype.indexOf(filetype) > -1) {
this.audioList.push(val);
}
});
this.$refs.guava.view()
}
this.$refs.info.getInfo(scope.row.id)
this.$refs.guava.view()
},
playVideo: function (fjurl) {
playvideo: function (fjurl) {
var self = this;
self.fileDialogVisible = true;
self.$nextTick(function () {
@@ -579,8 +547,8 @@ layout("/layouts/platform.html"){
document.getElementById('amusic').pause();
}
},
exportExcel: function () {
let hdid = this.pageForm.hdid;
exportWork() {
let {hdid, hdlb, zplb, union, unit, stateId, isExcellent} = this.pageForm;
if (hdid === '') {
this.$message.warning('请先选择活动主题');
return;
@@ -589,7 +557,33 @@ layout("/layouts/platform.html"){
return o.value == hdid;
});
let hdname = hdarr[0].label;
window.open('/platform/hd/wmhd/exportExcel?hdid=' + hdid + '&hdname=' + hdname);
window.open('/platform/hd/wmhd/exportWork?hdid=' + hdid +
'&hdname=' + hdname +
"&hdlb=" + hdlb +
"&zplb=" + zplb +
"&union=" + union +
"&unit=" + unit +
"&isExcellent=" + isExcellent +
"&stateId=" + stateId);
},
exportExcel: function () {
let {hdid, hdlb, zplb, union, unit, stateId, isExcellent} = this.pageForm;
if (hdid === '') {
this.$message.warning('请先选择活动主题');
return;
}
let hdarr = this.hdxxlist.filter(o => {
return o.value == hdid;
});
let hdname = hdarr[0].label;
window.open('/platform/hd/wmhd/exportExcel?hdid=' + hdid +
'&hdname=' + hdname +
"&hdlb=" + hdlb +
"&zplb=" + zplb +
"&union=" + union +
"&unit=" + unit +
"&isExcellent=" + isExcellent +
"&stateId=" + stateId);
},
doSearch: function () {
this.pageForm.pageNumber = 1;
@@ -630,7 +624,6 @@ layout("/layouts/platform.html"){
})
if (confirm) {
const resp = await $.post(loc() + '/doDelete', {id: id})
console.log(resp)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
@@ -640,17 +633,28 @@ layout("/layouts/platform.html"){
}
},
async getAuditStateByModule() {
const {data} = await $.post(loc() + '/getAuditStateByModule')
this.auditStateList = data
}
},
async created() {
await this.initHdxxlist();
if (this.hdxxlist && this.hdxxlist.length > 0) {
this.pageForm.hdid = this.hdxxlist[0].value
this.hdchange(this.pageForm.hdid)
}
await this.pageData();
this.unions = await getUnions()
this.units = await getUnits()
this.unions = await getUnions(null)
this.units = await getUnits(null)
await this.getAuditStateByModule()
}
})
</script>
<!--#
}
#-->
#-->
@@ -0,0 +1,419 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.hdid" clearable @change="hdchange"
placeholder="请选择活动主题">
<el-option v-for="o in hdxxlist" :label="o.label"
:value="o.value"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.hdlb" placeholder="请选择活动类型" clearable
@change="hdlbchange">
<el-option v-for="o in hdlblist" :label="o.lname"
:value="o.lid"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.zplb" placeholder="请选择作品类型" clearable>
<el-option v-for="o in hdzplblist" :label="o.zname"
:value="o.zid"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5" v-if="pageForm.isAudit===null">
<el-select placeholder="审核状态" v-model="pageForm.stateId"
style="width: 200px;"
clearable
filterable>
<el-option label="待校工会审核" value="4200"></el-option>
<el-option label="校工会退回" value="4250"></el-option>
<el-option label="校工会拒绝" value="4300"></el-option>
<el-option label="审核通过" value="4400"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<vi-title2 title="作品列表">
<template #func>
<el-button type="primary" icon="el-icon-position" size="small" @click="openAudit" class="mr10"
:disabled="multipleSelection.length==0">
批量审核
</el-button>
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="small">
<el-radio-button :label="null">全部</el-radio-button>
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</template>
</vi-title2>
<el-table :data="tableData" ref="table" @sort-change="pageOrder" row-key="id"
@selection-change="handleSelectionChange">
<el-table-column
reserve-selection
:selectable="(row)=>{return row.auditState=='4200'}"
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index" header-align="center" align="center"
width="50">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="hdname" label="活动主题" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="username" label="教职工姓名" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="loginname" label="工号" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdlbname" label="活动类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="zplbname" label="作品类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center"
show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="auditState" header-align="center"
label="审核状态" sortable>
<template scope="scope">
<span :style="'color:'+scope.row.stateColor">{{scope.row.stateName}}</span>
</template>
</el-table-column>
<el-table-column label="操作" header-align="center" align="center" width="300">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="viewInfo(scope.row)">查看</el-button>
<el-button v-if="scope.row.auditState==='4200'"
type="primary" size="mini"
@click="openAudit(scope.row)">审核
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<info ref="info" @playvideo="playvideo"></info>
</template>
<template #edit>
<template v-if="multipleSelection.length===0">
<info ref="info2" handle label="校工会审核" @playvideo="playvideo">
<template #handle>
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<el-form-item label="审核信息&emsp;" label-width="135px" class="view-header">
</el-form-item>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="auditor" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="auditOpinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<el-form-item prop="auditSign" label="签&emsp;&emsp;字" class="is-required">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="doReview(1)">拒绝</el-button>
<el-button @click="doReview(2)" type="warning">返回修改</el-button>
<el-button type="primary" @click="doReview(3)">通过</el-button>
</div>
</template>
</info>
</template>
<template v-else>
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<el-form-item label="审核信息&emsp;" label-width="135px" class="view-header">
</el-form-item>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="auditor" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="20">
<el-form-item>
<el-table :data="multipleSelection" max-height="500px">
<el-table-column prop="hdname" label="活动主题" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="username" label="教职工姓名" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="loginname" label="工号" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdlbname" label="活动类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="zplbname" label="作品类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center"
show-overflow-tooltip>
</el-table-column>
</el-table>
</el-form-item>
</el-row>
<el-form-item prop="auditOpinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<el-form-item prop="auditSign" label="签&emsp;&emsp;字" class="is-required">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="doReview(1)">拒绝</el-button>
<el-button @click="doReview(2)" type="warning">返回修改</el-button>
<el-button type="primary" @click="doReview(3)">通过</el-button>
</div>
</template>
</template>
</guava>
<el-dialog :visible.sync="fileDialogVisible" class="filedialog" @close="filedialogClose"
:close-on-click-modal="false">
<div id="videoContainer"></div>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
multipleSelection: [],
fileDialogVisible: false,
videoShow: false,
pageForm: {
isAudit: false
},
unions: [],
units: [],
hdxxlist: [],
hdlblist: [],
hdzplblist: [],
formRules: {
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
}
},
components: {
'info': httpVueLoader('/components/hd/hdwmInfo.vue'),
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
filedialogClose() {
//关闭的时候需要销毁video 但是随之dom元素也会被删除!!!!
this.imgShow = false;
this.videoShow = false;
videojs('my-video').dispose();
},
playvideo(fjurl) {
this.fileDialogVisible = true;
this.videoShow = true;
this.$nextTick(function () {
let vc = document.getElementById('videoContainer');
let newVideo = document.createElement("div");//创建一个标签
newVideo.innerHTML = '<video id="my-video" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto"></video>';
vc.appendChild(newVideo);
let option = {autoplay: false, language: 'zh-CN'};
let myPlayer = videojs('my-video', option, function onPlayerReady() {
let myPlayer = this;
myPlayer.src({src: fjurl, type: "video/mp4"});
/*videojs.log("播放器已经准备好了!");*/
//this.play();
});
})
},
doReview(flag) {
this.$refs["form"].validate(async (valid) => {
if (valid) {
const confirm = await this.$confirm('确定要' + (flag === 1 ? '拒绝' : flag === 2 ? '退回修改' : '通过审核') + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
this.formData.pass = flag
this.formData.ids = JSON.stringify(this.multipleSelection.map(v => v.id))
const resp = await $.post(loc() + "/doReview", this.formData)
if(resp.code===0){
this.$refs.table.clearSelection()
this.doSearch()
this.$refs.guava.index()
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
}
}
})
},
openAudit(row) {
this.$refs.guava.edit()
if (this.multipleSelection.length === 0) {
this.$refs.info2.getInfo(row.id)
}
const {id} = row
this.formData = {
id: id ? id : null,
username: "${@shiro.getPrincipalProperty('username')}",
loginname: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: '同意'
}
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
},
viewInfo(row) {
this.$refs.info.getInfo(row.id)
this.$refs.guava.view()
},
hdchange(id) {
this.$set(this.pageForm, 'hdlb', '');
this.$set(this.pageForm, 'zplb', '');
$.post('/platform/hd/childhd/zpxx/gethdlblist', {id: id}).then(data => {
if (data.code == 0) {
this.hdlblist = data.data;
}
});
},
hdlbchange(id) {
this.$set(this.pageForm, 'zplb', '');
$.post('/platform/hd/childhd/zpxx/gethdzplblist', {id: id}).then(data => {
if (data.code == 0) {
this.hdzplblist = data.data;
}
});
},
initHdxxlist() {
$.post(base + '/platform/hd/wmhd/initHdxxlist').then(data => {
if (data.code == 0) {
this.hdxxlist = data.data[0].children;
}
});
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.unions = await getUnions()
this.flushUnits()
this.initHdxxlist();
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,446 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.hdid" clearable @change="hdchange"
placeholder="请选择活动主题">
<el-option v-for="o in hdxxlist" :label="o.label"
:value="o.value"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.hdlb" placeholder="请选择活动类型" clearable
@change="hdlbchange">
<el-option v-for="o in hdlblist" :label="o.lname"
:value="o.lid"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.zplb" placeholder="请选择作品类型" clearable>
<el-option v-for="o in hdzplblist" :label="o.zname"
:value="o.zid"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
:value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5" v-if="pageForm.isAudit===null">
<el-select placeholder="审核状态" v-model="pageForm.stateId"
style="width: 200px;"
clearable
filterable>
<el-option label="待分工会审核" value="4000"></el-option>
<el-option label="分工会退回" value="4100"></el-option>
<el-option label="分工会审核拒绝" value="4150"></el-option>
<el-option label="待校工会审核" value="4200"></el-option>
<el-option label="校工会退回" value="4250"></el-option>
<el-option label="校工会拒绝" value="4300"></el-option>
<el-option label="审核通过" value="4400"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<vi-title2 title="作品列表">
<template #func>
<el-button type="primary" icon="el-icon-position" size="small" @click="openAudit" class="mr10"
:disabled="multipleSelection.length==0">
批量审核
</el-button>
<el-radio-group v-model="pageForm.isAudit" @change="doSearch" size="small">
<el-radio-button :label="null">全部</el-radio-button>
<el-radio-button :label="true">已审核</el-radio-button>
<el-radio-button :label="false">未审核</el-radio-button>
</el-radio-group>
</template>
</vi-title2>
<el-table :data="tableData" ref="table" @sort-change="pageOrder" row-key="id"
@selection-change="handleSelectionChange">
<el-table-column
reserve-selection
:selectable="(row)=>{return row.auditState=='4000'}"
type="selection"
width="55">
</el-table-column>
<el-table-column label="序号" type="index" header-align="center" align="center"
width="50">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="hdname" label="活动主题" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="username" label="教职工姓名" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="loginname" label="工号" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdlbname" label="活动类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="zplbname" label="作品类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center"
show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="auditState" header-align="center"
label="审核状态" sortable>
<template scope="scope">
<span :style="'color:'+scope.row.stateColor">{{scope.row.stateName}}</span>
</template>
</el-table-column>
<el-table-column label="操作" header-align="center" align="center" width="300">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="viewInfo(scope.row)">查看</el-button>
<el-button
v-if="scope.row.auditState==='4000'||scope.row.auditState==='4250'"
type="primary" size="mini"
@click="openAudit(scope.row)">审核
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<info ref="info" @playvideo="playvideo"></info>
</template>
<template #edit>
<template v-if="multipleSelection.length===0">
<info ref="info2" handle label="分工会审核" @playvideo="playvideo">
<template #handle>
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<el-form-item label="审核信息&emsp;" label-width="135px" class="view-header">
</el-form-item>
<template v-if="multipleSelection.length>0">
<el-table :data="multipleSelection">
<el-table-column prop="hdname" label="活动主题" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="username" label="教职工姓名" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="loginname" label="工号" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdlbname" label="活动类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="zplbname" label="作品类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center"
show-overflow-tooltip>
</el-table-column>
</el-table>
</template>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="auditor" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="auditOpinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<el-form-item prop="auditSign" label="签&emsp;&emsp;字" class="is-required">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="doReview(1)">拒绝</el-button>
<el-button @click="doReview(2)" type="warning">返回修改</el-button>
<el-button type="primary" @click="doReview(3)">通过</el-button>
</div>
</template>
</info>
</template>
<template v-else>
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<el-form-item label="审核信息&emsp;" label-width="135px" class="view-header">
</el-form-item>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="auditor" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row gutter="20">
<el-form-item>
<el-table :data="multipleSelection" max-height="500px">
<el-table-column prop="hdname" label="活动主题" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="username" label="教职工姓名" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="loginname" label="工号" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdlbname" label="活动类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="zplbname" label="作品类别" header-align="center"
align="center"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center"
show-overflow-tooltip>
</el-table-column>
</el-table>
</el-form-item>
</el-row>
<el-form-item prop="auditOpinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<el-form-item prop="auditSign" label="签&emsp;&emsp;字" class="is-required">
<sign :qz.sync="formData.auditSign"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="doReview(1)">拒绝</el-button>
<el-button @click="doReview(2)" type="warning">返回修改</el-button>
<el-button type="primary" @click="doReview(3)">通过</el-button>
</div>
</template>
</template>
</guava>
<el-dialog :visible.sync="fileDialogVisible" class="filedialog" @close="filedialogClose"
:close-on-click-modal="false">
<div id="videoContainer"></div>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
multipleSelection: [],
fileDialogVisible: false,
videoShow: false,
pageForm: {
isAudit: false
},
unions: [],
units: [],
hdxxlist: [],
hdlblist: [],
hdzplblist: [],
formRules: {
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
}
},
components: {
'info': httpVueLoader('/components/hd/hdwmInfo.vue'),
},
methods: {
handleSelectionChange(val) {
this.multipleSelection = val;
},
doReview(flag) {
this.$refs["form"].validate(async (valid) => {
if (valid) {
const confirm = await this.$confirm('确定要' + (flag === 1 ? '拒绝' : flag === 2 ? '退回修改' : '通过审核') + '吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
this.formData.pass = flag
this.formData.ids = JSON.stringify(this.multipleSelection.map(v => v.id))
const resp = await $.post(loc() + "/doReview", this.formData)
if(resp.code===0){
this.$refs.table.clearSelection()
this.doSearch()
this.$refs.guava.index()
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
}
}
})
},
openAudit(row) {
this.$refs.guava.edit()
if (this.multipleSelection.length === 0) {
this.$refs.info2.getInfo(row.id)
}
const {id} = row
this.formData = {
id: id ? id : null,
username: "${@shiro.getPrincipalProperty('username')}",
loginname: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD'),
auditOpinion: '同意'
}
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
},
viewInfo(row) {
this.$refs.info.getInfo(row.id)
this.$refs.guava.view()
},
hdchange(id) {
this.$set(this.pageForm, 'hdlb', '');
this.$set(this.pageForm, 'zplb', '');
$.post('/platform/hd/childhd/zpxx/gethdlblist', {id: id}).then(data => {
if (data.code == 0) {
this.hdlblist = data.data;
}
});
},
hdlbchange(id) {
this.$set(this.pageForm, 'zplb', '');
$.post('/platform/hd/childhd/zpxx/gethdzplblist', {id: id}).then(data => {
if (data.code == 0) {
this.hdzplblist = data.data;
}
});
},
initHdxxlist() {
$.post(base + '/platform/hd/wmhd/initHdxxlist').then(data => {
if (data.code == 0) {
this.hdxxlist = data.data[0].children;
}
});
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
filedialogClose() {
//关闭的时候需要销毁video 但是随之dom元素也会被删除!!!!
this.imgShow = false;
this.videoShow = false;
videojs('my-video').dispose();
},
playvideo(fjurl) {
this.fileDialogVisible = true;
this.videoShow = true;
this.$nextTick(function () {
let vc = document.getElementById('videoContainer');
let newVideo = document.createElement("div");//创建一个标签
newVideo.innerHTML = '<video id="my-video" class="video-js vjs-default-skin vjs-big-play-centered" controls preload="auto"></video>';
vc.appendChild(newVideo);
let option = {autoplay: false, language: 'zh-CN'};
let myPlayer = videojs('my-video', option, function onPlayerReady() {
let myPlayer = this;
myPlayer.src({src: fjurl, type: "video/mp4"});
/*videojs.log("播放器已经准备好了!");*/
//this.play();
});
})
},
},
async created() {
this.unions = await getUnions()
this.flushUnits()
this.initHdxxlist();
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -186,90 +186,124 @@ layout("/layouts/platform.html"){
</style>
<link rel="stylesheet" href="${base!}/assets/platform/plugins/video/css/video-js.min.css">
<link href="${base!}/assets/platform/plugins/video/css/video-js.min.css" rel="stylesheet">
<script src="${base!}/assets/platform/plugins/video/js/video.min.js"></script>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.hdid" clearable @change="hdchange" placeholder="请选择活动主题">
<el-option v-for="o in hdxxlist" :label="o.label" :value="o.value"></el-option>
<el-date-picker @change="yearChange"
placeholder="年度"
type="year"
v-model="pageForm.year"
value-format="yyyy"></el-date-picker>
</div>
<div class="btn-group tool-button mt5">
<el-select @change="hdchange" clearable placeholder="请选择活动主题"
v-model="pageForm.hdid">
<el-option :label="o.label" :value="o.value"
v-for="o in hdxxlist"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.hdlb" placeholder="请选择活动类型" clearable @change="hdlbchange">
<el-option v-for="o in hdlblist" :label="o.lname" :value="o.lid"></el-option>
<el-select @change="hdlbchange" clearable placeholder="请选择活动类别"
v-model="pageForm.hdlb">
<el-option :label="o.lname" :value="o.lid"
v-for="o in hdlblist"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.zplb" placeholder="请选择作品类型" clearable>
<el-option v-for="o in hdzplblist" :label="o.zname" :value="o.zid"></el-option>
<el-select clearable placeholder="请选择作品类型" v-model="pageForm.zplb">
<el-option :label="o.zname" :value="o.zid"
v-for="o in hdzplblist"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
<el-button @click="doSearch" icon="el-icon-search" type="primary"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openAdd">上传作品</el-button>
</div>
</el-card>
<el-card class="mt20" shadow="never">
<vi-title2 title="作品列表">
<template #func>
<el-button @click="openAdd" size="small" type="primary">上传作品</el-button>
</template>
</vi-title2>
<el-table :data="tableData">
<el-table-column label="序号" type="index" header-align="center" align="center" width="50">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="50">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="hdname" label="活动主题" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="活动主题" prop="hdname"
show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="hdsbzpzt" label="作品主题" header-align="center" align="center"-->
<!-- show-overflow-tooltip></el-table-column>-->
<el-table-column prop="sbrname" label="教职工姓名" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="教职工姓名"
prop="sbrname"
show-overflow-tooltip></el-table-column>
<el-table-column prop="loginname" label="工资号" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="工号"
prop="loginname"
show-overflow-tooltip></el-table-column>
<el-table-column prop="dwname" label="单位" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="单位" prop="dwname"
show-overflow-tooltip></el-table-column>
<el-table-column prop="ghname" label="分工会" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="分工会" prop="ghname"
show-overflow-tooltip></el-table-column>
<el-table-column prop="hdlbname" label="活动类别" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="活动类别"
prop="hdlbname"
show-overflow-tooltip></el-table-column>
<!-- <el-table-column prop="zplbname" label="作品类别" header-align="center" align="center"
show-overflow-tooltip></el-table-column>-->
<el-table-column prop="hdsbsj" label="上传时间" header-align="center" align="center"
<el-table-column align="center" header-align="center" label="作品类别"
prop="zplbname"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" header-align="center" label="上传时间" prop="hdsbsj"
show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" header-align="center" label="申请状态"
prop="auditState" sortable>
<template scope="scope">
{{moment(scope.row.hdsbsj).format('YYYY-MM-DD')}}
<span :style="'color:'+scope.row.statecolor">{{scope.row.statename}}</span>
</template>
</el-table-column>
<el-table-column label="操作" header-align="center" align="center" width="300">
<!-- <el-table-column align="center" header-align="center" label="总点赞数"
prop="dz_znum" sortable>
<template scope="scope">
{{scope.row.dz_znum}}次
</template>
</el-table-column>-->
<el-table-column align="center" header-align="center" label="操作" width="300">
<template slot-scope="scope">
<el-button size="mini" @click="viewInfo(scope)">查看</el-button>
<el-button v-if="currenttime<scope.row.hdjssj" type="primary" size="mini"
@click="openEdit(scope)">
<el-button @click="viewInfo(scope)" size="mini" type="primary">查看
</el-button>
<!-- v-if="scope.row.auditstate==='3999'||scope.row.auditstate==='4100'||scope.row.auditstate==='4250'"-->
<el-button :disabled="scope.row.auditstate!=='3999'"
@click="openEdit(scope)" size="mini"
type="primary">
编辑
</el-button>
<el-button v-if="currenttime<scope.row.hdjssj" type="danger" size="mini"
@click="dodelete(scope.row.id)">删除
<el-button :disabled="scope.row.auditstate!=='3999'"
@click="dodelete(scope.row.id)"
size="mini"
type="danger">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
:page-sizes="[10, 20, 30, 50]"
:total="pageForm.totalCount"
@current-change="pageNumberChange"
@size-change="pageSizeChange"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-row>
</el-card>
@@ -278,318 +312,204 @@ layout("/layouts/platform.html"){
</template>
<template #edit>
<el-form :model="AddFormData" label-width="120px" :rules="rules" ref="AddForm">
<el-form :model="AddFormData" :rules="rules" label-width="120px" ref="AddForm">
<el-divider content-position="left">基本信息</el-divider>
<div class="form-item-container">
<el-form-item prop="loginname" label="工资号">
<el-input value="${@shiro.getPrincipalProperty('loginname')}" readonly></el-input>
<el-form-item label="工号" prop="loginname">
<el-input readonly
value="${@shiro.getPrincipalProperty('loginname')}"></el-input>
</el-form-item>
<el-form-item prop="username" label="姓名">
<el-input value="${@shiro.getPrincipalProperty('username')}" readonly></el-input>
<el-form-item label="姓名" prop="username">
<el-input readonly
value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
</div>
<div class="form-item-container">
<el-form-item prop="ghname" label="所属工会">
<el-input v-model="currentUserGhname" readonly></el-input>
<el-form-item label="所属工会" prop="ghname">
<el-input readonly v-model="currentUserGhname"></el-input>
</el-form-item>
<el-form-item prop="mobile" label="手机号码">
<el-form-item label="手机号码" prop="mobile">
<el-input v-model="AddFormData.mobile"></el-input>
</el-form-item>
</div>
<el-divider content-position="left">活动信息</el-divider>
<div class="form-item-container">
<el-form-item prop="hdid" label="活动主题">
<el-select v-model="AddFormData.hdid" style="width: 100%" @change="formhdchange">
<el-option v-for="o in formhdxxlist" :label="o.label" :value="o.value"
:key="o.value">
<el-form-item label="活动主题" prop="hdid">
<el-select @change="formhdchange" style="width: 100%"
v-model="AddFormData.hdid">
<el-option :key="o.hdid" :label="o.hdname" :value="o.hdid"
v-for="o in formhdxxlist">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="hdlb" label="活动类别">
<el-select v-model="AddFormData.hdzplx" style="width: 100%" @change="formhdlbchange">
<el-option v-for="o in formhdlblist" :label="o.lname" :value="o.lid"></el-option>
<el-form-item label="活动类别" prop="hdzplx">
<el-select @change="formhdlbchange" style="width: 100%"
v-model="AddFormData.hdzplx">
<el-option :label="o.lname" :value="o.lid"
v-for="o in formhdlblist"></el-option>
</el-select>
</el-form-item>
</div>
<div class="form-item-container">
<!-- <el-form-item prop="zpzt" label="作品主题">
<el-input v-model="AddFormData.hdsbzpzt"></el-input>
</el-form-item>-->
<el-form-item prop="step_count" label="健步走步数">
<el-input-number style="width: 100%" v-model="AddFormData.step_count"></el-input-number>
</el-form-item>
<el-form-item prop="zplb" label="作品类别" v-if="formhdzplblist&&formhdzplblist.length>0">
<el-select v-model="AddFormData.hdzplx2" style="width: 100%">
<el-option v-for="o in formhdzplblist" :label="o.zname" :value="o.zid" :key="o.zid"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="zpms" label="作品描述/介绍">
<el-input type="textarea" v-model="AddFormData.hdsbzpms"></el-input>
</el-form-item>
<el-divider content-position="left">作品信息</el-divider>
<el-form-item label="照片">
<el-upload
name="picturefile"
:file-list="picturelist"
:auto-upload="false"
action=""
list-type="picture-card"
limit="5"
:on-exceed="pictureExceed"
:on-change="pictureChange">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="音/视频、文档">
<el-upload
name="vadfile"
:file-list="vadlist"
:auto-upload="false"
action=""
limit="5"
:on-change="vadChange">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<!-- <el-form-item prop="step_count" label="健步走步数">
<el-input-number style="width: 100%" v-model="AddFormData.step_count"></el-input-number>
</el-form-item>-->
<el-form-item label="类别" prop="hdzplx2">
<el-select @change="changeHdzplx2" style="width: 100%"
v-model="AddFormData.hdzplx2">
<el-option :key="o.zid" :label="o.zname" :value="o.zid"
v-for="o in formhdzplblist"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标题" prop="zpmc">
<el-input v-model="AddFormData.zpmc"></el-input>
</el-form-item>
</div>
<el-form-item label="创作说明" prop="hdsbzpms">
<el-input :maxlength="zplb2Config.maxWordCount" show-word-limit
type="textarea" v-model="AddFormData.hdsbzpms"></el-input>
</el-form-item>
<div v-if="zplb2Config.isUploadPhoto||zplb2Config.isUploadOther">
<el-divider content-position="left">作品信息</el-divider>
<el-form-item label="照片" required v-if="zplb2Config.isUploadPhoto">
<el-upload
:auto-upload="false"
:file-list="picturelist"
:limit="zplb2Config.photoNum"
:on-change="pictureChange"
:on-exceed="pictureExceed"
action=""
list-type="picture-card"
name="picturefile">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="音/视频、文档" v-if="zplb2Config.isUploadOther">
<el-upload
:auto-upload="false"
:file-list="vadlist"
:limit="zplb2Config.otherFileNum"
:on-change="vadChange"
:on-exceed="vadExceed"
action=""
name="vadfile">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</div>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
<el-button @click="doAdd(false)">保 存</el-button>
<el-button @click="doAdd(true)" type="primary">提 交</el-button>
</div>
</template>
<template #view>
<table style="width: 100%">
<tr style="border: 1px solid rgb(220, 220, 220);">
<td colspan="4"
style="text-align: center;padding: 10px;background-color: #0e78c5;color: white;font-size: 18px;font-weight:500">
作品信息
</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">姓名</td>
<td class="tpb">{{viewData.sbrname}}</td>
<td class="tpa">工资号</td>
<td class="tpb">{{viewData.loginname}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">单位</td>
<td class="tpb">{{viewData.dwname}}</td>
<td class="tpa">工会</td>
<td class="tpb">{{viewData.ghname}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">活动类别</td>
<td class="tpb">
<span>{{viewData.hdlbname}}</span>
</td>
<template v-if="viewData.zplbname">
<td class="tpa">作品类别</td>
<td class="tpb">
<span>{{viewData.zplbname}}</span>
</td>
</template>
<template v-else>
<td class="tpa">健步走步数</td>
<td class="tpb">
<span>{{viewData.step_count}}</span>
</td>
</template>
</tr>
<!-- <tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品主题</td>
<td class="tpb" colspan="3">{{viewData.hdsbzpzt}}</td>
</tr>-->
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品描述</td>
<td class="tpb" colspan="3">{{viewData.hdsbzpms}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">作品信息</td>
<td class="tpb" colspan="3">
<el-row>
<el-divider>照片&emsp;<i class="el-icon-picture-outline"></i></el-divider>
<file-upload view :files="img2List"></file-upload>
<!-- <div style="text-align: left;" v-if="img2List.length>0">
<div v-for="item in img2List"
style="display: inline-block;width: 100px;margin-right:10px">
<div class="file-down-span" @click="downLoad(item)">
<i class="el-icon-download"></i>
</div>
<el-image lazy :z-index="999999999"
style="width: 100px;height: 100px;"
:src="item.url"
:preview-src-list="prevImgList">
</el-image>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有照片。
</div>-->
</el-row>
<el-row>
<el-divider>视频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="videoList.length>0">
<div v-for="item in videoList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab">
<div class="video-toggle-i"
@click="playVideo(APP_DOMAIN + '/file_server/fileStreamPreview?id=' + item.id)">
<i class="el-icon-video-camera-solid"></i>
<i class="el-icon-video-play"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="location.href='/file_server/download?filepath=' + item.filepath + '&filename=' + item.filename">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有视频。
</div>
</el-row>
<el-row>
<el-divider>音频&emsp;<i class="el-icon-video-camera"></i></el-divider>
<div style="text-align: left;" v-if="audioList.length>0">
<div v-for="item in audioList">
<audio id="amusic" preload="auto" controls style="width: 100%;outline: none;">
<!-- <source :src="'${AppFileDomain!}'+item.filepath"/>-->
<source :src="APP_DOMAIN + '/file_server/fileStreamPreview?id=' + item.id"/>
</audio>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有音频。
</div>
</el-row>
<el-row>
<el-divider>文档&emsp;<i class="el-icon-document-copy"></i></el-divider>
<div style="text-align: left;" v-if="docList.length>0">
<div v-for="item in docList">
<el-tooltip class="item" effect="dark" placement="right-start">
<div slot="content">{{item.fjname}}</div>
<div class="view-myvideo-tab" style="background-color: #f6f6f6">
<div class="video-toggle-i" @click="dd3s.preview(item.filepath,item.id)">
<i class="el-icon-document"></i>
</div>
<span class="file-down-span"
style="bottom: 0;height: 20px;display: inline-block;"
@click="location.href='/file_server/download?filepath=' + item.filepath + '&filename=' + item.filename">
<i class="el-icon-download"></i>
</span>
</div>
</el-tooltip>
</div>
</div>
<div v-else style="text-align: center;color: #c2bbbb;font-size: 10px;">
没有文档。
</div>
</el-row>
</td>
</tr>
</table>
<info @playvideo="playvideo" ref="info"></info>
</template>
<template #public>
<el-form :model="EditFormData" label-width="120px" :rules="rules" ref="EditForm">
<el-form :model="EditFormData" :rules="rules" label-width="120px" ref="EditForm">
<el-divider content-position="left">基本信息</el-divider>
<div class="form-item-container">
<el-form-item prop="loginname" label="工资号">
<el-input value="${@shiro.getPrincipalProperty('loginname')}" readonly></el-input>
<el-form-item label="工号" prop="loginname">
<el-input readonly
value="${@shiro.getPrincipalProperty('loginname')}"></el-input>
</el-form-item>
<el-form-item prop="username" label="姓名">
<el-input value="${@shiro.getPrincipalProperty('username')}" readonly></el-input>
<el-form-item label="姓名" prop="username">
<el-input readonly
value="${@shiro.getPrincipalProperty('username')}"></el-input>
</el-form-item>
</div>
<div class="form-item-container">
<el-form-item prop="ghname" label="所属工会">
<el-input v-model="currentUserGhname" readonly></el-input>
<el-form-item label="所属工会" prop="ghname">
<el-input readonly v-model="currentUserGhname"></el-input>
</el-form-item>
<el-form-item prop="mobile" label="手机号码">
<el-form-item label="手机号码" prop="mobile">
<el-input v-model="EditFormData.mobile"></el-input>
</el-form-item>
</div>
<el-divider content-position="left">活动信息</el-divider>
<div class="form-item-container">
<el-form-item prop="hdid" label="活动主题">
<el-select v-model="EditFormData.hdid" style="width: 100%" @change="formhdchange">
<el-option v-for="o in formhdxxlist" :label="o.label" :value="o.value"
:key="o.value">{{o}}
<el-form-item label="活动主题" prop="hdid">
<el-select @change="formhdchange" style="width: 100%"
v-model="EditFormData.hdid">
<el-option :key="o.hdid" :label="o.hdname" :value="o.hdid"
v-for="o in formhdxxlist">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="hdlb" label="活动类别">
<el-select v-model="EditFormData.hdzplx" style="width: 100%" @change="formhdlbchange">
<el-option v-for="o in formhdlblist" :label="o.lname" :value="o.lid"></el-option>
<el-form-item label="活动类别" prop="hdzplx">
<el-select @change="formhdlbchange" style="width: 100%"
v-model="EditFormData.hdzplx">
<el-option :label="o.lname" :value="o.lid"
v-for="o in formhdlblist"></el-option>
</el-select>
</el-form-item>
</div>
<!-- <el-form-item prop="zpzt" label="作品主题">
<el-input v-model="EditFormData.hdsbzpzt"></el-input>
</el-form-item>-->
<el-form-item prop="step_count" label="健步走步数">
<el-input-number style="width: 100%" v-model="EditFormData.step_count"></el-input-number>
</el-form-item>
<el-form-item prop="zplb" label="作品类别" v-if="formhdzplblist&&formhdzplblist.length>0">
<el-select v-model="EditFormData.hdzplx2" style="width: 100%">
<el-option v-for="o in formhdzplblist" :label="o.zname" :value="o.zid" :key="o.zid"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="zpms" label="作品描述/介绍">
<el-input type="textarea" v-model="EditFormData.hdsbzpms"></el-input>
</el-form-item>
<el-divider content-position="left">作品信息</el-divider>
<el-form-item label="照片">
<el-upload
name="picturefile"
:file-list="picturelist"
:auto-upload="false"
action=""
list-type="picture-card"
limit="5"
:on-remove="pictureRemove"
:on-exceed="pictureExceed"
:on-change="pictureChange">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="音/视频、文档">
<el-upload
name="vadfile"
:file-list="vadlist"
:auto-upload="false"
action=""
limit="5"
:on-remove="vadRemove"
:on-change="vadChange">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
<div class="form-item-container">
<el-form-item label="类别" prop="hdzplx2"
v-if="formhdzplblist&&formhdzplblist.length>0">
<el-select @change="changeHdzplx2" style="width: 100%"
v-model="EditFormData.hdzplx2">
<el-option :key="o.zid" :label="o.zname" :value="o.zid"
v-for="o in formhdzplblist"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标题" prop="zpmc">
<el-input v-model="EditFormData.zpmc"></el-input>
</el-form-item>
</div>
<el-form-item label="创作说明" prop="hdsbzpms">
<el-input :maxlength="zplb2Config.maxWordCount" show-word-limit
type="textarea" v-model="EditFormData.hdsbzpms"></el-input>
</el-form-item>
<div v-if="zplb2Config.isUploadPhoto||zplb2Config.isUploadOther">
<el-divider content-position="left">作品信息</el-divider>
<el-form-item label="照片" required v-if="zplb2Config.isUploadPhoto">
<el-upload
:auto-upload="false"
:file-list="picturelist"
:limit="zplb2Config.photoNum"
:on-change="pictureChange"
:on-exceed="pictureExceed"
:on-remove="pictureRemove"
action=""
list-type="picture-card"
name="picturefile">
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="音/视频、文档" v-if="zplb2Config.isUploadOther">
<el-upload
:auto-upload="false"
:file-list="vadlist"
:limit="zplb2Config.otherFileNum"
:on-change="vadChange"
:on-remove="vadRemove"
action=""
name="vadfile">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</el-form-item>
</div>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 定</el-button>
<el-button @click="doEdit(false)">保 存</el-button>
<el-button @click="doEdit(true)" type="primary">提 交</el-button>
</div>
</template>
</guava>
<el-dialog :visible.sync="fileDialogVisible" class="filedialog" @close="filedialogClose"
:close-on-click-modal="false">
<el-dialog :close-on-click-modal="false" :visible.sync="fileDialogVisible"
@close="filedialogClose"
class="filedialog">
<div id="videoContainer"></div>
</el-dialog>
@@ -598,8 +518,10 @@ layout("/layouts/platform.html"){
<script>
const vue = new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
hdid: GetQueryString("hdid"),
editDialogVisible: false,
picturelist: [],
PicturedialogVisible: false,
@@ -609,6 +531,7 @@ layout("/layouts/platform.html"){
hasSuperAdminRole: "${@shiro.hasRole('sysadmin')}" === 'true' ? true : false,
tableData: [],
pageForm: {
year: new Date().getFullYear() + '',
hdid: '',
hdlb: '',
zplb: '',
@@ -626,7 +549,7 @@ layout("/layouts/platform.html"){
viewData: {},
imgtype: ['gif', 'jpg', 'png', 'jpeg'],
videotype: ['flv', 'swf', 'mkv', 'avi', 'rm', 'rmvb', 'wmv', 'mp4', 'mov', 'mpg', 'mpeg'],
doctype: ['doc', 'docx'],
doctype: ['doc', 'docx', 'xlsx', 'xls', 'txt'],
audiotype: ['mp3', 'wma', 'flac', 'wav', 'm4a', 'amr', 'au'],
prevImgList: [],
img2List: [],
@@ -637,28 +560,55 @@ layout("/layouts/platform.html"){
hdlblist: [],
hdzplblist: [],
addDialogVisible: false,
AddFormData: {
znnl: 1,
znxb: '男',
mobile: ''
},
AddFormData: {},
formhdlblist: [],
formhdzplblist: [],
rules: {
hdid: [{required: true, message: '请选择活动主题', trigger: ['blur', 'change']}],
hdzplx: [{required: true, message: '请选择活动类别', trigger: ['blur', 'change']}],
hdzplx2: [{required: true, message: '请选择作品类别', trigger: ['blur', 'change']}],
zpmc: [{required: true, message: '请填写作品标题', trigger: ['blur', 'change']}],
hdsbzpzt: [{required: true, message: '请填写作品主题', trigger: ['blur', 'change']}],
hdsbzpms: [{required: true, message: '请填写创作说明', trigger: ['blur', 'change']}],
},
EditFormData: {},
readytodelfile: [],
formhdxxlist: []
formhdxxlist: [],
yearActivityList: [],
zplb2Config: {},
}
},
components: {
'info': httpVueLoader('/components/hd/hdwmInfo.vue'),
},
methods: {
changeHdzplx2(id) {
this.zplb2Config = this.formhdzplblist.find(v => v.zid === id)
},
yearChange(val) {
let activityList = []
if (val === null) {
this.yearActivityList.map(v => {
activityList = activityList.concat(v.children)
})
} else {
let enen = this.yearActivityList.filter(v => v.value == val)
enen.map(v => {
activityList = activityList.concat(v.children)
})
}
this.hdxxlist = activityList
this.$set(this.pageForm, "hdid", null)
this.$set(this.pageForm, "hdlb", null)
this.$set(this.pageForm, "zplb", null)
},
formhdchange(id) {
this.$set(this.AddFormData, 'hdlb', '');
this.$set(this.AddFormData, 'zplb', '');
this.$set(this.AddFormData, 'hdzplx', null);
this.$set(this.AddFormData, 'hdzplx2', null);
this.$set(this.EditFormData, 'hdzplx', null);
this.$set(this.EditFormData, 'hdzplx2', null);
$.post('/platform/hd/childhd/zpxx/gethdlblist', {id: id}).then(data => {
if (data.code == 0) {
this.formhdlblist = data.data;
@@ -666,47 +616,83 @@ layout("/layouts/platform.html"){
});
},
formhdlbchange(id) {
this.$set(this.AddFormData, 'zplb', '');
$.post('/platform/hd/childhd/zpxx/gethdzplblist', {id: id}).then(data => {
this.$set(this.AddFormData, 'hdzplx2', null);
$.post('/platform/hd/jzghd/sczp/gethdzplblist', {id: id}).then(data => {
if (data.code == 0) {
this.formhdzplblist = data.data;
}
});
},
pictureExceed() {
this.$message.warning('照片最多上传5张');
this.$message.warning('照片最多上传' + this.zplb2Config.photoNum + '张');
},
vadExceed() {
this.$message.warning('音/视频、文档最多上传' + this.zplb2Config.otherFileNum + '个');
},
pictureChange(file, fileList) {
this.picturelist = fileList;
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1).toLowerCase();
const whiteList = this.zplb2Config.photoType
if (!whiteList.includes(fileSuffix)) {
this.picturelist = []
this.$message.warning('上传照片只能是' + whiteList.join(',') + '格式')
return false
}
this.picturelist = fileList
},
pictureRemove(file, fileList) {
if (file.status === 'success') {
const length = file.url.length - FILE_DOMAIN.length
const length = file.url.lastIndexOf("=") + 1
this.readytodelfile.push(file.url.substring(length));
this.picturelist.map(v => {
const length = v.url.lastIndexOf("=") + 1
v.urlId = v.url.substring(length);
})
this.picturelist = this.picturelist.filter(v => v.urlId !== file.url.substring(length))
}
},
vadChange(file, fileList) {
const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1).toLowerCase();
const whiteList = this.zplb2Config.otherType
if (!whiteList.includes(fileSuffix)) {
this.vadlist = []
this.$message.warning('上传音/视频、文档只能是' + whiteList.join(',') + '格式')
return false
}
this.vadlist = fileList;
},
vadRemove(file, fileList) {
if (file.status === 'success') {
const length = file.url.length - FILE_DOMAIN.length
const length = file.url.lastIndexOf("=") + 1
this.readytodelfile.push(file.url.substring(length));
this.vadlist.map(v => {
const length = v.url.lastIndexOf("=") + 1
v.urlId = v.url.substring(length);
})
this.vadlist = this.vadlist.filter(v => v.urlId !== file.url.substring(length))
}
},
openAdd() {
if (this.$refs['AddForm']) {
this.$refs['AddForm'].resetFields();
}
this.AddFormData = {}
this.zplb2Config = {}
this.AddFormData.mobile = "${@shiro.getPrincipalProperty('mobile')}";
if (this.formhdxxlist.find(v => v.hdid === this.hdid)) {
this.AddFormData.hdid = this.hdid;
} else if (this.pageForm.hdid) {
this.AddFormData.hdid = this.pageForm.hdid;
}
this.formhdchange(this.AddFormData.hdid)
this.picturelist = [];
this.vadlist = [];
this.$refs.guava.edit()
if (this.$refs['AddForm']) {
this.$refs['AddForm'].resetFields();
}
},
doAdd() {
doAdd(flag) {
this.$refs['AddForm'].validate((valid) => {
if (valid) {
if (this.picturelist.length === 0 && this.vadlist.length === 0) {
if (flag && ((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
(this.zplb2Config.isUploadOther && this.vadlist.length === 0))) {
this.$message.warning('请上传您的作品');
return;
}
@@ -717,6 +703,7 @@ layout("/layouts/platform.html"){
background: 'rgba(0, 0, 0, 0.7)'
});
let formdata = new FormData();
formdata.append("flag", flag);
formdata.append("data", JSON.stringify(this.AddFormData));
this.picturelist.forEach(val => {
formdata.append("file", val.raw);
@@ -748,7 +735,7 @@ layout("/layouts/platform.html"){
this.readytodelfile = [];
this.picturelist = [];
this.vadlist = [];
this.$refs.guava.public()
$.post('/platform/hd/wmhd/findOne', {id: scope.row.id}).then(res => {
if (res.code == 0) {
this.formhdlblist = res.data.hdlblist;
@@ -756,21 +743,26 @@ layout("/layouts/platform.html"){
this.EditFormData = res.data;
this.EditFormData.hdzplx = res.data.hdzplx ? res.data.hdzplx.toString() : "";
this.EditFormData.hdzplx2 = res.data.hdzplx2 ? res.data.hdzplx2.toString() : "";
this.changeHdzplx2(this.EditFormData.hdzplx2)
res.data.piclist.forEach(v => {
this.picturelist.push({url: APP_DOMAIN + '/file_server/fileStreamPreview?id=' + v.id})
})
this.vadlist = res.data.vadlist;
}
});
this.$refs.guava.public()
},
doEdit() {
doEdit(flag) {
this.$refs['EditForm'].validate((valid) => {
if (valid) {
if (this.picturelist.length === 0 && this.vadlist.length === 0) {
if (flag && ((this.zplb2Config.isUploadPhoto && this.picturelist.length === 0) ||
(this.zplb2Config.isUploadOther && this.vadlist.length === 0))) {
this.$message.warning('请上传您的作品');
return;
}
const loading = this.$loading({
lock: true,
text: '上传中',
@@ -778,6 +770,7 @@ layout("/layouts/platform.html"){
background: 'rgba(0, 0, 0, 0.7)'
});
let formdata = new FormData();
formdata.append("flag", flag);
formdata.append("data", JSON.stringify(this.EditFormData));
formdata.append("readytodelfile", JSON.stringify(this.readytodelfile));
this.picturelist.forEach(val => {
@@ -835,36 +828,10 @@ layout("/layouts/platform.html"){
this.pageData();
},
viewInfo(scope) {
this.img2List = [];
this.prevImgList = [];
this.videoList = [];
this.audioList = [];
this.docList = [];
this.viewData = scope.row;
$.post(base + '/platform/hd/wmhd/findOneById', {id: scope.row.id}).then(data => {
if (data.code == 0) {
data.data.forEach(val => {
val.fjname = val.filename
val.fjurl = val.filepath
val.url = '${AppFileDomain!}' + val.filepath
let filetype = val.fjname.substring(val.fjname.lastIndexOf('.') + 1, val.fjname.length).toLowerCase();
if (this.videotype.indexOf(filetype) > -1) {
this.videoList.push(val);
} else if (this.imgtype.indexOf(filetype) > -1) {
this.prevImgList.push('${AppFileDomain!}' + val.filepath)
this.img2List.push(val);
} else if (this.doctype.indexOf(filetype) > -1) {
this.docList.push(val);
} else if (this.audiotype.indexOf(filetype) > -1) {
this.audioList.push(val);
}
});
// this.viewDialogVisible = true
this.$refs.guava.view()
}
});
this.$refs.info.getInfo(scope.row.id)
this.$refs.guava.view()
},
playVideo(fjurl) {
playvideo(fjurl) {
this.fileDialogVisible = true;
this.videoShow = true;
this.$nextTick(function () {
@@ -897,7 +864,12 @@ layout("/layouts/platform.html"){
initHdxxlist() {
$.post(base + '/platform/hd/wmhd/initHdxxlist').then(data => {
if (data.code == 0) {
this.hdxxlist = data.data[0].children;
this.yearActivityList = data.data
let activityList = []
data.data.map(v => {
activityList = activityList.concat(v.children)
})
this.hdxxlist = activityList
}
});
},
@@ -940,20 +912,25 @@ layout("/layouts/platform.html"){
this.currentUserGhname = data;
});
},
initformHdxxlist() {
$.post('/platform/hd/wmhd/initHdxxlist').then(data => {
this.formhdxxlist = data.data[0].children;
});
async getUserActivityGroup() {
const {data} = await $.post("/platform/hd/wmhdMange/getUserActivityGroup")
this.formhdxxlist = data.filter(v => v.hdflag)
}
},
created() {
this.initHdxxlist();
this.initformHdxxlist();
this.getUserActivityGroup();
this.pageData();
this.getCurrentUserGhname();
if (this.hdid) {
setTimeout(() => {
this.openAdd()
}, 500)
}
}
});
</script>
<!--#
}
#-->
#-->
@@ -1,306 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<!-- 在线答题-答题页面 -->
<style>
#qsmEditor .w-e-text-container {
height: 450px !important;
}
#qsmEditor div {
z-index: 0 !important;
}
.el-divider {
background-color: #409EFF;
}
.el-divider__text {
color: #409EFF;
}
.inputParent input {
border: none;
border-bottom: 1px solid rgb(220, 223, 230);
border-radius: 0;
}
.issueList > .el-table__header-wrapper {
display: none;
}
.issueList .el-table__expanded-cell {
background-color: rgb(250, 250, 250) !important;
}
</style>
<div id="app" v-cloak>
<el-row class="transition-row">
<transition name="el-zoom-in-center">
<div v-show="v=='index'" class="transition-item">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<template slot="prepend">试卷名称</template>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button icon="el-icon-search" @click="doSearch"
style="background-color:#409eff;color: white;"></el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" size="medium" header-align="center" align="center" style="width: 100%">
<el-table-column
label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="name" label="试卷名称" header-align="center"
align="center"></el-table-column>
<el-table-column prop="explain_txt" label="说明" show-overflow-tooltip header-align="center"
align="center">
<template scope="scope">
<span v-html="scope.row.explain_txt"></span>
</template>
</el-table-column>
<el-table-column prop="answer_start_time" label="答题时间" header-align="center" align="center">
<template scope="scope">
<span>{{scope.row.answer_start_time}}-{{scope.row.answer_end_time}}</span>
</template>
</el-table-column>
<el-table-column prop="answer_num" label="答题次数" header-align="center"
align="center"></el-table-column>
<el-table-column prop="fraction" label="分值" header-align="center"
align="center"></el-table-column>
<el-table-column prop="create_time" label="创建时间" header-align="center"
align="center"></el-table-column>
<el-table-column label="操作" header-align="center" align="center" width="200px">
<template scope="scope">
<el-button type="primary" plain size="small" @click="openAdd(scope.row)">开始答题
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</div>
</transition>
<!-- 答题 -->
<transition name="el-zoom-in-center">
<div v-show="v=='add'" class="transition-item">
<el-card class="box-card v-box" shadow="never">
<div slot="header" class="clearfix">
<el-button icon="el-icon-back" type="text" @click="v='index'"
style="font-size: 18px">返回
</el-button>
</div>
<div style="padding: 0 5%; height:calc(100vh - 150px);overflow-y: scroll">
<div style="padding-left: 20px;padding-right: 20px">
<el-row style="text-align: center;margin-bottom: 20px">
<h2>{{viewData.name}}</h2>
<span style="color: rgb(120,120,120)">考试时间:{{viewData.answer_start_time}} - {{viewData.answer_end_time}}</span>&nbsp;&nbsp;&nbsp;
<span style="color: rgb(120,120,120)">分值:({{viewData.fraction}})</span>
</el-row>
<el-row style="margin-bottom: 20px">
<div v-html="viewData.explain_txt"></div>
</el-row>
<el-row v-for="sub,idx in viewData.subjects"
style="border-bottom: 1px solid rgb(200,200,200);padding: 20px 0;margin-bottom: 20px">
<el-col :span="1">
<span style="font-weight: bolder;color: rgb(120,120,120)">第 {{idx+1}} 题:</span>
</el-col>
<el-col :span="23">
<el-row>
<div v-html="sub.name" style="display: inline-block"></div>
<span style="color: rgb(180,180,180)" v-if="sub.type==1">[单选题]</span>
<span style="color: rgb(180,180,180)" v-if="sub.type==2">[多选题]</span>
</el-row>
<el-checkbox-group v-model="sub.val">
<el-row v-for="ans in sub.answer">
<el-row style="margin-top: 5px">
<el-radio v-if="sub.type==1" :label="ans.id" v-model="sub.val">
{{ans.option_txt}}
</el-radio>
<el-checkbox v-if="sub.type==2" :label="ans.id">{{ans.option_txt}}
</el-checkbox>
</el-row>
</el-row>
</el-checkbox-group>
</el-col>
</el-row>
</div>
<div style="width: 100%;text-align: center;margin-top: 30px">
<el-button type="primary" @click="doAdd" style="width: 70%">提交试卷</el-button>
</div>
</div>
</el-card>
</div>
</transition>
</el-row>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
searchName: "name",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
},
tableData: [],
formData: [],
viewData: {},
v: 'index',
}
},
methods: {
openAdd(row) {
this.formData = []
/*if (moment().format("HH:mm:ss") < row.answer_start_time) {
this.$message.warning("未到答题时间")
return
} else if (moment().format("HH:mm:ss") > row.answer_end_time) {
this.$message.warning("答题时间已过")
return
}*/
$.get("/platform/hd/zxdt/answer/findOne", {id: row.id}, (res) => {
const {code, data, msg} = res
if (!data) {
this.$message.warning("您今日的答题次数已用完")
return
}
if (code == 0) {
data.subjects.forEach(v => {
v.val = v.type == 1 ? "" : []
})
this.viewData = data
this.v = 'add'
} else {
this.$message.warning(msg)
}
})
},
doAdd() {
if (moment().format("HH:mm:ss") > this.viewData.answer_end_time) {
this.$notify({
title: '警告',
message: "您已超时,此次作废!",
type: 'warning'
});
this.v = 'index'
return
}
let subject = this.viewData.subjects
for (let i = 0; i < subject.length; i++) {
if (subject[i].val == "" || subject[i].val == []) {
this.$notify({
title: '警告',
message: "第" + (i + 1) + "题未答",
type: 'warning'
});
return
}
}
this.viewData.subjects.forEach(v => {
if (v.type == 1) {
this.formData.push({"papers_id": this.viewData.id, "subject_id": v.id, "answer_id": v.val})
} else if (v.type == 2) {
v.val.forEach(x => {
this.formData.push({"papers_id": this.viewData.id, "subject_id": v.id, "answer_id": x})
})
}
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
$.post(base + "/platform/hd/zxdt/answer/doAdd", {replyList: JSON.stringify(this.formData)}, (data) => {
if (data.code == 0) {
this.pageData()
this.$notify({
title: '成功',
message: "试卷已提交",
type: 'success'
});
} else {
this.$notify({
title: '错误',
message: data.msg,
type: 'error'
});
}
loading.close()
this.v = 'index'
}, "json");
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
},
pageOrder(column) {//按字段排序
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange(val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange(val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
pageData() {
sublime.showLoadingbar();
$.post(base + "/platform/hd/zxdt/answer/pageData", this.pageForm, (res) => {
const {code, msg, data} = res
if (code == 0) {
this.tableData = data.list;
this.pageForm.totalCount = data.totalCount;
sublime.closeLoadingbar();
} else {
this.$message.error(msg);
}
}, "json");
},
},
created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -1,174 +0,0 @@
<!--#
layout("/mobile/platform.html"){
#-->
<style>
[v-clock] {
display: none;
}
</style>
<div v-clock id="app" style="padding: 0 10px;">
<div v-show="showMsg"
style="margin: 1.2rem 0.20rem 0.4rem 0.20rem;padding: 0.3rem 0.34rem;text-align: center">
<div class="weui-msg">
<div class="weui-msg__icon-area">
<i v-if="flag" class="weui-icon-success weui-icon_msg"></i>
<i v-else class="weui-icon-warn weui-icon_msg"></i>
</div>
<div class="weui-msg__text-area">
<h2 class="weui-msg__title">{{msg}}</h2>
</div>
</div>
</div>
<div v-show="!showMsg" style="padding-top: 20px">
<div style="width: 100%;text-align: center;color: #1ea0fa"><h2>{{viewData.name}}</h2></div>
<div style="width: 100%;margin-top: 20px;font-size: 14px; text-align: center;color: rgb(120,120,120)">
<span>考试时间:{{viewData.answer_start_time}} - {{viewData.answer_end_time}}</span>&nbsp;&nbsp;&nbsp;
<span>分值:({{viewData.fraction}})</span>
</div>
<div style="width: 100%;margin-top: 20px" v-if="viewData.explain_txt" v-html="viewData.explain_txt">
</div>
<hr v-if="viewData.explain_txt"
style="margin-top: 20px;border: none;border-bottom: 1px rgb(150,150,150) dashed"/>
<div style="margin-top: 50px">
<van-panel style="margin: 20px 0;box-shadow: 0 0 10px rgb(220,220,220)"
v-for="sub,idx in viewData.subjects" :title="(idx+1)+'. '+ getTxt(sub.name)">
<!-- 单选-->
<div style="padding: 10px" v-if="sub.type==1">
<van-radio v-for="ans in sub.answer" :name="ans.id" v-model="sub.val"
style="padding: 10px 10px;margin: 0;box-sizing: border-box;">
<div style="width: 100%;margin: 5px 0" v-html="ans.option_txt"></div>
</van-radio>
</div>
<!-- 多选-->
<div style="padding: 10px" v-if="sub.type==2">
<van-checkbox-group style="position: relative;box-sizing: border-box;" v-model="sub.val">
<van-checkbox v-for="ans in sub.answer" shape="square" :name="ans.id"
style="padding: 10px 10px;margin: 0;box-sizing: border-box;">
<div style="width: 100%;margin: 5px 0" v-html="ans.option_txt"></div>
</van-checkbox>
</van-checkbox-group>
</div>
</van-panel>
</div>
<div style="width: 100%;text-align: center;margin-top: 30px;margin-bottom: 10px">
<van-button color="#1ea0fa" v-show="viewData!={}" type="primary" :loading="loading" @click.native="subData"
style="width: 70%">
提交试卷
</van-button>
</div>
</div>
</div>
<script>
const vue = new Vue({
el: "#app",
data() {
return {
loading: false,
showMsg: false,
showPage: false,
msg: '',
flag: false,
viewData: {},
formData: [],
getTxt(val) {
if (val) {
return val.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi, '').replace(/<[^>]+?>/g, '').replace(/\s+/g, ' ').replace(/&nbsp;/g, ' ').replace(/>/g, ' ');
}
return ''
},
}
},
methods: {
subData() {
this.formData = []
let subject = this.viewData.subjects
if (moment().format("HH:mm:ss") > this.viewData.answer_end_time) {
this.$notify({type: 'danger', message: "您已超时,此次作废!"})
this.flag = true
this.showMsg = true
return
}
for (let i = 0; i < subject.length; i++) {
if (subject[i].val == "" || subject[i].val == []) {
this.$notify({type: 'warning', message: "第" + (i + 1) + "题未答"})
return
}
}
this.viewData.subjects.forEach(v => {
if (v.type == 1) {
this.formData.push({"papers_id": this.viewData.id, "subject_id": v.id, "answer_id": v.val})
} else if (v.type == 2) {
v.val.forEach(x => {
this.formData.push({"papers_id": this.viewData.id, "subject_id": v.id, "answer_id": x})
})
}
})
this.loading = true
$.post("/platform/hd/zxdt/mobile/answer/doAdd", {replyList: JSON.stringify(this.formData)}, (res) => {
if (res.code == 0) {
this.loading = false
this.msg = '您的答卷已提交,感谢您的参与!'
this.flag = true
this.showMsg = true
} else {
this.$notify({type: 'danger', message: res.msg})
}
})
},
pageData() {
this.formData = []
$.get("/platform/hd/zxdt/mobile/answer/findOne", (res) => {
const {code, data, msg} = res
if (!data) {
this.msg = "您今日的答题次数已用完"
this.flag = true
this.showMsg = true
return
}
if (code == 0) {
if (moment().format("HH:mm:ss") < data.answer_start_time) {
this.msg = "未到答题时间"
this.flag = true
this.showMsg = true
return
} else if (moment().format("HH:mm:ss") > data.answer_end_time) {
this.msg = "答题时间已过"
this.flag = true
this.showMsg = true
return
}
data.subjects.forEach(v => {
v.val = v.type === 1 ? "" : []
})
this.viewData = data
this.showMsg = false
} else {
this.msg = msg
this.showMsg = true
}
})
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -1,665 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<!-- 在线答题-试卷管理 -->
<style>
#qsmEditor .w-e-text-container {
height: 450px !important;
}
#qsmEditor div {
z-index: 0 !important;
}
.el-divider {
background-color: #409EFF;
}
.el-divider__text {
color: #409EFF;
}
.inputParent input {
border: none;
border-bottom: 1px solid rgb(220, 223, 230);
border-radius: 0;
}
.issueList > .el-table__header-wrapper {
display: none;
}
.issueList .el-table__expanded-cell {
background-color: rgb(250, 250, 250) !important;
}
</style>
<div id="app" v-cloak>
<el-row class="transition-row">
<transition name="el-zoom-in-center">
<div v-show="v=='index'" class="transition-item">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<template slot="prepend">试卷名称</template>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button icon="el-icon-search" @click="doSearch"
style="background-color:#409eff;color: white;"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" type="primary" plain @click="openAdd"><i class="ti-plus"></i>新建试卷
</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" size="medium" header-align="center" align="center" style="width: 100%">
<el-table-column
label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="name" label="试卷名称" header-align="center"
align="center"></el-table-column>
<el-table-column prop="explain_txt" label="说明" show-overflow-tooltip header-align="center"
align="center">
<template scope="scope">
<span v-html="scope.row.explain_txt"></span>
</template>
</el-table-column>
<el-table-column prop="answer_start_time" label="答题时间" header-align="center" align="center">
<template scope="scope">
<span>{{scope.row.answer_start_time}}-{{scope.row.answer_end_time}}</span>
</template>
</el-table-column>
<el-table-column prop="answer_num" label="答题次数" header-align="center"
align="center"></el-table-column>
<el-table-column prop="fraction" label="分值" header-align="center"
align="center"></el-table-column>
<el-table-column prop="create_time" label="创建时间" header-align="center"
align="center"></el-table-column>
<el-table-column align="center" label="在线答题二维码">
<template slot-scope="scope">
<el-button size="small" plain type="primary" @click="saveCode(scope.row.id)">保存二维码
</el-button>
</template>
</el-table-column>
<el-table-column label="操作" header-align="center" align="center" width="200px">
<template scope="scope">
<el-button size="small" @click="openView(scope.row.id)">查看</el-button>
<el-button size="small" type="primary"
@click="openEdit(scope.row.id)" plain>编辑
</el-button>
<el-button size="small" type="danger"
@click="doDelete(scope.row.id)" plain>删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</div>
</transition>
<!-- 新增、修改 -->
<transition name="el-zoom-in-center">
<div v-show="v=='add'||v=='edit'" class="transition-item">
<el-card class="box-card v-box" shadow="never">
<div slot="header" class="clearfix">
<el-button icon="el-icon-back" type="text" @click="v='index'"
style="font-size: 18px">返回
</el-button>
</div>
<div style="padding: 0 5%; height:calc(100vh - 150px);overflow-y: scroll">
<el-row v-loading="loading">
<el-steps :active="stepActive" simple finish-status="success">
<el-step title="试卷信息" description=""></el-step>
<el-step title="选择题目" description=""></el-step>
</el-steps>
<transition name="el-zoom-in-top">
<div v-show="stepActive==0" class="transition-box" style="margin-top: 20px;">
<el-form ref="addForm" :model="formData" label-width="60px" label-position="right"
:rules="formRules">
<el-form-item label="试卷名称" class="is-required" prop="name" label-width="120px">
<el-input v-model="formData.name"
placeholder="请填写试卷名称"></el-input>
</el-form-item>
<el-row :gutter="20">
<el-col :span="7">
<el-form-item label="可答次数" class="is-required" prop="answer_num"
label-width="120px">
<el-input-number style="width: 100%" v-model="formData.answer_num"
controls-position="right"
:min="1" :max="100"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="分值" class="is-required" prop="fraction"
label-width="120px">
<el-input-number style="width: 100%" v-model="formData.fraction"
controls-position="right"
:min="1" :max="200"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="答题时间" prop="answer_time"
label-width="200px">
<el-time-picker
value-format="HH:mm:ss"
style="width: 100%"
is-range
v-model="formData.answer_time"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
placeholder="选择时间范围">
</el-time-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="说明" prop="explain_txt" label-width="120px">
<div id="qsmEditor"></div>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button type="primary" @click="next">下一步</el-button>
</div>
</div>
</transition>
<transition name="el-zoom-in-bottom">
<div v-show="stepActive==1" class="transition-box" style="margin-top: 20px;">
<el-row type="flex" justify="end" :gutter="20">
<div class="btn-group tool-button mt5" style="margin-right: 5px">
<el-input placeholder="请输入题目" size="small"
v-model="subjectForm.searchKeyword"></el-input>
</div>
<div class="btn-group tool-button mt5" style="margin-right: 5px">
<el-select v-model="subjectForm.type" clearable size="small"
placeholder="题型">
<el-option
v-for="item in typeOptions"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="pull-right offscreen-right mt5">
<el-button icon="el-icon-search" @click="doSubjectSearch"
style="background-color:#409eff;color: white;"
size="small"></el-button>
</div>
</el-row>
<el-table :data="subjectTable" row-key="id" ref="multipleSubject"
@selection-change="handleSelectionChange" size="medium"
@select="selectCheckbox">
<el-table-column type="selection" width="55"
reserve-selection></el-table-column>
<el-table-column align="center" type="index" header-align="center"
label="序号" width="55">
<template scope="scope">
<span>{{scope.$index+(subjectForm.pageNumber - 1) * subjectForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="name" show-overflow-tooltip label="题目"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="type" label="题型" header-align="center" align="center"
width="80px">
<template scope="scope">
<span v-if="scope.row.type==1">单选</span>
<span v-if="scope.row.type==2">多选</span>
</template>
</el-table-column>
<el-table-column prop="option_txt" show-overflow-tooltip label="正确答案"
header-align="center"
align="center"></el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="subjectSizeChange"
@current-change="subjectNumberChange"
:current-page="subjectForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="subjectForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="subjectForm.totalCount">
</el-pagination>
</el-row>
<div style="float: right;margin: 20px 0">
<el-button @click="stepActive=0">上一步</el-button>
<el-button type="primary" :disabled="subDis" @click="operation">提
交
</el-button>
</div>
</div>
</transition>
</el-row>
</div>
</el-card>
</div>
</transition>
<!-- 查看 -->
<transition name="el-zoom-in-center">
<div v-show="v=='view'" class="transition-item">
<el-card class="box-card v-box" shadow="never">
<div slot="header" class="clearfix">
<el-button icon="el-icon-back" type="text" @click="v='index'"
style="font-size: 18px">返回
</el-button>
</div>
<div style="padding: 0 5%; height:calc(100vh - 150px);overflow-y: scroll">
<div style="padding-left: 20px;padding-right: 20px">
<el-row style="text-align: center;margin-bottom: 20px">
<h2>{{viewData.name}}</h2>
<span style="color: rgb(120,120,120)">考试时间:{{viewData.answer_start_time}} - {{viewData.answer_end_time}}</span>&nbsp;&nbsp;&nbsp;
<span style="color: rgb(120,120,120)">分值:({{viewData.fraction}})</span>
</el-row>
<el-row style="margin-bottom: 20px">
<div v-html="viewData.explain_txt"></div>
</el-row>
<el-row v-for="sub,idx in viewData.subjects"
style="border-bottom: 1px solid rgb(200,200,200);padding: 20px 0;margin-bottom: 20px">
<el-col :span="1">
<span style="font-weight: bolder">{{idx+1}}.</span>
</el-col>
<el-col :span="23">
<el-row>
<div v-html="sub.name"></div>
</el-row>
<el-checkbox-group v-model="sub.val">
<el-row v-for="ans,idx2 in sub.answer">
<el-row style="margin-top: 5px">
<el-radio v-if="sub.type==1" :label="ans.id" v-model="sub.val">
{{ans.option_txt}}
</el-radio>
<el-checkbox v-if="sub.type==2" :label="ans.id">
{{ans.option_txt}}
</el-checkbox>
</el-row>
</el-row>
</el-checkbox-group>
</el-col>
</el-row>
</div>
</div>
</el-card>
</div>
</transition>
</el-row>
<a id="download" style="display: none"></a>
<div id="qrcode" style="display: none;width: 500px;height: 500px"></div>
</div>
<script src="${base!}/assets/platform/js/jquery.qrcode.min.js"></script>
<script>
let qsmEditor
const vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
searchName: "name",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
},
subjectForm: {
searchName: "sub.name",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
type: ""
},
viewData: {},
formData: {},
subjectTable: [],
tableData: [],
multipleSelection: [],
multipleSelection2: [],
stepActive: 0,
tabKey: new Date().getTime(),
v: 'index',
loading: false,
subDis: false,
redirect_uri: location.protocol + "//" + location.host,
formRules: {
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
fraction: [{required: true, message: '必填', trigger: ['blur', 'change']}],
answer_num: [{required: true, message: '必填', trigger: ['blur', 'change']}],
answer_time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
typeOptions: [{id: 1, name: "单选题"}, {id: 2, name: "多选题"}],
}
},
methods: {
IEVersion() {
let userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
let isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
let isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
let isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
if (isIE) {
let reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
let fIEVersion = parseFloat(RegExp["$1"]);
if (fIEVersion == 7) {
return 7;
} else if (fIEVersion == 8) {
return 8;
} else if (fIEVersion == 9) {
return 9;
} else if (fIEVersion == 10) {
return 10;
} else {
return 6;//IE版本<=7
}
} else if (isEdge) {
return 'edge';//edge
} else if (isIE11) {
return 11; //IE11
} else {
return -1;//不是ie浏览器
}
},
dwnCode(name) {
let type = 'png';
if (this.IEVersion() != -1) {
let blob = $("canvas").get(0).msToBlob();
window.navigator.msSaveBlob(blob, name + '_' + (new Date()).getTime() + '.' + type);
} else {
$('#download').attr({
href: $("canvas").get(0).toDataURL('image/png').replace("image/png", "image/octet-stream"),
download: name + '_' + (new Date()).getTime() + '.' + type
}).get(0).click();
}
},
saveCode(id) {
let self = this
$("#qrcode").html("")
$("#qrcode").qrcode({
render: "canvas",
width: $("#qrcode").width(),
height: $("#qrcode").width(),
text: self.redirect_uri + '/platform/hd/zxdt/mobile/answer?papers_id=' + id,
correctLevel: 3
});
this.$nextTick(() => {
this.dwnCode("在线答题")
})
},
selectCheckbox(selection, row) {
const checked = selection.some(v => v.id == row.id)
if (checked) {
this.multipleSelection2.push(row.id)
} else {
this.multipleSelection2.splice(this.multipleSelection2.findIndex(v => v == row.id), 1)
}
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
next() {
if (!this.formData.explain_txt || !dd3s.html2txt(this.formData.explain_txt)) {
this.$message.warning("请填写说明")
return
}
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.stepActive = 1
}
})
},
openView(id) {
$.get("/platform/hd/zxdt/papers/findOne", {id: id}, (res) => {
const {code, data, msg} = res
if (code == 0) {
this.viewData = data
data.subjects.forEach(v => {
if (v.type == 2) {
v.val = []
v.answer.map((x) => {
if (x.is_yes) {
v.val.push(x.id)
}
})
} else {
v.val = v.answer.find(x => x.is_yes).id
}
})
this.v = 'view'
} else {
this.$message.error(msg)
}
})
},
doDelete(id) {
let that = this
this.$confirm('确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback(a, b) {
if ("confirm" == a) {
$.post(base + "/platform/hd/zxdt/papers/delete", {id: id}, (data) => {
if (data.code == 0) {
that.$message.success(data.msg);
that.pageData();
} else {
that.$message.error(data.msg);
}
}, "json");
}
}
});
},
openAdd() {
this.v = 'add'
this.formData = {}
this.stepActive = 0
this.tabKey = new Date().getTime()
this.multipleSelection = []
this.subjectTable = []
this.$nextTick(() => {
$('#qsmEditor').html("")
E = window.wangEditor
qsmEditor = new E('#qsmEditor')
qsmEditor.config.uploadImgShowBase64 = true
qsmEditor.config.onchange = (html) => {
this.$set(this.formData, "explain_txt", html)
}
qsmEditor.create()
})
this.subjectData()
},
openEdit(id) {
this.stepActive = 0
this.tabKey = new Date().getTime()
this.multipleSelection = []
this.subjectTable = []
$.get("/platform/hd/zxdt/papers/findOne", {id: id}, (res) => {
const {code, data, msg} = res
if (code == 0) {
$('#qsmEditor').html(data.explain_txt)
E = window.wangEditor
qsmEditor = new E('#qsmEditor')
qsmEditor.config.onchange = (html) => {
this.$set(this.formData, "explain_txt", html)
}
qsmEditor.create()
this.formData = data
if (this.formData.answer_start_time && this.formData.answer_end_time) {
this.$set(this.formData, 'answer_time', [this.formData.answer_start_time, this.formData.answer_end_time])
}
this.multipleSelection = data.subjects.map(v => {
return v.id
})
this.multipleSelection2 = this.multipleSelection
this.subjectData()
this.v = "edit"
} else {
this.$message.error(msg)
}
})
},
operation() {
let url
if (this.v == 'edit') {
url = "/platform/hd/zxdt/papers/doEdit"
} else if (this.v == 'add') {
url = "/platform/hd/zxdt/papers/doAdd"
}
if (this.multipleSelection.length == 0) {
this.$message.warning('请选择题目!');
return
}
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.formData.answer_start_time = this.formData.answer_time[0]
this.formData.answer_end_time = this.formData.answer_time[1]
this.$refs["addForm"].validate((valid) => {
if (valid) {
$.post(base + url, {
papers: JSON.stringify(this.formData),
subject: JSON.stringify(this.multipleSelection)
}, (data) => {
if (data.code == 0) {
this.v = 'index'
this.pageData()
this.$message.success(data.msg)
} else {
this.$message.error(data.msg);
}
loading.close()
}, "json");
}
})
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
},
pageOrder(column) {//按字段排序
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange(val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange(val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
doSubjectSearch() {
this.subjectForm.pageNumber = 1;
this.subjectData();
},
subjectNumberChange(val) {//页码更新操作
this.subjectForm.pageNumber = val;
this.subjectData();
},
subjectSizeChange(val) {//分页大小更新操作
this.subjectForm.pageSize = val;
this.subjectData();
},
pageData() {//加载分页数据
sublime.showLoadingbar();
$.post(base + "/platform/hd/zxdt/papers/pageData", this.pageForm, (res) => {
const {code, msg, data} = res
if (code == 0) {
this.tableData = data.list;
this.pageForm.totalCount = data.totalCount;
sublime.closeLoadingbar();
} else {
this.$message.error(msg);
}
}, "json");
},
subjectData() {
sublime.showLoadingbar();
$.post(base + "/platform/hd/zxdt/papers/findSubject", this.subjectForm, (res) => {
const {code, msg, data} = res
if (code == 0) {
this.subjectTable = data.list;
this.subjectForm.totalCount = data.totalCount;
this.$nextTick(() => {
const arr = JSON.parse(JSON.stringify(this.multipleSelection2))
this.subjectTable.forEach(v => {
if (arr.includes(v.id)) {
this.$refs.multipleSubject.toggleRowSelection(v, true)
}
})
})
sublime.closeLoadingbar();
} else {
this.$message.error(msg);
}
}, "json");
},
},
created() {
this.pageData();
},
})
</script>
<!--#
}
#-->
@@ -1,240 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<!-- 在线答题-数据分析 -->
<style>
#qsmEditor .w-e-text-container {
height: 450px !important;
}
#qsmEditor div {
z-index: 0 !important;
}
.el-divider {
background-color: #409EFF;
}
.el-divider__text {
color: #409EFF;
}
.inputParent input {
border: none;
border-bottom: 1px solid rgb(220, 223, 230);
border-radius: 0;
}
.subList > .el-table__header-wrapper {
display: none;
}
.subList .el-table__expanded-cell {
background-color: rgb(250, 250, 250) !important;
}
</style>
<div id="app" v-cloak>
<el-row class="transition-row">
<transition name="el-zoom-in-center">
<div v-show="v=='index'" class="transition-item">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<template slot="prepend">试卷名称</template>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button icon="el-icon-search" @click="doSearch"
style="background-color:#409eff;color: white;"></el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" size="medium" header-align="center" align="center" style="width: 100%">
<el-table-column
label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="name" label="试卷名称" header-align="center"
align="center"></el-table-column>
<el-table-column prop="explain_txt" label="说明" show-overflow-tooltip header-align="center"
align="center">
<template scope="scope">
<span v-html="scope.row.explain_txt"></span>
</template>
</el-table-column>
<el-table-column prop="answer_start_time" label="答题时间" header-align="center" align="center">
<template scope="scope">
<span>{{scope.row.answer_start_time}}-{{scope.row.answer_end_time}}</span>
</template>
</el-table-column>
<el-table-column prop="answer_num" label="答题次数" header-align="center"
align="center"></el-table-column>
<el-table-column prop="fraction" label="分值" header-align="center"
align="center"></el-table-column>
<el-table-column prop="create_time" label="创建时间" header-align="center"
align="center"></el-table-column>
<el-table-column label="操作" header-align="center" align="center" width="200px">
<template scope="scope">
<el-button type="primary" plain size="small" @click="openView(scope.row.id)">查看详情
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</div>
</transition>
<!-- 查看 -->
<transition name="el-zoom-in-center">
<div v-show="v=='view'" class="transition-item">
<el-card class="box-card v-box" shadow="never">
<div slot="header" class="clearfix">
<el-button icon="el-icon-back" type="text" @click="v='index'"
style="font-size: 18px">返回
</el-button>
</div>
<div style="padding: 0 5%; height:calc(100vh - 150px);overflow-y: scroll">
<el-row style="text-align: center;margin-bottom: 20px">
<h2>{{viewData.hd_papers.name}}</h2>
<span style="color: rgb(120,120,120)">考试时间:{{viewData.hd_papers.answer_start_time}} - {{viewData.hd_papers.answer_end_time}}</span>&nbsp;&nbsp;&nbsp;
<span style="color: rgb(120,120,120)">分值:({{viewData.hd_papers.fraction}})</span>
</el-row>
<el-row style="margin-bottom: 20px">
<div v-html="viewData.hd_papers.explain_txt"></div>
</el-row>
<el-row v-for="sub,idx in viewData.hd_papers.subjects">
<el-row>
<span style="font-weight: bolder;color: rgb(120,120,120)">第 {{idx+1}} 题:</span>
<div v-html="sub.name" style="display: inline-block"></div>
<span style="color: rgb(180,180,180)" v-if="sub.type==1">[单选题]</span>
<span style="color: rgb(180,180,180)" v-if="sub.type==2">[多选题]</span>
</el-row>
<el-row style="margin: 20px 0">
<el-table :row-class-name="tableRowClassName" :data="sub.answer"
header-align="center"
style="width: 100%">
<el-table-column prop="option_txt" label="选项" header-align="center" align="center">
<template scope="scope">
{{scope.row.option_txt}}
</template>
</el-table-column>
<el-table-column prop="xj" label="小计" header-align="center" align="center">
</el-table-column>
<el-table-column prop="bl" label="比例" header-align="center" align="center">
<template scope="scope">
<el-progress v-if="scope.row.bl!=undefined"
:percentage="scope.row.bl"></el-progress>
</template>
</el-table-column>
</el-table>
</el-row>
</el-row>
</div>
</el-card>
</div>
</transition>
</el-row>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
searchName: "name",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
},
viewData: {hd_papers: {subjects: [{answer: []}]}},
tableData: [],
v: 'index',
}
},
methods: {
tableRowClassName(row) {
if (!row.row.bl) {
return 'last-row';
}
return '';
},
openView(id) {
$.get("/platform/hd/zxdt/result/findOne", {id: id}, (res) => {
const {code, data, msg} = res
if (code == 0) {
data.hd_papers.subjects.forEach((sub) => {
sub.answer.forEach((ans) => {
ans.xj = data[sub.id].hasOwnProperty(ans.id) ? data[sub.id][ans.id] : 0
ans.bl = (ans.xj / data[sub.id].yxs).toFixed(2) * 100
ans.bl = isNaN(ans.bl) ? 0 : ans.bl
})
sub.answer.push({option_txt: '本题有效填写人次', xj: data[sub.id].yxs})
}
)
this.viewData = data
this.v = 'view'
} else {
this.$message.error(msg)
}
})
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
},
pageOrder(column) {//按字段排序
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange(val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange(val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
pageData() {//加载分页数据
sublime.showLoadingbar();
$.post(base + "/platform/hd/zxdt/result/pageData", this.pageForm, (res) => {
const {code, msg, data} = res
if (code == 0) {
this.tableData = data.list;
this.pageForm.totalCount = data.totalCount;
sublime.closeLoadingbar();
} else {
this.$message.error(msg);
}
}, "json");
},
},
created() {
this.pageData();
},
})
</script>
<!--#
}
#-->
@@ -1,486 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<!-- 在线答题-题库管理 -->
<style>
.el-divider {
background-color: #409EFF;
}
.el-divider__text {
color: #409EFF;
}
.inputParent input {
border: none;
border-bottom: 1px solid rgb(220, 223, 230);
border-radius: 0;
}
.issueList > .el-table__header-wrapper {
display: none;
}
.issueList .el-table__expanded-cell {
background-color: rgb(250, 250, 250) !important;
}
</style>
<div id="app" v-cloak>
<el-row class="transition-row">
<transition name="el-zoom-in-center">
<div v-show="v=='index'" class="transition-item">
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<template slot="prepend">题目</template>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.type" clearable
placeholder="题型">
<el-option
v-for="item in typeOptions"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button icon="el-icon-search" @click="doSearch"
style="background-color:#409eff;color: white;"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" type="primary" @click="openAdd"><i class="ti-plus"></i>新建题目
</el-button>
</div>
</el-row>
<el-row class="el-table-container">
<el-table :data="tableData" size="medium" header-align="center" align="center" style="width: 100%">
<el-table-column
label="序号" type="index" header-align="center" align="center">
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column prop="name" show-overflow-tooltip label="题目" header-align="center"
align="center"></el-table-column>
<el-table-column prop="type" label="题型" header-align="center" align="center">
<template scope="scope">
<span v-if="scope.row.type==1">单选</span>
<span v-if="scope.row.type==2">多选</span>
</template>
</el-table-column>
<el-table-column prop="create_time" label="创建时间" header-align="center"
align="center"></el-table-column>
<el-table-column label="操作" header-align="center" align="center" width="230px">
<template scope="scope">
<el-button size="small" @click="openView(scope.row.id)">查看</el-button>
<el-button size="small" type="primary"
@click="openEdit(scope.row.id)">编辑
</el-button>
<el-button size="small" type="danger"
@click="doDelete(scope.row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</div>
</transition>
<transition name="el-zoom-in-center">
<div v-show="v=='add'||v=='edit'" class="transition-item">
<el-card class="box-card v-box" shadow="never">
<div slot="header" class="clearfix">
<el-button icon="el-icon-back" type="text" @click="v='index'"
style="font-size: 18px">返回
</el-button>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" type="primary" @click="operation">确 定</el-button>
</div>
</div>
<div style="padding: 0 5%; height:calc(100vh - 150px);overflow-y: scroll">
<el-form :model="formData" ref="addForm" label-position="right" :rules="formRules" size="small"
label-width="80px">
<el-form-item prop="name" label="题目名称">
<el-input size="medium" type="textarea" placeholder="请输入题目名称"
v-model="formData.name"
></el-input>
</el-form-item>
<el-form-item prop="type" label="题目类型">
<el-radio-group v-model="formData.type">
<el-radio :label="1">单选</el-radio>
<el-radio :label="2">多选</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<el-row>
<el-col :span="22">
<el-divider content-position="left" class="dia">
<span style="color: #3ea1ec;">题目选项</span>
</el-divider>
</el-col>
<el-col :span="2" style="text-align: right">
<el-button @click="formData.answer.push({option_txt:''})"
style="margin-top: 10px"
icon="el-icon-plus"
type="warning" size="mini"></el-button>
</el-col>
</el-row>
<el-row>
<el-checkbox-group v-model="checkVal">
<el-table :data="formData.answer" header-align="center"
style="width: 100%">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="option_txt" label="选项" header-align="center"
align="center">
<template slot-scope="scope">
<el-input placeholder="请输入选项名" maxlength="100"
v-model="scope.row.option_txt"></el-input>
</template>
</el-table-column>
<el-table-column prop="is_yes" label="正确答案" header-align="center" width="100px"
align="center">
<template slot-scope="scope">
<el-radio v-model="is_yes" :label="scope.$index+1"
v-if="formData.type==1">&nbsp;
</el-radio>
<el-checkbox :label="scope.$index+1"
v-if="formData.type==2">&nbsp;
</el-checkbox>
</template>
</el-table-column>
<el-table-column label="操作" header-align="center" width="150px" align="center">
<template slot-scope="scope">
<el-button icon="el-icon-delete" type="danger"
@click="delOptionX(scope)"></el-button>
</template>
</el-table-column>
</el-table>
</el-checkbox-group>
</el-row>
</div>
</el-card>
</div>
</transition>
<transition name="el-zoom-in-center">
<div v-show="v=='view'" class="transition-item">
<el-card class="box-card v-box" shadow="never">
<div slot="header" class="clearfix">
<el-button icon="el-icon-back" type="text" @click="v='index'"
style="font-size: 18px">返回
</el-button>
</div>
<div style="padding: 0 5%; height:calc(100vh - 150px);overflow-y: scroll">
<el-form :model="viewData" ref="addForm" label-position="right" size="small"
label-width="80px">
<el-form-item prop="name" label="题目名称">
<el-input readonly size="medium" type="textarea"
v-model="viewData.name"
></el-input>
</el-form-item>
<el-form-item prop="type" label="题目类型">
<el-radio-group v-model="viewData.type">
<el-radio disabled :label="1">单选</el-radio>
<el-radio disabled :label="2">多选</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<el-row>
<el-col :span="22">
<el-divider content-position="left" class="dia">
<span style="color: #3ea1ec;">题目选项</span>
</el-divider>
</el-col>
</el-row>
<el-row>
<el-checkbox-group v-model="checkVal">
<el-table :data="viewData.answer" header-align="center"
style="width: 100%">
<el-table-column type="index" label="序号"></el-table-column>
<el-table-column prop="option_txt" label="选项" header-align="center"
align="center">
<template slot-scope="scope">
<el-input readonly maxlength="100"
v-model="scope.row.option_txt"></el-input>
</template>
</el-table-column>
<el-table-column readonly prop="is_yes" label="正确答案" header-align="center"
width="100px"
align="center">
<template slot-scope="scope">
<el-radio disabled v-model="is_yes" :label="scope.$index+1"
v-if="viewData.type==1">&nbsp;
</el-radio>
<el-checkbox disabled :label="scope.$index+1"
v-if="viewData.type==2">&nbsp;
</el-checkbox>
</template>
</el-table-column>
</el-table>
</el-checkbox-group>
</el-row>
</div>
</el-card>
</div>
</transition>
</el-row>
</div>
<script>
const vue = new Vue({
el: '#app',
data() {
return {
pageForm: {
searchName: "name",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
type: ""
},
viewData: {},
formData: {type: 1, answer: [{}, {}, {}, {}]},
checkVal: [],
is_yes: '',
tableData: [],
delOption: [],
v: 'index',
formRules: {
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
option_txt: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
typeOptions: [{id: 1, name: "单选题"}, {id: 2, name: "多选题"}]
}
},
methods: {
delOptionX(scope) {
this.delOption = []
if (scope.row.id) {
this.delOption.push(scope.row.id)
}
if (this.formData.type == 1 && scope.$index == this.is_yes - 1) {
this.is_yes = ''
}
if (this.formData.type == 2) {
this.checkVal.splice(this.checkVal.indexOf(scope.$index + 1), 1)
}
this.formData.answer.splice(scope.$index, 1)
},
openView(id) {
$.get("/platform/hd/zxdt/subject/findOne", {id: id}, (res) => {
const {code, data, msg} = res
if (code == 0) {
this.viewData = data
if (data.type == 2) {
data.answer.forEach((val, idx) => {
if (val.is_yes) {
this.checkVal.push(idx + 1)
}
})
} else {
data.answer.forEach((val, idx) => {
if (val.is_yes) {
this.is_yes = idx + 1
}
})
}
this.v = 'view'
} else {
this.$message.error(msg)
}
})
},
doDelete(id) {
let that = this
this.$confirm('确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback(a, b) {
if ("confirm" == a) {//确认后再执行
$.get(base + "/platform/hd/zxdt/subject/delete", {id: id}).then(res => {
if (res.code == 0) {
that.$message.success(res.msg);
that.pageData();
} else {
that.$message.warning(res.msg);
}
}).catch(err => {
that.$message.error(err.msg);
});
}
}
});
},
openAdd() {
this.formData = {type: 1, answer: [{}, {}, {}, {}]}
this.is_yes = ''
this.checkVal = []
this.v = 'add'
},
openEdit(id) {
$.get("/platform/hd/zxdt/subject/findOne", {id: id}, (res) => {
const {code, data, msg} = res
if (code == 0) {
this.formData = data
if (data.type == 2) {
data.answer.forEach((val, idx) => {
if (val.is_yes) {
this.checkVal.push(idx + 1)
}
})
} else {
data.answer.forEach((val, idx) => {
if (val.is_yes) {
this.is_yes = idx + 1
}
})
}
this.v = "edit"
} else {
this.$message.error(msg)
}
})
},
operation() {
let url
if (this.formData.answer.length < 0) {
this.$message.warning('请至少添加一个选项!');
return
}
for (let i = 0; i < this.formData.answer.length; i++) {
if (!this.formData.answer[i].option_txt) {
this.$message.warning('第 ' + (i + 1) + " 个选项的名字未填写!");
return
}
}
if (this.formData.type == '2') {
if (this.checkVal.length < 1) {
this.$message.warning('请至少选择一个选项为正确答案!');
return
}
} else {
if (!this.is_yes) {
this.$message.warning('请至少选择一个选项为正确答案!');
return
}
}
if (this.v == 'edit') {
url = "/platform/hd/zxdt/subject/doEdit"
} else if (this.v == 'add') {
url = "/platform/hd/zxdt/subject/doAdd"
}
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.$refs["addForm"].validate((valid) => {
if (valid) {
this.formData.answer.forEach((value) => {
value.is_yes = false
})
if (this.formData.type == "2") {
this.checkVal.forEach((v) => {
this.formData.answer[parseInt([v]) - 1].is_yes = true
})
} else {
this.formData.answer[parseInt([this.is_yes]) - 1].is_yes = true
}
$.post(base + url, {
subject: JSON.stringify(this.formData),
delOption: JSON.stringify(this.delOption)
}, (data) => {
if (data.code == 0) {
this.v = 'index'
this.pageData()
this.$message.success(data.msg)
} else {
this.$message.error(data.msg);
}
loading.close()
}, "json");
}
})
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
},
pageOrder(column) {//按字段排序
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange(val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange(val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
pageData() {//加载分页数据
sublime.showLoadingbar();
$.post(base + "/platform/hd/zxdt/subject/pageData", this.pageForm, (res) => {
const {code, msg, data} = res
if (code == 0) {
this.tableData = data.list;
this.pageForm.totalCount = data.totalCount;
sublime.closeLoadingbar();
} else {
this.$message.error(msg);
}
}, "json");
}
,
},
created() {
this.pageData();
},
})
</script>
<!--#
}
#-->
@@ -22,39 +22,42 @@ layout("/layouts/platform.html"){
</style>
<div id="app" v-cloak style="padding: 20px 40px">
<div id="app" style="padding: 20px 40px" v-cloak>
<el-card class="box-card">
<div slot="header" class="clearfix">
<div class="clearfix" slot="header">
<span style="color: #409EFF;font-size: 18px">填写申报信息</span>
</div>
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px" label-suffix=":">
<el-form :model="formData" :rules="formRules" label-suffix=":" label-width="120px"
ref="form">
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="user_name" label="申请人姓名">
<el-input disabled v-model="formData.user_name" type="text"></el-input>
<el-form-item label="申请人姓名" prop="user_name">
<el-input disabled type="text" v-model="formData.user_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="apply_time" label="申报时间">
<el-input disabled v-model="formData.apply_time" type="text"></el-input>
<el-form-item label="申报时间" prop="apply_time">
<el-input disabled type="text" v-model="formData.apply_time"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="mobile" label="联系方式">
<el-input v-model="formData.mobile" type="text"></el-input>
<el-form-item label="联系方式" prop="mobile">
<el-input placeholder="请输入联系方式" type="number"
v-model="formData.mobile"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="activity_type" label="活动主体类型">
<el-select v-model="formData.activity_type" placeholder="请选择活动主体类型" style="width: 100%"
@change="getProjectCodeChange">
<el-form-item label="活动主体类型" prop="activity_type">
<el-select @change="getProjectCodeChange" placeholder="请选择活动主体类型"
style="width: 100%"
v-model="formData.activity_type">
<el-option
v-for="item in activityType"
:key="item.id"
:label="item.name+' ('+item.code+')'"
:value="item.code">
:value="item.code"
v-for="item in activityType">
</el-option>
<!-- <span>
@@ -74,31 +77,34 @@ layout("/layouts/platform.html"){
<el-col :span="12">
<el-form-item prop="activity_name" label="活动名称">
<el-autocomplete style="width: 100%"
v-model="formData.activity_name"
:fetch-suggestions="querySearchAsync"
placeholder="请输入内容"
@select="handleSelect"
@input="activityChange"
></el-autocomplete>
<el-form-item label="活动名称" prop="activity_name">
<!-- <el-autocomplete :fetch-suggestions="querySearchAsync"
@input="activityChange"
@select="handleSelect"
placeholder="请输入内容"
style="width: 100%"
v-model="formData.activity_name"
></el-autocomplete>-->
<el-input placeholder="请输入活动名称"
v-model="formData.activity_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="projectCode" label="项目编号">
<el-input disabled v-model="formData.projectCode" placeholder="选择活动类型自动生成"></el-input>
<el-form-item label="项目编号" prop="projectCode">
<el-input disabled placeholder="选择活动类型自动生成"
v-model="formData.projectCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="projectTypeCode" label="活动项目类型">
<el-select v-model="formData.projectTypeCode" placeholder="请选择活动类型"
style="width: 100%;">
<el-form-item label="活动项目类型" prop="projectTypeCode">
<el-select placeholder="请选择活动类型" style="width: 100%;"
v-model="formData.projectTypeCode">
<el-option
v-for="item in projectType"
:key="item.id"
:label="item.name+' ('+item.code+')'"
:value="item.code">
:value="item.code"
v-for="item in projectType">
</el-option>
</el-select>
</el-form-item>
@@ -106,20 +112,22 @@ layout("/layouts/platform.html"){
<el-col :span="12">
<el-form-item prop="fundsUnitName" label="申报(承办)单位" v-show="formData.activity_type!=40003">
<el-input v-model="formData.fundsUnitName" type="text"
placeholder="请输入申报(承办)单位"></el-input>
<el-form-item label="申报(承办)单位" prop="fundsUnitName"
v-show="formData.activity_type!=40003">
<el-input placeholder="请输入申报(承办)单位" type="text"
v-model="formData.fundsUnitName"></el-input>
</el-form-item>
<el-form-item prop="fundsUnitName" label="申报(承办)单位" v-show="formData.activity_type==40003">
<el-select v-model="formData.fundsUnitName"
placeholder="请选择申报(承办)单位"
style="width: 100%;">
<el-form-item label="申报(承办)单位" prop="fundsUnitName"
v-show="formData.activity_type==40003">
<el-select placeholder="请选择申报(承办)单位"
style="width: 100%;"
v-model="formData.fundsUnitName">
<el-option
v-for="item in fundsUnitNameOption"
:key="item.name"
:label="item.name+' ('+item.code+')'"
:value="item.name">
:value="item.name"
v-for="item in fundsUnitNameOption">
</el-option>
</el-select>
@@ -142,59 +150,66 @@ layout("/layouts/platform.html"){
<el-col :span="12">
<el-form-item prop="plannedDate" label="活动计划时间">
<el-form-item label="活动计划时间" prop="plannedDate">
<el-date-picker
style="width: 100%"
v-model="formData.plannedDate"
type="daterange"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期">
style="width: 100%"
type="daterange"
v-model="formData.plannedDate"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="address" label="活动地址">
<el-input maxlength="50" placeholder="请填写活动地址" v-model="formData.address"
type="text"></el-input>
<el-form-item label="活动地址" prop="address">
<el-input maxlength="50" placeholder="请填写活动地址" type="text"
v-model="formData.address"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="活动人数" prop="activity_number">
<el-input maxlength="50" placeholder="请填写活动人数"
type="number"
v-model="formData.activity_number"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="funds_money" label="申报金额">
<el-input disabled v-model="formData.funds_money" placeholder="输入物品单价自动计算"
type="number"></el-input>
<el-form-item label="申报金额" prop="funds_money">
<el-input disabled placeholder="输入物品单价自动计算" type="number"
v-model="formData.funds_money"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="payeeId" label="收款人">
<el-select v-model="formData.payeeId" placeholder="请选择联系人"
filterable
remote
clearable
reserve-keyword
:remote-method="remoteMethod"
:loading="selectLoading"
style="width: 100%">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+'-'+item.loginname+'-'+item.unitname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item prop="payeeId" label="收款人">
<el-select v-model="formData.payeeId" placeholder="请选择联系人"
filterable
remote
clearable
reserve-keyword
:remote-method="remoteMethod"
:loading="selectLoading"
style="width: 100%">
<el-option
v-for="item in userList"
:key="item.id"
:label="item.username+'-'+item.loginname+'-'+item.unitname"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="activity_card_number" label="报销卡号">
<el-input v-model="formData.activity_card_number" type="number"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="activity_card_number" label="报销卡号">
<el-input v-model="formData.activity_card_number" type="number"></el-input>
</el-form-item>
</el-col>-->
</el-row>
@@ -204,90 +219,90 @@ layout("/layouts/platform.html"){
<el-divider content-position="left">购置物品及价格</el-divider>
<div style="padding-left: 10px;padding-top: 20px">
<el-tooltip class="item" effect="dark" content="点击添加购置物品及价格" placement="top">
<el-button icon="el-icon-plus" circle @click="formData.goods.push({})"
<el-tooltip class="item" content="点击添加购置物品及价格" effect="dark" placement="top">
<el-button @click="formData.goods.push({})" circle icon="el-icon-plus"
type="primary"></el-button>
</el-tooltip>
</div>
</div>
<el-form-item>
<el-table :data="formData.goods" border size="mini" style="width: 100%" height="200">
<el-table :data="formData.goods" border height="200" size="mini"
style="width: 100%">
<el-table-column sortable type="index" width="100" label="序号"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" sortable
type="index" width="100">
</el-table-column>
<el-table-column prop="name" label="物品名称" align="center"
header-align="center">
<el-table-column align="center" header-align="center" label="物品名称"
prop="name">
<template slot-scope="{row}">
<el-input maxlength="50" placeholder="物品名称" v-model="row.name"
type="text"></el-input>
<el-input maxlength="50" placeholder="物品名称" type="text"
v-model="row.name"></el-input>
</template>
</el-table-column>
<el-table-column prop="price" label="预算费用" align="center"
header-align="center">
<el-table-column align="center" header-align="center" label="预算费用"
prop="price">
<template slot-scope="{row}">
<el-input maxlength="50" placeholder="预算费用" v-model="row.price"
type="number" @input="blur1"></el-input>
<el-input @input="blur1" maxlength="50" placeholder="预算费用"
type="number" v-model="row.price"></el-input>
</template>
</el-table-column>
<el-table-column prop="actualPrice" label="实际费用" align="center"
header-align="center">
<template slot-scope="{row}">
<el-input maxlength="50" placeholder="实际费用" v-model="row.actualPrice"
type="number" @input="blur2"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" header-align="center"
width="80px"
fixed="right">
<el-table-column align="center" fixed="right" fixed="right"
header-align="center"
label="操作"
width="80px">
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" circle
:disabled="formData.goods.length==0"
@click="delNotesItem(scope)"></el-button>
<el-button :disabled="formData.goods.length==0"
@click="delNotesItem(scope)" circle
icon="el-icon-delete"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-divider content-position="left" class="dia"><span style="color: #3ea1ec;">活动方案及简介</span>
<el-divider class="dia" content-position="left"><span
style="color: #3ea1ec;">活动方案</span>
</el-divider>
<el-form-item prop="activity_content" class="is-required">
<div id="acEditor"></div>
<el-form-item class="is-required" prop="activity_content">
<text-editor v-model="formData.activity_content"></text-editor>
</el-form-item>
<el-divider class="dia" content-position="left"><span
style="color: #3ea1ec;">活动安排</span>
</el-divider>
<el-form-item class="is-required" prop="activity_arrange">
<text-editor v-model="formData.activity_arrange"></text-editor>
</el-form-item>
<el-divider content-position="left" class="dia"><span style="color: #3ea1ec;">附件</span>
</el-divider>
<el-row :gutter="40">
<!-- <el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">附件</span>
</el-divider>
<el-row :gutter="40">
<el-col :span="24" class="mb25">
<el-form-item prop="files" label="附件">
<file-upload :files.sync="formData.files" card></file-upload>
</el-form-item>
</el-col>
<el-col :span="24" class="mb25">
<el-form-item label="附件" prop="files">
<file-upload :files.sync="formData.files" card></file-upload>
</el-form-item>
</el-col>
</el-row>
</el-row>-->
<el-divider content-position="left" class="dia"><span style="color: #3ea1ec;">签&emsp;&emsp;字</span>
<!--<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">签&emsp;&emsp;字</span>
</el-divider>
<el-form-item prop="sign">
<sign prefix="medicalAid" :qz.sync="formData.sign"></sign>
</el-form-item>
<sign :qz.sync="formData.sign" prefix="medicalAid"></sign>
</el-form-item>-->
</el-form>
<div style="float: right;margin: 20px 0">
<el-button type="primary" @click="doAdd()">确 定</el-button>
<el-button @click="doAdd()" type="primary">确 定</el-button>
</div>
</el-card>
<input>
</div>
<script>
let E = window.wangEditor
let acEditor = null
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
@@ -307,6 +322,8 @@ layout("/layouts/platform.html"){
activity_type: [{required: true, message: '必填', trigger: ['blur', 'change']}],
plannedDate: [{required: true, message: '必填', trigger: ['blur', 'change']}],
address: [{required: true, message: '必填', trigger: ['blur', 'change']}],
activity_number: [{required: true, message: '必填', trigger: ['blur', 'change']}],
mobile: [{required: true, message: '必填', trigger: ['blur', 'change']}],
}
}
},
@@ -460,20 +477,18 @@ layout("/layouts/platform.html"){
if (this.formData.activity_type) {
await this.getProjectCodeChange()
}
},
findOne(id){
this.$nextTick(() => {
$("#acEditor").html("")
acEditor = new E("#acEditor")
acEditor.config.onchange = (html) => {
this.formData.activity_content = html
}
acEditor.create()
})
}
},
async created() {
this.init()
const id = GetQueryString("id")
if (id){
this.findOne(id)
}else{
this.init()
}
}
})
@@ -481,4 +496,4 @@ layout("/layouts/platform.html"){
<!--#
}
#-->
#-->
@@ -25,22 +25,25 @@ layout("/layouts/platform.html"){
<search :page_form.sync="pageForm" @search="doSearch">
<template #column>
<div class="btn-group tool-button">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
<el-select @change="flushUnits" @clear="flushUnits"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true"
placeholder="所属工会" style="width: 100%;"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
v-model="pageForm.unionId">
<el-option :label="item.unionname" :value="item.id"
v-for="item in unions"></el-option>
</el-select>
</div>
<div class="btn-group tool-button">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
<el-select clearable="true" filterable="true" placeholder="所属单位"
style="width: 100%;"
v-model="pageForm.unitId">
<el-option :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</div>
</template>
@@ -48,8 +51,9 @@ layout("/layouts/platform.html"){
</search>
<!--申请记录展示-->
<el-card shadow="never" class="mt20">
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
<el-card class="mt20" shadow="never">
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
style="width: 100%"
v-loading="tabLoading">
<el-table-column align="center" header-align="center" label="序号" width="120px">
<template scope="scope">
@@ -57,50 +61,53 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
<el-table-column label="活动名称" prop="activity_name" header-align="center"
align="center">
<el-table-column align="center" header-align="center" label="活动名称"
prop="activity_name">
<template scope="scope">
<el-link type="primary" @click="openView(scope.row)">
<el-link @click="openView(scope.row)" type="primary">
{{scope.row.activity_name}}
</el-link>
</template>
</el-table-column>
<el-table-column label="申请人姓名" prop="user_name" header-align="center"
align="center"></el-table-column>
<el-table-column align="center" header-align="center" label="申请人姓名"
prop="user_name"></el-table-column>
<el-table-column label="工号" prop="bxr_loginname" header-align="center"
align="center"></el-table-column>
<el-table-column align="center" header-align="center" label="工号"
prop="bxr_loginname"></el-table-column>
<el-table-column label="所属工会" prop="bxr_unionname" header-align="center" sortable
align="center"></el-table-column>
<el-table-column align="center" header-align="center" label="所属工会"
prop="bxr_unionname"
sortable></el-table-column>
<el-table-column label="活动主体类型" prop="activity_type" header-align="center" align="center" sortable>
<el-table-column align="center" header-align="center" label="活动主体类型"
prop="activity_type" sortable>
<template scope="{row}">
{{ row.activity_type == 40002 ? "分工会活动" : row.activity_type == 40003 ? "协会(社团)活动" :
{{ row.activity_type == 40002 ? "分工会活动" : row.activity_type == 40003 ?
"协会(社团)活动" :
"校工会活动"}}
</template>
</el-table-column>
<el-table-column label="活动项目类型" prop="absName" header-align="center"
align="center" sortable>
<el-table-column align="center" header-align="center" label="活动项目类型"
prop="absName" sortable>
<template slot-scope="{row}">
{{row.absName}}({{row.projectTypeCode}})
</template>
</el-table-column>
<el-table-column label="申请类型" prop="apply_type" header-align="center" sortable
align="center">
<el-table-column align="center" header-align="center" label="申请类型" prop="apply_type"
sortable>
<template scope="{row}">
{{ row.apply_type == 1 ? "经费申报" : "报销申请" }}
</template>
</el-table-column>
<el-table-column label="申请时间" prop="apply_time" header-align="center" sortable
align="center"></el-table-column>
<el-table-column align="center" header-align="center" label="申请时间" prop="apply_time"
sortable></el-table-column>
<!-- <el-table-column label="审核人" prop="shrname" header-align="center"
@@ -110,13 +117,14 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
-->
<el-table-column align="center" prop="state_id" header-align="center" label="申请状态" sortable>
<el-table-column align="center" header-align="center" label="申请状态"
prop="state_id" sortable>
<template scope="scope">
<span :style="'color:'+scope.row.state_color">{{scope.row.state_name}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" fixed="right"
<el-table-column align="center" fixed="right" header-align="center" label="操作"
width="120px">
<template slot-scope="{row}">
<el-dropdown @command="dropdownCommand">
@@ -128,30 +136,30 @@ layout("/layouts/platform.html"){
<el-dropdown-item :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<el-dropdown-item v-if="[1010].includes(row.state_id)"
:command="{type:'edit',data:row}">
<el-dropdown-item :command="{type:'edit',data:row}"
v-if="[1020].includes(row.state_id)">
编辑
</el-dropdown-item>
<el-dropdown-item v-if="[1010,1000].includes(row.state_id)"
:command="{type:'delete',data:row}">
<el-dropdown-item :command="{type:'delete',data:row}"
v-if="[1020].includes(row.state_id)">
删除
</el-dropdown-item>
<el-dropdown-item v-if="row.state_id==1060&&row.apply_type!=2"
:command="{type:'exportWwj',data:row,apply_type:1}">
<el-dropdown-item :command="{type:'exportWwj',data:row,apply_type:1}"
v-if="row.state_id==1060&&row.apply_type!=2">
导出申请表
</el-dropdown-item>
<el-dropdown-item v-if="[1060].includes(row.state_id)"
:command="{type:'exportWwj',data:row,apply_type:2}">
导出报销表
</el-dropdown-item>
<!-- <el-dropdown-item v-if="[1060].includes(row.state_id)"
:command="{type:'exportWwj',data:row,apply_type:2}">
导出报销表
</el-dropdown-item>-->
<!--# if(@shiro.hasRole('sysadmin')){ #-->
<el-dropdown-item
:command="{type:'edit',data:row}">
<el-dropdown-item :command="{type:'edit',data:row}"
v-if="![1020].includes(row.state_id)">
编辑
</el-dropdown-item>
<el-dropdown-item
:command="{type:'delete',data:row}">
<el-dropdown-item :command="{type:'delete',data:row}"
v-if="![1020].includes(row.state_id)">
删除
</el-dropdown-item>
<!--# } #-->
@@ -172,20 +180,21 @@ layout("/layouts/platform.html"){
<template #edit>
<el-form label-width="100px">
<el-form-item label="填写申请信息&emsp;" label-width="135px" class="view-header" label-position="top">
<el-form-item class="view-header" label="填写申请信息&emsp;" label-position="top"
label-width="135px">
</el-form-item>
</el-form>
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px">
<el-form :model="formData" :rules="formRules" label-width="120px" ref="form">
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="user_name" label="申请人姓名">
<el-input disabled v-model="formData.user_name" type="text"></el-input>
<el-form-item label="申请人姓名" prop="user_name">
<el-input disabled type="text" v-model="formData.user_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="mobile" label="联系方式">
<el-input v-model="formData.mobile" type="text"></el-input>
<el-form-item label="联系方式" prop="mobile">
<el-input type="text" v-model="formData.mobile"></el-input>
</el-form-item>
</el-col>
@@ -193,19 +202,20 @@ layout("/layouts/platform.html"){
</el-row>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="activity_name" label="活动名称">
<el-input v-model="formData.activity_name" disabled></el-input>
<el-form-item label="活动名称" prop="activity_name">
<el-input disabled v-model="formData.activity_name"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="activity_type" label="活动类型">
<el-select v-model="formData.activity_type" placeholder="请选择活动主体类型" style="width: 100%">
<el-form-item label="活动类型" prop="activity_type">
<el-select placeholder="请选择活动主体类型" style="width: 100%"
v-model="formData.activity_type">
<el-option
v-for="item in activityType"
:key="item.id"
:label="item.name+' ('+item.code+')'"
:value="item.code">
:value="item.code"
v-for="item in activityType">
</el-option>
</el-select>
</el-form-item>
@@ -214,35 +224,39 @@ layout("/layouts/platform.html"){
<el-row gutter="20" v-if="formData.apply_type==2">
<el-col :span="12">
<el-form-item prop="venue" label="活动人数">
<el-input v-model="formData.activity_number" placeholder="请输入活动人数" type="number"></el-input>
<el-form-item label="活动人数" prop="venue">
<el-input placeholder="请输入活动人数" type="number"
v-model="formData.activity_number"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="venue" label="活动地点">
<el-input v-model="formData.venue" placeholder="请输入活动地点" type="text"></el-input>
<el-form-item label="活动地点" prop="venue">
<el-input placeholder="请输入活动地点" type="text"
v-model="formData.venue"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="activity_money" label="报销金额">
<el-input disabled v-model="formData.activity_money" placeholder="输入物品单价自动计算"
type="number"></el-input>
<el-form-item label="报销金额" prop="activity_money">
<el-input disabled placeholder="输入物品单价自动计算"
type="number"
v-model="formData.activity_money"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="activity_card_number" label="报销卡号">
<el-input v-model="formData.activity_card_number" type="number"></el-input>
<el-form-item label="报销卡号" prop="activity_card_number">
<el-input type="number"
v-model="formData.activity_card_number"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="activity_time" label="活动时间">
<el-date-picker style="width: 100%"
v-model="formData.activity_time"
type="date" value-format="yyyy-MM-dd"
placeholder="活动时间" disabled>
<el-form-item label="活动时间" prop="activity_time">
<el-date-picker disabled
placeholder="活动时间"
style="width: 100%" type="date"
v-model="formData.activity_time" value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
@@ -250,21 +264,23 @@ layout("/layouts/platform.html"){
<el-row gutter="20" v-if="formData.apply_type==1">
<el-col :span="12">
<el-form-item prop="projectCode" label="项目编号">
<el-input disabled v-model="formData.projectCode" placeholder="选择活动类型自动生成"></el-input>
<el-form-item label="项目编号" prop="projectCode">
<el-input disabled placeholder="选择活动类型自动生成"
v-model="formData.projectCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="fundsUnitName" label="申报(承办)单位">
<el-input v-model="formData.fundsUnitName" type="text" placeholder="请输入申报(承办)单位"></el-input>
<el-form-item label="申报(承办)单位" prop="fundsUnitName">
<el-input placeholder="请输入申报(承办)单位" type="text"
v-model="formData.fundsUnitName"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="plannedDate" label="活动计划时间">
<el-form-item label="活动计划时间" prop="plannedDate">
<el-input disabled v-model="formData.plannedDate"></el-input>
<!-- <el-date-picker style="width: 100%"
v-model="formData.plannedDate"
@@ -275,9 +291,10 @@ layout("/layouts/platform.html"){
</el-col>
<el-col :span="12">
<el-form-item prop="funds_money" label="申报金额">
<el-input disabled v-model="formData.funds_money" placeholder="输入物品单价自动计算"
type="number"></el-input>
<el-form-item label="申报金额" prop="funds_money">
<el-input disabled placeholder="输入物品单价自动计算"
type="number"
v-model="formData.funds_money"></el-input>
</el-form-item>
</el-col>
</el-row>
@@ -287,8 +304,9 @@ layout("/layouts/platform.html"){
<el-divider content-position="left">购置物品及价格</el-divider>
<div style="padding-left: 10px;padding-top:60px">
<el-tooltip class="item" effect="dark" content="点击添加购置物品及价格" placement="top">
<el-button icon="el-icon-plus" circle @click="formData.goods.push({})"
<el-tooltip class="item" content="点击添加购置物品及价格" effect="dark"
placement="top">
<el-button @click="formData.goods.push({})" circle icon="el-icon-plus"
type="primary"></el-button>
</el-tooltip>
</div>
@@ -299,60 +317,61 @@ layout("/layouts/platform.html"){
<el-table :data="formData.goods" border size="mini" style="width: 100%">
<el-table-column sortable type="index" width="100" label="序号"
align="center" header-align="center">
<el-table-column align="center" header-align="center" label="序号" sortable
type="index" width="100">
</el-table-column>
<el-table-column prop="name" label="物品名称" align="center"
header-align="center">
<el-table-column align="center" header-align="center" label="物品名称"
prop="name">
<template slot-scope="{row}">
<el-input maxlength="50" placeholder="物品名称" v-model="row.name"
type="text"></el-input>
<el-input maxlength="50" placeholder="物品名称" type="text"
v-model="row.name"></el-input>
</template>
</el-table-column>
<el-table-column prop="price" label="预算费用" align="center"
header-align="center">
<el-table-column align="center" header-align="center" label="预算费用"
prop="price">
<template slot-scope="{row}">
<el-input maxlength="50" placeholder="预算费用" v-model="row.price"
type="number" @input="blur"></el-input>
<el-input @input="blur" maxlength="50" placeholder="预算费用"
type="number" v-model="row.price"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" header-align="center"
width="80px"
fixed="right">
<el-table-column align="center" fixed="right" fixed="right"
header-align="center"
label="操作"
width="80px">
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" circle
:disabled="formData.goods.length==0"
@click="delNotesItem(scope)"></el-button>
<el-button :disabled="formData.goods.length==0" @click="delNotesItem(scope)" circle
icon="el-icon-delete"
type="danger"></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
<el-divider content-position="left" class="dia"><span style="color: #3ea1ec;">{{formData.apply_type==1?'活动方案及简介':'活动内容'}}</span>
<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">{{formData.apply_type==1?'活动方案及简介':'活动内容'}}</span>
</el-divider>
<el-form-item prop="activity_content" class="is-required" label-width="auto">
<el-form-item class="is-required" label-width="auto" prop="activity_content">
<div id="acEditor"></div>
</el-form-item>
<el-divider content-position="left" class="dia"><span style="color: #3ea1ec;">附&emsp;&emsp;件</span>
<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">附&emsp;&emsp;件</span>
</el-divider>
<el-form-item prop="files" label-width="auto">
<el-form-item label-width="auto" prop="files">
<file-upload :files.sync="formData.files" card></file-upload>
</el-form-item>
<el-divider content-position="left" class="dia"><span style="color: #3ea1ec;">签&emsp;&emsp;字</span>
<el-divider class="dia" content-position="left"><span style="color: #3ea1ec;">签&emsp;&emsp;字</span>
</el-divider>
<el-form-item prop="sign" label-width="auto">
<sign prefix="medicalAid" :qz.sync="formData.sign"></sign>
<el-form-item label-width="auto" prop="sign">
<sign :qz.sync="formData.sign" prefix="medicalAid"></sign>
</el-form-item>
</el-form>
<div style="float: right;margin: 20px 0">
<el-button type="primary" @click="formData.id?doEdit():doAdd()">确 定</el-button>
<el-button @click="formData.id?doEdit():doAdd()" type="primary">确 定</el-button>
</div>
</template>
@@ -573,32 +592,33 @@ layout("/layouts/platform.html"){
},
async openEdit(row) {
const {id} = row
this.formData = {
goods: [],
plannedDate: []
}
this.activityType = await getActivityTwoLevelType("40000")
const resp = await $.get(location.href + "/findOne", {id})
/* this.formData = {
goods: [],
plannedDate: []
}
this.activityType = await getActivityTwoLevelType("40000")
const resp = await $.get(location.href + "/findOne", {id})
requestLaterFun(resp, (v) => {
v.activity_type = v.activity_type.toString()
v.goods = v.Goods
if (v.files && v.files.length > 0) v.files = JSON.parse(v.files)
v.plannedDate = (v.startPlannedDate + "——" + v.endPlannedDate)
this.formData = v
requestLaterFun(resp, (v) => {
v.activity_type = v.activity_type.toString()
v.goods = v.Goods
if (v.files && v.files.length > 0) v.files = JSON.parse(v.files)
v.plannedDate = (v.startPlannedDate + "——" + v.endPlannedDate)
this.formData = v
this.$nextTick(() => {
$("#acEditor").html("")
acEditor = new E("#acEditor")
acEditor.config.onchange = (html) => {
this.formData.activity_content = html
}
acEditor.create()
acEditor.txt.html(v.activity_content)
})
this.$refs.guava.edit()
})
this.$nextTick(() => {
$("#acEditor").html("")
acEditor = new E("#acEditor")
acEditor.config.onchange = (html) => {
this.formData.activity_content = html
}
acEditor.create()
acEditor.txt.html(v.activity_content)
})
this.$refs.guava.edit()
})*/
window.location.href = "/platform/jf/Funds/apply?id=" + id
},
doDelete(row) {
const {id} = row
@@ -641,4 +661,4 @@ layout("/layouts/platform.html"){
<!--#
}
#-->
#-->
@@ -4,21 +4,39 @@ layout("/layouts/platform.html"){
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="btn-group tool-button mt5">
<el-button @click="openAdd" size="medium">
<el-row justify="end" type="flex">
<el-col>
<div class="search">
<div class="search-item">
<div class="search-item-label">菜单名称:</div>
<div class="search-item-option">
<el-input clearable placeholder="请填写名称查询" style="width: 100%;"
v-model="menuName" @keyup.enter.native="doSearch"></el-input>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-col>
<el-button @click="openAdd" size="medium" type="primary">
<i class="ti-plus"></i>
新建菜单
</el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button @click="openSort" size="medium">
<el-button @click="openSort" size="medium" type="primary">
排序
</el-button>
</div>
</el-row>
</el-card>
<el-card class="mt10" shadow="never">
<el-table :data="tableData" :highlight-current-row="true" :key="tableKey"
:load="loadChild" lazy row-key="id"
<el-table :data="tableData"
:highlight-current-row="true"
:key="tableKey"
:load="loadChild"
lazy
row-key="id"
style="width: 100%">
<el-table-column :show-overflow-tooltip="true" align="left" header-align="center"
label="菜单名称" prop="name" width="200">
@@ -37,11 +55,13 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" header-align="center" label="权限标识"
<el-table-column :show-overflow-tooltip="true" align="center" header-align="center"
label="权限标识"
prop="permission">
</el-table-column>
<el-table-column :show-overflow-tooltip="true" align="center" header-align="center" label="启用状态"
<el-table-column :show-overflow-tooltip="true" align="center" header-align="center"
label="启用状态"
prop="disabled">
<template slot-scope="scope">
<i class="fa fa-circle text-danger ml5"
@@ -60,8 +80,9 @@ layout("/layouts/platform.html"){
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'add',id:scope.row.id,name:scope.row.name}"
v-if="scope.row.type=='menu'">
<el-dropdown-item
:command="{type:'add',id:scope.row.id,name:scope.row.name}"
v-if="scope.row.type=='menu'">
添加子菜单
</el-dropdown-item>
<el-dropdown-item
@@ -73,18 +94,21 @@ layout("/layouts/platform.html"){
:command="{type:'disable',id:scope.row.id,name:scope.row.name,row:scope.row}">
禁用
</el-dropdown-item>
<el-dropdown-item :command="{type:'editMenu',id:scope.row.id,name:scope.row.name}"
divided
v-if="scope.row.type=='menu'">
<el-dropdown-item
:command="{type:'editMenu',id:scope.row.id,name:scope.row.name}"
divided
v-if="scope.row.type=='menu'">
修改
</el-dropdown-item>
<el-dropdown-item :command="{type:'editData',id:scope.row.id,name:scope.row.name}"
divided
v-if="scope.row.type=='data'">
<el-dropdown-item
:command="{type:'editData',id:scope.row.id,name:scope.row.name}"
divided
v-if="scope.row.type=='data'">
修改
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',id:scope.row.id,name:scope.row.name}"
v-if="scope.row.path!='0001'">
<el-dropdown-item
:command="{type:'delete',id:scope.row.id,name:scope.row.name}"
v-if="scope.row.path!='0001'">
删除
</el-dropdown-item>
</el-dropdown-menu>
@@ -97,216 +121,235 @@ layout("/layouts/platform.html"){
</guava>
<el-dialog
title="新建菜单"
:close-on-click-modal="false"
:visible.sync="addDialogVisible"
:close-on-click-modal="false"
title="新建菜单"
width="50%">
<el-form :model="formData" ref="addForm" :rules="formRules" size="small" label-width="80px">
<el-form-item prop="parentId" label="上级菜单" label-width="80px">
<el-cascader v-if="!isAddFromSub" :options="menuOptions" :props="props" v-model="parentMenu"
placeholder="不选择则为顶级" style="width: 100%"></el-cascader>
<el-input v-if="isAddFromSub" type="text" v-model="formData.parentName" :disabled="true"></el-input>
<el-form :model="formData" :rules="formRules" label-width="80px" ref="addForm" size="small">
<el-form-item label="上级菜单" label-width="80px" prop="parentId">
<el-cascader :options="menuOptions" :props="props" placeholder="不选择则为顶级"
style="width: 100%"
v-if="!isAddFromSub" v-model="parentMenu"></el-cascader>
<el-input :disabled="true" type="text" v-if="isAddFromSub"
v-model="formData.parentName"></el-input>
</el-form-item>
<el-form-item prop="name" label="菜单名称">
<el-input maxlength="100" placeholder="菜单名称"
v-model="formData.name"
auto-complete="off" tabindex="3" type="text"></el-input>
<el-form-item label="菜单名称" prop="name">
<el-input auto-complete="off" maxlength="100"
placeholder="菜单名称"
tabindex="3" type="text" v-model="formData.name"></el-input>
</el-form-item>
<el-form-item prop="aliasName" label="菜单别名">
<el-input maxlength="100" placeholder="菜单名称"
v-model="formData.aliasName"
auto-complete="off" tabindex="4" type="text"></el-input>
<el-form-item label="菜单别名" prop="aliasName">
<el-input auto-complete="off" maxlength="100"
placeholder="菜单名称"
tabindex="4" type="text" v-model="formData.aliasName"></el-input>
</el-form-item>
<el-form-item prop="permission" label="权限标识">
<el-input maxlength="100" placeholder="权限标识,如 sys.manager.menu"
v-model="formData.permission"
auto-complete="off" tabindex="5" type="text"></el-input>
<el-form-item label="权限标识" prop="permission">
<el-input auto-complete="off" maxlength="100"
placeholder="权限标识,如 sys.manager.menu"
tabindex="5" type="text" v-model="formData.permission"></el-input>
</el-form-item>
<el-form-item prop="href" label="URL">
<el-input maxlength="100" placeholder="URL"
v-model="formData.href"
auto-complete="off" tabindex="6" type="text"></el-input>
<el-form-item label="URL" prop="href">
<el-input auto-complete="off" maxlength="100"
placeholder="URL"
tabindex="6" type="text" v-model="formData.href"></el-input>
</el-form-item>
<el-form-item prop="icon" label="图标">
<el-input maxlength="100" placeholder="图标"
v-model="formData.icon"
auto-complete="off" tabindex="7" type="text"></el-input>
<el-form-item label="图标" prop="icon">
<el-input auto-complete="off" maxlength="100"
placeholder="图标"
tabindex="7" type="text" v-model="formData.icon"></el-input>
<span :class="formData.icon"></span>
</el-form-item>
<el-form-item prop="disabled" label="启用状态">
<el-form-item label="操作指南" prop="description">
<file-upload :files.sync="formData.description" :max="1" :type="['doc','docx','pdf']">
</file-upload>
</el-form-item>
<el-form-item label="启用状态" prop="disabled">
<el-switch
v-model="formData.disabled"
active-color="#ff4949"
inactive-color="#13ce66">
inactive-color="#13ce66"
v-model="formData.disabled">
</el-switch>
</el-form-item>
<el-form-item prop="type" label="数据权限">
<el-radio-group @change="formRadioChange" v-model="formData.children" size="mini">
<el-form-item label="数据权限" prop="type">
<el-radio-group @change="formRadioChange" size="mini" v-model="formData.children">
<el-radio label="false">无</el-radio>
<el-radio label="true">有</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if="formData.children=='true'"
v-for="(menu, index) in formData.buttons"
:label="'权限' + (index+1)"
:key="menu.key"
:label="'权限' + (index+1)"
:prop="'buttons[' + index + ']'"
:rules="{required: true,validator: validateMenu,trigger: ['blur','change']}"
v-for="(menu, index) in formData.buttons"
v-if="formData.children=='true'"
>
<el-row :gutter="2">
<el-col :span="6">
<el-input v-model="menu.name" placeholder="权限名称"></el-input>
<el-input placeholder="权限名称" v-model="menu.name"></el-input>
</el-col>
<el-col :span="13">
<el-input v-model="menu.permission" placeholder="权限标识,如 sys.manager.menu.add"></el-input>
<el-input placeholder="权限标识,如 sys.manager.menu.add"
v-model="menu.permission"></el-input>
</el-col>
<el-col :span="4">
<el-button @click.prevent="formRemoveMenu(menu)" icon="el-icon-delete" size="small"></el-button>
<el-button @click.prevent="formRemoveMenu(menu)" icon="el-icon-delete"
size="small"></el-button>
</el-col>
</el-row>
</el-form-item>
<el-row v-if="formData.children=='true'" style="text-align: right;padding-right: 17px;">
<el-button size="small" @click="formAddMenu" icon="el-icon-circle-plus">添加</el-button>
<el-row style="text-align: right;padding-right: 17px;" v-if="formData.children=='true'">
<el-button @click="formAddMenu" icon="el-icon-circle-plus" size="small">添加
</el-button>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<span class="dialog-footer" slot="footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doAdd">确 定</el-button>
<el-button @click="doAdd" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="修改菜单"
:visible.sync="editMenuDialogVisible"
:close-on-click-modal="false"
:visible.sync="editMenuDialogVisible"
title="修改菜单"
width="50%">
<el-form :model="formData" ref="editMenuForm" :rules="formRules" size="small" label-width="80px">
<el-form-item prop="parentId" label="上级菜单" label-width="80px">
<el-input type="text" v-model="formData.parentName" :disabled="true"></el-input>
<el-form :model="formData" :rules="formRules" label-width="80px" ref="editMenuForm"
size="small">
<el-form-item label="上级菜单" label-width="80px" prop="parentId">
<el-input :disabled="true" type="text" v-model="formData.parentName"></el-input>
</el-form-item>
<el-form-item prop="name" label="菜单名称">
<el-input maxlength="100" placeholder="菜单名称"
v-model="formData.name"
auto-complete="off" tabindex="3" type="text"></el-input>
<el-form-item label="菜单名称" prop="name">
<el-input auto-complete="off" maxlength="100"
placeholder="菜单名称"
tabindex="3" type="text" v-model="formData.name"></el-input>
</el-form-item>
<el-form-item prop="aliasName" label="菜单别名">
<el-input maxlength="100" placeholder="菜单名称"
v-model="formData.aliasName"
auto-complete="off" tabindex="4" type="text"></el-input>
<el-form-item label="菜单别名" prop="aliasName">
<el-input auto-complete="off" maxlength="100"
placeholder="菜单名称"
tabindex="4" type="text" v-model="formData.aliasName"></el-input>
</el-form-item>
<el-form-item prop="permission" label="权限标识">
<el-input maxlength="100" placeholder="权限标识,如 sys.manager.menu"
v-model="formData.permission"
auto-complete="off" tabindex="5" type="text"></el-input>
<el-form-item label="权限标识" prop="permission">
<el-input auto-complete="off" maxlength="100"
placeholder="权限标识,如 sys.manager.menu"
tabindex="5" type="text" v-model="formData.permission"></el-input>
</el-form-item>
<el-form-item prop="href" label="URL">
<el-input maxlength="100" placeholder="URL"
v-model="formData.href"
auto-complete="off" tabindex="6" type="text"></el-input>
<el-form-item label="URL" prop="href">
<el-input auto-complete="off" maxlength="100"
placeholder="URL"
tabindex="6" type="text" v-model="formData.href"></el-input>
</el-form-item>
<el-form-item prop="icon" label="图标">
<el-input maxlength="100" placeholder="图标"
v-model="formData.icon"
auto-complete="off" tabindex="7" type="text"></el-input>
<el-form-item label="图标" prop="icon">
<el-input auto-complete="off" maxlength="100"
placeholder="图标"
tabindex="7" type="text" v-model="formData.icon"></el-input>
<span :class="formData.icon"></span>
</el-form-item>
<el-form-item prop="disabled" label="启用状态">
<el-form-item label="操作指南" prop="description">
<file-upload :files.sync="formData.description" :max="1" :type="['doc','docx','pdf']">
</file-upload>
</el-form-item>
<el-form-item label="启用状态" prop="disabled">
<el-switch
v-model="formData.disabled"
active-color="#ff4949"
inactive-color="#13ce66">
inactive-color="#13ce66"
v-model="formData.disabled">
</el-switch>
</el-form-item>
<el-form-item prop="type" label="数据权限">
<el-radio-group @change="formRadioChange" v-model="formData.children" size="mini">
<el-form-item label="数据权限" prop="type">
<el-radio-group @change="formRadioChange" size="mini" v-model="formData.children">
<el-radio label="false">无</el-radio>
<el-radio label="true">有</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if="formData.children=='true'"
v-for="(menu, index) in formData.buttons"
:label="'权限' + (index+1)"
:key="menu.key"
:label="'权限' + (index+1)"
:prop="'buttons[' + index + ']'"
:rules="{required: true,validator: validateMenu,trigger: ['blur','change']}"
v-for="(menu, index) in formData.buttons"
v-if="formData.children=='true'"
>
<el-row :gutter="2">
<el-col :span="6">
<el-input v-model="menu.name" placeholder="权限名称"></el-input>
<el-input placeholder="权限名称" v-model="menu.name"></el-input>
</el-col>
<el-col :span="13">
<el-input v-model="menu.permission" placeholder="权限标识,如 sys.manager.menu.add"></el-input>
<el-input placeholder="权限标识,如 sys.manager.menu.add"
v-model="menu.permission"></el-input>
</el-col>
<el-col :span="4">
<el-button @click.prevent="formRemoveMenu(menu)" icon="el-icon-delete" size="small"></el-button>
<el-button @click.prevent="formRemoveMenu(menu)" icon="el-icon-delete"
size="small"></el-button>
</el-col>
</el-row>
</el-form-item>
<el-row v-if="formData.children=='true'" style="text-align: right;padding-right: 17px;">
<el-button size="small" @click="formAddMenu" icon="el-icon-circle-plus">添加</el-button>
<el-row style="text-align: right;padding-right: 17px;" v-if="formData.children=='true'">
<el-button @click="formAddMenu" icon="el-icon-circle-plus" size="small">添加
</el-button>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<span class="dialog-footer" slot="footer">
<el-button @click="editMenuDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEditMenu">确 定</el-button>
<el-button @click="doEditMenu" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="修改权限"
:visible.sync="editDataDialogVisible"
title="修改权限"
width="50%">
<el-form :model="formData2" ref="editDataForm" :rules="formRules2" size="small" label-width="80px">
<el-form-item prop="name" label="权限名称">
<el-input maxlength="100" placeholder="权限名称"
v-model="formData2.name"
auto-complete="off" tabindex="1" type="text"></el-input>
<el-form :model="formData2" :rules="formRules2" label-width="80px" ref="editDataForm"
size="small">
<el-form-item label="权限名称" prop="name">
<el-input auto-complete="off" maxlength="100"
placeholder="权限名称"
tabindex="1" type="text" v-model="formData2.name"></el-input>
</el-form-item>
<el-form-item prop="permission" label="权限标识">
<el-input maxlength="100" placeholder="权限标识,如 sys.manager.menu.add"
v-model="formData2.permission"
auto-complete="off" tabindex="2" type="text"></el-input>
<el-form-item label="权限标识" prop="permission">
<el-input auto-complete="off" maxlength="100"
placeholder="权限标识,如 sys.manager.menu.add"
tabindex="2" type="text" v-model="formData2.permission"></el-input>
</el-form-item>
<el-form-item prop="disabled" label="启用状态">
<el-form-item label="启用状态" prop="disabled">
<el-switch
v-model="formData2.disabled"
active-color="#ff4949"
inactive-color="#13ce66">
inactive-color="#13ce66"
v-model="formData2.disabled">
</el-switch>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<span class="dialog-footer" slot="footer">
<el-button @click="editDataDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEditData">确 定</el-button>
<el-button @click="doEditData" type="primary">确 定</el-button>
</span>
</el-dialog>
<el-dialog
title="菜单排序"
:visible.sync="sortDialogVisible"
title="菜单排序"
width="50%">
<el-tree
ref="sortMenuTree"
:data="sortMenuData"
draggable
:allow-drop="sortAllowDrop"
node-key="id"
:data="sortMenuData"
:props="defaultProps"
draggable
node-key="id"
ref="sortMenuTree"
>
<span class="custom-tree-node" slot-scope="scope">
<span>{{ scope.node.label }}</span>
</span>
</el-tree>
<span slot="footer" class="dialog-footer">
<span class="dialog-footer" slot="footer">
<el-button @click="sortDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doSort">确 定</el-button>
<el-button @click="doSort" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
new Vue({
const vue = new Vue({
el: "#app",
data: function () {
return {
menuName:'',
addDialogVisible: false,
editMenuDialogVisible: false,
editDataDialogVisible: false,
@@ -363,6 +406,9 @@ layout("/layouts/platform.html"){
}
},
methods: {
doSearch(){
this.initTreeTable()
},
//验证动态添加行数据
validateMenu: function (rule, value, callback) {
if (value.name == '') {
@@ -560,7 +606,7 @@ layout("/layouts/platform.html"){
initTreeTable: function () {
var self = this;
var url = base + "/platform/sys/menu/child";
$.post(url, {pid: ""}, function (data) {
$.post(url, {pid: "",menuName:this.menuName}, function (data) {
if (data.code == 0) {
self.tableData = data.data;
self.tableKey = +new Date();
@@ -644,7 +690,7 @@ layout("/layouts/platform.html"){
message: data.msg,
type: 'success'
});
self.initTreeTable();
// self.initTreeTable();
} else {
self.$message({
message: data.msg,
@@ -666,4 +712,4 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
#-->