From 6448ec15bfe0b65fb822a662105bceddc23b58d8 Mon Sep 17 00:00:00 2001
From: yubo <autumnal_wind@yeah.net>
Date: 星期一, 06 四月 2026 21:34:44 +0800
Subject: [PATCH] feat(user): 新增员工档案管理视图组件
---
src/views/dashboard/ygUser.vue | 41 +++++++++++++++++------------------------
1 files changed, 17 insertions(+), 24 deletions(-)
diff --git a/src/views/dashboard/ygUser.vue b/src/views/dashboard/ygUser.vue
index dd23216..4bfb651 100644
--- a/src/views/dashboard/ygUser.vue
+++ b/src/views/dashboard/ygUser.vue
@@ -63,10 +63,12 @@
<script>
// 引用翻页组件
import Pagination from '@/components/Pagination'
+import dictMixin from '../../utils/dictMixin'
export default {
components: {
Pagination
},
+ mixins: [dictMixin],
props: {
dialogVisible: {
type: Boolean,
@@ -110,12 +112,12 @@
defaultProps: {
children: 'children',
label: 'label'
- },
- educationOptions: [],
- nativePlaceOptions: [],
- sexOptions: [],
- empTypeOptions: [],
- nationOptions: []
+ }
+ // educationOptions: [],
+ // nativePlaceOptions: [],
+ // sexOptions: [],
+ // empTypeOptions: [],
+ // nationOptions: []
}
},
computed: {
@@ -123,26 +125,17 @@
get() {
return this.dialogVisible
}
- }
+ },
+ // 字典选项计算属性
+ sexOptions() { return this.getDictOptions('EDUCATION') },
+ empStatusOptions() { return this.getDictOptions('NATIVEPLACE') },
+ empTypeOptions() { return this.getDictOptions('sex') },
+ educationOptions() { return this.getDictOptions('EMPTYPE') },
+ nativePlaceOptions() { return this.getDictOptions('NATION') }
},
mounted() {
- setTimeout(() => {
- this.getDicts('EDUCATION').then(response => {
- this.educationOptions = response.data
- })
- this.getDicts('NATIVEPLACE').then(response => {
- this.nativePlaceOptions = response.data
- })
- this.getDicts('sex').then(response => {
- this.sexOptions = response.data
- })
- this.getDicts('empType').then(response => {
- this.empTypeOptions = response.data
- })
- this.getDicts('NATION').then(response => {
- this.nationOptions = response.data
- })
- }, 1000)
+ // 字典数据已在登录时预加载,直接从 Vuex 获取
+ this.initDictTypes(['sex', 'NATION', 'EMPTYPE', 'EDUCATION', 'NATIVEPLACE'])
},
methods: {
educationFormat(row, column) {
--
Gitblit v1.8.0