fix: 公用函数库编辑权限修复
This commit is contained in:
parent
43af7b9a89
commit
636b60acfa
@ -67,7 +67,7 @@
|
|||||||
<el-divider direction="vertical" />
|
<el-divider direction="vertical" />
|
||||||
<el-tooltip effect="dark" content="删除" placement="top">
|
<el-tooltip effect="dark" content="删除" placement="top">
|
||||||
<el-button
|
<el-button
|
||||||
:disabled="item.permission_type === 'PUBLIC'"
|
:disabled="item.permission_type === 'PUBLIC' && !canEdit(item)"
|
||||||
text
|
text
|
||||||
@click.stop="deleteFunctionLib(item)"
|
@click.stop="deleteFunctionLib(item)"
|
||||||
>
|
>
|
||||||
@ -77,7 +77,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div @click.stop>
|
<div @click.stop>
|
||||||
<el-switch
|
<el-switch
|
||||||
:disabled="item.permission_type === 'PUBLIC'"
|
:disabled="item.permission_type === 'PUBLIC' && !canEdit(item)"
|
||||||
v-model="item.is_active"
|
v-model="item.is_active"
|
||||||
@change="changeState($event, item)"
|
@change="changeState($event, item)"
|
||||||
size="small"
|
size="small"
|
||||||
@ -99,6 +99,9 @@ import { cloneDeep } from 'lodash'
|
|||||||
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, MsgConfirm } from '@/utils/message'
|
import { MsgSuccess, MsgConfirm } from '@/utils/message'
|
||||||
|
import useStore from '@/stores'
|
||||||
|
const { user } = useStore()
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
|
||||||
const FunctionFormDrawerRef = ref()
|
const FunctionFormDrawerRef = ref()
|
||||||
@ -115,6 +118,10 @@ const searchValue = ref('')
|
|||||||
const title = ref('')
|
const title = ref('')
|
||||||
const changeStateloading = ref(false)
|
const changeStateloading = ref(false)
|
||||||
|
|
||||||
|
const canEdit = (row: any) => {
|
||||||
|
return user.userInfo?.id === row.user_id
|
||||||
|
}
|
||||||
|
|
||||||
function openCreateDialog(data?: any) {
|
function openCreateDialog(data?: any) {
|
||||||
title.value = data ? '编辑函数' : '创建函数'
|
title.value = data ? '编辑函数' : '创建函数'
|
||||||
if (data?.permission_type !== 'PUBLIC') {
|
if (data?.permission_type !== 'PUBLIC') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user