diff --git a/web-api/src/main/java/com/jeesite/modules/biz/dao/BizListItemDao.java b/web-api/src/main/java/com/jeesite/modules/biz/dao/BizListItemDao.java new file mode 100644 index 00000000..016b8f19 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/dao/BizListItemDao.java @@ -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.BizListItem; + +/** + * 通知列表项表DAO接口 + * @author gaoxq + * @version 2025-11-26 + */ +@MyBatisDao(dataSourceName="work") +public interface BizListItemDao extends CrudDao { + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/entity/BizListItem.java b/web-api/src/main/java/com/jeesite/modules/biz/entity/BizListItem.java new file mode 100644 index 00000000..ebd122e2 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/entity/BizListItem.java @@ -0,0 +1,251 @@ +package com.jeesite.modules.biz.entity; + +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.Size; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; + +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 java.io.Serial; + +/** + * 通知列表项表Entity + * @author gaoxq + * @version 2025-11-26 + */ +@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), + @Column(name="avatar", attrName="avatar", label="头像图标", isQuery=false), + @Column(name="title", attrName="title", label="通知标题", queryType=QueryType.LIKE), + @Column(name="title_delete", attrName="titleDelete", label="是否删除", isQuery=false), + @Column(name="datetime", attrName="datetime", label="发送时间", isQuery=false), + @Column(name="type", attrName="type", label="类型标识"), + @Column(name="read_flag", attrName="readFlag", label="是否已读"), + @Column(name="description", attrName="description", label="描述信息", isQuery=false), + @Column(name="click_close", attrName="clickClose", label="是否关闭"), + @Column(name="extra", attrName="extra", label="待办状态"), + @Column(name="color", attrName="color", label="颜色值", isQuery=false), + @Column(name="update_time", attrName="updateTime", label="更新时间", isQuery=false), + @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.id DESC" +) +public class BizListItem extends DataEntity { + + @Serial + private static final long serialVersionUID = 1L; + private Date createTime; // 创建时间 + private String avatar; // 头像图标 + private String title; // 通知标题 + private String titleDelete; // 是否删除 + private String datetime; // 发送时间 + private String type; // 类型标识 + private String readFlag; // 是否已读 + private String description; // 描述信息 + private String clickClose; // 是否关闭 + private String extra; // 待办状态 + private String color; // 颜色值 + private Date updateTime; // 更新时间 + 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="id", align=Align.CENTER, sort=20), + @ExcelField(title="头像图标", attrName="avatar", align=Align.CENTER, sort=30), + @ExcelField(title="通知标题", attrName="title", align=Align.CENTER, sort=40), + @ExcelField(title="是否删除", attrName="titleDelete", align=Align.CENTER, sort=50), + @ExcelField(title="发送时间", attrName="datetime", align=Align.CENTER, sort=60, dataFormat="yyyy-MM-dd"), + @ExcelField(title="类型标识", attrName="type", align=Align.CENTER, sort=70), + @ExcelField(title="是否已读", attrName="readFlag", align=Align.CENTER, sort=80), + @ExcelField(title="描述信息", attrName="description", align=Align.CENTER, sort=90), + @ExcelField(title="是否关闭", attrName="clickClose", align=Align.CENTER, sort=100), + @ExcelField(title="待办状态", attrName="extra", align=Align.CENTER, sort=110), + @ExcelField(title="颜色值", attrName="color", align=Align.CENTER, sort=120), + }) + public BizListItem() { + this(null); + } + + public BizListItem(String id){ + 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); + } + + 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); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/service/BizListItemService.java b/web-api/src/main/java/com/jeesite/modules/biz/service/BizListItemService.java new file mode 100644 index 00000000..9df3ca4d --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/service/BizListItemService.java @@ -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.BizListItem; +import com.jeesite.modules.biz.dao.BizListItemDao; +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-26 + */ +@Service +public class BizListItemService extends CrudService { + + /** + * 获取单条数据 + * @param bizListItem 主键 + */ + @Override + public BizListItem get(BizListItem bizListItem) { + return super.get(bizListItem); + } + + /** + * 查询分页数据 + * @param bizListItem 查询条件 + * @param bizListItem page 分页对象 + */ + @Override + public Page findPage(BizListItem bizListItem) { + return super.findPage(bizListItem); + } + + /** + * 查询列表数据 + * @param bizListItem 查询条件 + */ + @Override + public List findList(BizListItem bizListItem) { + return super.findList(bizListItem); + } + + /** + * 保存数据(插入或更新) + * @param bizListItem 数据对象 + */ + @Override + @Transactional + public void save(BizListItem bizListItem) { + super.save(bizListItem); + } + + /** + * 导入数据 + * @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 list = ei.getDataList(BizListItem.class); + for (BizListItem bizListItem : list) { + try{ + ValidatorUtils.validateWithException(bizListItem); + this.save(bizListItem); + successNum++; + successMsg.append("
" + successNum + "、编号 " + bizListItem.getId() + " 导入成功"); + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、编号 " + bizListItem.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 bizListItem 数据对象 + */ + @Override + @Transactional + public void updateStatus(BizListItem bizListItem) { + super.updateStatus(bizListItem); + } + + /** + * 删除数据 + * @param bizListItem 数据对象 + */ + @Override + @Transactional + public void delete(BizListItem bizListItem) { + super.delete(bizListItem); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/biz/web/BizListItemController.java b/web-api/src/main/java/com/jeesite/modules/biz/web/BizListItemController.java new file mode 100644 index 00000000..74ba1b70 --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/biz/web/BizListItemController.java @@ -0,0 +1,178 @@ +package com.jeesite.modules.biz.web; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import com.jeesite.modules.dao.TabItem; +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.BizListItem; +import com.jeesite.modules.biz.service.BizListItemService; + +/** + * 通知列表项表Controller + * + * @author gaoxq + * @version 2025-11-26 + */ +@Controller +@RequestMapping(value = "${adminPath}/biz/listItem") +public class BizListItemController extends BaseController { + + private final BizListItemService bizListItemService; + + public BizListItemController(BizListItemService bizListItemService) { + this.bizListItemService = bizListItemService; + } + + /** + * 获取数据 + */ + @ModelAttribute + public BizListItem get(String id, boolean isNewRecord) { + return bizListItemService.get(id, isNewRecord); + } + + /** + * 查询列表 + */ + @RequiresPermissions("biz:listItem:view") + @RequestMapping(value = {"list", ""}) + public String list(BizListItem bizListItem, Model model) { + model.addAttribute("bizListItem", bizListItem); + return "modules/biz/bizListItemList"; + } + + /** + * 查询列表数据 + */ + @RequiresPermissions("biz:listItem:view") + @RequestMapping(value = "listData") + @ResponseBody + public Page listData(BizListItem bizListItem, HttpServletRequest request, HttpServletResponse response) { + bizListItem.setPage(new Page<>(request, response)); + Page page = bizListItemService.findPage(bizListItem); + return page; + } + + /** + * 查看编辑表单 + */ + @RequiresPermissions("biz:listItem:view") + @RequestMapping(value = "form") + public String form(BizListItem bizListItem, Model model) { + model.addAttribute("bizListItem", bizListItem); + return "modules/biz/bizListItemForm"; + } + + /** + * 保存数据 + */ + @RequiresPermissions("biz:listItem:edit") + @PostMapping(value = "save") + @ResponseBody + public String save(@Validated BizListItem bizListItem) { + bizListItemService.save(bizListItem); + return renderResult(Global.TRUE, text("保存通知列表项表成功!")); + } + + /** + * 导出数据 + */ + @RequiresPermissions("biz:listItem:view") + @RequestMapping(value = "exportData") + public void exportData(BizListItem bizListItem, HttpServletResponse response) { + List list = bizListItemService.findList(bizListItem); + String fileName = "通知列表项表" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx"; + try (ExcelExport ee = new ExcelExport("通知列表项表", BizListItem.class)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 下载模板 + */ + @RequiresPermissions("biz:listItem:view") + @RequestMapping(value = "importTemplate") + public void importTemplate(HttpServletResponse response) { + BizListItem bizListItem = new BizListItem(); + List list = ListUtils.newArrayList(bizListItem); + String fileName = "通知列表项表模板.xlsx"; + try (ExcelExport ee = new ExcelExport("通知列表项表", BizListItem.class, Type.IMPORT)) { + ee.setDataList(list).write(response, fileName); + } + } + + /** + * 导入数据 + */ + @ResponseBody + @RequiresPermissions("biz:listItem:edit") + @PostMapping(value = "importData") + public String importData(MultipartFile file) { + try { + String message = bizListItemService.importData(file); + return renderResult(Global.TRUE, "posfull:" + message); + } catch (Exception ex) { + return renderResult(Global.FALSE, "posfull:" + ex.getMessage()); + } + } + + /** + * 删除数据 + */ + @RequiresPermissions("biz:listItem:edit") + @RequestMapping(value = "delete") + @ResponseBody + public String delete(BizListItem bizListItem) { + bizListItemService.delete(bizListItem); + return renderResult(Global.TRUE, text("删除通知列表项表成功!")); + } + + + @RequestMapping(value = "getTabListData") + @ResponseBody + public List 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); + List dataList = bizListItemService.findList(listItem); + return new TabItem(type.code, type.name, dataList.size(), dataList); + }) + .collect(Collectors.toList()); + } + +} \ No newline at end of file diff --git a/web-api/src/main/java/com/jeesite/modules/dao/TabItem.java b/web-api/src/main/java/com/jeesite/modules/dao/TabItem.java new file mode 100644 index 00000000..d7bb5cba --- /dev/null +++ b/web-api/src/main/java/com/jeesite/modules/dao/TabItem.java @@ -0,0 +1,33 @@ +package com.jeesite.modules.dao; + +import com.jeesite.modules.biz.entity.BizListItem; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class TabItem implements Serializable { + + + private String key; + private String name; + + private Integer count; + private String btnHref; + private String btnText; + + private List list; + + + public TabItem() { + } + + public TabItem(String key, String name, Integer count, List list) { + this.key = key; + this.name = name; + this.count = count; + this.list = list; + } + +} diff --git a/web-api/src/main/resources/config/application-prod.yml b/web-api/src/main/resources/config/application-prod.yml index a58b4b0e..6bcbf6b1 100644 --- a/web-api/src/main/resources/config/application-prod.yml +++ b/web-api/src/main/resources/config/application-prod.yml @@ -13,7 +13,7 @@ jdbc: # Mysql 数据库配置 type: mysql driver: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://crontab.club:33069/worker?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + url: jdbc:mysql://192.168.31.189:33069/worker?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true username: dream password: info_dream testSql: SELECT 1 diff --git a/web-api/src/main/resources/config/application.yml b/web-api/src/main/resources/config/application.yml index 40dcd9ee..9acee0d5 100644 --- a/web-api/src/main/resources/config/application.yml +++ b/web-api/src/main/resources/config/application.yml @@ -57,7 +57,7 @@ jdbc: # Mysql 数据库配置 type: mysql driver: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://crontab.club:33069/worker?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + url: jdbc:mysql://192.168.31.189:33069/worker?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true username: dream password: info_dream testSql: SELECT 1 diff --git a/web-api/src/main/resources/mappings/modules/biz/BizListItemDao.xml b/web-api/src/main/resources/mappings/modules/biz/BizListItemDao.xml new file mode 100644 index 00000000..6da865c7 --- /dev/null +++ b/web-api/src/main/resources/mappings/modules/biz/BizListItemDao.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/web-vue/packages/biz/api/biz/listItem.ts b/web-vue/packages/biz/api/biz/listItem.ts new file mode 100644 index 00000000..36bf5e27 --- /dev/null +++ b/web-vue/packages/biz/api/biz/listItem.ts @@ -0,0 +1,69 @@ +/** + * 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 BizListItem extends BasicModel { + createTime?: string; // 创建时间 + avatar?: string; // 头像图标 + title: string; // 通知标题 + titleDelete?: string; // 是否删除 + datetime?: string; // 发送时间 + type: string; // 类型标识 + readFlag?: string; // 是否已读 + description: string; // 描述信息 + clickClose?: string; // 是否关闭 + extra?: string; // 待办状态 + color?: string; // 颜色值 + updateTime: string; // 更新时间 + ftenantId?: string; // 租户id + fflowId?: string; // 流程id + fflowTaskId?: string; // 流程任务主键 + fflowState?: number; // 流程任务状态 +} + +export interface TabItem { + key: string; + name: string; + count: number; + list: BizListItem[]; +} + +export const tabListDataAll = () => + defHttp.get({ url: adminPath + '/biz/listItem/getTabListData'}); + +export const bizListItemList = (params?: BizListItem | any) => + defHttp.get({ url: adminPath + '/biz/listItem/list', params }); + +export const bizListItemListData = (params?: BizListItem | any) => + defHttp.post>({ url: adminPath + '/biz/listItem/listData', params }); + +export const bizListItemForm = (params?: BizListItem | any) => + defHttp.get({ url: adminPath + '/biz/listItem/form', params }); + +export const bizListItemSave = (params?: any, data?: BizListItem | any) => + defHttp.postJson({ url: adminPath + '/biz/listItem/save', params, data }); + +export const bizListItemImportData = ( + params: UploadFileParams, + onUploadProgress: (progressEvent: AxiosProgressEvent) => void, +) => + defHttp.uploadFile( + { + url: ctxPath + adminPath + '/biz/listItem/importData', + onUploadProgress, + }, + params, + ); + +export const bizListItemDelete = (params?: BizListItem | any) => + defHttp.get({ url: adminPath + '/biz/listItem/delete', params }); diff --git a/web-vue/packages/biz/views/biz/listItem/form.vue b/web-vue/packages/biz/views/biz/listItem/form.vue new file mode 100644 index 00000000..ef67d218 --- /dev/null +++ b/web-vue/packages/biz/views/biz/listItem/form.vue @@ -0,0 +1,180 @@ + + + diff --git a/web-vue/packages/biz/views/biz/listItem/formImport.vue b/web-vue/packages/biz/views/biz/listItem/formImport.vue new file mode 100644 index 00000000..cb04c385 --- /dev/null +++ b/web-vue/packages/biz/views/biz/listItem/formImport.vue @@ -0,0 +1,103 @@ + + + diff --git a/web-vue/packages/biz/views/biz/listItem/list.vue b/web-vue/packages/biz/views/biz/listItem/list.vue new file mode 100644 index 00000000..aff58f42 --- /dev/null +++ b/web-vue/packages/biz/views/biz/listItem/list.vue @@ -0,0 +1,296 @@ + + + diff --git a/web-vue/packages/biz/views/biz/listItem/select.ts b/web-vue/packages/biz/views/biz/listItem/select.ts new file mode 100644 index 00000000..d26aff28 --- /dev/null +++ b/web-vue/packages/biz/views/biz/listItem/select.ts @@ -0,0 +1,189 @@ +import { useI18n } from '@jeesite/core/hooks/web/useI18n'; +import { BasicColumn, BasicTableProps, FormProps } from '@jeesite/core/components/Table'; +import { bizListItemListData } from '@jeesite/biz/api/biz/listItem'; + +const { t } = useI18n('biz.listItem'); + +const modalProps = { + title: t('通知列表项表选择'), +}; + +const searchForm: FormProps = { + 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: 'title', + component: 'Input', + }, + { + label: t('类型标识'), + field: 'type', + component: 'Select', + componentProps: { + dictType: '', + allowClear: true, + }, + }, + { + label: t('是否已读'), + field: 'readFlag', + component: 'Select', + componentProps: { + dictType: '', + allowClear: true, + }, + }, + { + label: t('是否关闭'), + field: 'clickClose', + component: 'Input', + }, + { + label: t('待办状态'), + field: 'extra', + component: 'Input', + }, + ], +}; + +const tableColumns: BasicColumn[] = [ + { + title: t('创建时间'), + dataIndex: 'createTime', + key: 'a.create_time', + sorter: true, + width: 230, + align: 'left', + slot: 'firstColumn', + }, + { + title: t('头像图标'), + dataIndex: 'avatar', + key: 'a.avatar', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('通知标题'), + dataIndex: 'title', + key: 'a.title', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('是否删除'), + dataIndex: 'titleDelete', + key: 'a.title_delete', + sorter: true, + width: 130, + align: 'left', + dictType: '', + }, + { + title: t('发送时间'), + dataIndex: 'datetime', + key: 'a.datetime', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('类型标识'), + dataIndex: 'type', + key: 'a.type', + sorter: true, + width: 130, + align: 'left', + dictType: '', + }, + { + title: t('是否已读'), + dataIndex: 'readFlag', + key: 'a.read_flag', + sorter: true, + width: 130, + align: 'left', + dictType: '', + }, + { + title: t('描述信息'), + dataIndex: 'description', + key: 'a.description', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('是否关闭'), + dataIndex: 'clickClose', + key: 'a.click_close', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('待办状态'), + dataIndex: 'extra', + key: 'a.extra', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('颜色值'), + dataIndex: 'color', + key: 'a.color', + sorter: true, + width: 130, + align: 'left', + }, + { + title: t('更新时间'), + dataIndex: 'updateTime', + key: 'a.update_time', + sorter: true, + width: 130, + align: 'center', + }, +]; + +const tableProps: BasicTableProps = { + api: bizListItemListData, + beforeFetch: (params) => { + params['isAll'] = true; + return params; + }, + columns: tableColumns, + formConfig: searchForm, + rowKey: 'id', +}; + +export default { + modalProps, + tableProps, + itemCode: 'id', + itemName: 'id', + isShowCode: false, +}; diff --git a/web-vue/packages/core/layouts/default/header/components/notify/NoticeList.vue b/web-vue/packages/core/layouts/default/header/components/notify/NoticeList.vue index ec6386e1..aba6b1cf 100644 --- a/web-vue/packages/core/layouts/default/header/components/notify/NoticeList.vue +++ b/web-vue/packages/core/layouts/default/header/components/notify/NoticeList.vue @@ -55,7 +55,7 @@ + + \ No newline at end of file diff --git a/web/src/main/resources/config/application-prod.yml b/web/src/main/resources/config/application-prod.yml index 39514c4c..6bcbf6b1 100644 --- a/web/src/main/resources/config/application-prod.yml +++ b/web/src/main/resources/config/application-prod.yml @@ -13,9 +13,9 @@ jdbc: # Mysql 数据库配置 type: mysql driver: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.56.1:3306/jeesite?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai - username: jeesite - password: jeesite + url: jdbc:mysql://192.168.31.189:33069/worker?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + username: dream + password: info_dream testSql: SELECT 1 # 数据库连接池配置 diff --git a/web/src/main/resources/config/application.yml b/web/src/main/resources/config/application.yml index 0ebdea3a..f95344f7 100644 --- a/web/src/main/resources/config/application.yml +++ b/web/src/main/resources/config/application.yml @@ -58,7 +58,7 @@ jdbc: # Mysql 数据库配置 type: mysql driver: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://crontab.club:33069/worker?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true + url: jdbc:mysql://192.168.31.189:33069/worker?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=CONVERT_TO_NULL&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true username: dream password: info_dream testSql: SELECT 1