From 40905cbd04c2e332cd4bc2b9e0c5b3e1da9cccfa Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期一, 30 三月 2026 08:17:32 +0800
Subject: [PATCH] feat: complete rsf-design phase 1 integration
---
rsf-design/src/views/system/user/modules/user-search.vue | 160 +++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 118 insertions(+), 42 deletions(-)
diff --git a/rsf-design/src/views/system/user/modules/user-search.vue b/rsf-design/src/views/system/user/modules/user-search.vue
index 071a0f9..849a4bc 100644
--- a/rsf-design/src/views/system/user/modules/user-search.vue
+++ b/rsf-design/src/views/system/user/modules/user-search.vue
@@ -3,61 +3,143 @@
ref="searchBarRef"
v-model="formData"
:items="formItems"
- :rules="rules"
@reset="handleReset"
@search="handleSearch"
- >
- </ArtSearchBar>
+ />
</template>
<script setup>
+ import { createUserSearchState } from '../userPage.helpers'
+
const props = defineProps({
- modelValue: { required: true }
+ modelValue: { required: true },
+ deptTreeOptions: { required: false, default: () => [] },
+ roleOptions: { required: false, default: () => [] }
})
+
const emit = defineEmits(['update:modelValue', 'search', 'reset'])
const searchBarRef = ref()
+
const formData = computed({
get: () => props.modelValue,
set: (val) => emit('update:modelValue', val)
})
- const rules = {
- // userName: [{ required: true, message: '璇疯緭鍏ョ敤鎴峰悕', trigger: 'blur' }]
- }
- const statusOptions = ref([])
- function fetchStatusOptions() {
- return new Promise((resolve) => {
- setTimeout(() => {
- resolve([
- { label: '鍦ㄧ嚎', value: '1' },
- { label: '绂荤嚎', value: '2' },
- { label: '寮傚父', value: '3' },
- { label: '娉ㄩ攢', value: '4' }
- ])
- }, 1e3)
- })
- }
- onMounted(async () => {
- statusOptions.value = await fetchStatusOptions()
- })
+
const formItems = computed(() => [
{
label: '鐢ㄦ埛鍚�',
- key: 'userName',
+ key: 'username',
type: 'input',
- placeholder: '璇疯緭鍏ョ敤鎴峰悕',
- clearable: true
+ props: {
+ placeholder: '璇疯緭鍏ョ敤鎴峰悕',
+ clearable: true
+ }
+ },
+ {
+ label: '鏄电О',
+ key: 'nickname',
+ type: 'input',
+ props: {
+ placeholder: '璇疯緭鍏ユ樀绉�',
+ clearable: true
+ }
},
{
label: '鎵嬫満鍙�',
- key: 'userPhone',
+ key: 'phone',
type: 'input',
- props: { placeholder: '璇疯緭鍏ユ墜鏈哄彿', maxlength: '11' }
+ props: {
+ placeholder: '璇疯緭鍏ユ墜鏈哄彿',
+ clearable: true
+ }
},
{
label: '閭',
- key: 'userEmail',
+ key: 'email',
type: 'input',
- props: { placeholder: '璇疯緭鍏ラ偖绠�' }
+ props: {
+ placeholder: '璇疯緭鍏ラ偖绠�',
+ clearable: true
+ }
+ },
+ {
+ label: '宸ュ彿',
+ key: 'code',
+ type: 'input',
+ props: {
+ placeholder: '璇疯緭鍏ュ伐鍙�',
+ clearable: true
+ }
+ },
+ {
+ label: '閮ㄩ棬',
+ key: 'deptId',
+ type: 'treeselect',
+ props: {
+ data: props.deptTreeOptions,
+ props: {
+ label: 'label',
+ value: 'value',
+ children: 'children'
+ },
+ placeholder: '璇烽�夋嫨閮ㄩ棬',
+ clearable: true,
+ checkStrictly: true
+ }
+ },
+ {
+ label: '瑙掕壊',
+ key: 'roleIds',
+ type: 'select',
+ props: {
+ placeholder: '璇烽�夋嫨瑙掕壊',
+ clearable: true,
+ multiple: true,
+ collapseTags: true,
+ filterable: true,
+ options: props.roleOptions
+ }
+ },
+ {
+ label: '鎬у埆',
+ key: 'sex',
+ type: 'select',
+ props: {
+ placeholder: '璇烽�夋嫨鎬у埆',
+ clearable: true,
+ options: [
+ { label: '鏈煡', value: 0 },
+ { label: '鐢�', value: 1 },
+ { label: '濂�', value: 2 }
+ ]
+ }
+ },
+ {
+ label: '鐪熷疄濮撳悕',
+ key: 'realName',
+ type: 'input',
+ props: {
+ placeholder: '璇疯緭鍏ョ湡瀹炲鍚�',
+ clearable: true
+ }
+ },
+ {
+ label: '韬唤璇佸彿',
+ key: 'idCard',
+ type: 'input',
+ props: {
+ placeholder: '璇疯緭鍏ヨ韩浠借瘉鍙�',
+ clearable: true
+ }
+ },
+ {
+ label: '鍏抽敭瀛�',
+ key: 'condition',
+ type: 'input',
+ props: {
+ placeholder: '杈撳叆鍏抽敭瀛楁悳绱�',
+ clearable: true
+ }
},
{
label: '鐘舵��',
@@ -65,28 +147,22 @@
type: 'select',
props: {
placeholder: '璇烽�夋嫨鐘舵��',
- options: statusOptions.value
- }
- },
- {
- label: '鎬у埆',
- key: 'userGender',
- type: 'radiogroup',
- props: {
+ clearable: true,
options: [
- { label: '鐢�', value: '1' },
- { label: '濂�', value: '2' }
+ { label: '姝e父', value: 1 },
+ { label: '绂佺敤', value: 0 }
]
}
}
])
+
function handleReset() {
- console.log('閲嶇疆琛ㄥ崟')
+ emit('update:modelValue', createUserSearchState())
emit('reset')
}
+
async function handleSearch(params) {
await searchBarRef.value.validate()
emit('search', params)
- console.log('琛ㄥ崟鏁版嵁', params)
}
</script>
--
Gitblit v1.9.1