|
@@ -7,16 +7,51 @@
|
|
|
<el-table-column label="题型" align="center">
|
|
|
<el-table-column
|
|
|
label="题型大类"
|
|
|
- prop="questionMainTypeName"
|
|
|
+ prop="quesMainType"
|
|
|
align="center"
|
|
|
- min-width="120"
|
|
|
- ></el-table-column>
|
|
|
+ width="120"
|
|
|
+ >
|
|
|
+ <span slot-scope="scope">{{
|
|
|
+ scope.row.quesMainType | questionMainTypeFilter
|
|
|
+ }}</span>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="题型小类"
|
|
|
- prop="questionTypeName"
|
|
|
+ prop="questionType"
|
|
|
+ align="center"
|
|
|
+ min-width="240"
|
|
|
+ >
|
|
|
+ <div slot-scope="scope" class="box-justify">
|
|
|
+ <div>{{ scope.row.quesStructType | questionTypeFilter }}</div>
|
|
|
+
|
|
|
+ <el-select
|
|
|
+ v-model="
|
|
|
+ questionTypeSources[scope.row.quesStructType].detailNames
|
|
|
+ "
|
|
|
+ class="dialog-input-width"
|
|
|
+ filterable
|
|
|
+ multiple
|
|
|
+ placeholder="选择大题来源"
|
|
|
+ @change="sourceInfoChange(scope.row.quesStructType)"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in questionTypeSources[scope.row.quesStructType]
|
|
|
+ .sourceInfoList"
|
|
|
+ :key="item.detailName"
|
|
|
+ :value="item.detailName"
|
|
|
+ :label="item.detailName"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="大题来源"
|
|
|
+ prop="detailName"
|
|
|
align="center"
|
|
|
min-width="120"
|
|
|
- ></el-table-column>
|
|
|
+ >
|
|
|
+ <span slot-scope="scope">{{ scope.row.detailName }}</span>
|
|
|
+ </el-table-column>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
label="试题数量"
|
|
@@ -69,7 +104,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { questionDistributionStatisticsApi } from "../../question/api";
|
|
|
+import { paperSimpleTypeDistributeApi } from "../api";
|
|
|
|
|
|
export default {
|
|
|
name: "BuildPaperSimple",
|
|
@@ -82,6 +117,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
baseDataList: [],
|
|
|
+ questionTypeSources: {},
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -97,25 +133,35 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async getBaseData() {
|
|
|
- const res = await questionDistributionStatisticsApi(this.courseId);
|
|
|
+ const res = await paperSimpleTypeDistributeApi(this.courseId);
|
|
|
// console.log(res.data);
|
|
|
// parse data
|
|
|
let baseDataList = [];
|
|
|
+ let questionTypeSources = {};
|
|
|
res.data.forEach((mainGroup) => {
|
|
|
- const rowspan = mainGroup.questionTypeStatisticList.length;
|
|
|
- mainGroup.questionTypeStatisticList.forEach((quesItem, index) => {
|
|
|
+ let qtRowspan = mainGroup.quesTypeDistributeList.length;
|
|
|
+ mainGroup.quesTypeDistributeList.forEach((quesItem, qindex) => {
|
|
|
let nitem = {
|
|
|
- questionMainTypeName: mainGroup.questionMainTypeName,
|
|
|
- questionTypeName: quesItem.questionTypeName,
|
|
|
- questionCount: quesItem.questionCount,
|
|
|
+ quesMainType: mainGroup.quesMainType,
|
|
|
+ quesStructType: quesItem.quesStructType,
|
|
|
+ detailName: "",
|
|
|
+ questionCount: undefined,
|
|
|
selectCount: undefined,
|
|
|
questionScore: undefined,
|
|
|
};
|
|
|
- if (index === 0) nitem.rowspan = rowspan;
|
|
|
+ if (qindex === 0) nitem.rowspan = qtRowspan;
|
|
|
baseDataList.push(nitem);
|
|
|
+ questionTypeSources[quesItem.quesStructType] = {
|
|
|
+ detailNames: [],
|
|
|
+ sourceInfoList: quesItem.sourceInfoList || [],
|
|
|
+ };
|
|
|
});
|
|
|
});
|
|
|
this.baseDataList = baseDataList;
|
|
|
+ this.questionTypeSources = questionTypeSources;
|
|
|
+ },
|
|
|
+ sourceInfoChange(quesStructType) {
|
|
|
+ console.log(quesStructType);
|
|
|
},
|
|
|
getData() {
|
|
|
return this.baseDataList;
|