fix(mall): 修复多端商城模块类型与组件兼容问题
- 修复商城统计时间参数、客服消息类型导入等类型错误 - 对齐 web-antd、web-ele、web-antdv-next 的商城促销组件类型定义 - 修复 DIY 装修、组合活动、积分活动、运费模板等组件兼容问题pull/359/MERGE
parent
f8fb3d881d
commit
f2a5bc522d
|
|
@ -7,7 +7,7 @@ import { requestClient } from '#/api/request';
|
||||||
export namespace MallTradeStatisticsApi {
|
export namespace MallTradeStatisticsApi {
|
||||||
/** 交易状况 Request */
|
/** 交易状况 Request */
|
||||||
export interface TradeTrendReqVO {
|
export interface TradeTrendReqVO {
|
||||||
times: [Date, Date];
|
times?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 交易统计 Response */
|
/** 交易统计 Response */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { MallBannerApi } from '#/api/mall/promotion/banner';
|
import type { MallBannerApi } from '#/api/mall/promotion/banner';
|
||||||
import type { SystemUserApi } from '#/api/system/user';
|
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
|
|
@ -19,7 +18,7 @@ import { $t } from '#/locales';
|
||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<SystemUserApi.User>();
|
const formData = ref<MallBannerApi.Banner>();
|
||||||
const getTitle = computed(() => {
|
const getTitle = computed(() => {
|
||||||
return formData.value?.id
|
return formData.value?.id
|
||||||
? $t('ui.actionTitle.edit', ['Banner'])
|
? $t('ui.actionTitle.edit', ['Banner'])
|
||||||
|
|
|
||||||
|
|
@ -234,12 +234,10 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
>();
|
>();
|
||||||
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
|
.fullData as MallCombinationActivityApi.CombinationActivity[];
|
||||||
data.forEach((activity) => {
|
data.forEach((activity) => {
|
||||||
const row = tableData.find(
|
const row = tableData.find((item) => item.id === activity.id);
|
||||||
(item: MallCombinationActivityApi.CombinationActivity) =>
|
|
||||||
item.id === activity.id,
|
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setCheckboxRow(row, true);
|
gridApi.grid.setCheckboxRow(row, true);
|
||||||
}
|
}
|
||||||
|
|
@ -247,11 +245,9 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
}, 300);
|
}, 300);
|
||||||
} else if (!props.multiple && data && !Array.isArray(data)) {
|
} else if (!props.multiple && data && !Array.isArray(data)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
const row = tableData.find(
|
.fullData as MallCombinationActivityApi.CombinationActivity[];
|
||||||
(item: MallCombinationActivityApi.CombinationActivity) =>
|
const row = tableData.find((item) => item.id === data.id);
|
||||||
item.id === data.id,
|
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setRadioRow(row);
|
gridApi.grid.setRadioRow(row);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { Ref } from 'vue';
|
||||||
|
|
||||||
import type { ComponentStyle } from '../util';
|
import type { ComponentStyle } from '../util';
|
||||||
|
|
||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
|
|
@ -28,6 +30,7 @@ defineOptions({ name: 'ComponentContainer' });
|
||||||
const props = defineProps<{ modelValue: ComponentStyle }>();
|
const props = defineProps<{ modelValue: ComponentStyle }>();
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
const formData = useVModel(props, 'modelValue', emit);
|
const formData = useVModel(props, 'modelValue', emit);
|
||||||
|
const formStyleValues = formData as unknown as Ref<Record<string, number>>;
|
||||||
|
|
||||||
const treeData: any[] = [
|
const treeData: any[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -182,9 +185,7 @@ function handleSliderChange(prop: string) {
|
||||||
<Row>
|
<Row>
|
||||||
<Col :span="19">
|
<Col :span="19">
|
||||||
<Slider
|
<Slider
|
||||||
v-model:value="
|
v-model:value="formStyleValues[dataRef.prop]"
|
||||||
formData[dataRef.prop as keyof ComponentStyle]
|
|
||||||
"
|
|
||||||
:max="100"
|
:max="100"
|
||||||
:min="0"
|
:min="0"
|
||||||
@change="handleSliderChange(dataRef.prop)"
|
@change="handleSliderChange(dataRef.prop)"
|
||||||
|
|
@ -196,9 +197,7 @@ function handleSliderChange(prop: string) {
|
||||||
class="w-[50px]"
|
class="w-[50px]"
|
||||||
:max="100"
|
:max="100"
|
||||||
:min="0"
|
:min="0"
|
||||||
v-model:value="
|
v-model:value="formStyleValues[dataRef.prop]"
|
||||||
formData[dataRef.prop as keyof ComponentStyle]
|
|
||||||
"
|
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { StyleValue } from 'vue';
|
import type { CSSProperties } from 'vue';
|
||||||
|
|
||||||
import type { HotZoneItemProperty } from '../../config';
|
import type { HotZoneItemProperty } from '../../config';
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ export enum CONTROL_TYPE_ENUM {
|
||||||
export interface ControlDot {
|
export interface ControlDot {
|
||||||
position: string;
|
position: string;
|
||||||
types: CONTROL_TYPE_ENUM[];
|
types: CONTROL_TYPE_ENUM[];
|
||||||
style: StyleValue;
|
style: CSSProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 热区的 8 个控制点 */
|
/** 热区的 8 个控制点 */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { Rect } from '../../../../magic-cube-editor/util';
|
||||||
import type { ComponentStyle, DiyComponent } from '../../../util';
|
import type { ComponentStyle, DiyComponent } from '../../../util';
|
||||||
|
|
||||||
/** 广告魔方属性 */
|
/** 广告魔方属性 */
|
||||||
|
|
@ -10,13 +11,9 @@ export interface MagicCubeProperty {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 广告魔方项目属性 */
|
/** 广告魔方项目属性 */
|
||||||
export interface MagicCubeItemProperty {
|
export interface MagicCubeItemProperty extends Rect {
|
||||||
imgUrl: string; // 图标链接
|
imgUrl: string; // 图标链接
|
||||||
url: string; // 链接
|
url: string; // 链接
|
||||||
width: number; // 宽
|
|
||||||
height: number; // 高
|
|
||||||
top: number; // 上
|
|
||||||
left: number; // 左
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 定义组件 */
|
/** 定义组件 */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { Rect } from '../../../../magic-cube-editor/util';
|
||||||
import type { DiyComponent } from '../../../util';
|
import type { DiyComponent } from '../../../util';
|
||||||
|
|
||||||
/** 顶部导航栏属性 */
|
/** 顶部导航栏属性 */
|
||||||
|
|
@ -16,12 +17,8 @@ export interface NavigationBarProperty {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 顶部导航栏 - 单元格 属性 */
|
/** 顶部导航栏 - 单元格 属性 */
|
||||||
export interface NavigationBarCellProperty {
|
export interface NavigationBarCellProperty extends Rect {
|
||||||
type: 'image' | 'search' | 'text'; // 类型:文字 | 图片 | 搜索框
|
type: 'image' | 'search' | 'text'; // 类型:文字 | 图片 | 搜索框
|
||||||
width: number; // 宽度
|
|
||||||
height: number; // 高度
|
|
||||||
top: number; // 顶部位置
|
|
||||||
left: number; // 左侧位置
|
|
||||||
text: string; // 文字内容
|
text: string; // 文字内容
|
||||||
textColor: string; // 文字颜色
|
textColor: string; // 文字颜色
|
||||||
imgUrl: string; // 图片地址
|
imgUrl: string; // 图片地址
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ const emit = defineEmits(['update:modelValue']);
|
||||||
|
|
||||||
const formData = useVModel(props, 'modelValue', emit);
|
const formData = useVModel(props, 'modelValue', emit);
|
||||||
const rules = {
|
const rules = {
|
||||||
content: [{ required: true, message: '请输入公告', trigger: 'blur' }],
|
content: [{ required: true, message: '请输入公告', trigger: 'blur' as const }],
|
||||||
}; // 表单校验
|
}; // 表单校验
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ const emits = defineEmits(['reset', 'save', 'update:modelValue']); // 工具栏
|
||||||
// margin: 4,
|
// margin: 4,
|
||||||
// }); // 预览二维码
|
// }); // 预览二维码
|
||||||
|
|
||||||
const componentLibrary = ref(); // 左侧组件库
|
|
||||||
const pageConfigComponent = ref<DiyComponent<any>>(
|
const pageConfigComponent = ref<DiyComponent<any>>(
|
||||||
cloneDeep(PAGE_CONFIG_COMPONENT),
|
cloneDeep(PAGE_CONFIG_COMPONENT),
|
||||||
); // 页面设置组件
|
); // 页面设置组件
|
||||||
|
|
@ -336,7 +335,6 @@ onMounted(() => {
|
||||||
<Col :span="6">
|
<Col :span="6">
|
||||||
<ComponentLibrary
|
<ComponentLibrary
|
||||||
v-if="libs && libs.length > 0"
|
v-if="libs && libs.length > 0"
|
||||||
ref="componentLibrary"
|
|
||||||
:list="libs"
|
:list="libs"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import type { Emoji } from './tools/emoji';
|
||||||
import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversation';
|
import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversation';
|
||||||
import type { MallKefuMessageApi } from '#/api/mall/promotion/kefu/message';
|
import type { MallKefuMessageApi } from '#/api/mall/promotion/kefu/message';
|
||||||
|
|
||||||
import { computed, KeFuMessageContentTypeEnum, reactive, ref, toRefs, unref, watch } from 'vue';
|
import { computed, reactive, ref, toRefs, unref, watch } from 'vue';
|
||||||
|
|
||||||
import { UserTypeEnum } from '@vben/constants';
|
import { KeFuMessageContentTypeEnum, UserTypeEnum } from '@vben/constants';
|
||||||
import { IconifyIcon } from '@vben/icons';
|
import { IconifyIcon } from '@vben/icons';
|
||||||
import { formatDate, isEmpty, jsonParse } from '@vben/utils';
|
import { formatDate, isEmpty, jsonParse } from '@vben/utils';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -196,12 +196,10 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
>();
|
>();
|
||||||
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
|
.fullData as MallPointActivityApi.PointActivity[];
|
||||||
data.forEach((activity) => {
|
data.forEach((activity) => {
|
||||||
const row = tableData.find(
|
const row = tableData.find((item) => item.id === activity.id);
|
||||||
(item: MallPointActivityApi.PointActivity) =>
|
|
||||||
item.id === activity.id,
|
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setCheckboxRow(row, true);
|
gridApi.grid.setCheckboxRow(row, true);
|
||||||
}
|
}
|
||||||
|
|
@ -209,10 +207,9 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
}, 300);
|
}, 300);
|
||||||
} else if (!props.multiple && data && !Array.isArray(data)) {
|
} else if (!props.multiple && data && !Array.isArray(data)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
const row = tableData.find(
|
.fullData as MallPointActivityApi.PointActivity[];
|
||||||
(item: MallPointActivityApi.PointActivity) => item.id === data.id,
|
const row = tableData.find((item) => item.id === data.id);
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setRadioRow(row);
|
gridApi.grid.setRadioRow(row);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { requestClient } from '#/api/request';
|
||||||
export namespace MallTradeStatisticsApi {
|
export namespace MallTradeStatisticsApi {
|
||||||
/** 交易状况 Request */
|
/** 交易状况 Request */
|
||||||
export interface TradeTrendReqVO {
|
export interface TradeTrendReqVO {
|
||||||
times: [Date, Date];
|
times?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 交易统计 Response */
|
/** 交易统计 Response */
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,6 @@ const emits = defineEmits(['reset', 'save', 'update:modelValue']); // 工具栏
|
||||||
// margin: 4,
|
// margin: 4,
|
||||||
// }); // 预览二维码
|
// }); // 预览二维码
|
||||||
|
|
||||||
const componentLibrary = ref(); // 左侧组件库
|
|
||||||
const pageConfigComponent = ref<DiyComponent<any>>(
|
const pageConfigComponent = ref<DiyComponent<any>>(
|
||||||
cloneDeep(PAGE_CONFIG_COMPONENT),
|
cloneDeep(PAGE_CONFIG_COMPONENT),
|
||||||
); // 页面设置组件
|
); // 页面设置组件
|
||||||
|
|
@ -332,7 +331,6 @@ onMounted(() => {
|
||||||
<Col :span="6">
|
<Col :span="6">
|
||||||
<ComponentLibrary
|
<ComponentLibrary
|
||||||
v-if="libs && libs.length > 0"
|
v-if="libs && libs.length > 0"
|
||||||
ref="componentLibrary"
|
|
||||||
:list="libs"
|
:list="libs"
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { requestClient } from '#/api/request';
|
||||||
export namespace MallTradeStatisticsApi {
|
export namespace MallTradeStatisticsApi {
|
||||||
/** 交易状况 Request */
|
/** 交易状况 Request */
|
||||||
export interface TradeTrendReqVO {
|
export interface TradeTrendReqVO {
|
||||||
times: [Date, Date];
|
times?: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 交易统计 Response */
|
/** 交易统计 Response */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { MallBannerApi } from '#/api/mall/promotion/banner';
|
import type { MallBannerApi } from '#/api/mall/promotion/banner';
|
||||||
import type { SystemUserApi } from '#/api/system/user';
|
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
|
|
@ -19,7 +18,7 @@ import { $t } from '#/locales';
|
||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
const formData = ref<SystemUserApi.User>();
|
const formData = ref<MallBannerApi.Banner>();
|
||||||
const getTitle = computed(() => {
|
const getTitle = computed(() => {
|
||||||
return formData.value?.id
|
return formData.value?.id
|
||||||
? $t('ui.actionTitle.edit', ['Banner'])
|
? $t('ui.actionTitle.edit', ['Banner'])
|
||||||
|
|
|
||||||
|
|
@ -234,12 +234,10 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
>();
|
>();
|
||||||
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
|
.fullData as MallCombinationActivityApi.CombinationActivity[];
|
||||||
data.forEach((activity) => {
|
data.forEach((activity) => {
|
||||||
const row = tableData.find(
|
const row = tableData.find((item) => item.id === activity.id);
|
||||||
(item: MallCombinationActivityApi.CombinationActivity) =>
|
|
||||||
item.id === activity.id,
|
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setCheckboxRow(row, true);
|
gridApi.grid.setCheckboxRow(row, true);
|
||||||
}
|
}
|
||||||
|
|
@ -247,11 +245,9 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
}, 300);
|
}, 300);
|
||||||
} else if (!props.multiple && data && !Array.isArray(data)) {
|
} else if (!props.multiple && data && !Array.isArray(data)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
const row = tableData.find(
|
.fullData as MallCombinationActivityApi.CombinationActivity[];
|
||||||
(item: MallCombinationActivityApi.CombinationActivity) =>
|
const row = tableData.find((item) => item.id === data.id);
|
||||||
item.id === data.id,
|
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setRadioRow(row);
|
gridApi.grid.setRadioRow(row);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { Ref } from 'vue';
|
||||||
|
|
||||||
import type { ComponentStyle } from '../util';
|
import type { ComponentStyle } from '../util';
|
||||||
|
|
||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
|
|
@ -26,6 +28,7 @@ defineOptions({ name: 'ComponentContainer' });
|
||||||
const props = defineProps<{ modelValue: ComponentStyle }>();
|
const props = defineProps<{ modelValue: ComponentStyle }>();
|
||||||
const emit = defineEmits(['update:modelValue']);
|
const emit = defineEmits(['update:modelValue']);
|
||||||
const formData = useVModel(props, 'modelValue', emit);
|
const formData = useVModel(props, 'modelValue', emit);
|
||||||
|
const formStyleValues = formData as unknown as Ref<Record<string, number>>;
|
||||||
|
|
||||||
const treeData: any[] = [
|
const treeData: any[] = [
|
||||||
{
|
{
|
||||||
|
|
@ -169,7 +172,7 @@ function handleSliderChange(prop: string) {
|
||||||
class="mb-0 w-full"
|
class="mb-0 w-full"
|
||||||
>
|
>
|
||||||
<ElSlider
|
<ElSlider
|
||||||
v-model="formData[data.prop]"
|
v-model="formStyleValues[data.prop]"
|
||||||
:max="100"
|
:max="100"
|
||||||
:min="0"
|
:min="0"
|
||||||
show-input
|
show-input
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { StyleValue } from 'vue';
|
import type { CSSProperties } from 'vue';
|
||||||
|
|
||||||
import type { HotZoneItemProperty } from '../../config';
|
import type { HotZoneItemProperty } from '../../config';
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ export enum CONTROL_TYPE_ENUM {
|
||||||
export interface ControlDot {
|
export interface ControlDot {
|
||||||
position: string;
|
position: string;
|
||||||
types: CONTROL_TYPE_ENUM[];
|
types: CONTROL_TYPE_ENUM[];
|
||||||
style: StyleValue;
|
style: CSSProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 热区的 8 个控制点 */
|
/** 热区的 8 个控制点 */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { Rect } from '../../../../magic-cube-editor/util';
|
||||||
import type { ComponentStyle, DiyComponent } from '../../../util';
|
import type { ComponentStyle, DiyComponent } from '../../../util';
|
||||||
|
|
||||||
/** 广告魔方属性 */
|
/** 广告魔方属性 */
|
||||||
|
|
@ -10,13 +11,9 @@ export interface MagicCubeProperty {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 广告魔方项目属性 */
|
/** 广告魔方项目属性 */
|
||||||
export interface MagicCubeItemProperty {
|
export interface MagicCubeItemProperty extends Rect {
|
||||||
imgUrl: string; // 图标链接
|
imgUrl: string; // 图标链接
|
||||||
url: string; // 链接
|
url: string; // 链接
|
||||||
width: number; // 宽
|
|
||||||
height: number; // 高
|
|
||||||
top: number; // 上
|
|
||||||
left: number; // 左
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 定义组件 */
|
/** 定义组件 */
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import type { Rect } from '../../../../magic-cube-editor/util';
|
||||||
import type { DiyComponent } from '../../../util';
|
import type { DiyComponent } from '../../../util';
|
||||||
|
|
||||||
/** 顶部导航栏属性 */
|
/** 顶部导航栏属性 */
|
||||||
|
|
@ -16,12 +17,8 @@ export interface NavigationBarProperty {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 顶部导航栏 - 单元格 属性 */
|
/** 顶部导航栏 - 单元格 属性 */
|
||||||
export interface NavigationBarCellProperty {
|
export interface NavigationBarCellProperty extends Rect {
|
||||||
type: 'image' | 'search' | 'text'; // 类型:文字 | 图片 | 搜索框
|
type: 'image' | 'search' | 'text'; // 类型:文字 | 图片 | 搜索框
|
||||||
width: number; // 宽度
|
|
||||||
height: number; // 高度
|
|
||||||
top: number; // 顶部位置
|
|
||||||
left: number; // 左侧位置
|
|
||||||
text: string; // 文字内容
|
text: string; // 文字内容
|
||||||
textColor: string; // 文字颜色
|
textColor: string; // 文字颜色
|
||||||
imgUrl: string; // 图片地址
|
imgUrl: string; // 图片地址
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,6 @@ const qrcode = useQRCode(props.previewUrl, {
|
||||||
margin: 4,
|
margin: 4,
|
||||||
}); // 预览二维码
|
}); // 预览二维码
|
||||||
|
|
||||||
const componentLibrary = ref(); // 左侧组件库
|
|
||||||
const pageConfigComponent = ref<DiyComponent<any>>(
|
const pageConfigComponent = ref<DiyComponent<any>>(
|
||||||
cloneDeep(PAGE_CONFIG_COMPONENT),
|
cloneDeep(PAGE_CONFIG_COMPONENT),
|
||||||
); // 页面设置组件
|
); // 页面设置组件
|
||||||
|
|
@ -343,11 +342,10 @@ onMounted(() => {
|
||||||
<ElContainer class="editor-container h-[calc(100vh-135px)]">
|
<ElContainer class="editor-container h-[calc(100vh-135px)]">
|
||||||
<!-- 左侧:组件库(ComponentLibrary) -->
|
<!-- 左侧:组件库(ComponentLibrary) -->
|
||||||
<ElAside width="261px" class="editor-left">
|
<ElAside width="261px" class="editor-left">
|
||||||
<ComponentLibrary
|
<ComponentLibrary
|
||||||
v-if="libs && libs.length > 0"
|
v-if="libs && libs.length > 0"
|
||||||
ref="componentLibrary"
|
:list="libs"
|
||||||
:list="libs"
|
/>
|
||||||
/>
|
|
||||||
</ElAside>
|
</ElAside>
|
||||||
<!-- 中心:设计区域(ComponentContainer) -->
|
<!-- 中心:设计区域(ComponentContainer) -->
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import type { Emoji } from './tools/emoji';
|
||||||
import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversation';
|
import type { MallKefuConversationApi } from '#/api/mall/promotion/kefu/conversation';
|
||||||
import type { MallKefuMessageApi } from '#/api/mall/promotion/kefu/message';
|
import type { MallKefuMessageApi } from '#/api/mall/promotion/kefu/message';
|
||||||
|
|
||||||
import { computed, KeFuMessageContentTypeEnum, reactive, ref, toRefs, unref, watch } from 'vue';
|
import { computed, reactive, ref, toRefs, unref, watch } from 'vue';
|
||||||
|
|
||||||
import { UserTypeEnum } from '@vben/constants';
|
import { KeFuMessageContentTypeEnum, UserTypeEnum } from '@vben/constants';
|
||||||
import { IconifyIcon } from '@vben/icons';
|
import { IconifyIcon } from '@vben/icons';
|
||||||
import { formatDate, isEmpty, jsonParse } from '@vben/utils';
|
import { formatDate, isEmpty, jsonParse } from '@vben/utils';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -196,12 +196,10 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
>();
|
>();
|
||||||
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
|
.fullData as MallPointActivityApi.PointActivity[];
|
||||||
data.forEach((activity) => {
|
data.forEach((activity) => {
|
||||||
const row = tableData.find(
|
const row = tableData.find((item) => item.id === activity.id);
|
||||||
(item: MallPointActivityApi.PointActivity) =>
|
|
||||||
item.id === activity.id,
|
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setCheckboxRow(row, true);
|
gridApi.grid.setCheckboxRow(row, true);
|
||||||
}
|
}
|
||||||
|
|
@ -209,10 +207,9 @@ const [Modal, modalApi] = useVbenModal({
|
||||||
}, 300);
|
}, 300);
|
||||||
} else if (!props.multiple && data && !Array.isArray(data)) {
|
} else if (!props.multiple && data && !Array.isArray(data)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const tableData = gridApi.grid.getTableData().fullData;
|
const tableData = gridApi.grid.getTableData()
|
||||||
const row = tableData.find(
|
.fullData as MallPointActivityApi.PointActivity[];
|
||||||
(item: MallPointActivityApi.PointActivity) => item.id === data.id,
|
const row = tableData.find((item) => item.id === data.id);
|
||||||
);
|
|
||||||
if (row) {
|
if (row) {
|
||||||
gridApi.grid.setRadioRow(row);
|
gridApi.grid.setRadioRow(row);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,6 @@ defineExpose({
|
||||||
node-key="id"
|
node-key="id"
|
||||||
:props="{
|
:props="{
|
||||||
label: 'name',
|
label: 'name',
|
||||||
value: 'id',
|
|
||||||
children: 'children',
|
children: 'children',
|
||||||
}"
|
}"
|
||||||
placeholder="请选择地区"
|
placeholder="请选择地区"
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,6 @@ defineExpose({
|
||||||
node-key="id"
|
node-key="id"
|
||||||
:props="{
|
:props="{
|
||||||
label: 'name',
|
label: 'name',
|
||||||
value: 'id',
|
|
||||||
children: 'children',
|
children: 'children',
|
||||||
}"
|
}"
|
||||||
placeholder="请选择地区"
|
placeholder="请选择地区"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue