Merge pull request '优化数据库信息,调整菜单页面逻辑,优化部分页面内容' (#2) from logzhan/management:main into main

Reviewed-on: http://logzhan.ticp.io:30000/zhurui/management/pulls/2
pull/3/head
zhurui 2024-01-02 17:53:40 +08:00
commit 6cfb172aaf
33 changed files with 5900 additions and 380 deletions

View File

@ -4,8 +4,12 @@
<file url="file://$PROJECT_DIR$/dkha-admin/dkha-admin-client/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-admin/dkha-admin-server/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-admin/dkha-admin-server/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-admin/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-admin/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-auth/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-auth/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-dependencies/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-dependencies/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-dynamic-datasource/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-elasticsearch/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-entity/src/main/java" charset="UTF-8" />
@ -18,13 +22,21 @@
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-tools/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-tools/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/dkha-commons-xxl-job/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-commons/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-gateway/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-gateway/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-module/dkha-system/dkha-system-client/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-module/dkha-system/dkha-system-server/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-module/dkha-system/dkha-system-server/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-module/dkha-system/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-module/dkha-system/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-module/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-module/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-monitor/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/dkha-monitor/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@ -5,7 +5,14 @@
</component>
<component name="ChangeListManager">
<list default="true" id="1074127b-12ed-449d-8751-42776e4317f6" name="更改" comment="更改">
<change beforePath="$PROJECT_DIR$/../../README.md" beforeDir="false" afterPath="$PROJECT_DIR$/../../README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/i18n/zh-CN.js" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/i18n/zh-CN.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/projectApplication/projectapplication.vue" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/projectApplication/projectapplication.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/projectApplicationRecord2/projectapplicationRecord2.vue" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/projectApplicationRecord2/projectapplicationRecord2.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/teamManagement/teammanagement.vue" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/teamManagement/teammanagement.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/teammateManagement/teammatemanagement.vue" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/applicationPart2/teammateManagement/teammatemanagement.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/projectApplication/lxsqb.vue" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/projectApplication/lxsqb.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/sys/user-add-or-update.vue" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/sys/user-add-or-update.vue" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/sys/user.vue" beforeDir="false" afterPath="$PROJECT_DIR$/../../front/dkha-web-sz-main/src/views/modules/sys/user.vue" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -40,30 +47,30 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"ASKED_ADD_EXTERNAL_FILES": "true",
"RequestMappingsPanelOrder0": "0",
"RequestMappingsPanelOrder1": "1",
"RequestMappingsPanelWidth0": "75",
"RequestMappingsPanelWidth1": "75",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"WebServerToolWindowFactoryState": "false",
"ignore.virus.scanning.warn.message": "true",
"last_opened_file_path": "C:/Users/zhu/Desktop/博二的工作/2023.10.14 java汇报视频/个人代码/黎琦/HelloSpringSecurity",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"project.structure.last.edited": "Modules",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.32988507",
"settings.editor.selected.configurable": "File.Encoding",
"spring.configuration.checksum": "61198adabf77d1bab73231d4d10ffd03",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
&quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
&quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
&quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
&quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;last_opened_file_path&quot;: &quot;D:/Software Develop/management/back/dkha-sz-main&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
&quot;project.structure.proportion&quot;: &quot;0.15&quot;,
&quot;project.structure.side.proportion&quot;: &quot;0.32988507&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;File.Encoding&quot;,
&quot;spring.configuration.checksum&quot;: &quot;57761ef24ffc67cacccceb0d32d6effe&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}
}]]></component>
}</component>
<component name="RunDashboard">
<option name="configurationTypes">
<set>
@ -85,19 +92,6 @@
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="AdminApplication (1)" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
<module name="main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.dkha.AdminApplication" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.dkha.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="AdminApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<module name="dkha-admin-server" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.dkha.AdminApplication" />
@ -139,13 +133,7 @@
<item itemvalue="Spring Boot.SystemApplication" />
<item itemvalue="Spring Boot.AuthApplication" />
<item itemvalue="Spring Boot.GatewayApplication" />
<item itemvalue="Spring Boot.AdminApplication (1)" />
</list>
<recent_temporary>
<list>
<item itemvalue="Spring Boot.AdminApplication (1)" />
</list>
</recent_temporary>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
@ -168,6 +156,13 @@
<workItem from="1702614163382" duration="3182000" />
<workItem from="1702875103325" duration="24000" />
<workItem from="1703492072985" duration="25995000" />
<workItem from="1703843678365" duration="252000" />
<workItem from="1703844010478" duration="702000" />
<workItem from="1703927504625" duration="1979000" />
<workItem from="1703934347083" duration="14128000" />
<workItem from="1704023721457" duration="1026000" />
<workItem from="1704028417264" duration="2652000" />
<workItem from="1704033412984" duration="701000" />
</task>
<servers />
</component>

