| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { createRoleSearchState } from '../rolePage.helpers' |
| | | import { createRoleSearchState, getRoleStatusOptions } from '../rolePage.helpers' |
| | | |
| | | const props = defineProps({ |
| | | modelValue: { required: true } |
| | |
| | | set: (val) => emit('update:modelValue', val) |
| | | }) |
| | | |
| | | const formItems = computed(() => [ |
| | | { |
| | | label: '角色名称', |
| | | key: 'name', |
| | | function createInputSearchItem(label, key, placeholder) { |
| | | return { |
| | | label, |
| | | key, |
| | | type: 'input', |
| | | props: { |
| | | placeholder: '请输入角色名称', |
| | | placeholder, |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '角色编码', |
| | | key: 'code', |
| | | type: 'input', |
| | | props: { |
| | | placeholder: '请输入角色编码', |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '备注', |
| | | key: 'memo', |
| | | type: 'input', |
| | | props: { |
| | | placeholder: '请输入备注', |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '关键字', |
| | | key: 'condition', |
| | | type: 'input', |
| | | props: { |
| | | placeholder: '输入关键字搜索', |
| | | clearable: true |
| | | } |
| | | }, |
| | | { |
| | | label: '状态', |
| | | key: 'status', |
| | | type: 'select', |
| | | props: { |
| | | placeholder: '请选择状态', |
| | | clearable: true, |
| | | options: [ |
| | | { label: '正常', value: 1 }, |
| | | { label: '禁用', value: 0 } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | |
| | | function createSelectSearchItem(label, key, placeholder, options) { |
| | | return { |
| | | label, |
| | | key, |
| | | type: 'select', |
| | | props: { |
| | | placeholder, |
| | | clearable: true, |
| | | options |
| | | } |
| | | } |
| | | } |
| | | |
| | | const formItems = computed(() => [ |
| | | createInputSearchItem('角色名称', 'name', '请输入角色名称'), |
| | | createInputSearchItem('角色编码', 'code', '请输入角色编码'), |
| | | createInputSearchItem('备注', 'memo', '请输入备注'), |
| | | createInputSearchItem('关键字', 'condition', '输入关键字搜索'), |
| | | createSelectSearchItem('状态', 'status', '请选择状态', getRoleStatusOptions()) |
| | | ]) |
| | | |
| | | function handleReset() { |