@@ -153,6 +153,24 @@ export default {
// if(this.manualJson.filter(i=>i.type==6).length>=1){
// return this.$message.error("一个表单只能添加一个课程组件");
// }
+ function checkType(obj){
+ if(obj.filter(i=>i.array).length>0){
+ let bol = false;
+ obj.forEach(i=>{
+ console.log(i.array)
+ if(bol)return;
+ bol = checkType(i.array);
+ })
+ return bol;
+ }else if(obj.filter(i=>i.type==6).length>=1){
+ return true;
+ }else{
+ return false;
+ }
+ if(topicType == 6 && checkType(this.manualJson)){
+ return this.$message.error("一个表单只能添加一个课程组件");
if (this.manualJson.length > 0) {
for (var i = 0; i < this.manualJson.length; i++) {
if (this.manualJson[i].ttype == 2) {
@@ -139,6 +139,24 @@ export default {
// if(this.checkJson.filter(i=>i.type==6).length>=1){
+ if(this.topicType == 6 && checkType(this.checkJson)){
if (this.checkJson.length > 0) {
for (var i = 0; i < this.checkJson.length; i++) {
if (this.checkJson[i].ttype == 2) {
@@ -618,7 +618,8 @@ export default {
topic.courseArray = [];
topic.array.forEach(async i => {
let data = await this.getCourse(i)
- data.update_at = new Date(data.update_at).toLocaleString().replace('/', '-')
+ console.log(data.update_at)
+ data.update_at = new Date(data.update_at).toLocaleString('zh-CN', {year: 'numeric',month: '2-digit',day: '2-digit',hour: '2-digit',minute: '2-digit',second: '2-digit',hour12: false}).replace(/\//g,'-')
topic.courseArray.push(data)
})
} else if (topic.type == 7) {