添加面授任务

This commit is contained in:
zhangyc
2022-11-27 16:39:22 +08:00
parent 339d77fd1d
commit a586bf108e
11 changed files with 562 additions and 324 deletions

View File

@@ -20,29 +20,29 @@
<div class="main_items">
<div class="mi_ipts">
<div class="mii_ipt">
<div class="ipt_name">课程编号</div>
<div class="ipt_name">课程信息</div>
<div class="fi_input">
<a-input
v-model:value="valueClass"
v-model:value="name"
style="width: 240px; height: 40px; border-radius: 8px"
placeholder="请输入项目名称"
/>
</div>
</div>
<div class="mii_ipt">
<div class="ipt_name">内容分类</div>
<div class="select">
<a-select
dropdownClassName="dropdown-style"
style="width: 240px"
placeholder="请选择"
:options="options1"
@change="handleChange"
v-model:value="valueContent"
allowClear
showSearch
/>
</div>
<div class="ipt_name">课程状态</div>
<div class="select fitems">
<a-select
v-model:value="auditStatus"
dropdownClassName="dropdown-style"
style="width: 200px"
placeholder="请选择状态"
:options="options1"
allowClear
showSearch
>
</a-select>
</div>
</div>
</div>
<div class="mi_btns">
@@ -56,18 +56,58 @@
</div>
</div>
</div>
<div class="main_notice">
<div class="mntc_left">
<div class="notice_icon"></div>
<div v-if="offcourse == null">
<span class="title"
>已选择 <span class="data">0</span> </span
>
</div>
<div v-else>
<span class="title"
>已选择 <span class="data">1</span> ;</span
>
<span class="title"
>课程编号
<span class="data">{{ offcourse.offcourseId }}</span>
</span>
<span class="title"
>名称
<span class="data">{{
offcourse.name
}}</span>
</span>
<span class="title"
>分类
<span class="data">{{
offcourse.categoryId
}}</span>
</span>
<span class="title"
>授课老师
<span class="data">{{
offcourse.teacherId
}}</span>
</span>
<span class="title"
>创建人
<span class="data">{{ offcourse.createUser }}</span>
</span>
</div>
</div>
</div>
<div class="main_table">
<a-table
class="ant-table-striped"
:row-class-name="
(_record, index) => (index % 2 === 1 ? 'table-striped' : null)
"
:row-selection="{
selectedRowKeys: selectedRowKeys,
onChange: onSelectChange,
type: 'radio',
}"
:row-selection="rowSelection"
:columns="columns1"
:data-source="classTableData"
:loading="tableDataTotal === -1 ? true : false"
@@ -88,28 +128,18 @@
</div>
</div>
</div>
<div class="main_btns">
<button class="btn1">取消</button>
<button class="btn2" @click="closeDrawer">确定</button>
</div>
</div>
</a-drawer>
</template>
<script>
//import { ApiFilled } from "@ant-design/icons-vue";
import { reactive, toRefs, ref } from "vue";
// import { planList } from "../../api/indexTaskadd";
import {detail} from "../../api/indexCourse";
import { list } from "../../api/indexTaskadd";
import { toDate } from "../../api/method";
const options1 = ref([
{
value: "value1",
label: "通用",
},
{
value: "value2",
label: "领导",
},
]);
const columns1 = [
{
title: "课程编号",
@@ -162,6 +192,14 @@ export default {
type: Boolean,
default: false,
},
chooseCourse: {
type: Number,
default: null,
},
titleTag: {
type: Boolean,
default: false,
},
},
setup(props, ctx) {
const state = reactive({
@@ -183,46 +221,55 @@ export default {
valueContent: null, //内容分类
selectedRows: [], //选择的数据
selectedRowKeys: [],
titleTag:false,
offcourse:null,
auditStatus:null,
name:null,
});
const onSelectChange = (selectedRowKeys, selectedRows) => {
console.log("selectedRowKeys changed: ", selectedRowKeys);
state.selectedRowKeys = selectedRowKeys;
state.selectedRows = selectedRows;
console.log("选择了", state.selectedRows[0].name);
const rowSelection = {
type: "radio",
onSelect: (selectedRows) => {
state.chooseCourse=selectedRows.num;
console.log(selectedRows,"==========",state.chooseCourse);
closeDrawer();
},
};
const closeDrawer = () => {
ctx.emit("update:selfacetVisible", false);
ctx.emit("getData", state.selectedRows);
ctx.emit("update:chooseCourse", state.chooseCourse);
};
const afterVisibleChange = (bool) => {
console.log("state", bool);
if(bool){
state.chooseCourse=props.chooseCourse;
getClassList();
getFaceInfo();
}
};
// const showDrawerSelFacet = () => {
// state.selfacetvisible = true;
// };
const getFaceInfo =()=>{
detail({offcourseId:36}).then((res) => {
state.chooseCourse = res.data.data;
}).catch();
}
//获取面授课列表
const getClassList = (obj) => {
let objn = obj || {
auditStatus: 0,
// beginTime: 0,
categoryId: 0,
createName: "",
// endTime: 0,
name: "",
pageNo: state.currentPage,
pageSize: 10,
projectName: "",
auditStatus:state.auditStatus,
name:state.name,
pageNo:state.currentPage,
pageSize:state.pageSize
};
list(objn)
.then((res) => {
console.log(res.data.data.rows);
let result = res.data.data;
state.tableDataTotal = result.total;
if (result.total > 0) {
getClassData(result.rows);
}
getClassData(result.rows);
})
.catch((err) => {
console.log("获取列表失败", err.data);
@@ -248,32 +295,41 @@ export default {
state.classTableData = array;
};
const options1 = ref([
{
value: 0,
label: "未提交",
},
{
value: 1,
label: "待审核",
},
{
value: 2,
label: "已审核",
},
{
value: -1,
label: "审核未通过",
},
]);
const handleChange = (value, option) => {
console.log("改变了", value, option);
console.log(state.valueContent);
};
//重置
const reset = () => {
state.valueClass = null;
state.valueContent = null;
//搜索
const search = () => {
//重新获取列表
getClassList();
};
//搜索
const search = () => {
let obj = {
auditStatus: 0,
// beginTime: 0,
categoryId: 0, //分类
createName: "",
// endTime: 0,
name: state.valueClass,
pageNo: state.currentPage,
pageSize: 10,
projectName: "",
};
getClassList(obj);
//重置
const reset = () => {
state.name = null;
state.auditStatus = null;
//重新获取列表
getClassList();
};
const changePaginationStu = (page) => {
state.currentPage = page;
getClassList();
@@ -289,9 +345,9 @@ export default {
handleChange,
reset,
getClassList,
search,
changePaginationStu,
onSelectChange,
rowSelection,
search,
// change,
};
},
@@ -323,6 +379,7 @@ export default {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
margin-top: 32px;
flex-wrap: wrap;
.mi_ipts {
display: flex;
@@ -403,6 +460,36 @@ export default {
}
}
}
.main_notice {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32px;
height: 40px;
background-color: #e9f6fe;
.mntc_left {
display: flex;
align-items: center;
.title {
color: rgba(0, 0, 0, 0.65);
margin-right: 17px;
}
.data {
color: #388be1;
}
.notice_icon {
width: 14px;
height: 14px;
margin-right: 9px;
margin-left: 9px;
background-image: url(@/assets/images/coursewareManage/gan.png);
background-size: 100% 100%;
}
}
.mntc_right {
cursor: pointer;
}
}
}
.main_btns {