Skip to content

Commit

Permalink
feat: add step disabled show
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Mar 17, 2023
1 parent 41ef406 commit 44942d5
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/components/ChildStepListView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,33 @@ const props = defineProps({
<el-card v-if="s.conditionType !== 0">
<template #header>
<step-show :step="s"></step-show>
<div style="float: right">
<el-switch
v-model="s.disabled"
:active-value="0"
:inactive-value="1"
active-color="#67C23A"
width="30"
size="large"
disabled
></el-switch>
</div>
</template>
<child-step-list-view :steps="s['childSteps']" />
</el-card>
<div v-else style="display: flex; justify-content: space-between">
<step-show :step="s"></step-show>
<div style="float: right">
<el-switch
v-model="s.disabled"
:active-value="0"
:inactive-value="1"
active-color="#67C23A"
width="30"
size="large"
disabled
></el-switch>
</div>
</div>
</el-timeline-item>
</el-timeline>
Expand Down
38 changes: 37 additions & 1 deletion src/components/StepDraggable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ const emit = defineEmits([
'remove',
'copyStep',
]);
const switchStep = (id, e) => {
axios
.get('/controller/steps/switchStep', {
params: {
id,
type: e,
},
})
.then((resp) => {
if (resp.code === 2000) {
ElMessage.success({
message: resp.message,
});
}
});
};
const sortStep = (e) => {
if (props.isEdit && props.steps[e.moved.newIndex].parentId === 0) {
return;
Expand Down Expand Up @@ -130,8 +146,18 @@ const copyStep = (id) => {
<template #header>
<step-show :step="s"></step-show>
<div style="float: right">
<el-switch
v-model="s.disabled"
:active-value="0"
:inactive-value="1"
active-color="#67C23A"
width="30"
size="large"
@change="switchStep(s.id, $event)"
></el-switch>
<el-button
circle
style="margin-left: 10px"
type="primary"
size="mini"
@click="addStep(s.id)"
Expand Down Expand Up @@ -207,8 +233,18 @@ const copyStep = (id) => {
</el-card>
<div v-else style="display: flex; justify-content: space-between">
<step-show :step="s"></step-show>
<div style="float: right; flex: 0 0 185px; text-align: right">
<div style="float: right; flex: 0 0 205px; text-align: right">
<el-switch
v-model="s.disabled"
:active-value="0"
:inactive-value="1"
active-color="#67C23A"
width="30"
size="large"
@change="switchStep(s.id, $event)"
></el-switch>
<el-button
style="margin-left: 10px"
circle
type="primary"
size="mini"
Expand Down
2 changes: 1 addition & 1 deletion src/views/PublicStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ onMounted(() => {
<el-dialog
v-model="dialogVisible"
:title="$t('publicStepTS.info')"
width="750px"
width="70%"
>
<public-step-update
v-if="dialogVisible"
Expand Down

0 comments on commit 44942d5

Please sign in to comment.