{
  "code": 200,
  "msg": "操作成功",
  "data": {
    "vm/java/domain.java.vm": "package org.dromara.system.domain;\n\nimport org.dromara.common.tenant.core.TenantEntity;\nimport com.baomidou.mybatisplus.annotation.*;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\n\nimport java.io.Serial;\n\n/**\n * 通知公告对象 sys_notice\n *\n * @author Lion Li\n * @date 2024-09-13\n */\n@Data\n@EqualsAndHashCode(callSuper = true)\n@TableName(\"sys_notice\")\npublic class SysNotice extends TenantEntity {\n\n    @Serial\n    private static final long serialVersionUID = 1L;\n\n    /**\n     * 公告ID\n     */\n    @TableId(value = \"notice_id\")\n    private Long noticeId;\n\n    /**\n     * 公告标题\n     */\n    private String noticeTitle;\n\n    /**\n     * 公告类型（1通知 2公告）\n     */\n    private String noticeType;\n\n    /**\n     * 公告内容\n     */\n    private String noticeContent;\n\n    /**\n     * 公告状态（0正常 1关闭）\n     */\n    private String status;\n\n    /**\n     * 备注\n     */\n    private String remark;\n\n\n}\n",
    "vm/java/vo.java.vm": "package org.dromara.system.domain.vo;\n\nimport org.dromara.system.domain.SysNotice;\nimport com.alibaba.excel.annotation.ExcelIgnoreUnannotated;\nimport com.alibaba.excel.annotation.ExcelProperty;\nimport org.dromara.common.excel.annotation.ExcelDictFormat;\nimport org.dromara.common.excel.convert.ExcelDictConvert;\nimport io.github.linpeilie.annotations.AutoMapper;\nimport lombok.Data;\n\nimport java.io.Serial;\nimport java.io.Serializable;\nimport java.util.Date;\n\n\n\n/**\n * 通知公告视图对象 sys_notice\n *\n * @author Lion Li\n * @date 2024-09-13\n */\n@Data\n@ExcelIgnoreUnannotated\n@AutoMapper(target = SysNotice.class)\npublic class SysNoticeVo implements Serializable {\n\n    @Serial\n    private static final long serialVersionUID = 1L;\n\n    /**\n     * 公告ID\n     */\n    @ExcelProperty(value = \"公告ID\")\n    private Long noticeId;\n\n    /**\n     * 公告标题\n     */\n    @ExcelProperty(value = \"公告标题\")\n    private String noticeTitle;\n\n    /**\n     * 公告类型（1通知 2公告）\n     */\n    @ExcelProperty(value = \"公告类型\", converter = ExcelDictConvert.class)\n    @ExcelDictFormat(readConverterExp = \"1=通知,2=公告\")\n    private String noticeType;\n\n    /**\n     * 公告内容\n     */\n    @ExcelProperty(value = \"公告内容\")\n    private String noticeContent;\n\n    /**\n     * 公告状态（0正常 1关闭）\n     */\n    @ExcelProperty(value = \"公告状态\", converter = ExcelDictConvert.class)\n    @ExcelDictFormat(readConverterExp = \"0=正常,1=关闭\")\n    private String status;\n\n    /**\n     * 备注\n     */\n    @ExcelProperty(value = \"备注\")\n    private String remark;\n\n\n}\n",
    "vm/java/bo.java.vm": "package org.dromara.system.domain.bo;\n\nimport org.dromara.system.domain.SysNotice;\nimport org.dromara.common.mybatis.core.domain.BaseEntity;\nimport org.dromara.common.core.validate.AddGroup;\nimport org.dromara.common.core.validate.EditGroup;\nimport io.github.linpeilie.annotations.AutoMapper;\nimport lombok.Data;\nimport lombok.EqualsAndHashCode;\nimport jakarta.validation.constraints.*;\n\n/**\n * 通知公告业务对象 sys_notice\n *\n * @author Lion Li\n * @date 2024-09-13\n */\n@Data\n@EqualsAndHashCode(callSuper = true)\n@AutoMapper(target = SysNotice.class, reverseConvertGenerate = false)\npublic class SysNoticeBo extends BaseEntity {\n\n    /**\n     * 公告ID\n     */\n    @NotNull(message = \"公告ID不能为空\", groups = { EditGroup.class })\n    private Long noticeId;\n\n    /**\n     * 公告标题\n     */\n    @NotBlank(message = \"公告标题不能为空\", groups = { AddGroup.class, EditGroup.class })\n    private String noticeTitle;\n\n    /**\n     * 公告类型（1通知 2公告）\n     */\n    @NotBlank(message = \"公告类型（1通知 2公告）不能为空\", groups = { AddGroup.class, EditGroup.class })\n    private String noticeType;\n\n    /**\n     * 公告内容\n     */\n    @NotBlank(message = \"公告内容不能为空\", groups = { AddGroup.class, EditGroup.class })\n    private String noticeContent;\n\n    /**\n     * 公告状态（0正常 1关闭）\n     */\n    @NotBlank(message = \"公告状态（0正常 1关闭）不能为空\", groups = { AddGroup.class, EditGroup.class })\n    private String status;\n\n    /**\n     * 备注\n     */\n    @NotBlank(message = \"备注不能为空\", groups = { AddGroup.class, EditGroup.class })\n    private String remark;\n\n\n}\n",
    "vm/java/mapper.java.vm": "package org.dromara.system.mapper;\n\nimport org.dromara.system.domain.SysNotice;\nimport org.dromara.system.domain.vo.SysNoticeVo;\nimport org.dromara.common.mybatis.core.mapper.BaseMapperPlus;\n\n/**\n * 通知公告Mapper接口\n *\n * @author Lion Li\n * @date 2024-09-13\n */\npublic interface SysNoticeMapper extends BaseMapperPlus<SysNotice, SysNoticeVo> {\n\n}\n",
    "vm/java/service.java.vm": "package org.dromara.system.service;\n\nimport org.dromara.system.domain.vo.SysNoticeVo;\nimport org.dromara.system.domain.bo.SysNoticeBo;\nimport org.dromara.common.mybatis.core.page.TableDataInfo;\nimport org.dromara.common.mybatis.core.page.PageQuery;\n\nimport java.util.Collection;\nimport java.util.List;\n\n/**\n * 通知公告Service接口\n *\n * @author Lion Li\n * @date 2024-09-13\n */\npublic interface ISysNoticeService {\n\n    /**\n     * 查询通知公告\n     *\n     * @param noticeId 主键\n     * @return 通知公告\n     */\n    SysNoticeVo queryById(Long noticeId);\n\n    /**\n     * 分页查询通知公告列表\n     *\n     * @param bo        查询条件\n     * @param pageQuery 分页参数\n     * @return 通知公告分页列表\n     */\n    TableDataInfo<SysNoticeVo> queryPageList(SysNoticeBo bo, PageQuery pageQuery);\n\n    /**\n     * 查询符合条件的通知公告列表\n     *\n     * @param bo 查询条件\n     * @return 通知公告列表\n     */\n    List<SysNoticeVo> queryList(SysNoticeBo bo);\n\n    /**\n     * 新增通知公告\n     *\n     * @param bo 通知公告\n     * @return 是否新增成功\n     */\n    Boolean insertByBo(SysNoticeBo bo);\n\n    /**\n     * 修改通知公告\n     *\n     * @param bo 通知公告\n     * @return 是否修改成功\n     */\n    Boolean updateByBo(SysNoticeBo bo);\n\n    /**\n     * 校验并批量删除通知公告信息\n     *\n     * @param ids     待删除的主键集合\n     * @param isValid 是否进行有效性校验\n     * @return 是否删除成功\n     */\n    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);\n}\n",
    "vm/java/serviceImpl.java.vm": "package org.dromara.system.service.impl;\n\nimport org.dromara.common.core.utils.MapstructUtils;\nimport org.dromara.common.core.utils.StringUtils;\nimport org.dromara.common.mybatis.core.page.TableDataInfo;\nimport org.dromara.common.mybatis.core.page.PageQuery;\nimport com.baomidou.mybatisplus.extension.plugins.pagination.Page;\nimport com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;\nimport com.baomidou.mybatisplus.core.toolkit.Wrappers;\nimport lombok.RequiredArgsConstructor;\nimport org.springframework.stereotype.Service;\nimport org.dromara.system.domain.bo.SysNoticeBo;\nimport org.dromara.system.domain.vo.SysNoticeVo;\nimport org.dromara.system.domain.SysNotice;\nimport org.dromara.system.mapper.SysNoticeMapper;\nimport org.dromara.system.service.ISysNoticeService;\n\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Collection;\n\n/**\n * 通知公告Service业务层处理\n *\n * @author Lion Li\n * @date 2024-09-13\n */\n@RequiredArgsConstructor\n@Service\npublic class SysNoticeServiceImpl implements ISysNoticeService {\n\n    private final SysNoticeMapper baseMapper;\n\n    /**\n     * 查询通知公告\n     *\n     * @param noticeId 主键\n     * @return 通知公告\n     */\n    @Override\n    public SysNoticeVo queryById(Long noticeId){\n        return baseMapper.selectVoById(noticeId);\n    }\n\n    /**\n     * 分页查询通知公告列表\n     *\n     * @param bo        查询条件\n     * @param pageQuery 分页参数\n     * @return 通知公告分页列表\n     */\n    @Override\n    public TableDataInfo<SysNoticeVo> queryPageList(SysNoticeBo bo, PageQuery pageQuery) {\n        LambdaQueryWrapper<SysNotice> lqw = buildQueryWrapper(bo);\n        Page<SysNoticeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);\n        return TableDataInfo.build(result);\n    }\n\n    /**\n     * 查询符合条件的通知公告列表\n     *\n     * @param bo 查询条件\n     * @return 通知公告列表\n     */\n    @Override\n    public List<SysNoticeVo> queryList(SysNoticeBo bo) {\n        LambdaQueryWrapper<SysNotice> lqw = buildQueryWrapper(bo);\n        return baseMapper.selectVoList(lqw);\n    }\n\n    private LambdaQueryWrapper<SysNotice> buildQueryWrapper(SysNoticeBo bo) {\n        Map<String, Object> params = bo.getParams();\n        LambdaQueryWrapper<SysNotice> lqw = Wrappers.lambdaQuery();\n        lqw.eq(StringUtils.isNotBlank(bo.getNoticeTitle()), SysNotice::getNoticeTitle, bo.getNoticeTitle());\n        lqw.eq(StringUtils.isNotBlank(bo.getNoticeType()), SysNotice::getNoticeType, bo.getNoticeType());\n        lqw.eq(StringUtils.isNotBlank(bo.getNoticeContent()), SysNotice::getNoticeContent, bo.getNoticeContent());\n        lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysNotice::getStatus, bo.getStatus());\n        return lqw;\n    }\n\n    /**\n     * 新增通知公告\n     *\n     * @param bo 通知公告\n     * @return 是否新增成功\n     */\n    @Override\n    public Boolean insertByBo(SysNoticeBo bo) {\n        SysNotice add = MapstructUtils.convert(bo, SysNotice.class);\n        validEntityBeforeSave(add);\n        boolean flag = baseMapper.insert(add) > 0;\n        if (flag) {\n            bo.setNoticeId(add.getNoticeId());\n        }\n        return flag;\n    }\n\n    /**\n     * 修改通知公告\n     *\n     * @param bo 通知公告\n     * @return 是否修改成功\n     */\n    @Override\n    public Boolean updateByBo(SysNoticeBo bo) {\n        SysNotice update = MapstructUtils.convert(bo, SysNotice.class);\n        validEntityBeforeSave(update);\n        return baseMapper.updateById(update) > 0;\n    }\n\n    /**\n     * 保存前的数据校验\n     */\n    private void validEntityBeforeSave(SysNotice entity){\n        //TODO 做一些数据校验,如唯一约束\n    }\n\n    /**\n     * 校验并批量删除通知公告信息\n     *\n     * @param ids     待删除的主键集合\n     * @param isValid 是否进行有效性校验\n     * @return 是否删除成功\n     */\n    @Override\n    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {\n        if(isValid){\n            //TODO 做一些业务上的校验,判断是否需要校验\n        }\n        return baseMapper.deleteByIds(ids) > 0;\n    }\n}\n",
    "vm/java/controller.java.vm": "package org.dromara.system.controller;\n\nimport java.util.List;\n\nimport lombok.RequiredArgsConstructor;\nimport jakarta.servlet.http.HttpServletResponse;\nimport jakarta.validation.constraints.*;\nimport cn.dev33.satoken.annotation.SaCheckPermission;\nimport org.springframework.web.bind.annotation.*;\nimport org.springframework.validation.annotation.Validated;\nimport org.dromara.common.idempotent.annotation.RepeatSubmit;\nimport org.dromara.common.log.annotation.Log;\nimport org.dromara.common.web.core.BaseController;\nimport org.dromara.common.mybatis.core.page.PageQuery;\nimport org.dromara.common.core.domain.R;\nimport org.dromara.common.core.validate.AddGroup;\nimport org.dromara.common.core.validate.EditGroup;\nimport org.dromara.common.log.enums.BusinessType;\nimport org.dromara.common.excel.utils.ExcelUtil;\nimport org.dromara.system.domain.vo.SysNoticeVo;\nimport org.dromara.system.domain.bo.SysNoticeBo;\nimport org.dromara.system.service.ISysNoticeService;\nimport org.dromara.common.mybatis.core.page.TableDataInfo;\n\n/**\n * 通知公告\n *\n * @author Lion Li\n * @date 2024-09-13\n */\n@Validated\n@RequiredArgsConstructor\n@RestController\n@RequestMapping(\"/system/notice\")\npublic class SysNoticeController extends BaseController {\n\n    private final ISysNoticeService sysNoticeService;\n\n    /**\n     * 查询通知公告列表\n     */\n    @SaCheckPermission(\"system:notice:list\")\n    @GetMapping(\"/list\")\n    public TableDataInfo<SysNoticeVo> list(SysNoticeBo bo, PageQuery pageQuery) {\n        return sysNoticeService.queryPageList(bo, pageQuery);\n    }\n\n    /**\n     * 导出通知公告列表\n     */\n    @SaCheckPermission(\"system:notice:export\")\n    @Log(title = \"通知公告\", businessType = BusinessType.EXPORT)\n    @PostMapping(\"/export\")\n    public void export(SysNoticeBo bo, HttpServletResponse response) {\n        List<SysNoticeVo> list = sysNoticeService.queryList(bo);\n        ExcelUtil.exportExcel(list, \"通知公告\", SysNoticeVo.class, response);\n    }\n\n    /**\n     * 获取通知公告详细信息\n     *\n     * @param noticeId 主键\n     */\n    @SaCheckPermission(\"system:notice:query\")\n    @GetMapping(\"/{noticeId}\")\n    public R<SysNoticeVo> getInfo(@NotNull(message = \"主键不能为空\")\n                                     @PathVariable Long noticeId) {\n        return R.ok(sysNoticeService.queryById(noticeId));\n    }\n\n    /**\n     * 新增通知公告\n     */\n    @SaCheckPermission(\"system:notice:add\")\n    @Log(title = \"通知公告\", businessType = BusinessType.INSERT)\n    @RepeatSubmit()\n    @PostMapping()\n    public R<Void> add(@Validated(AddGroup.class) @RequestBody SysNoticeBo bo) {\n        return toAjax(sysNoticeService.insertByBo(bo));\n    }\n\n    /**\n     * 修改通知公告\n     */\n    @SaCheckPermission(\"system:notice:edit\")\n    @Log(title = \"通知公告\", businessType = BusinessType.UPDATE)\n    @RepeatSubmit()\n    @PutMapping()\n    public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysNoticeBo bo) {\n        return toAjax(sysNoticeService.updateByBo(bo));\n    }\n\n    /**\n     * 删除通知公告\n     *\n     * @param noticeIds 主键串\n     */\n    @SaCheckPermission(\"system:notice:remove\")\n    @Log(title = \"通知公告\", businessType = BusinessType.DELETE)\n    @DeleteMapping(\"/{noticeIds}\")\n    public R<Void> remove(@NotEmpty(message = \"主键不能为空\")\n                          @PathVariable Long[] noticeIds) {\n        return toAjax(sysNoticeService.deleteWithValidByIds(List.of(noticeIds), true));\n    }\n}\n",
    "vm/xml/mapper.xml.vm": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE mapper\nPUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\"\n\"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n<mapper namespace=\"org.dromara.system.mapper.SysNoticeMapper\">\n\n</mapper>\n",
    "vm/sql/sql.vm": "-- 菜单 SQL\ninsert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)\nvalues(1834422614669983745, '通知公告', '3', '1', 'notice', 'system/notice/index', 1, 0, 'C', '0', '0', 'system:notice:list', '#', 103, 1, sysdate(), null, null, '通知公告菜单');\n\n-- 按钮 SQL\ninsert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)\nvalues(1834422614669983746, '通知公告查询', 1834422614669983745, '1',  '#', '', 1, 0, 'F', '0', '0', 'system:notice:query',        '#', 103, 1, sysdate(), null, null, '');\n\ninsert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)\nvalues(1834422614669983747, '通知公告新增', 1834422614669983745, '2',  '#', '', 1, 0, 'F', '0', '0', 'system:notice:add',          '#', 103, 1, sysdate(), null, null, '');\n\ninsert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)\nvalues(1834422614669983748, '通知公告修改', 1834422614669983745, '3',  '#', '', 1, 0, 'F', '0', '0', 'system:notice:edit',         '#', 103, 1, sysdate(), null, null, '');\n\ninsert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)\nvalues(1834422614669983749, '通知公告删除', 1834422614669983745, '4',  '#', '', 1, 0, 'F', '0', '0', 'system:notice:remove',       '#', 103, 1, sysdate(), null, null, '');\n\ninsert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)\nvalues(1834422614669983750, '通知公告导出', 1834422614669983745, '5',  '#', '', 1, 0, 'F', '0', '0', 'system:notice:export',       '#', 103, 1, sysdate(), null, null, '');\n",
    "vm/ts/api.ts.vm": "import request from '@/utils/request';\nimport { AxiosPromise } from 'axios';\nimport { NoticeVO, NoticeForm, NoticeQuery } from '@/api/system/notice/types';\n\n/**\n * 查询通知公告列表\n * @param query\n * @returns {*}\n */\n\nexport const listNotice = (query?: NoticeQuery): AxiosPromise<NoticeVO[]> => {\n  return request({\n    url: '/system/notice/list',\n    method: 'get',\n    params: query\n  });\n};\n\n/**\n * 查询通知公告详细\n * @param noticeId\n */\nexport const getNotice = (noticeId: string | number): AxiosPromise<NoticeVO> => {\n  return request({\n    url: '/system/notice/' + noticeId,\n    method: 'get'\n  });\n};\n\n/**\n * 新增通知公告\n * @param data\n */\nexport const addNotice = (data: NoticeForm) => {\n  return request({\n    url: '/system/notice',\n    method: 'post',\n    data: data\n  });\n};\n\n/**\n * 修改通知公告\n * @param data\n */\nexport const updateNotice = (data: NoticeForm) => {\n  return request({\n    url: '/system/notice',\n    method: 'put',\n    data: data\n  });\n};\n\n/**\n * 删除通知公告\n * @param noticeId\n */\nexport const delNotice = (noticeId: string | number | Array<string | number>) => {\n  return request({\n    url: '/system/notice/' + noticeId,\n    method: 'delete'\n  });\n};\n",
    "vm/ts/types.ts.vm": "export interface NoticeVO {\n  /**\n   * 公告ID\n   */\n  noticeId: string | number;\n\n  /**\n   * 公告标题\n   */\n  noticeTitle: string;\n\n  /**\n   * 公告类型（1通知 2公告）\n   */\n  noticeType: string;\n\n  /**\n   * 公告内容\n   */\n  noticeContent: string;\n\n  /**\n   * 公告状态（0正常 1关闭）\n   */\n  status: string;\n\n  /**\n   * 备注\n   */\n  remark: string;\n\n}\n\nexport interface NoticeForm extends BaseEntity {\n  /**\n   * 公告ID\n   */\n  noticeId?: string | number;\n\n  /**\n   * 公告标题\n   */\n  noticeTitle?: string;\n\n  /**\n   * 公告类型（1通知 2公告）\n   */\n  noticeType?: string;\n\n  /**\n   * 公告内容\n   */\n  noticeContent?: string;\n\n  /**\n   * 公告状态（0正常 1关闭）\n   */\n  status?: string;\n\n  /**\n   * 备注\n   */\n  remark?: string;\n\n}\n\nexport interface NoticeQuery extends PageQuery {\n\n  /**\n   * 公告标题\n   */\n  noticeTitle?: string;\n\n  /**\n   * 公告类型（1通知 2公告）\n   */\n  noticeType?: string;\n\n  /**\n   * 公告内容\n   */\n  noticeContent?: string;\n\n  /**\n   * 公告状态（0正常 1关闭）\n   */\n  status?: string;\n\n    /**\n     * 日期范围参数\n     */\n    params?: any;\n}\n\n\n\n",
    "vm/vue/index.vue.vm": "<template>\n  <div class=\"p-2\">\n    <transition :enter-active-class=\"proxy?.animate.searchAnimate.enter\" :leave-active-class=\"proxy?.animate.searchAnimate.leave\">\n      <div v-show=\"showSearch\" class=\"mb-[10px]\">\n        <el-card shadow=\"hover\">\n          <el-form ref=\"queryFormRef\" :model=\"queryParams\" :inline=\"true\">\n            <el-form-item label=\"公告标题\" prop=\"noticeTitle\">\n              <el-input v-model=\"queryParams.noticeTitle\" placeholder=\"请输入公告标题\" clearable @keyup.enter=\"handleQuery\" />\n            </el-form-item>\n            <el-form-item>\n              <el-button type=\"primary\" icon=\"Search\" @click=\"handleQuery\">搜索</el-button>\n              <el-button icon=\"Refresh\" @click=\"resetQuery\">重置</el-button>\n            </el-form-item>\n          </el-form>\n        </el-card>\n      </div>\n    </transition>\n\n    <el-card shadow=\"never\">\n      <template #header>\n        <el-row :gutter=\"10\" class=\"mb8\">\n          <el-col :span=\"1.5\">\n            <el-button type=\"primary\" plain icon=\"Plus\" @click=\"handleAdd\" v-hasPermi=\"['system:notice:add']\">新增</el-button>\n          </el-col>\n          <el-col :span=\"1.5\">\n            <el-button type=\"success\" plain icon=\"Edit\" :disabled=\"single\" @click=\"handleUpdate()\" v-hasPermi=\"['system:notice:edit']\">修改</el-button>\n          </el-col>\n          <el-col :span=\"1.5\">\n            <el-button type=\"danger\" plain icon=\"Delete\" :disabled=\"multiple\" @click=\"handleDelete()\" v-hasPermi=\"['system:notice:remove']\">删除</el-button>\n          </el-col>\n          <el-col :span=\"1.5\">\n            <el-button type=\"warning\" plain icon=\"Download\" @click=\"handleExport\" v-hasPermi=\"['system:notice:export']\">导出</el-button>\n          </el-col>\n          <right-toolbar v-model:showSearch=\"showSearch\" @queryTable=\"getList\"></right-toolbar>\n        </el-row>\n      </template>\n\n      <el-table v-loading=\"loading\" :data=\"noticeList\" @selection-change=\"handleSelectionChange\">\n        <el-table-column type=\"selection\" width=\"55\" align=\"center\" />\n        <el-table-column label=\"公告ID\" align=\"center\" prop=\"noticeId\" v-if=\"true\" />\n        <el-table-column label=\"公告标题\" align=\"center\" prop=\"noticeTitle\" />\n        <el-table-column label=\"公告类型\" align=\"center\" prop=\"noticeType\" />\n        <el-table-column label=\"公告内容\" align=\"center\" prop=\"noticeContent\" />\n        <el-table-column label=\"公告状态\" align=\"center\" prop=\"status\" />\n        <el-table-column label=\"备注\" align=\"center\" prop=\"remark\" />\n        <el-table-column label=\"操作\" align=\"center\" class-name=\"small-padding fixed-width\">\n          <template #default=\"scope\">\n            <el-tooltip content=\"修改\" placement=\"top\">\n              <el-button link type=\"primary\" icon=\"Edit\" @click=\"handleUpdate(scope.row)\" v-hasPermi=\"['system:notice:edit']\"></el-button>\n            </el-tooltip>\n            <el-tooltip content=\"删除\" placement=\"top\">\n              <el-button link type=\"primary\" icon=\"Delete\" @click=\"handleDelete(scope.row)\" v-hasPermi=\"['system:notice:remove']\"></el-button>\n            </el-tooltip>\n          </template>\n        </el-table-column>\n      </el-table>\n\n      <pagination v-show=\"total > 0\" :total=\"total\" v-model:page=\"queryParams.pageNum\" v-model:limit=\"queryParams.pageSize\" @pagination=\"getList\" />\n    </el-card>\n    <!-- 添加或修改通知公告对话框 -->\n    <el-dialog :title=\"dialog.title\" v-model=\"dialog.visible\" width=\"500px\" append-to-body>\n      <el-form ref=\"noticeFormRef\" :model=\"form\" :rules=\"rules\" label-width=\"80px\">\n        <el-form-item label=\"公告标题\" prop=\"noticeTitle\">\n          <el-input v-model=\"form.noticeTitle\" placeholder=\"请输入公告标题\" />\n        </el-form-item>\n        <el-form-item label=\"公告内容\">\n          <editor v-model=\"form.noticeContent\" :min-height=\"192\"/>\n        </el-form-item>\n        <el-form-item label=\"备注\" prop=\"remark\">\n          <el-input v-model=\"form.remark\" placeholder=\"请输入备注\" />\n        </el-form-item>\n      </el-form>\n      <template #footer>\n        <div class=\"dialog-footer\">\n          <el-button :loading=\"buttonLoading\" type=\"primary\" @click=\"submitForm\">确 定</el-button>\n          <el-button @click=\"cancel\">取 消</el-button>\n        </div>\n      </template>\n    </el-dialog>\n  </div>\n</template>\n\n<script setup name=\"Notice\" lang=\"ts\">\nimport { listNotice, getNotice, delNotice, addNotice, updateNotice } from '@/api/system/notice';\nimport { NoticeVO, NoticeQuery, NoticeForm } from '@/api/system/notice/types';\n\nconst { proxy } = getCurrentInstance() as ComponentInternalInstance;\n\nconst noticeList = ref<NoticeVO[]>([]);\nconst buttonLoading = ref(false);\nconst loading = ref(true);\nconst showSearch = ref(true);\nconst ids = ref<Array<string | number>>([]);\nconst single = ref(true);\nconst multiple = ref(true);\nconst total = ref(0);\n\nconst queryFormRef = ref<ElFormInstance>();\nconst noticeFormRef = ref<ElFormInstance>();\n\nconst dialog = reactive<DialogOption>({\n  visible: false,\n  title: ''\n});\n\nconst initFormData: NoticeForm = {\n  noticeId: undefined,\n  noticeTitle: undefined,\n  noticeType: undefined,\n  noticeContent: undefined,\n  status: undefined,\n  remark: undefined\n}\nconst data = reactive<PageData<NoticeForm, NoticeQuery>>({\n  form: {...initFormData},\n  queryParams: {\n    pageNum: 1,\n    pageSize: 10,\n    noticeTitle: undefined,\n    noticeType: undefined,\n    noticeContent: undefined,\n    status: undefined,\n    params: {\n    }\n  },\n  rules: {\n    noticeId: [\n      { required: true, message: \"公告ID不能为空\", trigger: \"blur\" }\n    ],\n    noticeTitle: [\n      { required: true, message: \"公告标题不能为空\", trigger: \"blur\" }\n    ],\n    noticeType: [\n      { required: true, message: \"公告类型不能为空\", trigger: \"change\" }\n    ],\n    noticeContent: [\n      { required: true, message: \"公告内容不能为空\", trigger: \"blur\" }\n    ],\n    status: [\n      { required: true, message: \"公告状态不能为空\", trigger: \"change\" }\n    ],\n    remark: [\n      { required: true, message: \"备注不能为空\", trigger: \"blur\" }\n    ]\n  }\n});\n\nconst { queryParams, form, rules } = toRefs(data);\n\n/** 查询通知公告列表 */\nconst getList = async () => {\n  loading.value = true;\n  const res = await listNotice(queryParams.value);\n  noticeList.value = res.rows;\n  total.value = res.total;\n  loading.value = false;\n}\n\n/** 取消按钮 */\nconst cancel = () => {\n  reset();\n  dialog.visible = false;\n}\n\n/** 表单重置 */\nconst reset = () => {\n  form.value = {...initFormData};\n  noticeFormRef.value?.resetFields();\n}\n\n/** 搜索按钮操作 */\nconst handleQuery = () => {\n  queryParams.value.pageNum = 1;\n  getList();\n}\n\n/** 重置按钮操作 */\nconst resetQuery = () => {\n  queryFormRef.value?.resetFields();\n  handleQuery();\n}\n\n/** 多选框选中数据 */\nconst handleSelectionChange = (selection: NoticeVO[]) => {\n  ids.value = selection.map(item => item.noticeId);\n  single.value = selection.length != 1;\n  multiple.value = !selection.length;\n}\n\n/** 新增按钮操作 */\nconst handleAdd = () => {\n  reset();\n  dialog.visible = true;\n  dialog.title = \"添加通知公告\";\n}\n\n/** 修改按钮操作 */\nconst handleUpdate = async (row?: NoticeVO) => {\n  reset();\n  const _noticeId = row?.noticeId || ids.value[0]\n  const res = await getNotice(_noticeId);\n  Object.assign(form.value, res.data);\n  dialog.visible = true;\n  dialog.title = \"修改通知公告\";\n}\n\n/** 提交按钮 */\nconst submitForm = () => {\n  noticeFormRef.value?.validate(async (valid: boolean) => {\n    if (valid) {\n      buttonLoading.value = true;\n      if (form.value.noticeId) {\n        await updateNotice(form.value).finally(() =>  buttonLoading.value = false);\n      } else {\n        await addNotice(form.value).finally(() =>  buttonLoading.value = false);\n      }\n      proxy?.$modal.msgSuccess(\"操作成功\");\n      dialog.visible = false;\n      await getList();\n    }\n  });\n}\n\n/** 删除按钮操作 */\nconst handleDelete = async (row?: NoticeVO) => {\n  const _noticeIds = row?.noticeId || ids.value;\n  await proxy?.$modal.confirm('是否确认删除通知公告编号为\"' + _noticeIds + '\"的数据项？').finally(() => loading.value = false);\n  await delNotice(_noticeIds);\n  proxy?.$modal.msgSuccess(\"删除成功\");\n  await getList();\n}\n\n/** 导出按钮操作 */\nconst handleExport = () => {\n  proxy?.download('system/notice/export', {\n    ...queryParams.value\n  }, `notice_${new Date().getTime()}.xlsx`)\n}\n\nonMounted(() => {\n  getList();\n});\n</script>\n",
    "vm/vben/api/index.ts.vm": "import { defHttp } from '@/utils/http/axios';\nimport { ID, IDS, commonExport } from '@/api/base';\nimport { NoticeVO, NoticeForm, NoticeQuery } from './model';\n\n/**\n * 查询通知公告列表\n * @param params\n * @returns\n */\nexport function noticeList(params?: NoticeQuery) {\n  return defHttp.get<NoticeVO[]>({ url: '/system/notice/list', params });\n}\n\n/**\n * 导出通知公告列表\n * @param params\n * @returns\n */\nexport function noticeExport(params?: NoticeQuery) {\n  return commonExport('/system/notice/export', params ?? {});\n}\n\n/**\n * 查询通知公告详细\n * @param noticeId id\n * @returns\n */\nexport function noticeInfo(noticeId: ID) {\n  return defHttp.get<NoticeVO>({ url: '/system/notice/' + noticeId });\n}\n\n/**\n * 新增通知公告\n * @param data\n * @returns\n */\nexport function noticeAdd(data: NoticeForm) {\n  return defHttp.postWithMsg<void>({ url: '/system/notice', data });\n}\n\n/**\n * 更新通知公告\n * @param data\n * @returns\n */\nexport function noticeUpdate(data: NoticeForm) {\n  return defHttp.putWithMsg<void>({ url: '/system/notice', data });\n}\n\n/**\n * 删除通知公告\n * @param noticeId id\n * @returns\n */\nexport function noticeRemove(noticeId: ID | IDS) {\n  return defHttp.deleteWithMsg<void>({ url: '/system/notice/' + noticeId });\n}\n",
    "vm/vben/api/model.ts.vm": "import { BaseEntity, PageQuery } from '@/api/base';\n\nexport interface NoticeVO {\n  /**\n   * 公告ID\n   */\n  noticeId: string | number;\n\n  /**\n   * 公告标题\n   */\n  noticeTitle: string;\n\n  /**\n   * 公告类型（1通知 2公告）\n   */\n  noticeType: string;\n\n  /**\n   * 公告内容\n   */\n  noticeContent: string;\n\n  /**\n   * 公告状态（0正常 1关闭）\n   */\n  status: string;\n\n  /**\n   * 备注\n   */\n  remark: string;\n\n}\n\nexport interface NoticeForm extends BaseEntity {\n  /**\n   * 公告ID\n   */\n  noticeId?: string | number;\n\n  /**\n   * 公告标题\n   */\n  noticeTitle?: string;\n\n  /**\n   * 公告类型（1通知 2公告）\n   */\n  noticeType?: string;\n\n  /**\n   * 公告内容\n   */\n  noticeContent?: string;\n\n  /**\n   * 公告状态（0正常 1关闭）\n   */\n  status?: string;\n\n  /**\n   * 备注\n   */\n  remark?: string;\n\n}\n\nexport interface NoticeQuery extends PageQuery {\n  /**\n   * 公告标题\n   */\n  noticeTitle?: string;\n\n  /**\n   * 公告类型（1通知 2公告）\n   */\n  noticeType?: string;\n\n  /**\n   * 公告内容\n   */\n  noticeContent?: string;\n\n  /**\n   * 公告状态（0正常 1关闭）\n   */\n  status?: string;\n\n  /**\n    * 日期范围参数\n    */\n  params?: any;\n}\n",
    "vm/vben/views/data.ts.vm": "import { BasicColumn } from '@/components/Table';\nimport { FormSchema } from '@/components/Form';\n\nexport const formSchemas: FormSchema[] = [\n  {\n    label: '公告标题',\n    field: 'noticeTitle',\n    component: 'Input',\n  },\n  {\n    label: '公告类型',\n    field: 'noticeType',\n    component: 'Select',\n  },\n  {\n    label: '公告内容',\n    field: 'noticeContent',\n    component: 'Input',\n  },\n  {\n    label: '公告状态',\n    field: 'status',\n    component: 'RadioButtonGroup',\n  },\n];\n\nexport const columns: BasicColumn[] = [\n  {\n    title: '公告ID',\n    dataIndex: 'noticeId',\n  },\n  {\n    title: '公告标题',\n    dataIndex: 'noticeTitle',\n  },\n  {\n    title: '公告类型',\n    dataIndex: 'noticeType',\n  },\n  {\n    title: '公告内容',\n    dataIndex: 'noticeContent',\n  },\n  {\n    title: '公告状态',\n    dataIndex: 'status',\n  },\n  {\n    title: '备注',\n    dataIndex: 'remark',\n  },\n];\n\nexport const modalSchemas: FormSchema[] = [\n  {\n    label: '公告ID',\n    field: 'noticeId',\n    required: false,\n    component: 'Input',\n      show: false,\n  },\n  {\n    label: '公告标题',\n    field: 'noticeTitle',\n    required: true,\n    component: 'Input',\n  },\n  {\n    label: '公告类型',\n    field: 'noticeType',\n    required: true,\n    component: 'Select',\n  },\n  {\n    label: '公告内容',\n    field: 'noticeContent',\n    required: true,\n    component: 'RichTextarea',\n      /**\n      * 注意 好像没啥可写的\n      */\n      componentProps: {\n        // 没啥可写的\n      }, \n  },\n  {\n    label: '公告状态',\n    field: 'status',\n    required: true,\n    component: 'RadioButtonGroup',\n  },\n  {\n    label: '备注',\n    field: 'remark',\n    required: true,\n    component: 'Input',\n  },\n];\n",
    "vm/vben/views/index_vben.vue.vm": "<template>\n  <PageWrapper dense>\n    <BasicTable @register=\"registerTable\">\n      <template #toolbar>\n        <a-button\n          @click=\"downloadExcel(noticeExport, '通知公告数据', getForm().getFieldsValue())\"\n          v-auth=\"'system:notice:export'\"\n          >导出</a-button\n        >\n        <a-button\n          type=\"primary\"\n          danger\n          @click=\"multipleRemove(noticeRemove)\"\n          :disabled=\"!selected\"\n          v-auth=\"'system:notice:remove'\"\n          >删除</a-button\n        >\n        <a-button\n          type=\"primary\"\n          @click=\"handleAdd\"\n          v-auth=\"'system:notice:add'\"\n          >新增</a-button\n        >\n      </template>\n      <template #bodyCell=\"{ column, record }\">\n        <template v-if=\"column.key === 'action'\">\n          <TableAction\n            stopButtonPropagation\n            :actions=\"[\n              {\n                label: '修改',\n                icon: IconEnum.EDIT,\n                type: 'primary',\n                ghost: true,\n                auth: 'system:notice:edit',\n                onClick: handleEdit.bind(null, record),\n              },\n              {\n                label: '删除',\n                icon: IconEnum.DELETE,\n                type: 'primary',\n                danger: true,\n                ghost: true,\n                auth: 'system:notice:remove',\n                popConfirm: {\n                  placement: 'left',\n                  title: '是否删除通知公告[' + record.noticeId + ']?',\n                  confirm: handleDelete.bind(null, record),\n                },\n              },\n            ]\"\n          />\n        </template>\n      </template>\n    </BasicTable>\n    <NoticeModal @register=\"registerModal\" @reload=\"reload\" />\n  </PageWrapper>\n</template>\n\n<script setup lang=\"ts\">\n  import { PageWrapper } from '@/components/Page';\n  import { BasicTable, useTable, TableAction } from '@/components/Table';\n  import { noticeList, noticeExport, noticeRemove } from '@/api/system/notice';\n  import { downloadExcel } from '@/utils/file/download';\n  import { useModal } from '@/components/Modal';\n  import NoticeModal from './NoticeModal.vue';\n  import { formSchemas, columns } from './notice.data';\n  import { IconEnum } from '@/enums/appEnum';\n\n  defineOptions({ name: 'Notice' });\n\n  const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({\n    rowSelection: {\n      type: 'checkbox',\n    },\n    title: '通知公告列表',\n    api: noticeList,\n    showIndexColumn: false,\n    rowKey: 'noticeId',\n    useSearchForm: true,\n    formConfig: {\n      schemas: formSchemas,\n      baseColProps: {\n        xs: 24,\n        sm: 24,\n        md: 24,\n        lg: 6,\n      },\n    },\n    columns: columns,\n    actionColumn: {\n      width: 200,\n      title: '操作',\n      key: 'action',\n      fixed: 'right',\n    },\n  });\n\n  const [registerModal, { openModal }] = useModal();\n\n  function handleEdit(record: Recordable) {\n    openModal(true, { record, update: true });\n  }\n\n  function handleAdd() {\n    openModal(true, { update: false });\n  }\n\n  async function handleDelete(record: Recordable) {\n    await noticeRemove([record.noticeId]);\n    await reload();\n  }\n</script>\n\n<style scoped></style>\n",
    "vm/vben/views/modal.vue.vm": "<template>\n  <BasicModal\n    v-bind=\"$attrs\"\n    :title=\"title\"\n    @register=\"registerInnerModal\"\n    @ok=\"handleSubmit\"\n    @cancel=\"resetForm\"\n  >\n    <BasicForm @register=\"registerForm\" />\n  </BasicModal>\n</template>\n\n<script setup lang=\"ts\">\n  import { BasicModal, useModalInner } from '@/components/Modal';\n  import { BasicForm, useForm } from '@/components/Form';\n  import { computed, ref, unref } from 'vue';\n  import { noticeInfo, noticeAdd, noticeUpdate } from '@/api/system/notice';\n  import { modalSchemas } from './notice.data';\n\n  defineOptions({ name: 'NoticeModal' });\n\n  const emit = defineEmits(['register', 'reload']);\n\n  const isUpdate = ref<boolean>(false);\n  const title = computed<string>(() => {\n    return isUpdate.value ? '编辑通知公告' : '新增通知公告';\n  });\n\n  const [registerInnerModal, { modalLoading, closeModal }] = useModalInner(\n    async (data: { record?: Recordable; update: boolean }) => {\n      modalLoading(true);\n      const { record, update } = data;\n      isUpdate.value = update;\n      if (update && record) {\n        const ret = await noticeInfo(record.noticeId);\n        await setFieldsValue(ret);\n      }\n      modalLoading(false);\n    },\n  );\n\n  const [registerForm, { setFieldsValue, resetForm, validate }] = useForm({\n    labelWidth: 100,\n    showActionButtonGroup: false,\n    baseColProps: { span: 24 },\n    schemas: modalSchemas,\n  });\n\n  async function handleSubmit() {\n    try {\n      modalLoading(true);\n      const data = await validate();\n      if (unref(isUpdate)) {\n        await noticeUpdate(data);\n      } else {\n        await noticeAdd(data);\n      }\n      emit('reload');\n      closeModal();\n      await resetForm();\n    } catch (e) {\n      console.warn(e);\n    } finally {\n      modalLoading(false);\n    }\n  }\n</script>\n\n<style scoped></style>\n"
  }
}
