|
@@ -96,7 +96,7 @@ const {
|
|
|
isLeader,
|
|
|
getMainQuestionList,
|
|
|
getQuestionGroupList,
|
|
|
-} = useOptions(['subject', 'question', 'group'])
|
|
|
+} = useOptions(['subject', 'question', 'group'], undefined, true, true, true)
|
|
|
|
|
|
const { formRef, elFormRef, defineColumn, _ } = useForm()
|
|
|
|
|
@@ -105,7 +105,7 @@ type FormModel = Omit<ExtractApiParams<'setCustomQueryConfig'>['params'], 'timeS
|
|
|
const model = reactive<FormModel>({
|
|
|
subjectCode: dataModel.subject,
|
|
|
mainNumber: dataModel.question,
|
|
|
- markingGroupNumber: dataModel.group,
|
|
|
+ markingGroupNumbers: dataModel.group,
|
|
|
checked: false,
|
|
|
arbitration: false,
|
|
|
markerId: void 0,
|
|
@@ -121,11 +121,6 @@ const model = reactive<FormModel>({
|
|
|
objectiveScoreEnd: void 0,
|
|
|
})
|
|
|
|
|
|
-// watch(dataModel, () => {
|
|
|
-// model.subjectCode = dataModel.subject
|
|
|
-// model.mainNumber = dataModel.question
|
|
|
-// model.markingGroupNumber = dataModel.group
|
|
|
-// })
|
|
|
watch(
|
|
|
() => dataModel.subject,
|
|
|
() => {
|
|
@@ -141,7 +136,7 @@ watch(
|
|
|
watch(
|
|
|
() => dataModel.group,
|
|
|
() => {
|
|
|
- model.markingGroupNumber = dataModel.group
|
|
|
+ model.markingGroupNumbers = dataModel.group
|
|
|
}
|
|
|
)
|
|
|
watch(
|
|
@@ -157,24 +152,38 @@ watch(
|
|
|
}
|
|
|
)
|
|
|
watch(
|
|
|
- () => model.markingGroupNumber,
|
|
|
+ () => model.markingGroupNumbers,
|
|
|
() => {
|
|
|
- dataModel.group = model.markingGroupNumber
|
|
|
+ dataModel.group = model.markingGroupNumbers
|
|
|
}
|
|
|
)
|
|
|
|
|
|
const { fetch: getCustomQueryConfigList, result: customQueryConfigList } = useFetch('getCustomQueryConfigList')
|
|
|
const { fetch: setCustomQueryConfig, loading: saving } = useFetch('setCustomQueryConfig')
|
|
|
-const { fetch: getMarkerList, result: markerList } = useFetch('getMarkerList')
|
|
|
+// const { fetch: getMarkerList, result: markerList } = useFetch('getMarkerList')
|
|
|
+const { fetch: getMarkerList, result: allMarkerList } = useFetch('getMarkerList')
|
|
|
+const markerList = computed(() => {
|
|
|
+ let mgn = model.markingGroupNumbers
|
|
|
+ if (typeof mgn == 'number') {
|
|
|
+ mgn = [mgn]
|
|
|
+ }
|
|
|
+ if ((mgn || []).includes(undefined) || typeof mgn === 'undefined' || (Array.isArray(mgn) && !mgn.length)) {
|
|
|
+ return allMarkerList?.value || []
|
|
|
+ } else {
|
|
|
+ return (allMarkerList?.value || []).filter((item) => {
|
|
|
+ return (mgn || []).includes(item.markingGroupNumber)
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
watch(
|
|
|
- () => [model.subjectCode, model.mainNumber, model.markingGroupNumber],
|
|
|
+ () => [model.subjectCode, model.mainNumber, model.markingGroupNumbers],
|
|
|
() => {
|
|
|
if (model.subjectCode && model.mainNumber) {
|
|
|
getMarkerList({
|
|
|
subjectCode: model.subjectCode,
|
|
|
mainNumber: model.mainNumber,
|
|
|
- markingGroupNumber: model.markingGroupNumber,
|
|
|
+ // markingGroupNumber: model.markingGroupNumber,
|
|
|
}).then(() => {
|
|
|
if (resetMarkerId.value) {
|
|
|
model.markerId = resetMarkerId.value
|
|
@@ -233,8 +242,8 @@ const fastParamChange = async (index: number) => {
|
|
|
if (shortQueryConfig.markerId) {
|
|
|
resetMarkerId.value = shortQueryConfig.markerId
|
|
|
}
|
|
|
- if (!shortQueryConfig.hasOwnProperty('markingGroupNumber')) {
|
|
|
- shortQueryConfig.markingGroupNumber = undefined
|
|
|
+ if (!shortQueryConfig.hasOwnProperty('markingGroupNumbers')) {
|
|
|
+ shortQueryConfig.markingGroupNumbers = undefined
|
|
|
}
|
|
|
console.log('shortQueryConfig:', shortQueryConfig)
|
|
|
Object.assign(model, omit(shortQueryConfig, 'timeStart', 'timeEnd'), {
|
|
@@ -260,6 +269,29 @@ const rules: EpFormRules = {
|
|
|
subjectCode: [{ required: true, message: '请选择科目' }],
|
|
|
mainNumber: [{ required: true, message: '请选择大题' }],
|
|
|
}
|
|
|
+const customGroupChange = (v: any) => {
|
|
|
+ if (groupListWithAll.value.find((item: any) => item.value == undefined)) {
|
|
|
+ if (model.markingGroupNumbers.includes(undefined)) {
|
|
|
+ model.markingGroupNumbers = [void 0]
|
|
|
+ changeModelValue('group')(model.markingGroupNumbers)
|
|
|
+ } else {
|
|
|
+ changeModelValue('group')(v)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ changeModelValue('group')(v)
|
|
|
+ }
|
|
|
+}
|
|
|
+const transGroupOptions = computed(() => {
|
|
|
+ return (model.markingGroupNumbers || []).includes(undefined)
|
|
|
+ ? (groupListWithAll.value || []).map((item: any) => {
|
|
|
+ item.value != undefined && (item.disabled = true)
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ : groupListWithAll.value.map((item: any) => {
|
|
|
+ item.disabled = false
|
|
|
+ return item
|
|
|
+ })
|
|
|
+})
|
|
|
|
|
|
const items = computed<EpFormItem[]>(() => [
|
|
|
OneRow({
|
|
@@ -285,13 +317,14 @@ const items = computed<EpFormItem[]>(() => [
|
|
|
},
|
|
|
}),
|
|
|
TwoRow({
|
|
|
- prop: 'markingGroupNumber',
|
|
|
+ prop: 'markingGroupNumbers',
|
|
|
label: '小组',
|
|
|
slotType: 'select',
|
|
|
slot: {
|
|
|
placeholder: '评卷小组',
|
|
|
- options: groupListWithAll.value,
|
|
|
- onChange: changeModelValue('group'),
|
|
|
+ options: transGroupOptions.value,
|
|
|
+ onChange: customGroupChange,
|
|
|
+ multiple: true,
|
|
|
},
|
|
|
}),
|
|
|
ThreeRow({
|
|
@@ -383,10 +416,16 @@ const items = computed<EpFormItem[]>(() => [
|
|
|
slotType: 'select',
|
|
|
prop: 'markerId',
|
|
|
slot: {
|
|
|
- options: markerList?.value?.map((marker) => ({
|
|
|
- value: marker.id,
|
|
|
- label: marker.loginName ? `${marker.loginName}-${marker.name}` : marker.name,
|
|
|
- })),
|
|
|
+ // options: markerList?.value?.map((marker) => ({
|
|
|
+ // value: marker.id,
|
|
|
+ // label: marker.loginName ? `${marker.loginName}-${marker.name}` : marker.name,
|
|
|
+ // })),
|
|
|
+ options: [
|
|
|
+ ...(markerList?.value || []).map((marker) => ({
|
|
|
+ value: marker.id,
|
|
|
+ label: marker.loginName ? `${marker.loginName}-${marker.name}` : marker.name,
|
|
|
+ })),
|
|
|
+ ],
|
|
|
filterable: true,
|
|
|
clearable: true,
|
|
|
},
|