feat:动态权限
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { ref } from 'vue'
|
||||
import { t } from '/admin/support/helper'
|
||||
|
||||
const visible = ref<boolean>(false)
|
||||
const id = ref(null)
|
||||
const title = ref<string>('')
|
||||
export function useOpen() {
|
||||
const visible = ref<boolean>(false)
|
||||
const id = ref(null)
|
||||
const title = ref<string>('')
|
||||
|
||||
const open = (primary: any) => {
|
||||
console.log(primary)
|
||||
title.value = primary ? t('system.edit') : t('system.add')
|
||||
id.value = primary
|
||||
visible.value = true
|
||||
|
@@ -2,14 +2,14 @@ import http from '/admin/support/http'
|
||||
import { Ref, ref } from 'vue'
|
||||
import { isFunction } from '../../support/helper'
|
||||
|
||||
const loading = ref<boolean>(true)
|
||||
|
||||
const data = ref<object>()
|
||||
|
||||
// 后置钩子
|
||||
const afterShow = ref()
|
||||
|
||||
export function useShow(path: string, id: string | number, fillData: null | Ref = null) {
|
||||
const loading = ref<boolean>(true)
|
||||
|
||||
const data = ref<object>()
|
||||
|
||||
// 后置钩子
|
||||
const afterShow = ref()
|
||||
|
||||
http.get(path + '/' + id).then(r => {
|
||||
loading.value = false
|
||||
data.value = r.data.data
|
||||
|
Reference in New Issue
Block a user