From e0868a10aff1552b87e30663342910a28ed8f877 Mon Sep 17 00:00:00 2001 From: zhangpeng <690927457@qq.com> Date: Mon, 28 Apr 2025 17:57:16 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E6=96=B0=E5=A2=9E=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加用户列表页面,包含搜索、分页等功能 - 实现用户状态切换和详情查看功能 - 新增用户选择组件,用于选择用户 - 优化表格组件,支持自定义列和操作 - 添加面包屑组件,用于展示导航路径 --- src/api/goods/index.js | 42 ++++ src/api/user/index.js | 14 ++ src/assets/icons/bookmark-fill.svg | 6 + src/components/MyTitle/MyTitle.vue | 77 ++++++++ src/components/PmDialog/pm-dialog.vue | 112 +++++++++++ src/components/columnItem/ColumnItem.vue | 39 ++++ src/components/content/index.vue | 22 +-- src/components/richtext/rich-edit.vue | 2 +- src/components/userChoose/index.vue | 236 +++++++++++++++++++++++ src/config.js | 149 +++++++++++++- src/pathInfo.json | 13 +- src/style/main.scss | 15 ++ src/view/goods/article/edit.vue | 165 ++++++++++++++++ src/view/goods/article/index.vue | 129 ++++++++++++- src/view/order/order/index.vue | 30 +-- src/view/user/index.vue | 21 ++ src/view/user/user/index.vue | 106 ++++++++++ 17 files changed, 1132 insertions(+), 46 deletions(-) create mode 100644 src/api/goods/index.js create mode 100644 src/api/user/index.js create mode 100644 src/assets/icons/bookmark-fill.svg create mode 100644 src/components/MyTitle/MyTitle.vue create mode 100644 src/components/PmDialog/pm-dialog.vue create mode 100644 src/components/columnItem/ColumnItem.vue create mode 100644 src/components/userChoose/index.vue create mode 100644 src/view/goods/article/edit.vue create mode 100644 src/view/user/index.vue create mode 100644 src/view/user/user/index.vue diff --git a/src/api/goods/index.js b/src/api/goods/index.js new file mode 100644 index 0000000..e7e23fc --- /dev/null +++ b/src/api/goods/index.js @@ -0,0 +1,42 @@ +import service from '@/utils/request' + +// @tag goods +// @summary 获取商品(文章)列表 +// @param {object} params +// @return {object} data +// @router get /user/list +export const list = (params) => { + return service({ + url: '/article/list', + method: 'get', + params + }) +} + +export const add = (data) => { + return service({ + url: '/article/list', + method: 'post', + data + }) +} +export const edit = (data) => { + return service({ + url: '/article/list', + method: 'put', + data + }) +} +export const del = (data) => { + return service({ + url: '/article/list', + method: 'delete', + data + }) +} +export const detail = (id) => { + return service({ + url: '/article/'+ id, + method: 'get', + }) +} diff --git a/src/api/user/index.js b/src/api/user/index.js new file mode 100644 index 0000000..204642c --- /dev/null +++ b/src/api/user/index.js @@ -0,0 +1,14 @@ +import service from '@/utils/request' + +// @tag user +// @summary 获取用户列表 +// @param {object} params +// @return {object} data +// @router get /user/list +export const list = (params) => { + return service({ + url: '/user/list', + method: 'get', + params + }) +} diff --git a/src/assets/icons/bookmark-fill.svg b/src/assets/icons/bookmark-fill.svg new file mode 100644 index 0000000..5f44d02 --- /dev/null +++ b/src/assets/icons/bookmark-fill.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/components/MyTitle/MyTitle.vue b/src/components/MyTitle/MyTitle.vue new file mode 100644 index 0000000..6323d67 --- /dev/null +++ b/src/components/MyTitle/MyTitle.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/src/components/PmDialog/pm-dialog.vue b/src/components/PmDialog/pm-dialog.vue new file mode 100644 index 0000000..7862521 --- /dev/null +++ b/src/components/PmDialog/pm-dialog.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/src/components/columnItem/ColumnItem.vue b/src/components/columnItem/ColumnItem.vue new file mode 100644 index 0000000..3907761 --- /dev/null +++ b/src/components/columnItem/ColumnItem.vue @@ -0,0 +1,39 @@ + + + + + diff --git a/src/components/content/index.vue b/src/components/content/index.vue index d7be8ff..58979d2 100644 --- a/src/components/content/index.vue +++ b/src/components/content/index.vue @@ -28,7 +28,7 @@ v-if="config.index" type="index" align="center" - width="50px" + width="80px" label="序号" /> + + diff --git a/src/config.js b/src/config.js index c1d01e4..e0d51e3 100644 --- a/src/config.js +++ b/src/config.js @@ -1,3 +1,5 @@ +import {getDict} from '@/utils/dictionary' +export let userStatus = await getDict('user-status') export const ORDER_SEARCH_CONFIG = [ { type: 'input', @@ -16,7 +18,53 @@ export const ORDER_SEARCH_CONFIG = [ rangeSeparator: '-' }, ] -// 经费申请列表 +export const USER_SEARCH_CONFIG = [ + { + type: 'input', + prop:'name', + label: '用户名称', + placeholder: '请输入', + }, + { + type: 'select', + prop:'status', + label: '状态', + placeholder: '请选择', + children:{ + list: [ + { + label: '全部', + value: '' + }, + ...userStatus + ] + }, + } +] +export const ARTICLE_SEARCH_CONFIG = [ + { + type: 'input', + prop:'name', + label: '名称', + placeholder: '请输入', + }, + { + type: 'select', + prop:'status', + label: '状态', + placeholder: '请选择', + children:{ + list: [ + { + label: '全部', + value: '' + }, + ...userStatus + ] + }, + } +] +// 订单列表 export const ORDER_TABLE_CONFIG = { index: true, schemes: [ @@ -48,6 +96,56 @@ export const ORDER_TABLE_CONFIG = { prop: 'order_type' } }, + { + attrs: { + label: '状态', + prop: 'status', + align: 'center' + }, + slot: 'status' + },{ + attrs: { + label: '创建时间', + prop: 'CreatedAt', + align: 'center' + }, + slot: 'CreatedAt' + },{ + attrs: { + label: '更新时间', + prop: 'UpdatedAt', + align: 'center' + }, + slot: 'UpdatedAt' + }, + { + attrs: { + label: '操作', + prop: 'operate', + align: 'center' + }, + slot: 'operate' + } + ] +} +// 用户列表 +export const USER_TABLE_CONFIG = { + index: true, + schemes: [ + { + attrs: { + label: 'ID', + prop: 'order_no', + align: 'center' + } + }, + { + attrs: { + label: '名称', + prop: 'name', + align: 'center' + } + }, { attrs: { label: '状态', @@ -78,3 +176,52 @@ export const ORDER_TABLE_CONFIG = { } ] } +// 文章列表 +export const ARTICLE_TABLE_CONFIG = { + index: true, + schemes: [ + { + attrs: { + label: '封面', + prop: 'coverImg', + align: 'center' + }, + slot: 'coverImg' + }, + { + attrs: { + label: '名称', + prop: 'title', + align: 'center' + } + },{ + attrs: { + label: '价格', + prop: 'price', + align: 'center' + } + },{ + attrs: { + label: '创建时间', + prop: 'CreatedAt', + align: 'center' + }, + slot: 'CreatedAt' + },{ + attrs: { + label: '更新时间', + prop: 'UpdatedAt', + align: 'center' + }, + slot: 'UpdatedAt' + }, + { + attrs: { + label: '操作', + prop: 'operate', + align: 'center' + }, + slot: 'operate' + } + ] +} diff --git a/src/pathInfo.json b/src/pathInfo.json index 0cf0b0c..75fe9b2 100644 --- a/src/pathInfo.json +++ b/src/pathInfo.json @@ -22,6 +22,9 @@ "/src/view/example/index.vue": "Example", "/src/view/example/upload/scanUpload.vue": "scanUpload", "/src/view/example/upload/upload.vue": "Upload", + "/src/view/goods/article/edit.vue": "Edit", + "/src/view/goods/article/index.vue": "Index", + "/src/view/goods/index.vue": "goods", "/src/view/init/index.vue": "Init", "/src/view/layout/aside/asideComponent/asyncSubmenu.vue": "AsyncSubmenu", "/src/view/layout/aside/asideComponent/index.vue": "AsideComponent", @@ -40,6 +43,8 @@ "/src/view/layout/setting/title.vue": "layoutSettingTitle", "/src/view/layout/tabs/index.vue": "HistoryComponent", "/src/view/login/index.vue": "Login", + "/src/view/order/index.vue": "OrderManage", + "/src/view/order/order/index.vue": "Index", "/src/view/person/person.vue": "Person", "/src/view/routerHolder.vue": "RouterHolder", "/src/view/superAdmin/api/api.vue": "Api", @@ -68,11 +73,9 @@ "/src/view/systemTools/installPlugin/index.vue": "Index", "/src/view/systemTools/pubPlug/pubPlug.vue": "PubPlug", "/src/view/systemTools/system/system.vue": "Config", + "/src/view/user/index.vue": "UserManage", + "/src/view/user/user/index.vue": "Index", "/src/plugin/announcement/form/info.vue": "InfoForm", "/src/plugin/announcement/view/info.vue": "Info", - "/src/plugin/email/view/index.vue": "Email", - "/src/view/goods/index.vue": "Goods", - "/src/view/goods/article/index.vue": "Article", - "/src/view/order/index.vue": "OrderManage", - "/src/view/order/order/index.vue": "Order" + "/src/plugin/email/view/index.vue": "Email" } \ No newline at end of file diff --git a/src/style/main.scss b/src/style/main.scss index a213d48..78c1787 100644 --- a/src/style/main.scss +++ b/src/style/main.scss @@ -49,3 +49,18 @@ outline: none; } } +.container-wrapper{ + min-height: calc(100vh - 12rem); + display: flex; + flex-direction: column; + justify-content: space-between; + position: relative; +} +.footer-box{ + display: flex; + justify-content: center; + padding: 1rem 0; + position: sticky; + bottom: 0; + border-top: 1px solid #ededed; +} diff --git a/src/view/goods/article/edit.vue b/src/view/goods/article/edit.vue new file mode 100644 index 0000000..a3ed9ff --- /dev/null +++ b/src/view/goods/article/edit.vue @@ -0,0 +1,165 @@ + + + diff --git a/src/view/goods/article/index.vue b/src/view/goods/article/index.vue index b91856a..7cd59db 100644 --- a/src/view/goods/article/index.vue +++ b/src/view/goods/article/index.vue @@ -1,11 +1,132 @@ \ No newline at end of file + diff --git a/src/view/order/order/index.vue b/src/view/order/order/index.vue index 0d29592..1a4fb36 100644 --- a/src/view/order/order/index.vue +++ b/src/view/order/order/index.vue @@ -9,22 +9,6 @@ />
- - - - - - - - - - - - - - - - { queryParams.value.page = 1 queryParams.value = { ...queryParams.value, ...data } delete queryParams.value.times - // console.log(queryParams.value) getList() } const resetData = () => { @@ -92,7 +75,7 @@ onMounted(() => { getList() }) async function getList() { - const res = await list(queryParams) + const res = await list(queryParams.value) if(res.code === 0) { tableData.value = res.data.list total.value = res.data.total @@ -106,10 +89,9 @@ function handleDetail(row) { } - function changePage(data) { -queryParams.value.pageNum = data -getList() + queryParams.value.pageNum = data + getList() }