-
-
+
+
-
-
-
- 搜索
-
-
-
- 重置
-
-
-
-
-
diff --git a/modules/Permissions/views/router.ts b/modules/Permissions/views/router.ts
index 6fda820..4590ba2 100644
--- a/modules/Permissions/views/router.ts
+++ b/modules/Permissions/views/router.ts
@@ -13,12 +13,24 @@ const router: RouteRecordRaw[] = [
meta: { title: '角色管理', icon: 'home' },
component: () => import('./roles/index.vue'),
},
+ {
+ path: 'permissions',
+ name: 'permissions',
+ meta: { title: '菜单管理', icon: 'home' },
+ component: () => import('./permissions/index.vue'),
+ },
{
path: 'jobs',
name: 'jobs',
meta: { title: '岗位管理', icon: 'home' },
component: () => import('./jobs/index.vue'),
},
+ {
+ path: 'departments',
+ name: 'departments',
+ meta: { title: '部门管理', icon: 'home' },
+ component: () => import('./departments/index.vue'),
+ },
],
},
]
diff --git a/resources/admin/components/admin/paginate/index.vue b/resources/admin/components/admin/paginate/index.vue
index a3b0b30..3d046af 100644
--- a/resources/admin/components/admin/paginate/index.vue
+++ b/resources/admin/components/admin/paginate/index.vue
@@ -1,29 +1,17 @@
-
-
-
+
+
+
-
+
diff --git a/resources/admin/components/admin/status/index.vue b/resources/admin/components/admin/status/index.vue
index 5f191cd..20372ae 100644
--- a/resources/admin/components/admin/status/index.vue
+++ b/resources/admin/components/admin/status/index.vue
@@ -5,7 +5,6 @@
diff --git a/resources/admin/components/admin/table/operate.vue b/resources/admin/components/admin/table/operate.vue
index 3ff9341..7775ad1 100644
--- a/resources/admin/components/admin/table/operate.vue
+++ b/resources/admin/components/admin/table/operate.vue
@@ -1,21 +1,17 @@
-
+
-
-
diff --git a/resources/admin/composables/curd/useCreate.ts b/resources/admin/composables/curd/useCreate.ts
index f473b83..5f04fb2 100644
--- a/resources/admin/composables/curd/useCreate.ts
+++ b/resources/admin/composables/curd/useCreate.ts
@@ -1,5 +1,5 @@
import http from '/admin/support/http'
-import { ref, unref } from 'vue'
+import { ref, unref, watch } from 'vue'
import { Code } from '/admin/enum/app'
import Message from '/admin/support/message'
import { FormInstance } from 'element-plus'
@@ -64,5 +64,13 @@ export function useCreate(path: string, id: string | number | null = null, _form
.then(() => {})
}
- return { formData, loading, form, submitForm, isClose, beforeCreate, beforeUpdate }
+ const close = (func: Function) => {
+ watch(isClose, function (value) {
+ if (value && isFunction(func)) {
+ func()
+ }
+ })
+ }
+
+ return { formData, loading, form, submitForm, close, beforeCreate, beforeUpdate }
}
diff --git a/resources/admin/composables/curd/useEnabled.ts b/resources/admin/composables/curd/useEnabled.ts
index a3dfd47..b540fd6 100644
--- a/resources/admin/composables/curd/useEnabled.ts
+++ b/resources/admin/composables/curd/useEnabled.ts
@@ -1,19 +1,24 @@
import http from '/admin/support/http'
import { Code } from '/admin/assets/enum/app'
import Message from '/admin/support/message'
-import { ref } from 'vue'
+import { ref, watch } from 'vue'
+import { isFunction } from '/admin/support/helper'
export function useEnabled() {
- const success = ref(false)
+ const isSuccess = ref(false)
const loading = ref
(false)
+ const afterEnabled = ref()
function enabled(path: string, id: string | number, data: object = {}) {
loading.value = true
http
.put(path + '/enable/' + id, data)
.then(r => {
if (r.data.code === Code.SUCCESS) {
- success.value = true
+ isSuccess.value = true
Message.success(r.data.message)
+ if (isFunction(afterEnabled.value)) {
+ afterEnabled.value()
+ }
} else {
Message.error(r.data.message)
}
@@ -23,5 +28,12 @@ export function useEnabled() {
})
}
- return { enabled, success, loading }
+ const success = (func: Function) => {
+ watch(isSuccess, function () {
+ isSuccess.value = false
+ func()
+ })
+ }
+
+ return { enabled, success, loading, afterEnabled }
}
diff --git a/resources/admin/composables/curd/useOpen.ts b/resources/admin/composables/curd/useOpen.ts
new file mode 100644
index 0000000..224a557
--- /dev/null
+++ b/resources/admin/composables/curd/useOpen.ts
@@ -0,0 +1,21 @@
+import { ref } from 'vue'
+import { t } from '/admin/support/helper'
+
+const visible = ref(false)
+const id = ref(null)
+const title = ref('')
+export function useOpen() {
+ const open = (primary: any) => {
+ console.log(primary)
+ title.value = primary ? t('system.edit') : t('system.add')
+ id.value = primary
+ visible.value = true
+ }
+
+ const close = (func: Function) => {
+ visible.value = false
+ func()
+ }
+
+ return { open, close, title, visible, id }
+}
diff --git a/resources/admin/composables/curd/useShow.ts b/resources/admin/composables/curd/useShow.ts
index 4797d25..be62db9 100644
--- a/resources/admin/composables/curd/useShow.ts
+++ b/resources/admin/composables/curd/useShow.ts
@@ -1,14 +1,26 @@
import http from '/admin/support/http'
+import { Ref, ref } from 'vue'
+import { isFunction } from '../../support/helper'
-export function useShow(path: string, id: string | number) {
- return new Promise((resolve, reject) => {
- http
- .get(path + '/' + id)
- .then(response => {
- resolve(response.data)
- })
- .catch(e => {
- reject(e)
- })
+const loading = ref(true)
+
+const data = ref