|
@@ -102,6 +102,7 @@
|
|
|
</el-form-item>
|
|
|
<el-table
|
|
|
ref="table2"
|
|
|
+ v-loading="tableLoading2"
|
|
|
:data="tableData2"
|
|
|
border
|
|
|
@selection-change="handleSelectionChange"
|
|
@@ -121,6 +122,46 @@
|
|
|
>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <div class="page pull-right">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="curSelect"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, prev, pager, next, jumper"
|
|
|
+ :total="totalSelect"
|
|
|
+ @current-change="selectCurrentChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ <div style="clear: both; margin-top: 5px"></div>
|
|
|
+
|
|
|
+ <el-form
|
|
|
+ :inline="true"
|
|
|
+ label-position="right"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-form-item label="选中列表" class="form-item"></el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table :data="tempPapers" border>
|
|
|
+ <el-table-column label="名称" width="200">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <span>{{ scope.row.name }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ size="mini"
|
|
|
+ @click="removeSelected(scope.row.id)"
|
|
|
+ >移除</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
<div style="width: 60%; padding-left: 20px">
|
|
|
<div style="color: #606266; font-size: 14px; line-height: 32px">
|
|
@@ -186,6 +227,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import qs from "qs";
|
|
|
+import { cloneDeep } from "lodash";
|
|
|
import { mapState } from "vuex";
|
|
|
import { QUESTION_API } from "@/constants/constants";
|
|
|
import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
|
|
@@ -194,6 +236,11 @@ export default {
|
|
|
components: { LinkTitlesCustom },
|
|
|
data() {
|
|
|
return {
|
|
|
+ tempPapers: [],
|
|
|
+ tempPaperIds: [],
|
|
|
+ curSelect: 1,
|
|
|
+ totalSelect: 10,
|
|
|
+ pageSize: 10,
|
|
|
hasError: false,
|
|
|
form: {
|
|
|
paperStructType: "EXACT",
|
|
@@ -231,6 +278,7 @@ export default {
|
|
|
lastRequestKey: "",
|
|
|
tableLoading3: false,
|
|
|
tableLoading1: false,
|
|
|
+ tableLoading2: false,
|
|
|
checked: false,
|
|
|
initSelectedRows: [],
|
|
|
};
|
|
@@ -280,6 +328,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ selectCurrentChange(val) {
|
|
|
+ this.curSelect = val;
|
|
|
+ this.getTable2();
|
|
|
+ },
|
|
|
paperStructTypeChange() {
|
|
|
this.form.paperStructId = "";
|
|
|
this.getStruct();
|
|
@@ -390,16 +442,26 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
getTable2(bool) {
|
|
|
+ this.tableLoading2 = true;
|
|
|
let apiUrl =
|
|
|
this.form.paperType === "IMPORT"
|
|
|
- ? "/api/ecs_ques/importPaper/huoge/1/10000"
|
|
|
- : "/api/ecs_ques/genPaper/huoge/1/10000";
|
|
|
+ ? "/api/ecs_ques/importPaper/huoge"
|
|
|
+ : "/api/ecs_ques/genPaper/huoge";
|
|
|
this.$http
|
|
|
- .get(apiUrl, {
|
|
|
- params: { courseNo: this.$route.query.courseNo, ids: "" },
|
|
|
- })
|
|
|
+ .get(
|
|
|
+ apiUrl +
|
|
|
+ `/${this.curSelect}/${this.pageSize}?courseNo=${this.$route.query.courseNo}&ids=${this.tempPaperIds}`,
|
|
|
+ {
|
|
|
+ // params: {
|
|
|
+ // courseNo: this.$route.query.courseNo,
|
|
|
+ // ids: this.tempPaperIds,
|
|
|
+ // },
|
|
|
+ }
|
|
|
+ )
|
|
|
.then((res) => {
|
|
|
this.tableData2 = res.data.content || [];
|
|
|
+ this.totalSelect = res.data.totalElements;
|
|
|
+ // this.curSelect = res.data.number + 1;
|
|
|
if (bool) {
|
|
|
this.tableData2.forEach((item) => {
|
|
|
if (this.paperIdsArr.includes(item.id)) {
|
|
@@ -412,21 +474,52 @@ export default {
|
|
|
});
|
|
|
}, 0);
|
|
|
}
|
|
|
+ this.tableLoading2 = false;
|
|
|
});
|
|
|
},
|
|
|
- changePaperType(bool) {
|
|
|
- if (bool === true) {
|
|
|
- this.handleSelectionChange([]);
|
|
|
- this.$refs.table2.clearSelection();
|
|
|
- } else {
|
|
|
- this.tableData2 = [];
|
|
|
- this.multipleSelection = [];
|
|
|
- this.getTable2();
|
|
|
+ removeSelected(id) {
|
|
|
+ for (let [index, paper] of this.tempPapers.entries()) {
|
|
|
+ if (id == paper.id) {
|
|
|
+ this.tempPapers.splice(index, 1);
|
|
|
+ this.tableData2.push(paper);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
+ for (var i = 0; i < this.tempPaperIds.length; i++) {
|
|
|
+ if (this.tempPaperIds[i] == id) {
|
|
|
+ this.tempPaperIds.splice(i, 1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.getTable2();
|
|
|
+ },
|
|
|
+ changePaperType() {
|
|
|
+ this.tempPapers = [];
|
|
|
+ this.tempPaperIds = [];
|
|
|
+ this.tableData2 = [];
|
|
|
+ this.tableData3 = [];
|
|
|
+ this.multipleSelection = [];
|
|
|
+ this.curSelect = 1;
|
|
|
+ this.getTable2();
|
|
|
+ // if (bool === true) {
|
|
|
+ // // this.handleSelectionChange([]);
|
|
|
+ // this.tempPapers = [];
|
|
|
+ // this.tempPaperIds = [];
|
|
|
+ // // this.$refs.table2.clearSelection();
|
|
|
+ // this.getTable3();
|
|
|
+ // } else {
|
|
|
+ // this.tableData2 = [];
|
|
|
+ // this.tempPapers = [];
|
|
|
+ // this.tempPaperIds = [];
|
|
|
+ // this.multipleSelection = [];
|
|
|
+ // this.curSelect = 1;
|
|
|
+ // this.getTable2();
|
|
|
+ // }
|
|
|
},
|
|
|
getTable3() {
|
|
|
- let paperIds = this.multipleSelection.map((item) => item.id);
|
|
|
- if (!paperIds.length) {
|
|
|
+ // let paperIds = this.multipleSelection.map((item) => item.id);
|
|
|
+ // if (!paperIds.length) {
|
|
|
+ if (!this.tempPaperIds.length) {
|
|
|
this.tableData3 = [];
|
|
|
this.tableLoading3 = false;
|
|
|
return false;
|
|
@@ -438,7 +531,7 @@ export default {
|
|
|
.post(
|
|
|
"/api/ecs_ques/randompaper/struct/question/view/info",
|
|
|
qs.stringify({
|
|
|
- paperIds: paperIds.join(","),
|
|
|
+ paperIds: this.tempPaperIds.join(","),
|
|
|
structId: this.form.paperStructId,
|
|
|
}),
|
|
|
{
|
|
@@ -454,7 +547,12 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val;
|
|
|
+ // this.multipleSelection = val;
|
|
|
+ val.forEach((element) => {
|
|
|
+ this.tempPapers.push(cloneDeep(element));
|
|
|
+ this.tempPaperIds.push(element.id);
|
|
|
+ });
|
|
|
+ this.getTable2();
|
|
|
this.getTable3();
|
|
|
},
|
|
|
hasNumError(row) {
|