mirror of
https://gitee.com/yudaocode/yudao-ui-admin-vben.git
synced 2025-12-30 02:22:25 +00:00
review:【antd/ele】【mall】营销模块的迁移
This commit is contained in:
@@ -3,9 +3,7 @@ import 'bpmn-js/dist/assets/diagram-js.css';
|
|||||||
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css';
|
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css';
|
||||||
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css';
|
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css';
|
||||||
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
|
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css';
|
||||||
// TODO @puhui999:样式问题:设计器那,位置不太对;
|
|
||||||
|
|
||||||
export { default as MyProcessDesigner } from './designer';
|
export { default as MyProcessDesigner } from './designer';
|
||||||
// TODO @puhui999:流程发起时,预览相关的,需要使用;
|
|
||||||
export { default as MyProcessViewer } from './designer/index2';
|
export { default as MyProcessViewer } from './designer/index2';
|
||||||
export { default as MyProcessPenal } from './penal';
|
export { default as MyProcessPenal } from './penal';
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ watch(
|
|||||||
<Image
|
<Image
|
||||||
v-if="row.picUrl"
|
v-if="row.picUrl"
|
||||||
:src="row.picUrl"
|
:src="row.picUrl"
|
||||||
class="h-[30px] w-[30px] cursor-pointer"
|
class="!h-[30px] !w-[30px] cursor-pointer"
|
||||||
:preview="true"
|
:preview="true"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
// TODO @puhui999:1)新增时:一直报:“请输入优惠设置”;2)修改老数据,出现报“请求参数类型错误:50.00”;
|
||||||
{
|
{
|
||||||
fieldName: 'rules',
|
fieldName: 'rules',
|
||||||
label: '优惠设置',
|
label: '优惠设置',
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
// 提交表单
|
// 提交表单
|
||||||
try {
|
try {
|
||||||
const values = await formApi.getValues();
|
const values = await formApi.getValues();
|
||||||
// 合并表单值和 formData(含 id、productSpuIds、productCategoryIds 等)
|
|
||||||
const data = { ...formData.value, ...values };
|
const data = { ...formData.value, ...values };
|
||||||
if (data.startAndEndTime && Array.isArray(data.startAndEndTime)) {
|
if (data.startAndEndTime && Array.isArray(data.startAndEndTime)) {
|
||||||
data.startTime = data.startAndEndTime[0];
|
data.startTime = data.startAndEndTime[0];
|
||||||
@@ -74,7 +73,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
item.limit = convertToInteger(item.limit || 0);
|
item.limit = convertToInteger(item.limit || 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// productScopeValues 已通过 data.ts 中的 dependencies.trigger 自动同步到表单值中
|
|
||||||
await (data.id
|
await (data.id
|
||||||
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
||||||
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
||||||
@@ -99,7 +97,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
try {
|
try {
|
||||||
const result = await getReward(data.id);
|
const result = await getReward(data.id);
|
||||||
// antd RangePicker 需要 dayjs 对象
|
|
||||||
result.startAndEndTime = [
|
result.startAndEndTime = [
|
||||||
result.startTime ? dayjs(result.startTime) : undefined,
|
result.startTime ? dayjs(result.startTime) : undefined,
|
||||||
result.endTime ? dayjs(result.endTime) : undefined,
|
result.endTime ? dayjs(result.endTime) : undefined,
|
||||||
|
|||||||
@@ -490,6 +490,7 @@ defineExpose({
|
|||||||
@checkbox-all="handleSelectionChange"
|
@checkbox-all="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<VxeColumn v-if="isComponent" type="checkbox" width="45" fixed="left" />
|
<VxeColumn v-if="isComponent" type="checkbox" width="45" fixed="left" />
|
||||||
|
<!-- TODO @puhui999:这里的宽度貌似有点问题,图片会寄出来; -->
|
||||||
<VxeColumn align="center" title="图片" max-width="140" fixed="left">
|
<VxeColumn align="center" title="图片" max-width="140" fixed="left">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElImage
|
<ElImage
|
||||||
@@ -582,6 +583,7 @@ defineExpose({
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<VxeColumn v-if="isComponent" type="checkbox" width="45" fixed="left" />
|
<VxeColumn v-if="isComponent" type="checkbox" width="45" fixed="left" />
|
||||||
|
<!-- TODO @puhui999:这里的宽度貌似有点问题,图片会寄出来; -->
|
||||||
<VxeColumn align="center" title="图片" max-width="140" fixed="left">
|
<VxeColumn align="center" title="图片" max-width="140" fixed="left">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<ElImage
|
<ElImage
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ watch(
|
|||||||
<VxeColumn field="id" align="center" title="商品编号" min-width="30" />
|
<VxeColumn field="id" align="center" title="商品编号" min-width="30" />
|
||||||
<VxeColumn title="商品图" min-width="80">
|
<VxeColumn title="商品图" min-width="80">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
<!-- TODO @puhui999:它的 preview 貌似展示有点奇怪,不像 antd 是全屏的。。。 -->
|
||||||
<ElImage
|
<ElImage
|
||||||
v-if="row.picUrl"
|
v-if="row.picUrl"
|
||||||
:src="row.picUrl"
|
:src="row.picUrl"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { computed, nextTick, onMounted, ref } from 'vue';
|
|||||||
|
|
||||||
import { handleTree } from '@vben/utils';
|
import { handleTree } from '@vben/utils';
|
||||||
|
|
||||||
import { ElDialog, ElMessage } from 'element-plus';
|
import { ElButton, ElDialog, ElMessage } from 'element-plus';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getCategoryList } from '#/api/mall/product/category';
|
import { getCategoryList } from '#/api/mall/product/category';
|
||||||
@@ -314,8 +314,8 @@ onMounted(async () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
<el-button @click="closeModal">取消</el-button>
|
<ElButton @click="closeModal">取消</ElButton>
|
||||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
<ElButton type="primary" @click="handleConfirm">确定</ElButton>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</ElDialog>
|
</ElDialog>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { computed, nextTick, onMounted, ref } from 'vue';
|
|||||||
|
|
||||||
import { handleTree } from '@vben/utils';
|
import { handleTree } from '@vben/utils';
|
||||||
|
|
||||||
import { ElDialog } from 'element-plus';
|
import { ElButton, ElDialog } from 'element-plus';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getCategoryList } from '#/api/mall/product/category';
|
import { getCategoryList } from '#/api/mall/product/category';
|
||||||
@@ -236,8 +236,8 @@ onMounted(async () => {
|
|||||||
<Grid />
|
<Grid />
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span v-if="props.multiple" class="dialog-footer">
|
<span v-if="props.multiple" class="dialog-footer">
|
||||||
<el-button @click="closeModal">取消</el-button>
|
<ElButton @click="closeModal">取消</ElButton>
|
||||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
<ElButton type="primary" @click="handleConfirm">确定</ElButton>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</ElDialog>
|
</ElDialog>
|
||||||
|
|||||||
@@ -320,6 +320,7 @@ onMounted(async () => {
|
|||||||
<ElCard class="h-full w-full" v-loading="formLoading">
|
<ElCard class="h-full w-full" v-loading="formLoading">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
|
<!-- TODO @puhui999:这里有告警,需要修复下。 -->
|
||||||
<ElTabs v-model="activeTabName" @tab-change="handleTabChange">
|
<ElTabs v-model="activeTabName" @tab-change="handleTabChange">
|
||||||
<ElTabPane label="基础设置" name="info" />
|
<ElTabPane label="基础设置" name="info" />
|
||||||
<ElTabPane label="价格库存" name="sku" />
|
<ElTabPane label="价格库存" name="sku" />
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ async function getSpuDetails(
|
|||||||
|
|
||||||
// ================= end =================
|
// ================= end =================
|
||||||
|
|
||||||
const [Dialog, modalApi] = useVbenModal({
|
const [Modal, modalApi] = useVbenModal({
|
||||||
async onConfirm() {
|
async onConfirm() {
|
||||||
const { valid } = await formApi.validate();
|
const { valid } = await formApi.validate();
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
@@ -214,7 +214,7 @@ const [Dialog, modalApi] = useVbenModal({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Dialog :title="getTitle" class="w-[70%]">
|
<Modal :title="getTitle" class="w-[70%]">
|
||||||
<Form class="mx-4">
|
<Form class="mx-4">
|
||||||
<!-- 商品选择 -->
|
<!-- 商品选择 -->
|
||||||
<template #spuId>
|
<template #spuId>
|
||||||
@@ -253,7 +253,7 @@ const [Dialog, modalApi] = useVbenModal({
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Form>
|
</Form>
|
||||||
</Dialog>
|
</Modal>
|
||||||
|
|
||||||
<!-- 商品选择器弹窗 -->
|
<!-- 商品选择器弹窗 -->
|
||||||
<SpuSkuSelect
|
<SpuSkuSelect
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { MallCouponTemplateApi } from '#/api/mall/promotion/coupon/couponTe
|
|||||||
|
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { ElDialog } from 'element-plus';
|
import { ElButton, ElDialog } from 'element-plus';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { getCouponTemplatePage } from '#/api/mall/promotion/coupon/couponTemplate';
|
import { getCouponTemplatePage } from '#/api/mall/promotion/coupon/couponTemplate';
|
||||||
@@ -90,8 +90,8 @@ defineExpose({
|
|||||||
>
|
>
|
||||||
<Grid />
|
<Grid />
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="closeModal">取消</el-button>
|
<ElButton @click="closeModal">取消</ElButton>
|
||||||
<el-button type="primary" @click="handleConfirm">确定</el-button>
|
<ElButton type="primary" @click="handleConfirm">确定</ElButton>
|
||||||
</template>
|
</template>
|
||||||
</ElDialog>
|
</ElDialog>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ const [Form, formApi] = useVbenForm({
|
|||||||
showDefaultActions: false,
|
showDefaultActions: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO @puhui999:antd 和 ele 里,修改时,商品都没展示。
|
||||||
const [Modal, modalApi] = useVbenModal({
|
const [Modal, modalApi] = useVbenModal({
|
||||||
async onConfirm() {
|
async onConfirm() {
|
||||||
const { valid } = await formApi.validate();
|
const { valid } = await formApi.validate();
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
item.limit = convertToInteger(item.limit || 0);
|
item.limit = convertToInteger(item.limit || 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// productScopeValues 已通过 data.ts 中的 dependencies.trigger 自动同步到表单值中
|
|
||||||
await (data.id
|
await (data.id
|
||||||
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
? updateRewardActivity(data as MallRewardActivityApi.RewardActivity)
|
||||||
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
: createRewardActivity(data as MallRewardActivityApi.RewardActivity));
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ function handleDelete(ruleIndex: number) {
|
|||||||
<span>{{ isPriceCondition ? '元' : '件' }}</span>
|
<span>{{ isPriceCondition ? '元' : '件' }}</span>
|
||||||
</div>
|
</div>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
|
<!-- 优惠内容 -->
|
||||||
<ElFormItem label="优惠内容:" class="!mb-0">
|
<ElFormItem label="优惠内容:" class="!mb-0">
|
||||||
<div class="flex flex-col gap-3">
|
<div class="flex flex-col gap-3">
|
||||||
<div
|
<div
|
||||||
@@ -134,7 +134,7 @@ function handleDelete(ruleIndex: number) {
|
|||||||
<span class="w-20 shrink-0 text-sm text-gray-500">包邮</span>
|
<span class="w-20 shrink-0 text-sm text-gray-500">包邮</span>
|
||||||
<ElSwitch v-model="rule.freeDelivery" />
|
<ElSwitch v-model="rule.freeDelivery" />
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 送积分 -->
|
||||||
<div
|
<div
|
||||||
class="flex items-center gap-2 rounded-md bg-gray-50 px-3 py-2"
|
class="flex items-center gap-2 rounded-md bg-gray-50 px-3 py-2"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'logType',
|
field: 'logType',
|
||||||
title: '操作类型',
|
title: '登录类型',
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
cellRender: {
|
cellRender: {
|
||||||
name: 'CellDict',
|
name: 'CellDict',
|
||||||
@@ -108,7 +108,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'logType',
|
field: 'logType',
|
||||||
label: '操作类型',
|
label: '登录类型',
|
||||||
render: (val) => {
|
render: (val) => {
|
||||||
return h(DictTag, {
|
return h(DictTag, {
|
||||||
type: DICT_TYPE.SYSTEM_LOGIN_TYPE,
|
type: DICT_TYPE.SYSTEM_LOGIN_TYPE,
|
||||||
|
|||||||
Reference in New Issue
Block a user