Commit 49f19697 by wangzhihui

Merge branch 'SAAS+V5.8.3' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into SAAS+V5.8.3_wzh
2 parents 8f985ee4 bee93c3f
......@@ -9,6 +9,10 @@ npm run lint
npm run test:unit
```
### 开发性能与主题预研
详见 [`.ai/docs/DEV_PERF_AND_THEME_RESEARCH.md`](../docs/DEV_PERF_AND_THEME_RESEARCH.md)(`npm run serve` 慢/OOM、懒加载开关、Element 主题静态化等方案的预研与后续落地顺序)。
默认不要执行:
```bash
......
......@@ -5,6 +5,7 @@
请优先阅读:
- /.ai/rules/ 目录下的文件
- 开发性能 / Element 主题预研:/.ai/docs/DEV_PERF_AND_THEME_RESEARCH.md
## 项目概述
......
......@@ -27,6 +27,7 @@ export default antfu({
"array-bracket-spacing": ["error", "always"],
},
rules: {
"curly": ["error", "all"],
"vue/no-deprecated-slot-attribute": "off",
"vue/no-deprecated-v-on-native-modifier": "off",
"vue/no-deprecated-destroyed-lifecycle": "off",
......
......@@ -421,11 +421,48 @@ export default {
return true;
},
resolveUploadFileType(file) {
if (this.type === "image" || this.type === "video") {
return this.type;
}
const mimeType = (file && file.type) || "";
if (mimeType.startsWith("image/")) {
return "image";
}
if (mimeType.startsWith("video/")) {
return "video";
}
const fileName = ((file && file.name) || "").toLowerCase();
if (/\.(jpg|jpeg|png|webp|bmp|gif)$/.test(fileName)) {
return "image";
}
if (/\.(mp4|mov|webm|avi|m4v)$/.test(fileName)) {
return "video";
}
return "file";
},
beforeUpload(file) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
const fileType = this.resolveUploadFileType(file);
const validateContext = {
file,
fileType,
maxFileSize: this.fileSize,
isValid: true,
message: "",
};
this.$emit("beforeUploadValidate", validateContext);
const isLt = file.size / 1024 / 1024 < validateContext.maxFileSize;
const isValid = validateContext.isValid !== false && isLt;
if (!isLt) {
const label = this.type === "video" ? "视频" : this.type === "image" ? "图片" : "文件";
this.$message.error(`仅允许上传不超过${this.fileSize}M的${label}`);
const label = fileType === "video" ? "视频" : fileType === "image" ? "图片" : "文件";
this.$message.error(validateContext.message || `仅允许上传不超过${validateContext.maxFileSize}M的${label}`);
return false;
}
if (!isValid) {
if (validateContext.message) {
this.$message.error(validateContext.message);
}
return false;
}
return true;
......
......@@ -81,22 +81,6 @@ export const routerName = {
},
auth: [
{
authId: "9020201",
parentId: "90202",
label: "预录客户",
icon: "plus",
category: "Button",
type: "primary",
handle: "handleAdd",
addRoutePath: [
{
authId: "901",
name: "预录客户",
parentId: "90202",
},
],
},
{
authId: "9020202",
parentId: "90202",
label: "一键导入",
......@@ -120,69 +104,6 @@ export const routerName = {
],
component: _import("customer/recordList"),
},
90203: {
path: "/invitation",
name: "invitation",
meta: {
title: "邀约管理",
authId: "90203",
parentId: "902",
cache: false,
},
auth: [
{
authId: "9020301",
parentId: "90203",
label: "再次电联",
handle: "handleMoreCall",
// ruleObj: {
// attr: 'status',
// rule: {
// 0: '上架',
// 1: '下架'
// }
// }
},
{
authId: "9020302",
parentId: "90203",
label: "取消预约",
handle: "handleCancel",
},
{
authId: "9020303",
parentId: "90203",
label: "更新备注",
handle: "handleUpdateRemark",
},
{
authId: "9020304",
parentId: "90203",
label: "修改时间",
handle: "handleChangeTime",
},
{
authId: "9020305",
parentId: "90203",
label: "电联一下",
handle: "handleCall",
},
{
authId: "9020306",
parentId: "90203",
label: "预约时间",
handle: "handleAppoint",
},
{
authId: "9020307",
parentId: "90203",
label: "更新备注",
handle: "handleUpdateRemark",
},
],
component: _import("customer/invitation"),
},
90205: {
path: "/customerPortrait",
name: "customerPortrait",
......
......@@ -28,14 +28,6 @@ export const routerName = {
],
auth: [
{
authId: "9230101",
parentId: "92301",
label: "新增子分类",
category: "Button",
type: "primary",
handle: "handleAddCategory",
},
{
authId: "9230102",
parentId: "92301",
label: "新增标签维度",
......@@ -44,30 +36,12 @@ export const routerName = {
handle: "handleAddDimension",
},
{
authId: "9230103",
parentId: "92301",
label: "编辑",
handle: "handleEditCategory",
},
{
authId: "9230104",
parentId: "92301",
label: "新增枚举",
handle: "handleAddEnum",
},
{
authId: "9230105",
parentId: "92301",
label: "编辑",
handle: "handleEditDimension",
},
{
authId: "9230106",
parentId: "92301",
label: "编辑枚举",
handle: "handleEditEnum",
},
{
authId: "9230108",
parentId: "92301",
label: "维护枚举值",
......@@ -94,22 +68,6 @@ export const routerName = {
sideHidden: true,
activePath: "/tagManagementList",
},
auth: [
{
authId: "9230104",
parentId: "92302",
label: "新增枚举值",
category: "Button",
type: "primary",
handle: "handleAddEnum",
},
{
authId: "9230106",
parentId: "92302",
label: "编辑枚举",
handle: "handleEditEnum",
},
],
component: _import("tagCustomerManagement/tagManagement/enumMaintain/index"),
},
};
......@@ -29,8 +29,6 @@
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<!-- 2024/9 独立版本 -->
<!-- <auth-button category="Button" style="{display: inline-block}" :show-btn-ids="['9020201']" /> -->
<span class="table-header-left-txt" style="margin-left: 0;">已预录客户列表{{ total }}条记录。</span>
</span>
<span>
......@@ -360,15 +358,6 @@ export default {
}
});
},
handleAdd() {
this.close({ tagName: "/editCustomer" });
this.$router.push({
name: "editCustomer",
params: {
addOrEdit: "add",
},
});
},
handleEdit(data) {
getOrderDetail({
orderCode: data.orderCode,
......
......@@ -416,8 +416,6 @@ export default {
this.directPackages = list.map(item => ({
...item,
productType: item.packageCode ? 0 : 1,
// 套餐字段映射
packageId: item.packageCode || item.packageId,
packageName: item.packageName || "",
tabName: item.tabName || item.packageName || "",
packageCode: item.packageCode || "",
......@@ -469,7 +467,6 @@ export default {
const packages = (series.packageList || []).map(item => ({
...item,
productType: 0,
packageId: item.packageCode,
packageName: item.packageName || "",
tabName: item.tabName || "",
packageCode: item.packageCode || "",
......@@ -643,9 +640,21 @@ export default {
const currentPackages = this.seriesPackages[seriesId] || [];
this.tempSelectedItems = currentPackages.map((item) => {
if (item.productType === 0) {
return { ...item, packageId: item.packageCode || item.code, productType: 0, productName: item.packageName || item.productName || "" };
// 套餐
return {
...item,
packageCode: item.packageCode,
productType: 0,
productName: item.packageName || item.productName || "",
};
}
return { ...item, goodsCode: item.goodsCode || item.code, productType: 1, productName: item.productName || "" };
// 商品:优先使用 goodsCode,其次尝试 code
return {
...item,
goodsCode: item.goodsCode || item.code,
productType: 1,
productName: item.productName || "",
};
});
this.packageDialogVisible = true;
},
......@@ -658,18 +667,18 @@ export default {
return;
}
// 按车系模式:用 packageId/goodsCode 做唯一匹配,保留已编辑数据
// 按车系模式:用 packageCode/goodsCode 做唯一匹配,保留已编辑数据
const existingList = this.seriesPackages[this.currentSeriesId] || [];
const existingMap = {};
existingList.forEach((item) => {
const key = item.productType == 0 ? (item.packageId) : (item.goodsCode);
const key = item.productType == 0 ? (item.packageCode) : (item.goodsCode);
if (key)
existingMap[key] = item;
});
const newList = selectedItems.map((item) => {
// 唯一匹配key:套餐用 packageId,商品用 goodsCode
const matchKey = item.productType === 0 ? (item.packageId) : item.goodsCode;
// 唯一匹配key:套餐用 packageCode,商品用 goodsCode
const matchKey = item.productType === 0 ? (item.packageCode) : item.goodsCode;
if (matchKey && existingMap[matchKey]) {
// 已存在:保留原有编辑数据,但同步最新门店数
const merged = { ...existingMap[matchKey] };
......@@ -735,17 +744,17 @@ export default {
// 执行添加直接模式套餐/商品(公共逻辑)
doAddDirectPackages(selectedItems) {
// 用 packageId/goodsCode 做唯一匹配,保留已编辑数据
// 用 packageCode/goodsCode 做唯一匹配,保留已编辑数据
const existingMap = {};
this.directPackages.forEach((item) => {
const key = item.productType === 0 ? (item.packageId || item.packageCode || item.code) : (item.goodsCode || item.code);
const key = item.productType === 0 ? (item.packageCode) : (item.goodsCode);
if (key)
existingMap[key] = item;
});
this.directPackages = selectedItems.map((item) => {
// 唯一匹配key:套餐用 packageId,商品用 goodsCode
const matchKey = item.productType === 0 ? (item.packageId || item.packageCode) : item.goodsCode;
// 唯一匹配key:套餐用 packageCode,商品用 goodsCode
const matchKey = item.productType === 0 ? (item.packageCode) : item.goodsCode;
if (matchKey && existingMap[matchKey]) {
// 已存在:保留原有编辑数据,但同步最新门店数
const merged = { ...existingMap[matchKey] };
......@@ -1060,7 +1069,7 @@ export default {
productType: 0,
productName: item.packageName || item.productName,
productAlias: item.productAlias,
packageCode: item.packageId,
packageCode: item.packageCode,
sortOrder: i + 1,
tabName: item.tabName,
tabDescription: item.tabDescription,
......@@ -1161,10 +1170,10 @@ export default {
return;
}
this.currentSeriesId = ""; // 标记为直接模式
// 提取原始标识字段用于弹窗回显,确保 packageId/goodsCode 字段存在
// 提取原始标识字段用于弹窗回显,确保 packageCode/goodsCode 字段存在
this.tempSelectedItems = (this.directPackages || []).map((item) => {
if (item.productType === 0) {
return { ...item, productType: 0, packageId: item.packageId || item.packageCode || item.code, productName: item.packageName || item.productName || "" };
return { ...item, productType: 0, packageCode: item.packageCode, productName: item.packageName || item.productName || "" };
}
return { ...item, productType: 1, goodsCode: item.goodsCode || item.code, productName: item.productName || "" };
});
......
......@@ -54,14 +54,14 @@
<!-- 手风琴列表(Sortable 拖拽整个 item) -->
<el-collapse v-model="activeNames" class="package-collapse">
<el-collapse-item v-for="(pkg, index) in localList"
:key="pkg.packageId"
:key="pkg.packageCode"
class="package-item"
:name="pkg.packageId">
:name="pkg.packageCode">
<!-- 标题行:模拟表格的一行数据 -->
<template slot="title">
<div class="collapse-row"
:class="{ 'is-expanded': activeNames.includes(pkg.packageId) }"
:class="{ 'is-expanded': activeNames.includes(pkg.packageCode) }"
@click.stop
@keydown.stop
@keyup.stop>
......@@ -70,8 +70,8 @@
</span>
<span class="col col-index"
style="cursor: pointer;"
@click.stop="toggleExpand(pkg.packageId)">
<i :class="[activeNames.includes(pkg.packageId) ? 'el-icon-arrow-down' : 'el-icon-arrow-right']"></i>
@click.stop="toggleExpand(pkg.packageCode)">
<i :class="[activeNames.includes(pkg.packageCode) ? 'el-icon-arrow-down' : 'el-icon-arrow-right']"></i>
{{ index + 1 }}
</span>
<span class="col col-name"
......@@ -83,7 +83,7 @@
size="mini"
:class="{ 'is-error': pkg.tabNameError }"
@input="clearError(pkg, 'tabNameError')" />
<div class="sub-text">{{ pkg.packageId }}</div>
<div class="sub-text">{{ pkg.packageCode }}</div>
</span>
<span class="col col-tabDescription"
@keydown.stop
......@@ -223,7 +223,7 @@
</template>
<!-- 展开内容:子商品 div 模拟表格 -->
<div v-loading="packageLoadingMap[pkg.packageId]"
<div v-loading="packageLoadingMap[pkg.packageCode]"
class="collapse-content">
<!-- 子商品表头 -->
<div class="sub-table-header">
......@@ -325,35 +325,35 @@ export default {
* 切换套餐项展开/收起(只有点击箭头/排序号区域才触发)
* 展开时若套餐无子商品数据,自动请求接口获取
*/
toggleExpand(packageId) {
const idx = this.activeNames.indexOf(packageId);
toggleExpand(packageCode) {
const idx = this.activeNames.indexOf(packageCode);
if (idx > -1) {
this.activeNames.splice(idx, 1);
} else {
this.activeNames.push(packageId);
this.activeNames.push(packageCode);
// 展开时检查是否需要加载子商品
this.loadPackageProducts(packageId);
this.loadPackageProducts(packageCode);
}
},
/**
* 加载套餐子商品数据(每次展开时调用,合并新旧数据保留用户输入)
*/
loadPackageProducts(packageId) {
const idx = this.localList.findIndex(p => p.packageId === packageId);
loadPackageProducts(packageCode) {
const idx = this.localList.findIndex(p => p.packageCode === packageCode);
if (idx < 0)
return;
const pkg = this.localList[idx];
if (!pkg.packageId)
if (!pkg.packageCode)
return;
// 设置loading状态
this.$set(this.packageLoadingMap, packageId, true);
this.$set(this.packageLoadingMap, packageCode, true);
// 保存旧的子商品数据(用于合并)
const oldItems = pkg.packageItems || [];
getGoodsDataByPackage({ packageId: pkg.packageId }).then((res) => {
getGoodsDataByPackage({ packageId: pkg.packageCode }).then((res) => {
if (!res || !res.length) {
// 如果新数据为空,清空子商品列表
pkg.packageItems = [];
......@@ -385,7 +385,7 @@ export default {
pkg.packageItems = mergedItems;
}).finally(() => {
// 清除loading状态
this.$set(this.packageLoadingMap, packageId, false);
this.$set(this.packageLoadingMap, packageCode, false);
});
},
......
......@@ -98,7 +98,7 @@
label="套餐ID"
width="200">
<template #default="scope">
{{ emptyFilter(scope.row.packageId) }}
{{ emptyFilter(scope.row.packageCode) }}
</template>
</el-table-column>
</template>
......@@ -193,7 +193,7 @@
套餐 ({{ packageItems.length }})
</div>
<div v-for="(item, index) in packageItems"
:key="`pkg_${item.packageId || index}`"
:key="`pkg_${item.packageCode || index}`"
class="selected-item">
<div class="item-info">
<div class="item-name">
......@@ -437,8 +437,9 @@ export default {
const tabKey = isPackage ? "package" : "product";
eventRequest(params)
.then((res) => {
const savedIds = (this.selectedMap[tabKey] || []).map(item => (isPackage ? item.packageId : item.goodsCode));
const savedIds = (this.selectedMap[tabKey] || []).map(item => (isPackage ? item.packageCode : item.goodsCode));
res?.list?.forEach((val) => {
val.packageCode = val.packageId;
val.productName = val.productName || val.packageName;
val.upgradeProductId = val.productId;
});
......@@ -448,7 +449,7 @@ export default {
this.$nextTick(() => {
if (this.$refs.tableRef) {
this.tableData.forEach((row) => {
if (savedIds.includes(isPackage ? row.packageId : row.goodsCode)) {
if (savedIds.includes(isPackage ? row.packageCode : row.goodsCode)) {
this.$refs.tableRef.toggleRowSelection(row, true);
}
});
......@@ -489,7 +490,7 @@ export default {
return;
}
const isPackage = this.activeTab === "0";
const idField = isPackage ? "packageId" : "goodsCode";
const idField = isPackage ? "packageCode" : "goodsCode";
const tabKey = isPackage ? "package" : "product";
// 当前页所有数据的 id 集合
const currentPageIds = this.tableData.map(row => row[idField]);
......@@ -511,13 +512,13 @@ export default {
// 移除已选项
handleRemoveItem(item) {
const tab = item.productType === 0 ? "package" : "product";
const idx = this.selectedMap[tab].findIndex(s => tab === "package" ? s.packageId === item.packageId : s.goodsCode === item.goodsCode);
const idx = this.selectedMap[tab].findIndex(s => tab === "package" ? s.packageCode === item.packageCode : s.goodsCode === item.goodsCode);
if (idx === -1)
return;
this.selectedMap[tab].splice(idx, 1);
// 取消表格中的选中状态
this.$nextTick(() => {
const row = this.tableData.find(s => tab === "package" ? s.packageId === item.packageId : s.goodsCode === item.goodsCode);
const row = this.tableData.find(s => tab === "package" ? s.packageCode === item.packageCode : s.goodsCode === item.goodsCode);
if (row && this.$refs.tableRef) {
this.$refs.tableRef.toggleRowSelection(row, false);
}
......
......@@ -83,7 +83,7 @@ export default {
getMerchantData() {
const params = {
goodsCode: this.storeRow.goodsCode,
packageCode: this.storeRow.packageId,
packageCode: this.storeRow.packageCode,
activityId: this.storeRow?.activityId,
merchantIds: this.merchantList?.map((val) => {
return val.merchantId;
......
......@@ -98,7 +98,7 @@
<div class="card-content">
<!-- ========== 直接选择模式:套餐+商品都有时显示子tab ========== -->
<template v-if="detailData.configMode === 'direct' && directSplit.packages.length && directSplit.products.length">
<template v-if="detailData.configMode === 'direct' && directSplit.packages && directSplit.packages.length && directSplit.products && directSplit.products.length">
<el-tabs v-model="directSubActiveTab" class="sub-tabs direct-sub-tabs">
<el-tab-pane name="direct_package">
<template #label>
......@@ -116,7 +116,7 @@
</template>
<!-- 直接模式:只有套餐或只有商品 -->
<template v-else-if="detailData.configMode === 'direct' && detailData.directPackages.length">
<template v-else-if="detailData.configMode === 'direct' && detailData.directPackages && detailData.directPackages.length">
<MixedDetailTable :list="detailData.directPackages" />
</template>
......@@ -131,7 +131,7 @@
:name="String(series.carSeriesId)">
<!-- 该车系同时有套餐和商品:显示子tabs -->
<template v-if="series.packageList.length && series.goodsList.length">
<template v-if="series.packageList && series.packageList.length && series.goodsList && series.goodsList.length">
<el-tabs class="sub-tabs" :value="getSeriesSubTabId(series.carSeriesId)">
<el-tab-pane :name="`package_${series.carSeriesId}`">
<template #label>
......@@ -150,7 +150,7 @@
<!-- 该车系只有套餐或只有商品:单表展示 -->
<template v-else>
<MixedDetailTable :list="series.packageList.length ? series.packageList : series.goodsList.length ? series.goodsList : []" />
<MixedDetailTable :list="series.packageList && series.packageList.length ? series.packageList : series.goodsList && series.goodsList.length ? series.goodsList : []" />
</template>
</el-tab-pane>
</el-tabs>
......@@ -426,6 +426,7 @@ export default {
getActivityCarSeries() {
this.startLoading();
getMarketingActivityCarSeries({ activityId: this.activityId, includeDetail: true, pageSize: 999 }).then((res) => {
console.log(res, "222222");
this.activeSeriesId = String(res?.[0]?.carSeriesId || "");
this.detailData.seriesList = res || [];
}).finally(() => this.endLoading());
......
......@@ -13,10 +13,16 @@ const ActionsItem = require("./index.vue").default;
describe("marketingPushStrategy components/actionsItem", () => {
const localVue = createLocalVue();
let wrapper;
let validateFieldMock;
function createWrapper(item = {}) {
wrapper = shallowMount(ActionsItem, {
localVue,
provide: {
elForm: {
validateField: validateFieldMock,
},
},
propsData: {
propPrefix: "branches[0].actions[0]",
options: {
......@@ -62,6 +68,10 @@ describe("marketingPushStrategy components/actionsItem", () => {
jest.clearAllMocks();
});
beforeEach(() => {
validateFieldMock = jest.fn();
});
it("文本消息缺少内容时应报错", () => {
createWrapper({ messageType: MessageTypeEnum.VARIABLE_TEXT, content: "" });
const callback = jest.fn();
......@@ -124,4 +134,12 @@ describe("marketingPushStrategy components/actionsItem", () => {
expect(wrapper.emitted("input")[1]).toEqual([{ messageType: 3 }]);
expect(wrapper.emitted("remove")).toHaveLength(1);
});
it("handleMessageTypeChange 应在消息类型变更后触发当前表单项校验", async () => {
createWrapper();
await wrapper.vm.handleMessageTypeChange({ messageType: MessageTypeEnum.VARIABLE_IMAGE });
expect(validateFieldMock).toHaveBeenCalledWith("branches[0].actions[0].messageType");
});
});
......@@ -54,14 +54,17 @@
</template>
<script>
import { isFunction } from "lodash-es";
import MessageType from "@/views/marketingManagement/marketingPushStrategy/components/messageType";
import { MessageTypeEnum } from "@/views/marketingManagement/marketingPushStrategy/constant";
export default {
name: "",
components: {
MessageType,
},
inject: ["elForm"],
props: {
showDelActionBtn: {
type: Boolean,
......@@ -148,8 +151,13 @@ export default {
handleActionTypeChange(e) {
this.$emit("input", { ...this.item, actionType: e });
},
handleMessageTypeChange(e) {
async handleMessageTypeChange(e) {
this.$emit("input", e);
if (this?.elForm?.validateField && isFunction(this?.elForm?.validateField)) {
await this.$nextTick();
this?.elForm?.validateField(`${this.propPrefix}.messageType`);
}
},
handleRemoveActions() {
this.$emit("remove");
......
......@@ -102,6 +102,33 @@ describe("marketingPushStrategy components/pageConfig", () => {
expect(addEventListenerSpy).toHaveBeenCalledWith("message", wrapper.vm.eventListenerIframeReady);
});
it("上传校验应按图片和视频分别设置大小限制与提示文案", () => {
const imagePayload = { fileType: "image" };
const videoPayload = { fileType: "video" };
PageConfig.methods.handleBeforeUploadValidate.call({}, imagePayload);
PageConfig.methods.handleBeforeUploadValidate.call({}, videoPayload);
expect(imagePayload).toEqual({
fileType: "image",
maxFileSize: 10,
message: "仅允许上传不超过10M的图片",
});
expect(videoPayload).toEqual({
fileType: "video",
maxFileSize: 50,
message: "仅允许上传不超过50M的视频",
});
});
it("素材表单规则应提示至少上传 1 个图片或视频", () => {
createWrapper();
expect(wrapper.vm.rules.materialJson).toEqual([
{ required: true, message: "请至少上传1个图片或视频", trigger: ["change"] },
]);
});
it("watch materialJson 应同步 file 和 materialList,并保留上传中项", async () => {
const ctx = {
materialList: [
......
......@@ -53,9 +53,10 @@
accept="image/jpeg,image/png,image/bmp,video/mp4"
list-type="text"
type="file"
:file-size="50"
:limit="10"
:show-file-list="false"
@beforeUpload="handleBeforeUpload"
@beforeUploadValidate="handleBeforeUploadValidate"
@change="handleUploadChange"
@error="handleUploadError"
@progress="handleUploadProgress"
......@@ -69,7 +70,7 @@
</div>
</template>
</VenusOssUpload>
<el-popover content="支持JPG\JPEG\PNG\BMP\MP4格式"
<el-popover content="支持JPG/JPEG/PNG/BMP/MP4格式,图片不超过10M,视频不超过50M"
placement="top-start"
trigger="hover">
<i slot="reference" class="el-icon-warning-outline"></i>
......@@ -200,7 +201,7 @@ export default {
{ required: true, message: "请选择素材间隔", trigger: ["change"] },
],
materialJson: [
{ required: true, message: "请上传素材", trigger: ["change"] },
{ required: true, message: "请至少上传1个图片或视频", trigger: ["change"] },
],
},
......@@ -287,6 +288,20 @@ export default {
percentage: 0,
};
},
handleBeforeUploadValidate(payload) {
if (!payload) {
return;
}
if (payload.fileType === "image") {
payload.maxFileSize = 10;
payload.message = "仅允许上传不超过10M的图片";
return;
}
if (payload.fileType === "video") {
payload.maxFileSize = 50;
payload.message = "仅允许上传不超过50M的视频";
}
},
handleBeforeUpload(file) {
if (!file)
return;
......
......@@ -85,7 +85,7 @@ export function getBasicRows(info = {}) {
return [
{ label: "策略名称", value: getValue(basicInfo.strategyName) },
{ label: "适用场景", value: getValue(basicInfo.bizTypeName) },
{ label: "适用门店", value: getValue(basicInfo.storeDescription) },
{ label: "适用门店", value: getValue(basicInfo.storeDescription || basicInfo.storeScopeDesc) },
{ label: "营销阶段", value: getValue(basicInfo.marketingStageName) },
];
}
......@@ -106,7 +106,7 @@ export function getTriggerRows(info = {}) {
{ label: "触发类型", value: getValue(triggerInfo.triggerTypeName) },
{ label: "日期时间变量", value: "客户新车交付日期" },
{ label: "实际触发时间", value: getValue(triggerInfo.triggerTimeDesc) },
{ label: "同时满足以下条件", value: conditionText },
{ label: "同时满足以下条件", value: conditionText || "无" },
];
return rows;
}
......@@ -114,7 +114,7 @@ export function getTriggerRows(info = {}) {
export function getBranchBlocks(info = {}) {
const branches = Array.isArray(info.branches) ? info.branches : [];
return branches.map((branch, branchIndex) => {
const conditionText = flattenConditions(branch.conditionGroups).join(";") || "默认分支";
const conditionText = flattenConditions(branch.conditionGroups).join(";") || "无";
const actions = Array.isArray(branch.actions) ? branch.actions : [];
return {
name: branch.branchName || `分支${branchIndex + 1}`,
......
......@@ -237,15 +237,6 @@ export default {
);
this.selectedCategory = found;
},
handleAddCategory() {
this.categoryDialogMode = "add";
this.currentCategory = {};
this.defaultParentId
= this.selectedCategory && Number(this.selectedCategory.canAddChild) === 1
? this.selectedCategory.id
: "";
this.categoryDialogVisible = true;
},
handleTreeAddChild(data) {
this.categoryDialogMode = "add";
this.currentCategory = {};
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!