|
@@ -1,8 +1,8 @@
|
|
-import { reactive, computed, watch } from 'vue'
|
|
|
|
|
|
+import { reactive, computed, watch, ref } from 'vue'
|
|
import useForm from '@/hooks/useForm'
|
|
import useForm from '@/hooks/useForm'
|
|
import useOptions from '@/hooks/useOptions'
|
|
import useOptions from '@/hooks/useOptions'
|
|
import useVW from '@/hooks/useVW'
|
|
import useVW from '@/hooks/useVW'
|
|
-
|
|
|
|
|
|
+import useFetch from '@/hooks/useFetch'
|
|
import type { EpFormItem } from 'global-type'
|
|
import type { EpFormItem } from 'global-type'
|
|
import type { ExtractApiParams } from '@/api/api'
|
|
import type { ExtractApiParams } from '@/api/api'
|
|
|
|
|
|
@@ -17,14 +17,27 @@ const useFormFilter = () => {
|
|
isExpert,
|
|
isExpert,
|
|
isLeader,
|
|
isLeader,
|
|
} = useOptions(['subject', 'question', 'group'])
|
|
} = useOptions(['subject', 'question', 'group'])
|
|
|
|
+ const ROLE_OPTION = ref<any[]>([])
|
|
|
|
+ useFetch('getRoleList')
|
|
|
|
+ .fetch()
|
|
|
|
+ .then((res: any) => {
|
|
|
|
+ ROLE_OPTION.value = res.map((item: any) => {
|
|
|
|
+ return {
|
|
|
|
+ value: item.code,
|
|
|
|
+ label: item.roleName,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
const { formRef, elFormRef, defineColumn, _ } = useForm()
|
|
const { formRef, elFormRef, defineColumn, _ } = useForm()
|
|
|
|
|
|
const model = reactive<
|
|
const model = reactive<
|
|
- Omit<ExtractApiParams<'getGroupMonitor'>, 'markingGroupNumber'> & { markingGroupNumber?: number | string }
|
|
|
|
|
|
+ // Omit<ExtractApiParams<'getGroupMonitor'>, 'markingGroupNumber'> & { markingGroupNumber?: number | string }
|
|
|
|
+ Omit<ExtractApiParams<'getGroupMonitor'>, 'markingGroupNumbers'> & { markingGroupNumbers?: any; roles?: any }
|
|
>({
|
|
>({
|
|
subjectCode: dataModel.subject || '',
|
|
subjectCode: dataModel.subject || '',
|
|
- markingGroupNumber: dataModel.group,
|
|
|
|
|
|
+ markingGroupNumbers: dataModel.group,
|
|
questionMainNumber: dataModel.question,
|
|
questionMainNumber: dataModel.question,
|
|
|
|
+ roles: [],
|
|
})
|
|
})
|
|
|
|
|
|
const formModel = computed<any>(() => {
|
|
const formModel = computed<any>(() => {
|
|
@@ -32,18 +45,19 @@ const useFormFilter = () => {
|
|
subjectCode: model.subjectCode,
|
|
subjectCode: model.subjectCode,
|
|
// markingGroupNumber:
|
|
// markingGroupNumber:
|
|
// typeof model.markingGroupNumber === 'number' ? [model.markingGroupNumber] : model.markingGroupNumber,
|
|
// typeof model.markingGroupNumber === 'number' ? [model.markingGroupNumber] : model.markingGroupNumber,
|
|
- markingGroupNumber: model.markingGroupNumber,
|
|
|
|
|
|
+ markingGroupNumbers: model.markingGroupNumbers,
|
|
questionMainNumber: model.questionMainNumber,
|
|
questionMainNumber: model.questionMainNumber,
|
|
|
|
+ roles: model.roles,
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
watch(dataModel, () => {
|
|
watch(dataModel, () => {
|
|
model.subjectCode = dataModel.subject || ''
|
|
model.subjectCode = dataModel.subject || ''
|
|
model.questionMainNumber = dataModel.question
|
|
model.questionMainNumber = dataModel.question
|
|
- model.markingGroupNumber = dataModel.group
|
|
|
|
|
|
+ model.markingGroupNumbers = dataModel.group
|
|
})
|
|
})
|
|
|
|
|
|
- const OneRowSpan5 = defineColumn(_, 'row-1', { span: 5 })
|
|
|
|
|
|
+ const OneRowSpan5 = defineColumn(_, 'row-1', { span: 4 })
|
|
|
|
|
|
const items = computed<EpFormItem[]>(() => [
|
|
const items = computed<EpFormItem[]>(() => [
|
|
OneRowSpan5({
|
|
OneRowSpan5({
|
|
@@ -67,12 +81,23 @@ const useFormFilter = () => {
|
|
},
|
|
},
|
|
}),
|
|
}),
|
|
OneRowSpan5({
|
|
OneRowSpan5({
|
|
- prop: 'markingGroupNumber',
|
|
|
|
|
|
+ prop: 'markingGroupNumbers',
|
|
label: '小组',
|
|
label: '小组',
|
|
slotType: 'select',
|
|
slotType: 'select',
|
|
slot: {
|
|
slot: {
|
|
options: groupListWithAll.value,
|
|
options: groupListWithAll.value,
|
|
onChange: changeModelValue('group'),
|
|
onChange: changeModelValue('group'),
|
|
|
|
+ multiple: true,
|
|
|
|
+ },
|
|
|
|
+ }),
|
|
|
|
+ OneRowSpan5({
|
|
|
|
+ label: '角色',
|
|
|
|
+ slotType: 'select',
|
|
|
|
+ prop: 'roles',
|
|
|
|
+ slot: {
|
|
|
|
+ options: ROLE_OPTION.value,
|
|
|
|
+ placeholder: '角色',
|
|
|
|
+ multiple: true,
|
|
},
|
|
},
|
|
}),
|
|
}),
|
|
OneRowSpan5({
|
|
OneRowSpan5({
|