Skip to content

Commit

Permalink
feat: 函数库增加复制功能
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdan-fit2cloud committed Aug 15, 2024
1 parent 845ee52 commit 9d5ea64
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/views/function-lib/component/FunctionFormDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const form = ref<functionLibData>({
watch(visible, (bool) => {
if (!bool) {
isEdit.value = false
showEditor.value = true
showEditor.value = false
currentIndex.value = null
form.value = {
name: '',
Expand Down
15 changes: 13 additions & 2 deletions ui/src/views/function-lib/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<template #footer>
<div class="footer-content">
<el-tooltip effect="dark" content="复制" placement="top">
<el-button text>
<el-button text @click.stop="copyFunctionLib(item)">
<AppIcon iconName="app-copy"></AppIcon>
</el-button>
</el-tooltip>
Expand All @@ -73,7 +73,7 @@
import { ref, onMounted, reactive } from 'vue'
import functionLibApi from '@/api/function-lib'
import FunctionFormDrawer from './component/FunctionFormDrawer.vue'
import { MsgSuccess, MsgError } from '@/utils/message'
const loading = ref(false)
const FunctionFormDrawerRef = ref()
Expand Down Expand Up @@ -114,6 +114,17 @@ function deleteFunctionLib(row: any) {
// .catch(() => {})
}
function copyFunctionLib(row: any) {
delete row['id']
functionLibApi.postFunctionLib(row, loading).then((res) => {
MsgSuccess('复制成功')
paginationConfig.total = 0
paginationConfig.current_page = 1
functionLibList.value = []
getList()
})
}
function getList() {
functionLibApi
.getFunctionLib(paginationConfig, searchValue.value && { name: searchValue.value }, loading)
Expand Down

0 comments on commit 9d5ea64

Please sign in to comment.