|
@@ -139,6 +139,24 @@
|
|
|
style="margin: 0 10px"
|
|
|
><br /></el-checkbox
|
|
|
><span>{{ topic.group_name }}</span>
|
|
|
+ <el-button size="small" @click="deleteElement(toindex)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-top"
|
|
|
+ @click="moveElement(topic, toindex, 'up')"
|
|
|
+ >上移</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-bottom"
|
|
|
+ @click="moveElement(topic, toindex, 'down')"
|
|
|
+ >下移</el-button
|
|
|
+ >
|
|
|
</div>
|
|
|
<span @click="handleChangeTab(topic)">
|
|
|
{{ topic.contentShow ? "收起" : "展开" }}
|
|
@@ -1935,6 +1953,29 @@ export default {
|
|
|
});
|
|
|
window.getSelection().removeAllRanges();
|
|
|
},
|
|
|
+ deleteElement(index) {
|
|
|
+ this.$confirm(`确定要删除吗?`, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ if(this.question_list.cur_fn_data.length>1){
|
|
|
+ this.question_list.cur_fn_data.splice(index, 1);
|
|
|
+ }else{
|
|
|
+ this.question_list.cur_fn_data = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ moveElement(dItem, index, type) {
|
|
|
+ let obj = JSON.parse(JSON.stringify(dItem));
|
|
|
+ if (type == "up" && index > 0) {
|
|
|
+ this.question_list.cur_fn_data.splice(index - 1, 0, obj);
|
|
|
+ this.question_list.cur_fn_data.splice(index + 1, 1);
|
|
|
+ }
|
|
|
+ if (type == "down" && index < this.question_list.cur_fn_data.length - 1) {
|
|
|
+ this.question_list.cur_fn_data[index] = this.question_list.cur_fn_data.splice(index + 1, 1, this.question_list.cur_fn_data[index])[0]
|
|
|
+ }
|
|
|
+ },
|
|
|
}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
|
</script>
|