Skip to content

Commit 4423e9b

Browse files
YunaiVgitee-org
authored andcommitted
!326 CRM 客户最新的代码
Merge pull request !326 from 芋道源码/dev
2 parents 9d7c578 + ebb19cf commit 4423e9b

File tree

46 files changed

+2926
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2926
-183
lines changed

build/vite/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,11 @@ export function createVitePlugins() {
6060
}
6161
}),
6262
Components({
63-
// 要搜索组件的目录的相对路径
64-
dirs: ['src/components'],
65-
// 组件的有效文件扩展名
66-
extensions: ['vue', 'md'],
67-
// 搜索子目录
68-
deep: true,
69-
include: [/\.vue$/, /\.vue\?vue/],
7063
// 生成自定义 `auto-components.d.ts` 全局声明
7164
dts: 'src/types/auto-components.d.ts',
7265
// 自定义组件的解析器
7366
resolvers: [ElementPlusResolver()],
74-
exclude: [/[\\/]node_modules[\\/]/]
67+
globs: ["src/components/**/**.{vue, md}", '!src/components/DiyEditor/components/mobile/**']
7568
}),
7669
EslintPlugin({
7770
cache: false,
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import request from '@/config/axios'
2+
3+
export interface CustomerLimitConfigVO {
4+
id?: number
5+
type?: number
6+
userIds?: string
7+
deptIds?: string
8+
maxCount?: number
9+
dealCountEnabled?: boolean
10+
}
11+
12+
// 查询客户限制配置列表
13+
export const getCustomerLimitConfigPage = async (params) => {
14+
return await request.get({ url: `/crm/customer-limit-config/page`, params })
15+
}
16+
17+
// 查询客户限制配置详情
18+
export const getCustomerLimitConfig = async (id: number) => {
19+
return await request.get({ url: `/crm/customer-limit-config/get?id=` + id })
20+
}
21+
22+
// 新增客户限制配置
23+
export const createCustomerLimitConfig = async (data: CustomerLimitConfigVO) => {
24+
return await request.post({ url: `/crm/customer-limit-config/create`, data })
25+
}
26+
27+
// 修改客户限制配置
28+
export const updateCustomerLimitConfig = async (data: CustomerLimitConfigVO) => {
29+
return await request.put({ url: `/crm/customer-limit-config/update`, data })
30+
}
31+
32+
// 删除客户限制配置
33+
export const deleteCustomerLimitConfig = async (id: number) => {
34+
return await request.delete({ url: `/crm/customer-limit-config/delete?id=` + id })
35+
}

src/api/crm/customerPoolConf/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import request from '@/config/axios'
2+
3+
export interface CustomerPoolConfigVO {
4+
enabled?: boolean
5+
contactExpireDays?: number
6+
dealExpireDays?: number
7+
notifyEnabled?: boolean
8+
notifyDays: number
9+
}
10+
11+
// 获取客户公海规则设置
12+
export const getCustomerPoolConfig = async () => {
13+
return await request.get({ url: `/crm/customer-pool-config/get` })
14+
}
15+
16+
// 更新客户公海规则设置
17+
export const updateCustomerPoolConfig = async (data: ConfigVO) => {
18+
return await request.put({ url: `/crm/customer-pool-config/update`, data })
19+
}

src/api/crm/permission/index.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import request from '@/config/axios'
2+
3+
export interface PermissionVO {
4+
id?: number // 数据权限编号
5+
userId: number | undefined // 用户编号
6+
bizType: number | undefined // Crm 类型
7+
bizId: number | undefined // Crm 类型数据编号
8+
level: number | undefined // 权限级别
9+
deptName?: string // 部门名称 // 岗位名称数组 TODO @puhui999:数组?
10+
nickname?: string // 用户昵称
11+
postNames?: string // 岗位名称数组 TODO @puhui999:数组?
12+
createTime?: Date
13+
}
14+
15+
// 查询团队成员列表
16+
export const getPermissionList = async (params) => {
17+
return await request.get({ url: `/crm/permission/list`, params })
18+
}
19+
20+
// 新增团队成员
21+
export const createPermission = async (data: PermissionVO) => {
22+
return await request.post({ url: `/crm/permission/add`, data })
23+
}
24+
25+
// 修改团队成员权限级别
26+
export const updatePermission = async (data) => {
27+
return await request.put({ url: `/crm/permission/update`, data })
28+
}
29+
30+
// 删除团队成员
31+
export const deletePermission = async (params) => {
32+
return await request.delete({ url: '/crm/permission/delete', params })
33+
}
34+
35+
// 退出团队
36+
export const quitTeam = async (id) => {
37+
return await request.delete({ url: '/crm/permission/quit-team?id=' + id })
38+
}
39+
40+
// 领取公海数据
41+
export const receive = async (data: { bizType: number; bizId: number }) => {
42+
return await request.put({ url: `/crm/permission/receive`, data })
43+
}
44+
45+
// 数据放入公海
46+
export const putPool = async (data: { bizType: number; bizId: number }) => {
47+
return await request.put({ url: `/crm/permission/put-pool`, data })
48+
}

src/api/system/user/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export const getUserPage = (params: PageParam) => {
2222
return request.get({ url: '/system/user/page', params })
2323
}
2424

25+
// 查询所有用户列表
26+
export const getAllUser = () => {
27+
return request.get({ url: '/system/user/all' })
28+
}
29+
2530
// 查询用户详情
2631
export const getUser = (id: number) => {
2732
return request.get({ url: '/system/user/get?id=' + id })

src/components/ColorInput/index.vue

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,18 @@
11
<template>
22
<el-input v-model="color">
33
<template #prepend>
4-
<el-color-picker v-model="color" :predefine="COLORS" />
4+
<el-color-picker v-model="color" :predefine="PREDEFINE_COLORS" />
55
</template>
66
</el-input>
77
</template>
88

99
<script setup lang="ts">
1010
import { propTypes } from '@/utils/propTypes'
11+
import { PREDEFINE_COLORS } from '@/utils/color'
1112
1213
// 颜色输入框
1314
defineOptions({ name: 'ColorInput' })
1415
15-
// 预设颜色
16-
const COLORS = [
17-
'#ff4500',
18-
'#ff8c00',
19-
'#ffd700',
20-
'#90ee90',
21-
'#00ced1',
22-
'#1e90ff',
23-
'#c71585',
24-
'#409EFF',
25-
'#909399',
26-
'#C0C4CC',
27-
'#b7390b',
28-
'#ff7800',
29-
'#fad400',
30-
'#5b8c5f',
31-
'#00babd',
32-
'#1f73c3',
33-
'#711f57'
34-
]
35-
3616
const props = defineProps({
3717
modelValue: propTypes.string.def('')
3818
})
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
2+
3+
/** 广告魔方属性 */
4+
export interface MagicCubeProperty {
5+
// 上圆角
6+
borderRadiusTop: number
7+
// 下圆角
8+
borderRadiusBottom: number
9+
// 间隔
10+
space: number
11+
// 导航菜单列表
12+
list: MagicCubeItemProperty[]
13+
// 组件样式
14+
style: ComponentStyle
15+
}
16+
/** 广告魔方项目属性 */
17+
export interface MagicCubeItemProperty {
18+
// 图标链接
19+
imgUrl: string
20+
// 链接
21+
url: string
22+
// 宽
23+
width: number
24+
// 高
25+
height: number
26+
// 上
27+
top: number
28+
// 左
29+
left: number
30+
}
31+
32+
// 定义组件
33+
export const component = {
34+
id: 'MagicCube',
35+
name: '广告魔方',
36+
icon: 'bi:columns',
37+
property: {
38+
borderRadiusTop: 0,
39+
borderRadiusBottom: 0,
40+
space: 0,
41+
list: [],
42+
style: {
43+
bgType: 'color',
44+
bgColor: '#fff',
45+
marginBottom: 8
46+
} as ComponentStyle
47+
}
48+
} as DiyComponent<MagicCubeProperty>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<template>
2+
<div
3+
class="relative"
4+
:style="{ height: `${rowCount * CUBE_SIZE}px`, width: `${4 * CUBE_SIZE}px` }"
5+
>
6+
<div
7+
v-for="(item, index) in property.list"
8+
:key="index"
9+
class="absolute"
10+
:style="{
11+
width: `${item.width * CUBE_SIZE - property.space * 2}px`,
12+
height: `${item.height * CUBE_SIZE - property.space * 2}px`,
13+
margin: `${property.space}px`,
14+
top: `${item.top * CUBE_SIZE}px`,
15+
left: `${item.left * CUBE_SIZE}px`
16+
}"
17+
>
18+
<el-image
19+
class="h-full w-full"
20+
fit="cover"
21+
:src="item.imgUrl"
22+
:style="{
23+
borderTopLeftRadius: `${property.borderRadiusTop}px`,
24+
borderTopRightRadius: `${property.borderRadiusTop}px`,
25+
borderBottomLeftRadius: `${property.borderRadiusBottom}px`,
26+
borderBottomRightRadius: `${property.borderRadiusBottom}px`
27+
}"
28+
>
29+
<template #error>
30+
<div class="image-slot">
31+
<div
32+
class="flex items-center justify-center"
33+
:style="{
34+
width: `${item.width * CUBE_SIZE}px`,
35+
height: `${item.height * CUBE_SIZE}px`
36+
}"
37+
>
38+
<Icon icon="ep-picture" color="gray" :size="CUBE_SIZE" />
39+
</div>
40+
</div>
41+
</template>
42+
</el-image>
43+
</div>
44+
</div>
45+
</template>
46+
47+
<script setup lang="ts">
48+
import { MagicCubeProperty } from './config'
49+
50+
/** 广告魔方 */
51+
defineOptions({ name: 'MagicCube' })
52+
const props = defineProps<{ property: MagicCubeProperty }>()
53+
// 一个方块的大小
54+
const CUBE_SIZE = 93.75
55+
/**
56+
* 计算方块的行数
57+
* 行数用于计算魔方的总体高度,存在以下情况:
58+
* 1. 没有数据时,默认就只显示一行的高度
59+
* 2. 底部的空白不算高度,例如只有第一行有数据,那么就只显示一行的高度
60+
* 3. 顶部及中间的空白算高度,例如一共有四行,只有最后一行有数据,那么也显示四行的高度
61+
*/
62+
const rowCount = computed(() => {
63+
let count = 0
64+
if (props.property.list.length > 0) {
65+
// 最大行号
66+
count = Math.max(...props.property.list.map((item) => item.bottom))
67+
}
68+
// 行号从 0 开始,所以加 1
69+
return count + 1
70+
})
71+
</script>
72+
73+
<style scoped lang="scss"></style>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<template>
2+
<ComponentContainerProperty v-model="formData.style">
3+
<!-- 表单 -->
4+
<el-form label-width="80px" :model="formData" class="m-t-8px">
5+
<el-text tag="p"> 魔方设置 </el-text>
6+
<el-text type="info" size="small"> 每格尺寸187 * 187 </el-text>
7+
<MagicCubeEditor
8+
class="m-y-16px"
9+
v-model="formData.list"
10+
:rows="4"
11+
:cols="4"
12+
@hot-area-selected="handleHotAreaSelected"
13+
/>
14+
<template v-for="(hotArea, index) in formData.list" :key="index">
15+
<template v-if="selectedHotAreaIndex === index">
16+
<el-form-item label="上传图片" :prop="`list[${index}].imgUrl`">
17+
<UploadImg v-model="hotArea.imgUrl" height="80px" width="80px" />
18+
</el-form-item>
19+
<el-form-item label="链接" :prop="`list[${index}].url`">
20+
<el-input v-model="hotArea.url" placeholder="请输入链接" />
21+
</el-form-item>
22+
</template>
23+
</template>
24+
<el-form-item label="上圆角" prop="borderRadiusTop">
25+
<el-slider
26+
v-model="formData.borderRadiusTop"
27+
:max="100"
28+
:min="0"
29+
show-input
30+
input-size="small"
31+
:show-input-controls="false"
32+
/>
33+
</el-form-item>
34+
<el-form-item label="下圆角" prop="borderRadiusBottom">
35+
<el-slider
36+
v-model="formData.borderRadiusBottom"
37+
:max="100"
38+
:min="0"
39+
show-input
40+
input-size="small"
41+
:show-input-controls="false"
42+
/>
43+
</el-form-item>
44+
<el-form-item label="间隔" prop="space">
45+
<el-slider
46+
v-model="formData.space"
47+
:max="100"
48+
:min="0"
49+
show-input
50+
input-size="small"
51+
:show-input-controls="false"
52+
/>
53+
</el-form-item>
54+
</el-form>
55+
</ComponentContainerProperty>
56+
</template>
57+
58+
<script setup lang="ts">
59+
import { usePropertyForm } from '@/components/DiyEditor/util'
60+
import { MagicCubeProperty } from '@/components/DiyEditor/components/mobile/MagicCube/config'
61+
62+
/** 广告魔方属性面板 */
63+
defineOptions({ name: 'MagicCubeProperty' })
64+
65+
const props = defineProps<{ modelValue: MagicCubeProperty }>()
66+
const emit = defineEmits(['update:modelValue'])
67+
const { formData } = usePropertyForm(props.modelValue, emit)
68+
69+
// 选中的热区
70+
const selectedHotAreaIndex = ref(-1)
71+
const handleHotAreaSelected = (_: any, index: number) => {
72+
selectedHotAreaIndex.value = index
73+
}
74+
</script>
75+
76+
<style scoped lang="scss"></style>

0 commit comments

Comments
 (0)