From 3e9b34e0fdb8a4ad5485be0ad7cd0286c6c60373 Mon Sep 17 00:00:00 2001 From: wuweihua Date: Fri, 28 Aug 2026 11:35:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=81=E8=A3=85=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E8=A1=A8=E5=8D=95/=E8=A1=A8=E6=A0=BC=E7=BB=84=E4=BB=B6=20Basic?= =?UTF-8?q?Form/BasicTable=EF=BC=8C=E5=B9=B6=E6=9B=BF=E6=8D=A2=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1=E9=A1=B5=E9=9D=A2=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 BasicForm 配置驱动表单组件,支持多种控件、字典自动加载、校验、插槽扩展 - 新增 BasicTable 公共表格组件,集成搜索栏+工具栏+表格+分页,基于 columns/searchColumns 配置驱动 - 替换 18 个业务页面 el-table 为 BasicTable(post/user/role/dict/config/notice/job/log/logininfor/operlog/online/gen 等) - 全局注册 BasicForm、BasicTable 组件 - 项目标题由若依管理系统改为 BMS --- .env.development | 4 +- .env.production | 4 +- .env.staging | 4 +- package.json | 2 +- src/components/BasicForm/FormControl.vue | 182 ++++ src/components/BasicForm/index.vue | 234 +++++ src/components/BasicTable/index.vue | 440 +++++++++ src/main.js | 6 + src/views/index.vue | 2 +- src/views/monitor/job/index.vue | 796 ++++++++-------- src/views/monitor/job/log.vue | 409 ++++----- src/views/monitor/logininfor/index.vue | 377 +++----- src/views/monitor/online/index.vue | 173 ++-- src/views/monitor/operlog/index.vue | 403 +++----- src/views/system/config/index.vue | 546 +++++------ src/views/system/dict/data.vue | 638 ++++++------- src/views/system/dict/index.vue | 601 ++++++------ src/views/system/notice/ReadUsers.vue | 147 ++- src/views/system/notice/index.vue | 531 +++++------ src/views/system/post/index.vue | 497 +++++----- src/views/system/role/authUser.vue | 304 +++--- src/views/system/role/index.vue | 1069 ++++++++++------------ src/views/system/role/selectUser.vue | 243 ++--- src/views/system/user/authRole.vue | 274 +++--- src/views/system/user/index.vue | 847 ++++++++--------- src/views/tool/gen/importTable.vue | 218 ++--- src/views/tool/gen/index.vue | 558 +++++------ 27 files changed, 4593 insertions(+), 4916 deletions(-) create mode 100644 src/components/BasicForm/FormControl.vue create mode 100644 src/components/BasicForm/index.vue create mode 100644 src/components/BasicTable/index.vue diff --git a/.env.development b/.env.development index 2744ed2..0002d63 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ # 页面标题 -VITE_APP_TITLE = 若依管理系统 +VITE_APP_TITLE = BMS # 开发环境配置 VITE_APP_ENV = 'development' -# 若依管理系统/开发环境 +# BMS/开发环境 VITE_APP_BASE_API = '/dev-api' diff --git a/.env.production b/.env.production index d857bba..5ee625b 100644 --- a/.env.production +++ b/.env.production @@ -1,10 +1,10 @@ # 页面标题 -VITE_APP_TITLE = 若依管理系统 +VITE_APP_TITLE = BMS # 生产环境配置 VITE_APP_ENV = 'production' -# 若依管理系统/生产环境 +# BMS/生产环境 VITE_APP_BASE_API = '/prod-api' # 是否在打包时开启压缩,支持 gzip 和 brotli diff --git a/.env.staging b/.env.staging index fa7c357..b80d954 100644 --- a/.env.staging +++ b/.env.staging @@ -1,10 +1,10 @@ # 页面标题 -VITE_APP_TITLE = 若依管理系统 +VITE_APP_TITLE = BMS # 生产环境配置 VITE_APP_ENV = 'staging' -# 若依管理系统/生产环境 +# BMS/生产环境 VITE_APP_BASE_API = '/stage-api' # 是否在打包时开启压缩,支持 gzip 和 brotli diff --git a/package.json b/package.json index e5e4ec3..e9f6be3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ruoyi", "version": "3.9.2", - "description": "若依管理系统", + "description": "BMS", "author": "若依", "license": "MIT", "type": "module", diff --git a/src/components/BasicForm/FormControl.vue b/src/components/BasicForm/FormControl.vue new file mode 100644 index 0000000..ba4a5c5 --- /dev/null +++ b/src/components/BasicForm/FormControl.vue @@ -0,0 +1,182 @@ + + + diff --git a/src/components/BasicForm/index.vue b/src/components/BasicForm/index.vue new file mode 100644 index 0000000..bd9ed28 --- /dev/null +++ b/src/components/BasicForm/index.vue @@ -0,0 +1,234 @@ + + + + + diff --git a/src/components/BasicTable/index.vue b/src/components/BasicTable/index.vue new file mode 100644 index 0000000..c96c02c --- /dev/null +++ b/src/components/BasicTable/index.vue @@ -0,0 +1,440 @@ + + + + + diff --git a/src/main.js b/src/main.js index 96cd5eb..31078f0 100644 --- a/src/main.js +++ b/src/main.js @@ -43,6 +43,10 @@ import ImageUpload from "@/components/ImageUpload" import ImagePreview from "@/components/ImagePreview" // 字典标签组件 import DictTag from '@/components/DictTag' +// 公共表单组件 +import BasicForm from '@/components/BasicForm' +// 公共表格组件 +import BasicTable from '@/components/BasicTable' const app = createApp(App) @@ -65,6 +69,8 @@ app.component('ImageUpload', ImageUpload) app.component('ImagePreview', ImagePreview) app.component('RightToolbar', RightToolbar) app.component('Editor', Editor) +app.component('BasicForm', BasicForm) +app.component('BasicTable', BasicTable) app.use(router) app.use(store) diff --git a/src/views/index.vue b/src/views/index.vue index 2b2bd7d..348a9f2 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -4,7 +4,7 @@

