|
@@ -10,7 +10,7 @@
|
|
|
<van-icon name="question-o" size="24" @click="showHelpDoc = true" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="container">
|
|
|
+ <div class="container" ref="stepListRef">
|
|
|
<div class="card-group" v-if="crtCommand!.stepList.length">
|
|
|
<VueDraggableNext :list="crtCommand!.stepList" animation="250" :delay="500">
|
|
|
<div class="card" v-for="(item, index) in crtCommand!.stepList">
|
|
@@ -400,7 +400,10 @@ const handleEditCommand = (type: string, index: number, cIndex?: number) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const handleAddCommand = (type: string) => {
|
|
|
+const stepListRef = ref<HTMLDivElement>()
|
|
|
+let flag = false
|
|
|
+let timer: any
|
|
|
+const handleAddCommand = async (type: string) => {
|
|
|
if (!crtCommand.value) return
|
|
|
if (type === 'del') {
|
|
|
if (crtProject.value && crtCommand.value) {
|
|
@@ -423,6 +426,9 @@ const handleAddCommand = (type: string) => {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+ if (flag) return
|
|
|
+ if (timer) clearTimeout(timer)
|
|
|
+ flag = true
|
|
|
const endCMD = crtCommand.value.stepList[crtCommand.value.stepList.length - 1]
|
|
|
const isExistTime = endCMD?.list?.some((item) => item.type === 'time')
|
|
|
const x = endCMD?.x || crtCommand.value.x
|
|
@@ -478,6 +484,13 @@ const handleAddCommand = (type: string) => {
|
|
|
})
|
|
|
break
|
|
|
}
|
|
|
+ await nextTick()
|
|
|
+ if (stepListRef.value && stepListRef.value.scrollHeight > stepListRef.value.clientHeight) {
|
|
|
+ stepListRef.value.scroll({ top: stepListRef.value.scrollHeight, behavior: 'smooth' })
|
|
|
+ }
|
|
|
+ timer = setTimeout(() => {
|
|
|
+ flag = false
|
|
|
+ }, 300)
|
|
|
}
|
|
|
|
|
|
const handleSaveCommand = () => {
|
|
@@ -687,7 +700,7 @@ const showBtnGroup = ref(true)
|
|
|
bottom: 64px;
|
|
|
right: 16px;
|
|
|
padding: 16px;
|
|
|
- background-color: rgba(255, 255, 255, 0.7);
|
|
|
+ background-color: rgba(255, 255, 255);
|
|
|
border-radius: 4px;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
@@ -695,12 +708,13 @@ const showBtnGroup = ref(true)
|
|
|
gap: 8px;
|
|
|
max-width: 90%;
|
|
|
transition: all 0.3s;
|
|
|
+ box-shadow: 0 0 2px 2px #ccc;
|
|
|
}
|
|
|
.unfold {
|
|
|
position: fixed;
|
|
|
bottom: 72px;
|
|
|
right: 16px;
|
|
|
- background-color: rgba(255, 255, 255, 0.7);
|
|
|
+ background-color: rgba(255, 255, 255);
|
|
|
border-radius: 4px;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
@@ -710,6 +724,8 @@ const showBtnGroup = ref(true)
|
|
|
height: 48px;
|
|
|
font-size: 28px;
|
|
|
transition: all 0.3s;
|
|
|
+ color: #4fb5f9;
|
|
|
+ box-shadow: 0 0 2px 2px #ccc;
|
|
|
}
|
|
|
.pack {
|
|
|
display: flex;
|