View File

@ -11,7 +11,7 @@ import lombok.Data;
/**
*
*
*
* @author
* @since v1.0.0 2021-05-07

View File

@ -1,18 +0,0 @@
package com.dkha.applicationPart4.forum.dao;
import com.dkha.commons.mybatis.dao.BaseDao;
import com.dkha.applicationPart4.forum.entity.ForumEntity;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author
* @since v1.0.0 2021-05-31
*/
@Mapper
public interface ForumDao extends BaseDao<ForumEntity> {
}

View File

@ -1,45 +0,0 @@
package com.dkha.applicationPart4.forum.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author
* @since v1.0.0 2021-05-31
*/
@Data
@ApiModel(value = "类似博客")
public class ForumDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private Long id;
@ApiModelProperty(value = "学号")
private String studentNumber;
@ApiModelProperty(value = "报告人")
private String reporter;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "内容")
private String content;
@ApiModelProperty(value = "创建人")
private String creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
}

View File

@ -1,44 +0,0 @@
package com.dkha.applicationPart4.forum.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dkha.commons.mybatis.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author
* @since v1.0.0 2021-05-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("zhyy_forum")
public class ForumEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String studentNumber;
/**
*
*/
private String reporter;
/**
*
*/
private String title;
/**
*
*/
private String content;
}

View File

@ -1,33 +0,0 @@
package com.dkha.applicationPart4.forum.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
*
*
* @author
* @since v1.0.0 2021-05-31
*/
@Data
public class ForumExcel {
@Excel(name = "主键")
private Long id;
@Excel(name = "学号")
private String studentNumber;
@Excel(name = "报告人")
private String reporter;
@Excel(name = "标题")
private String title;
@Excel(name = "内容")
private String content;
@Excel(name = "创建人")
private String creator;
@Excel(name = "创建时间")
private Date createDate;
}

View File

@ -1,32 +0,0 @@
package com.dkha.applicationPart4.forum.service;
import com.dkha.commons.mybatis.service.BaseService;
import com.dkha.commons.tools.page.PageData;
import com.dkha.applicationPart4.forum.dto.ForumDTO;
import com.dkha.applicationPart4.forum.entity.ForumEntity;
import java.util.List;
import java.util.Map;
/**
*
*
* @author
* @since v1.0.0 2021-05-31
*/
public interface ForumService extends BaseService<ForumEntity> {
PageData<ForumDTO> page(Map<String, Object> params);
List<ForumDTO> list(Map<String, Object> params);
ForumDTO get(String id);
void save(ForumDTO dto);
void update(ForumDTO dto);
void delete(String[] ids);
}

View File

@ -1,104 +0,0 @@
package com.dkha.applicationPart4.forum.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dkha.commons.mybatis.enums.DelFlagEnum;
import com.dkha.commons.mybatis.service.impl.BaseServiceImpl;
import com.dkha.commons.tools.constant.Constant;
import com.dkha.commons.tools.exception.RenException;
import com.dkha.commons.tools.page.PageData;
import com.dkha.commons.tools.utils.ConvertUtils;
import com.dkha.applicationPart4.forum.dao.ForumDao;
import com.dkha.applicationPart4.forum.dto.ForumDTO;
import com.dkha.applicationPart4.forum.entity.ForumEntity;
import com.dkha.applicationPart4.forum.redis.ForumRedis;
import com.dkha.applicationPart4.forum.service.ForumService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
*
*
* @author
* @since v1.0.0 2021-05-31
*/
@Service
public class ForumServiceImpl extends BaseServiceImpl<ForumDao, ForumEntity> implements ForumService {
@Autowired
private ForumRedis forumRedis;
@Override
public PageData<ForumDTO> page(Map<String, Object> params) {
IPage<ForumEntity> page = baseDao.selectPage(
getPage(params, Constant.CREATE_DATE, false),
getWrapper(params)
);
return getPageData(page, ForumDTO.class);
}
@Override
public List<ForumDTO> list(Map<String, Object> params) {
List<ForumEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ForumDTO.class);
}
private QueryWrapper<ForumEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
String reporter = (String)params.get("reporter");
String studentNumber = null;
if (!StringUtils.isNotBlank(id)){
studentNumber = (String)params.get("studentNumber");
}
QueryWrapper<ForumEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
wrapper.eq(StringUtils.isNotBlank(studentNumber), "student_number", studentNumber);
wrapper.like(StringUtils.isNotBlank(reporter), "reporter", reporter);
return wrapper;
}
@Override
public ForumDTO get(String id) {
ForumEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ForumDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ForumDTO dto) {
ForumEntity entity = ConvertUtils.sourceToTarget(dto, ForumEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ForumDTO dto) {
ForumEntity entity = ConvertUtils.sourceToTarget(dto, ForumEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
//逻辑删除
//logicDelete(ids, ForumEntity.class);
//物理删除
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

View File

@ -10,7 +10,6 @@ import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*

View File

@ -1,4 +1,8 @@
package com.dkha.applicationPart4.forum.controller;
/**
* Copyright 2023 UESTC
*/
package com.dkha.unitInfoManagement.controller;
import com.dkha.commons.tools.constant.Constant;
import com.dkha.commons.tools.page.PageData;
@ -9,9 +13,9 @@ import com.dkha.commons.tools.validator.ValidatorUtils;
import com.dkha.commons.tools.validator.group.AddGroup;
import com.dkha.commons.tools.validator.group.UpdateGroup;
import com.dkha.commons.tools.validator.group.DefaultGroup;
import com.dkha.applicationPart4.forum.dto.ForumDTO;
import com.dkha.applicationPart4.forum.excel.ForumExcel;
import com.dkha.applicationPart4.forum.service.ForumService;
import com.dkha.unitInfoManagement.dto.SysUserUnitDTO;
import com.dkha.unitInfoManagement.excel.SysUserUnitExcel;
import com.dkha.unitInfoManagement.service.SysUserUnitService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@ -26,17 +30,17 @@ import java.util.Map;
/**
*
*
*
* @author
* @since v1.0.0 2021-05-31
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
@RestController
@RequestMapping("forum/forum")
@Api(tags="类似博客")
public class ForumController {
@RequestMapping("unitInfoManagement/sysuserunit")
@Api(tags="用户管理")
public class SysUserUnitController {
@Autowired
private ForumService forumService;
private SysUserUnitService sysUserUnitService;
@GetMapping("page")
@ApiOperation("分页")
@ -46,38 +50,38 @@ public class ForumController {
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
public Result<PageData<ForumDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<ForumDTO> page = forumService.page(params);
public Result<PageData<SysUserUnitDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<SysUserUnitDTO> page = sysUserUnitService.page(params);
return new Result<PageData<ForumDTO>>().ok(page);
return new Result<PageData<SysUserUnitDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
public Result<ForumDTO> get(@PathVariable("id") String id){
ForumDTO data = forumService.get(id);
public Result<SysUserUnitDTO> get(@PathVariable("id") String id){
SysUserUnitDTO data = sysUserUnitService.get(id);
return new Result<ForumDTO>().ok(data);
return new Result<SysUserUnitDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
public Result save(@RequestBody ForumDTO dto){
public Result save(@RequestBody SysUserUnitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
forumService.save(dto);
sysUserUnitService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
public Result update(@RequestBody ForumDTO dto){
public Result update(@RequestBody SysUserUnitDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
forumService.update(dto);
sysUserUnitService.update(dto);
return new Result();
}
@ -88,7 +92,7 @@ public class ForumController {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
forumService.delete(ids);
sysUserUnitService.delete(ids);
return new Result();
}
@ -96,9 +100,9 @@ public class ForumController {
@GetMapping("export")
@ApiOperation("导出")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ForumDTO> list = forumService.list(params);
List<SysUserUnitDTO> list = sysUserUnitService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ForumExcel.class);
ExcelUtils.exportExcelToTarget(response, null, list, SysUserUnitExcel.class);
}
}

View File

@ -0,0 +1,20 @@
/**
* Copyright 2023 UESTC
*/
package com.dkha.unitInfoManagement.dao;
import com.dkha.commons.mybatis.dao.BaseDao;
import com.dkha.unitInfoManagement.entity.SysUserUnitEntity;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
@Mapper
public interface SysUserUnitDao extends BaseDao<SysUserUnitEntity> {
}

View File

@ -0,0 +1,83 @@
/**
* Copyright 2023 UESTC
*/
package com.dkha.unitInfoManagement.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
@Data
@ApiModel(value = "用户管理")
public class SysUserUnitDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "身份ID")
private Long id;
@ApiModelProperty(value = "用户名")
private String username;
@ApiModelProperty(value = "密码")
private String password;
@ApiModelProperty(value = "单位名称")
private String unitName;
@ApiModelProperty(value = "头像")
private String headUrl;
@ApiModelProperty(value = "邮箱")
private String email;
@ApiModelProperty(value = "手机号")
private String mobile;
@ApiModelProperty(value = "部门ID")
private Long deptId;
@ApiModelProperty(value = "超级管理员 0否 1是")
private Integer superAdmin;
@ApiModelProperty(value = "状态 0停用 1正常")
private Integer status;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除标识 0未删除 1删除")
private Integer delFlag;
@ApiModelProperty(value = "创建者")
private Long creator;
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "更新者")
private Long updater;
@ApiModelProperty(value = "更新时间")
private Date updateDate;
@ApiModelProperty(value = "对公银行账号")
private String bankNum;
@ApiModelProperty(value = "开户行")
private String bankLoc;
@ApiModelProperty(value = "银行名称")
private String bankName;
}

View File

@ -0,0 +1,95 @@
/**
* Copyright 2023 UESTC
*/
package com.dkha.unitInfoManagement.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dkha.commons.mybatis.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("sys_user_unit")
public class SysUserUnitEntity extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
*
*/
private String username;
/**
*
*/
private String password;
/**
*
*/
private String unitName;
/**
*
*/
private String headUrl;
/**
*
*/
private String email;
/**
*
*/
private String mobile;
/**
* ID
*/
private Long deptId;
/**
* 0 1
*/
private Integer superAdmin;
/**
* 0 1
*/
private Integer status;
/**
*
*/
private String remark;
/**
* 0 1
*/
private Integer delFlag;
/**
*
*/
private Long updater;
/**
*
*/
private Date updateDate;
/**
*
*/
private String bankNum;
/**
*
*/
private String bankLoc;
/**
*
*/
private String bankName;
}

View File

@ -0,0 +1,59 @@
/**
* Copyright 2023 UESTC
*/
package com.dkha.unitInfoManagement.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
*
*
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
@Data
public class SysUserUnitExcel {
@Excel(name = "身份ID")
private Long id;
@Excel(name = "用户名")
private String username;
@Excel(name = "密码")
private String password;
@Excel(name = "单位名称")
private String unitName;
@Excel(name = "头像")
private String headUrl;
@Excel(name = "邮箱")
private String email;
@Excel(name = "手机号")
private String mobile;
@Excel(name = "部门ID")
private Long deptId;
@Excel(name = "超级管理员 0否 1是")
private Integer superAdmin;
@Excel(name = "状态 0停用 1正常")
private Integer status;
@Excel(name = "备注")
private String remark;
@Excel(name = "删除标识 0未删除 1删除")
private Integer delFlag;
@Excel(name = "创建者")
private Long creator;
@Excel(name = "创建时间")
private Date createDate;
@Excel(name = "更新者")
private Long updater;
@Excel(name = "更新时间")
private Date updateDate;
@Excel(name = "对公银行账号")
private String bankNum;
@Excel(name = "开户行")
private String bankLoc;
@Excel(name = "银行名称")
private String bankName;
}

