|
@@ -17,7 +17,11 @@
|
|
|
|
|
|
<div class="log-container">
|
|
|
<div class="log-question">
|
|
|
- <div v-if="question.id" class="edit-part" :key="question.id">
|
|
|
+ <div
|
|
|
+ v-if="question.version"
|
|
|
+ class="edit-part"
|
|
|
+ :key="question.version"
|
|
|
+ >
|
|
|
<div class="edit-cont">
|
|
|
<div class="edit-cont-title">
|
|
|
<rich-text :text-json="question.quesBody"></rich-text>
|
|
@@ -143,17 +147,39 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="log-history">
|
|
|
- <el-table
|
|
|
- element-loading-text="加载中"
|
|
|
- :data="logList"
|
|
|
- :row-class-name="rowClassHandle"
|
|
|
- @row-click="selectQuestion"
|
|
|
- >
|
|
|
- <el-table-column label="修改时间" width="180" prop="creationTime">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="修改人" prop="creator" width="120">
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <div class="log-history-table">
|
|
|
+ <el-table
|
|
|
+ element-loading-text="加载中"
|
|
|
+ :data="logList"
|
|
|
+ :row-class-name="rowClassHandle"
|
|
|
+ @row-click="selectQuestion"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="修改时间"
|
|
|
+ width="160"
|
|
|
+ prop="versionCreationTime"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="修改人" prop="versionCreatorLoginName">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.versionCreatorRealName }}({{
|
|
|
+ scope.row.versionCreatorLoginName
|
|
|
+ }})
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="part-page">
|
|
|
+ <el-pagination
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-size="pageSize"
|
|
|
+ :total="total"
|
|
|
+ @current-change="toPage"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -164,9 +190,11 @@
|
|
|
|
|
|
<script>
|
|
|
import { questionEditLogsApi } from "../api";
|
|
|
+import QuestionAnswer from "./QuestionAnswer.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "QuestionEditLogDialog",
|
|
|
+ components: { QuestionAnswer },
|
|
|
props: {
|
|
|
questionId: {
|
|
|
type: [String, Number],
|
|
@@ -178,17 +206,35 @@ export default {
|
|
|
modalIsShow: false,
|
|
|
question: {},
|
|
|
logList: [],
|
|
|
- curLogId: "",
|
|
|
+ curLogVersion: "",
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ total: 0,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
async openHandle() {
|
|
|
- const res = await questionEditLogsApi(this.questionId);
|
|
|
-
|
|
|
- this.logList = res || [];
|
|
|
-
|
|
|
+ await this.toPage(1);
|
|
|
if (this.logList.length) this.selectQuestion(this.logList[0]);
|
|
|
},
|
|
|
+ async toPage(page) {
|
|
|
+ this.currentPage = page;
|
|
|
+ await this.getList();
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ const res = await questionEditLogsApi({
|
|
|
+ questionId: this.questionId,
|
|
|
+ pageNumber: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ });
|
|
|
+
|
|
|
+ this.logList = res.data.content;
|
|
|
+ this.total = res.data.totalElements;
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.pageSize = val;
|
|
|
+ this.toPage(1);
|
|
|
+ },
|
|
|
cancel() {
|
|
|
this.modalIsShow = false;
|
|
|
},
|
|
@@ -211,11 +257,11 @@ export default {
|
|
|
return typeQuestion.includes(questionType);
|
|
|
},
|
|
|
rowClassHandle({ row }) {
|
|
|
- return row.id === this.curLogId ? "is-active" : "";
|
|
|
+ return row.version === this.curLogVersion ? "is-active" : "";
|
|
|
},
|
|
|
selectQuestion(row) {
|
|
|
- this.curLogId = row.id;
|
|
|
- this.question = row.question;
|
|
|
+ this.curLogVersion = row.version;
|
|
|
+ this.question = row;
|
|
|
},
|
|
|
},
|
|
|
};
|