feat: 函数库增加复制功能
This commit is contained in:
parent
845ee524c4
commit
5681d2d895
@ -141,7 +141,7 @@ const form = ref<functionLibData>({
|
|||||||
watch(visible, (bool) => {
|
watch(visible, (bool) => {
|
||||||
if (!bool) {
|
if (!bool) {
|
||||||
isEdit.value = false
|
isEdit.value = false
|
||||||
showEditor.value = true
|
showEditor.value = false
|
||||||
currentIndex.value = null
|
currentIndex.value = null
|
||||||
form.value = {
|
form.value = {
|
||||||
name: '',
|
name: '',
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="footer-content">
|
<div class="footer-content">
|
||||||
<el-tooltip effect="dark" content="复制" placement="top">
|
<el-tooltip effect="dark" content="复制" placement="top">
|
||||||
<el-button text>
|
<el-button text @click.stop="copyFunctionLib(item)">
|
||||||
<AppIcon iconName="app-copy"></AppIcon>
|
<AppIcon iconName="app-copy"></AppIcon>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
import { ref, onMounted, reactive } from 'vue'
|
import { ref, onMounted, reactive } from 'vue'
|
||||||
import functionLibApi from '@/api/function-lib'
|
import functionLibApi from '@/api/function-lib'
|
||||||
import FunctionFormDrawer from './component/FunctionFormDrawer.vue'
|
import FunctionFormDrawer from './component/FunctionFormDrawer.vue'
|
||||||
|
import { MsgSuccess, MsgError } from '@/utils/message'
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
const FunctionFormDrawerRef = ref()
|
const FunctionFormDrawerRef = ref()
|
||||||
@ -114,6 +114,17 @@ function deleteFunctionLib(row: any) {
|
|||||||
// .catch(() => {})
|
// .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() {
|
function getList() {
|
||||||
functionLibApi
|
functionLibApi
|
||||||
.getFunctionLib(paginationConfig, searchValue.value && { name: searchValue.value }, loading)
|
.getFunctionLib(paginationConfig, searchValue.value && { name: searchValue.value }, loading)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user