新增前端vue
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package com.jeesite.modules.biz.dao;
|
||||
|
||||
import com.jeesite.common.dao.CrudDao;
|
||||
import com.jeesite.common.mybatis.annotation.MyBatisDao;
|
||||
import com.jeesite.modules.biz.entity.BizProjectInfo;
|
||||
|
||||
/**
|
||||
* 项目信息DAO接口
|
||||
* @author gaoxq
|
||||
* @version 2025-11-27
|
||||
*/
|
||||
@MyBatisDao(dataSourceName="work")
|
||||
public interface BizProjectInfoDao extends CrudDao<BizProjectInfo> {
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.jeesite.modules.biz.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
@@ -15,6 +16,8 @@ import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -23,6 +26,7 @@ import java.io.Serial;
|
||||
* @author gaoxq
|
||||
* @version 2025-11-26
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name="biz_list_item", alias="a", label="通知列表项表信息", columns={
|
||||
@Column(name="create_time", attrName="createTime", label="创建时间", isUpdate=false, isUpdateForce=true),
|
||||
@Column(name="id", attrName="id", label="唯一标识", isPK=true),
|
||||
@@ -43,19 +47,20 @@ import java.io.Serial;
|
||||
@Column(name="f_flow_state", attrName="fflowState", label="流程任务状态", isUpdate=false, isQuery=false, isUpdateForce=true),
|
||||
}, orderBy="a.id DESC"
|
||||
)
|
||||
public class BizListItem extends DataEntity<BizListItem> {
|
||||
@Data
|
||||
public class BizListItem extends DataEntity<BizListItem> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Date createTime; // 创建时间
|
||||
private String avatar; // 头像图标
|
||||
private String title; // 通知标题
|
||||
private String titleDelete; // 是否删除
|
||||
private boolean titleDelete; // 是否删除
|
||||
private String datetime; // 发送时间
|
||||
private String type; // 类型标识
|
||||
private String readFlag; // 是否已读
|
||||
private boolean readFlag; // 是否已读
|
||||
private String description; // 描述信息
|
||||
private String clickClose; // 是否关闭
|
||||
private boolean clickClose; // 是否关闭
|
||||
private String extra; // 待办状态
|
||||
private String color; // 颜色值
|
||||
private Date updateTime; // 更新时间
|
||||
@@ -86,152 +91,6 @@ public class BizListItem extends DataEntity<BizListItem> {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@Size(min=0, max=255, message="头像图标长度不能超过 255 个字符")
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar) {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
@NotBlank(message="通知标题不能为空")
|
||||
@Size(min=0, max=512, message="通知标题长度不能超过 512 个字符")
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Size(min=0, max=12, message="是否删除长度不能超过 12 个字符")
|
||||
public String getTitleDelete() {
|
||||
return titleDelete;
|
||||
}
|
||||
|
||||
public void setTitleDelete(String titleDelete) {
|
||||
this.titleDelete = titleDelete;
|
||||
}
|
||||
|
||||
@Size(min=0, max=32, message="发送时间长度不能超过 32 个字符")
|
||||
public String getDatetime() {
|
||||
return datetime;
|
||||
}
|
||||
|
||||
public void setDatetime(String datetime) {
|
||||
this.datetime = datetime;
|
||||
}
|
||||
|
||||
@NotBlank(message="类型标识不能为空")
|
||||
@Size(min=0, max=32, message="类型标识长度不能超过 32 个字符")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Size(min=0, max=12, message="是否已读长度不能超过 12 个字符")
|
||||
public String getReadFlag() {
|
||||
return readFlag;
|
||||
}
|
||||
|
||||
public void setReadFlag(String readFlag) {
|
||||
this.readFlag = readFlag;
|
||||
}
|
||||
|
||||
@NotBlank(message="描述信息不能为空")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Size(min=0, max=12, message="是否关闭长度不能超过 12 个字符")
|
||||
public String getClickClose() {
|
||||
return clickClose;
|
||||
}
|
||||
|
||||
public void setClickClose(String clickClose) {
|
||||
this.clickClose = clickClose;
|
||||
}
|
||||
|
||||
@Size(min=0, max=64, message="待办状态长度不能超过 64 个字符")
|
||||
public String getExtra() {
|
||||
return extra;
|
||||
}
|
||||
|
||||
public void setExtra(String extra) {
|
||||
this.extra = extra;
|
||||
}
|
||||
|
||||
@Size(min=0, max=32, message="颜色值长度不能超过 32 个字符")
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
@NotNull(message="更新时间不能为空")
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Size(min=0, max=50, message="租户id长度不能超过 50 个字符")
|
||||
public String getFtenantId() {
|
||||
return ftenantId;
|
||||
}
|
||||
|
||||
public void setFtenantId(String ftenantId) {
|
||||
this.ftenantId = ftenantId;
|
||||
}
|
||||
|
||||
@Size(min=0, max=50, message="流程id长度不能超过 50 个字符")
|
||||
public String getFflowId() {
|
||||
return fflowId;
|
||||
}
|
||||
|
||||
public void setFflowId(String fflowId) {
|
||||
this.fflowId = fflowId;
|
||||
}
|
||||
|
||||
@Size(min=0, max=50, message="流程任务主键长度不能超过 50 个字符")
|
||||
public String getFflowTaskId() {
|
||||
return fflowTaskId;
|
||||
}
|
||||
|
||||
public void setFflowTaskId(String fflowTaskId) {
|
||||
this.fflowTaskId = fflowTaskId;
|
||||
}
|
||||
|
||||
public Integer getFflowState() {
|
||||
return fflowState;
|
||||
}
|
||||
|
||||
public void setFflowState(Integer fflowState) {
|
||||
this.fflowState = fflowState;
|
||||
}
|
||||
|
||||
public Date getCreateTime_gte() {
|
||||
return sqlMap.getWhere().getValue("create_time", QueryType.GTE);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.jeesite.modules.biz.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.Size;
|
||||
|
||||
import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelFields;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 项目信息Entity
|
||||
* @author gaoxq
|
||||
* @version 2025-11-27
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name="biz_project_info", alias="a", label="项目信息信息", columns={
|
||||
@Column(name="create_time", attrName="createTime", label="记录时间", isUpdate=false, isUpdateForce=true),
|
||||
@Column(name="project_id", attrName="projectId", label="唯一标识", isPK=true),
|
||||
@Column(name="project_code", attrName="projectCode", label="项目编码"),
|
||||
@Column(name="project_name", attrName="projectName", label="项目名称", queryType=QueryType.LIKE),
|
||||
@Column(name="project_desc", attrName="projectDesc", label="项目描述", isQuery=false),
|
||||
@Column(name="start_date", attrName="startDate", label="开始日期", isQuery=false, isUpdateForce=true),
|
||||
@Column(name="end_date", attrName="endDate", label="预计结束日期", isQuery=false, isUpdateForce=true),
|
||||
@Column(name="actual_end_date", attrName="actualEndDate", label="实际结束日期", isQuery=false, isUpdateForce=true),
|
||||
@Column(name="employee_id", attrName="employeeId", label="员工列表"),
|
||||
@Column(name="project_type", attrName="projectType", label="项目类型"),
|
||||
@Column(name="project_status", attrName="projectStatus", label="项目状态"),
|
||||
@Column(name="f_tenant_id", attrName="ftenantId", label="租户id", isUpdate=false, isQuery=false),
|
||||
@Column(name="f_flow_id", attrName="fflowId", label="流程id", isUpdate=false, isQuery=false),
|
||||
@Column(name="f_flow_task_id", attrName="fflowTaskId", label="流程任务主键", isUpdate=false, isQuery=false),
|
||||
@Column(name="f_flow_state", attrName="fflowState", label="流程任务状态", isUpdate=false, isQuery=false, isUpdateForce=true),
|
||||
}, orderBy="a.project_id DESC"
|
||||
)
|
||||
@Data
|
||||
public class BizProjectInfo extends DataEntity<BizProjectInfo> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Date createTime; // 记录时间
|
||||
private String projectId; // 唯一标识
|
||||
private String projectCode; // 项目编码
|
||||
private String projectName; // 项目名称
|
||||
private String projectDesc; // 项目描述
|
||||
private Date startDate; // 开始日期
|
||||
private Date endDate; // 预计结束日期
|
||||
private Date actualEndDate; // 实际结束日期
|
||||
private String employeeId; // 员工列表
|
||||
private String projectType; // 项目类型
|
||||
private String projectStatus; // 项目状态
|
||||
private String ftenantId; // 租户id
|
||||
private String fflowId; // 流程id
|
||||
private String fflowTaskId; // 流程任务主键
|
||||
private Integer fflowState; // 流程任务状态
|
||||
|
||||
@ExcelFields({
|
||||
@ExcelField(title="记录时间", attrName="createTime", align=Align.CENTER, sort=10, dataFormat="yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title="唯一标识", attrName="projectId", align=Align.CENTER, sort=20),
|
||||
@ExcelField(title="项目编码", attrName="projectCode", align=Align.CENTER, sort=30),
|
||||
@ExcelField(title="项目名称", attrName="projectName", align=Align.CENTER, sort=40),
|
||||
@ExcelField(title="项目描述", attrName="projectDesc", align=Align.CENTER, sort=50),
|
||||
@ExcelField(title="开始日期", attrName="startDate", align=Align.CENTER, sort=60, dataFormat="yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title="预计结束日期", attrName="endDate", align=Align.CENTER, sort=70, dataFormat="yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title="实际结束日期", attrName="actualEndDate", align=Align.CENTER, sort=80, dataFormat="yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title="员工列表", attrName="employeeId", align=Align.CENTER, sort=90),
|
||||
@ExcelField(title="项目类型", attrName="projectType", align=Align.CENTER, sort=100),
|
||||
@ExcelField(title="项目状态", attrName="projectStatus", align=Align.CENTER, sort=110),
|
||||
})
|
||||
public BizProjectInfo() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public BizProjectInfo(String id){
|
||||
super(id);
|
||||
}
|
||||
|
||||
public Date getCreateTime_gte() {
|
||||
return sqlMap.getWhere().getValue("create_time", QueryType.GTE);
|
||||
}
|
||||
|
||||
public void setCreateTime_gte(Date createTime) {
|
||||
sqlMap.getWhere().and("create_time", QueryType.GTE, createTime);
|
||||
}
|
||||
|
||||
public Date getCreateTime_lte() {
|
||||
return sqlMap.getWhere().getValue("create_time", QueryType.LTE);
|
||||
}
|
||||
|
||||
public void setCreateTime_lte(Date createTime) {
|
||||
sqlMap.getWhere().and("create_time", QueryType.LTE, createTime);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.jeesite.modules.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.service.CrudService;
|
||||
import com.jeesite.modules.biz.entity.BizProjectInfo;
|
||||
import com.jeesite.modules.biz.dao.BizProjectInfoDao;
|
||||
import com.jeesite.common.service.ServiceException;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.validator.ValidatorUtils;
|
||||
import com.jeesite.common.utils.excel.ExcelImport;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import jakarta.validation.ConstraintViolation;
|
||||
import jakarta.validation.ConstraintViolationException;
|
||||
|
||||
/**
|
||||
* 项目信息Service
|
||||
* @author gaoxq
|
||||
* @version 2025-11-27
|
||||
*/
|
||||
@Service
|
||||
public class BizProjectInfoService extends CrudService<BizProjectInfoDao, BizProjectInfo> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bizProjectInfo 主键
|
||||
*/
|
||||
@Override
|
||||
public BizProjectInfo get(BizProjectInfo bizProjectInfo) {
|
||||
return super.get(bizProjectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param bizProjectInfo 查询条件
|
||||
* @param bizProjectInfo page 分页对象
|
||||
*/
|
||||
@Override
|
||||
public Page<BizProjectInfo> findPage(BizProjectInfo bizProjectInfo) {
|
||||
return super.findPage(bizProjectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bizProjectInfo 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<BizProjectInfo> findList(BizProjectInfo bizProjectInfo) {
|
||||
return super.findList(bizProjectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bizProjectInfo 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(BizProjectInfo bizProjectInfo) {
|
||||
super.save(bizProjectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
* @param file 导入的数据文件
|
||||
*/
|
||||
@Transactional
|
||||
public String importData(MultipartFile file) {
|
||||
if (file == null){
|
||||
throw new ServiceException(text("请选择导入的数据文件!"));
|
||||
}
|
||||
int successNum = 0; int failureNum = 0;
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
try(ExcelImport ei = new ExcelImport(file, 2, 0)){
|
||||
List<BizProjectInfo> list = ei.getDataList(BizProjectInfo.class);
|
||||
for (BizProjectInfo bizProjectInfo : list) {
|
||||
try{
|
||||
ValidatorUtils.validateWithException(bizProjectInfo);
|
||||
this.save(bizProjectInfo);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、编号 " + bizProjectInfo.getId() + " 导入成功");
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、编号 " + bizProjectInfo.getId() + " 导入失败:";
|
||||
if (e instanceof ConstraintViolationException){
|
||||
ConstraintViolationException cve = (ConstraintViolationException)e;
|
||||
for (ConstraintViolation<?> violation : cve.getConstraintViolations()) {
|
||||
msg += Global.getText(violation.getMessage()) + " ("+violation.getPropertyPath()+")";
|
||||
}
|
||||
}else{
|
||||
msg += e.getMessage();
|
||||
}
|
||||
failureMsg.append(msg);
|
||||
logger.error(msg, e);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage(), e);
|
||||
failureMsg.append(e.getMessage());
|
||||
return failureMsg.toString();
|
||||
}
|
||||
if (failureNum > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new ServiceException(failureMsg.toString());
|
||||
}else{
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新状态
|
||||
* @param bizProjectInfo 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateStatus(BizProjectInfo bizProjectInfo) {
|
||||
super.updateStatus(bizProjectInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bizProjectInfo 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(BizProjectInfo bizProjectInfo) {
|
||||
super.delete(bizProjectInfo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.jeesite.modules.dao.TabItem;
|
||||
import com.jeesite.modules.dict.NotifyType;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -153,24 +154,12 @@ public class BizListItemController extends BaseController {
|
||||
@RequestMapping(value = "getTabListData")
|
||||
@ResponseBody
|
||||
public List<TabItem> getTabListData() {
|
||||
enum NotifyType {
|
||||
NOTIFICATION("1", "通知"),
|
||||
MESSAGE("2", "消息"),
|
||||
TODO("3", "待办");
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
NotifyType(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
return Arrays.stream(NotifyType.values())
|
||||
.map(type -> {
|
||||
BizListItem listItem = new BizListItem();
|
||||
listItem.setType(type.code);
|
||||
listItem.setType(type.getCode());
|
||||
List<BizListItem> dataList = bizListItemService.findList(listItem);
|
||||
return new TabItem(type.code, type.name, dataList.size(), dataList);
|
||||
return new TabItem(type.getCode(), type.getName(), dataList.size(), dataList);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
package com.jeesite.modules.biz.web;
|
||||
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.utils.excel.ExcelExport;
|
||||
import com.jeesite.common.utils.excel.annotation.ExcelField.Type;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.biz.entity.BizProjectInfo;
|
||||
import com.jeesite.modules.biz.service.BizProjectInfoService;
|
||||
|
||||
/**
|
||||
* 项目信息Controller
|
||||
* @author gaoxq
|
||||
* @version 2025-11-27
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/biz/projectInfo")
|
||||
public class BizProjectInfoController extends BaseController {
|
||||
|
||||
private final BizProjectInfoService bizProjectInfoService;
|
||||
|
||||
public BizProjectInfoController(BizProjectInfoService bizProjectInfoService) {
|
||||
this.bizProjectInfoService = bizProjectInfoService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public BizProjectInfo get(String projectId, boolean isNewRecord) {
|
||||
return bizProjectInfoService.get(projectId, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("biz:projectInfo:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(BizProjectInfo bizProjectInfo, Model model) {
|
||||
model.addAttribute("bizProjectInfo", bizProjectInfo);
|
||||
return "modules/biz/bizProjectInfoList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("biz:projectInfo:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<BizProjectInfo> listData(BizProjectInfo bizProjectInfo, HttpServletRequest request, HttpServletResponse response) {
|
||||
bizProjectInfo.setPage(new Page<>(request, response));
|
||||
Page<BizProjectInfo> page = bizProjectInfoService.findPage(bizProjectInfo);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("biz:projectInfo:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(BizProjectInfo bizProjectInfo, Model model) {
|
||||
model.addAttribute("bizProjectInfo", bizProjectInfo);
|
||||
return "modules/biz/bizProjectInfoForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("biz:projectInfo:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizProjectInfo bizProjectInfo) {
|
||||
bizProjectInfoService.save(bizProjectInfo);
|
||||
return renderResult(Global.TRUE, text("保存项目信息成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("biz:projectInfo:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(BizProjectInfo bizProjectInfo, HttpServletResponse response) {
|
||||
List<BizProjectInfo> list = bizProjectInfoService.findList(bizProjectInfo);
|
||||
String fileName = "项目信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("项目信息", BizProjectInfo.class)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("biz:projectInfo:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
BizProjectInfo bizProjectInfo = new BizProjectInfo();
|
||||
List<BizProjectInfo> list = ListUtils.newArrayList(bizProjectInfo);
|
||||
String fileName = "项目信息模板.xlsx";
|
||||
try(ExcelExport ee = new ExcelExport("项目信息", BizProjectInfo.class, Type.IMPORT)){
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("biz:projectInfo:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = bizProjectInfoService.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:"+message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:"+ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("biz:projectInfo:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(BizProjectInfo bizProjectInfo) {
|
||||
bizProjectInfoService.delete(bizProjectInfo);
|
||||
return renderResult(Global.TRUE, text("删除项目信息成功!"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.jeesite.modules.biz.entity.BizListItem;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -17,7 +18,7 @@ public class TabItem implements Serializable {
|
||||
private String btnHref;
|
||||
private String btnText;
|
||||
|
||||
private List<BizListItem> list;
|
||||
private List<BizListItem> list = new ArrayList<>();
|
||||
|
||||
|
||||
public TabItem() {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jeesite.modules.dict;
|
||||
|
||||
public enum NotifyType {
|
||||
NOTIFICATION("1", "通知"),
|
||||
MESSAGE("2", "消息"),
|
||||
TODO("3", "待办");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
NotifyType(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// 新增getter方法,否则lambda中无法访问
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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.jeesite.modules.biz.dao.BizProjectInfoDao">
|
||||
|
||||
<!-- 查询数据
|
||||
<select id="findList" resultType="BizProjectInfo">
|
||||
SELECT ${sqlMap.column.toSql()}
|
||||
FROM ${sqlMap.table.toSql()}
|
||||
<where>
|
||||
${sqlMap.where.toSql()}
|
||||
</where>
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select> -->
|
||||
|
||||
</mapper>
|
||||
@@ -16,12 +16,12 @@ export interface BizListItem extends BasicModel<BizListItem> {
|
||||
createTime?: string; // 创建时间
|
||||
avatar?: string; // 头像图标
|
||||
title: string; // 通知标题
|
||||
titleDelete?: string; // 是否删除
|
||||
titleDelete?: boolean;
|
||||
datetime?: string; // 发送时间
|
||||
type: string; // 类型标识
|
||||
readFlag?: string; // 是否已读
|
||||
readFlag?: boolean; // 是否已读
|
||||
description: string; // 描述信息
|
||||
clickClose?: string; // 是否关闭
|
||||
clickClose?: boolean; // 是否关闭
|
||||
extra?: string; // 待办状态
|
||||
color?: string; // 颜色值
|
||||
updateTime: string; // 更新时间
|
||||
@@ -34,8 +34,11 @@ export interface BizListItem extends BasicModel<BizListItem> {
|
||||
export interface TabItem {
|
||||
key: string;
|
||||
name: string;
|
||||
count: number;
|
||||
count?: number;
|
||||
btnHref?: string;
|
||||
btnText?: string;
|
||||
list: BizListItem[];
|
||||
unreadlist?: BizListItem[];
|
||||
}
|
||||
|
||||
export const tabListDataAll = () =>
|
||||
|
||||
58
web-vue/packages/biz/api/biz/projectInfo.ts
Normal file
58
web-vue/packages/biz/api/biz/projectInfo.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
* @author gaoxq
|
||||
*/
|
||||
import { defHttp } from '@jeesite/core/utils/http/axios';
|
||||
import { useGlobSetting } from '@jeesite/core/hooks/setting';
|
||||
import { BasicModel, Page } from '@jeesite/core/api/model/baseModel';
|
||||
import { UploadApiResult } from '@jeesite/core/api/sys/upload';
|
||||
import { UploadFileParams } from '@jeesite/types/axios';
|
||||
import { AxiosProgressEvent } from 'axios';
|
||||
|
||||
const { ctxPath, adminPath } = useGlobSetting();
|
||||
|
||||
export interface BizProjectInfo extends BasicModel<BizProjectInfo> {
|
||||
createTime?: string; // 记录时间
|
||||
projectId?: string; // 唯一标识
|
||||
projectCode: string; // 项目编码
|
||||
projectName: string; // 项目名称
|
||||
projectDesc: string; // 项目描述
|
||||
startDate?: string; // 开始日期
|
||||
endDate?: string; // 预计结束日期
|
||||
actualEndDate?: string; // 实际结束日期
|
||||
employeeId: string; // 员工列表
|
||||
projectType: string; // 项目类型
|
||||
projectStatus: string; // 项目状态
|
||||
ftenantId?: string; // 租户id
|
||||
fflowId?: string; // 流程id
|
||||
fflowTaskId?: string; // 流程任务主键
|
||||
fflowState?: number; // 流程任务状态
|
||||
}
|
||||
|
||||
export const bizProjectInfoList = (params?: BizProjectInfo | any) =>
|
||||
defHttp.get<BizProjectInfo>({ url: adminPath + '/biz/projectInfo/list', params });
|
||||
|
||||
export const bizProjectInfoListData = (params?: BizProjectInfo | any) =>
|
||||
defHttp.post<Page<BizProjectInfo>>({ url: adminPath + '/biz/projectInfo/listData', params });
|
||||
|
||||
export const bizProjectInfoForm = (params?: BizProjectInfo | any) =>
|
||||
defHttp.get<BizProjectInfo>({ url: adminPath + '/biz/projectInfo/form', params });
|
||||
|
||||
export const bizProjectInfoSave = (params?: any, data?: BizProjectInfo | any) =>
|
||||
defHttp.postJson<BizProjectInfo>({ url: adminPath + '/biz/projectInfo/save', params, data });
|
||||
|
||||
export const bizProjectInfoImportData = (
|
||||
params: UploadFileParams,
|
||||
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
||||
) =>
|
||||
defHttp.uploadFile<UploadApiResult>(
|
||||
{
|
||||
url: ctxPath + adminPath + '/biz/projectInfo/importData',
|
||||
onUploadProgress,
|
||||
},
|
||||
params,
|
||||
);
|
||||
|
||||
export const bizProjectInfoDelete = (params?: BizProjectInfo | any) =>
|
||||
defHttp.get<BizProjectInfo>({ url: adminPath + '/biz/projectInfo/delete', params });
|
||||
@@ -42,14 +42,6 @@
|
||||
}));
|
||||
|
||||
const inputFormSchemas: FormSchema<BizListItem>[] = [
|
||||
{
|
||||
label: t('头像图标'),
|
||||
field: 'avatar',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 255,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('通知标题'),
|
||||
field: 'title',
|
||||
@@ -58,13 +50,14 @@
|
||||
maxlength: 512,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('是否删除'),
|
||||
field: 'titleDelete',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
dictType: 'title_delete',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
@@ -78,37 +71,22 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('类型标识'),
|
||||
label: t('所属类型'),
|
||||
field: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
dictType: 'msg_type',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('是否已读'),
|
||||
field: 'readFlag',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('描述信息'),
|
||||
field: 'description',
|
||||
component: 'InputTextArea',
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('是否关闭'),
|
||||
field: 'clickClose',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
maxlength: 12,
|
||||
dictType: 'click_close',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -120,7 +98,7 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('颜色值'),
|
||||
label: t('颜色编码'),
|
||||
field: 'color',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
@@ -128,14 +106,11 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('更新时间'),
|
||||
field: 'updateTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
label: t('描述信息'),
|
||||
field: 'description',
|
||||
component: 'InputTextArea',
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
<a-button type="default" :loading="loading" @click="handleExport()">
|
||||
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
|
||||
</a-button>
|
||||
<a-button type="default" @click="handleImport()">
|
||||
<Icon icon="i-ant-design:import-outlined" /> {{ t('导入') }}
|
||||
</a-button>
|
||||
<a-button type="primary" @click="handleForm({})" v-auth="'biz:listItem:edit'">
|
||||
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
@@ -87,11 +84,11 @@
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('类型标识'),
|
||||
label: t('所属类型'),
|
||||
field: 'type',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
dictType: 'msg_type',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
@@ -100,14 +97,18 @@
|
||||
field: 'readFlag',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
dictType: 'read_flag',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('是否关闭'),
|
||||
field: 'clickClose',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'click_close',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('待办状态'),
|
||||
@@ -123,7 +124,7 @@
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
width: 180,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
},
|
||||
@@ -140,7 +141,7 @@
|
||||
dataIndex: 'title',
|
||||
key: 'a.title',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
@@ -150,24 +151,24 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
dictType: 'title_delete',
|
||||
},
|
||||
{
|
||||
title: t('发送时间'),
|
||||
dataIndex: 'datetime',
|
||||
key: 'a.datetime',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 180,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('类型标识'),
|
||||
title: t('所属类型'),
|
||||
dataIndex: 'type',
|
||||
key: 'a.type',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
dictType: 'msg_type',
|
||||
},
|
||||
{
|
||||
title: t('是否已读'),
|
||||
@@ -176,14 +177,14 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
dictType: 'read_flag',
|
||||
},
|
||||
{
|
||||
title: t('描述信息'),
|
||||
dataIndex: 'description',
|
||||
key: 'a.description',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 225,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
@@ -193,6 +194,7 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'click_close',
|
||||
},
|
||||
{
|
||||
title: t('待办状态'),
|
||||
@@ -203,7 +205,7 @@
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('颜色值'),
|
||||
title: t('颜色编码'),
|
||||
dataIndex: 'color',
|
||||
key: 'a.color',
|
||||
sorter: true,
|
||||
@@ -215,26 +217,27 @@
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<BizListItem> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: BizListItem) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑通知列表项表'),
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { id: record.id }),
|
||||
auth: 'biz:listItem:edit',
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除通知列表项表'),
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除通知列表项表'),
|
||||
title: t('是否确认删除信息?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:listItem:edit',
|
||||
|
||||
167
web-vue/packages/biz/views/biz/projectInfo/form.vue
Normal file
167
web-vue/packages/biz/views/biz/projectInfo/form.vue
Normal file
@@ -0,0 +1,167 @@
|
||||
<!--
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
* @author gaoxq
|
||||
-->
|
||||
<template>
|
||||
<BasicDrawer
|
||||
v-bind="$attrs"
|
||||
:showFooter="true"
|
||||
:okAuth="'biz:projectInfo:edit'"
|
||||
@register="registerDrawer"
|
||||
@ok="handleSubmit"
|
||||
width="70%"
|
||||
>
|
||||
<template #title>
|
||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||
<span> {{ getTitle.value }} </span>
|
||||
</template>
|
||||
<BasicForm @register="registerForm" />
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizProjectInfoForm">
|
||||
import { ref, unref, computed } from 'vue';
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
||||
import { router } from '@jeesite/core/router';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
||||
import { BasicDrawer, useDrawerInner } from '@jeesite/core/components/Drawer';
|
||||
import { BizProjectInfo, bizProjectInfoSave, bizProjectInfoForm } from '@jeesite/biz/api/biz/projectInfo';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.projectInfo');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizProjectInfo>({} as BizProjectInfo);
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: record.value.isNewRecord ? t('新增项目信息') : t('编辑项目信息'),
|
||||
}));
|
||||
|
||||
const inputFormSchemas: FormSchema<BizProjectInfo>[] = [
|
||||
{
|
||||
label: t('项目编码'),
|
||||
field: 'projectCode',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 52,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('项目名称'),
|
||||
field: 'projectName',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 100,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('项目描述'),
|
||||
field: 'projectDesc',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('开始日期'),
|
||||
field: 'startDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('预计结束日期'),
|
||||
field: 'endDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('实际结束日期'),
|
||||
field: 'actualEndDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('员工列表'),
|
||||
field: 'employeeId',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('项目类型'),
|
||||
field: 'projectType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('项目状态'),
|
||||
field: 'projectStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
];
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizProjectInfo>({
|
||||
labelWidth: 120,
|
||||
schemas: inputFormSchemas,
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await bizProjectInfoForm(data);
|
||||
record.value = (res.bizProjectInfo || {}) as BizProjectInfo;
|
||||
record.value.__t = new Date().getTime();
|
||||
await setFieldsValue(record.value);
|
||||
setDrawerProps({ loading: false });
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
const params: any = {
|
||||
isNewRecord: record.value.isNewRecord,
|
||||
projectId: record.value.projectId || data.projectId,
|
||||
};
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await bizProjectInfoSave(params, data);
|
||||
showMessage(res.message);
|
||||
setTimeout(closeDrawer);
|
||||
emit('success', data);
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
showMessage(error.message || t('common.validateError'));
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
103
web-vue/packages/biz/views/biz/projectInfo/formImport.vue
Normal file
103
web-vue/packages/biz/views/biz/projectInfo/formImport.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<!--
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
* @author gaoxq
|
||||
-->
|
||||
<template>
|
||||
<BasicModal
|
||||
v-bind="$attrs"
|
||||
:title="t('导入项目信息')"
|
||||
:okText="t('导入')"
|
||||
@register="registerModal"
|
||||
@ok="handleSubmit"
|
||||
:minHeight="120"
|
||||
:width="400"
|
||||
>
|
||||
<Upload accept=".xls,.xlsx" :file-list="fileList" :before-upload="beforeUpload" @remove="handleRemove">
|
||||
<a-button> <Icon icon="ant-design:upload-outlined" /> {{ t('选择文件') }} </a-button>
|
||||
<span class="ml-4">{{ uploadInfo }}</span>
|
||||
</Upload>
|
||||
<div class="ml-4 mt-4">
|
||||
{{ t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<a-button @click="handleDownloadTemplate()" type="text">
|
||||
<Icon icon="i-fa:file-excel-o" />
|
||||
{{ t('下载模板') }}
|
||||
</a-button>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { Upload } from 'ant-design-vue';
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
||||
import { useGlobSetting } from '@jeesite/core/hooks/setting';
|
||||
import { downloadByUrl } from '@jeesite/core/utils/file/download';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
import { bizProjectInfoImportData } from '@jeesite/biz/api/biz/projectInfo';
|
||||
import { FileType } from 'ant-design-vue/es/upload/interface';
|
||||
import { AxiosProgressEvent } from 'axios';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.projectInfo');
|
||||
const { showMessage, showMessageModal } = useMessage();
|
||||
|
||||
const fileList = ref<FileType[]>([]);
|
||||
const uploadInfo = ref('');
|
||||
|
||||
const beforeUpload = (file: FileType) => {
|
||||
fileList.value = [file];
|
||||
return false;
|
||||
};
|
||||
|
||||
const handleRemove = () => {
|
||||
fileList.value = [];
|
||||
};
|
||||
|
||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(() => {
|
||||
fileList.value = [];
|
||||
uploadInfo.value = '';
|
||||
});
|
||||
|
||||
async function handleDownloadTemplate() {
|
||||
const { ctxAdminPath } = useGlobSetting();
|
||||
downloadByUrl({ url: ctxAdminPath + '/biz/projectInfo/importTemplate' });
|
||||
}
|
||||
|
||||
function onUploadProgress(progressEvent: AxiosProgressEvent) {
|
||||
const complete = ((progressEvent.loaded / (progressEvent.total || 1)) * 100) | 0;
|
||||
if (complete != 100) {
|
||||
uploadInfo.value = t('正在导入,请稍候') + ' ' + complete + '%...';
|
||||
} else {
|
||||
uploadInfo.value = '';
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
if (fileList.value.length == 0) {
|
||||
showMessage(t('请选择要导入的数据文件'));
|
||||
return;
|
||||
}
|
||||
setModalProps({ confirmLoading: true });
|
||||
const params = {
|
||||
file: fileList.value[0],
|
||||
};
|
||||
const { data } = await bizProjectInfoImportData(params, onUploadProgress);
|
||||
showMessageModal({ content: data.message });
|
||||
setTimeout(closeModal);
|
||||
emit('success');
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
showMessage(error.message || t('common.validateError'));
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
284
web-vue/packages/biz/views/biz/projectInfo/list.vue
Normal file
284
web-vue/packages/biz/views/biz/projectInfo/list.vue
Normal file
@@ -0,0 +1,284 @@
|
||||
<!--
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
* @author gaoxq
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable">
|
||||
<template #tableTitle>
|
||||
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
||||
<span> {{ getTitle.value }} </span>
|
||||
</template>
|
||||
<template #toolbar>
|
||||
<a-button type="default" :loading="loading" @click="handleExport()">
|
||||
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
|
||||
</a-button>
|
||||
<a-button type="default" @click="handleImport()">
|
||||
<Icon icon="i-ant-design:import-outlined" /> {{ t('导入') }}
|
||||
</a-button>
|
||||
<a-button type="primary" @click="handleForm({})" v-auth="'biz:projectInfo:edit'">
|
||||
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #firstColumn="{ record }">
|
||||
<a @click="handleForm({ projectId: record.projectId })" :title="record.createTime">
|
||||
{{ record.createTime }}
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
<FormImport @register="registerImportModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizProjectInfoList">
|
||||
import { onMounted, ref, unref } from 'vue';
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
||||
import { useGlobSetting } from '@jeesite/core/hooks/setting';
|
||||
import { downloadByUrl } from '@jeesite/core/utils/file/download';
|
||||
import { router } from '@jeesite/core/router';
|
||||
import { Icon } from '@jeesite/core/components/Icon';
|
||||
import { BasicTable, BasicColumn, useTable } from '@jeesite/core/components/Table';
|
||||
import { BizProjectInfo, bizProjectInfoList } from '@jeesite/biz/api/biz/projectInfo';
|
||||
import { bizProjectInfoDelete, bizProjectInfoListData } from '@jeesite/biz/api/biz/projectInfo';
|
||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
||||
import { useModal } from '@jeesite/core/components/Modal';
|
||||
import { FormProps } from '@jeesite/core/components/Form';
|
||||
import InputForm from './form.vue';
|
||||
import FormImport from './formImport.vue';
|
||||
|
||||
const { t } = useI18n('biz.projectInfo');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizProjectInfo>({} as BizProjectInfo);
|
||||
|
||||
const getTitle = {
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: meta.title || t('项目信息管理'),
|
||||
};
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm: FormProps<BizProjectInfo> = {
|
||||
baseColProps: { md: 8, lg: 6 },
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{
|
||||
label: t('记录时间起'),
|
||||
field: 'createTime_gte',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('记录时间止'),
|
||||
field: 'createTime_lte',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('项目编码'),
|
||||
field: 'projectCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('项目名称'),
|
||||
field: 'projectName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('员工列表'),
|
||||
field: 'employeeId',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('项目类型'),
|
||||
field: 'projectType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('项目状态'),
|
||||
field: 'projectStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<BizProjectInfo>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
},
|
||||
{
|
||||
title: t('项目编码'),
|
||||
dataIndex: 'projectCode',
|
||||
key: 'a.project_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('项目名称'),
|
||||
dataIndex: 'projectName',
|
||||
key: 'a.project_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('项目描述'),
|
||||
dataIndex: 'projectDesc',
|
||||
key: 'a.project_desc',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('开始日期'),
|
||||
dataIndex: 'startDate',
|
||||
key: 'a.start_date',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('预计结束日期'),
|
||||
dataIndex: 'endDate',
|
||||
key: 'a.end_date',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('实际结束日期'),
|
||||
dataIndex: 'actualEndDate',
|
||||
key: 'a.actual_end_date',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('员工列表'),
|
||||
dataIndex: 'employeeId',
|
||||
key: 'a.employee_id',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('项目类型'),
|
||||
dataIndex: 'projectType',
|
||||
key: 'a.project_type',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('项目状态'),
|
||||
dataIndex: 'projectStatus',
|
||||
key: 'a.project_status',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<BizProjectInfo> = {
|
||||
width: 160,
|
||||
actions: (record: BizProjectInfo) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑项目信息'),
|
||||
onClick: handleForm.bind(this, { projectId: record.projectId }),
|
||||
auth: 'biz:projectInfo:edit',
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除项目信息'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除项目信息'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:projectInfo:edit',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const [registerTable, { reload, getForm }] = useTable<BizProjectInfo>({
|
||||
api: bizProjectInfoListData,
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
columns: tableColumns,
|
||||
actionColumn: actionColumn,
|
||||
formConfig: searchForm,
|
||||
showTableSetting: true,
|
||||
useSearchForm: true,
|
||||
canResize: true,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await bizProjectInfoList();
|
||||
record.value = (res.bizProjectInfo || {}) as BizProjectInfo;
|
||||
await getForm().setFieldsValue(record.value);
|
||||
});
|
||||
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
|
||||
function handleForm(record: Recordable) {
|
||||
openDrawer(true, record);
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
loading.value = true;
|
||||
const { ctxAdminPath } = useGlobSetting();
|
||||
await downloadByUrl({
|
||||
url: ctxAdminPath + '/biz/projectInfo/exportData',
|
||||
params: getForm().getFieldsValue(),
|
||||
});
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
const [registerImportModal, { openModal: importModal }] = useModal();
|
||||
|
||||
function handleImport() {
|
||||
importModal(true, {});
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
const params = { projectId: record.projectId };
|
||||
const res = await bizProjectInfoDelete(params);
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
|
||||
async function handleSuccess(record: Recordable) {
|
||||
await reload({ record });
|
||||
}
|
||||
</script>
|
||||
177
web-vue/packages/biz/views/biz/projectInfo/select.ts
Normal file
177
web-vue/packages/biz/views/biz/projectInfo/select.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
||||
import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table';
|
||||
import { bizProjectInfoListData } from '@jeesite/biz/api/biz/projectInfo';
|
||||
|
||||
const { t } = useI18n('biz.projectInfo');
|
||||
|
||||
const modalProps = {
|
||||
title: t('项目信息选择'),
|
||||
};
|
||||
|
||||
const searchForm: FormProps<BizProjectInfo> = {
|
||||
baseColProps: { md: 8, lg: 6 },
|
||||
labelWidth: 90,
|
||||
schemas: [
|
||||
{
|
||||
label: t('记录时间起'),
|
||||
field: 'createTime_gte',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('记录时间止'),
|
||||
field: 'createTime_lte',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('项目编码'),
|
||||
field: 'projectCode',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('项目名称'),
|
||||
field: 'projectName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('员工列表'),
|
||||
field: 'employeeId',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('项目类型'),
|
||||
field: 'projectType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('项目状态'),
|
||||
field: 'projectStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<BizProjectInfo>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
},
|
||||
{
|
||||
title: t('项目编码'),
|
||||
dataIndex: 'projectCode',
|
||||
key: 'a.project_code',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('项目名称'),
|
||||
dataIndex: 'projectName',
|
||||
key: 'a.project_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('项目描述'),
|
||||
dataIndex: 'projectDesc',
|
||||
key: 'a.project_desc',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('开始日期'),
|
||||
dataIndex: 'startDate',
|
||||
key: 'a.start_date',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('预计结束日期'),
|
||||
dataIndex: 'endDate',
|
||||
key: 'a.end_date',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('实际结束日期'),
|
||||
dataIndex: 'actualEndDate',
|
||||
key: 'a.actual_end_date',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('员工列表'),
|
||||
dataIndex: 'employeeId',
|
||||
key: 'a.employee_id',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('项目类型'),
|
||||
dataIndex: 'projectType',
|
||||
key: 'a.project_type',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
{
|
||||
title: t('项目状态'),
|
||||
dataIndex: 'projectStatus',
|
||||
key: 'a.project_status',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: '',
|
||||
},
|
||||
];
|
||||
|
||||
const tableProps: BasicTableProps = {
|
||||
api: bizProjectInfoListData,
|
||||
beforeFetch: (params) => {
|
||||
params['isAll'] = true;
|
||||
return params;
|
||||
},
|
||||
columns: tableColumns,
|
||||
formConfig: searchForm,
|
||||
rowKey: 'projectId',
|
||||
};
|
||||
|
||||
export default {
|
||||
modalProps,
|
||||
tableProps,
|
||||
itemCode: 'projectId',
|
||||
itemName: 'projectId',
|
||||
isShowCode: false,
|
||||
};
|
||||
@@ -50,6 +50,7 @@
|
||||
maxlength: 100,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('首页地址'),
|
||||
@@ -59,6 +60,7 @@
|
||||
maxlength: 255,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('图标类名'),
|
||||
@@ -81,14 +83,14 @@
|
||||
{
|
||||
label: t('排序序号'),
|
||||
field: 'sortOrder',
|
||||
component: 'Input',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
maxlength: 10,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('图标背景色'),
|
||||
label: t('背景颜色'),
|
||||
field: 'bgColor',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
@@ -97,7 +99,7 @@
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('悬浮遮罩色'),
|
||||
label: t('遮罩颜色'),
|
||||
field: 'maskColor',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
@@ -110,7 +112,7 @@
|
||||
field: 'isEnabled',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: '',
|
||||
dictType: 'is_enabled',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 230,
|
||||
width: 180,
|
||||
align: 'left',
|
||||
slot: 'firstColumn',
|
||||
},
|
||||
@@ -92,7 +92,7 @@
|
||||
dataIndex: 'systemName',
|
||||
key: 'a.system_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 225,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
@@ -100,7 +100,7 @@
|
||||
dataIndex: 'homepageUrl',
|
||||
key: 'a.homepage_url',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
@@ -150,33 +150,34 @@
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
dictType: '',
|
||||
dictType: 'is_enabled',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<BizQuickLogin> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: BizQuickLogin) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑系统信息'),
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { id: record.id }),
|
||||
auth: 'biz:quickLogin:edit',
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除系统信息'),
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除系统信息'),
|
||||
title: t('是否确认删除系统信息?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:quickLogin:edit',
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<ATable
|
||||
ref="tableRef"
|
||||
v-bind="getBindValues"
|
||||
:bordered=false
|
||||
:rowClassName="getRowClassName"
|
||||
v-show="getEmptyDataIsShowTable"
|
||||
@change="handleTableChange"
|
||||
|
||||
@@ -37,10 +37,14 @@
|
||||
const { createMessage } = useMessage();
|
||||
const listData = ref<TabItem[]>([]);
|
||||
|
||||
onMounted(async () => {
|
||||
const response = await tabListDataAll();
|
||||
listData.value = response;
|
||||
});
|
||||
const getDataList = async () => {
|
||||
try {
|
||||
const result = await tabListDataAll();
|
||||
listData.value = result || [];
|
||||
} catch (error) {
|
||||
listData.value = []; // 异常时置空列表,显示空状态
|
||||
}
|
||||
}
|
||||
|
||||
const count = computed(() => {
|
||||
let count = 0;
|
||||
@@ -51,9 +55,14 @@
|
||||
});
|
||||
|
||||
function onNoticeClick(record: BizListItem) {
|
||||
createMessage.success('你点击了通知,ID=' + record.id);
|
||||
createMessage.success('你点击了' + record.title);
|
||||
getDataList()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getDataList()
|
||||
});
|
||||
|
||||
return {
|
||||
prefixCls,
|
||||
listData,
|
||||
|
||||
@@ -215,16 +215,15 @@ export const useUserStore = defineStore('app-user', {
|
||||
* @description: Confirm before logging out
|
||||
*/
|
||||
async confirmLoginOut() {
|
||||
// const { createConfirm } = useMessage();
|
||||
// const { t } = useI18n();
|
||||
// createConfirm({
|
||||
// iconType: 'warning',
|
||||
// title: () => h('span', t('sys.app.logoutTip')),
|
||||
// content: () => h('span', t('sys.app.logoutMessage')),
|
||||
// onOk: async () => {
|
||||
const { createConfirm } = useMessage();
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '温馨提示',
|
||||
content: '确认要退出系统吗?',
|
||||
onOk: async () => {
|
||||
await this.logout(true);
|
||||
// },
|
||||
// });
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user