feat:案例和测评接口(测试)新增内部考试选则考卷抽屉

This commit is contained in:
Ggysh-7
2022-11-18 13:00:15 +08:00
parent ec7c437c17
commit 987d683e06
7 changed files with 558 additions and 169 deletions

View File

@@ -46,7 +46,7 @@
<div class="main_table">
<a-table
style="border: 1px solid #f2f6fe"
:columns="tablecolumns"
:columns="columns"
:data-source="tabledata"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
@@ -81,7 +81,7 @@
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref } from "vue";
import { reactive, toRefs, ref,onMounted } from "vue";
import * as api from "../../api/indexEval";
export default {
name: "EvList",
@@ -101,115 +101,27 @@
},
setup(props, ctx) {
const state = reactive({
tableData1: [
{
key: "1",
num: "JDF2022071100001",
name: "时间管理课程",
content: "通用力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "2",
num: "JDF2022071100001",
name: "管理能力课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "3",
num: "JDF2022071100001",
name: "快速换模SMED",
content: "通用力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "4",
num: "JDF2022071100001",
name: "巧妙对话人见人夸",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "5",
num: "JDF2022071100001",
name: "管理能力课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "6",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "7",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "8",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
{
key: "9",
num: "JDF2022071100001",
name: "时间管理课程",
content: "领导力",
teacher: "BOE教师",
creator: "管理员",
time: "2022-10-31 23:12:00",
},
],
currentPage: 1,
tableDataTotal: 100,
tableDataTotal: 0,
pageSize: 10,
vlue1:"",
tabledata: [
],
evaluationTypeId:null,
evaluationTypeName:"",
tableData: [],
});
const options1 = ref([
{
value: "value1",
label: "请选择状态",
},
]);
const columns1 = [
const columns = [
{
title: "课程编号",
width: "20%",
dataIndex: "num",
key: "num",
dataIndex: "kid",
key: "kid",
align: "center",
},
{
title: "title",
width: "20%",
dataIndex: "name",
key: "name",
dataIndex: "title",
key: "title",
align: "center",
},
{
@@ -222,15 +134,15 @@
{
title: "状态",
width: "13%",
dataIndex: "teacher",
key: "teacher",
dataIndex: "status",
key: "status",
align: "center",
},
{
title: "价格",
width: "13%",
dataIndex: "creator",
key: "creator",
dataIndex: "price",
key: "price",
align: "center",
},
{
@@ -242,60 +154,59 @@
},
];
const rowSelection = ref({
type: "radio",
checkStrictly: false,
onChange: (selectedRowKeys, selectedRows) => {
console.log(
`selectedRowKeys: ${selectedRowKeys}`,
"selectedRows: ",
selectedRows
);
},
onSelect: (record, selected, selectedRows) => {
console.log(record, selected, selectedRows);
},
onSelectAll: (selected, selectedRows, changeRows) => {
console.log(selected, selectedRows, changeRows);
onSelect: (selectedRows) => {
state.evaluationTypeName = selectedRows.title
state.evaluationTypeId = selectedRows.kid
},
});
const closeDrawer = () => {
ctx.emit("update:EvalListVisible", false);
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
getEvalList();
const afterVisibleChange = () => {
// getEvalList();
};
const checkFinish =() =>{
ctx.emit("update:evaluationTypeId", state.evaluationTypeId);
ctx.emit("update:evaluationTypeName", state.evaluationTypeName);
let EvListDate = {
Id : state.evaluationTypeId,
Name : state.evaluationTypeName,
}
ctx.emit("getEvListDate", EvListDate);
closeDrawer();
}
const changePagination = (page) => {
state.currentPage = page;
getEvalList();
// getEvalList();
};
const getTableDataList = (tableData) => {
let data = tableData;
let array = [];
data.map((value) => {
let obj = {
key: value.studentId,
projectId: value.projectId, //项目id
groupId: value.groupId, //小组id
group: value.groupName, //小组名
studentId: value.studentId, //学生id
currentStageId: value.currentStageId, //当前关卡id
name: value.name, //用户名
bum: value.userInfoBo.deptName, //部门
gangw: value.userInfoBo.jobName, //岗位
completeStageCnt: value.completeStageCnt, //当前完成阶段数
totalStageCnt: value.totalStageCnt, //总阶段数
progress: value.completeStageCnt + "/" + value.totalStageCnt,
status:value.status,
kid:value.quiz_kid,
title:value.title,
price:value.quiz_price,
// key: value.studentId,
// projectId: value.projectId, //项目id
// groupId: value.groupId, //小组id
// group: value.groupName, //小组名
// studentId: value.studentId, //学生id
// currentStageId: value.currentStageId, //当前关卡id
// name: value.name, //用户名
// bum: value.userInfoBo.deptName, //部门
// gangw: value.userInfoBo.jobName, //岗位
// completeStageCnt: value.completeStageCnt, //当前完成阶段数
// totalStageCnt: value.totalStageCnt, //总阶段数
// progress: value.completeStageCnt + "/" + value.totalStageCnt,
};
array.push(obj);
});
state.tabledata = array;
};
//个人认为此接口为查询外部测评接口
const getEvalList =(o)=>{
let obj = o || {
evaluationTypeName:state.value1
@@ -312,12 +223,30 @@
}
});
};
//获取测评列表
const getAllEvalText = ()=> {
let objael = {
"keyword": "",
"user_id": 0
}
api
.choiceEvaluation(objael)
.then((res) => {
state.tableData = res.data.data
getTableDataList()
})
}
onMounted(() => {
getAllEvalText ();
});
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
options1,
columns1,
getEvalList,
getTableDataList,
columns,
rowSelection,
checkFinish,
changePagination,