@@ -113,8 +113,21 @@ const remove = (e) => {
113113 emit (' remove' , e);
114114};
115115
116- const copyStep = (id ) => {
117- emit (' copyStep' , id);
116+ /**
117+ * 拷贝步骤的方法
118+ * @param {*} id 步骤id
119+ * @param {*} toLast 是否复制到最后一行
120+ */
121+ const copyStep = (id , toLast ) => {
122+ emit (' copyStep' , id, toLast);
123+ };
124+ /**
125+ * 添加步骤到特定位置的方法
126+ * @param {*} id 点选的位置
127+ * @param {*} toNext true添加到下一行,false添加到上一行
128+ */
129+ const addStepTotarget = (id , toNext ) => {
130+ emit (' addStepTotarget' , id, toNext);
118131};
119132 </script >
120133
@@ -241,7 +254,7 @@ const copyStep = (id) => {
241254 <div
242255 style ="
243256 float : right ;
244- flex : 0 0 205 px ;
257+ flex : 0 0 245 px ;
245258 text-align : right ;
246259 margin-right : 12px ;
247260 "
@@ -266,16 +279,51 @@ const copyStep = (id) => {
266279 <Edit />
267280 </el-icon >
268281 </el-button >
269- <el-button
270- circle
271- type =" primary"
272- size =" mini"
273- @click =" copyStep(s.id)"
282+
283+ <!-- 添加操作的按钮-->
284+ <el-popconfirm
285+ v-if =" s.parentId === 0 && !isEdit"
286+ style =" margin-left : 10px "
287+ :confirm-button-text =" $t('steps.addToNextLine')"
288+ :cancel-button-text =" $t('steps.addToBeforeLine')"
289+ confirm-button-type =" text"
290+ icon =" el-icon-warning"
291+ icon-color =" green"
292+ :title =" $t('steps.addStepTips')"
293+ @confirm =" addStepTotarget(s.id, true)"
294+ @cancel =" addStepTotarget(s.id, false)"
274295 >
275- <el-icon :size =" 13" style =" vertical-align : middle " >
276- <CopyDocument />
277- </el-icon >
278- </el-button >
296+ <template #reference >
297+ <el-button circle type =" primary" size =" mini" >
298+ <el-icon :size =" 13" style =" vertical-align : middle " >
299+ <DocumentAdd />
300+ </el-icon >
301+ </el-button >
302+ </template >
303+ </el-popconfirm >
304+
305+ <!-- 复制操作的按钮-->
306+ <el-popconfirm
307+ v-if =" !isEdit"
308+ style =" margin-left : 10px "
309+ :confirm-button-text =" $t('steps.copyToLastLine')"
310+ :cancel-button-text =" $t('steps.copyToNextLine')"
311+ confirm-button-type =" text"
312+ icon =" el-icon-warning"
313+ icon-color =" green"
314+ :title =" $t('steps.copyStepTips')"
315+ @confirm =" copyStep(s.id, true)"
316+ @cancel =" copyStep(s.id, false)"
317+ >
318+ <template #reference >
319+ <el-button circle type =" primary" size =" mini" >
320+ <el-icon :size =" 13" style =" vertical-align : middle " >
321+ <CopyDocument />
322+ </el-icon >
323+ </el-button >
324+ </template >
325+ </el-popconfirm >
326+
279327 <el-button class =" handle" circle size =" mini" >
280328 <el-icon :size =" 13" style =" vertical-align : middle " >
281329 <Rank />
0 commit comments