若依后台管理框架

- 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 + 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了BMS,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。

当前版本: v{{ version }} diff --git a/src/views/monitor/job/index.vue b/src/views/monitor/job/index.vue index 17f5dc7..229236b 100644 --- a/src/views/monitor/job/index.vue +++ b/src/views/monitor/job/index.vue @@ -1,435 +1,361 @@ - - - + + + diff --git a/src/views/monitor/job/log.vue b/src/views/monitor/job/log.vue index 5b2c108..a47b3df 100644 --- a/src/views/monitor/job/log.vue +++ b/src/views/monitor/job/log.vue @@ -1,251 +1,158 @@ - - - + + + diff --git a/src/views/monitor/logininfor/index.vue b/src/views/monitor/logininfor/index.vue index 807fd05..90585fe 100644 --- a/src/views/monitor/logininfor/index.vue +++ b/src/views/monitor/logininfor/index.vue @@ -1,233 +1,144 @@ - - - + + + diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue index fcfee24..2712b01 100644 --- a/src/views/monitor/online/index.vue +++ b/src/views/monitor/online/index.vue @@ -1,109 +1,64 @@ - - - + + + diff --git a/src/views/monitor/operlog/index.vue b/src/views/monitor/operlog/index.vue index eb4a8cc..2bdb41f 100644 --- a/src/views/monitor/operlog/index.vue +++ b/src/views/monitor/operlog/index.vue @@ -1,262 +1,141 @@ - - - + + + diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 01db3ca..2489160 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -1,316 +1,230 @@ - - - + + + diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue index 410be6f..0ec660b 100644 --- a/src/views/system/dict/data.vue +++ b/src/views/system/dict/data.vue @@ -1,362 +1,276 @@ - - - + + + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 721c956..db4232a 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -1,346 +1,255 @@ - - - + + + diff --git a/src/views/system/notice/ReadUsers.vue b/src/views/system/notice/ReadUsers.vue index 7590bef..2d5dd3b 100644 --- a/src/views/system/notice/ReadUsers.vue +++ b/src/views/system/notice/ReadUsers.vue @@ -1,47 +1,24 @@ @@ -51,52 +28,64 @@ import { listNoticeReadUsers } from "@/api/system/notice" const { proxy } = getCurrentInstance() +const tableRef = ref() const visible = ref(false) -const loading = ref(false) const noticeTitle = ref("") -const total = ref(0) -const userList = ref([]) +const readTotal = ref(0) -const queryParams = reactive({ - pageNum: 1, - pageSize: 10, - noticeId: undefined, - searchValue: undefined -}) +// 固定参数:公告 ID(每次请求合并,不参与搜索重置) +const extraParams = reactive({ noticeId: undefined }) -function open(row) { - queryParams.noticeId = row.noticeId - noticeTitle.value = row.noticeTitle - queryParams.searchValue = undefined - queryParams.pageNum = 1 - visible.value = true - getList() -} +// 搜索项配置 +const searchColumns = [ + { + label: "", + prop: "searchValue", + component: "input", + placeholder: "登录名称 / 用户名称", + width: "220px", + formItemProps: { labelWidth: "0px" }, + props: { + prefixIcon: Search, + clearable: true, + onKeyup: (e) => { if (e.key === "Enter") tableRef.value?.handleQuery() }, + onClear: () => tableRef.value?.handleQuery() + } + } +] -function getList() { - loading.value = true - listNoticeReadUsers(queryParams).then(res => { - userList.value = res.rows - total.value = res.total - }).finally(() => { - loading.value = false +// 表格列配置 +const columns = [ + { label: "登录名称", prop: "userName", align: "center" }, + { label: "用户名称", prop: "nickName", align: "center" }, + { label: "所属部门", prop: "deptName", align: "center" }, + { label: "手机号码", prop: "phonenumber", align: "center", width: 120 }, + { label: "阅读时间", prop: "readTime", align: "center", width: 160, parseTime: true } +] + +// 查询函数(BasicTable 调用,返回 { rows, total });同时记录已读总数用于统计 +function queryList(params) { + return listNoticeReadUsers(params).then(res => { + readTotal.value = res.total + return res }) } -function handleQuery() { - queryParams.pageNum = 1 - getList() -} - -function resetQuery() { - proxy.resetForm("queryRef") - handleQuery() +/** 打开弹框 */ +function open(row) { + extraParams.noticeId = row.noticeId + noticeTitle.value = row.noticeTitle + visible.value = true + nextTick(() => { + tableRef.value?.setQueryParams({ searchValue: undefined }) + tableRef.value?.reload() + }) } +/** 关闭弹框 */ function handleClose() { - userList.value = [] - total.value = 0 - queryParams.searchValue = undefined + tableRef.value?.clearSelection() + tableRef.value?.setQueryParams({ searchValue: undefined }) } defineExpose({ @@ -115,4 +104,8 @@ defineExpose({ font-size: 15px; margin: 0 2px; } +/* 将搜索栏操作区(搜索/重置 + 已读统计)浮动到右侧 */ +:deep(.basic-form > .el-form-item:last-of-type) { + float: right; +} diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index f0c3316..c4a4ec7 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -1,306 +1,225 @@ - - - + + + diff --git a/src/views/system/post/index.vue b/src/views/system/post/index.vue index 67bbdc0..e127d81 100644 --- a/src/views/system/post/index.vue +++ b/src/views/system/post/index.vue @@ -1,287 +1,210 @@ - - - + + + diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue index c9f7d30..0ffa078 100644 --- a/src/views/system/role/authUser.vue +++ b/src/views/system/role/authUser.vue @@ -1,179 +1,125 @@ - - - - + + + diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index b6beae6..f7f3317 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -1,584 +1,485 @@ - - - + + + diff --git a/src/views/system/role/selectUser.vue b/src/views/system/role/selectUser.vue index 3f48530..3b641b1 100644 --- a/src/views/system/role/selectUser.vue +++ b/src/views/system/role/selectUser.vue @@ -1,144 +1,99 @@ - - - + + + diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue index 8293fb3..d73a064 100644 --- a/src/views/system/user/authRole.vue +++ b/src/views/system/user/authRole.vue @@ -1,123 +1,151 @@ - - - + + + diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 5b80c74..1c491ad 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -1,459 +1,388 @@ - - - + + + diff --git a/src/views/tool/gen/importTable.vue b/src/views/tool/gen/importTable.vue index 34e0916..7100458 100644 --- a/src/views/tool/gen/importTable.vue +++ b/src/views/tool/gen/importTable.vue @@ -1,126 +1,92 @@ - - - + + + diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue index 5a16582..3ab6e7c 100644 --- a/src/views/tool/gen/index.vue +++ b/src/views/tool/gen/index.vue @@ -1,309 +1,249 @@ - - - + + +