|
@@ -2,11 +2,12 @@ import { ref, reactive, computed, watch } from 'vue'
|
|
import { ROLE_OPTION, StatusMap } from '@/constants/dicts'
|
|
import { ROLE_OPTION, StatusMap } from '@/constants/dicts'
|
|
import useForm from '@/hooks/useForm'
|
|
import useForm from '@/hooks/useForm'
|
|
import useOptions, { DataModel } from '@/hooks/useOptions'
|
|
import useOptions, { DataModel } from '@/hooks/useOptions'
|
|
-
|
|
|
|
|
|
+import useMainStore from '@/store/main'
|
|
import type { EpFormItem, InstanceForm, EpFormRows } from 'global-type'
|
|
import type { EpFormItem, InstanceForm, EpFormRows } from 'global-type'
|
|
import type { ExtractMultipleApiParams } from '@/api/api'
|
|
import type { ExtractMultipleApiParams } from '@/api/api'
|
|
|
|
|
|
const useUserManageFilter = () => {
|
|
const useUserManageFilter = () => {
|
|
|
|
+ const mainStore = useMainStore()
|
|
const { subjectList, mainQuestionList, changeModelValue, dataModel } = useOptions(['subject', 'question'])
|
|
const { subjectList, mainQuestionList, changeModelValue, dataModel } = useOptions(['subject', 'question'])
|
|
|
|
|
|
const { elFormRef, formRef, defineColumn, _ } = useForm()
|
|
const { elFormRef, formRef, defineColumn, _ } = useForm()
|
|
@@ -16,7 +17,7 @@ const useUserManageFilter = () => {
|
|
const model = reactive<ExtractMultipleApiParams<'getUserList'>>({
|
|
const model = reactive<ExtractMultipleApiParams<'getUserList'>>({
|
|
subjectCode: dataModel.subject || '',
|
|
subjectCode: dataModel.subject || '',
|
|
mainNumber: dataModel.question,
|
|
mainNumber: dataModel.question,
|
|
- enable: true,
|
|
|
|
|
|
+ // enable: true,
|
|
loginName: '',
|
|
loginName: '',
|
|
name: '',
|
|
name: '',
|
|
role: void 0,
|
|
role: void 0,
|
|
@@ -46,6 +47,7 @@ const useUserManageFilter = () => {
|
|
prop: 'subjectCode',
|
|
prop: 'subjectCode',
|
|
slot: {
|
|
slot: {
|
|
placeholder: '选择科目',
|
|
placeholder: '选择科目',
|
|
|
|
+ disabled: mainStore.loginInfo?.role === 'CHIEF',
|
|
options: subjectList.value,
|
|
options: subjectList.value,
|
|
onChange: changeModelValue('subject'),
|
|
onChange: changeModelValue('subject'),
|
|
clearable: true,
|
|
clearable: true,
|
|
@@ -57,6 +59,7 @@ const useUserManageFilter = () => {
|
|
prop: 'mainNumber',
|
|
prop: 'mainNumber',
|
|
slot: {
|
|
slot: {
|
|
placeholder: '选择大题',
|
|
placeholder: '选择大题',
|
|
|
|
+ disabled: mainStore.loginInfo?.role === 'CHIEF',
|
|
options: mainQuestionList.value,
|
|
options: mainQuestionList.value,
|
|
onChange: changeModelValue('question'),
|
|
onChange: changeModelValue('question'),
|
|
clearable: true,
|
|
clearable: true,
|
|
@@ -68,7 +71,9 @@ const useUserManageFilter = () => {
|
|
prop: 'role',
|
|
prop: 'role',
|
|
slot: {
|
|
slot: {
|
|
placeholder: '用户角色',
|
|
placeholder: '用户角色',
|
|
- options: ROLE_OPTION,
|
|
|
|
|
|
+ options: ROLE_OPTION.filter((option) => {
|
|
|
|
+ return !(mainStore.loginInfo?.role === 'CHIEF' && option.value === 'CHIEF')
|
|
|
|
+ }),
|
|
clearable: true,
|
|
clearable: true,
|
|
},
|
|
},
|
|
}),
|
|
}),
|