|
@@ -3,20 +3,40 @@
|
|
|
<template #header>
|
|
<template #header>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="3">
|
|
<el-col :span="3">
|
|
|
- <div>
|
|
|
|
|
- <strong>申请人: </strong>{{savedUserName}}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <span><strong>S/N: </strong>{{curNum+1}} / {{totalNum}}</span>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+
|
|
|
<el-col :span="5">
|
|
<el-col :span="5">
|
|
|
- <div>
|
|
|
|
|
- <strong>申请日期: </strong> {{toMyDate(questionvo.createdTime)}}
|
|
|
|
|
|
|
+ <span><strong>题目类型: </strong>{{questionvo.type}}</span>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <div class="bQuestion-card-body-knowledgeID">
|
|
|
|
|
+ <span v-if="questionvo.knowledgeId && questionvo.knowledgeId.length !== 0">
|
|
|
|
|
+ <span><strong>KnowledgeId: </strong></span>
|
|
|
|
|
+ <el-tooltip v-for="item in questionvo.knowledgeId" effect="dark" placement="bottom">
|
|
|
|
|
+ <template #content>
|
|
|
|
|
+ {{map(item)}}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <el-tag effect="dark" style="margin-right: 2px">{{item}}</el-tag>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <span v-else>
|
|
|
|
|
+ <span><strong>KnowledgeId: </strong>null</span>
|
|
|
|
|
+ </span>
|
|
|
</div>
|
|
</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="14"></el-col>
|
|
|
|
|
|
|
+ <el-col :span="6"></el-col>
|
|
|
<el-col :span="2">
|
|
<el-col :span="2">
|
|
|
- <el-button type="text" circle @click="expand" v-if="!isAll"><strong>查看全部</strong></el-button>
|
|
|
|
|
|
|
+ <el-button type="text" circle @click="expand" v-if="!isAll"><strong>展开</strong></el-button>
|
|
|
<el-button type="text" circle @click="withdraw" v-if="isAll"><strong>收起</strong></el-button>
|
|
<el-button type="text" circle @click="withdraw" v-if="isAll"><strong>收起</strong></el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="1">
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-check" circle @click="approve"></el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1">
|
|
|
|
|
+ <el-button type="warning" icon="el-icon-close" circle @click="checkDialogVisible=true"></el-button>
|
|
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="question-body">
|
|
<div class="question-body">
|
|
@@ -109,32 +129,59 @@
|
|
|
|
|
|
|
|
<el-divider v-if="isAll"></el-divider>
|
|
<el-divider v-if="isAll"></el-divider>
|
|
|
|
|
|
|
|
- <div class="bQuestion-card-footer" v-if="isAll">
|
|
|
|
|
- <div>
|
|
|
|
|
|
|
+ <div class="bQuestion-card-footer" v-show="isAll">
|
|
|
|
|
+ <div class="footer">
|
|
|
<el-row>
|
|
<el-row>
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <el-button type="primary" @click="approve">通过</el-button>
|
|
|
|
|
|
|
+ <el-col :span="3">
|
|
|
|
|
+ <div><strong>状态: </strong>{{questionvo.state}}</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <el-button type="primary" @click="">待定</el-button>
|
|
|
|
|
|
|
+ <el-col :span="5">
|
|
|
|
|
+ <div><strong>申请人: </strong>{{savedUserName}}</div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
|
|
- <el-button type="primary" @click="deny">拒绝</el-button>
|
|
|
|
|
|
|
+ <el-col :span="10"></el-col>
|
|
|
|
|
+ <el-col :span="6">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <strong>申请日期: </strong> {{toMyDate(questionvo.createdTime)}}
|
|
|
|
|
+ </div>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
-
|
|
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="footer" v-if="recordList.length !== 0">
|
|
|
|
|
+ <el-table :data="recordTable" style="width: 100%;background-color: transparent" height="100">
|
|
|
|
|
+ <el-table-column prop="序号" label="序号" width="240" />
|
|
|
|
|
+ <el-table-column prop="操作时间" label="操作时间" width="360" />
|
|
|
|
|
+ <el-table-column prop="操作人" label="操作人" width="240" />
|
|
|
|
|
+ <el-table-column prop="操作类型" label="操作类型" />
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="footer" v-else>
|
|
|
|
|
+ <p>No Record!</p>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
+ <el-dialog title="审核不通过原因" v-model="checkDialogVisible" width="30%" center
|
|
|
|
|
+ :before-close="handleCheckDialogClose">
|
|
|
|
|
+ <el-space direction="vertical">
|
|
|
|
|
+ <el-space direction="vertical" :fill="true">
|
|
|
|
|
+ <el-checkbox-group v-model="failCheckList">
|
|
|
|
|
+ <el-checkbox v-for="(item, index) in failCheckOption" :label="item" class="fail-check-option"/>
|
|
|
|
|
+ </el-checkbox-group>
|
|
|
|
|
+ <el-input v-model="failCheckInput" placeholder="请输入原因"/>
|
|
|
|
|
+ </el-space>
|
|
|
|
|
+ <el-button type="primary" @click="deny">提交</el-button>
|
|
|
|
|
+ </el-space>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import MarkdownText from "./MarkdownText";
|
|
import MarkdownText from "./MarkdownText";
|
|
|
import {toMyDate} from "../utils/dateConvertor";
|
|
import {toMyDate} from "../utils/dateConvertor";
|
|
|
|
|
+ import {map} from "../utils/knowledgeMapper";
|
|
|
|
|
+ import store from "../store";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "checkCard",
|
|
name: "checkCard",
|
|
@@ -143,37 +190,51 @@
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
|
questionvo: Object,
|
|
questionvo: Object,
|
|
|
|
|
+ curNum: Number,
|
|
|
|
|
+ totalNum: Number,
|
|
|
},
|
|
},
|
|
|
data(){
|
|
data(){
|
|
|
return{
|
|
return{
|
|
|
- questionvo1: {
|
|
|
|
|
- id: '',
|
|
|
|
|
- type: '',
|
|
|
|
|
- state: '',
|
|
|
|
|
- checkedUserId: 0,
|
|
|
|
|
- savedUserId: 0,
|
|
|
|
|
- stem: '',
|
|
|
|
|
- weight: 0,
|
|
|
|
|
- analysis: '',
|
|
|
|
|
- keyPoints: '',
|
|
|
|
|
- tags: [],
|
|
|
|
|
- knowledgeId: [],
|
|
|
|
|
- options: {},
|
|
|
|
|
- blanks: {},
|
|
|
|
|
- answer: '',
|
|
|
|
|
- inputOutputMapping: {},
|
|
|
|
|
- millisecondLimit: 0,
|
|
|
|
|
- memoryLimit: 0,
|
|
|
|
|
- createdTime: Date,
|
|
|
|
|
- lastModifiedTime: Date,
|
|
|
|
|
- },
|
|
|
|
|
isAll: false,
|
|
isAll: false,
|
|
|
savedUserName: '',
|
|
savedUserName: '',
|
|
|
|
|
+ // 审核dialog的可视化
|
|
|
|
|
+ checkDialogVisible: false,
|
|
|
|
|
+ // 审核失败的原因
|
|
|
|
|
+ failCheckOption: [
|
|
|
|
|
+ '题目中存在错误','题目与相关内容无关','题目中存在敏感词','其他'
|
|
|
|
|
+ ],
|
|
|
|
|
+ // 详细解释
|
|
|
|
|
+ failCheckInput: "",
|
|
|
|
|
+ failCheckList: [],
|
|
|
|
|
+ recordList: [],
|
|
|
|
|
+ recordNameDict: {},
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ recordTable(){
|
|
|
|
|
+ let recordTable1 = [];
|
|
|
|
|
+ let length = this.recordList.length;
|
|
|
|
|
+ for (let i = 0; i < length; i++) {
|
|
|
|
|
+ let recordDict = {};
|
|
|
|
|
+ recordDict["序号"] = i+1;
|
|
|
|
|
+ recordDict["操作时间"] = this.toMyDate(this.recordList[length-i-1].time);
|
|
|
|
|
+ recordDict["操作人"] = this.recordNameDict[this.recordList[length-i-1].userId];
|
|
|
|
|
+ recordDict["操作类型"] = this.recordList[length-i-1].operationType;
|
|
|
|
|
+ recordTable1.push(recordDict);
|
|
|
|
|
+ }
|
|
|
|
|
+ return recordTable1;
|
|
|
|
|
+ },
|
|
|
|
|
+ denyReason(){
|
|
|
|
|
+ let denyReason = "";
|
|
|
|
|
+ for (let reason of this.failCheckList) {
|
|
|
|
|
+ denyReason += reason+", ";
|
|
|
|
|
+ }
|
|
|
|
|
+ denyReason += this.failCheckInput;
|
|
|
|
|
+ return denyReason;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ map,
|
|
|
toMyDate,
|
|
toMyDate,
|
|
|
expand(){
|
|
expand(){
|
|
|
if(!this.isAll){
|
|
if(!this.isAll){
|
|
@@ -187,13 +248,28 @@
|
|
|
},
|
|
},
|
|
|
approve(){ // 通过审核
|
|
approve(){ // 通过审核
|
|
|
this.questionvo.state = "APPROVED";
|
|
this.questionvo.state = "APPROVED";
|
|
|
|
|
+ let record = {
|
|
|
|
|
+ userId: store.state.user.id,
|
|
|
|
|
+ operationType: "Approve",
|
|
|
|
|
+ }
|
|
|
this.$api.updateQuestion(this.questionvo)
|
|
this.$api.updateQuestion(this.questionvo)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
message: '通过成功!'
|
|
message: '通过成功!'
|
|
|
});
|
|
});
|
|
|
|
|
+ console.log("checkQuestionCard-approve");
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
|
|
+ record.questionId = res.data.result.id;
|
|
|
|
|
+ record.time = new Date();
|
|
|
|
|
+ // 审核通过,添加操作记录
|
|
|
|
|
+ this.$api.createRecord(record)
|
|
|
|
|
+ .then(res1 => {
|
|
|
|
|
+ console.log("checkQuestionCard-approve-createRecord");
|
|
|
|
|
+ console.log(res1);
|
|
|
|
|
+ }).catch(err1 => {
|
|
|
|
|
+ console.log(err1);
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
this.$notify.error({
|
|
this.$notify.error({
|
|
@@ -204,14 +280,32 @@
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
deny(){ // 拒绝通过
|
|
deny(){ // 拒绝通过
|
|
|
|
|
+ let reason = this.denyReason
|
|
|
this.questionvo.state = "REFUSED";
|
|
this.questionvo.state = "REFUSED";
|
|
|
|
|
+ let record = {
|
|
|
|
|
+ userId: store.state.user.id,
|
|
|
|
|
+ operationType: "Refuse",
|
|
|
|
|
+ }
|
|
|
this.$api.updateQuestion(this.questionvo)
|
|
this.$api.updateQuestion(this.questionvo)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
message: '拒绝成功!'
|
|
message: '拒绝成功!'
|
|
|
});
|
|
});
|
|
|
|
|
+ console.log("checkQuestionCard-deny")
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
|
|
+ record.questionId = res.data.result.id;
|
|
|
|
|
+ record.time = new Date();
|
|
|
|
|
+ // todo 这里直接调用denyReason就为空?
|
|
|
|
|
+ record.remark = reason;
|
|
|
|
|
+ // 审核通过,添加操作记录
|
|
|
|
|
+ this.$api.createRecord(record)
|
|
|
|
|
+ .then(res1 => {
|
|
|
|
|
+ console.log("checkQuestionCard-deny-createRecord");
|
|
|
|
|
+ console.log(res1);
|
|
|
|
|
+ }).catch(err1 => {
|
|
|
|
|
+ console.log(err1);
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
.catch(err => {
|
|
.catch(err => {
|
|
|
this.$notify.error({
|
|
this.$notify.error({
|
|
@@ -220,7 +314,20 @@
|
|
|
});
|
|
});
|
|
|
console.log(err);
|
|
console.log(err);
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
|
|
+ this.failCheckList = []
|
|
|
|
|
+ this.failCheckInput = ""
|
|
|
|
|
+ this.checkDialogVisible = false
|
|
|
|
|
+ },
|
|
|
|
|
+ // 关闭审核dialog前的方法
|
|
|
|
|
+ handleCheckDialogClose(done){
|
|
|
|
|
+ const _this = this
|
|
|
|
|
+ _this.$confirm('此操作将丢失填写信息, 是否继续?', '提示')
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ _this.failCheckList = []
|
|
|
|
|
+ _this.failCheckInput = ""
|
|
|
|
|
+ done()})
|
|
|
|
|
+ .catch(()=>{})
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
if(this.questionvo.savedUserId){
|
|
if(this.questionvo.savedUserId){
|
|
@@ -233,6 +340,26 @@
|
|
|
console.log(err);
|
|
console.log(err);
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ this.$api.getRecordByQid(this.questionvo.id) // 异步函数2:根据题目id获得ope_record
|
|
|
|
|
+ .then(res1 => {
|
|
|
|
|
+ let tempList = res1.data.result.content;
|
|
|
|
|
+ this.recordList = tempList;
|
|
|
|
|
+ for (let record of tempList) { //这里换成this.recordList是没问题的
|
|
|
|
|
+ if(!this.recordNameDict[record.userId]){
|
|
|
|
|
+ this.$api.getUserById(record.userId) //异步函数3:根据记录中的用户ID获得其name
|
|
|
|
|
+ .then(res2 => {
|
|
|
|
|
+ if(res2.data.result.name){
|
|
|
|
|
+ this.recordNameDict[record.userId] = res2.data.result.name;
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err2 => {
|
|
|
|
|
+ console.log(err2);
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err1 => {
|
|
|
|
|
+ console.log(err1);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|