feat:添加案例接口修改 部分分抽屉的margintop值

This commit is contained in:
Ggysh-7
2022-11-15 12:50:02 +08:00
parent 9659ebef3a
commit 633ec2d6bf
13 changed files with 418 additions and 291 deletions

View File

@@ -509,6 +509,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -9,7 +9,8 @@
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">添加案例</div> <div v-if="edit" class="headerTitle">编辑案例</div>
<div v-else class="headerTitle">添加案例</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@@ -35,7 +36,7 @@
<div class="search"></div> <div class="search"></div>
<div class="btnText">搜索</div> <div class="btnText">搜索</div>
</div> </div>
<div class="btn btn2"> <div class="btn btn2" @click="resetCase()">
<div class="search"></div> <div class="search"></div>
<div class="btnText">重置</div> <div class="btnText">重置</div>
</div> </div>
@@ -43,16 +44,11 @@
</div> </div>
<div class="main_table"> <div class="main_table">
<a-table <a-table class="ant-table-striped" :row-class-name="
class="ant-table-striped"
:row-class-name="
(_record, index) => (index % 2 === 1 ? 'table-striped' : null) (_record, index) => (index % 2 === 1 ? 'table-striped' : null)
" " :row-selection="rowSelection" :columns="tableDataFunc()" :data-source="tableData"
:row-selection="rowSelection" :loading="tableDataTotal === -1 ? true : false" expandRowByClick="true" this.getMilitaryDeployment()
:columns="columns1" @expand="expandTable" :pagination="false" filterMultiple:false
:data-source="tableData1"
:loading="tableDataTotal === -1 ? true : false"
:pagination="false"
/> />
<div class="pa"> <div class="pa">
<a-pagination <a-pagination
@@ -63,148 +59,242 @@
:current="currentPage" :current="currentPage"
:total="tableDataTotal" :total="tableDataTotal"
class="pagination" class="pagination"
@change="handelChangePage"
/> />
</div> </div>
</div> </div>
</div> </div>
<div class="main_btns"> <div class="main_btns">
<button class="btn1">取消</button> <button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2">确定</button> <button class="btn2" @click="updateTask">确定</button>
</div> </div>
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, toRefs, ref } from "vue"; import { reactive, toRefs, onMounted } from "vue";
const columns1 = [ import * as api from "../../api/indexInvist.js";
{ import * as apiTask from "../../api/indexTaskadd";
title: "案例标题", import { message } from "ant-design-vue";
width: "40%", import { RouterEditTask } from "@/api/indexTask";
dataIndex: "title", import dayjs from "dayjs";
key: "num",
align: "center", export default {
ellipsis: true,
},
{
title: "作者",
width: "25%",
dataIndex: "name",
key: "name",
align: "center",
},
{
title: "导入时间",
width: "35%",
dataIndex: "time",
key: "time",
align: "center",
},
];
const rowSelection = ref({
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);
},
});
export default {
name: "AddCase", name: "AddCase",
props: { props: {
addcaseVisible: { addcaseVisible: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
EditCaseId: {
type: Number,
default: null,
},
edit: { // 是否为编辑
type: Boolean,
default: null,
},
projectId: {
type: Number,
default: null,
},
chooseStageId: {
type: Number,
default: null,
},
routerTaskId: {
type: Number,
default: 0,
},
isLevel: { // 是否是关卡页面触发
type: Boolean,
default: null,
},
projectTaskId: { // 要编辑的projectId
type: Number,
default: null,
},
routerId: {
type: Number,
default: null,
},
isactive: {
type: Number,
default: null,
}
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
tableData1: [ tableData: [
{ {
key: "1", key: "1",
title: "基于BOE显示PNL工厂的工序平1111112222222221111111111111122222333335555", title: "基于BOE显示PNL工厂的工序平1111112222222221111111111111122222333335555",
name: "李玉冰", name: "李玉冰",
time: "2022-10-31 23:12:00", time: "2022-10-31 23:12:00",
}, },
{
key: "2",
title: "OEM 企业一线用工之路探索",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
{
key: "3",
title: " 销售数字化转型的痛苦与探索",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
{
key: "4",
title: "疫情突发技能人才招聘的相关",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
{
key: "5",
title: "设计效率提升之工具化",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
{
key: "6",
title: "疫情突发技能人才招聘的相关",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
{
key: "7",
title: "基于BOE显示PNL工厂的工序平",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
{
key: "8",
title: "基于BOE显示PNL工厂的工序平",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
{
key: "9",
title: "基于BOE显示PNL工厂的工序平",
name: "李玉冰",
time: "2022-10-31 23:12:00",
},
], ],
currentPage: 1, currentPage: 1,
tableDataTotal: 100, tableDataTotal: 0,
pageSize: 10, pageSize: 10,
inputV1:'', inputV1: '',
time: undefined,
assessmentId: null,
assessmentName: "",
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:addcaseVisible", false); ctx.emit("update:addcaseVisible", false);
ctx.emit("update:edit", false);
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
console.log("state", bool); console.log("state", bool);
}; };
const tableDataFunc = () => {
const columns = [
{
title: "案例标题",
dataIndex: "tit",
key: "tit",
width: "400px",
align: "center",
},
{
title: "作者",
dataIndex: "name",
// width: "30%",
key: "name",
width: "100px",
align: "center",
className: "classify",
},
{
title: "导入时间",
dataIndex: "time",
key: "time",
width: "200px",
align: "center",
},
];
return columns;
};
const rowSelection = {
onSelect: (selectedRows, selected, selectedRowKeys) => {
console.log(
"selectedRowKeys", selectedRowKeys, "selectedRows", selectedRows, "selected", selected);
console.log(selectedRows.assessmentId);
state.assessmentId = selectedRows.assessmentId;
state.assessmentName = selectedRows.name;
},
};
const handelChangePage = (page, pageSize) => {
state.currentPage = page;
state.pageSize = pageSize;
getAllCaseText();
};
const getTableDate = (tableData) => {
let data = tableData;
let array = [];
data.map((value, index) => {
let obj = {
key: index,
assessmentId: value.assessmentId,
num: value.essayQuestionVoList.length,
name: value.assessmentName ? value.assessmentName : "-",
creator: value.createUser ? value.createUser : "-",
time: dayjs(value.createTime).format("YYYY-MM-DD"),
};
array.push(obj);
});
state.tableData = array;
};
//获取全部案例信息接口
const getAllCaseText = () => {
api
.queryAssessmentDetailList({
assessmentName: "",
pageNo: state.currentPage,
pageSize: state.pageSize,
})
.then((res) => {
let arr = res.data.data.rows;
if (res.status === 200) {
// console.log("获取案例信息", res.data.data);
getTableDate(arr);
state.tableDataTotal = Number(res.data.data.total);
}
})
.catch((err) => {
console.log("获取全部在线信息接口失败", err);
// state.createLoading = false;
});
};
const updateTask = () => {
console.log("jinlaile=================", state.assessmentName)
if (props.isLevel) {
RouterEditTask({
chapterId: props.isactive,
courseId: state.assessmentId,
name: state.assessmentName,
routerId: props.routerId,
routerTaskId: props.routerTaskId || 0,
type: 3,
})
.then((res) => {
console.log(res, 11111);
message.success(`${props.edit ? '编辑' : '新增'}关卡任务成功`)
ctx.emit("changeData", false);
closeDrawer();
state.addLoading = false;
})
.catch((err) => {
console.log(err, 1111);
});
} else {
console.log("=========projectTaskId", props.projectTaskId);
apiTask
.addTask({
courseId: state.assessmentId,
name: state.assessmentName,
projectId: props.projectId,
projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId,
type: 3,
})
.then((res) => {
console.log("调用项目添加接口后111", res.data, 11111);
ctx.emit("changeData", false);
closeDrawer();
})
.catch((err) => {
console.log(err, 111111);
});
}
}
//重置案例信息
const resetCase = () => {
state.inputV1 = "";
getAllCaseText();
};
onMounted(() => {
// createCase();
getAllCaseText();
});
return { return {
...toRefs(state), ...toRefs(state),
afterVisibleChange, afterVisibleChange,
closeDrawer, closeDrawer,
columns1, tableDataFunc,
rowSelection, rowSelection,
handelChangePage,
getTableDate,
updateTask,
getAllCaseText,
resetCase,
}; };
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
@@ -226,9 +316,12 @@
} }
} }
.contentMain { .contentMain {
padding-right: 15px;
.main_items { .main_items {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 32px;
margin-bottom: 12px; margin-bottom: 12px;
flex-wrap: wrap; flex-wrap: wrap;
.mi_ipts { .mi_ipts {
@@ -381,4 +474,4 @@
} }
} }
} }
</style> </style>

View File

@@ -300,6 +300,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -322,6 +322,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -400,20 +400,25 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;
display: flex; display: flex;
justify-content: end; justify-content: end;
align-items: center; align-items: center;
.sign { .sign {
margin-right: 5px; margin-right: 5px;
} }
} }
.btnbox { .btnbox {
display: flex; display: flex;
flex: 1; flex: 1;
align-items: center; align-items: center;
.xkbtn { .xkbtn {
cursor: pointer; cursor: pointer;
width: 130px; width: 130px;
@@ -426,21 +431,25 @@ export default {
} }
} }
} }
.main_item2 { .main_item2 {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;
display: flex; display: flex;
justify-content: end; justify-content: end;
align-items: center; align-items: center;
} }
.kqszbox { .kqszbox {
.qdqtbox { .qdqtbox {
margin-left: 5px; margin-left: 5px;
cursor: pointer; cursor: pointer;
} }
.qdbtn, .qdbtn,
.qtbtn { .qtbtn {
width: 75px; width: 75px;
@@ -451,15 +460,18 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.btntext { .btntext {
color: #387df7; color: #387df7;
} }
} }
.setbox { .setbox {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 10px; margin-top: 10px;
margin-bottom: 24px; margin-bottom: 24px;
.timerbox { .timerbox {
margin-top: 6px; margin-top: 6px;
margin-right: 32px; margin-right: 32px;
@@ -469,10 +481,12 @@ export default {
} }
} }
} }
.btnbox2 { .btnbox2 {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
.xkbtn { .xkbtn {
cursor: pointer; cursor: pointer;
width: 130px; width: 130px;
@@ -488,11 +502,14 @@ export default {
} }
} }
} }
.main_right { .main_right {
width: 337px; width: 337px;
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -488,6 +488,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {

View File

@@ -333,6 +333,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.fi_input { .fi_input {
margin-right: 20px; margin-right: 20px;

View File

@@ -701,6 +701,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -49,7 +49,7 @@
<div class="search"></div> <div class="search"></div>
<div class="btnText">搜索</div> <div class="btnText">搜索</div>
</div> </div>
<div class="btn btn2" @click="resetInvist"> <div class="btn btn2" @click="resetOnline()">
<div class="search"></div> <div class="search"></div>
<div class="btnText">重置</div> <div class="btnText">重置</div>
</div> </div>
@@ -241,7 +241,7 @@ export default {
const handelChangePage = (page, pageSize) => { const handelChangePage = (page, pageSize) => {
state.currentPage = page; state.currentPage = page;
state.pageSize = pageSize; state.pageSize = pageSize;
getAllInvistText(); getAllOnlineText();
}; };
const getTableDate = (tableData) => { const getTableDate = (tableData) => {
let data = tableData; let data = tableData;
@@ -260,7 +260,7 @@ export default {
state.tableData = array; state.tableData = array;
}; };
//获取全部在线信息接口 //获取全部在线信息接口
const getAllInvistText = () => { const getAllOnlineText = () => {
api api
.queryAssessmentDetailList({ .queryAssessmentDetailList({
assessmentName: "", assessmentName: "",
@@ -323,13 +323,13 @@ export default {
} }
} }
//重置在线信息 //重置在线信息
const resetInvist = () => { const resetOnline = () => {
state.inputV1 = ""; state.inputV1 = "";
getAllInvistText(); getAllOnlineText();
}; };
onMounted(() => { onMounted(() => {
// createInvist(); // createOnline();
getAllInvistText(); getAllOnlineText();
}); });
return { return {
...toRefs(state), ...toRefs(state),
@@ -338,9 +338,10 @@ export default {
tableDataFunc, tableDataFunc,
rowSelection, rowSelection,
handelChangePage, handelChangePage,
getAllOnlineText,
getTableDate, getTableDate,
updateTask, updateTask,
resetInvist, resetOnline,
}; };
}, },
}; };
@@ -371,6 +372,7 @@ export default {
.main_items { .main_items {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: 32px;
margin-bottom: 12px; margin-bottom: 12px;
flex-wrap: wrap; flex-wrap: wrap;
.mi_ipts { .mi_ipts {

View File

@@ -200,7 +200,7 @@
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { reactive, ref, toRefs } from "vue"; import { reactive, ref, toRefs } from "vue";
import {message} from"ant-design-vue"; import {message} from"ant-design-vue";
import {createExamination,queryExaminationDetailById,updateExamination} from "@/api/indexExam" import {createExamination,queryExaminationDetailById,updateExamination} from "@/api/indexExam"
@@ -628,7 +628,7 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
@@ -659,6 +659,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -477,6 +477,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -435,6 +435,7 @@ export default {
.main_item { .main_item {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 32px;
margin-bottom: 32px; margin-bottom: 32px;
.signbox { .signbox {
width: 120px; width: 120px;

View File

@@ -132,7 +132,9 @@
</div> </div>
<!-- 添加案例侧弹窗 --> <!-- 添加案例侧弹窗 -->
<div> <div>
<add-case v-model:addcaseVisible="addcasevisible" /> <add-case v-model:addcaseVisible="addcasevisible" @changeData="updateTableData" v-model:edit="edit"
v-model:projectId="projectId" v-model:chooseStageId="chooseStageId" v-model:projectTaskId="projectTaskId"
v-model:EditCaseId="EditCaseId" />
</div> </div>
<!-- 添加案例侧弹窗 --> <!-- 添加案例侧弹窗 -->
<div class="lin"></div> <div class="lin"></div>
@@ -962,6 +964,8 @@ export default {
EditActiveId: null, //要编辑的活动id EditActiveId: null, //要编辑的活动id
EditWorkId: null, // 要编辑的作业id EditWorkId: null, // 要编辑的作业id
EditTestId: null, // 要编辑的考试id EditTestId: null, // 要编辑的考试id
EditCaseId:null,//要编辑的案例id
EditOnlineId:null,//要编辑的在线id
EditEvalId: null, EditEvalId: null,
EditInvistId: null, EditInvistId: null,
EditVoteId: null, //编辑需要投票的id EditVoteId: null, //编辑需要投票的id
@@ -1519,8 +1523,10 @@ export default {
const showDrawerFaceteach = () => { const showDrawerFaceteach = () => {
state.addfaceteachvisible = true; state.addfaceteachvisible = true;
}; };
const showDrawerAddCase = () => { const showDrawerAddCase = (id, eleId) => {
state.addcasevisible = true; state.addcasevisible = true;
state.EditCaseId = id;
state.projectTaskId = eleId;
}; };
const showDrawerAddHomework = (id, eleId) => { const showDrawerAddHomework = (id, eleId) => {
state.EditWorkId = id; state.EditWorkId = id;