|
@@ -1,4 +1,4 @@
|
|
|
-
|
|
|
+<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<title>私塾家</title>
|
|
@@ -98,11 +98,11 @@
|
|
|
<el-table-column type="expand">
|
|
|
<template slot-scope="props">
|
|
|
<el-form label-position="left" inline class="demo-table-expand unit_item">
|
|
|
- <div v-for="(item,index) in props.row.unitList">
|
|
|
+ <div v-for="(item,index) in props.row.unitList" :key="index">
|
|
|
<el-form-item label="单元名称">
|
|
|
<span :title="item.unitName">{{ item.unitName}}</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="item.videoList&&(item.videoList[0].videoLink!=''||item.videoList[0].videoName!='')">
|
|
|
+ <el-form-item v-if="item.videoList.length>0&&(item.videoList[0].videoLink!=''||item.videoList[0].videoName!='')">
|
|
|
<div class="link link2"><i class="el-icon-link"></i> <a target="_blank" :href="item.videoList[0].videoLink"><span :title="item.videoList[0].videoName">{{item.videoList[0].videoName}}</span></a></div>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float:right">
|
|
@@ -136,7 +136,7 @@
|
|
|
label="链接"
|
|
|
align="center" width="130">
|
|
|
<template slot-scope="scope">
|
|
|
- <div class="link"><i class="el-icon-link"></i> <a target="_blank" :href="scope.row.materialLink">教材链接</a></div>
|
|
|
+ <div class="link" v-if='scope.row.materialLink'><i class="el-icon-link"></i> <a target="_blank" :href="scope.row.materialLink">教材链接</a></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -163,7 +163,6 @@
|
|
|
>
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- </template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="复习" name="second">
|
|
@@ -209,7 +208,6 @@
|
|
|
>
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
- </template>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
@@ -378,9 +376,9 @@
|
|
|
volume: [
|
|
|
{ required: true, message: '请选择上下册', trigger: 'change' },
|
|
|
],
|
|
|
- link: [
|
|
|
- { required: true, message: '请输入链接', trigger: 'blur' },
|
|
|
- ],
|
|
|
+ // link: [
|
|
|
+ // { required: true, message: '请输入链接', trigger: 'blur' },
|
|
|
+ // ],
|
|
|
},
|
|
|
activeName:'first',
|
|
|
tabPosition:'语文',
|
|
@@ -432,66 +430,6 @@
|
|
|
}
|
|
|
],
|
|
|
expands:[],
|
|
|
- tableData: [{
|
|
|
- "id": "xxx",
|
|
|
- "subject": "科目",
|
|
|
- "versionType": "版本数字描述",
|
|
|
- "versionName": "版本文字描述",
|
|
|
- "grade":"年级",
|
|
|
- "semester":1,
|
|
|
- "materialLink":"http://baidu.com",
|
|
|
- "unitList":[
|
|
|
- {"id": "xxx",
|
|
|
- "unitId":"单元Id",
|
|
|
- "versionType": "版本数字描述",
|
|
|
- "versionName": "版本文字描述",
|
|
|
- "grade":"年级",
|
|
|
- "unitName":"单元",
|
|
|
- "videoList":[
|
|
|
- {'videoLink':"",
|
|
|
- 'videoName':""}
|
|
|
- ]
|
|
|
- },
|
|
|
- {"id": "xxx",
|
|
|
- "unitId":"单元Id",
|
|
|
- "versionType": "版本数字描述",
|
|
|
- "versionName": "版本文字描述",
|
|
|
- "grade":"年级",
|
|
|
- "unitName":"单元",
|
|
|
- "videoList":[
|
|
|
- {'videoLink':"21312",
|
|
|
- 'videoName':""}
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
- //"subject": "科目",
|
|
|
- //"versionType": "版本数字描述",
|
|
|
- //"versionName": "版本文字描述"
|
|
|
- },{
|
|
|
- "id": "xxx",
|
|
|
- "subject": "科目",
|
|
|
- "versionType": "版本数字描述",
|
|
|
- "versionName": "版本文字描述",
|
|
|
- "grade":"年级",
|
|
|
- "semester":1,
|
|
|
- "materialLink":"http://baidu.com",
|
|
|
- "unitList":[
|
|
|
- {"id": "xxx",
|
|
|
- "unitId":"单元Id",
|
|
|
- "versionType": "版本数字描述",
|
|
|
- "versionName": "版本文字描述",
|
|
|
- "grade":"年级",
|
|
|
- "unitName":"单元",
|
|
|
- "videoList":[
|
|
|
- {'videoLink':"21312",
|
|
|
- 'videoName':""}
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
- //"subject": "科目",
|
|
|
- //"versionType": "版本数字描述",
|
|
|
- //"versionName": "版本文字描述"
|
|
|
- }],
|
|
|
tableData_p:[],
|
|
|
tableData_r:[],
|
|
|
material_title:'添加教材',
|
|
@@ -578,7 +516,8 @@
|
|
|
});
|
|
|
|
|
|
var data={params:param};
|
|
|
- var Host='[[${sysUrl}]]'
|
|
|
+ var Host='[[${sysUrl}]]/sys';
|
|
|
+ axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|
|
axios.get(Host+url,data,successFunction)
|
|
|
.then((response)=> {
|
|
|
loading.close();
|
|
@@ -619,12 +558,14 @@
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(0, 0, 0, 0)'
|
|
|
});
|
|
|
- var Host='[[${sysUrl}]]'
|
|
|
+ var Host='[[${sysUrl}]]/sys';
|
|
|
+ axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|
|
axios.post(Host+url,param,config)
|
|
|
.then((response)=> {
|
|
|
successFunction(response.data);
|
|
|
loading.close();
|
|
|
}).catch((res)=>{
|
|
|
+
|
|
|
loading.close();
|
|
|
if(typeof(errorFunction) == 'function'){
|
|
|
errorFunction(res);
|
|
@@ -716,7 +657,6 @@
|
|
|
this.page_p.total = data.total;
|
|
|
if(expand){
|
|
|
this.expands=[expand];
|
|
|
- console.log(this.expands)
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -850,6 +790,32 @@
|
|
|
submit_addUnit(formName){
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ var flag='1';
|
|
|
+ this.videoList.forEach(element => {
|
|
|
+ if(element.videoLink==''&&element.videoName!=''){
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: `请输入视频${element.videoName}的视频链接`
|
|
|
+ });
|
|
|
+ flag='2';
|
|
|
+ }
|
|
|
+ if(element.videoLink!=''&&element.videoName==''){
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: `请输入视频链接为${element.videoLink}的视频名称`
|
|
|
+ });
|
|
|
+ flag=2;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(flag==2){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var unitList=[];
|
|
|
+ this.videoList.forEach(element => {
|
|
|
+ if(element.videoLink!=''||element.videoName!=''){
|
|
|
+ unitList.push(element);
|
|
|
+ }
|
|
|
+ });
|
|
|
this.post(
|
|
|
"/summerVacation/edit/preUnitVersion",
|
|
|
{
|
|
@@ -857,7 +823,7 @@
|
|
|
unitName:this.unit_form.unitName,
|
|
|
unitId:this.unit_form.unitId,
|
|
|
parentId:this.unit_form.parentId,
|
|
|
- unitList:this.videoList,
|
|
|
+ unitList:unitList,
|
|
|
},
|
|
|
(data) => {
|
|
|
if (data.code == 200) {
|