|
@@ -61,10 +61,18 @@
|
|
<el-row>
|
|
<el-row>
|
|
<el-form-item class="pull-left">
|
|
<el-form-item class="pull-left">
|
|
<span>批量操作:</span>
|
|
<span>批量操作:</span>
|
|
- <el-button size="small" type="primary" @click="openCoursePropertys"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="openCoursePropertys"
|
|
|
|
+ :disabled="noBatchSelected"
|
|
><i class="el-icon-check"></i> 启用</el-button
|
|
><i class="el-icon-check"></i> 启用</el-button
|
|
>
|
|
>
|
|
- <el-button size="small" type="danger" @click="closeCoursePropertys"
|
|
|
|
|
|
+ <el-button
|
|
|
|
+ size="small"
|
|
|
|
+ type="danger"
|
|
|
|
+ @click="closeCoursePropertys"
|
|
|
|
+ :disabled="noBatchSelected"
|
|
><i class="el-icon-close"></i> 禁用</el-button
|
|
><i class="el-icon-close"></i> 禁用</el-button
|
|
>
|
|
>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -319,39 +327,31 @@ export default {
|
|
},
|
|
},
|
|
//批量启用
|
|
//批量启用
|
|
openCoursePropertys() {
|
|
openCoursePropertys() {
|
|
- var selectedList = this.selectedList;
|
|
|
|
- if (selectedList.length === 0) {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "error",
|
|
|
|
- message: "请选择要开启的课程属性"
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- this.$confirm("是否确认开启?", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "error"
|
|
|
|
- }).then(() => {
|
|
|
|
- this.loading = true;
|
|
|
|
- var url = QUESTION_API + "/courseProperty/opens/" + this.selectedIds;
|
|
|
|
- this.$http
|
|
|
|
- .put(url)
|
|
|
|
- .then(() => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "success",
|
|
|
|
- message: "开启成功!"
|
|
|
|
- });
|
|
|
|
- this.searchCourProperty();
|
|
|
|
- this.selectedList = [];
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "error",
|
|
|
|
- message: "开启失败!"
|
|
|
|
- });
|
|
|
|
- this.selectedList = [];
|
|
|
|
|
|
+ this.$confirm("是否确认开启?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "error"
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ var url = QUESTION_API + "/courseProperty/opens/" + this.selectedIds;
|
|
|
|
+ this.$http
|
|
|
|
+ .put(url)
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "开启成功!"
|
|
});
|
|
});
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ this.searchCourProperty();
|
|
|
|
+ this.selectedList = [];
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "开启失败!"
|
|
|
|
+ });
|
|
|
|
+ this.selectedList = [];
|
|
|
|
+ });
|
|
|
|
+ });
|
|
this.loading = false;
|
|
this.loading = false;
|
|
},
|
|
},
|
|
//关闭
|
|
//关闭
|
|
@@ -379,39 +379,31 @@ export default {
|
|
},
|
|
},
|
|
//批量关闭
|
|
//批量关闭
|
|
closeCoursePropertys() {
|
|
closeCoursePropertys() {
|
|
- var selectedList = this.selectedList;
|
|
|
|
- if (selectedList.length === 0) {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "error",
|
|
|
|
- message: "请选择要禁用的课程属性"
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- this.$confirm("是否确认禁用?", "提示", {
|
|
|
|
- confirmButtonText: "确定",
|
|
|
|
- cancelButtonText: "取消",
|
|
|
|
- type: "error"
|
|
|
|
- }).then(() => {
|
|
|
|
- this.loading = true;
|
|
|
|
- var url = QUESTION_API + "/courseProperty/closes/" + this.selectedIds;
|
|
|
|
- this.$http
|
|
|
|
- .put(url)
|
|
|
|
- .then(() => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "success",
|
|
|
|
- message: "禁用成功!"
|
|
|
|
- });
|
|
|
|
- this.searchCourProperty();
|
|
|
|
- this.selectedList = [];
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
- this.$notify({
|
|
|
|
- type: "error",
|
|
|
|
- message: "禁用失败!"
|
|
|
|
- });
|
|
|
|
- this.selectedList = [];
|
|
|
|
|
|
+ this.$confirm("是否确认禁用?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "error"
|
|
|
|
+ }).then(() => {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ var url = QUESTION_API + "/courseProperty/closes/" + this.selectedIds;
|
|
|
|
+ this.$http
|
|
|
|
+ .put(url)
|
|
|
|
+ .then(() => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "禁用成功!"
|
|
});
|
|
});
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ this.searchCourProperty();
|
|
|
|
+ this.selectedList = [];
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$notify({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: "禁用失败!"
|
|
|
|
+ });
|
|
|
|
+ this.selectedList = [];
|
|
|
|
+ });
|
|
|
|
+ });
|
|
this.loading = false;
|
|
this.loading = false;
|
|
},
|
|
},
|
|
//分页
|
|
//分页
|
|
@@ -544,6 +536,9 @@ export default {
|
|
courseList.push(courseInfo);
|
|
courseList.push(courseInfo);
|
|
}
|
|
}
|
|
return courseList;
|
|
return courseList;
|
|
|
|
+ },
|
|
|
|
+ noBatchSelected() {
|
|
|
|
+ return this.selectedList.length === 0;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|