From 4f20b48b378feb1f3eca60760dc6e57cbe9caf48 Mon Sep 17 00:00:00 2001 From: mengyxu Date: Tue, 5 Mar 2024 15:34:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=9D=83=E9=99=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E7=9B=B8=E5=85=B3=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/App.vue | 6 +- packages/base/data/list-table.vue | 2 +- packages/base/data/modify-form.vue | 27 +++-- packages/base/data/table-action.vue | 2 + packages/base/item/button.vue | 2 +- packages/base/item/select.vue | 2 +- packages/manage/common/head.vue | 3 +- packages/manage/common/menu-tree.vue | 2 +- packages/manage/router/index.vue | 22 +++- packages/manage/views/buffer.vue | 9 +- packages/manage/views/index.ts | 11 +- packages/manage/views/login.vue | 3 +- packages/manage/views/permission.vue | 13 +-- packages/manage/views/role.vue | 145 ++++++++++++++++++++++++++- packages/manage/views/user.vue | 134 +++++++++++++++++++++++++ plugs/api/index.ts | 2 + plugs/api/permission.ts | 36 +++++-- plugs/api/public.ts | 18 ++++ plugs/api/role.ts | 88 ++++++++++++++++ plugs/api/user.ts | 87 ++++++++++++++++ plugs/element/message.ts | 2 +- plugs/element/rule.ts | 75 +++++++------- plugs/http/axios.ts | 8 +- plugs/i18n/en.ts | 36 +++++-- plugs/i18n/zh.ts | 22 +++- plugs/store/index.ts | 19 +++- 26 files changed, 681 insertions(+), 95 deletions(-) create mode 100644 packages/manage/views/user.vue create mode 100644 plugs/api/role.ts create mode 100644 plugs/api/user.ts diff --git a/examples/App.vue b/examples/App.vue index f6ab9d5..82fe77e 100644 --- a/examples/App.vue +++ b/examples/App.vue @@ -1,5 +1,5 @@ @@ -9,14 +9,14 @@ import { useStore } from "vuex"; import { Index, Views } from "noob-mengyxu"; const store = useStore(); -const { buff, dictionary, config, permission, role, status, log } = Views.menus; +const { buff, dictionary, config, permission, role, user, status, log } = Views.menus; const menus = [ { i18n: "menu.home", path: "home", icon: "HomeFilled" }, { i18n: "menu.operator", path: "operator", icon: "Platform", children: [ - buff, dictionary, config, permission, role, status, log + buff, dictionary, config, permission, role, user, status, log ] }, { diff --git a/packages/base/data/list-table.vue b/packages/base/data/list-table.vue index 2345af6..6b9ee63 100644 --- a/packages/base/data/list-table.vue +++ b/packages/base/data/list-table.vue @@ -90,7 +90,7 @@ const getValue = ( value: any, index?: number ) => { - if ((value == null || value == '') && value !== 0) { + if ((typeof value === 'undefined' || value === null || value === '') && value !== 0) { return '--'; } return value; diff --git a/packages/base/data/modify-form.vue b/packages/base/data/modify-form.vue index ba6f8c6..937581f 100644 --- a/packages/base/data/modify-form.vue +++ b/packages/base/data/modify-form.vue @@ -2,16 +2,19 @@
- - - - - - + {{ t('base.confirm') }} @@ -49,6 +52,10 @@ const prop = defineProps({ type: String, default: null, }, + modify: { + type: Boolean, + default: false, + }, items: { type: Array(), default: [], diff --git a/packages/base/data/table-action.vue b/packages/base/data/table-action.vue index 6d4bc0a..b435113 100644 --- a/packages/base/data/table-action.vue +++ b/packages/base/data/table-action.vue @@ -1,4 +1,5 @@ \ No newline at end of file diff --git a/packages/manage/views/index.ts b/packages/manage/views/index.ts index c3c960b..592acd3 100644 --- a/packages/manage/views/index.ts +++ b/packages/manage/views/index.ts @@ -4,6 +4,7 @@ import Config from './config.vue'; import Dictionary from './dictionary.vue'; import Permission from './permission.vue'; import Role from './role.vue'; +import User from './user.vue'; import Status from './status.vue'; import Log from './log.vue'; const routes = [ @@ -37,6 +38,11 @@ const routes = [ name: 'role', component: Role, }, + { + path: '/user', + name: 'user', + component: User, + }, { path: '/status', name: 'status', @@ -62,7 +68,8 @@ const menus = { icon: 'Unlock', }, role: { i18n: 'preMenu.operator.4', path: 'role', icon: 'User' }, - status: { i18n: 'preMenu.operator.5', path: 'status', icon: 'Setting' }, - log: { i18n: 'preMenu.operator.6', path: 'log', icon: 'Document' }, + user: { i18n: 'preMenu.operator.5', path: 'user', icon: 'User' }, + status: { i18n: 'preMenu.operator.6', path: 'status', icon: 'Setting' }, + log: { i18n: 'preMenu.operator.7', path: 'log', icon: 'Document' }, }; export default { routes, menus }; diff --git a/packages/manage/views/login.vue b/packages/manage/views/login.vue index 4b8784a..8ce3b95 100644 --- a/packages/manage/views/login.vue +++ b/packages/manage/views/login.vue @@ -12,7 +12,7 @@ import { useRouter } from "vue-router"; import md5 from "js-md5"; import { Api, LoginForm } from "noob-mengyxu"; -const { state, commit } = useStore(); +const { state, commit, dispatch } = useStore(); const router = useRouter(); onBeforeMount(() => { @@ -29,6 +29,7 @@ const login = user => { state.size.headHeight = state.size.head + 'px'; state.size.asideWidth = state.size.aside + 'px'; commit("initSize"); + dispatch("getMenus"); router.push('/') } }) diff --git a/packages/manage/views/permission.vue b/packages/manage/views/permission.vue index 8932186..dad3f5d 100644 --- a/packages/manage/views/permission.vue +++ b/packages/manage/views/permission.vue @@ -2,7 +2,7 @@ -