feat:测试抽屉创建数据增加到学习路径

This commit is contained in:
dongwug
2022-11-04 11:46:22 +08:00
parent dd6924bb89
commit c03fb1007b
5 changed files with 133 additions and 84 deletions

View File

@@ -38,31 +38,27 @@
</div>
<div class="main_item2">
<a-table
style="border: 1px solid #f2f6fe"
:columns="tableDataFunc()"
:data-source="tableData"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
@expand="expandTable"
:pagination="false"
:row-selection="{
columnWidth: 30,
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
}"
/>
style="border: 1px solid #f2f6fe"
:columns="tableDataFunc()"
:data-source="tableData"
:loading="tableDataTotal === -1 ? true : false"
expandRowByClick="true"
@expand="expandTable"
:pagination="false"
:row-selection="rowSelection"
/>
<div class="pa">
<a-pagination
showSizeChanger="true"
showQuickJumper="true"
hideOnSinglePage="true"
:pageSize="pageSize"
:current="currentPage"
:total="tableDataTotal"
class="pagination"
/>
</div>
<div class="pa">
<a-pagination
showSizeChanger="true"
showQuickJumper="true"
hideOnSinglePage="true"
:pageSize="pageSize"
:current="currentPage"
:total="tableDataTotal"
class="pagination"
/>
</div>
</div>
</div>
</div>
@@ -74,7 +70,7 @@
</a-drawer>
</template>
<script>
import { reactive, toRefs} from "vue";
import { reactive, toRefs } from "vue";
import * as api from "../../api/indexInvist";
import * as apitaskadd from "../../api/indexTaskadd";
import { message } from "ant-design-vue";
@@ -93,34 +89,20 @@ export default {
inputV1: "",
time: undefined,
tableData: [
{
key: 1,
name: "评估",
num: "2",
creator: "管理员",
time: "2022-07-21 14:30:25",
},
{
key: 2,
name: "评估",
num: "8",
creator: "管理员",
time: "2022-07-21 14:30:25",
},
{
key: 3,
name: "评估",
num: "5",
creator: "管理员",
time: "2022-07-21 14:30:25",
},
{
key: 4,
name: "评估",
num: "20",
creator: "管理员",
time: "2022-07-21 14:30:25",
},
// {
// key: 1,
// name: "评估",
// num: "2",
// creator: "管理员",
// time: "2022-07-21 14:30:25",
// },
// {
// key: 2,
// name: "评估",
// num: "8",
// creator: "管理员",
// time: "2022-07-21 14:30:25",
// },
],
});
const closeDrawer = () => {
@@ -137,7 +119,7 @@ export default {
dataIndex: "name",
// width: "30%",
key: "name",
width: '150px',
width: "150px",
align: "left",
className: "classify",
@@ -162,26 +144,36 @@ export default {
title: "题数",
dataIndex: "num",
key: "num",
width: '80px',
width: "80px",
align: "center",
},
{
title: "创建人",
dataIndex: "creator",
key: "creator",
width: '150px',
width: "150px",
align: "center",
},
{
title: "创建时间",
dataIndex: "time",
key: "time",
width: '200px',
width: "200px",
align: "center",
},
];
return columns;
};
const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
},
getCheckboxProps: record => ({
// disabled: record.name === 'Disabled User',
// // Column configuration not to be checked
name: record.name,
}),
};
//创建评估信息
const createInvist = () => {
let obj = {
@@ -202,9 +194,10 @@ export default {
api
.createAppraiseMessage(obj)
.then((res) => {
console.log("创建成功", res);
message.success("创建成功");
closeDrawer();
console.log("创建成功", res);
message.success("创建成功");
closeDrawer();
getAllInvistText();
apitaskadd
.addTask({
courseId: 0,
@@ -218,7 +211,7 @@ export default {
})
.then((res) => {
console.log("调用项目添加接口后", res.data);
ctx.emit("changeData",false);
ctx.emit("changeData", false);
})
.catch((err) => {
console.log(err);
@@ -229,12 +222,37 @@ export default {
// state.createLoading = false;
});
};
//获取全部评估信息接口
const getAllInvistText = () => {
let obj = {
assessmentName: "",
pageNo: 0,
pageSize: 0,
releaseStatus: "",
searchEndTime: "",
searchStartTime: "",
};
api
.queryAssessmentDetailList(obj)
.then((res) => {
console.log("获取全部评估信息接口成功", res);
message.success("获取全部评估信息接口成功");
console.log(obj);
})
.catch((err) => {
console.log("获取全部评估信息接口失败", err);
// state.createLoading = false;
});
};
return {
...toRefs(state),
afterVisibleChange,
closeDrawer,
tableDataFunc,
rowSelection,
createInvist,
getAllInvistText,
};
},
};
@@ -268,10 +286,10 @@ export default {
display: flex;
align-items: center;
margin-bottom: 32px;
.fi_input{
.fi_input {
margin-right: 20px;
}
.btns{
.btns {
margin-right: 20px;
padding: 0px 26px 0px 26px;
height: 38px;
@@ -324,12 +342,11 @@ export default {
margin-left: 5px;
}
}
}
.main_item2 {
.pa {
width: 100%;
margin:15px auto;
margin: 15px auto;
display: flex;
justify-content: center;
}