|
@@ -6,6 +6,7 @@
|
|
|
@open="openExpand"
|
|
@open="openExpand"
|
|
|
:show-close="false"
|
|
:show-close="false"
|
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
|
|
|
+ destroy-on-close
|
|
|
>
|
|
>
|
|
|
<div slot="title" class="hearders">
|
|
<div slot="title" class="hearders">
|
|
|
<div class="leftTitle">试听设置</div>
|
|
<div class="leftTitle">试听设置</div>
|
|
@@ -20,38 +21,39 @@
|
|
|
<div style="text-align: end">
|
|
<div style="text-align: end">
|
|
|
<el-button type="text" @click="inits">重置</el-button>
|
|
<el-button type="text" @click="inits">重置</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-tree
|
|
|
|
|
- ref="trees"
|
|
|
|
|
- :data="datas"
|
|
|
|
|
- :props="layoutTreeProps"
|
|
|
|
|
- :load="loadNode"
|
|
|
|
|
- lazy
|
|
|
|
|
- :default-checked-keys="audition"
|
|
|
|
|
- :show-checkbox="true"
|
|
|
|
|
- :check-strictly="true"
|
|
|
|
|
- @check-change="getCheckedKeys"
|
|
|
|
|
- node-key="onlyId"
|
|
|
|
|
- >
|
|
|
|
|
- <span class="custom-tree-node" slot-scope="{ node }">
|
|
|
|
|
- <span>{{ node.label }}</span>
|
|
|
|
|
- <span v-if="node.checked && node.data.sectionType !== 2"
|
|
|
|
|
- >试听前
|
|
|
|
|
- <el-time-picker
|
|
|
|
|
- style="width: 140px"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- value-format="HH:mm:ss"
|
|
|
|
|
- range-separator="-"
|
|
|
|
|
- v-model="node.data.auditionMinute"
|
|
|
|
|
- :picker-options="{
|
|
|
|
|
- selectableRange: compTimes(node.data.durationTime),
|
|
|
|
|
- }"
|
|
|
|
|
- placeholder="请选择试听时长"
|
|
|
|
|
- @blur="changeNum(node)"
|
|
|
|
|
- >
|
|
|
|
|
- </el-time-picker>
|
|
|
|
|
|
|
+ <el-tree
|
|
|
|
|
+ v-if="showPop"
|
|
|
|
|
+ ref="trees"
|
|
|
|
|
+ :data="datas"
|
|
|
|
|
+ :props="layoutTreeProps"
|
|
|
|
|
+ :load="loadNode"
|
|
|
|
|
+ lazy
|
|
|
|
|
+ :default-checked-keys="audition"
|
|
|
|
|
+ :show-checkbox="true"
|
|
|
|
|
+ :check-strictly="true"
|
|
|
|
|
+ @check-change="getCheckedKeys"
|
|
|
|
|
+ node-key="onlyId"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node }">
|
|
|
|
|
+ <span>{{ node.label }}</span>
|
|
|
|
|
+ <span v-if="node.checked && node.data.sectionType !== 2"
|
|
|
|
|
+ >试听前
|
|
|
|
|
+ <el-time-picker
|
|
|
|
|
+ style="width: 140px"
|
|
|
|
|
+ size="mini"
|
|
|
|
|
+ value-format="HH:mm:ss"
|
|
|
|
|
+ range-separator="-"
|
|
|
|
|
+ v-model="node.data.auditionMinute"
|
|
|
|
|
+ :picker-options="{
|
|
|
|
|
+ selectableRange: compTimes(node.data.durationTime),
|
|
|
|
|
+ }"
|
|
|
|
|
+ placeholder="请选择试听时长"
|
|
|
|
|
+ @blur="changeNum(node)"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-time-picker>
|
|
|
|
|
+ </span>
|
|
|
</span>
|
|
</span>
|
|
|
- </span>
|
|
|
|
|
- </el-tree>
|
|
|
|
|
|
|
+ </el-tree>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitTable">确 定</el-button>
|
|
<el-button type="primary" @click="submitTable">确 定</el-button>
|
|
@@ -66,6 +68,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
copyData: [],
|
|
copyData: [],
|
|
|
|
|
+ showPop: false,
|
|
|
datas: [],
|
|
datas: [],
|
|
|
audition: [],
|
|
audition: [],
|
|
|
auditionListCope: [],
|
|
auditionListCope: [],
|
|
@@ -102,34 +105,43 @@ export default {
|
|
|
var arrays = this.$refs.trees;
|
|
var arrays = this.$refs.trees;
|
|
|
//修改指定项的 auditionMinute
|
|
//修改指定项的 auditionMinute
|
|
|
arrays.root.childNodes.forEach((item, index) => {
|
|
arrays.root.childNodes.forEach((item, index) => {
|
|
|
- item.childNodes.forEach((items, indexs) => {
|
|
|
|
|
|
|
+ if (item.data.type && item.data.type === 3) {
|
|
|
if (
|
|
if (
|
|
|
- items.data.TypeId === v.data.TypeId &&
|
|
|
|
|
- items.data.courseId === v.data.courseId
|
|
|
|
|
|
|
+ item.data.TypeId === v.data.TypeId &&
|
|
|
|
|
+ item.data.courseId === v.data.courseId
|
|
|
) {
|
|
) {
|
|
|
- items.data.auditionMinute = v.data.auditionMinute;
|
|
|
|
|
|
|
+ item.data.auditionMinute = v.data.auditionMinute;
|
|
|
}
|
|
}
|
|
|
- if (items.childNodes.length) {
|
|
|
|
|
- items.childNodes.forEach((ik) => {
|
|
|
|
|
- if (
|
|
|
|
|
- ik.data.TypeId === v.data.TypeId &&
|
|
|
|
|
- ik.data.courseId === v.data.courseId
|
|
|
|
|
- ) {
|
|
|
|
|
- ik.data.auditionMinute = v.data.auditionMinute;
|
|
|
|
|
- }
|
|
|
|
|
- if (ik.childNodes.length) {
|
|
|
|
|
- ik.childNodes.forEach((iks) => {
|
|
|
|
|
- if (
|
|
|
|
|
- iks.data.TypeId === v.data.TypeId &&
|
|
|
|
|
- iks.data.courseId === v.data.courseId
|
|
|
|
|
- ) {
|
|
|
|
|
- iks.data.auditionMinute = v.data.auditionMinute;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.childNodes.forEach((items, indexs) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ items.data.TypeId === v.data.TypeId &&
|
|
|
|
|
+ items.data.courseId === v.data.courseId
|
|
|
|
|
+ ) {
|
|
|
|
|
+ items.data.auditionMinute = v.data.auditionMinute;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (items.childNodes.length) {
|
|
|
|
|
+ items.childNodes.forEach((ik) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ ik.data.TypeId === v.data.TypeId &&
|
|
|
|
|
+ ik.data.courseId === v.data.courseId
|
|
|
|
|
+ ) {
|
|
|
|
|
+ ik.data.auditionMinute = v.data.auditionMinute;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ik.childNodes.length) {
|
|
|
|
|
+ ik.childNodes.forEach((iks) => {
|
|
|
|
|
+ if (
|
|
|
|
|
+ iks.data.TypeId === v.data.TypeId &&
|
|
|
|
|
+ iks.data.courseId === v.data.courseId
|
|
|
|
|
+ ) {
|
|
|
|
|
+ iks.data.auditionMinute = v.data.auditionMinute;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
this.auditionListCope.forEach((items) => {
|
|
this.auditionListCope.forEach((items) => {
|
|
@@ -146,27 +158,23 @@ export default {
|
|
|
* 重置按钮
|
|
* 重置按钮
|
|
|
*/
|
|
*/
|
|
|
inits() {
|
|
inits() {
|
|
|
|
|
+ this.showPop = false;
|
|
|
if (this.auditionList) {
|
|
if (this.auditionList) {
|
|
|
this.auditionListCope = JSON.parse(JSON.stringify(this.auditionList));
|
|
this.auditionListCope = JSON.parse(JSON.stringify(this.auditionList));
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.audition = [];
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
this.datas = JSON.parse(JSON.stringify(this.copyData));
|
|
this.datas = JSON.parse(JSON.stringify(this.copyData));
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.showPop = true;
|
|
|
|
|
+ }, 50);
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 弹窗打开触发
|
|
* 弹窗打开触发
|
|
|
*/
|
|
*/
|
|
|
openExpand() {
|
|
openExpand() {
|
|
|
|
|
+ this.showPop = true;
|
|
|
if (this.auditionList) {
|
|
if (this.auditionList) {
|
|
|
this.auditionListCope = JSON.parse(JSON.stringify(this.auditionList));
|
|
this.auditionListCope = JSON.parse(JSON.stringify(this.auditionList));
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.audition = [];
|
|
|
|
|
- });
|
|
|
|
|
}
|
|
}
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.inits();
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* @param {Objact,Bool} 当前点击数据 当前是否勾选
|
|
* @param {Objact,Bool} 当前点击数据 当前是否勾选
|
|
@@ -215,7 +223,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
var pdst = self.auditionListCope.filter((itx, indx) => {
|
|
var pdst = self.auditionListCope.filter((itx, indx) => {
|
|
|
if (itx.courseId != item.courseId) {
|
|
if (itx.courseId != item.courseId) {
|
|
|
return itx;
|
|
return itx;
|
|
@@ -245,21 +252,53 @@ export default {
|
|
|
loadNode(node, resolve) {
|
|
loadNode(node, resolve) {
|
|
|
var self = this;
|
|
var self = this;
|
|
|
if (node.level === 0) {
|
|
if (node.level === 0) {
|
|
|
- this.tableData.map((item) => {
|
|
|
|
|
- item.TypeId = "0-" + item.courseId;
|
|
|
|
|
- item.disabled = true;
|
|
|
|
|
- item.hasChildren = true;
|
|
|
|
|
- });
|
|
|
|
|
- this.copyData = JSON.parse(JSON.stringify(this.tableData));
|
|
|
|
|
- return resolve(this.tableData);
|
|
|
|
|
|
|
+ if (this.tableData[0].type > 0) {
|
|
|
|
|
+ this.tableData.forEach((item) => {
|
|
|
|
|
+ item.TypeId = `${item.type}-${item.menuId}`;
|
|
|
|
|
+ if (item.type === 3) {
|
|
|
|
|
+ console.log(item,'item')
|
|
|
|
|
+ item.hasChildren = false;
|
|
|
|
|
+ item.disabled = false;
|
|
|
|
|
+ item.onlyId = `${item.courseId || 0}-0-0-${item.menuId}`;
|
|
|
|
|
+ if (self.getAllSeNum.indexOf(item.onlyId) === -1) {
|
|
|
|
|
+ self.getAllSeNum.push(item.onlyId);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (self.auditionListCope) {
|
|
|
|
|
+ self.auditionListCope.map((items) => {
|
|
|
|
|
+ if (items.TypeId === item.TypeId) {
|
|
|
|
|
+ if (self.audition.indexOf(item.onlyId) === -1) {
|
|
|
|
|
+ self.audition.push(item.onlyId);
|
|
|
|
|
+ }
|
|
|
|
|
+ item.auditionMinute = items.auditionMinute;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ item.hasChildren = true;
|
|
|
|
|
+ item.disabled = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ this.copyData = JSON.parse(JSON.stringify(this.tableData));
|
|
|
|
|
+ return resolve(this.tableData);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.tableData.forEach((item) => {
|
|
|
|
|
+ item.TypeId = "0-" + item.courseId;
|
|
|
|
|
+ item.disabled = true;
|
|
|
|
|
+ item.hasChildren = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ this.copyData = JSON.parse(JSON.stringify(this.tableData));
|
|
|
|
|
+ return resolve(this.tableData);
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
if (node.data.type === 1) {
|
|
if (node.data.type === 1) {
|
|
|
this.$api
|
|
this.$api
|
|
|
.inquireCourseListmodulechapter(node.data.menuId)
|
|
.inquireCourseListmodulechapter(node.data.menuId)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
res.data.map((item) => {
|
|
res.data.map((item) => {
|
|
|
- item.onlyId = `${node.data.courseId}-${node.data.menuId}-${item.chapterId}-0`;
|
|
|
|
|
- item.courseId = node.data.courseId;
|
|
|
|
|
|
|
+ item.onlyId = `${node.data.courseId || 0}-${node.data.menuId}-${
|
|
|
|
|
+ item.chapterId
|
|
|
|
|
+ }-0`;
|
|
|
|
|
+ item.courseId = node.data.courseId || 0;
|
|
|
item.TypeId = "2" + "-" + item.chapterId;
|
|
item.TypeId = "2" + "-" + item.chapterId;
|
|
|
item.hasChildren = true;
|
|
item.hasChildren = true;
|
|
|
item.disabled = true;
|
|
item.disabled = true;
|
|
@@ -273,7 +312,7 @@ export default {
|
|
|
.inquireCoursechaptersectionlist(node.data.menuId)
|
|
.inquireCoursechaptersectionlist(node.data.menuId)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
res.data.map((item) => {
|
|
res.data.map((item) => {
|
|
|
- item.onlyId = `${node.data.courseId}-${
|
|
|
|
|
|
|
+ item.onlyId = `${node.data.courseId || 0}-${
|
|
|
node.data.moduleId ? node.data.moduleId : 0
|
|
node.data.moduleId ? node.data.moduleId : 0
|
|
|
}-${item.chapterId}-${item.sectionId}`;
|
|
}-${item.chapterId}-${item.sectionId}`;
|
|
|
if (this.getAllSeNum.indexOf(item.onlyId) === -1) {
|
|
if (this.getAllSeNum.indexOf(item.onlyId) === -1) {
|
|
@@ -286,7 +325,7 @@ export default {
|
|
|
item.durationTime,
|
|
item.durationTime,
|
|
|
false
|
|
false
|
|
|
);
|
|
);
|
|
|
- item.courseId = node.data.courseId;
|
|
|
|
|
|
|
+ item.courseId = node.data.courseId || 0;
|
|
|
if (self.auditionListCope) {
|
|
if (self.auditionListCope) {
|
|
|
self.auditionListCope.map((items) => {
|
|
self.auditionListCope.map((items) => {
|
|
|
if (
|
|
if (
|