commit
4423e9b804
@ -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 })
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface CustomerPoolConfigVO {
|
||||||
|
enabled?: boolean
|
||||||
|
contactExpireDays?: number
|
||||||
|
dealExpireDays?: number
|
||||||
|
notifyEnabled?: boolean
|
||||||
|
notifyDays: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取客户公海规则设置
|
||||||
|
export const getCustomerPoolConfig = async () => {
|
||||||
|
return await request.get({ url: `/crm/customer-pool-config/get` })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新客户公海规则设置
|
||||||
|
export const updateCustomerPoolConfig = async (data: ConfigVO) => {
|
||||||
|
return await request.put({ url: `/crm/customer-pool-config/update`, data })
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
|
||||||
|
|
||||||
|
/** 广告魔方属性 */
|
||||||
|
export interface MagicCubeProperty {
|
||||||
|
// 上圆角
|
||||||
|
borderRadiusTop: number
|
||||||
|
// 下圆角
|
||||||
|
borderRadiusBottom: number
|
||||||
|
// 间隔
|
||||||
|
space: number
|
||||||
|
// 导航菜单列表
|
||||||
|
list: MagicCubeItemProperty[]
|
||||||
|
// 组件样式
|
||||||
|
style: ComponentStyle
|
||||||
|
}
|
||||||
|
/** 广告魔方项目属性 */
|
||||||
|
export interface MagicCubeItemProperty {
|
||||||
|
// 图标链接
|
||||||
|
imgUrl: string
|
||||||
|
// 链接
|
||||||
|
url: string
|
||||||
|
// 宽
|
||||||
|
width: number
|
||||||
|
// 高
|
||||||
|
height: number
|
||||||
|
// 上
|
||||||
|
top: number
|
||||||
|
// 左
|
||||||
|
left: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义组件
|
||||||
|
export const component = {
|
||||||
|
id: 'MagicCube',
|
||||||
|
name: '广告魔方',
|
||||||
|
icon: 'bi:columns',
|
||||||
|
property: {
|
||||||
|
borderRadiusTop: 0,
|
||||||
|
borderRadiusBottom: 0,
|
||||||
|
space: 0,
|
||||||
|
list: [],
|
||||||
|
style: {
|
||||||
|
bgType: 'color',
|
||||||
|
bgColor: '#fff',
|
||||||
|
marginBottom: 8
|
||||||
|
} as ComponentStyle
|
||||||
|
}
|
||||||
|
} as DiyComponent<MagicCubeProperty>
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
<template>
|
||||||
|
<ComponentContainerProperty v-model="formData.style">
|
||||||
|
<!-- 表单 -->
|
||||||
|
<el-form label-width="80px" :model="formData" class="m-t-8px">
|
||||||
|
<el-text tag="p"> 魔方设置 </el-text>
|
||||||
|
<el-text type="info" size="small"> 每格尺寸187 * 187 </el-text>
|
||||||
|
<MagicCubeEditor
|
||||||
|
class="m-y-16px"
|
||||||
|
v-model="formData.list"
|
||||||
|
:rows="4"
|
||||||
|
:cols="4"
|
||||||
|
@hot-area-selected="handleHotAreaSelected"
|
||||||
|
/>
|
||||||
|
<template v-for="(hotArea, index) in formData.list" :key="index">
|
||||||
|
<template v-if="selectedHotAreaIndex === index">
|
||||||
|
<el-form-item label="上传图片" :prop="`list[${index}].imgUrl`">
|
||||||
|
<UploadImg v-model="hotArea.imgUrl" height="80px" width="80px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="链接" :prop="`list[${index}].url`">
|
||||||
|
<el-input v-model="hotArea.url" placeholder="请输入链接" />
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<el-form-item label="上圆角" prop="borderRadiusTop">
|
||||||
|
<el-slider
|
||||||
|
v-model="formData.borderRadiusTop"
|
||||||
|
:max="100"
|
||||||
|
:min="0"
|
||||||
|
show-input
|
||||||
|
input-size="small"
|
||||||
|
:show-input-controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="下圆角" prop="borderRadiusBottom">
|
||||||
|
<el-slider
|
||||||
|
v-model="formData.borderRadiusBottom"
|
||||||
|
:max="100"
|
||||||
|
:min="0"
|
||||||
|
show-input
|
||||||
|
input-size="small"
|
||||||
|
:show-input-controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="间隔" prop="space">
|
||||||
|
<el-slider
|
||||||
|
v-model="formData.space"
|
||||||
|
:max="100"
|
||||||
|
:min="0"
|
||||||
|
show-input
|
||||||
|
input-size="small"
|
||||||
|
:show-input-controls="false"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ComponentContainerProperty>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { usePropertyForm } from '@/components/DiyEditor/util'
|
||||||
|
import { MagicCubeProperty } from '@/components/DiyEditor/components/mobile/MagicCube/config'
|
||||||
|
|
||||||
|
/** 广告魔方属性面板 */
|
||||||
|
defineOptions({ name: 'MagicCubeProperty' })
|
||||||
|
|
||||||
|
const props = defineProps<{ modelValue: MagicCubeProperty }>()
|
||||||
|
const emit = defineEmits(['update:modelValue'])
|
||||||
|
const { formData } = usePropertyForm(props.modelValue, emit)
|
||||||
|
|
||||||
|
// 选中的热区
|
||||||
|
const selectedHotAreaIndex = ref(-1)
|
||||||
|
const handleHotAreaSelected = (_: any, index: number) => {
|
||||||
|
selectedHotAreaIndex.value = index
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@ -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: 'bi:grid-3x3-gap',
|
||||||
|
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<MenuGridProperty>
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
<template>
|
||||||
|
<div class="flex flex-row flex-wrap">
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in property.list"
|
||||||
|
:key="index"
|
||||||
|
class="relative flex flex-col items-center p-b-14px p-t-20px"
|
||||||
|
:style="{ width: `${100 * (1 / property.column)}%` }"
|
||||||
|
>
|
||||||
|
<!-- 右上角角标 -->
|
||||||
|
<span
|
||||||
|
v-if="item.badge?.show"
|
||||||
|
class="absolute left-50% top-10px z-1 h-20px rounded-50% p-x-6px text-center text-12px leading-20px"
|
||||||
|
:style="{ color: item.badge.textColor, backgroundColor: item.badge.bgColor }"
|
||||||
|
>
|
||||||
|
{{ item.badge.text }}
|
||||||
|
</span>
|
||||||
|
<el-image v-if="item.iconUrl" class="h-28px w-28px" :src="item.iconUrl" />
|
||||||
|
<span class="m-t-8px h-16px text-12px leading-16px" :style="{ color: item.titleColor }">
|
||||||
|
{{ item.title }}
|
||||||
|
</span>
|
||||||
|
<span class="m-t-6px h-12px text-10px leading-12px" :style="{ color: item.subtitleColor }">
|
||||||
|
{{ item.subtitle }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { MenuGridProperty } from './config'
|
||||||
|
/** 宫格导航 */
|
||||||
|
defineOptions({ name: 'MenuGrid' })
|
||||||
|
defineProps<{ property: MenuGridProperty }>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
|
||||||
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
|
/** 列表导航属性 */
|
||||||
|
export interface MenuListProperty {
|
||||||
|
// 导航菜单列表
|
||||||
|
list: MenuListItemProperty[]
|
||||||
|
// 组件样式
|
||||||
|
style: ComponentStyle
|
||||||
|
}
|
||||||
|
/** 列表导航项目属性 */
|
||||||
|
export interface MenuListItemProperty {
|
||||||
|
// 图标链接
|
||||||
|
iconUrl: string
|
||||||
|
// 标题
|
||||||
|
title: string
|
||||||
|
// 标题颜色
|
||||||
|
titleColor: string
|
||||||
|
// 副标题
|
||||||
|
subtitle: string
|
||||||
|
// 副标题颜色
|
||||||
|
subtitleColor: string
|
||||||
|
// 链接
|
||||||
|
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: [cloneDeep(EMPTY_MENU_LIST_ITEM_PROPERTY)],
|
||||||
|
style: {
|
||||||
|
bgType: 'color',
|
||||||
|
bgColor: '#fff',
|
||||||
|
marginBottom: 8
|
||||||
|
} as ComponentStyle
|
||||||
|
}
|
||||||
|
} as DiyComponent<MenuListProperty>
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
<template>
|
||||||
|
<div class="min-h-42px flex flex-col">
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in property.list"
|
||||||
|
:key="index"
|
||||||
|
class="item h-42px flex flex-row items-center justify-between gap-4px p-x-12px"
|
||||||
|
>
|
||||||
|
<div class="flex flex-1 flex-row items-center gap-8px">
|
||||||
|
<el-image v-if="item.iconUrl" class="h-16px w-16px" :src="item.iconUrl" />
|
||||||
|
<span class="text-16px" :style="{ color: item.titleColor }">{{ item.title }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="item-center flex flex-row justify-center gap-4px">
|
||||||
|
<span class="text-12px" :style="{ color: item.subtitleColor }">{{ item.subtitle }}</span>
|
||||||
|
<Icon icon="ep-arrow-right" color="#000" :size="16" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { MenuListProperty } from './config'
|
||||||
|
/** 列表导航 */
|
||||||
|
defineOptions({ name: 'MenuList' })
|
||||||
|
defineProps<{ property: MenuListProperty }>()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.item + .item {
|
||||||
|
border-top: 1px solid #eee;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
|
||||||
|
import { cloneDeep } from 'lodash-es'
|
||||||
|
|
||||||
|
/** 菜单导航属性 */
|
||||||
|
export interface MenuSwiperProperty {
|
||||||
|
// 布局: 图标+文字 | 图标
|
||||||
|
layout: 'iconText' | 'icon'
|
||||||
|
// 行数
|
||||||
|
row: number
|
||||||
|
// 列数
|
||||||
|
column: number
|
||||||
|
// 导航菜单列表
|
||||||
|
list: MenuSwiperItemProperty[]
|
||||||
|
// 组件样式
|
||||||
|
style: ComponentStyle
|
||||||
|
}
|
||||||
|
/** 菜单导航项目属性 */
|
||||||
|
export interface MenuSwiperItemProperty {
|
||||||
|
// 图标链接
|
||||||
|
iconUrl: string
|
||||||
|
// 标题
|
||||||
|
title: string
|
||||||
|
// 标题颜色
|
||||||
|
titleColor: string
|
||||||
|
// 链接
|
||||||
|
url: string
|
||||||
|
// 角标
|
||||||
|
badge: {
|
||||||
|
// 是否显示
|
||||||
|
show: boolean
|
||||||
|
// 角标文字
|
||||||
|
text: string
|
||||||
|
// 角标文字颜色
|
||||||
|
textColor: string
|
||||||
|
// 角标背景颜色
|
||||||
|
bgColor: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const EMPTY_MENU_SWIPER_ITEM_PROPERTY = {
|
||||||
|
title: '标题',
|
||||||
|
titleColor: '#333',
|
||||||
|
badge: {
|
||||||
|
show: false,
|
||||||
|
textColor: '#fff',
|
||||||
|
bgColor: '#FF6000'
|
||||||
|
}
|
||||||
|
} as MenuSwiperItemProperty
|
||||||
|
|
||||||
|
// 定义组件
|
||||||
|
export const component = {
|
||||||
|
id: 'MenuSwiper',
|
||||||
|
name: '菜单导航',
|
||||||
|
icon: 'bi:grid-3x2-gap',
|
||||||
|
property: {
|
||||||
|
layout: 'iconText',
|
||||||
|
row: 1,
|
||||||
|
column: 3,
|
||||||
|
list: [cloneDeep(EMPTY_MENU_SWIPER_ITEM_PROPERTY)],
|
||||||
|
style: {
|
||||||
|
bgType: 'color',
|
||||||
|
bgColor: '#fff',
|
||||||
|
marginBottom: 8
|
||||||
|
} as ComponentStyle
|
||||||
|
}
|
||||||
|
} as DiyComponent<MenuSwiperProperty>
|
||||||
@ -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<ProductCardProperty>
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<el-input v-model="valueRef" v-bind="$attrs">
|
||||||
|
<template #append>
|
||||||
|
<el-color-picker v-model="colorRef" :predefine="PREDEFINE_COLORS" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { propTypes } from '@/utils/propTypes'
|
||||||
|
import { PREDEFINE_COLORS } from '@/utils/color'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带颜色选择器输入框
|
||||||
|
*/
|
||||||
|
defineOptions({ name: 'InputWithColor' })
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: propTypes.string.def('').isRequired,
|
||||||
|
color: propTypes.string.def('').isRequired
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
(val: string) => {
|
||||||
|
if (val === unref(valueRef)) return
|
||||||
|
valueRef.value = val
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue', 'update:color'])
|
||||||
|
|
||||||
|
// 输入框的值
|
||||||
|
const valueRef = ref(props.modelValue)
|
||||||
|
watch(
|
||||||
|
() => valueRef.value,
|
||||||
|
(val: string) => {
|
||||||
|
emit('update:modelValue', val)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
// 颜色
|
||||||
|
const colorRef = ref(props.color)
|
||||||
|
watch(
|
||||||
|
() => colorRef.value,
|
||||||
|
(val: string) => {
|
||||||
|
emit('update:color', val)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
:deep(.el-input-group__append) {
|
||||||
|
padding: 0;
|
||||||
|
.el-color-picker__trigger {
|
||||||
|
padding: 0;
|
||||||
|
border-left: none;
|
||||||
|
border-radius: 0 var(--el-input-border-radius) var(--el-input-border-radius) 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
import CrmTeam from './CrmTeamList.vue'
|
||||||
|
|
||||||
|
enum CrmBizTypeEnum {
|
||||||
|
CRM_LEADS = 1, // 线索
|
||||||
|
CRM_CUSTOMER = 2, // 客户
|
||||||
|
CRM_CONTACTS = 3, // 联系人
|
||||||
|
CRM_BUSINESS = 5, // 商机
|
||||||
|
CRM_CONTRACT = 6 // 合同
|
||||||
|
}
|
||||||
|
|
||||||
|
enum CrmPermissionLevelEnum {
|
||||||
|
OWNER = 1, // 负责人
|
||||||
|
READ = 2, // 读
|
||||||
|
WRITE = 3 // 写
|
||||||
|
}
|
||||||
|
|
||||||
|
export { CrmTeam, CrmBizTypeEnum, CrmPermissionLevelEnum }
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
// TODO 可以挪到它对应的 api.ts 文件里哈
|
||||||
|
/**
|
||||||
|
* 客户限制配置类型
|
||||||
|
*/
|
||||||
|
export enum LimitConfType {
|
||||||
|
/**
|
||||||
|
* 拥有客户数限制
|
||||||
|
*/
|
||||||
|
CUSTOMER_QUANTITY_LIMIT = 1,
|
||||||
|
/**
|
||||||
|
* 锁定客户数限制
|
||||||
|
*/
|
||||||
|
CUSTOMER_LOCK_LIMIT = 2
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue