|
@@ -3,10 +3,10 @@
|
|
|
<el-dialog
|
|
|
:visible.sync="dialogVisible"
|
|
|
width="60%"
|
|
|
- @open="openExpand"
|
|
|
:show-close="false"
|
|
|
:close-on-click-modal="false"
|
|
|
destroy-on-close
|
|
|
+ @closed="showPop = false"
|
|
|
>
|
|
|
<div slot="title" class="hearders">
|
|
|
<div class="leftTitle">试听设置</div>
|
|
@@ -21,39 +21,39 @@
|
|
|
<div style="text-align: end">
|
|
|
<el-button type="text" @click="inits">重置</el-button>
|
|
|
</div>
|
|
|
- <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>
|
|
|
+ <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>
|
|
|
- </el-tree>
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="submitTable">确 定</el-button>
|
|
@@ -64,9 +64,10 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- props: ["tableData", "auditionList"],
|
|
|
data() {
|
|
|
return {
|
|
|
+ tableData: [],
|
|
|
+ auditionitem: [],
|
|
|
copyData: [],
|
|
|
showPop: false,
|
|
|
datas: [],
|
|
@@ -170,11 +171,14 @@ export default {
|
|
|
/**
|
|
|
* 弹窗打开触发
|
|
|
*/
|
|
|
- openExpand() {
|
|
|
- this.showPop = true;
|
|
|
- if (this.auditionList) {
|
|
|
- this.auditionListCope = JSON.parse(JSON.stringify(this.auditionList));
|
|
|
+ openExpand(item, auditionitem) {
|
|
|
+ this.auditionitem = JSON.parse(JSON.stringify(auditionitem));
|
|
|
+ this.tableData = JSON.parse(JSON.stringify(item));
|
|
|
+ if (auditionitem) {
|
|
|
+ this.auditionListCope = JSON.parse(JSON.stringify(auditionitem));
|
|
|
}
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.showPop = true;
|
|
|
},
|
|
|
/**
|
|
|
* @param {Objact,Bool} 当前点击数据 当前是否勾选
|
|
@@ -240,23 +244,26 @@ export default {
|
|
|
this.$message.warning("请勾选至少一节的试听时间");
|
|
|
return;
|
|
|
}
|
|
|
- this.auditionListCope.forEach((item) => {
|
|
|
- if (!item.auditionMinute || item.auditionMinute === "00:00:00") {
|
|
|
+ for (let i = 0; i < this.auditionListCope.length; i++) {
|
|
|
+ if (
|
|
|
+ !this.auditionListCope[i].auditionMinute ||
|
|
|
+ this.auditionListCope[i].auditionMinute === "00:00:00"
|
|
|
+ ) {
|
|
|
this.$message.warning("不允许填写时长为0的节,请重新输入");
|
|
|
return;
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
this.$emit("uploadArrays", this.auditionListCope);
|
|
|
this.dialogVisible = false;
|
|
|
},
|
|
|
loadNode(node, resolve) {
|
|
|
var self = this;
|
|
|
if (node.level === 0) {
|
|
|
+ console.log(11)
|
|
|
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}`;
|
|
@@ -264,7 +271,7 @@ export default {
|
|
|
self.getAllSeNum.push(item.onlyId);
|
|
|
}
|
|
|
if (self.auditionListCope) {
|
|
|
- self.auditionListCope.map((items) => {
|
|
|
+ self.auditionListCope.forEach((items) => {
|
|
|
if (items.TypeId === item.TypeId) {
|
|
|
if (self.audition.indexOf(item.onlyId) === -1) {
|
|
|
self.audition.push(item.onlyId);
|