mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-20 00:06:45 +08:00
feat: Add 添加SignupModal组件,并在CourseManage中集成注册功能;
This commit is contained in:
@@ -46,6 +46,20 @@
|
||||
|
||||
<el-col :span="6" :offset="4">
|
||||
<div class="grid-content bg-purple" style="text-align: right;">
|
||||
<el-dropdown
|
||||
v-if="showSignupActions"
|
||||
trigger="click"
|
||||
@command="openAddSignup"
|
||||
style="margin-right: 10px;"
|
||||
>
|
||||
<el-button type="primary">
|
||||
添加报名<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="plain">未设置受众</el-dropdown-item>
|
||||
<el-dropdown-item command="audience">设置受众</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-button type="primary" icon="el-icon-upload2" @click="handleExportSignup">导出报名记录</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -71,6 +85,21 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="signTime" label="报名时间"></el-table-column>
|
||||
<el-table-column
|
||||
v-if="showSignupActions"
|
||||
label="操作"
|
||||
width="140"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="handleDeleteSignup(scope.row)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="padding: 10px;">
|
||||
<div style="text-align:center; padding: 10px;">
|
||||
@@ -226,6 +255,12 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<SignupModal
|
||||
v-if="showSignupActions"
|
||||
:visible.sync="addSignupVisible"
|
||||
:mode="addSignupMode"
|
||||
@confirm="handleSignupCreate"
|
||||
/>
|
||||
<!-- 学习详情 -->
|
||||
<el-dialog title="学习详情" :visible.sync="study.detailShow" width="900px" :append-to-body="true">
|
||||
<div>
|
||||
@@ -448,10 +483,17 @@ import apiStudy from "@/api/modules/courseStudy.js";
|
||||
import { getToken } from "@/utils/token";
|
||||
import axios from "axios";
|
||||
import NameFilterSelect from "@/components/NameFilterSelect/index.vue";
|
||||
import SignupModal from "@/components/signup/SignupModal.vue";
|
||||
|
||||
NameFilterSelect;
|
||||
export default {
|
||||
components: { NameFilterSelect },
|
||||
components: { NameFilterSelect, SignupModal },
|
||||
props: {
|
||||
showSignupActions: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["resOwnerMap", "sysTypeMap"]),
|
||||
},
|
||||
@@ -527,6 +569,8 @@ export default {
|
||||
signType: "",
|
||||
aid: [],
|
||||
},
|
||||
addSignupVisible: false,
|
||||
addSignupMode: "plain",
|
||||
courseType: courseType,
|
||||
value: "",
|
||||
input: "",
|
||||
@@ -632,6 +676,33 @@ export default {
|
||||
loadSysTypes: "sysType/loadSysTypes",
|
||||
}),
|
||||
|
||||
openAddSignup(command) {
|
||||
this.addSignupMode = command === "audience" ? "audience" : "plain";
|
||||
this.addSignupVisible = true;
|
||||
},
|
||||
handleSignupCreate(payload) {
|
||||
console.log("signup payload", payload);
|
||||
this.$message.success("已记录添加报名操作(待接入后端接口)");
|
||||
},
|
||||
handleDeleteSignup(row) {
|
||||
this.$confirm("确定删除该报名记录吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
return apicourseStudy.deleteSignUp(row.id, this.courseDetail.id);
|
||||
})
|
||||
.then((res) => {
|
||||
if (res && res.status === 200) {
|
||||
this.$message.success("删除成功");
|
||||
this.getSignupList();
|
||||
} else if (res) {
|
||||
this.$message.error(res.message || "删除失败");
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
resetCommonResourceQuery() {
|
||||
this.commonResourceStudyPeopleQuery = {
|
||||
|
||||
Reference in New Issue
Block a user