Commit 01ef7b8d by Jaxon

chron(marketingPushStrategy): 详情 - 调试代码

1 parent c0cf1f5e
{
"mcpServers": {
"codegraph": {
"type": "stdio",
"command": "codegraph",
"args": [
"serve",
"--mcp"
]
}
}
}
<template>
<div class="wrapper">
<div style="width:800px">
<!-- <VariableTextarea v-model="test" /> -->
<ConditionGroup style="width:880px;margin:0 0 0 30px;padding-top:30px;" :options="options" />
<div style="margin-left:30px;padding">
<glsx-combi-form label-width="150px"
:form-data="formSchema"
:form-obj="form"
:form-rules="formRules"
:inline="false">
<template #_branchList>
<el-form label-width="150px" size="small">
<BranchItem v-for="(branch, index) in form.branches"
:key="branch._key"
:branch="branch"
:options="{
messageVariables: options.messageVariables,
triggers: options.triggers,
}"
:title="`分支${index + 1}`"
@appendAction="handleAppendAction(index)"
@input="handleBranchChange($event, index)"
@removeAction="handleRemoveAction($event, index)"
@removeBranch="handleRemoveBranch(index)" />
<el-button block @click="handleAppendBranch">
<i class="el-icon-plus "></i>
添加分支
</el-button>
</el-form>
</template>
</glsx-combi-form>
</div>
<!-- <div class="step3-wrapper">
<div class="title-wrapper">
③ 就执行以下动作
</div>
</div>
<glsx-combi-form default-width="400px"
label-width="150px"
:form-data="formSchema"
:form-obj="form"
:form-rules="formRules">
<template #_label4>
<div>默认执行第一条满足条件规则的分支</div>
</template>
</glsx-combi-form> -->
<!-- <div style="width:800px">
<ConditionGroup style="width:880px;margin:0 0 0 30px;padding-top:30px;"
:options="{
conditionVariables: getStep2ConditionOptions,
}" />
</div> -->
</div>
</template>
<script>
import { nanoid } from "nanoid";
import { getMetaOptions } from "@/views/marketingManagement/marketingPushStrategy/api/index.js";
import BranchItem from "@/views/marketingManagement/marketingPushStrategy/components/branchItem/index.vue";
import ConditionGroup from "@/views/marketingManagement/marketingPushStrategy/components/conditionGroup/index.vue";
import VariableTextarea from "@/views/marketingManagement/marketingPushStrategy/components/variableTextarea/index.vue";
import { getDefaultAction, getDefaultBranch, MessageTypeEnum } from "@/views/marketingManagement/marketingPushStrategy/constant";
import { replaceCodeWithName } from "@/views/marketingManagement/marketingPushStrategy/utils/index.js";
import { getModifySchema } from "./modify.data";
export default {
name: "",
components: {
BranchItem,
ConditionGroup,
VariableTextarea,
},
......@@ -24,18 +80,51 @@ export default {
data() {
return {
test: "123",
form: {
actionConfirmType: 0,
branches: [getDefaultBranch()],
},
formSchema: [],
formRules: {},
options: {
conditionVariables: [],
step2ConditionVariables: [],
stages: [],
triggers: [],
messageVariables: [],
},
};
},
computed: {
getStep2ConditionOptions() {
return this.options.step2ConditionVariables;
},
},
async mounted() {
this.formSchema = await getModifySchema();
await this.getData();
},
methods: {
handleSubmit() {
console.log(this.form);
},
handleRemoveAction(actionIndex, branchIndex) {
this.form.branches[branchIndex].actions.splice(actionIndex, 1);
},
handleAppendBranch() {
this.form.branches.push(getDefaultBranch());
},
handleRemoveBranch(branchIndex) {
this.form.branches.splice(branchIndex, 1);
},
handleAppendAction(branchIndex) {
this.form.branches[branchIndex].actions.push(getDefaultAction());
},
handleBranchChange({ actionIndex, actionItem }, branchIndex) {
this.$set(this.form.branches[branchIndex].actions, actionIndex, actionItem);
},
async getData() {
const data = await getMetaOptions();
Object.assign(this.options, data);
......@@ -50,5 +139,11 @@ export default {
background-color: white;
height: 100%;
margin: 0 20px 20px;
::v-deep .branch-item-wrapper {
margin-top: 12px;
&:first-child {
margin-top: 0;
}
}
}
</style>
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",
},
];
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!