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