fix(web-antdv-next): 修复商城组件类型与 WMS 枚举导入
- 修复 web-antdv-next 商城 Banner、活动选择、DIY 装修等组件类型问题 - 收窄热区、魔方、导航栏、公告栏等装修组件配置类型 - 修复 web-antd WMS 首页单据统计枚举从 vue 错误导入的问题 - 修复商城统计时间参数、客服消息类型导入等类型错误 - 对齐 web-antd、web-ele、web-antdv-next 的商城促销组件类型定义 - 修复 DIY 装修、组合活动、积分活动、运费模板等组件兼容问题pull/359/MERGE
parent
f2a5bc522d
commit
9c68eb18c1
|
|
@ -1,10 +1,10 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { WmsHomeStatisticsApi } from '#/api/wms/home';
|
import type { WmsHomeStatisticsApi } from '#/api/wms/home';
|
||||||
|
|
||||||
import { OrderStatusEnum, OrderTypeEnum, ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import { DICT_TYPE } from '@vben/constants';
|
import { DICT_TYPE, OrderStatusEnum, OrderTypeEnum } from '@vben/constants';
|
||||||
import { getDictLabel } from '@vben/hooks';
|
import { getDictLabel } from '@vben/hooks';
|
||||||
|
|
||||||
import { Button, Card, message } from 'ant-design-vue';
|
import { Button, Card, message } from 'ant-design-vue';
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue