diff --git a/.env.development b/.env.development index 0aabc1d..df3cbfc 100644 --- a/.env.development +++ b/.env.development @@ -1,7 +1,7 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com -#VITE_SERVER_URL=https://server.gxwebsoft.com/api -VITE_API_URL=https://modules.gxwebsoft.com/api +VITE_SERVER_URL=https://server.gxwebsoft.com/api +#VITE_API_URL=https://modules.gxwebsoft.com/api -VITE_SERVER_URL=http://127.0.0.1:9091/api -#VITE_API_URL=http://127.0.0.1:9099/api +#VITE_SERVER_URL=http://127.0.0.1:9091/api +VITE_API_URL=http://127.0.0.1:9099/api diff --git a/src/api/cms/mp-menu/model/index.ts b/src/api/cms/mp-menu/model/index.ts index 0427e64..1a29155 100644 --- a/src/api/cms/mp-menu/model/index.ts +++ b/src/api/cms/mp-menu/model/index.ts @@ -67,13 +67,17 @@ export interface MpMenu { // 子菜单 children?: MpMenu[]; pageName?: string; + groupName?: string; } /** * 小程序端菜单搜索条件 */ export interface MpMenuParam extends PageParam { + parentId?: number; menuId?: number; + pageId?: number; + subpackage?: string; type?: number; keywords?: string; } diff --git a/src/api/cms/mpPages/index.ts b/src/api/cms/mpPages/index.ts new file mode 100644 index 0000000..eed003b --- /dev/null +++ b/src/api/cms/mpPages/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { MpPages, MpPagesParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询小程序页面 + */ +export async function pageMpPages(params: MpPagesParam) { + const res = await request.get>>( + MODULES_API_URL + '/cms/mp-pages/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询小程序页面列表 + */ +export async function listMpPages(params?: MpPagesParam) { + const res = await request.get>( + MODULES_API_URL + '/cms/mp-pages', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加小程序页面 + */ +export async function addMpPages(data: MpPages) { + const res = await request.post>( + MODULES_API_URL + '/cms/mp-pages', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改小程序页面 + */ +export async function updateMpPages(data: MpPages) { + const res = await request.put>( + MODULES_API_URL + '/cms/mp-pages', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除小程序页面 + */ +export async function removeMpPages(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/cms/mp-pages/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除小程序页面 + */ +export async function removeBatchMpPages(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/cms/mp-pages/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询小程序页面 + */ +export async function getMpPages(id: number) { + const res = await request.get>( + MODULES_API_URL + '/cms/mp-pages/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/cms/mpPages/model/index.ts b/src/api/cms/mpPages/model/index.ts new file mode 100644 index 0000000..0a0393c --- /dev/null +++ b/src/api/cms/mpPages/model/index.ts @@ -0,0 +1,48 @@ +import type { PageParam } from '@/api'; + +/** + * 小程序页面 + */ +export interface MpPages { + // ID + id?: number; + // 上级id, 0是顶级 + parentId?: number; + // 页面名称 + title?: string; + // 页面路径 + path?: string; + // 设为首页 + home?: number; + // 分包 + subpackage?: string; + // 图标 + icon?: string; + // 排序(数字越小越靠前) + sortNumber?: number; + // 备注 + comments?: string; + // 用户ID + userId?: number; + // 状态, 0正常, 1冻结 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 租户id + tenantId?: number; + // 注册时间 + createTime?: string; + // 子页面 + children?: MpPages[]; +} + +/** + * 小程序页面搜索条件 + */ +export interface MpPagesParam extends PageParam { + id?: number; + title?: string; + path?: string; + subpackage?: string; + keywords?: string; +} diff --git a/src/api/system/file/index.ts b/src/api/system/file/index.ts index 1f7723c..7a63932 100644 --- a/src/api/system/file/index.ts +++ b/src/api/system/file/index.ts @@ -213,3 +213,22 @@ export async function uploadOssByGroupId(file: File, GroupId: string) { } return Promise.reject(new Error(res.data.message)); } + +/** + * 上传阿里云OSS + */ +export async function uploadOssByAppId(file: File, appId: string) { + const formData = new FormData(); + formData.append('file', file); + const res = await request.post>( + SERVER_API_URL + '/oss/upload', + formData, + { + headers: { appId } + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/components/SelectDict/components/select-data.vue b/src/components/SelectDict/components/select-data.vue index e67d672..5a4e6cd 100644 --- a/src/components/SelectDict/components/select-data.vue +++ b/src/components/SelectDict/components/select-data.vue @@ -51,12 +51,13 @@ import { pageDictData } from '@/api/system/dict-data'; import { DictData, DictDataParam } from '@/api/system/dict-data/model'; - defineProps<{ + const props = defineProps<{ // 弹窗是否打开 visible: boolean; title?: any; // 修改回显的数据 data?: DictData | null; + dictCode?: string; }>(); const emit = defineEmits<{ @@ -93,6 +94,11 @@ dataIndex: 'dictDataName', key: 'dictDataName' }, + { + title: '描述', + dataIndex: 'comments', + key: 'comments' + }, { title: '操作', key: 'action', @@ -103,7 +109,7 @@ // 表格数据源 const datasource: DatasourceFunction = ({ page, limit, where, orders }) => { - where.dictCode = 'groupId'; + where.dictCode = props.dictCode; return pageDictData({ ...where, ...orders, diff --git a/src/components/SelectDict/index.vue b/src/components/SelectDict/index.vue index c0401da..b8394b9 100644 --- a/src/components/SelectDict/index.vue +++ b/src/components/SelectDict/index.vue @@ -15,6 +15,7 @@ @@ -32,6 +33,7 @@ value?: any; placeholder?: string; index?: number; + dictCode?: string; }>(), { placeholder: '请选择字典' diff --git a/src/config/menu.ts b/src/config/menu.ts index b075425..1c3ab06 100644 --- a/src/config/menu.ts +++ b/src/config/menu.ts @@ -64,7 +64,7 @@ export default [ { path: '/system/organization', component: '/system/organization', - meta: { title: '组织机构', icon: 'BankOutlined' } + meta: { title: '部门管理', icon: 'BankOutlined' } }, { path: '/system/file', diff --git a/src/i18n/lang/zh_CN/list.ts b/src/i18n/lang/zh_CN/list.ts index 0b31ab0..63cd456 100644 --- a/src/i18n/lang/zh_CN/list.ts +++ b/src/i18n/lang/zh_CN/list.ts @@ -6,7 +6,7 @@ export default { avatar: '头像', username: '账号', nickname: '昵称', - organizationName: '组织机构', + organizationName: '部门管理', phone: '手机号', sexName: '性别', createTime: '创建时间', diff --git a/src/i18n/lang/zh_CN/route.ts b/src/i18n/lang/zh_CN/route.ts index eee1ba9..15843f3 100644 --- a/src/i18n/lang/zh_CN/route.ts +++ b/src/i18n/lang/zh_CN/route.ts @@ -13,7 +13,7 @@ export default { role: { _name: '角色管理' }, menu: { _name: '菜单管理' }, dictionary: { _name: '字典管理(系统类)' }, - organization: { _name: '组织机构' }, + organization: { _name: '部门管理' }, loginRecord: { _name: '登录日志' }, operationRecord: { _name: '操作日志' }, file: { _name: '文件管理' } diff --git a/src/layout/components/header-tools.vue b/src/layout/components/header-tools.vue index 574dc07..7ea4d45 100644 --- a/src/layout/components/header-tools.vue +++ b/src/layout/components/header-tools.vue @@ -8,7 +8,7 @@ treeDefaultExpandAll :bordered="bordered" :tree-data="menuTree" - :placeholder="`请输入搜索关键词`" + :placeholder="`订单管理`" :value="parentId || undefined" style="width: 180px" v-if="menuTree.length" diff --git a/src/store/modules/theme.ts b/src/store/modules/theme.ts index 8808b5a..7eb135d 100644 --- a/src/store/modules/theme.ts +++ b/src/store/modules/theme.ts @@ -53,7 +53,7 @@ const DEFAULT_STATE: ThemeState = Object.freeze({ // 侧栏菜单风格: default(默认), mix(双排侧栏) sideMenuStyle: 'default', // 页签风格: default(默认), dot(圆点), card(卡片) - tabStyle: 'card', + tabStyle: 'default', // 路由切换动画 transitionName: 'fade', // 是否固定顶栏 diff --git a/src/views/cms/article/list.vue b/src/views/cms/article/list.vue index 4743174..6c08311 100644 --- a/src/views/cms/article/list.vue +++ b/src/views/cms/article/list.vue @@ -27,9 +27,14 @@ - {{ - record.title - }} + {{ record.title }} diff --git a/src/views/cms/category/index.vue b/src/views/cms/category/index.vue index 61e1596..e037597 100644 --- a/src/views/cms/category/index.vue +++ b/src/views/cms/category/index.vue @@ -66,9 +66,15 @@ style="margin-right: 10px" v-if="record.image" /> - {{ - record.title - }} + {{ record.title }}