feat:创建测评对接 评估改版创建评估对接

This commit is contained in:
dongwug
2022-11-01 14:24:30 +08:00
parent 5dd02e6448
commit 5fad403edc
2 changed files with 136 additions and 130 deletions

View File

@@ -102,7 +102,7 @@
</a-drawer>
</template>
<script>
import { reactive, toRefs, ref, onMounted } from "vue";
import { reactive, toRefs, ref } from "vue";
import { useRouter } from "vue-router";
import * as api from "../../api/indexEval";
import { message } from "ant-design-vue";
@@ -186,35 +186,35 @@ export default {
return isJpgOrPng && isLt2M;
};
const getTableDate = (tableData) => {
let data = tableData;
let array = [];
data.map((value, index) => {
let obj = {
id: value.routerId,
number: (state.currentPage - 1) * state.pageSize + index + 1,
manager: value.name ? value.name : "-",
state:
value.status === 0
? "草稿"
: value.status === 1
? "已发布"
: value.status === -1
? "已停用"
: "-",
creater: value.createName ? value.createName : "-",
pubtime: value.publishTime
? toDate(value.publishTime, "Y-M-D h:m:s")
: "-",
cretime: value.createTime
? toDate(value.createTime, "Y-M-D h:m:s")
: "-",
remark: value.remark ? value.remark : "-",
};
array.push(obj);
});
state.tableData = array;
};
// const getTableDate = (tableData) => {
// let data = tableData;
// let array = [];
// data.map((value, index) => {
// let obj = {
// id: value.routerId,
// number: (state.currentPage - 1) * state.pageSize + index + 1,
// manager: value.name ? value.name : "-",
// state:
// value.status === 0
// ? "草稿"
// : value.status === 1
// ? "已发布"
// : value.status === -1
// ? "已停用"
// : "-",
// creater: value.createName ? value.createName : "-",
// pubtime: value.publishTime
// ? toDate(value.publishTime, "Y-M-D h:m:s")
// : "-",
// cretime: value.createTime
// ? toDate(value.createTime, "Y-M-D h:m:s")
// : "-",
// remark: value.remark ? value.remark : "-",
// };
// array.push(obj);
// });
// state.tableData = array;
// };
//创建测评信息
const createEvalText = () => {
@@ -256,92 +256,92 @@ export default {
});
};
//获取学习路径列表
const getEvalPath = () => {
let obj = {
pageNo: state.currentPage,
pageSize: state.pageSize,
};
api
.queryEvaluationDetailById(obj)
.then((res) => {
if (res.status === 200) {
console.log("获取任务列表数据", res.data.data);
let arr = res.data.data.rows;
if (
arr.length === 0 &&
res.data.data.total > 0 &&
state.currentPage > 1
) {
state.currentPage = state.currentPage - 1;
getEvalPath();
}
getTableDate(arr);
state.tableDataTotal = Number(res.data.data.total);
}
})
.catch((err) => {
console.log("获取学习路径失败", err);
});
};
//翻页 需要去pa里绑定 @change="changePagination"
const changePagination = (page) => {
state.currentPage = page;
getEvalPath();
// console.log("翻页", page, pageSize);
};
//删除评估
const deleteEvalPath = () => {
let obj = {
routerId: state.deletePathId,
type: -2,
};
api
.deleteEvaluationById(obj)
.then((res) => {
console.log("删除成功", res);
message.success("删除成功");
// state.deleteModal = false;
getEvalPath();
})
.catch((err) => {
console.log("删除失败", err);
});
};
//编辑评估
const editEvalPath = () => {
if (!state.pathName) return message.info("请输入路径图名称");
// if (!state.organizationSelectName) return message.info("请选择归属组织");
// state.createLoading = true;
let obj = {
routerId: state.editPathId,
name: state.pathName,
picUrl: "",
remark: state.pathIntro,
status: 0,
};
api
.updateEvaluation(obj)
.then((res) => {
setTimeout(() => {
console.log("修改成功", res);
message.success("修改成功");
// state.createLoading = false;
// state.currentPage = 1;
// state.out1 = false;
// router.push("/leveladd");
getEvalPath();
}, 1000);
})
.catch((err) => {
console.log("修改失败", err);
// state.createLoading = false;
});
};
onMounted(() => {
// console.log("执行");
getEvalPath();
});
// //获取学习路径列表
// const getEvalPath = () => {
// let obj = {
// pageNo: state.currentPage,
// pageSize: state.pageSize,
// };
// api
// .queryEvaluationDetailById(obj)
// .then((res) => {
// if (res.status === 200) {
// console.log("获取任务列表数据", res.data.data);
// let arr = res.data.data.rows;
// if (
// arr.length === 0 &&
// res.data.data.total > 0 &&
// state.currentPage > 1
// ) {
// state.currentPage = state.currentPage - 1;
// getEvalPath();
// }
// getTableDate(arr);
// state.tableDataTotal = Number(res.data.data.total);
// }
// })
// .catch((err) => {
// console.log("获取学习路径失败", err);
// });
// };
// //翻页 需要去pa里绑定 @change="changePagination"
// const changePagination = (page) => {
// state.currentPage = page;
// getEvalPath();
// // console.log("翻页", page, pageSize);
// };
// //删除评估
// const deleteEvalPath = () => {
// let obj = {
// routerId: state.deletePathId,
// type: -2,
// };
// api
// .deleteEvaluationById(obj)
// .then((res) => {
// console.log("删除成功", res);
// message.success("删除成功");
// // state.deleteModal = false;
// getEvalPath();
// })
// .catch((err) => {
// console.log("删除失败", err);
// });
// };
// //编辑评估
// const editEvalPath = () => {
// if (!state.pathName) return message.info("请输入路径图名称");
// // if (!state.organizationSelectName) return message.info("请选择归属组织");
// // state.createLoading = true;
// let obj = {
// routerId: state.editPathId,
// name: state.pathName,
// picUrl: "",
// remark: state.pathIntro,
// status: 0,
// };
// api
// .updateEvaluation(obj)
// .then((res) => {
// setTimeout(() => {
// console.log("修改成功", res);
// message.success("修改成功");
// // state.createLoading = false;
// // state.currentPage = 1;
// // state.out1 = false;
// // router.push("/leveladd");
// getEvalPath();
// }, 1000);
// })
// .catch((err) => {
// console.log("修改失败", err);
// // state.createLoading = false;
// });
// };
// onMounted(() => {
// // console.log("执行");
// getEvalPath();
// });
return {
...toRefs(state),
@@ -349,10 +349,10 @@ export default {
closeDrawer,
//增删改查
createEvalText,
getEvalPath,
changePagination,
deleteEvalPath,
editEvalPath,
// getEvalPath,
// changePagination,
// deleteEvalPath,
// editEvalPath,
//上传组件
fileList,
loading,

View File

@@ -15,7 +15,13 @@
<div class="btnText">添加阶段</div>
</div>
<div class="maincon" style="background-color: #fff">
<div class="item" :class="isactive == index && isActive == true ? 'bgcactive' : '' " v-for="(item , index ) in level" @click="changebgc(index)" :key="item.id">
<div
class="item"
:class="isactive == index && isActive == true ? 'bgcactive' : ''"
v-for="(item, index) in level"
@click="changebgc(index)"
:key="item.id"
>
<div class="itemle">
<div class="tit">{{ item.tit }}</div>
<div class="name">{{ item.name }}</div>
@@ -841,7 +847,7 @@ export default {
cancelModal: false, //确认取消阶段弹窗
deleteModal: false, //确认删除弹窗
isactive: -1,
isActive:false,
isActive: false,
});
const selectProjectName = (value, index) => {
console.log("value", value, index);
@@ -1066,7 +1072,7 @@ export default {
const changebgc = (index) => {
state.isactive = index;
state.isActive = !state.isActive;
}
};
return {
...toRefs(state),
selectProjectName,
@@ -1226,10 +1232,10 @@ export default {
padding: 0 !important;
.modalHeader {
background: linear-gradient(
0deg,
rgba(78, 166, 255, 0) 0%,
rgba(78, 166, 255, 0.2) 100%
);
0deg,
rgba(78, 166, 255, 0) 0%,
rgba(78, 166, 255, 0.2) 100%
);
}
.modalMain {
.ant-input-textarea-show-count {
@@ -1527,9 +1533,9 @@ export default {
right: 16px;
}
}
.bgcactive{
opacity:1;
transition:all .5s;
.bgcactive {
opacity: 1;
transition: all 0.5s;
}
}
}