|
@@ -4,15 +4,16 @@
|
|
|
<el-card shadow="hover">
|
|
|
<template #header v-if="majorTree.length">
|
|
|
<div class="fx-row fx-bet-cen">
|
|
|
- <span class="f-999 f12">
|
|
|
- 请从推荐专业门类中选择{{ reportConfig.selectMajorLimit }}个你喜欢的专业类</span>
|
|
|
- <el-button type="primary" size="small" plain @click="majorPickerDisabled=false">
|
|
|
+ <span class="f-999 f12">
|
|
|
+ 请从推荐专业门类中选择{{ reportConfig.selectMajorLimit }}个你喜欢的专业类
|
|
|
+ </span>
|
|
|
+ <el-button v-if="!readonly" type="primary" size="small" plain @click="majorPickerDisabled=false">
|
|
|
{{ selectMajorText }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
<test-major-picker :major-tree="majorTree" :selected-codes="selectedCodes"
|
|
|
- :select-limit="reportConfig.selectMajorLimit" :disabled="majorPickerDisabled"
|
|
|
+ :select-limit="reportConfig.selectMajorLimit" :disabled="disabled"
|
|
|
@submit="handleMajorSubmit" @cancel="majorPickerDisabled=true"></test-major-picker>
|
|
|
</el-card>
|
|
|
</slot>
|
|
@@ -76,6 +77,12 @@ export default {
|
|
|
mixins: [ReportMixin],
|
|
|
name: 'test-report',
|
|
|
components: { TestMajorPicker, MxTableDynamic, MxChart },
|
|
|
+ props: {
|
|
|
+ readonly: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
majorTree: [],
|
|
@@ -91,6 +98,9 @@ export default {
|
|
|
},
|
|
|
selectedCodes() {
|
|
|
return this.source?.selectedList?.map(s => s.majorCategoryCode) || []
|
|
|
+ },
|
|
|
+ disabled() {
|
|
|
+ return this.majorPickerDisabled || this.readonly
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -106,6 +116,10 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
loadMajorCategoryTree() {
|
|
|
+ if (!this.source.matchedCode) {
|
|
|
+ console.log('Prevent `getMatchCategoryTree` request caused by no-matchedCode', this.source)
|
|
|
+ return
|
|
|
+ }
|
|
|
getMatchCategoryTree({
|
|
|
matchCode: this.source.matchedCode,
|
|
|
testType: this.testType
|