mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: 函数库增加复制功能
This commit is contained in:
parent
845ee524c4
commit
5681d2d895
|
|
@ -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: '',
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -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()
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue