From bff9a07ed4a24b5ce10154df12715eab53b2cdd8 Mon Sep 17 00:00:00 2001 From: zzc <1761997216@qq.com> Date: Mon, 19 Jan 2026 18:05:36 +0800 Subject: [PATCH] feat: draw card --- src/api/spring/fortune/card/index.js | 34 +++ src/api/system/index.js | 9 + src/components/SingleUpload/index.vue | 2 +- src/router/index.js | 76 ++++++- src/utils/request.js | 2 +- .../card/components/AppManagementEdit.vue | 123 +++++++++++ src/views/spring/fortune/card/index.vue | 148 +++++++++++++ src/views/spring/user/device/index.vue | 102 +++++++++ src/views/spring/user/user/index.vue | 201 ++++++++++++++++++ src/views/systemManagement/device/index.vue | 106 +++++++++ src/views/vab/tree/index.vue | 8 +- 11 files changed, 799 insertions(+), 12 deletions(-) create mode 100644 src/api/spring/fortune/card/index.js create mode 100644 src/api/system/index.js create mode 100644 src/views/spring/fortune/card/components/AppManagementEdit.vue create mode 100644 src/views/spring/fortune/card/index.vue create mode 100644 src/views/spring/user/device/index.vue create mode 100644 src/views/spring/user/user/index.vue create mode 100644 src/views/systemManagement/device/index.vue diff --git a/src/api/spring/fortune/card/index.js b/src/api/spring/fortune/card/index.js new file mode 100644 index 0000000..97ea88f --- /dev/null +++ b/src/api/spring/fortune/card/index.js @@ -0,0 +1,34 @@ +import request from '@/utils/request' + +export function getList(data) { + return request({ + url: 'management/api/spring/fortune/card/list', + method: 'get', + params: data, + }) +} + +export function doAdd(data) { + return request({ + url: '/management/api/spring/fortune/card', + method: 'post', + data, + }) +} + +export function doEdit(id, data) { + console.log(22222, id, data) + return request({ + url: `/management/api/spring/fortune/card/${id}`, + method: 'put', + data, + }) +} + +export function doDelete(data) { + return request({ + url: '/management/api/spring/fortune/card/delete', + method: 'put', + data, + }) +} diff --git a/src/api/system/index.js b/src/api/system/index.js new file mode 100644 index 0000000..8002f24 --- /dev/null +++ b/src/api/system/index.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getDeviceList(data) { + return request({ + url: 'management/api/system/device/list', + method: 'get', + params: data, + }) +} diff --git a/src/components/SingleUpload/index.vue b/src/components/SingleUpload/index.vue index 1eb2a8d..683497e 100644 --- a/src/components/SingleUpload/index.vue +++ b/src/components/SingleUpload/index.vue @@ -76,7 +76,7 @@ if (response.code === 200) { this.fileUrl = `https://file.lihailezzc.com/${response.data.key}` this.$message.success('上传成功!') - // this.$emit('input', this.fileUrl) + this.$emit('input', this.fileUrl) this.$emit('upload-success', this.fileUrl) } else { this.$message.error('上传失败,请重试!') diff --git a/src/router/index.js b/src/router/index.js index 10ff993..4f9ad54 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -48,6 +48,61 @@ export const asyncRoutes = [ }, ], }, + { + path: '/spring', + component: Layout, + redirect: 'noRedirect', + name: 'SpringMini', + meta: { title: '新春祝福', icon: 'gift', permissions: ['admin'] }, + children: [ + { + path: 'fortune', + component: EmptyLayout, + alwaysShow: true, + redirect: 'noRedirect', + name: 'Fortune', + meta: { + title: '抽签', + icon: 'clover', + permissions: ['admin'], + }, + children: [ + { + path: 'card', + name: 'card', + component: () => import('@/views/spring/fortune/card/index'), + meta: { title: '抽签卡片' }, + }, + ], + }, + { + path: 'user', + component: EmptyLayout, + alwaysShow: true, + redirect: 'noRedirect', + name: 'User', + meta: { + title: '用户', + icon: 'user', + permissions: ['admin'], + }, + children: [ + { + path: 'user', + name: 'User', + component: () => import('@/views/spring/user/user/index'), + meta: { title: '用户' }, + }, + { + path: 'userChat', + name: 'UserChat', + component: () => import('@/views/spring/user/device/index'), + meta: { title: '设备' }, + }, + ], + }, + ], + }, { path: '/maomaotou', component: Layout, @@ -411,6 +466,21 @@ export const asyncRoutes = [ component: () => import('@/views/personnelManagement/roleManagement/index'), meta: { title: '角色管理' }, }, + ], + }, + { + path: '/systemManagement', + component: Layout, + redirect: 'noRedirect', + name: 'SystemManagement', + meta: { title: '系统', icon: 'users-cog', permissions: ['admin'] }, + children: [ + { + path: 'deviceManagement', + name: 'DeviceManagement', + component: () => import('@/views/systemManagement/device/index'), + meta: { title: '设备管理' }, + }, { path: 'accessLogManagement', name: 'AccessLogManagement', @@ -423,12 +493,6 @@ export const asyncRoutes = [ component: () => import('@/views/personnelManagement/uploadedFileManagement/index'), meta: { title: '已上传文件' }, }, - // { - // path: 'menuManagement', - // name: 'MenuManagement', - // component: () => import('@/views/personnelManagement/menuManagement/index'), - // meta: { title: '菜单管理', badge: 'New' }, - // }, ], }, // { diff --git a/src/utils/request.js b/src/utils/request.js index fb82c2a..e4ed8f8 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -59,7 +59,7 @@ instance.interceptors.request.use( config.params = Vue.prototype.$baseLodash.pickBy(config.params, Vue.prototype.$baseLodash.identity) } //这里会过滤所有为空、0、false的key,如果不需要请自行注释 - if (config.data) config.data = Vue.prototype.$baseLodash.pickBy(config.data, Vue.prototype.$baseLodash.identity) + // if (config.data) config.data = Vue.prototype.$baseLodash.pickBy(config.data, Vue.prototype.$baseLodash.identity) if (config.data && config.headers['Content-Type'] === 'application/x-www-form-urlencoded;charset=UTF-8') config.data = qs.stringify(config.data) if (debounce.some((item) => config.url.includes(item))) loadingInstance = Vue.prototype.$baseLoading() diff --git a/src/views/spring/fortune/card/components/AppManagementEdit.vue b/src/views/spring/fortune/card/components/AppManagementEdit.vue new file mode 100644 index 0000000..261cc94 --- /dev/null +++ b/src/views/spring/fortune/card/components/AppManagementEdit.vue @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/spring/fortune/card/index.vue b/src/views/spring/fortune/card/index.vue new file mode 100644 index 0000000..e2e1d9d --- /dev/null +++ b/src/views/spring/fortune/card/index.vue @@ -0,0 +1,148 @@ + + + + + 添加 + + + + + + + + + 查询 + + + + + + + + + + + + + + + + + + + {{ row.fortuneLevel === '1' ? '吉祥' : row.fortuneLevel === '2' ? '大吉' : '普通' }} + + + + + {{ row.isEnabled ? '是' : '否' }} + + + + + + 编辑 + 删除 + + + + + + + + + diff --git a/src/views/spring/user/device/index.vue b/src/views/spring/user/device/index.vue new file mode 100644 index 0000000..464733d --- /dev/null +++ b/src/views/spring/user/device/index.vue @@ -0,0 +1,102 @@ + + + + + + + + + + 查询 + + + + + + + + + + + + + + + + + + {{ formatTime(row.createdAt) }} + + + + + + + + diff --git a/src/views/spring/user/user/index.vue b/src/views/spring/user/user/index.vue new file mode 100644 index 0000000..84d31fd --- /dev/null +++ b/src/views/spring/user/user/index.vue @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + 查询 + + + + + + + + + + + + + + + + 名称: + {{ row.nickname }} + + + 性别: + {{ row.gender ? (row.gender === 'male' ? '男' : '女') : '未公开' }} + + + 平台: + {{ row.platform }} + + + + + + + + + 粉丝: + {{ row.followers }} + + + 关注数: + {{ row.followings }} + + + 好友: + {{ row.friends }} + + + + + + + {{ formatTime(row.createdAt) }} + + + + + + + + + + + diff --git a/src/views/systemManagement/device/index.vue b/src/views/systemManagement/device/index.vue new file mode 100644 index 0000000..81074c5 --- /dev/null +++ b/src/views/systemManagement/device/index.vue @@ -0,0 +1,106 @@ + + + + + + + + + + 查询 + + + + + + + + + + + + + + + + + + {{ row.appName || row.addId }} + + + + + {{ formatTime(row.createdAt) }} + + + + + + + + diff --git a/src/views/vab/tree/index.vue b/src/views/vab/tree/index.vue index 098695a..ddbce44 100644 --- a/src/views/vab/tree/index.vue +++ b/src/views/vab/tree/index.vue @@ -21,7 +21,7 @@ @node-collapse="nodeCollapse" @node-expand="nodeExpand" > - + {{ node.label }} @@ -55,7 +55,7 @@ :props="defaultProps" @node-click="nodeClick" > - + {{ node.label }} @@ -87,7 +87,7 @@ :props="defaultProps" @node-click="nodeClick" > - + {{ node.label }} @@ -128,7 +128,7 @@ :props="selectTreeDefaultProps" @node-click="selectTreeNodeClick" > - + {{ node.label }}