新增预警页面
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.BizCalendarSchedule;
|
||||
|
||||
/**
|
||||
* 日程信息DAO接口
|
||||
* @author gaoxq
|
||||
* @version 2025-12-10
|
||||
*/
|
||||
@MyBatisDao(dataSourceName="work")
|
||||
public interface BizCalendarScheduleDao extends CrudDao<BizCalendarSchedule> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
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 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 lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 日程信息Entity
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2025-12-10
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name = "biz_calendar_schedule", alias = "a", label = "日程信息信息", columns = {
|
||||
@Column(name = "create_time", attrName = "createTime", label = "记录时间", isUpdate = false, isUpdateForce = true),
|
||||
@Column(name = "schedule_id", attrName = "scheduleId", label = "主键标识", isPK = true),
|
||||
@Column(name = "schedule_no", attrName = "scheduleNo", label = "日程编号"),
|
||||
@Column(name = "title", attrName = "title", label = "日程标题", queryType = QueryType.LIKE),
|
||||
@Column(name = "content", attrName = "content", label = "日程详情/备注", isQuery = false),
|
||||
@Column(name = "start_time", attrName = "startTime", label = "日程开始时间", isQuery = false),
|
||||
@Column(name = "end_time", attrName = "endTime", label = "日程结束时间", isQuery = false),
|
||||
@Column(name = "all_day", attrName = "allDay", label = "是否全天"),
|
||||
@Column(name = "location", attrName = "location", label = "日程地点", isQuery = false),
|
||||
@Column(name = "priority", attrName = "priority", label = "优先等级"),
|
||||
@Column(name = "ustatus", attrName = "ustatus", label = "日程状态"),
|
||||
@Column(name = "remind_time", attrName = "remindTime", label = "提醒时间", isQuery = false, isUpdateForce = true),
|
||||
@Column(name = "creator_user", attrName = "creatorUser", label = "创建人账号", isUpdate = false, isUpdateForce = true),
|
||||
@Column(name = "participant_user", attrName = "participantUser", label = "接收人账号"),
|
||||
@Column(name = "participant_name", attrName = "participantName", label = "接收人名称"),
|
||||
@Column(name = "update_time", attrName = "updateTime", label = "更新时间", isQuery = false, isUpdateForce = true),
|
||||
}, orderBy = "a.schedule_id DESC"
|
||||
)
|
||||
@Data
|
||||
public class BizCalendarSchedule extends DataEntity<BizCalendarSchedule> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Date createTime; // 记录时间
|
||||
private String scheduleId; // 主键标识
|
||||
private String scheduleNo; // 日程编号
|
||||
private String title; // 日程标题
|
||||
private String content; // 日程详情/备注
|
||||
private Date startTime; // 日程开始时间
|
||||
private Date endTime; // 日程结束时间
|
||||
private String allDay; // 是否全天
|
||||
private String location; // 日程地点
|
||||
private String priority; // 优先等级
|
||||
private String ustatus; // 日程状态
|
||||
private Date remindTime; // 提醒时间
|
||||
private String creatorUser; // 创建人账号
|
||||
private String participantUser; // 接收人账号
|
||||
private String participantName; // 接收人名称
|
||||
private Date updateTime; // 更新时间
|
||||
|
||||
@ExcelFields({
|
||||
@ExcelField(title = "记录时间", attrName = "createTime", align = Align.CENTER, sort = 10, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title = "主键标识", attrName = "scheduleId", align = Align.CENTER, sort = 20),
|
||||
@ExcelField(title = "日程编号", attrName = "scheduleNo", align = Align.CENTER, sort = 30),
|
||||
@ExcelField(title = "日程标题", attrName = "title", align = Align.CENTER, sort = 40),
|
||||
@ExcelField(title = "日程详情/备注", attrName = "content", align = Align.CENTER, sort = 50),
|
||||
@ExcelField(title = "日程开始时间", attrName = "startTime", align = Align.CENTER, sort = 60, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title = "日程结束时间", attrName = "endTime", align = Align.CENTER, sort = 70, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title = "是否全天", attrName = "allDay", align = Align.CENTER, sort = 80),
|
||||
@ExcelField(title = "日程地点", attrName = "location", align = Align.CENTER, sort = 90),
|
||||
@ExcelField(title = "优先等级", attrName = "priority", dictType = "priority", align = Align.CENTER, sort = 100),
|
||||
@ExcelField(title = "日程状态", attrName = "ustatus", dictType = "todo_status", align = Align.CENTER, sort = 110),
|
||||
@ExcelField(title = "提醒时间", attrName = "remindTime", align = Align.CENTER, sort = 120, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
@ExcelField(title = "创建人账号", attrName = "creatorUser", align = Align.CENTER, sort = 130),
|
||||
@ExcelField(title = "接收人账号", attrName = "participantUser", align = Align.CENTER, sort = 150),
|
||||
@ExcelField(title = "接收人名称", attrName = "participantName", align = Align.CENTER, sort = 160),
|
||||
@ExcelField(title = "更新时间", attrName = "updateTime", align = Align.CENTER, sort = 170, dataFormat = "yyyy-MM-dd hh:mm"),
|
||||
})
|
||||
public BizCalendarSchedule() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public BizCalendarSchedule(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.BizCalendarSchedule;
|
||||
import com.jeesite.modules.biz.dao.BizCalendarScheduleDao;
|
||||
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-12-10
|
||||
*/
|
||||
@Service
|
||||
public class BizCalendarScheduleService extends CrudService<BizCalendarScheduleDao, BizCalendarSchedule> {
|
||||
|
||||
/**
|
||||
* 获取单条数据
|
||||
* @param bizCalendarSchedule 主键
|
||||
*/
|
||||
@Override
|
||||
public BizCalendarSchedule get(BizCalendarSchedule bizCalendarSchedule) {
|
||||
return super.get(bizCalendarSchedule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页数据
|
||||
* @param bizCalendarSchedule 查询条件
|
||||
* @param bizCalendarSchedule page 分页对象
|
||||
*/
|
||||
@Override
|
||||
public Page<BizCalendarSchedule> findPage(BizCalendarSchedule bizCalendarSchedule) {
|
||||
return super.findPage(bizCalendarSchedule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
* @param bizCalendarSchedule 查询条件
|
||||
*/
|
||||
@Override
|
||||
public List<BizCalendarSchedule> findList(BizCalendarSchedule bizCalendarSchedule) {
|
||||
return super.findList(bizCalendarSchedule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据(插入或更新)
|
||||
* @param bizCalendarSchedule 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void save(BizCalendarSchedule bizCalendarSchedule) {
|
||||
super.save(bizCalendarSchedule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
* @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<BizCalendarSchedule> list = ei.getDataList(BizCalendarSchedule.class);
|
||||
for (BizCalendarSchedule bizCalendarSchedule : list) {
|
||||
try{
|
||||
ValidatorUtils.validateWithException(bizCalendarSchedule);
|
||||
this.save(bizCalendarSchedule);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、编号 " + bizCalendarSchedule.getId() + " 导入成功");
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、编号 " + bizCalendarSchedule.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 bizCalendarSchedule 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateStatus(BizCalendarSchedule bizCalendarSchedule) {
|
||||
super.updateStatus(bizCalendarSchedule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
* @param bizCalendarSchedule 数据对象
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void delete(BizCalendarSchedule bizCalendarSchedule) {
|
||||
super.delete(bizCalendarSchedule);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
package com.jeesite.modules.biz.web;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.jeesite.modules.app.utils.vDate;
|
||||
import com.jeesite.modules.sys.entity.User;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
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.BizCalendarSchedule;
|
||||
import com.jeesite.modules.biz.service.BizCalendarScheduleService;
|
||||
|
||||
/**
|
||||
* 日程信息Controller
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2025-12-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/biz/calendarSchedule")
|
||||
public class BizCalendarScheduleController extends BaseController {
|
||||
|
||||
private final BizCalendarScheduleService bizCalendarScheduleService;
|
||||
|
||||
public BizCalendarScheduleController(BizCalendarScheduleService bizCalendarScheduleService) {
|
||||
this.bizCalendarScheduleService = bizCalendarScheduleService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public BizCalendarSchedule get(String scheduleId, boolean isNewRecord) {
|
||||
return bizCalendarScheduleService.get(scheduleId, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarSchedule:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(BizCalendarSchedule bizCalendarSchedule, Model model) {
|
||||
model.addAttribute("bizCalendarSchedule", bizCalendarSchedule);
|
||||
return "modules/biz/bizCalendarScheduleList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarSchedule:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<BizCalendarSchedule> listData(BizCalendarSchedule bizCalendarSchedule, HttpServletRequest request, HttpServletResponse response) {
|
||||
bizCalendarSchedule.setPage(new Page<>(request, response));
|
||||
Page<BizCalendarSchedule> page = bizCalendarScheduleService.findPage(bizCalendarSchedule);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarSchedule:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(BizCalendarSchedule bizCalendarSchedule, Model model) {
|
||||
model.addAttribute("bizCalendarSchedule", bizCalendarSchedule);
|
||||
return "modules/biz/bizCalendarScheduleForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarSchedule:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizCalendarSchedule bizCalendarSchedule) {
|
||||
User user = UserUtils.getUser();
|
||||
User fUser = UserUtils.getByLoginCode(bizCalendarSchedule.getParticipantUser());
|
||||
bizCalendarSchedule.setCreatorUser(user.getLoginCode());
|
||||
bizCalendarSchedule.setParticipantName(fUser.getUserName());
|
||||
bizCalendarSchedule.setUpdateTime(vDate.getUpdateTime(bizCalendarSchedule.getIsNewRecord()));
|
||||
bizCalendarScheduleService.save(bizCalendarSchedule);
|
||||
return renderResult(Global.TRUE, text("保存日程信息成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarSchedule:view")
|
||||
@RequestMapping(value = "exportData")
|
||||
public void exportData(BizCalendarSchedule bizCalendarSchedule, HttpServletResponse response) {
|
||||
List<BizCalendarSchedule> list = bizCalendarScheduleService.findList(bizCalendarSchedule);
|
||||
String fileName = "日程信息" + DateUtils.getDate("yyyyMMddHHmmss") + ".xlsx";
|
||||
try (ExcelExport ee = new ExcelExport("日程信息", BizCalendarSchedule.class)) {
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模板
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarSchedule:view")
|
||||
@RequestMapping(value = "importTemplate")
|
||||
public void importTemplate(HttpServletResponse response) {
|
||||
BizCalendarSchedule bizCalendarSchedule = new BizCalendarSchedule();
|
||||
List<BizCalendarSchedule> list = ListUtils.newArrayList(bizCalendarSchedule);
|
||||
String fileName = "日程信息模板.xlsx";
|
||||
try (ExcelExport ee = new ExcelExport("日程信息", BizCalendarSchedule.class, Type.IMPORT)) {
|
||||
ee.setDataList(list).write(response, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入数据
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequiresPermissions("biz:calendarSchedule:edit")
|
||||
@PostMapping(value = "importData")
|
||||
public String importData(MultipartFile file) {
|
||||
try {
|
||||
String message = bizCalendarScheduleService.importData(file);
|
||||
return renderResult(Global.TRUE, "posfull:" + message);
|
||||
} catch (Exception ex) {
|
||||
return renderResult(Global.FALSE, "posfull:" + ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("biz:calendarSchedule:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(BizCalendarSchedule bizCalendarSchedule) {
|
||||
bizCalendarScheduleService.delete(bizCalendarSchedule);
|
||||
return renderResult(Global.TRUE, text("删除日程信息成功!"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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.BizCalendarScheduleDao">
|
||||
|
||||
<!-- 查询数据
|
||||
<select id="findList" resultType="BizCalendarSchedule">
|
||||
SELECT ${sqlMap.column.toSql()}
|
||||
FROM ${sqlMap.table.toSql()}
|
||||
<where>
|
||||
${sqlMap.where.toSql()}
|
||||
</where>
|
||||
ORDER BY ${sqlMap.order.toSql()}
|
||||
</select> -->
|
||||
|
||||
</mapper>
|
||||
60
web-vue/packages/biz/api/biz/calendarSchedule.ts
Normal file
60
web-vue/packages/biz/api/biz/calendarSchedule.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* 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 BizCalendarSchedule extends BasicModel<BizCalendarSchedule> {
|
||||
createTime?: string; // 记录时间
|
||||
scheduleId?: string; // 主键标识
|
||||
scheduleNo: string; // 日程编号
|
||||
title: string; // 日程标题
|
||||
content?: string; // 日程详情/备注
|
||||
startTime: string; // 日程开始时间
|
||||
endTime: string; // 日程结束时间
|
||||
allDay: string; // 是否全天
|
||||
location?: string; // 日程地点
|
||||
priority: string; // 优先等级
|
||||
ustatus: string; // 日程状态
|
||||
remindTime?: string; // 提醒时间
|
||||
creatorUser?: string; // 创建人账号
|
||||
creatorName?: string; // 创建人名称
|
||||
participantUser?: string; // 接收人账号
|
||||
participantName?: string; // 接收人名称
|
||||
updateTime?: string; // 更新时间
|
||||
}
|
||||
|
||||
export const bizCalendarScheduleList = (params?: BizCalendarSchedule | any) =>
|
||||
defHttp.get<BizCalendarSchedule>({ url: adminPath + '/biz/calendarSchedule/list', params });
|
||||
|
||||
export const bizCalendarScheduleListData = (params?: BizCalendarSchedule | any) =>
|
||||
defHttp.post<Page<BizCalendarSchedule>>({ url: adminPath + '/biz/calendarSchedule/listData', params });
|
||||
|
||||
export const bizCalendarScheduleForm = (params?: BizCalendarSchedule | any) =>
|
||||
defHttp.get<BizCalendarSchedule>({ url: adminPath + '/biz/calendarSchedule/form', params });
|
||||
|
||||
export const bizCalendarScheduleSave = (params?: any, data?: BizCalendarSchedule | any) =>
|
||||
defHttp.postJson<BizCalendarSchedule>({ url: adminPath + '/biz/calendarSchedule/save', params, data });
|
||||
|
||||
export const bizCalendarScheduleImportData = (
|
||||
params: UploadFileParams,
|
||||
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
||||
) =>
|
||||
defHttp.uploadFile<UploadApiResult>(
|
||||
{
|
||||
url: ctxPath + adminPath + '/biz/calendarSchedule/importData',
|
||||
onUploadProgress,
|
||||
},
|
||||
params,
|
||||
);
|
||||
|
||||
export const bizCalendarScheduleDelete = (params?: BizCalendarSchedule | any) =>
|
||||
defHttp.get<BizCalendarSchedule>({ url: adminPath + '/biz/calendarSchedule/delete', params });
|
||||
188
web-vue/packages/biz/views/biz/calendarSchedule/form.vue
Normal file
188
web-vue/packages/biz/views/biz/calendarSchedule/form.vue
Normal file
@@ -0,0 +1,188 @@
|
||||
<!--
|
||||
* 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:calendarSchedule: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="ViewsBizCalendarScheduleForm">
|
||||
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 { BizCalendarSchedule, bizCalendarScheduleSave, bizCalendarScheduleForm } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.calendarSchedule');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizCalendarSchedule>({} as BizCalendarSchedule);
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: record.value.isNewRecord ? t('新增日程信息') : t('编辑日程信息'),
|
||||
}));
|
||||
|
||||
const inputFormSchemas: FormSchema<BizCalendarSchedule>[] = [
|
||||
{
|
||||
label: t('日程标题'),
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 255,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('日程编号'),
|
||||
field: 'scheduleNo',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 64,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('通知人员'),
|
||||
field: 'participantUser',
|
||||
fieldLabel: 'participantName',
|
||||
component: 'ListSelect',
|
||||
componentProps: {
|
||||
selectType: 'userSelect',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('日程内容'),
|
||||
field: 'content',
|
||||
component: 'InputTextArea',
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('开始时间'),
|
||||
field: 'startTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('结束时间'),
|
||||
field: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('是否全天'),
|
||||
field: 'allDay',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_day',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('优先等级'),
|
||||
field: 'priority',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'priority',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('提醒时间'),
|
||||
field: 'remindTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('日程状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'todo_status',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('日程地点'),
|
||||
field: 'location',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 512,
|
||||
},
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
];
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizCalendarSchedule>({
|
||||
labelWidth: 120,
|
||||
schemas: inputFormSchemas,
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await bizCalendarScheduleForm(data);
|
||||
record.value = (res.bizCalendarSchedule || {}) as BizCalendarSchedule;
|
||||
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,
|
||||
scheduleId: record.value.scheduleId || data.scheduleId,
|
||||
};
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await bizCalendarScheduleSave(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/calendarSchedule/formImport.vue
Normal file
103
web-vue/packages/biz/views/biz/calendarSchedule/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 { bizCalendarScheduleImportData } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
import { FileType } from 'ant-design-vue/es/upload/interface';
|
||||
import { AxiosProgressEvent } from 'axios';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.calendarSchedule');
|
||||
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/calendarSchedule/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 bizCalendarScheduleImportData(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>
|
||||
311
web-vue/packages/biz/views/biz/calendarSchedule/list.vue
Normal file
311
web-vue/packages/biz/views/biz/calendarSchedule/list.vue
Normal file
@@ -0,0 +1,311 @@
|
||||
<!--
|
||||
* 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="primary" @click="handleForm({})" v-auth="'biz:calendarSchedule:edit'">
|
||||
<Icon icon="i-fluent:add-12-filled" /> {{ t('新增') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #slotBizKey="{ record }">
|
||||
<a v-if="record.ustatus !== '9'" @click="handleForm({ scheduleId: record.scheduleId })" :title="record.title">
|
||||
{{ record.title }}
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
<FormImport @register="registerImportModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizCalendarScheduleList">
|
||||
import { onMounted, ref, unref, computed } 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 { BizCalendarSchedule, bizCalendarScheduleList } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
import { bizCalendarScheduleDelete, bizCalendarScheduleListData } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
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';
|
||||
import { useUserStore } from '@jeesite/core/store/modules/user';
|
||||
|
||||
const { t } = useI18n('biz.calendarSchedule');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizCalendarSchedule>({} as BizCalendarSchedule);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userinfo = computed(() => userStore.getUserInfo);
|
||||
|
||||
const getTitle = {
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: meta.title || t('日程信息管理'),
|
||||
};
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm: FormProps<BizCalendarSchedule> = {
|
||||
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: 'scheduleNo',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('日程标题'),
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('是否全天'),
|
||||
field: 'allDay',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_day',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('优先等级'),
|
||||
field: 'priority',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'priority',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('日程状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'todo_status',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<BizCalendarSchedule>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'left',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('日程编号'),
|
||||
dataIndex: 'scheduleNo',
|
||||
key: 'a.schedule_no',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('日程标题'),
|
||||
dataIndex: 'title',
|
||||
key: 'a.title',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
slot: 'slotBizKey',
|
||||
},
|
||||
{
|
||||
title: t('开始时间'),
|
||||
dataIndex: 'startTime',
|
||||
key: 'a.start_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('结束时间'),
|
||||
dataIndex: 'endTime',
|
||||
key: 'a.end_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('是否全天'),
|
||||
dataIndex: 'allDay',
|
||||
key: 'a.all_day',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'is_day',
|
||||
},
|
||||
{
|
||||
title: t('日程地点'),
|
||||
dataIndex: 'location',
|
||||
key: 'a.location',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('通知人员'),
|
||||
dataIndex: 'participantName',
|
||||
key: 'a.participant_name',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('优先等级'),
|
||||
dataIndex: 'priority',
|
||||
key: 'a.priority',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
dictType: 'priority',
|
||||
},
|
||||
{
|
||||
title: t('日程状态'),
|
||||
dataIndex: 'ustatus',
|
||||
key: 'a.ustatus',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
dictType: 'todo_status',
|
||||
},
|
||||
{
|
||||
title: t('提醒时间'),
|
||||
dataIndex: 'remindTime',
|
||||
key: 'a.remind_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<BizCalendarSchedule> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: BizCalendarSchedule) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { scheduleId: record.scheduleId }),
|
||||
auth: 'biz:calendarSchedule:edit',
|
||||
ifShow: record.ustatus !== '9'
|
||||
},
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除日程信息?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:calendarSchedule:edit',
|
||||
ifShow: record.ustatus == '0'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const [registerTable, { reload, getForm }] = useTable<BizCalendarSchedule>({
|
||||
api: bizCalendarScheduleListData,
|
||||
beforeFetch: (params) => {
|
||||
return {
|
||||
... params,
|
||||
creatorUser: userinfo.value.loginCode ,
|
||||
};
|
||||
},
|
||||
columns: tableColumns,
|
||||
actionColumn: actionColumn,
|
||||
formConfig: searchForm,
|
||||
showTableSetting: true,
|
||||
useSearchForm: true,
|
||||
canResize: true,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await bizCalendarScheduleList();
|
||||
record.value = (res.bizCalendarSchedule || {}) as BizCalendarSchedule;
|
||||
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/calendarSchedule/exportData',
|
||||
params: {
|
||||
... getForm().getFieldsValue(),
|
||||
creatorUser: userinfo.value.loginCode,
|
||||
},
|
||||
});
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
const [registerImportModal, { openModal: importModal }] = useModal();
|
||||
|
||||
function handleImport() {
|
||||
importModal(true, {});
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
const params = { scheduleId: record.scheduleId };
|
||||
const res = await bizCalendarScheduleDelete(params);
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
|
||||
async function handleSuccess(record: Recordable) {
|
||||
await reload({ record });
|
||||
}
|
||||
</script>
|
||||
@@ -201,7 +201,7 @@ const processTableData = () => {
|
||||
);
|
||||
|
||||
if (validData.length === 0) {
|
||||
return { accountNames: [], series: [], bankDetailMap: {}, latestDate: '' };
|
||||
return { accountNames: [], series: [], bankDetailMap: {}, latestDate: '', sortedDates: [] };
|
||||
}
|
||||
|
||||
// 1. 获取所有日期并排序(支持季度/月份格式)
|
||||
@@ -287,7 +287,7 @@ const processTableData = () => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化图表(X轴为银行名称,Tooltip展示月度明细)
|
||||
* 初始化图表(X轴为银行名称,Tooltip改为表格形式展示)
|
||||
*/
|
||||
const initChart = () => {
|
||||
if (!chartDom.value) return;
|
||||
@@ -319,53 +319,77 @@ const initChart = () => {
|
||||
trigger: 'axis',
|
||||
axisPointer: { type: 'shadow' },
|
||||
textStyle: { fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
padding: [12, 15],
|
||||
// Tooltip重构为:标题 + 明细表格 + 汇总行
|
||||
formatter: function(params: any) {
|
||||
if (!params || params.length === 0) return '';
|
||||
// 获取当前银行名称
|
||||
const bankName = params[0]?.axisValue || '';
|
||||
const bankDetails = bankDetailMap[bankName] || {};
|
||||
|
||||
// 生成各周期明细行
|
||||
let cycleRows = '';
|
||||
// 生成周期明细表格行
|
||||
let cycleTableRows = '';
|
||||
let hasData = false;
|
||||
sortedDates.forEach(date => {
|
||||
const detail = bankDetails[date] || { income: 0, expense: 0 };
|
||||
const incomeYuan = convertToYuan(detail.income);
|
||||
const expenseYuan = convertToYuan(detail.expense);
|
||||
|
||||
if (incomeYuan > 0 || expenseYuan > 0) {
|
||||
cycleRows += `
|
||||
<div style="display: flex; justify-content: space-between; margin: 4px 0;">
|
||||
<span style="display: flex; align-items: center;">
|
||||
hasData = true;
|
||||
cycleTableRows += `
|
||||
<tr>
|
||||
<td style="padding: 4px 8px; text-align: left;">
|
||||
<span style="display: inline-block; width: 8px; height: 8px; background: ${incomeYuan > 0 ? '#52c41a' : '#f5222d'}; border-radius: 2px; margin-right: 6px;"></span>
|
||||
${date}
|
||||
</span>
|
||||
<span style="display: flex; gap: 15px;">
|
||||
<span style="color: #52c41a;">收入:${formatNumber(incomeYuan)} </span>
|
||||
<span style="color: #f5222d;">支出:${formatNumber(expenseYuan)} </span>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding: 4px 8px; text-align: right; color: #52c41a;">${formatNumber(incomeYuan)}</td>
|
||||
<td style="padding: 4px 8px; text-align: right; color: #f5222d;">${formatNumber(expenseYuan)}</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
});
|
||||
|
||||
// 空明细处理
|
||||
if (!hasData) {
|
||||
cycleTableRows = `
|
||||
<tr>
|
||||
<td colspan="3" style="padding: 8px; text-align: center; color: #999;">暂无周期明细数据</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
|
||||
// 计算最新周期汇总
|
||||
const latestDetail = bankDetails[latestDate] || { income: 0, expense: 0 };
|
||||
const latestIncome = convertToYuan(latestDetail.income);
|
||||
const latestExpense = convertToYuan(latestDetail.expense);
|
||||
const netIncome = latestIncome - latestExpense;
|
||||
|
||||
// 完整表格化Tooltip结构
|
||||
return `
|
||||
<div style="font-weight: 600; margin-bottom: 8px;">${bankName}</div>
|
||||
${cycleRows}
|
||||
<div style="border-top: 1px solid #eee; margin: 8px 0; padding-top: 8px; display: flex; justify-content: space-between; font-weight: 600;">
|
||||
<span>本期总收入:</span>
|
||||
<span style="display: flex; gap: 15px;">
|
||||
<span style="color: #52c41a;">收入:${formatNumber(latestIncome)} 元</span>
|
||||
<span style="color: #f5222d;">支出:${formatNumber(latestExpense)} 元</span>
|
||||
</span>
|
||||
<!-- 标题 -->
|
||||
<div style="font-weight: 600; margin-bottom: 8px; text-align: center; font-size: 14px;">${bankName}</div>
|
||||
<!-- 明细表格 -->
|
||||
<table style="width: 100%; border-collapse: collapse; border: 1px solid #eee; margin-bottom: 8px;">
|
||||
<thead>
|
||||
<tr style="background: #f8f8f8;">
|
||||
<th style="padding: 6px 8px; text-align: left; border: 1px solid #eee;">周期</th>
|
||||
<th style="padding: 6px 8px; text-align: right; border: 1px solid #eee; color: #52c41a;">收入(元)</th>
|
||||
<th style="padding: 6px 8px; text-align: right; border: 1px solid #eee; color: #f5222d;">支出(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${cycleTableRows}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- 汇总行 -->
|
||||
<div style="border-top: 1px solid #eee; margin: 8px 0; padding-top: 8px;">
|
||||
<div style="display: flex; justify-content: space-between; color: #333;">
|
||||
<span style="color: #52c41a;">本期总收入:${formatNumber(latestIncome)} 元</span>
|
||||
<span style="color: #f5222d;">本期总支出:${formatNumber(latestExpense)} 元</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: left; color: #333; font-weight: 600;">
|
||||
<div style="text-align: left; font-weight: 600; color: #333;">
|
||||
本期净收入:${formatNumber(netIncome)} 元
|
||||
</div>
|
||||
`;
|
||||
@@ -486,15 +510,16 @@ onUnmounted(() => {
|
||||
border-radius: 4px; /* 图例也添加圆角,保持风格统一 */
|
||||
}
|
||||
|
||||
/* Tooltip样式 */
|
||||
/* Tooltip样式优化(适配表格) */
|
||||
:deep(.echarts-tooltip) {
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
padding: 12px !important;
|
||||
box-shadow: 0 2px 12px rgba(0,0,0,0.15);
|
||||
border: none;
|
||||
background: #fff;
|
||||
z-index: 9999 !important;
|
||||
max-width: 400px; /* 限制Tooltip宽度,避免过宽 */
|
||||
min-width: 450px; /* 保证表格有足够宽度 */
|
||||
max-width: 500px; /* 限制最大宽度避免过宽 */
|
||||
}
|
||||
|
||||
/* 优化标签显示效果 */
|
||||
@@ -511,4 +536,15 @@ onUnmounted(() => {
|
||||
word-break: keep-all;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Tooltip表格样式增强 */
|
||||
:deep(.echarts-tooltip table) {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip th) {
|
||||
font-weight: 600;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
@@ -216,8 +216,7 @@ const processTableData = () => {
|
||||
data: dateList.map(date => incomeTotalMap[date]),
|
||||
itemStyle: {
|
||||
...baseBarConfig.itemStyle,
|
||||
color: '#52c41a', // 收入绿色
|
||||
// 可选:收入柱子添加渐变效果,增强视觉体验
|
||||
// 收入柱子添加渐变效果,增强视觉体验
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#73d13d' },
|
||||
{ offset: 1, color: '#52c41a' }
|
||||
@@ -235,8 +234,7 @@ const processTableData = () => {
|
||||
data: dateList.map(date => expenseTotalMap[date]),
|
||||
itemStyle: {
|
||||
...baseBarConfig.itemStyle,
|
||||
color: '#f5222d', // 支出红色
|
||||
// 可选:支出柱子添加渐变效果,增强视觉体验
|
||||
// 支出柱子添加渐变效果,增强视觉体验
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: '#ff4d4f' },
|
||||
{ offset: 1, color: '#f5222d' }
|
||||
@@ -259,7 +257,7 @@ const processTableData = () => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 初始化图表(改为总值显示,恢复原Tooltip格式)
|
||||
* 初始化图表(改为总值显示,Tooltip改为表格形式)
|
||||
*/
|
||||
const initChart = () => {
|
||||
if (!chartDom.value) return;
|
||||
@@ -292,6 +290,7 @@ const initChart = () => {
|
||||
axisPointer: { type: 'shadow' },
|
||||
textStyle: { fontSize: 12 },
|
||||
padding: [10, 15],
|
||||
// Tooltip改为表格形式展示
|
||||
formatter: function(params: any) {
|
||||
if (!params || params.length === 0) return '';
|
||||
const date = params[0]?.axisValue || '';
|
||||
@@ -301,11 +300,11 @@ const initChart = () => {
|
||||
const expenseTotal = convertToYuan(expenseTotalMap[date] || 0);
|
||||
const netIncome = incomeTotal - expenseTotal;
|
||||
|
||||
let accountRows = '';
|
||||
const accountDetails = accountDetailMap[date] || {};
|
||||
const accountNames = Object.keys(accountDetails).sort();
|
||||
|
||||
// 生成账户明细行(保持原格式)
|
||||
// 生成账户明细表格行
|
||||
let accountTableRows = '';
|
||||
accountNames.forEach(account => {
|
||||
const detail = accountDetails[account];
|
||||
if (detail.income > 0 || detail.expense > 0) {
|
||||
@@ -313,32 +312,44 @@ const initChart = () => {
|
||||
const incomeValue = convertToYuan(detail.income);
|
||||
const expenseValue = convertToYuan(detail.expense);
|
||||
|
||||
accountRows += `
|
||||
<div style="display: flex; justify-content: space-between; margin: 4px 0;">
|
||||
<span style="display: flex; align-items: center;">
|
||||
accountTableRows += `
|
||||
<tr>
|
||||
<td style="padding: 4px 8px; text-align: left;">
|
||||
<span style="display: inline-block; width: 8px; height: 8px; background: ${detail.income > 0 ? '#52c41a' : '#f5222d'}; border-radius: 2px; margin-right: 6px;"></span>
|
||||
${account}
|
||||
</span>
|
||||
<span style="display: flex; gap: 15px;">
|
||||
<span style="color: #52c41a;">收入:${formatNumber(incomeValue)} </span>
|
||||
<span style="color: #f5222d;">支出:${formatNumber(expenseValue)} </span>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td style="padding: 4px 8px; text-align: right; color: #52c41a;">${formatNumber(incomeValue)}</td>
|
||||
<td style="padding: 4px 8px; text-align: right; color: #f5222d;">${formatNumber(expenseValue)}</td>
|
||||
</tr>
|
||||
`;
|
||||
}
|
||||
});
|
||||
|
||||
// 保持原Tooltip的HTML结构
|
||||
// 完整的表格结构Tooltip
|
||||
return `
|
||||
<div style="font-weight: 600; margin-bottom: 8px;">${date}</div>
|
||||
${accountRows}
|
||||
<div style="font-weight: 600; margin-bottom: 8px; text-align: center;">${date}</div>
|
||||
<!-- 账户明细表格 -->
|
||||
<table style="width: 100%; border-collapse: collapse; border: 1px solid #eee;">
|
||||
<thead>
|
||||
<tr style="background: #f8f8f8;">
|
||||
<th style="padding: 6px 8px; text-align: left; border: 1px solid #eee;">账户名称</th>
|
||||
<th style="padding: 6px 8px; text-align: right; border: 1px solid #eee; color: #52c41a;">收入(元)</th>
|
||||
<th style="padding: 6px 8px; text-align: right; border: 1px solid #eee; color: #f5222d;">支出(元)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${accountTableRows || '<tr><td colspan="3" style="padding: 8px; text-align: center; color: #999;">暂无明细数据</td></tr>'}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- 汇总行 -->
|
||||
<div style="border-top: 1px solid #eee; margin: 8px 0; padding-top: 8px; display: flex; justify-content: space-between; font-weight: 600;">
|
||||
<span style="display: flex; gap: 15px;">
|
||||
<span>总计</span>
|
||||
<span style="display: flex; gap: 20px;">
|
||||
<span style="color: #52c41a;">总收入:${formatNumber(incomeTotal)} 元</span>
|
||||
<span style="color: #f5222d;">总支出:${formatNumber(expenseTotal)} 元</span>
|
||||
</span>
|
||||
</div>
|
||||
<div style="text-align: left; color: #333; font-weight: 600;">
|
||||
<div style="text-align: right; font-weight: 600; color: #333;">
|
||||
净收入:${formatNumber(netIncome)} 元
|
||||
</div>
|
||||
`;
|
||||
@@ -460,14 +471,15 @@ onUnmounted(() => {
|
||||
border-radius: 4px; /* 图例也添加圆角,保持风格统一 */
|
||||
}
|
||||
|
||||
/* Tooltip样式 */
|
||||
/* Tooltip样式优化(适配表格) */
|
||||
:deep(.echarts-tooltip) {
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
padding: 12px !important;
|
||||
box-shadow: 0 2px 12px rgba(0,0,0,0.15);
|
||||
border: none;
|
||||
background: #fff;
|
||||
z-index: 9999 !important;
|
||||
min-width: 400px; /* 保证表格有足够宽度 */
|
||||
}
|
||||
|
||||
/* 优化标签显示效果 */
|
||||
@@ -484,4 +496,20 @@ onUnmounted(() => {
|
||||
word-break: keep-all;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Tooltip表格样式优化 */
|
||||
:deep(.echarts-tooltip table) {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip th) {
|
||||
font-weight: 600;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
:deep(.echarts-tooltip td, .echarts-tooltip th) {
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
</style>
|
||||
@@ -179,7 +179,7 @@
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
/* 样式部分保持不变 */
|
||||
.card-container {
|
||||
width: 100%;
|
||||
height: 18vh;
|
||||
height: 12vh;
|
||||
min-height: 160px;
|
||||
background-color: #e6f7ff;
|
||||
padding: 10px 0;
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
<!--
|
||||
* 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"
|
||||
:showFooter="true"
|
||||
:okAuth="'biz:calendarSchedule: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" />
|
||||
</BasicModal>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizCalendarScheduleForm">
|
||||
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 { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
||||
|
||||
import { BizCalendarSchedule, bizCalendarScheduleSave, bizCalendarScheduleForm } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.calendarSchedule');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizCalendarSchedule>({} as BizCalendarSchedule);
|
||||
|
||||
const getTitle = computed(() => ({
|
||||
icon: meta.icon || 'i-ant-design:book-outlined',
|
||||
value: record.value.isNewRecord ? t('新增日程信息') : t('编辑日程信息'),
|
||||
}));
|
||||
|
||||
const inputFormSchemas: FormSchema<BizCalendarSchedule>[] = [
|
||||
{
|
||||
label: t('日程标题'),
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 255,
|
||||
},
|
||||
required: true,
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('日程编号'),
|
||||
field: 'scheduleNo',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 64,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('通知人员'),
|
||||
field: 'participantUser',
|
||||
fieldLabel: 'participantName',
|
||||
component: 'ListSelect',
|
||||
componentProps: {
|
||||
selectType: 'userSelect',
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('日程内容'),
|
||||
field: 'content',
|
||||
component: 'InputTextArea',
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
{
|
||||
label: t('开始时间'),
|
||||
field: 'startTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('结束时间'),
|
||||
field: 'endTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('是否全天'),
|
||||
field: 'allDay',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_day',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('优先等级'),
|
||||
field: 'priority',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'priority',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('提醒时间'),
|
||||
field: 'remindTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
showTime: { format: 'HH:mm' },
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('日程状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'todo_status',
|
||||
allowClear: true,
|
||||
},
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: t('日程地点'),
|
||||
field: 'location',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
maxlength: 512,
|
||||
},
|
||||
colProps: { md: 24, lg: 24 },
|
||||
},
|
||||
];
|
||||
|
||||
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizCalendarSchedule>({
|
||||
labelWidth: 120,
|
||||
schemas: inputFormSchemas,
|
||||
baseColProps: { md: 24, lg: 12 },
|
||||
});
|
||||
|
||||
const [registerDrawer, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||
setModalProps({ loading: true });
|
||||
await resetFields();
|
||||
const res = await bizCalendarScheduleForm(data);
|
||||
record.value = (res.bizCalendarSchedule || {}) as BizCalendarSchedule;
|
||||
record.value.__t = new Date().getTime();
|
||||
await setFieldsValue(record.value);
|
||||
setModalProps({ loading: false });
|
||||
});
|
||||
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const data = await validate();
|
||||
setModalProps({ confirmLoading: true });
|
||||
const params: any = {
|
||||
isNewRecord: record.value.isNewRecord,
|
||||
scheduleId: record.value.scheduleId || data.scheduleId,
|
||||
};
|
||||
// console.log('submit', params, data, record);
|
||||
const res = await bizCalendarScheduleSave(params, data);
|
||||
showMessage(res.message);
|
||||
setTimeout(closeModal);
|
||||
emit('success', data);
|
||||
} catch (error: any) {
|
||||
if (error && error.errorFields) {
|
||||
showMessage(error.message || t('common.validateError'));
|
||||
}
|
||||
console.log('error', error);
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -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 { bizCalendarScheduleImportData } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
import { FileType } from 'ant-design-vue/es/upload/interface';
|
||||
import { AxiosProgressEvent } from 'axios';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.calendarSchedule');
|
||||
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/calendarSchedule/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 bizCalendarScheduleImportData(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>
|
||||
@@ -0,0 +1,280 @@
|
||||
<!--
|
||||
* 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 #toolbar>
|
||||
<a-button type="default" :loading="loading" @click="handleExport()">
|
||||
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
|
||||
</a-button>
|
||||
</template>
|
||||
<template #slotBizKey="{ record }">
|
||||
<a v-if="record.ustatus !== '9'" @click="handleForm({ scheduleId: record.scheduleId })" :title="record.title">
|
||||
{{ record.title }}
|
||||
</a>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InputForm @register="registerDrawer" @success="handleSuccess" />
|
||||
<FormImport @register="registerImportModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizCalendarScheduleList">
|
||||
import { onMounted, ref, unref, computed } 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 { BizCalendarSchedule, bizCalendarScheduleList } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
import { bizCalendarScheduleDelete, bizCalendarScheduleListData } from '@jeesite/biz/api/biz/calendarSchedule';
|
||||
import { useModal } from '@jeesite/core/components/Modal';
|
||||
import { FormProps } from '@jeesite/core/components/Form';
|
||||
import InputForm from './form.vue';
|
||||
import FormImport from './formImport.vue';
|
||||
import { useUserStore } from '@jeesite/core/store/modules/user';
|
||||
|
||||
const { t } = useI18n('biz.calendarSchedule');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizCalendarSchedule>({} as BizCalendarSchedule);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userinfo = computed(() => userStore.getUserInfo);
|
||||
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm: FormProps<BizCalendarSchedule> = {
|
||||
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: 'scheduleNo',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('日程标题'),
|
||||
field: 'title',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('是否全天'),
|
||||
field: 'allDay',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'is_day',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('优先等级'),
|
||||
field: 'priority',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'priority',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('日程状态'),
|
||||
field: 'ustatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
dictType: 'todo_status',
|
||||
allowClear: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<BizCalendarSchedule>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'left',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('日程编号'),
|
||||
dataIndex: 'scheduleNo',
|
||||
key: 'a.schedule_no',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('日程标题'),
|
||||
dataIndex: 'title',
|
||||
key: 'a.title',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
slot: 'slotBizKey',
|
||||
},
|
||||
{
|
||||
title: t('开始时间'),
|
||||
dataIndex: 'startTime',
|
||||
key: 'a.start_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('结束时间'),
|
||||
dataIndex: 'endTime',
|
||||
key: 'a.end_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('是否全天'),
|
||||
dataIndex: 'allDay',
|
||||
key: 'a.all_day',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
dictType: 'is_day',
|
||||
},
|
||||
{
|
||||
title: t('日程地点'),
|
||||
dataIndex: 'location',
|
||||
key: 'a.location',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('优先等级'),
|
||||
dataIndex: 'priority',
|
||||
key: 'a.priority',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
dictType: 'priority',
|
||||
},
|
||||
{
|
||||
title: t('日程状态'),
|
||||
dataIndex: 'ustatus',
|
||||
key: 'a.ustatus',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
dictType: 'todo_status',
|
||||
},
|
||||
{
|
||||
title: t('提醒时间'),
|
||||
dataIndex: 'remindTime',
|
||||
key: 'a.remind_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<BizCalendarSchedule> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: BizCalendarSchedule) => [
|
||||
{
|
||||
icon: 'i-clarity:note-edit-line',
|
||||
title: t('编辑'),
|
||||
onClick: handleForm.bind(this, { scheduleId: record.scheduleId }),
|
||||
auth: 'biz:calendarSchedule:edit',
|
||||
ifShow: record.ustatus !== '9'
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const [registerTable, { reload, getForm }] = useTable<BizCalendarSchedule>({
|
||||
api: bizCalendarScheduleListData,
|
||||
beforeFetch: (params) => {
|
||||
return {
|
||||
... params,
|
||||
participantUser: userinfo.value.loginCode ,
|
||||
};
|
||||
},
|
||||
columns: tableColumns,
|
||||
actionColumn: actionColumn,
|
||||
formConfig: searchForm,
|
||||
showTableSetting: true,
|
||||
useSearchForm: true,
|
||||
canResize: true,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await bizCalendarScheduleList();
|
||||
record.value = (res.bizCalendarSchedule || {}) as BizCalendarSchedule;
|
||||
await getForm().setFieldsValue(record.value);
|
||||
});
|
||||
|
||||
const [registerDrawer, { openModal }] = useModal();
|
||||
|
||||
function handleForm(record: Recordable) {
|
||||
openModal(true, record);
|
||||
}
|
||||
|
||||
async function handleExport() {
|
||||
loading.value = true;
|
||||
const { ctxAdminPath } = useGlobSetting();
|
||||
await downloadByUrl({
|
||||
url: ctxAdminPath + '/biz/calendarSchedule/exportData',
|
||||
params: {
|
||||
... getForm().getFieldsValue(),
|
||||
participantUser: userinfo.value.loginCode,
|
||||
},
|
||||
});
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
const [registerImportModal, { openModal: importModal }] = useModal();
|
||||
|
||||
function handleImport() {
|
||||
importModal(true, {});
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
const params = { scheduleId: record.scheduleId };
|
||||
const res = await bizCalendarScheduleDelete(params);
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
|
||||
async function handleSuccess(record: Recordable) {
|
||||
await reload({ record });
|
||||
}
|
||||
</script>
|
||||
@@ -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 { bizTableInfoImportData } from '@jeesite/biz/api/biz/tableInfo';
|
||||
import { FileType } from 'ant-design-vue/es/upload/interface';
|
||||
import { AxiosProgressEvent } from 'axios';
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const { t } = useI18n('biz.tableInfo');
|
||||
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/tableInfo/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 bizTableInfoImportData(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>
|
||||
@@ -0,0 +1,262 @@
|
||||
<!--
|
||||
* 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 #toolbar>
|
||||
<a-button type="default" :loading="loading" @click="handleExport()">
|
||||
<Icon icon="i-ant-design:download-outlined" /> {{ t('导出') }}
|
||||
</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<FormImport @register="registerImportModal" @success="handleSuccess" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup name="ViewsBizTableInfoList">
|
||||
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 { BizTableInfo, bizTableInfoList } from '@jeesite/biz/api/biz/tableInfo';
|
||||
import { bizTableInfoDelete, bizTableInfoListData } from '@jeesite/biz/api/biz/tableInfo';
|
||||
import { useDrawer } from '@jeesite/core/components/Drawer';
|
||||
import { useModal } from '@jeesite/core/components/Modal';
|
||||
import { FormProps } from '@jeesite/core/components/Form';
|
||||
import FormImport from './formImport.vue';
|
||||
|
||||
const { t } = useI18n('biz.tableInfo');
|
||||
const { showMessage } = useMessage();
|
||||
const { meta } = unref(router.currentRoute);
|
||||
const record = ref<BizTableInfo>({} as BizTableInfo);
|
||||
const loading = ref(false);
|
||||
|
||||
const searchForm: FormProps<BizTableInfo> = {
|
||||
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: 'dataName',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('数据表描述'),
|
||||
field: 'tableComment',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('数据库名称'),
|
||||
field: 'dbId',
|
||||
fieldLabel: 'dbName',
|
||||
component: 'ListSelect',
|
||||
componentProps: {
|
||||
selectType: 'bizDbSelect',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: t('数据来源'),
|
||||
field: 'dataSource',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: t('备注信息'),
|
||||
field: 'remarks',
|
||||
component: 'Input',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const tableColumns: BasicColumn<BizTableInfo>[] = [
|
||||
{
|
||||
title: t('记录时间'),
|
||||
dataIndex: 'createTime',
|
||||
key: 'a.create_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'left',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
title: t('数据库名称'),
|
||||
dataIndex: 'dbName',
|
||||
key: 'b.db_name',
|
||||
sorter: true,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('数据库IP'),
|
||||
dataIndex: 'dbIp',
|
||||
key: 'b.db_ip',
|
||||
sorter: true,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('数据表名称'),
|
||||
dataIndex: 'dataName',
|
||||
key: 'a.data_name',
|
||||
sorter: true,
|
||||
width: 200,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('数据表描述'),
|
||||
dataIndex: 'tableComment',
|
||||
key: 'a.table_comment',
|
||||
sorter: true,
|
||||
width: 225,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('数据表大小'),
|
||||
dataIndex: 'tableSize',
|
||||
key: 'a.table_size',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
title: t('数据来源'),
|
||||
dataIndex: 'dataSource',
|
||||
key: 'a.data_source',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('创建人员'),
|
||||
dataIndex: 'creator',
|
||||
key: 'a.creator',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('记录条数'),
|
||||
dataIndex: 'dataRows',
|
||||
key: 'a.data_rows',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('更新时间'),
|
||||
dataIndex: 'updateTime',
|
||||
key: 'a.update_time',
|
||||
sorter: true,
|
||||
width: 180,
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: t('备注信息'),
|
||||
dataIndex: 'remarks',
|
||||
key: 'a.remarks',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
{
|
||||
title: t('分区日期'),
|
||||
dataIndex: 'ds',
|
||||
key: 'a.ds',
|
||||
sorter: true,
|
||||
width: 130,
|
||||
align: 'left',
|
||||
},
|
||||
];
|
||||
|
||||
const actionColumn: BasicColumn<BizTableInfo> = {
|
||||
width: 160,
|
||||
align: 'center',
|
||||
actions: (record: BizTableInfo) => [
|
||||
{
|
||||
icon: 'i-ant-design:delete-outlined',
|
||||
color: 'error',
|
||||
title: t('删除'),
|
||||
popConfirm: {
|
||||
title: t('是否确认删除数据信息?'),
|
||||
confirm: handleDelete.bind(this, record),
|
||||
},
|
||||
auth: 'biz:tableInfo:edit',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const [registerTable, { reload, getForm }] = useTable<BizTableInfo>({
|
||||
api: bizTableInfoListData,
|
||||
beforeFetch: (params) => {
|
||||
return params;
|
||||
},
|
||||
columns: tableColumns,
|
||||
actionColumn: actionColumn,
|
||||
formConfig: searchForm,
|
||||
showTableSetting: true,
|
||||
useSearchForm: true,
|
||||
canResize: true,
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
const res = await bizTableInfoList();
|
||||
record.value = (res.bizTableInfo || {}) as BizTableInfo;
|
||||
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/tableInfo/exportData',
|
||||
params: getForm().getFieldsValue(),
|
||||
});
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
const [registerImportModal, { openModal: importModal }] = useModal();
|
||||
|
||||
function handleImport() {
|
||||
importModal(true, {});
|
||||
}
|
||||
|
||||
async function handleDelete(record: Recordable) {
|
||||
const params = { tableId: record.tableId };
|
||||
const res = await bizTableInfoDelete(params);
|
||||
showMessage(res.message);
|
||||
await handleSuccess(record);
|
||||
}
|
||||
|
||||
async function handleSuccess(record: Recordable) {
|
||||
await reload({ record });
|
||||
}
|
||||
</script>
|
||||
@@ -1,16 +1,22 @@
|
||||
<template>
|
||||
<PageWrapper title="数据看板">
|
||||
<template #headerContent>
|
||||
<MySchedule />
|
||||
</template>
|
||||
<div>
|
||||
<Tabs v-model:activeKey="activeKey">
|
||||
<TabPane key="1" tab="日程管理"></TabPane>
|
||||
<TabPane key="2" tab="工单管理"></TabPane>
|
||||
<TabPane key="3" tab="字典管理"></TabPane>
|
||||
</Tabs>
|
||||
<div class="web-page-container">
|
||||
<PageWrapper title="数据看板">
|
||||
<template #headerContent>
|
||||
<MySchedule />
|
||||
</template>
|
||||
<div>
|
||||
s
|
||||
</div>
|
||||
</PageWrapper>
|
||||
<Tabs v-model:activeKey="activeKey">
|
||||
<TabPane key="1" tab="日程管理">
|
||||
<Calendar />
|
||||
</TabPane>
|
||||
<TabPane key="2" tab="字典管理">
|
||||
<TableInfo />
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</div>
|
||||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup name="AboutPage">
|
||||
import { h, ref } from 'vue';
|
||||
@@ -18,7 +24,21 @@
|
||||
import { PageWrapper } from '@jeesite/core/components/Page';
|
||||
|
||||
import MySchedule from './components/MySchedule.vue';
|
||||
import Calendar from './components/calendar/list.vue';
|
||||
import TableInfo from './components/tableInfo/list.vue';
|
||||
|
||||
const activeKey = ref('1');
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
// 整体容器样式
|
||||
.web-page-container {
|
||||
width: 100%;
|
||||
background-color: #e8f4f8;
|
||||
display: flex;
|
||||
flex-direction: column; // 垂直布局
|
||||
overflow: hidden; // 防止内容溢出
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user