Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 函数库增加复制功能 #981

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading