From 7146fdc9b9640c140d39e676453c09fe6a5248a2 Mon Sep 17 00:00:00 2001 From: Wanwan <913752709@qq.com> Date: Mon, 6 Nov 2023 22:00:40 +0800 Subject: [PATCH 01/22] =?UTF-8?q?style:=20=E5=AE=A2=E6=88=B7=20review=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/crm/customer/detail/CustomerDetails.vue | 7 +++---- src/views/crm/customer/detail/index.vue | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/views/crm/customer/detail/CustomerDetails.vue b/src/views/crm/customer/detail/CustomerDetails.vue index 1065b22c..2e584bd9 100644 --- a/src/views/crm/customer/detail/CustomerDetails.vue +++ b/src/views/crm/customer/detail/CustomerDetails.vue @@ -44,6 +44,9 @@ {{ customer.contactNextTime ? formatDate(customer.contactNextTime, 'YYYY-MM-DD') : '空' }} + + {{ customer.contactLastTime ? formatDate(customer.contactLastTime) : '空' }} + @@ -71,10 +74,6 @@ {{ customer.updateTime ? formatDate(customer.updateTime) : '空' }} - - - {{ customer.contactLastTime ? formatDate(customer.contactLastTime) : '空' }} - diff --git a/src/views/crm/customer/detail/index.vue b/src/views/crm/customer/detail/index.vue index 1caeadef..f250bc28 100644 --- a/src/views/crm/customer/detail/index.vue +++ b/src/views/crm/customer/detail/index.vue @@ -63,8 +63,7 @@ - - + From 325e2e4ff20b23d8b1a64902bb19bb24c4f0190f Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 8 Nov 2023 21:10:05 +0800 Subject: [PATCH 02/22] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E3=80=90=E5=88=97=E8=A1=A8=E5=AF=BC=E8=88=AA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/MenuList/config.ts | 39 ++++++++++ .../components/mobile/MenuList/index.vue | 31 ++++++++ .../components/mobile/MenuList/property.vue | 74 +++++++++++++++++++ src/components/DiyEditor/util.ts | 5 +- src/components/InputWithColor/index.vue | 58 +++++++++++++++ 5 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/MenuList/config.ts create mode 100644 src/components/DiyEditor/components/mobile/MenuList/index.vue create mode 100644 src/components/DiyEditor/components/mobile/MenuList/property.vue create mode 100644 src/components/InputWithColor/index.vue diff --git a/src/components/DiyEditor/components/mobile/MenuList/config.ts b/src/components/DiyEditor/components/mobile/MenuList/config.ts new file mode 100644 index 00000000..f06adfae --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuList/config.ts @@ -0,0 +1,39 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' + +/** 列表导航属性 */ +export interface MenuListProperty { + // 导航菜单列表 + list: MenuListItemProperty[] + // 组件样式 + style: ComponentStyle +} +/** 列表导航项目属性 */ +export interface MenuListItemProperty { + // 图标链接 + iconUrl: string + // 标题 + title: string + // 标题颜色 + titleColor: string + // 副标题 + subtitle: string + // 副标题颜色 + subtitleColor: string + // 链接 + url: string +} + +// 定义组件 +export const component = { + id: 'MenuList', + name: '列表导航', + icon: 'fa-solid:list', + property: { + list: [], + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/MenuList/index.vue b/src/components/DiyEditor/components/mobile/MenuList/index.vue new file mode 100644 index 00000000..9a56fd94 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuList/index.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/MenuList/property.vue b/src/components/DiyEditor/components/mobile/MenuList/property.vue new file mode 100644 index 00000000..51652b6e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuList/property.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 29b44cf6..96dd4dbb 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -103,8 +103,9 @@ export const PAGE_LIBS = [ components: [ 'SearchBar', 'NoticeBar', - 'GridNavigation', - 'ListNavigation', + 'MenuSwiper', + 'MenuGrid', + 'MenuList', 'Divider', 'TitleBar' ] diff --git a/src/components/InputWithColor/index.vue b/src/components/InputWithColor/index.vue new file mode 100644 index 00000000..1932fd58 --- /dev/null +++ b/src/components/InputWithColor/index.vue @@ -0,0 +1,58 @@ + + + + From ac42493659cd79b4ae7b451386b229dc293221fa Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 8 Nov 2023 22:22:35 +0800 Subject: [PATCH 03/22] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E3=80=90=E5=AE=AB=E6=A0=BC=E5=AF=BC=E8=88=AA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/MenuGrid/config.ts | 78 +++++++++++++++ .../components/mobile/MenuGrid/index.vue | 35 +++++++ .../components/mobile/MenuGrid/property.vue | 96 +++++++++++++++++++ .../components/mobile/MenuList/config.ts | 10 +- .../components/mobile/MenuList/property.vue | 11 ++- 5 files changed, 224 insertions(+), 6 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/MenuGrid/config.ts create mode 100644 src/components/DiyEditor/components/mobile/MenuGrid/index.vue create mode 100644 src/components/DiyEditor/components/mobile/MenuGrid/property.vue diff --git a/src/components/DiyEditor/components/mobile/MenuGrid/config.ts b/src/components/DiyEditor/components/mobile/MenuGrid/config.ts new file mode 100644 index 00000000..ccf09b2e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuGrid/config.ts @@ -0,0 +1,78 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' +import { cloneDeep } from 'lodash-es' + +/** 宫格导航属性 */ +export interface MenuGridProperty { + // 列数 + column: number + // 导航菜单列表 + list: MenuGridItemProperty[] + // 组件样式 + style: ComponentStyle +} +/** 宫格导航项目属性 */ +export interface MenuGridItemProperty { + // 图标链接 + iconUrl: string + // 标题 + title: string + // 标题颜色 + titleColor: string + // 副标题 + subtitle: string + // 副标题颜色 + subtitleColor: string + // 链接 + url: string + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标文字 + text: string + // 角标文字颜色 + textColor: string + // 角标背景颜色 + bgColor: string + } +} + +export const EMPTY_MENU_GRID_ITEM_PROPERTY = { + title: '标题', + titleColor: '#333', + subtitle: '副标题', + subtitleColor: '#bbb', + badge: { + show: false, + textColor: '#fff', + bgColor: '#FF6000' + } +} as MenuGridItemProperty + +// 定义组件 +export const component = { + id: 'MenuGrid', + name: '宫格导航', + icon: 'fa-solid:list', + property: { + column: 3, + list: [cloneDeep(EMPTY_MENU_GRID_ITEM_PROPERTY)], + style: { + bgType: 'color', + bgColor: '#fff', + marginBottom: 8, + marginLeft: 8, + marginRight: 8, + padding: 8, + paddingTop: 8, + paddingRight: 8, + paddingBottom: 8, + paddingLeft: 8, + borderRadius: 8, + borderTopLeftRadius: 8, + borderTopRightRadius: 8, + borderBottomRightRadius: 8, + borderBottomLeftRadius: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/MenuGrid/index.vue b/src/components/DiyEditor/components/mobile/MenuGrid/index.vue new file mode 100644 index 00000000..1c5ef1dc --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuGrid/index.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/MenuGrid/property.vue b/src/components/DiyEditor/components/mobile/MenuGrid/property.vue new file mode 100644 index 00000000..e09dd318 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuGrid/property.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/src/components/DiyEditor/components/mobile/MenuList/config.ts b/src/components/DiyEditor/components/mobile/MenuList/config.ts index f06adfae..c42674f3 100644 --- a/src/components/DiyEditor/components/mobile/MenuList/config.ts +++ b/src/components/DiyEditor/components/mobile/MenuList/config.ts @@ -1,4 +1,5 @@ import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' +import { cloneDeep } from 'lodash-es' /** 列表导航属性 */ export interface MenuListProperty { @@ -23,13 +24,20 @@ export interface MenuListItemProperty { url: string } +export const EMPTY_MENU_LIST_ITEM_PROPERTY = { + title: '标题', + titleColor: '#333', + subtitle: '副标题', + subtitleColor: '#bbb' +} + // 定义组件 export const component = { id: 'MenuList', name: '列表导航', icon: 'fa-solid:list', property: { - list: [], + list: [cloneDeep(EMPTY_MENU_LIST_ITEM_PROPERTY)], style: { bgType: 'color', bgColor: '#fff', diff --git a/src/components/DiyEditor/components/mobile/MenuList/property.vue b/src/components/DiyEditor/components/mobile/MenuList/property.vue index 51652b6e..270ca261 100644 --- a/src/components/DiyEditor/components/mobile/MenuList/property.vue +++ b/src/components/DiyEditor/components/mobile/MenuList/property.vue @@ -49,7 +49,11 @@ From 59b2d89a18855091851270d6c1cebcc1fb6b0178 Mon Sep 17 00:00:00 2001 From: Wanwan <913752709@qq.com> Date: Thu, 9 Nov 2023 00:08:09 +0800 Subject: [PATCH 05/22] =?UTF-8?q?feat:=20CRM=20=E5=AE=A2=E6=88=B7=E5=85=AC?= =?UTF-8?q?=E6=B5=B7=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/crm/customerPoolConf/index.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/views/crm/customerPoolConf/index.vue b/src/views/crm/customerPoolConf/index.vue index 518c6f3d..1ea61f94 100644 --- a/src/views/crm/customerPoolConf/index.vue +++ b/src/views/crm/customerPoolConf/index.vue @@ -11,7 +11,12 @@ From 82aed175ab31296666a317e81e0e2bb7744b4f5d Mon Sep 17 00:00:00 2001 From: owen Date: Thu, 9 Nov 2023 09:18:46 +0800 Subject: [PATCH 06/22] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E3=80=90=E8=8F=9C=E5=8D=95=E5=AF=BC=E8=88=AA=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ColorInput/index.vue | 24 +--- .../components/ComponentContainer.vue | 31 +++-- .../components/mobile/MenuGrid/config.ts | 2 +- .../components/mobile/MenuSwiper/config.ts | 66 ++++++++++ .../components/mobile/MenuSwiper/index.vue | 119 ++++++++++++++++++ .../components/mobile/MenuSwiper/property.vue | 106 ++++++++++++++++ src/components/DiyEditor/util.ts | 16 +-- src/components/InputWithColor/index.vue | 3 +- src/utils/color.ts | 21 ++++ 9 files changed, 344 insertions(+), 44 deletions(-) create mode 100644 src/components/DiyEditor/components/mobile/MenuSwiper/config.ts create mode 100644 src/components/DiyEditor/components/mobile/MenuSwiper/index.vue create mode 100644 src/components/DiyEditor/components/mobile/MenuSwiper/property.vue diff --git a/src/components/ColorInput/index.vue b/src/components/ColorInput/index.vue index abd083a1..63ff73cf 100644 --- a/src/components/ColorInput/index.vue +++ b/src/components/ColorInput/index.vue @@ -1,38 +1,18 @@ + + diff --git a/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue b/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue new file mode 100644 index 00000000..2175d57e --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MenuSwiper/property.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 96dd4dbb..5ae0a93f 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -100,17 +100,13 @@ export const PAGE_LIBS = [ { name: '基础组件', extended: true, - components: [ - 'SearchBar', - 'NoticeBar', - 'MenuSwiper', - 'MenuGrid', - 'MenuList', - 'Divider', - 'TitleBar' - ] + components: ['SearchBar', 'NoticeBar', 'MenuSwiper', 'MenuGrid', 'MenuList'] + }, + { + name: '图文组件', + extended: true, + components: ['ImageBar', 'Carousel', 'TitleBar', 'VideoPlayer', 'Divider'] }, - { name: '图文组件', extended: true, components: ['ImageBar', 'Carousel', 'VideoPlayer'] }, { name: '商品组件', extended: true, components: ['ProductCard'] }, { name: '会员组件', diff --git a/src/components/InputWithColor/index.vue b/src/components/InputWithColor/index.vue index 1932fd58..2bc53172 100644 --- a/src/components/InputWithColor/index.vue +++ b/src/components/InputWithColor/index.vue @@ -1,13 +1,14 @@ From 55b477acdb4e4246648ab6198440cfc0649efc04 Mon Sep 17 00:00:00 2001 From: owen Date: Thu, 9 Nov 2023 15:48:20 +0800 Subject: [PATCH 09/22] =?UTF-8?q?unplugin-auto-import=EF=BC=9A=E6=8E=92?= =?UTF-8?q?=E9=99=A4=E8=87=AA=E5=8A=A8=E5=AF=BC=E5=85=A5=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/vite/index.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/build/vite/index.ts b/build/vite/index.ts index 02067107..585759f5 100644 --- a/build/vite/index.ts +++ b/build/vite/index.ts @@ -60,18 +60,11 @@ export function createVitePlugins() { } }), Components({ - // 要搜索组件的目录的相对路径 - dirs: ['src/components'], - // 组件的有效文件扩展名 - extensions: ['vue', 'md'], - // 搜索子目录 - deep: true, - include: [/\.vue$/, /\.vue\?vue/], // 生成自定义 `auto-components.d.ts` 全局声明 dts: 'src/types/auto-components.d.ts', // 自定义组件的解析器 resolvers: [ElementPlusResolver()], - exclude: [/[\\/]node_modules[\\/]/] + globs: ["src/components/**/**.{vue, md}", '!src/components/DiyEditor/components/mobile/**'] }), EslintPlugin({ cache: false, From 6369b334e311f5cc402685d230df8d453d4c5007 Mon Sep 17 00:00:00 2001 From: Wanwan <913752709@qq.com> Date: Sat, 11 Nov 2023 20:50:33 +0800 Subject: [PATCH 10/22] =?UTF-8?q?feat:=20CRM=20=E5=AE=A2=E6=88=B7=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/customerLimitConfig/index.ts | 35 +++ src/api/system/user/index.ts | 5 + .../CustomerLimitConfigForm.vue | 222 ++++++++++++++++++ .../CustomerQuantityLimit.vue | 130 ++++++++++ .../customerLimitConfig/customerLimitConf.ts | 13 + src/views/crm/customerLimitConfig/index.vue | 20 ++ src/views/crm/customerPoolConf/index.vue | 4 +- 7 files changed, 427 insertions(+), 2 deletions(-) create mode 100644 src/api/crm/customerLimitConfig/index.ts create mode 100644 src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue create mode 100644 src/views/crm/customerLimitConfig/CustomerQuantityLimit.vue create mode 100644 src/views/crm/customerLimitConfig/customerLimitConf.ts create mode 100644 src/views/crm/customerLimitConfig/index.vue diff --git a/src/api/crm/customerLimitConfig/index.ts b/src/api/crm/customerLimitConfig/index.ts new file mode 100644 index 00000000..22fde3ea --- /dev/null +++ b/src/api/crm/customerLimitConfig/index.ts @@ -0,0 +1,35 @@ +import request from '@/config/axios' + +export interface CustomerLimitConfigVO { + id?: number + type?: number + userIds?: string + deptIds?: string + maxCount?: number + dealCountEnabled?: boolean +} + +// 查询客户限制配置列表 +export const getCustomerLimitConfigPage = async (params) => { + return await request.get({ url: `/crm/customer-limit-config/page`, params }) +} + +// 查询客户限制配置详情 +export const getCustomerLimitConfig = async (id: number) => { + return await request.get({ url: `/crm/customer-limit-config/get?id=` + id }) +} + +// 新增客户限制配置 +export const createCustomerLimitConfig = async (data: CustomerLimitConfigVO) => { + return await request.post({ url: `/crm/customer-limit-config/create`, data }) +} + +// 修改客户限制配置 +export const updateCustomerLimitConfig = async (data: CustomerLimitConfigVO) => { + return await request.put({ url: `/crm/customer-limit-config/update`, data }) +} + +// 删除客户限制配置 +export const deleteCustomerLimitConfig = async (id: number) => { + return await request.delete({ url: `/crm/customer-limit-config/delete?id=` + id }) +} diff --git a/src/api/system/user/index.ts b/src/api/system/user/index.ts index 6224f0e8..689fec0d 100644 --- a/src/api/system/user/index.ts +++ b/src/api/system/user/index.ts @@ -22,6 +22,11 @@ export const getUserPage = (params: PageParam) => { return request.get({ url: '/system/user/page', params }) } +// 查询所有用户列表 +export const getAllUser = () => { + return request.get({ url: '/system/user/all' }) +} + // 查询用户详情 export const getUser = (id: number) => { return request.get({ url: '/system/user/get?id=' + id }) diff --git a/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue b/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue new file mode 100644 index 00000000..006c1349 --- /dev/null +++ b/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue @@ -0,0 +1,222 @@ + + diff --git a/src/views/crm/customerLimitConfig/CustomerQuantityLimit.vue b/src/views/crm/customerLimitConfig/CustomerQuantityLimit.vue new file mode 100644 index 00000000..fec9acb4 --- /dev/null +++ b/src/views/crm/customerLimitConfig/CustomerQuantityLimit.vue @@ -0,0 +1,130 @@ + + + diff --git a/src/views/crm/customerLimitConfig/customerLimitConf.ts b/src/views/crm/customerLimitConfig/customerLimitConf.ts new file mode 100644 index 00000000..188e6ef4 --- /dev/null +++ b/src/views/crm/customerLimitConfig/customerLimitConf.ts @@ -0,0 +1,13 @@ +/** + * 客户限制配置类型 + */ +export enum LimitConfType { + /** + * 拥有客户数限制 + */ + CUSTOMER_QUANTITY_LIMIT = 1, + /** + * 锁定客户数限制 + */ + CUSTOMER_LOCK_LIMIT = 2 +} diff --git a/src/views/crm/customerLimitConfig/index.vue b/src/views/crm/customerLimitConfig/index.vue new file mode 100644 index 00000000..49582ca1 --- /dev/null +++ b/src/views/crm/customerLimitConfig/index.vue @@ -0,0 +1,20 @@ + + + diff --git a/src/views/crm/customerPoolConf/index.vue b/src/views/crm/customerPoolConf/index.vue index 1ea61f94..92467fee 100644 --- a/src/views/crm/customerPoolConf/index.vue +++ b/src/views/crm/customerPoolConf/index.vue @@ -87,7 +87,6 @@ const getConfig = async () => { return } formData.value = data - console.log(formData.value) } finally { formLoading.value = false } @@ -107,7 +106,8 @@ const onSubmit = async () => { const data = formData.value as unknown as CustomerPoolConfApi.CustomerPoolConfigVO await CustomerPoolConfApi.updateCustomerPoolConfig(data) message.success(t('common.updateSuccess')) - dialogVisible.value = false + await getConfig() + formLoading.value = false } finally { formLoading.value = false } From a7f86dfd8bdc2813263d8a449d1b0efeec8fd490 Mon Sep 17 00:00:00 2001 From: Wanwan <913752709@qq.com> Date: Sat, 11 Nov 2023 21:06:11 +0800 Subject: [PATCH 11/22] =?UTF-8?q?feat:=20CRM=20=E5=AE=A2=E6=88=B7=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crm/customer/detail/CustomerDetails.vue | 160 +++++++++--------- src/views/crm/customer/detail/index.vue | 3 +- .../CustomerQuantityLimit.vue | 17 +- src/views/crm/customerLimitConfig/index.vue | 2 +- 4 files changed, 100 insertions(+), 82 deletions(-) diff --git a/src/views/crm/customer/detail/CustomerDetails.vue b/src/views/crm/customer/detail/CustomerDetails.vue index 2e584bd9..67beae94 100644 --- a/src/views/crm/customer/detail/CustomerDetails.vue +++ b/src/views/crm/customer/detail/CustomerDetails.vue @@ -1,82 +1,86 @@ + + diff --git a/src/components/DiyEditor/components/mobile/MagicCube/property.vue b/src/components/DiyEditor/components/mobile/MagicCube/property.vue new file mode 100644 index 00000000..57c0af79 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/MagicCube/property.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts index 5ae0a93f..8f8c2c0c 100644 --- a/src/components/DiyEditor/util.ts +++ b/src/components/DiyEditor/util.ts @@ -105,7 +105,7 @@ export const PAGE_LIBS = [ { name: '图文组件', extended: true, - components: ['ImageBar', 'Carousel', 'TitleBar', 'VideoPlayer', 'Divider'] + components: ['ImageBar', 'Carousel', 'TitleBar', 'VideoPlayer', 'Divider', 'MagicCube'] }, { name: '商品组件', extended: true, components: ['ProductCard'] }, { diff --git a/src/components/MagicCubeEditor/index.vue b/src/components/MagicCubeEditor/index.vue new file mode 100644 index 00000000..26ea179d --- /dev/null +++ b/src/components/MagicCubeEditor/index.vue @@ -0,0 +1,270 @@ + + + diff --git a/src/components/MagicCubeEditor/util.ts b/src/components/MagicCubeEditor/util.ts new file mode 100644 index 00000000..e7c64658 --- /dev/null +++ b/src/components/MagicCubeEditor/util.ts @@ -0,0 +1,72 @@ +// 坐标点 +export interface Point { + x: number + y: number +} + +// 矩形 +export interface Rect { + // 左上角 X 轴坐标 + left: number + // 左上角 Y 轴坐标 + top: number + // 右下角 X 轴坐标 + right: number + // 右下角 Y 轴坐标 + bottom: number + // 矩形宽度 + width: number + // 矩形高度 + height: number +} + +/** + * 判断两个矩形是否重叠 + * @param a 矩形 A + * @param b 矩形 B + */ +export const isOverlap = (a: Rect, b: Rect): boolean => { + return ( + a.left < b.left + b.width && + a.left + a.width > b.left && + a.top < b.top + b.height && + a.height + a.top > b.top + ) +} +/** + * 检查坐标点是否在矩形内 + * @param hotArea 矩形 + * @param point 坐标 + */ +export const isContains = (hotArea: Rect, point: Point): boolean => { + return ( + point.x >= hotArea.left && + point.x < hotArea.right && + point.y >= hotArea.top && + point.y < hotArea.bottom + ) +} + +/** + * 在两个坐标点中间,创建一个矩形 + * + * 存在以下情况: + * 1. 两个坐标点是同一个位置,只占一个位置的正方形,宽高都为 1 + * 2. X 轴坐标相同,只占一行的矩形,高度为 1 + * 3. Y 轴坐标相同,只占一列的矩形,宽度为 1 + * 4. 多行多列的矩形 + * + * @param a 坐标点一 + * @param b 坐标点二 + */ +export const createRect = (a: Point, b: Point): Rect => { + // 计算矩形的范围 + const [left, left2] = [a.x, b.x].sort() + const [top, top2] = [a.y, b.y].sort() + const right = left2 + 1 + const bottom = top2 + 1 + const height = bottom - top + const width = right - left + + return { left, right, top, bottom, height, width } +} diff --git a/src/views/mall/promotion/diy/template/decorate.vue b/src/views/mall/promotion/diy/template/decorate.vue index 8304088a..f2ae7bc0 100644 --- a/src/views/mall/promotion/diy/template/decorate.vue +++ b/src/views/mall/promotion/diy/template/decorate.vue @@ -78,7 +78,6 @@ const handleTemplateItemChange = () => { currentFormData.value = formData.value!.pages.find( (page: DiyPageApi.DiyPageVO) => page.name === templateItems[selectedTemplateItem.value].name ) - console.log(currentFormData.value) } // 提交表单 From 2385cd9b9a88f7b1f0de303a1c7b473ec203f544 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Mon, 13 Nov 2023 15:48:21 +0800 Subject: [PATCH 14/22] =?UTF-8?q?fix=EF=BC=9A=E5=A6=82=E6=9E=9C=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E5=88=B0=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=88=99=E4=B8=8D=E8=BF=9B=E8=A1=8C=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/axios/service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index 1a4741b6..6413e945 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -217,6 +217,10 @@ const refreshToken = async () => { const handleAuthorized = () => { const { t } = useI18n() if (!isRelogin.show) { + // 如果已经到重新登录页面则不进行弹窗提示 + if (window.location.href.includes('login?redirect=')) { + return + } isRelogin.show = true ElMessageBox.confirm(t('sys.api.timeoutMessage'), t('common.confirmTitle'), { showCancelButton: false, From 27c9a0f32deee6e69b81348aae08ba114a5a0797 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Mon, 13 Nov 2023 17:49:27 +0800 Subject: [PATCH 15/22] =?UTF-8?q?crm-=E5=9B=A2=E9=98=9F=E6=88=90=E5=91=98?= =?UTF-8?q?=EF=BC=9A=20=E5=85=88=E6=8F=90=E4=BA=A4=E4=B8=80=E6=B3=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/permission/index.ts | 32 +++++ .../crm/components/CrmPermissionForm.vue | 106 ++++++++++++++++ src/views/crm/components/CrmTeamList.vue | 116 ++++++++++++++++++ src/views/crm/components/index.ts | 11 ++ src/views/crm/customer/index.vue | 115 +++++++++-------- 5 files changed, 328 insertions(+), 52 deletions(-) create mode 100644 src/api/crm/permission/index.ts create mode 100644 src/views/crm/components/CrmPermissionForm.vue create mode 100644 src/views/crm/components/CrmTeamList.vue create mode 100644 src/views/crm/components/index.ts diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts new file mode 100644 index 00000000..f71e2bfc --- /dev/null +++ b/src/api/crm/permission/index.ts @@ -0,0 +1,32 @@ +import request from '@/config/axios' + +export interface PermissionVO { + id: number // 数据权限编号 + userId: number // 用户编号 + bizType: number // Crm 类型 + bizId: number // Crm 类型数据编号 + level: number // 权限级别 + deptName: string // 部门名称 + nickname: string // 用户昵称 + postNames: string // 岗位名称数组 +} + +// 查询团队成员列表 +export const getPermissionList = async (params) => { + return await request.get({ url: `/crm/permission/list`, params }) +} + +// 新增团队成员 +export const createPermission = async (data: PermissionVO) => { + return await request.post({ url: `/crm/permission/add`, data }) +} + +// 修改团队成员 +export const updatePermission = async (data: PermissionVO) => { + return await request.put({ url: `/crm/permission/update`, data }) +} + +// 删除团队成员 +export const deletePermission = async (params) => { + return await request.delete({ url: '/crm/permission/delete', params }) +} diff --git a/src/views/crm/components/CrmPermissionForm.vue b/src/views/crm/components/CrmPermissionForm.vue new file mode 100644 index 00000000..1d217323 --- /dev/null +++ b/src/views/crm/components/CrmPermissionForm.vue @@ -0,0 +1,106 @@ + + diff --git a/src/views/crm/components/CrmTeamList.vue b/src/views/crm/components/CrmTeamList.vue new file mode 100644 index 00000000..824409b8 --- /dev/null +++ b/src/views/crm/components/CrmTeamList.vue @@ -0,0 +1,116 @@ + + + diff --git a/src/views/crm/components/index.ts b/src/views/crm/components/index.ts new file mode 100644 index 00000000..b0bf3e42 --- /dev/null +++ b/src/views/crm/components/index.ts @@ -0,0 +1,11 @@ +import CrmTeam from './CrmTeamList.vue' + +enum CrmBizTypeEnum { + CRM_LEADS = 1, // 线索 + CRM_CUSTOMER = 2, // 客户 + CRM_CONTACTS = 3, // 联系人 + CRM_BUSINESS = 5, // 商机 + CRM_CONTRACT = 6 // 合同 +} + +export { CrmTeam, CrmBizTypeEnum } diff --git a/src/views/crm/customer/index.vue b/src/views/crm/customer/index.vue index 073bf8cb..b214d7c1 100644 --- a/src/views/crm/customer/index.vue +++ b/src/views/crm/customer/index.vue @@ -2,36 +2,36 @@ - 搜索 - 重置 - - 新增 + + + 搜索 + + + + 重置 + + + + 新增 - 导出 + + 导出 @@ -92,77 +100,77 @@ - - - - + + + + - + - + - - - - - + + + + + - + - + - + - diff --git a/src/views/crm/components/CrmTeamList.vue b/src/views/crm/components/CrmTeamList.vue index 824409b8..6a1c14bc 100644 --- a/src/views/crm/components/CrmTeamList.vue +++ b/src/views/crm/components/CrmTeamList.vue @@ -25,10 +25,10 @@ @selection-change="handleSelectionChange" > - - - - + + + + @@ -39,6 +39,7 @@ import { ElTable } from 'element-plus' import * as PermissionApi from '@/api/crm/permission' import { useUserStoreWithOut } from '@/store/modules/user' import CrmPermissionForm from './CrmPermissionForm.vue' +import { CrmPermissionLevelEnum } from './index' defineOptions({ name: 'CrmTeam' }) const props = defineProps<{ @@ -65,14 +66,14 @@ const handleSelectionChange = (val: PermissionApi.PermissionVO[]) => { multipleSelection.value = val } const message = useMessage() -const crmPermissionFormRef = ref>(null) +const crmPermissionFormRef = ref>() const handleEdit = () => { if (multipleSelection.value?.length === 0) { message.warning('请先选择团队成员后操作!') return } const ids = multipleSelection.value?.map((item) => item.id) - crmPermissionFormRef.value?.open('update', props.bizType, props.bizId, ids[0]) + crmPermissionFormRef.value?.open('update', props.bizType, props.bizId, ids) } const handleRemove = async () => { if (multipleSelection.value?.length === 0) { @@ -81,13 +82,10 @@ const handleRemove = async () => { } await message.delConfirm() const ids = multipleSelection.value?.map((item) => item.id) - ids?.forEach((id) => { - // TODO 还不确定要不要搞个批量删除,还是一次只能删除一个,先用循环弄一下 - PermissionApi.deletePermission({ - bizType: props.bizType, - bizId: props.bizId, - id - }) + await PermissionApi.deletePermission({ + bizType: props.bizType, + bizId: props.bizId, + ids }) } const handleAdd = () => { @@ -95,14 +93,16 @@ const handleAdd = () => { } const userStore = useUserStoreWithOut() -const handleQuit = () => { +const handleQuit = async () => { const permission = list.value.find( - (item) => item.userId === userStore.getUser.id && item.level === 1 + (item) => item.userId === userStore.getUser.id && item.level === CrmPermissionLevelEnum.OWNER ) if (permission) { message.warning('负责人不能退出团队!') return } + const userPermission = list.value.find((item) => item.userId === userStore.getUser.id) + await PermissionApi.quitTeam(userPermission?.id) } watch( @@ -113,4 +113,3 @@ watch( { immediate: true, deep: true } ) - diff --git a/src/views/crm/components/index.ts b/src/views/crm/components/index.ts index b0bf3e42..c25feef3 100644 --- a/src/views/crm/components/index.ts +++ b/src/views/crm/components/index.ts @@ -8,4 +8,10 @@ enum CrmBizTypeEnum { CRM_CONTRACT = 6 // 合同 } -export { CrmTeam, CrmBizTypeEnum } +enum CrmPermissionLevelEnum { + OWNER = 1, // 负责人 + READ = 2, // 读 + WRITE = 3 // 写 +} + +export { CrmTeam, CrmBizTypeEnum, CrmPermissionLevelEnum } From 8e0cf5c1e54afd114a41fd40f838614a68bbb4d0 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 14 Nov 2023 12:06:42 +0800 Subject: [PATCH 17/22] =?UTF-8?q?crm-=E5=9B=A2=E9=98=9F=E6=88=90=E5=91=98?= =?UTF-8?q?=EF=BC=9A=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=BE=97=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E5=90=8D=E7=A7=B0=E5=87=BD=E6=95=B0=20getLev?= =?UTF-8?q?elName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/permission/index.ts | 1 + src/views/crm/components/CrmTeamList.vue | 38 ++++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts index c592bb23..e790c334 100644 --- a/src/api/crm/permission/index.ts +++ b/src/api/crm/permission/index.ts @@ -9,6 +9,7 @@ export interface PermissionVO { deptName?: string // 部门名称 nickname?: string // 用户昵称 postNames?: string // 岗位名称数组 + createTime?: Date } // 查询团队成员列表 diff --git a/src/views/crm/components/CrmTeamList.vue b/src/views/crm/components/CrmTeamList.vue index 6a1c14bc..f7591f6a 100644 --- a/src/views/crm/components/CrmTeamList.vue +++ b/src/views/crm/components/CrmTeamList.vue @@ -28,7 +28,11 @@ - + + + @@ -47,7 +51,20 @@ const props = defineProps<{ bizId: number }>() const loading = ref(true) // 列表的加载中 -const list = ref([]) // 列表的数据 +const list = ref([ + // TODO 测试数据 + { + id: 1, // 数据权限编号 + userId: 1, // 用户编号 + bizType: 1, // Crm 类型 + bizId: 1, // Crm 类型数据编号 + level: 1, // 权限级别 + deptName: '研发部门', // 部门名称 + nickname: '芋道源码', // 用户昵称 + postNames: '全栈开发工程师', // 岗位名称数组 + createTime: new Date() + } +]) // 列表的数据 const getList = async () => { loading.value = true try { @@ -60,7 +77,22 @@ const getList = async () => { loading.value = false } } - +/** + * 获得权限级别名称 + * @param level 权限级别 + */ +const getLevelName = computed(() => (level: number) => { + switch (level) { + case CrmPermissionLevelEnum.OWNER: + return '负责人' + case CrmPermissionLevelEnum.READ: + return '只读' + case CrmPermissionLevelEnum.WRITE: + return '读写' + default: + break + } +}) const multipleSelection = ref([]) const handleSelectionChange = (val: PermissionApi.PermissionVO[]) => { multipleSelection.value = val From 22206b25e1357e6f69a4d027d130544affcc3b04 Mon Sep 17 00:00:00 2001 From: Wanwan <913752709@qq.com> Date: Wed, 15 Nov 2023 21:55:44 +0800 Subject: [PATCH 18/22] =?UTF-8?q?feat:=20CRM=20=E5=AE=A2=E6=88=B7=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../crm/customerLimitConfig/CustomerLimitConfDetails.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/crm/customerLimitConfig/CustomerLimitConfDetails.vue b/src/views/crm/customerLimitConfig/CustomerLimitConfDetails.vue index dd31961e..01b7fbbb 100644 --- a/src/views/crm/customerLimitConfig/CustomerLimitConfDetails.vue +++ b/src/views/crm/customerLimitConfig/CustomerLimitConfDetails.vue @@ -89,6 +89,8 @@ defineOptions({ name: 'CustomerLimitConfDetails' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 +const { confType } = defineProps<{ confType: LimitConfType }>() + const loading = ref(true) // 列表的加载中 const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数据 @@ -131,8 +133,6 @@ const handleDelete = async (id: number) => { } catch {} } -const { confType } = defineProps<{ confType: LimitConfType }>() - /** 搜索按钮操作 */ const handleQuery = () => { queryParams.pageNo = 1 From b4a177258467e3a08c33524e50c80b46eaca5215 Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 17 Nov 2023 10:14:26 +0800 Subject: [PATCH 19/22] =?UTF-8?q?=E8=90=A5=E9=94=80=EF=BC=9A=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=95=86=E5=9F=8E=E8=A3=85=E4=BF=AE=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E3=80=90=E5=95=86=E5=93=81=E5=8D=A1=E7=89=87=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/mobile/MagicCube/config.ts | 2 +- .../components/mobile/ProductCard/config.ts | 97 ++++++++++ .../components/mobile/ProductCard/index.vue | 165 ++++++++++++++++++ .../mobile/ProductCard/property.vue | 149 ++++++++++++++++ .../product/spu/components/SpuShowcase.vue | 126 +++++++++++++ 5 files changed, 538 insertions(+), 1 deletion(-) create mode 100644 src/components/DiyEditor/components/mobile/ProductCard/config.ts create mode 100644 src/components/DiyEditor/components/mobile/ProductCard/index.vue create mode 100644 src/components/DiyEditor/components/mobile/ProductCard/property.vue create mode 100644 src/views/mall/product/spu/components/SpuShowcase.vue diff --git a/src/components/DiyEditor/components/mobile/MagicCube/config.ts b/src/components/DiyEditor/components/mobile/MagicCube/config.ts index ce5d21a3..bd3120bb 100644 --- a/src/components/DiyEditor/components/mobile/MagicCube/config.ts +++ b/src/components/DiyEditor/components/mobile/MagicCube/config.ts @@ -33,7 +33,7 @@ export interface MagicCubeItemProperty { export const component = { id: 'MagicCube', name: '广告魔方', - icon: 'fluent:puzzle-cube-piece-20-filled', + icon: 'bi:columns', property: { borderRadiusTop: 0, borderRadiusBottom: 0, diff --git a/src/components/DiyEditor/components/mobile/ProductCard/config.ts b/src/components/DiyEditor/components/mobile/ProductCard/config.ts new file mode 100644 index 00000000..49dd30d0 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/ProductCard/config.ts @@ -0,0 +1,97 @@ +import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util' + +/** 商品卡片属性 */ +export interface ProductCardProperty { + // 布局类型:单列大图 | 单列小图 | 双列 + layoutType: 'oneColBigImg' | 'oneColSmallImg' | 'twoCol' + // 商品字段 + fields: { + // 商品名称 + name: ProductCardFieldProperty + // 商品简介 + introduction: ProductCardFieldProperty + // 商品价格 + price: ProductCardFieldProperty + // 商品市场价 + marketPrice: ProductCardFieldProperty + // 商品销量 + salesCount: ProductCardFieldProperty + // 商品库存 + stock: ProductCardFieldProperty + } + // 角标 + badge: { + // 是否显示 + show: boolean + // 角标图片 + imgUrl: string + } + // 按钮 + btnBuy: { + // 类型:文字 | 图片 + type: 'text' | 'img' + // 文字 + text: string + // 文字按钮:背景渐变起始颜色 + bgBeginColor: string + // 文字按钮:背景渐变结束颜色 + bgEndColor: string + // 图片按钮:图片地址 + imgUrl: string + } + // 上圆角 + borderRadiusTop: number + // 下圆角 + borderRadiusBottom: number + // 间距 + space: number + // 商品编号列表 + spuIds: number[] + // 组件样式 + style: ComponentStyle +} +// 商品字段 +export interface ProductCardFieldProperty { + // 是否显示 + show: boolean + // 颜色 + color: string +} + +// 定义组件 +export const component = { + id: 'ProductCard', + name: '商品卡片', + icon: 'system-uicons:carousel', + property: { + layoutType: 'oneColBigImg', + fields: { + name: { show: true, color: '#000' }, + introduction: { show: true, color: '#999' }, + price: { show: true, color: '#ff3000' }, + marketPrice: { show: true, color: '#c4c4c4' }, + salesCount: { show: true, color: '#c4c4c4' }, + stock: { show: false, color: '#c4c4c4' } + }, + badge: { show: false, imgUrl: '' }, + btnBuy: { + type: 'text', + text: '立即购买', + // todo: @owen 根据主题色配置 + bgBeginColor: '#FF6000', + bgEndColor: '#FE832A', + imgUrl: '' + }, + borderRadiusTop: 8, + borderRadiusBottom: 8, + space: 8, + spuIds: [], + style: { + bgType: 'color', + bgColor: '', + marginLeft: 8, + marginRight: 8, + marginBottom: 8 + } as ComponentStyle + } +} as DiyComponent diff --git a/src/components/DiyEditor/components/mobile/ProductCard/index.vue b/src/components/DiyEditor/components/mobile/ProductCard/index.vue new file mode 100644 index 00000000..a6894ed9 --- /dev/null +++ b/src/components/DiyEditor/components/mobile/ProductCard/index.vue @@ -0,0 +1,165 @@ + + + + diff --git a/src/components/DiyEditor/components/mobile/ProductCard/property.vue b/src/components/DiyEditor/components/mobile/ProductCard/property.vue new file mode 100644 index 00000000..cfa5008b --- /dev/null +++ b/src/components/DiyEditor/components/mobile/ProductCard/property.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/src/views/mall/product/spu/components/SpuShowcase.vue b/src/views/mall/product/spu/components/SpuShowcase.vue new file mode 100644 index 00000000..a3f16fba --- /dev/null +++ b/src/views/mall/product/spu/components/SpuShowcase.vue @@ -0,0 +1,126 @@ + + + + From 85e953b920891cd25c1dc886586bd6bcae47af7e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 18 Nov 2023 21:08:00 +0800 Subject: [PATCH 20/22] =?UTF-8?q?crm=EF=BC=9Acode=20review=20=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/crm/contact/ContactForm.vue | 15 ++++++++++----- src/views/crm/contact/OwerSelect.vue | 1 + src/views/crm/contact/detail/ContactBasicInfo.vue | 3 ++- src/views/crm/contact/detail/ContactDetails.vue | 1 + src/views/crm/contact/detail/index.vue | 2 ++ src/views/crm/contact/index.vue | 8 +++++++- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/views/crm/contact/ContactForm.vue b/src/views/crm/contact/ContactForm.vue index 94d50299..68d0030b 100644 --- a/src/views/crm/contact/ContactForm.vue +++ b/src/views/crm/contact/ContactForm.vue @@ -28,6 +28,7 @@ /> + - @@ -212,6 +212,7 @@ const formRules = reactive({ const formRef = ref() // 表单 Ref const ownerUserList = ref([]) const userList = ref([]) // 用户列表 + /** 打开弹窗 */ const open = async (type: string, id?: number) => { dialogVisible.value = true @@ -231,6 +232,8 @@ const open = async (type: string, id?: number) => { } } } +defineExpose({ open }) // 提供 open 方法,用于打开弹窗 + /** 查询列表 */ const getList = async () => { loading.value = true @@ -242,7 +245,7 @@ const getList = async () => { loading.value = false } } -defineExpose({ open }) // 提供 open 方法,用于打开弹窗 + const gotOwnerUser = (owerUserId: any) => { if (owerUserId !== null) { owerUserId.split(',').forEach((item: string) => { @@ -254,6 +257,7 @@ const gotOwnerUser = (owerUserId: any) => { }) } } + /** 提交表单 */ const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { @@ -305,12 +309,13 @@ const resetForm = () => { formRef.value?.resetFields() ownerUserList.value = [] } + /** 添加/修改操作 */ +// TODO @zyna:owner?拼写要注意哈; const owerRef = ref() const openOwerForm = (type: string) => { owerRef.value.open(type, ownerUserList.value) } - const owerSelectValue = (value) => { ownerUserList.value = value.value formData.value.ownerUserId = undefined @@ -322,7 +327,7 @@ const owerSelectValue = (value) => { } }) } -//选择客户 +// 选择客户 const showCustomer = ref(false) const openCustomerSelect = () => { showCustomer.value = !showCustomer.value @@ -341,7 +346,7 @@ const selectCustomer = () => { formData.value.customerName = multipleSelection.value.name showCustomer.value = !showCustomer.value } -const allContactList = ref([]) //所有联系人列表 +const allContactList = ref([]) // 所有联系人列表 onMounted(async () => { allContactList.value = await ContactApi.simpleAlllist() }) diff --git a/src/views/crm/contact/OwerSelect.vue b/src/views/crm/contact/OwerSelect.vue index 83dd143b..5ed0fe50 100644 --- a/src/views/crm/contact/OwerSelect.vue +++ b/src/views/crm/contact/OwerSelect.vue @@ -18,6 +18,7 @@ - diff --git a/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue b/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue index 006c1349..880106f0 100644 --- a/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue +++ b/src/views/crm/customerLimitConfig/CustomerLimitConfigForm.vue @@ -83,6 +83,7 @@ const formRules = reactive({ maxCount: [{ required: true, message: '数量上限不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref +// TODO @芋艿:看看怎么搞个部门选择组件 const deptTree = ref() // 部门树形结构 const userTree = ref() // 用户树形结构 @@ -179,6 +180,7 @@ const getUserTree = async () => { handleUserData(userTree.value, deptUserMap) } +// TODO @芋艿:看看怎么搞个用户选择的组件 /** * 处理用户树 * diff --git a/src/views/crm/customerLimitConfig/customerLimitConf.ts b/src/views/crm/customerLimitConfig/customerLimitConf.ts index 188e6ef4..1336e137 100644 --- a/src/views/crm/customerLimitConfig/customerLimitConf.ts +++ b/src/views/crm/customerLimitConfig/customerLimitConf.ts @@ -1,3 +1,4 @@ +// TODO 可以挪到它对应的 api.ts 文件里哈 /** * 客户限制配置类型 */ diff --git a/src/views/crm/customerLimitConfig/index.vue b/src/views/crm/customerLimitConfig/index.vue index 48f2eac2..1bccf4d3 100644 --- a/src/views/crm/customerLimitConfig/index.vue +++ b/src/views/crm/customerLimitConfig/index.vue @@ -1,8 +1,9 @@ - diff --git a/src/views/crm/components/CrmTeamList.vue b/src/views/crm/components/CrmTeamList.vue index f7591f6a..568777f6 100644 --- a/src/views/crm/components/CrmTeamList.vue +++ b/src/views/crm/components/CrmTeamList.vue @@ -38,6 +38,7 @@