-
-
- 新增
-
-
-
-
+
-
diff --git a/src/views/auth/menu/menu.vue b/src/views/auth/menu/menu.vue
new file mode 100644
index 0000000..0fd4e8d
--- /dev/null
+++ b/src/views/auth/menu/menu.vue
@@ -0,0 +1,160 @@
+
+
+
+
+
diff --git a/src/views/auth/menu/popupApi.vue b/src/views/auth/menu/popupApi.vue
new file mode 100644
index 0000000..2ebe565
--- /dev/null
+++ b/src/views/auth/menu/popupApi.vue
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 普通接口
+ 公用接口
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/auth/menu/popupForm.vue b/src/views/auth/menu/popupMenu.vue
similarity index 87%
rename from src/views/auth/menu/popupForm.vue
rename to src/views/auth/menu/popupMenu.vue
index 4a5a4aa..d4fc445 100644
--- a/src/views/auth/menu/popupForm.vue
+++ b/src/views/auth/menu/popupMenu.vue
@@ -46,10 +46,18 @@ import TableStore from '@/utils/tableStore'
import IconSelector from '@/components/baInput/components/iconSelector.vue'
import { updateMenu, addMenu } from '@/api/systerm'
+defineOptions({
+ name: 'auth/menu/popupMenu'
+})
+const emits = defineEmits<{
+ (e: 'init'): void
+}>()
const tableStore = inject('tableStore') as TableStore
const cascaderProps = {
label: 'title',
- value: 'id'
+ value: 'id',
+ checkStrictly: true,
+ emitPath: false
}
const form: any = reactive({
code: '',
@@ -69,20 +77,20 @@ const title = ref('新增菜单')
const open = (text: string, data?: anyObj) => {
console.log(data)
title.value = text
+ // 重置表单
+ for (let key in form) {
+ form[key] = ''
+ }
+ form.pid = '0'
+ form.sort = 0
+ form.type = 0
+
if (data) {
for (let key in form) {
- form[key] = data[key]
+ form[key] = data[key] || ''
}
- form.path = data.routePath
- form.name = data.title
- } else {
- // 重置表单
- for (let key in form) {
- form[key] = ''
- }
- form.pid = '0'
- form.sort = 0
- form.type = 0
+ form.path = data.routePath || ''
+ form.name = data.title || ''
}
dialogVisible.value = true
}
@@ -95,9 +103,9 @@ const submit = async () => {
delete obj.id
await addMenu(obj)
}
- tableStore.index()
+ emits('init')
dialogVisible.value = false
}
defineExpose({ open })
-
+
\ No newline at end of file
diff --git a/types/table.d.ts b/types/table.d.ts
index 7611eeb..7430c77 100644
--- a/types/table.d.ts
+++ b/types/table.d.ts
@@ -1,12 +1,12 @@
import Table from '@/components/table/index.vue'
import { Component } from 'vue'
-import type { VxeColumnProps } from 'vxe-table'
+import type { VxeColumnProps, VxeTableInstance } from 'vxe-table'
import type { PopconfirmProps, ButtonType, ButtonProps } from 'element-plus'
import { Mutable } from 'element-plus/es/utils'
declare global {
interface CnTable {
- ref: typeof Table | null
+ ref: VxeTableInstance | null
data: TableRow[] | any
// 前端分页数据
webPagingData: TableRow[][]