View File

@ -1,19 +1,21 @@
/**
* Copyright 2023 UESTC
*/
package com.dkha.applicationPart4.forum.redis;
package com.dkha.unitInfoManagement.redis;
import com.dkha.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
*
*
* @author
* @since v1.0.0 2021-05-31
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
@Component
public class ForumRedis {
public class SysUserUnitRedis {
@Autowired
private RedisUtils redisUtils;

View File

@ -0,0 +1,34 @@
/**
* Copyright 2023 UESTC
*/
package com.dkha.unitInfoManagement.service;
import com.dkha.commons.mybatis.service.BaseService;
import com.dkha.commons.tools.page.PageData;
import com.dkha.unitInfoManagement.dto.SysUserUnitDTO;
import com.dkha.unitInfoManagement.entity.SysUserUnitEntity;
import java.util.List;
import java.util.Map;
/**
*
*
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
public interface SysUserUnitService extends BaseService<SysUserUnitEntity> {
PageData<SysUserUnitDTO> page(Map<String, Object> params);
List<SysUserUnitDTO> list(Map<String, Object> params);
SysUserUnitDTO get(String id);
void save(SysUserUnitDTO dto);
void update(SysUserUnitDTO dto);
void delete(String[] ids);
}

View File

@ -0,0 +1,100 @@
/**
* Copyright 2023 UESTC
*/
package com.dkha.unitInfoManagement.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dkha.commons.mybatis.enums.DelFlagEnum;
import com.dkha.commons.mybatis.service.impl.BaseServiceImpl;
import com.dkha.commons.tools.constant.Constant;
import com.dkha.commons.tools.exception.RenException;
import com.dkha.commons.tools.page.PageData;
import com.dkha.commons.tools.utils.ConvertUtils;
import com.dkha.unitInfoManagement.dao.SysUserUnitDao;
import com.dkha.unitInfoManagement.dto.SysUserUnitDTO;
import com.dkha.unitInfoManagement.entity.SysUserUnitEntity;
import com.dkha.unitInfoManagement.redis.SysUserUnitRedis;
import com.dkha.unitInfoManagement.service.SysUserUnitService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
*
*
* @author li.zhan 719901725@qq.com
* @since v1.0.0 2023-12-31
*/
@Service
public class SysUserUnitServiceImpl extends BaseServiceImpl<SysUserUnitDao, SysUserUnitEntity> implements SysUserUnitService {
@Autowired
private SysUserUnitRedis sysUserUnitRedis;
@Override
public PageData<SysUserUnitDTO> page(Map<String, Object> params) {
IPage<SysUserUnitEntity> page = baseDao.selectPage(
getPage(params, Constant.CREATE_DATE, false),
getWrapper(params)
);
return getPageData(page, SysUserUnitDTO.class);
}
@Override
public List<SysUserUnitDTO> list(Map<String, Object> params) {
List<SysUserUnitEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, SysUserUnitDTO.class);
}
private QueryWrapper<SysUserUnitEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<SysUserUnitEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
//wrapper.eq(Constant.DEL_FLAG, DelFlagEnum.NORMAL.value());
return wrapper;
}
@Override
public SysUserUnitDTO get(String id) {
SysUserUnitEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, SysUserUnitDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(SysUserUnitDTO dto) {
SysUserUnitEntity entity = ConvertUtils.sourceToTarget(dto, SysUserUnitEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(SysUserUnitDTO dto) {
SysUserUnitEntity entity = ConvertUtils.sourceToTarget(dto, SysUserUnitEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
//逻辑删除
//logicDelete(ids, SysUserUnitEntity.class);
//物理删除
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dkha.applicationPart4.forum.dao.ForumDao">
<resultMap type="com.dkha.applicationPart4.forum.entity.ForumEntity" id="forumMap">
<result property="id" column="id"/>
<result property="studentNumber" column="student_number"/>
<result property="reporter" column="reporter"/>
<result property="title" column="title"/>
<result property="content" column="content"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
</resultMap>
</mapper>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dkha.unitInfoManagement.dao.SysUserUnitDao">
<resultMap type="com.dkha.unitInfoManagement.entity.SysUserUnitEntity" id="sysUserUnitMap">
<result property="id" column="id"/>
<result property="username" column="username"/>
<result property="password" column="password"/>
<result property="unitName" column="unit_name"/>
<result property="headUrl" column="head_url"/>
<result property="email" column="email"/>
<result property="mobile" column="mobile"/>
<result property="deptId" column="dept_id"/>
<result property="superAdmin" column="super_admin"/>
<result property="status" column="status"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="creator" column="creator"/>
<result property="createDate" column="create_date"/>
<result property="updater" column="updater"/>
<result property="updateDate" column="update_date"/>
<result property="bankNum" column="bank_num"/>
<result property="bankLoc" column="bank_loc"/>
<result property="bankName" column="bank_name"/>
</resultMap>
</mapper>

File diff suppressed because one or more lines are too long

View File

@ -370,7 +370,7 @@ t.user.status1 = '正常'
t.user.createDate = '创建时间'
t.user.password = '密码'
t.user.confirmPassword = '确认密码'
t.user.realName = '真实姓名'
t.user.realName = '姓名'
t.user.gender = '性别'
t.user.gender0 = '男'
t.user.gender1 = '女'

View File

@ -1,3 +1,4 @@
<!-- 电产院项目立项申请 -->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-projectApplication__projectapplication}">
@ -22,8 +23,8 @@
<el-table-column prop="projectName" label="项目名称" header-align="center" align="center"></el-table-column>
<el-table-column prop="applicant" label="申请人" header-align="center" align="center"></el-table-column>
<el-table-column prop="applicationDept" label="申请单位" header-align="center" align="center"></el-table-column>
<el-table-column prop="projectStartDate" label="项目开始时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="projectEndDate" label="项目结束时间" header-align="center" align="center"></el-table-column>
<!-- <el-table-column prop="projectStartDate" label="项目开始时间" header-align="center" align="center"></el-table-column>
<el-table-column prop="projectEndDate" label="项目结束时间" header-align="center" align="center"></el-table-column> -->
<el-table-column prop="projectType" label="项目类型" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.projectType==0" effect="dark"></el-tag>
@ -33,7 +34,7 @@
<el-tag v-if="scope.row.projectType==4" effect="dark"></el-tag>
</template>
</el-table-column>
<el-table-column prop="projectDescription" label="项目描述" header-align="center" align="center"></el-table-column>
<el-table-column prop="projectDescription" label="项目描述" header-align="center" align="center" width="250"></el-table-column>
<el-table-column prop="projectState" label="项目状态" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.projectState==0" effect="dark" type="info"></el-tag>

View File

@ -1,3 +1,4 @@
<!-- 电产院项目审批 -->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-projectApplicationRecord2__projectapplication}">
@ -30,7 +31,7 @@
<el-tag v-if="scope.row.projectType==2" effect="dark" >其他</el-tag>
</template>
</el-table-column>
<el-table-column prop="projectDescription" label="项目描述" header-align="center" align="center"></el-table-column>
<el-table-column prop="projectDescription" label="项目描述" header-align="center" align="center" width="200"></el-table-column>
<el-table-column prop="projectState" label="项目状态" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.projectState==0" effect="dark" type="info"></el-tag>

View File

@ -1,4 +1,5 @@
<template>
<!-- 项目团队成员管理 -->
<el-card shadow="never" class="aui-card--fill">
<div class="mod-teamManagement__teammanagement}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">

View File

@ -1,3 +1,4 @@
<!-- 电产院科研管理系统-项目成员管理 -->
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-teammateManagement__teammatemanagement}">
@ -27,8 +28,6 @@
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<!-- <el-table-column prop="id" label="管理记录ID" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="projectId" label="项目ID" header-align="center" align="center"></el-table-column>-->
<el-table-column prop="studentNumber" label="学号" header-align="center" align="center"></el-table-column>
<el-table-column prop="name" label="姓名" header-align="center" align="center"></el-table-column>
<!-- <el-table-column prop="advantages" label="技能特长" header-align="center" align="center"></el-table-column>-->
<!-- <el-table-column prop="expectDevelop" label="开发模块" header-align="center" align="center"></el-table-column>-->

View File

@ -15,6 +15,7 @@
<el-button type="danger" @click="deleteHandleWapper()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="xmmc" label="项目名称" header-align="center" align="center"></el-table-column>
@ -33,6 +34,7 @@
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"

View File

@ -72,6 +72,7 @@
deptId: '0',
deptName: '',
password: '',
realname: '',
confirmPassword: '',
realName: '',
gender: '0',
@ -189,7 +190,7 @@
this.roleList = res.data
}).catch(() => {})
},
//
// dataForm
getInfo() {
this.$http.get(`/sys/user/${this.dataForm.id}`).then(({
data: res

View File

@ -12,6 +12,7 @@
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree>
</el-form-item>
<el-form-item>
<!-- button 按钮用于从后端请求数据 -->
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
@ -24,34 +25,40 @@
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item> -->
</el-form>
<!-- 成员列表 -->
<!-- 数据data从dataList赋值 -->
<el-table
v-loading="dataListLoading"
:data="dataList"
:data="dataList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="realName" :label="$t('user.realName')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center"></el-table-column>
<el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center">
<!-- 性别 -->
<el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
{{ $getDictLabel("gender", scope.row.gender) }}
</template>
</el-table-column>
<el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag>
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
</template>
</el-table-column>
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<!-- <el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> -->
<el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>

View File

@ -0,0 +1,201 @@
<template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'">
<el-form-item label="用户名" prop="username">
<el-input v-model="dataForm.username" placeholder="用户名"></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="dataForm.password" placeholder="密码"></el-input>
</el-form-item>
<el-form-item label="单位名称" prop="unitName">
<el-input v-model="dataForm.unitName" placeholder="单位名称"></el-input>
</el-form-item>
<el-form-item label="头像" prop="headUrl">
<el-input v-model="dataForm.headUrl" placeholder="头像"></el-input>
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="dataForm.email" placeholder="邮箱"></el-input>
</el-form-item>
<el-form-item label="手机号" prop="mobile">
<el-input v-model="dataForm.mobile" placeholder="手机号"></el-input>
</el-form-item>
<el-form-item label="部门ID" prop="deptId">
<el-input v-model="dataForm.deptId" placeholder="部门ID"></el-input>
</el-form-item>
<el-form-item label="超级管理员 0否 1是" prop="superAdmin">
<el-input v-model="dataForm.superAdmin" placeholder="超级管理员 0否 1是"></el-input>
</el-form-item>
<el-form-item label="状态 0停用 1正常" prop="status">
<el-input v-model="dataForm.status" placeholder="状态 0停用 1正常"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item>
<el-form-item label="删除标识 0未删除 1删除" prop="delFlag">
<el-input v-model="dataForm.delFlag" placeholder="删除标识 0未删除 1删除"></el-input>
</el-form-item>
<el-form-item label="创建者" prop="creator">
<el-input v-model="dataForm.creator" placeholder="创建者"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="createDate">
<el-input v-model="dataForm.createDate" placeholder="创建时间"></el-input>
</el-form-item>
<el-form-item label="更新者" prop="updater">
<el-input v-model="dataForm.updater" placeholder="更新者"></el-input>
</el-form-item>
<el-form-item label="更新时间" prop="updateDate">
<el-input v-model="dataForm.updateDate" placeholder="更新时间"></el-input>
</el-form-item>
<el-form-item label="对公银行账号" prop="bankNum">
<el-input v-model="dataForm.bankNum" placeholder="对公银行账号"></el-input>
</el-form-item>
<el-form-item label="开户行" prop="bankLoc">
<el-input v-model="dataForm.bankLoc" placeholder="开户行"></el-input>
</el-form-item>
<el-form-item label="银行名称" prop="bankName">
<el-input v-model="dataForm.bankName" placeholder="银行名称"></el-input>
</el-form-item>
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template>
</el-dialog>
</template>
<script>
import debounce from 'lodash/debounce'
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
username: '',
password: '',
unitName: '',
headUrl: '',
email: '',
mobile: '',
deptId: '',
superAdmin: '',
status: '',
remark: '',
delFlag: '',
creator: '',
createDate: '',
updater: '',
updateDate: '',
bankNum: '',
bankLoc: '',
bankName: ''
}
}
},
computed: {
dataRule () {
return {
username: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
password: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
unitName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
headUrl: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
email: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
mobile: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
deptId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
superAdmin: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
status: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
remark: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
delFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
creator: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createDate: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updater: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updateDate: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
bankNum: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
bankLoc: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
bankName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/unitInfoManagement/sysuserunit/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/unitInfoManagement/sysuserunit/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

View File

@ -0,0 +1,71 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-unitInfoManagement__sysuserunit}">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item>
<el-input v-model="dataForm.id" placeholder="id" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('unitInfoManagement:sysuserunit:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item>
<el-form-item>
<el-button v-if="$hasPermission('unitInfoManagement:sysuserunit:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item>
</el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="unitName" label="单位名称" header-align="center" align="center" width="180"></el-table-column>
<el-table-column prop="email" label="邮箱" header-align="center" align="center"></el-table-column>
<el-table-column prop="mobile" label="手机号" header-align="center" align="center"></el-table-column>
<el-table-column prop="status" label="状态" header-align="center" align="center"></el-table-column>
<el-table-column prop="bankNum" label="对公银行账号" header-align="center" align="center"></el-table-column>
<el-table-column prop="bankLoc" label="开户行" header-align="center" align="center"></el-table-column>
<el-table-column prop="bankName" label="银行名称" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button v-if="$hasPermission('unitInfoManagement:sysuserunit:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('unitInfoManagement:sysuserunit:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './sysuserunit-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/system/unitInfoManagement/sysuserunit/page',
getDataListIsPage: true,
deleteURL: '/system/unitInfoManagement/sysuserunit',
deleteIsBatch: true
},
dataForm: {
id: ''
}
}
},
components: {
AddOrUpdate
}
}
</script>

View File

@ -0,0 +1,48 @@
数据的获取:
经常可以看到在`el-form`中调用函数`getDataList()`,但是在源码中找不到函数`getDataList()`。
```vue
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
```
实际上这个函数是在`import mixinViewModule from '@/mixins/view-module'`中被实现,其实现如下:
```javascript
getDataList: function () {
this.page = 1
this.checkList = {};
this.query()
},
```
这里实现的方式似乎相当于对象实例化的方式:
```javascript
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './user-add-or-update'
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
// 这里实际上就是getDataList要访问的API
getDataListURL: '/sys/user/page',
getDataListIsPage: true,
deleteURL: '/sys/user',
deleteIsBatch: true,
exportURL: '/sys/user/export'
},
dataForm: {
username: '',
deptId: '',
gender: ''
}
}
},
components: {
AddOrUpdate
}
}
```