添案例接口添多数据情况批量标记弹窗封装新增查答卷查投票抽屉考勤面管添在线注释及清空考和测管内容判断

This commit is contained in:
Ggysh-7
2022-11-21 13:32:21 +08:00
parent 5a9c5ad274
commit 0fe0e74a75
22 changed files with 1259 additions and 1075 deletions

View File

@@ -47,16 +47,10 @@
<a-table
style="border: 1px solid #f2f6fe"
:columns="columns"
:data-source="tabledata"
:data-source="tableData"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
@expand="expandTable"
:pagination="false"
:row-selection="{
columnWidth: 30,
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
:row-selection="{ selectedRowKeys:selectedRowKeys,onSelect:onSelect,onChange:onSelectChange}"
/>
<div class="pa">
<a-pagination
@@ -81,7 +75,7 @@
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref,onMounted } from "vue";
import { reactive, toRefs } from "vue";
import * as api from "../../api/indexEval";
export default {
name: "EvList",
@@ -108,64 +102,64 @@
evaluationTypeId:null,
evaluationTypeName:"",
tableData: [],
selectedRowKeys:[],
columns:[
{
title: "课程编号",
width: "20%",
dataIndex: "quiz_code",
key: "code",
align: "center",
},
{
title: "title",
width: "20%",
dataIndex: "title",
key: "title",
align: "center",
},
{
title: "备注",
width: "13%",
dataIndex: "theme_desc",
key: "content",
align: "center",
},
{
title: "状态",
width: "13%",
dataIndex: "status",
key: "status",
align: "center",
},
{
title: "价格",
width: "13%",
dataIndex: "quiz_price",
key: "price",
align: "center",
},
{
title: "可答题人数",
width: "20%",
dataIndex: "quiz_range",
key: "time",
align: "center",
},
]
});
const columns = [
{
title: "课程编号",
width: "20%",
dataIndex: "kid",
key: "kid",
align: "center",
},
{
title: "title",
width: "20%",
dataIndex: "title",
key: "title",
align: "center",
},
{
title: "备注",
width: "13%",
dataIndex: "content",
key: "content",
align: "center",
},
{
title: "状态",
width: "13%",
dataIndex: "status",
key: "status",
align: "center",
},
{
title: "价格",
width: "13%",
dataIndex: "price",
key: "price",
align: "center",
},
{
title: "可答题人数",
width: "20%",
dataIndex: "time",
key: "time",
align: "center",
},
];
const rowSelection = ref({
type: "radio",
checkStrictly: false,
onSelect: (selectedRows) => {
state.evaluationTypeName = selectedRows.title
state.evaluationTypeId = selectedRows.kid
},
});
const onSelect = (record)=> {
state.evaluationTypeName = record.title
state.evaluationTypeId = record.quiz_code
};
const onSelectChange = (selectedRowKeys)=> {
state.selectedRowKeys = selectedRowKeys
}
const closeDrawer = () => {
ctx.emit("update:EvalListVisible", false);
};
const afterVisibleChange = () => {
// getEvalList();
getAllEvalText();
};
const checkFinish =() =>{
let EvListDate = {
@@ -177,77 +171,46 @@
}
const changePagination = (page) => {
state.currentPage = page;
// getEvalList();
};
const getTableDataList = (tableData) => {
let data = tableData;
let array = [];
data.map((value) => {
let obj = {
status:value.status,
kid:value.quiz_kid,
quiz_code:value.quiz_code,
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,
theme_desc:value.theme_desc,
quiz_price:value.quiz_price,
quiz_range:value.quiz_range,
};
array.push(obj);
});
state.tabledata = array;
};
//个人认为此接口为查询外部测评接口
const getEvalList =(o)=>{
let obj = o || {
evaluationTypeName:state.value1
}
api
.getEvalListByName(obj).then((res) => {
console.log(res.data.data, "获取测评");
let leng = res.data.data.rows.length;
state.total = res.data.data.total;
if (leng > 0) {
let arr = res.data.data.rows;
getTableDataList(arr);
}
});
state.tableData = array;
};
//获取测评列表
const getAllEvalText = ()=> {
let objael = {
"keyword": "",
"user_id": 0
"user_id": 0,
}
api
.choiceEvaluation(objael)
.then((res) => {
state.tableData = res.data.data
getTableDataList()
getTableDataList(res.data.data)
})
.catch(()=>{
})
}
onMounted(() => {
getAllEvalText ();
});
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
getEvalList,
onSelectChange,
onSelect,
getTableDataList,
columns,
rowSelection,
checkFinish,
changePagination,
};