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

View File

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