|
@@ -1,13 +1,13 @@
|
|
|
<template>
|
|
|
<div id="moduleManagementEdit">
|
|
|
- <div class="boxWidth">
|
|
|
- <el-form
|
|
|
- label-position="right"
|
|
|
- label-width="120px"
|
|
|
- :model="listData"
|
|
|
- :rules="rules"
|
|
|
- ref="listData"
|
|
|
- >
|
|
|
+ <el-form
|
|
|
+ label-position="right"
|
|
|
+ label-width="120px"
|
|
|
+ :model="listData"
|
|
|
+ :rules="rules"
|
|
|
+ ref="listData"
|
|
|
+ >
|
|
|
+ <div class="boxWidth">
|
|
|
<el-form-item label="适用业务层级" required>
|
|
|
<el-select
|
|
|
v-model="eduType"
|
|
@@ -173,99 +173,104 @@
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="管理章">
|
|
|
- <div class="dis_plays">
|
|
|
- <div>
|
|
|
- <el-button size="small" @click="openBoxs">添加章</el-button>
|
|
|
- </div>
|
|
|
- <div style="color: #f56c6c">
|
|
|
- <span style="margin-right: 10px"
|
|
|
- >章总数:{{ tableData.length }}</span
|
|
|
- >
|
|
|
- <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <el-form-item label="管理章">
|
|
|
+ <div class="dis_plays">
|
|
|
+ <div>
|
|
|
+ <el-button size="small" @click="openBoxs">调用已有数据</el-button>
|
|
|
+ <el-button size="small" @click="addChapter">自定义添加章</el-button>
|
|
|
</div>
|
|
|
- <el-table
|
|
|
- :data="tableData"
|
|
|
- border
|
|
|
- :header-cell-style="{
|
|
|
- 'background-color': '#eee',
|
|
|
- padding: '8px',
|
|
|
- color: '#333',
|
|
|
- }"
|
|
|
- :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- v-for="(item, index) in tableSet"
|
|
|
- :width="item.width"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- align="center"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- header-align="center"
|
|
|
- :sortable="item.prop === 'sort'"
|
|
|
- sort-by="sort"
|
|
|
- :prop="item.prop"
|
|
|
+ <div style="color: #f56c6c">
|
|
|
+ <span style="margin-right: 10px"
|
|
|
+ >章总数:{{ tableData.length }}</span
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="item.scope === 'types'">{{
|
|
|
+ <!-- <span>总时长:{{ minTimeAll }}分钟</span> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ border
|
|
|
+ :header-cell-style="{
|
|
|
+ 'background-color': '#eee',
|
|
|
+ padding: '8px',
|
|
|
+ color: '#333',
|
|
|
+ }"
|
|
|
+ :default-sort="{ prop: 'sort', order: 'ascending' }"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ v-for="(item, index) in tableSet"
|
|
|
+ :width="item.width"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ align="center"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ header-align="center"
|
|
|
+ :sortable="item.prop === 'sort'"
|
|
|
+ sort-by="sort"
|
|
|
+ :prop="item.prop"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="item.scope === 'types'">{{
|
|
|
+ scope.row[item.prop] === 1
|
|
|
+ ? "录播"
|
|
|
+ : scope.row[item.prop] === 2
|
|
|
+ ? "直播"
|
|
|
+ : scope.row[item.prop] === 3
|
|
|
+ ? "回放"
|
|
|
+ : "未知"
|
|
|
+ }}</span>
|
|
|
+ <span v-else-if="item.scope === 'Status'">
|
|
|
+ {{
|
|
|
scope.row[item.prop] === 1
|
|
|
- ? "录播"
|
|
|
- : scope.row[item.prop] === 2
|
|
|
- ? "直播"
|
|
|
- : scope.row[item.prop] === 3
|
|
|
- ? "回放"
|
|
|
+ ? "发布"
|
|
|
+ : scope.row[item.prop] === 0
|
|
|
+ ? "未发布"
|
|
|
: "未知"
|
|
|
- }}</span>
|
|
|
- <span v-else-if="item.scope === 'Status'">
|
|
|
- {{
|
|
|
- scope.row[item.prop] === 1
|
|
|
- ? "发布"
|
|
|
- : scope.row[item.prop] === 0
|
|
|
- ? "未发布"
|
|
|
- : "未知"
|
|
|
- }}
|
|
|
- </span>
|
|
|
- <div v-else-if="item.scope === 'inputs'">
|
|
|
- <el-input-number
|
|
|
- style="width: 50px"
|
|
|
- size="small"
|
|
|
- :controls="false"
|
|
|
- v-model="scope.row[item.prop]"
|
|
|
- controls-position="right"
|
|
|
- :min="0"
|
|
|
- ></el-input-number>
|
|
|
- </div>
|
|
|
- <span v-else>{{ scope.row[item.prop] }}</span></template
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="操作"
|
|
|
- align="center"
|
|
|
- fixed="right"
|
|
|
- width="100px"
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ <div v-else-if="item.scope === 'inputs'">
|
|
|
+ <el-input-number
|
|
|
+ style="width: 50px"
|
|
|
+ size="small"
|
|
|
+ :controls="false"
|
|
|
+ v-model="scope.row[item.prop]"
|
|
|
+ controls-position="right"
|
|
|
+ :min="0"
|
|
|
+ ></el-input-number>
|
|
|
+ </div>
|
|
|
+ <span v-else>{{ scope.row[item.prop] }}</span></template
|
|
|
>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" @click="delList(scope.row)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button @click="backPage">取消</el-button>
|
|
|
- <el-button
|
|
|
- :loading="disabledBtn"
|
|
|
- type="primary"
|
|
|
- @click="submit('listData')"
|
|
|
- :disabled="!noStudent"
|
|
|
- >确定</el-button
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ fixed="right"
|
|
|
+ width="180px"
|
|
|
>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </div>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="jumpChapter(scope.row)"
|
|
|
+ >章节内容</el-button
|
|
|
+ >
|
|
|
+ <el-button type="text" @click="delList(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="backPage">取消</el-button>
|
|
|
+ <el-button
|
|
|
+ :loading="disabledBtn"
|
|
|
+ type="primary"
|
|
|
+ @click="submit('listData')"
|
|
|
+ :disabled="!noStudent"
|
|
|
+ >确定</el-button
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
<el-dialog
|
|
|
+ @closed="closedFunc"
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="800px"
|
|
|
:show-close="false"
|
|
@@ -361,15 +366,17 @@
|
|
|
>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <addChapter ref="addChapter" @backData="backData" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import searchBoxNew from "@/components/searchBoxNew";
|
|
|
import pagination from "@/components/pagination";
|
|
|
+import addChapter from "../addChapter.vue";
|
|
|
export default {
|
|
|
name: "ModuleManagementEdit",
|
|
|
- components: { searchBoxNew, pagination },
|
|
|
+ components: { searchBoxNew, pagination, addChapter },
|
|
|
data() {
|
|
|
return {
|
|
|
disabledBtn: false,
|
|
@@ -416,11 +423,12 @@ export default {
|
|
|
{ label: "排序", prop: "sort", scope: "inputs", width: "100" },
|
|
|
{ label: "章编码", prop: "code", width: "120" },
|
|
|
{ label: "标题前缀", prop: "prefixName", width: "180" },
|
|
|
- { label: "章标题", prop: "name", width: "310" },
|
|
|
+ { label: "章标题", prop: "name" },
|
|
|
{
|
|
|
label: "发布状态",
|
|
|
prop: "publishStatus",
|
|
|
scope: "Status",
|
|
|
+ width: "120",
|
|
|
},
|
|
|
],
|
|
|
tableData: [],
|
|
@@ -474,6 +482,7 @@ export default {
|
|
|
disCheckList: [], //已选转禁用复选列表
|
|
|
activeLists: [],
|
|
|
noStudent: true,
|
|
|
+ pageId:this.$route.query.id
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -487,7 +496,7 @@ export default {
|
|
|
async mounted() {
|
|
|
this.$modal.loading("正在导入数据,请稍后...");
|
|
|
this.$api
|
|
|
- .gradecheckGoodsChange({ moduleId: this.$route.query.id })
|
|
|
+ .gradecheckGoodsChange({ moduleId: this.pageId })
|
|
|
.then((res) => {
|
|
|
if (res.data > 0) {
|
|
|
this.noStudent = false;
|
|
@@ -496,7 +505,72 @@ export default {
|
|
|
await this.getDict();
|
|
|
this.search();
|
|
|
},
|
|
|
+ activated() {
|
|
|
+ if (this.$store.getters.modulePage) {
|
|
|
+ this.$api
|
|
|
+ .obtainCoursechapter(this.$store.getters.modulePage.id)
|
|
|
+ .then((res) => {
|
|
|
+ const FIND = this.tableData.findIndex((item) => {
|
|
|
+ return item.chapterId == this.$store.getters.modulePage.id;
|
|
|
+ });
|
|
|
+ if (FIND !== -1) {
|
|
|
+ res.data.sort = this.tableData[FIND].sort;
|
|
|
+ this.tableData.splice(FIND, 1, res.data);
|
|
|
+ }
|
|
|
+ this.$store.dispatch("changemodulePage", null);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ jumpChapter(v) {
|
|
|
+ const jump = () => {
|
|
|
+ this.$store.dispatch("changemodulePage", {
|
|
|
+ name: "moduleManagementEdit",
|
|
|
+ id: v.chapterId,
|
|
|
+ });
|
|
|
+ this.$router.push({
|
|
|
+ path: "chapterEdit",
|
|
|
+ query: {
|
|
|
+ id: v.chapterId,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const statusPage = this.$store.state.tagsView.visitedViews.some(
|
|
|
+ (item) => {
|
|
|
+ return item.name == "ChapterEdit";
|
|
|
+ }
|
|
|
+ );
|
|
|
+ if (statusPage) {
|
|
|
+ this.$store
|
|
|
+ .dispatch("tagsView/delCachedView", {
|
|
|
+ name: "ChapterEdit",
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ jump();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ jump();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 打开添加章组件
|
|
|
+ */
|
|
|
+ addChapter() {
|
|
|
+ if (!this.newSujectApis.length) {
|
|
|
+ this.$message.warning("请选择科目");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$refs.addChapter.openBoxs(this.newSujectApis);
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 添加章-返回数据
|
|
|
+ */
|
|
|
+ backData(v) {
|
|
|
+ this.$api.inquireCourseListchapter({ chapterIds: v }).then((res) => {
|
|
|
+ this.activeLists = res.rows;
|
|
|
+ this.submitForm();
|
|
|
+ });
|
|
|
+ },
|
|
|
handleCheckedCitiesChange() {
|
|
|
let nid = this.newSujectOption.map((item) => {
|
|
|
return item.newId;
|
|
@@ -566,7 +640,7 @@ export default {
|
|
|
},
|
|
|
getInfosList() {
|
|
|
this.$api
|
|
|
- .inquireCourseListmodulechapter(this.$route.query.id)
|
|
|
+ .inquireCourseListmodulechapter(this.pageId)
|
|
|
.then((result) => {
|
|
|
// this.numberAll = result.total;
|
|
|
// this.minTimeAll = result.timeTotal;
|
|
@@ -595,12 +669,12 @@ export default {
|
|
|
},
|
|
|
search() {
|
|
|
this.$api
|
|
|
- .obtainCoursemodule(this.$route.query.id)
|
|
|
+ .obtainCoursemodule(this.pageId)
|
|
|
.then((res) => {
|
|
|
this.bfImg = res.data.coverUrl;
|
|
|
this.listData = res.data;
|
|
|
this.$api
|
|
|
- .inquireCourseListmodulebusiness(this.$route.query.id)
|
|
|
+ .inquireCourseListmodulebusiness(this.pageId)
|
|
|
.then((result) => {
|
|
|
var arrays = [];
|
|
|
result.data.map((item) => {
|
|
@@ -743,8 +817,8 @@ export default {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (!this.newSujectApis.length) {
|
|
|
- this.$message.error("请选择适用业务层级")
|
|
|
- return
|
|
|
+ this.$message.error("请选择适用业务层级");
|
|
|
+ return;
|
|
|
}
|
|
|
// if (
|
|
|
// this.listData.coverUrl === "" ||
|
|
@@ -784,7 +858,7 @@ export default {
|
|
|
});
|
|
|
var dataInfos = {
|
|
|
status: 1,
|
|
|
- moduleId: this.$route.query.id,
|
|
|
+ moduleId: this.pageId,
|
|
|
businessList: this.newSujectApis,
|
|
|
chapterIdList: chapterIdList,
|
|
|
coverUrl: this.listData.coverUrl,
|
|
@@ -895,7 +969,6 @@ export default {
|
|
|
this.tableData = this.tableData.concat(this.activeLists);
|
|
|
this.dialogVisible = false;
|
|
|
this.$message.success("添加成功");
|
|
|
- this.activeLists = [];
|
|
|
},
|
|
|
delList(item) {
|
|
|
this.tableData.map((items, indexs) => {
|
|
@@ -905,6 +978,9 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ closedFunc(){
|
|
|
+ this.activeLists = [];
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|