Commit 0a549a88 by Jaxon

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

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