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>
|
||||
import type { WmsHomeStatisticsApi } from '#/api/wms/home';
|
||||
|
||||
import { OrderStatusEnum, OrderTypeEnum, ref } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
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 { Button, Card, message } from 'ant-design-vue';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<script lang="ts" setup>
|
||||
import type { MallBannerApi } from '#/api/mall/promotion/banner';
|
||||
import type { SystemUserApi } from '#/api/system/user';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
|
|
@ -19,7 +18,7 @@ import { $t } from '#/locales';
|
|||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemUserApi.User>();
|
||||
const formData = ref<MallBannerApi.Banner>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['Banner'])
|
||||
|
|
|
|||
|
|
@ -234,12 +234,10 @@ const [Modal, modalApi] = useVbenModal({
|
|||
>();
|
||||
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
||||
setTimeout(() => {
|
||||
const tableData = gridApi.grid.getTableData().fullData;
|
||||
const tableData = gridApi.grid.getTableData()
|
||||
.fullData as MallCombinationActivityApi.CombinationActivity[];
|
||||
data.forEach((activity) => {
|
||||
const row = tableData.find(
|
||||
(item: MallCombinationActivityApi.CombinationActivity) =>
|
||||
item.id === activity.id,
|
||||
);
|
||||
const row = tableData.find((item) => item.id === activity.id);
|
||||
if (row) {
|
||||
gridApi.grid.setCheckboxRow(row, true);
|
||||
}
|
||||
|
|
@ -247,11 +245,9 @@ const [Modal, modalApi] = useVbenModal({
|
|||
}, 300);
|
||||
} else if (!props.multiple && data && !Array.isArray(data)) {
|
||||
setTimeout(() => {
|
||||
const tableData = gridApi.grid.getTableData().fullData;
|
||||
const row = tableData.find(
|
||||
(item: MallCombinationActivityApi.CombinationActivity) =>
|
||||
item.id === data.id,
|
||||
);
|
||||
const tableData = gridApi.grid.getTableData()
|
||||
.fullData as MallCombinationActivityApi.CombinationActivity[];
|
||||
const row = tableData.find((item) => item.id === data.id);
|
||||
if (row) {
|
||||
gridApi.grid.setRadioRow(row);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
import type { ComponentStyle } from '../util';
|
||||
|
||||
import { useVModel } from '@vueuse/core';
|
||||
|
|
@ -28,6 +30,7 @@ defineOptions({ name: 'ComponentContainer' });
|
|||
const props = defineProps<{ modelValue: ComponentStyle }>();
|
||||
const emit = defineEmits(['update:modelValue']);
|
||||
const formData = useVModel(props, 'modelValue', emit);
|
||||
const formStyleValues = formData as unknown as Ref<Record<string, number>>;
|
||||
|
||||
const treeData: any[] = [
|
||||
{
|
||||
|
|
@ -182,9 +185,7 @@ function handleSliderChange(prop: string) {
|
|||
<Row>
|
||||
<Col :span="19">
|
||||
<Slider
|
||||
v-model:value="
|
||||
formData[dataRef.prop as keyof ComponentStyle]
|
||||
"
|
||||
v-model:value="formStyleValues[dataRef.prop]"
|
||||
:max="100"
|
||||
:min="0"
|
||||
@change="handleSliderChange(dataRef.prop)"
|
||||
|
|
@ -196,9 +197,7 @@ function handleSliderChange(prop: string) {
|
|||
class="w-[50px]"
|
||||
:max="100"
|
||||
:min="0"
|
||||
v-model:value="
|
||||
formData[dataRef.prop as keyof ComponentStyle]
|
||||
"
|
||||
v-model:value="formStyleValues[dataRef.prop]"
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { StyleValue } from 'vue';
|
||||
import type { CSSProperties } from 'vue';
|
||||
|
||||
import type { HotZoneItemProperty } from '../../config';
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ export enum CONTROL_TYPE_ENUM {
|
|||
export interface ControlDot {
|
||||
position: string;
|
||||
types: CONTROL_TYPE_ENUM[];
|
||||
style: StyleValue;
|
||||
style: CSSProperties;
|
||||
}
|
||||
|
||||
/** 热区的 8 个控制点 */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import type { Rect } from '../../../../magic-cube-editor/util';
|
||||
import type { ComponentStyle, DiyComponent } from '../../../util';
|
||||
|
||||
/** 广告魔方属性 */
|
||||
|
|
@ -10,13 +11,9 @@ export interface MagicCubeProperty {
|
|||
}
|
||||
|
||||
/** 广告魔方项目属性 */
|
||||
export interface MagicCubeItemProperty {
|
||||
export interface MagicCubeItemProperty extends Rect {
|
||||
imgUrl: 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';
|
||||
|
||||
/** 顶部导航栏属性 */
|
||||
|
|
@ -16,12 +17,8 @@ export interface NavigationBarProperty {
|
|||
}
|
||||
|
||||
/** 顶部导航栏 - 单元格 属性 */
|
||||
export interface NavigationBarCellProperty {
|
||||
export interface NavigationBarCellProperty extends Rect {
|
||||
type: 'image' | 'search' | 'text'; // 类型:文字 | 图片 | 搜索框
|
||||
width: number; // 宽度
|
||||
height: number; // 高度
|
||||
top: number; // 顶部位置
|
||||
left: number; // 左侧位置
|
||||
text: string; // 文字内容
|
||||
textColor: string; // 文字颜色
|
||||
imgUrl: string; // 图片地址
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ const emit = defineEmits(['update:modelValue']);
|
|||
|
||||
const formData = useVModel(props, 'modelValue', emit);
|
||||
const rules = {
|
||||
content: [{ required: true, message: '请输入公告', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '请输入公告', trigger: 'blur' as const }],
|
||||
}; // 表单校验
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -196,12 +196,10 @@ const [Modal, modalApi] = useVbenModal({
|
|||
>();
|
||||
if (props.multiple && Array.isArray(data) && data.length > 0) {
|
||||
setTimeout(() => {
|
||||
const tableData = gridApi.grid.getTableData().fullData;
|
||||
const tableData = gridApi.grid.getTableData()
|
||||
.fullData as MallPointActivityApi.PointActivity[];
|
||||
data.forEach((activity) => {
|
||||
const row = tableData.find(
|
||||
(item: MallPointActivityApi.PointActivity) =>
|
||||
item.id === activity.id,
|
||||
);
|
||||
const row = tableData.find((item) => item.id === activity.id);
|
||||
if (row) {
|
||||
gridApi.grid.setCheckboxRow(row, true);
|
||||
}
|
||||
|
|
@ -209,10 +207,9 @@ const [Modal, modalApi] = useVbenModal({
|
|||
}, 300);
|
||||
} else if (!props.multiple && data && !Array.isArray(data)) {
|
||||
setTimeout(() => {
|
||||
const tableData = gridApi.grid.getTableData().fullData;
|
||||
const row = tableData.find(
|
||||
(item: MallPointActivityApi.PointActivity) => item.id === data.id,
|
||||
);
|
||||
const tableData = gridApi.grid.getTableData()
|
||||
.fullData as MallPointActivityApi.PointActivity[];
|
||||
const row = tableData.find((item) => item.id === data.id);
|
||||
if (row) {
|
||||
gridApi.grid.setRadioRow(row);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue