mirror of
https://github.com/zclzone/vue-naive-admin.git
synced 2025-04-30 22:29:01 +08:00
Merge branch '2.x' of https://gitee.com/isme-admin/vue-naive-admin into 2.x
This commit is contained in:
commit
0a0c970f5c
@ -145,6 +145,7 @@ async function handleQuery() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
pagination.itemCount = 0
|
pagination.itemCount = 0
|
||||||
}
|
}
|
||||||
|
@ -144,11 +144,12 @@ async function handleOk(data) {
|
|||||||
// 调用onOk函数,传入data参数
|
// 调用onOk函数,传入data参数
|
||||||
const res = await modalOptions.value.onOk(data)
|
const res = await modalOptions.value.onOk(data)
|
||||||
// 如果onOk函数的返回值不为false,则关闭模态框
|
// 如果onOk函数的返回值不为false,则关闭模态框
|
||||||
res !== false && close()
|
if (res !== false)
|
||||||
|
close()
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
okLoading.value = false
|
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
okLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,11 +164,12 @@ async function handleCancel(data) {
|
|||||||
const res = await modalOptions.value.onCancel(data)
|
const res = await modalOptions.value.onCancel(data)
|
||||||
|
|
||||||
// 如果onCancel函数的返回值不为false,则关闭模态框
|
// 如果onCancel函数的返回值不为false,则关闭模态框
|
||||||
res !== false && close()
|
if (res !== false)
|
||||||
|
close()
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
okLoading.value = false
|
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
okLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ export function useCrud({ name, initForm = {}, doCreate, doDelete, doUpdate, ref
|
|||||||
data && refresh(data)
|
data && refresh(data)
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
okLoading.value = false
|
okLoading.value = false
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -103,6 +104,7 @@ export function useCrud({ name, initForm = {}, doCreate, doDelete, doUpdate, ref
|
|||||||
refresh(data, true)
|
refresh(data, true)
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
d.loading = false
|
d.loading = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -119,7 +119,8 @@ function handleHideDropdown() {
|
|||||||
|
|
||||||
function handleSelect(key) {
|
function handleSelect(key) {
|
||||||
const actionFn = actionMap.get(key)
|
const actionFn = actionMap.get(key)
|
||||||
actionFn && actionFn()
|
if (typeof actionFn === 'function')
|
||||||
|
actionFn()
|
||||||
handleHideDropdown()
|
handleHideDropdown()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -47,6 +47,7 @@ class Storage {
|
|||||||
return def
|
return def
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
this.remove(key)
|
this.remove(key)
|
||||||
return def
|
return def
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ import icons from 'isme:icons'
|
|||||||
const { copy, copied } = useClipboard()
|
const { copy, copied } = useClipboard()
|
||||||
|
|
||||||
watch(copied, (val) => {
|
watch(copied, (val) => {
|
||||||
val && $message.success('已复制到剪切板')
|
if (val)
|
||||||
|
$message.success('已复制到剪切板')
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -70,7 +70,8 @@ const imgList = reactive([
|
|||||||
])
|
])
|
||||||
|
|
||||||
watch(copied, (val) => {
|
watch(copied, (val) => {
|
||||||
val && $message.success('已复制到剪切板')
|
if (val)
|
||||||
|
$message.success('已复制到剪切板')
|
||||||
})
|
})
|
||||||
|
|
||||||
function onBeforeUpload({ file }) {
|
function onBeforeUpload({ file }) {
|
||||||
|
@ -28,8 +28,8 @@
|
|||||||
:on-update:selected-keys="onSelect"
|
:on-update:selected-keys="onSelect"
|
||||||
key-field="code"
|
key-field="code"
|
||||||
label-field="name"
|
label-field="name"
|
||||||
default-expand-all
|
|
||||||
block-line
|
block-line default-expand-all
|
||||||
/>
|
/>
|
||||||
</n-space>
|
</n-space>
|
||||||
|
|
||||||
@ -115,6 +115,7 @@ function handleDelete(item) {
|
|||||||
emit('update:currentMenu', null)
|
emit('update:currentMenu', null)
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
$message.destroy('deleteMenu')
|
$message.destroy('deleteMenu')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -231,6 +231,7 @@ function handleDeleteBtn(id) {
|
|||||||
d.loading = false
|
d.loading = false
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
d.loading = false
|
d.loading = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -248,6 +249,7 @@ async function handleEnable(item) {
|
|||||||
item.enableLoading = false
|
item.enableLoading = false
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
item.enableLoading = false
|
item.enableLoading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,9 +74,8 @@
|
|||||||
:data="permissionTree"
|
:data="permissionTree"
|
||||||
:checked-keys="modalForm.permissionIds"
|
:checked-keys="modalForm.permissionIds"
|
||||||
:on-update:checked-keys="(keys) => (modalForm.permissionIds = keys)"
|
:on-update:checked-keys="(keys) => (modalForm.permissionIds = keys)"
|
||||||
checkable
|
|
||||||
check-on-click
|
default-expand-all checkable check-on-click
|
||||||
default-expand-all
|
|
||||||
class="cus-scroll max-h-200 w-full"
|
class="cus-scroll max-h-200 w-full"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
@ -211,6 +210,7 @@ async function handleEnable(row) {
|
|||||||
$table.value?.handleSearch()
|
$table.value?.handleSearch()
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
row.enableLoading = false
|
row.enableLoading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -279,6 +279,7 @@ async function handleEnable(row) {
|
|||||||
$table.value?.handleSearch()
|
$table.value?.handleSearch()
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
console.error(error)
|
||||||
row.enableLoading = false
|
row.enableLoading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user