Commit 0a549a88 by Jaxon

refactor(marketingPushStrategy): 提取动作执行确认选项为常量并清理无用代码

新增动作执行确认的单选选项常量配置,移除modify.data.js中无用的getModifySchema函数,修复集成测试中beforeEach与afterEach的声明顺序,在编辑页面导入并注册新增的常量选项
1 parent ca1b4195
......@@ -46,7 +46,9 @@ describe("marketingPushStrategy 执行记录集成测试", () => {
});
return wrapper;
}
beforeEach(() => {
consoleLogSpy = jest.spyOn(console, "log").mockImplementation(() => {});
});
afterEach(() => {
if (wrapper) {
wrapper.destroy();
......@@ -57,10 +59,6 @@ describe("marketingPushStrategy 执行记录集成测试", () => {
jest.clearAllMocks();
});
beforeEach(() => {
consoleLogSpy = jest.spyOn(console, "log").mockImplementation(() => {});
});
function getDetailDialogVm() {
return wrapper.vm.$children.find(child => child.$options && child.$options.name === "DetailDialog");
}
......
......@@ -112,11 +112,10 @@
label="动作执行确认:"
required>
<el-radio-group v-model="form.actionConfirmType">
<el-radio :label="0">
自动执行
</el-radio>
<el-radio :label="1">
需驻店人员确认
<el-radio v-for="opt in options.actionConfirmOptions"
:key="opt.value"
:label="opt.value">
{{ opt.label }}
</el-radio>
</el-radio-group>
</el-form-item>
......@@ -158,7 +157,7 @@ import { createStrategy, getMarketingPushStrategyDetailApi, getMetaOptionsApi, u
import BranchGroup from "@/views/marketingManagement/marketingPushStrategy/components/branchGroup/index.vue";
import ConditionPanel from "@/views/marketingManagement/marketingPushStrategy/components/conditionPanel/index.vue";
import SelectStoreDialog from "@/views/marketingManagement/marketingPushStrategy/components/selectStoreDialog/index.vue";
import { getDefaultBranch, hourOptions, MessageTypeEnum, minuteOptions, relativeDateTypeOpt } from "@/views/marketingManagement/marketingPushStrategy/constant";
import { actionConfirmOptions, getDefaultBranch, hourOptions, MessageTypeEnum, minuteOptions, relativeDateTypeOpt } from "@/views/marketingManagement/marketingPushStrategy/constant";
import { getFormSchema, getSpecFormSchema, rules } from "@/views/marketingManagement/marketingPushStrategy/views/modify/modify.data.js";
export default {
......@@ -208,6 +207,7 @@ export default {
relativeDateTypeOpt,
hourOptions,
minuteOptions,
actionConfirmOptions,
},
dialog: {
step2ConditionGroup: {
......
import { bizTypeOpt, storeTypeOpt } from "@/views/marketingManagement/marketingPushStrategy/constant";
import { actionConfirmOptions } from "@/views/marketingManagement/marketingPushStrategy/constant/index";
export function getModifySchema() {
return [
{
addHtml: "_label3",
},
{
label: "动作执行确认",
name: "actionConfirmType",
type: "radio",
optionList: actionConfirmOptions,
optionId: "value",
optionLabel: "label",
},
{
labelWidth: "0px",
addHtml: "_branchList",
},
];
}
export const rules = {
strategyName: [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!