|
@@ -13,6 +13,8 @@
|
|
|
clearable
|
|
|
value-key="secretNumber"
|
|
|
:options="customQueryConfigList?.map((v, i) => ({ label: v.name, value: i }))"
|
|
|
+ @clear="fastParamClear"
|
|
|
+ @change="fastParamChange"
|
|
|
></base-select>
|
|
|
</template>
|
|
|
</base-form>
|
|
@@ -32,7 +34,7 @@
|
|
|
|
|
|
<script setup lang="ts" name="MarkingInquiry">
|
|
|
/** 阅卷-自定义查询 */
|
|
|
-import { computed, reactive, ref, watch } from 'vue'
|
|
|
+import { computed, reactive, ref, watch, inject } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
import { ElButton, ElInput } from 'element-plus'
|
|
|
import { omit } from 'lodash-es'
|
|
@@ -48,14 +50,22 @@ import useVW from '@/hooks/useVW'
|
|
|
|
|
|
import type { EpFormItem, EpFormRules } from 'global-type'
|
|
|
import type { ExtractApiParams } from '@/api/api'
|
|
|
-
|
|
|
+const refresh: any = inject('reload')
|
|
|
const { push } = useRouter()
|
|
|
-
|
|
|
+const resetMarkerId = ref<any>(void 0)
|
|
|
const shortQueryConfigIndex = ref<number>()
|
|
|
|
|
|
-const { subjectList, mainQuestionList, groupListWithAll, dataModel, changeModelValue, isExpert, isLeader } = useOptions(
|
|
|
- ['subject', 'question', 'group']
|
|
|
-)
|
|
|
+const {
|
|
|
+ subjectList,
|
|
|
+ mainQuestionList,
|
|
|
+ groupListWithAll,
|
|
|
+ dataModel,
|
|
|
+ changeModelValue,
|
|
|
+ isExpert,
|
|
|
+ isLeader,
|
|
|
+ getMainQuestionList,
|
|
|
+ getQuestionGroupList,
|
|
|
+} = useOptions(['subject', 'question', 'group'])
|
|
|
|
|
|
const { formRef, elFormRef, defineColumn, _ } = useForm()
|
|
|
|
|
@@ -80,11 +90,47 @@ const model = reactive<FormModel>({
|
|
|
objectiveScoreEnd: void 0,
|
|
|
})
|
|
|
|
|
|
-watch(dataModel, () => {
|
|
|
- model.subjectCode = dataModel.subject
|
|
|
- model.mainNumber = dataModel.question
|
|
|
- model.markingGroupNumber = dataModel.group
|
|
|
-})
|
|
|
+// watch(dataModel, () => {
|
|
|
+// model.subjectCode = dataModel.subject
|
|
|
+// model.mainNumber = dataModel.question
|
|
|
+// model.markingGroupNumber = dataModel.group
|
|
|
+// })
|
|
|
+watch(
|
|
|
+ () => dataModel.subject,
|
|
|
+ () => {
|
|
|
+ model.subjectCode = dataModel.subject
|
|
|
+ }
|
|
|
+)
|
|
|
+watch(
|
|
|
+ () => dataModel.question,
|
|
|
+ () => {
|
|
|
+ model.mainNumber = dataModel.question
|
|
|
+ }
|
|
|
+)
|
|
|
+watch(
|
|
|
+ () => dataModel.group,
|
|
|
+ () => {
|
|
|
+ model.markingGroupNumber = dataModel.group
|
|
|
+ }
|
|
|
+)
|
|
|
+watch(
|
|
|
+ () => model.subjectCode,
|
|
|
+ () => {
|
|
|
+ dataModel.subject = model.subjectCode
|
|
|
+ }
|
|
|
+)
|
|
|
+watch(
|
|
|
+ () => model.mainNumber,
|
|
|
+ () => {
|
|
|
+ dataModel.question = model.mainNumber
|
|
|
+ }
|
|
|
+)
|
|
|
+watch(
|
|
|
+ () => model.markingGroupNumber,
|
|
|
+ () => {
|
|
|
+ dataModel.group = model.markingGroupNumber
|
|
|
+ }
|
|
|
+)
|
|
|
|
|
|
const { fetch: getCustomQueryConfigList, result: customQueryConfigList } = useFetch('getCustomQueryConfigList')
|
|
|
const { fetch: setCustomQueryConfig, loading: saving } = useFetch('setCustomQueryConfig')
|
|
@@ -99,7 +145,12 @@ watch(
|
|
|
mainNumber: model.mainNumber,
|
|
|
markingGroupNumber: model.markingGroupNumber,
|
|
|
}).then(() => {
|
|
|
- model.markerId = void 0
|
|
|
+ if (resetMarkerId.value) {
|
|
|
+ model.markerId = resetMarkerId.value
|
|
|
+ resetMarkerId.value = void 0
|
|
|
+ } else {
|
|
|
+ model.markerId = void 0
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -110,22 +161,58 @@ watch(
|
|
|
|
|
|
getCustomQueryConfigList()
|
|
|
|
|
|
-const shortQueryConfig = computed<ExtractApiParams<'setCustomQueryConfig'>['params'] | void>(() => {
|
|
|
- if (shortQueryConfigIndex.value === undefined) {
|
|
|
- return void 0
|
|
|
- }
|
|
|
- return customQueryConfigList?.value?.[shortQueryConfigIndex.value]?.params
|
|
|
-})
|
|
|
+// const shortQueryConfig = computed<ExtractApiParams<'setCustomQueryConfig'>['params'] | void>(() => {
|
|
|
+// if (shortQueryConfigIndex.value === undefined) {
|
|
|
+// return void 0
|
|
|
+// }
|
|
|
+// return customQueryConfigList?.value?.[shortQueryConfigIndex.value]?.params
|
|
|
+// })
|
|
|
|
|
|
-watch(shortQueryConfig, () => {
|
|
|
- if (!shortQueryConfig.value) {
|
|
|
- elFormRef?.value?.resetFields()
|
|
|
- } else {
|
|
|
- Object.assign(model, omit(shortQueryConfig.value, 'timeStart', 'timeEnd'), {
|
|
|
- time: [shortQueryConfig.value.timeStart, shortQueryConfig.value.timeEnd],
|
|
|
- })
|
|
|
+// watch(shortQueryConfig, () => {
|
|
|
+// if (!shortQueryConfig.value) {
|
|
|
+// elFormRef?.value?.resetFields()
|
|
|
+// } else {
|
|
|
+// Object.assign(model, omit(shortQueryConfig.value, 'timeStart', 'timeEnd'), {
|
|
|
+// time: [shortQueryConfig.value.timeStart, shortQueryConfig.value.timeEnd],
|
|
|
+// })
|
|
|
+// }
|
|
|
+// })
|
|
|
+const fastParamClear = () => {
|
|
|
+ // elFormRef?.value?.resetFields()
|
|
|
+ refresh()
|
|
|
+}
|
|
|
+const fastParamChange = async (index: number) => {
|
|
|
+ if (typeof index === 'number') {
|
|
|
+ let shortQueryConfig = customQueryConfigList?.value?.[index]?.params
|
|
|
+ if (shortQueryConfig) {
|
|
|
+ // Object.assign(model, omit(shortQueryConfig, 'timeStart', 'timeEnd'), {
|
|
|
+ // time: [shortQueryConfig.timeStart, shortQueryConfig.timeEnd],
|
|
|
+ // })
|
|
|
+ elFormRef?.value?.resetFields()
|
|
|
+ if (shortQueryConfig.subjectCode) {
|
|
|
+ await getMainQuestionList({ subjectCode: shortQueryConfig.subjectCode as string })
|
|
|
+ if (shortQueryConfig.mainNumber) {
|
|
|
+ await getQuestionGroupList({
|
|
|
+ subjectCode: shortQueryConfig.subjectCode,
|
|
|
+ mainNumber: shortQueryConfig.mainNumber,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ if (shortQueryConfig.markerId) {
|
|
|
+ resetMarkerId.value = shortQueryConfig.markerId
|
|
|
+ }
|
|
|
+ if (!shortQueryConfig.hasOwnProperty('markingGroupNumber')) {
|
|
|
+ shortQueryConfig.markingGroupNumber = undefined
|
|
|
+ }
|
|
|
+ console.log('shortQueryConfig:', shortQueryConfig)
|
|
|
+ Object.assign(model, omit(shortQueryConfig, 'timeStart', 'timeEnd'), {
|
|
|
+ time: [shortQueryConfig.timeStart, shortQueryConfig.timeEnd],
|
|
|
+ })
|
|
|
+ }, 30)
|
|
|
+ }
|
|
|
}
|
|
|
-})
|
|
|
+}
|
|
|
|
|
|
const Span7 = defineColumn(_, _, { span: 7 })
|
|
|
const Span6 = defineColumn(_, _, { span: 6 })
|