diff --git a/.eslintrc.js b/.eslintrc.js index 712f877..97db69b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,5 +12,6 @@ module.exports = { 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'vue/multi-word-component-names': 'off', '@typescript-eslint/no-explicit-any': 'off', + 'vue/no-mutating-props': 'off', }, }; diff --git a/components.d.ts b/components.d.ts index f2bf317..769796c 100644 --- a/components.d.ts +++ b/components.d.ts @@ -22,6 +22,7 @@ declare module 'vue' { ElMain: typeof import('element-plus/es')['ElMain']; ElMenu: typeof import('element-plus/es')['ElMenu']; ElMenuItem: typeof import('element-plus/es')['ElMenuItem']; + ElPagination: typeof import('element-plus/es')['ElPagination']; ElRadio: typeof import('element-plus/es')['ElRadio']; ElRadioButton: typeof import('element-plus/es')['ElRadioButton']; ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']; diff --git a/src/App.vue b/src/App.vue index e6a5d3b..f5772bb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,4 +2,24 @@ + diff --git a/src/api/employee.ts b/src/api/employee.ts index 2f3daa3..4593353 100644 --- a/src/api/employee.ts +++ b/src/api/employee.ts @@ -8,6 +8,30 @@ export const reqLogin = (data: any) => { return Request({ url: '/admin/employee/login', method: 'POST', data }); }; +/** + * 启用、禁用员工账号 + * @param data + */ +export const reqStatus = (data: any) => { + return Request({ url: `/admin/employee/status/${data.status}`, method: 'POST', params: { id: data.id } }); +}; + +/** + * 新增员工 + * @param data + */ +export const reqAddEmployee = (data: any) => { + return Request({ url: `/admin/employee`, method: 'POST', data }); +}; + +/** + * 编辑员工信息 + * @param data + */ +export const reqEditEmployee = (data: any) => { + return Request({ url: `/admin/employee`, method: 'PUT', data }); +}; + /** * 员工分页查询 * @param params diff --git a/src/assets/css/index.scss b/src/assets/css/index.scss index 88581c1..82e5f80 100644 --- a/src/assets/css/index.scss +++ b/src/assets/css/index.scss @@ -1,4 +1,5 @@ @charset "UTF-8"; + :root { --el-color-white: #ffffff; --el-color-black: #000000; diff --git a/src/assets/css/mixin/circle.scss b/src/assets/css/mixin/circle.scss new file mode 100644 index 0000000..80b5077 --- /dev/null +++ b/src/assets/css/mixin/circle.scss @@ -0,0 +1,30 @@ +@charset "UTF-8"; + +@mixin circle() { + content: ''; + position: absolute; + top: 50%; + left: -10px; + transform: translateY(-50%); + width: 5px; + height: 5px; + border-radius: 50%; +} + +.circle-success { + position: relative; + + &::before { + @include circle; + background-color: var(--el-color-success); + } +} + +.circle-danger { + position: relative; + + &::before { + @include circle; + background-color: var(--el-color-danger); + } +} diff --git a/src/assets/css/mixin/index.scss b/src/assets/css/mixin/index.scss new file mode 100644 index 0000000..a118da0 --- /dev/null +++ b/src/assets/css/mixin/index.scss @@ -0,0 +1 @@ +@use 'circle'; diff --git a/src/commpent/button/black-btn.vue b/src/commpent/button/black-btn.vue new file mode 100644 index 0000000..ca0eec5 --- /dev/null +++ b/src/commpent/button/black-btn.vue @@ -0,0 +1,15 @@ + + + + diff --git a/src/commpent/button/cancel-save-add.vue b/src/commpent/button/cancel-save-add.vue new file mode 100644 index 0000000..98774c6 --- /dev/null +++ b/src/commpent/button/cancel-save-add.vue @@ -0,0 +1,50 @@ + + + diff --git a/src/commpent/button/primary-btn.vue b/src/commpent/button/primary-btn.vue new file mode 100644 index 0000000..3a27a29 --- /dev/null +++ b/src/commpent/button/primary-btn.vue @@ -0,0 +1,15 @@ + + + + diff --git a/src/commpent/page-header.vue b/src/commpent/page-header.vue new file mode 100644 index 0000000..678665d --- /dev/null +++ b/src/commpent/page-header.vue @@ -0,0 +1,41 @@ + + + + diff --git a/src/commpent/pagination.vue b/src/commpent/pagination.vue new file mode 100644 index 0000000..256ab8e --- /dev/null +++ b/src/commpent/pagination.vue @@ -0,0 +1,26 @@ + + diff --git a/src/commpent/table/table-footer.vue b/src/commpent/table/table-footer.vue new file mode 100644 index 0000000..3f206d0 --- /dev/null +++ b/src/commpent/table/table-footer.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/commpent/table/table-header.vue b/src/commpent/table/table-header.vue new file mode 100644 index 0000000..346ea21 --- /dev/null +++ b/src/commpent/table/table-header.vue @@ -0,0 +1,19 @@ + + + diff --git a/src/commpent/table/table-plus.vue b/src/commpent/table/table-plus.vue index fb8058f..c0d77c6 100644 --- a/src/commpent/table/table-plus.vue +++ b/src/commpent/table/table-plus.vue @@ -1,5 +1,5 @@