|
@@ -10,19 +10,25 @@
|
|
:tid="tid"
|
|
:tid="tid"
|
|
:bmData="bmData"
|
|
:bmData="bmData"
|
|
></homePage>
|
|
></homePage>
|
|
- <bindFrom ref="bindFromRef" @cutPage="cutPage" :page="page" v-if="page == 2" :testData="bmData.jsonData.testData?bmData.jsonData.testData:{}"></bindFrom>
|
|
|
|
|
|
+ <bindFrom
|
|
|
|
+ ref="bindFromRef"
|
|
|
|
+ @cutPage="cutPage"
|
|
|
|
+ :page="page"
|
|
|
|
+ v-if="page == 2"
|
|
|
|
+ :testData="bmData.jsonData.testData ? bmData.jsonData.testData : {}"
|
|
|
|
+ ></bindFrom>
|
|
<classInfo
|
|
<classInfo
|
|
ref="classInfoRef"
|
|
ref="classInfoRef"
|
|
@cutPage="cutPage"
|
|
@cutPage="cutPage"
|
|
:page="page"
|
|
:page="page"
|
|
- :tid="tid"
|
|
|
|
|
|
+ :tid="tid"
|
|
v-if="page == 3"
|
|
v-if="page == 3"
|
|
v-loading="baseMessageLoading"
|
|
v-loading="baseMessageLoading"
|
|
:bmData="bmData"
|
|
:bmData="bmData"
|
|
:imageList="imageList"
|
|
:imageList="imageList"
|
|
></classInfo>
|
|
></classInfo>
|
|
- <stencilled ref="stencilledRef" @cutPage="cutPage" :page="page" v-if="page == 5 && userId" ></stencilled>
|
|
|
|
- <editTel ref="editTelRef" @cutPage="cutPage" :page="page" v-if="page == 6" ></editTel>
|
|
|
|
|
|
+ <stencilled ref="stencilledRef" @cutPage="cutPage" :page="page" v-if="page == 5 && userId"></stencilled>
|
|
|
|
+ <editTel ref="editTelRef" @cutPage="cutPage" :page="page" v-if="page == 6"></editTel>
|
|
<addTel ref="addTelRef" @cutPage="cutPage" :page="page" v-if="page == 7"></addTel>
|
|
<addTel ref="addTelRef" @cutPage="cutPage" :page="page" v-if="page == 7"></addTel>
|
|
<outcome
|
|
<outcome
|
|
ref="outcomeRef"
|
|
ref="outcomeRef"
|
|
@@ -43,8 +49,17 @@ import stencilled from './stencilled'
|
|
import editTel from './editTel'
|
|
import editTel from './editTel'
|
|
import addTel from './addTel'
|
|
import addTel from './addTel'
|
|
import outcome from './outcome.vue'
|
|
import outcome from './outcome.vue'
|
|
-import { v4 as uuidv4 } from "uuid";
|
|
|
|
-import { updateObsRequest, getCourseListRequest, getObsRequest, delClassRequest,delObsRequest,getClassroomDefaultRequest,insertNewClassRoomRequest,insertNewObsRequest } from '@/api/classObserve'
|
|
|
|
|
|
+import { v4 as uuidv4 } from 'uuid'
|
|
|
|
+import {
|
|
|
|
+ updateObsRequest,
|
|
|
|
+ getCourseListRequest,
|
|
|
|
+ getObsRequest,
|
|
|
|
+ delClassRequest,
|
|
|
|
+ delObsRequest,
|
|
|
|
+ getClassroomDefaultRequest,
|
|
|
|
+ insertNewClassRoomRequest,
|
|
|
|
+ insertNewObsRequest
|
|
|
|
+} from '@/api/classObserve'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: { homePage, bindFrom, classInfo, stencilled, editTel, addTel, outcome },
|
|
components: { homePage, bindFrom, classInfo, stencilled, editTel, addTel, outcome },
|
|
@@ -117,9 +132,9 @@ export default {
|
|
_optionData = _optionData.filter(i => i.label != '' && i.tId != '')
|
|
_optionData = _optionData.filter(i => i.label != '' && i.tId != '')
|
|
this.classList = _optionData
|
|
this.classList = _optionData
|
|
this.loading = false
|
|
this.loading = false
|
|
- if (this.classList.length > 0 && !this.tid) {
|
|
|
|
- this.changeTid(this.classList[0].value)
|
|
|
|
- }
|
|
|
|
|
|
+ // if (this.classList.length > 0 && !this.tid) {
|
|
|
|
+ // this.changeTid(this.classList[0].value)
|
|
|
|
+ // }
|
|
resolve()
|
|
resolve()
|
|
})
|
|
})
|
|
.catch(e => {
|
|
.catch(e => {
|
|
@@ -185,9 +200,27 @@ export default {
|
|
delClassRequest({ tid: item.id }).then(_ => {
|
|
delClassRequest({ tid: item.id }).then(_ => {
|
|
this.$toast.success('删除成功')
|
|
this.$toast.success('删除成功')
|
|
this.getCourseList().then(_ => {
|
|
this.getCourseList().then(_ => {
|
|
- if (this.tid == item.value || (this.tid == '' && this.classList.length > 0)) {
|
|
|
|
- this.changeTid(this.classList[0].value)
|
|
|
|
|
|
+ // if (this.tid == item.value || (this.tid == '' && this.classList.length > 0)) {
|
|
|
|
+ // this.changeTid(this.classList[0].value)
|
|
|
|
+ // }
|
|
|
|
+ this.tid = ''
|
|
|
|
+ this.dataList = ''
|
|
|
|
+ this.bmData = {
|
|
|
|
+ id: '',
|
|
|
|
+ tId: '',
|
|
|
|
+ tIndex: 0,
|
|
|
|
+ jsonData: {
|
|
|
|
+ activity_methods: '',
|
|
|
|
+ activity_structure: '',
|
|
|
|
+ classroom_resources: '',
|
|
|
|
+ courseName: '',
|
|
|
|
+ name: '',
|
|
|
|
+ studentNum: 0,
|
|
|
|
+ subject: '',
|
|
|
|
+ textbook: ''
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ this.imageList = {};
|
|
this.$refs.homePageRef.historyListLoading = false
|
|
this.$refs.homePageRef.historyListLoading = false
|
|
})
|
|
})
|
|
})
|
|
})
|
|
@@ -221,7 +254,7 @@ export default {
|
|
let _bmData = _data.find(i => i.tIndex == 0)
|
|
let _bmData = _data.find(i => i.tIndex == 0)
|
|
// 基础信息
|
|
// 基础信息
|
|
_bmData.jsonData = JSON.parse(_bmData.jsonData)
|
|
_bmData.jsonData = JSON.parse(_bmData.jsonData)
|
|
- _bmData.jsonData.time? "":_bmData.jsonData.time = "";
|
|
|
|
|
|
+ _bmData.jsonData.time ? '' : (_bmData.jsonData.time = '')
|
|
// 图片
|
|
// 图片
|
|
let _imageList = _data.find(i => i.tIndex == 1)
|
|
let _imageList = _data.find(i => i.tIndex == 1)
|
|
_imageList.jsonData = JSON.parse(_imageList.jsonData)
|
|
_imageList.jsonData = JSON.parse(_imageList.jsonData)
|
|
@@ -288,188 +321,183 @@ export default {
|
|
getExtendData() {
|
|
getExtendData() {
|
|
return new Promise(resolve => {
|
|
return new Promise(resolve => {
|
|
if (!this.tid) return
|
|
if (!this.tid) return
|
|
- this.extendLoading = true;
|
|
|
|
- getObsRequest({tid:this.tid,type:"2"}).then(res=>{
|
|
|
|
- let _data = res.FunctionResponse.result.length
|
|
|
|
- ? JSON.parse(res.FunctionResponse.result)
|
|
|
|
- : [];
|
|
|
|
- if (_data.length == 0) {
|
|
|
|
- return (this.extendLoading = false);
|
|
|
|
- }
|
|
|
|
- let extent = [];
|
|
|
|
- for (let i = 0; i < _data.length; i++) {
|
|
|
|
- let _extent = _data[i];
|
|
|
|
- _extent.jsonData = JSON.parse(_extent.jsonData);
|
|
|
|
- extent.push(_extent);
|
|
|
|
- }
|
|
|
|
- this.dataList.push(...extent);
|
|
|
|
- this.extendLoading = false;
|
|
|
|
- resolve();
|
|
|
|
- }).catch((e) => {
|
|
|
|
- console.log(e);
|
|
|
|
- this.$toast("获取扩展分析失败")
|
|
|
|
- resolve();
|
|
|
|
- });
|
|
|
|
|
|
+ this.extendLoading = true
|
|
|
|
+ getObsRequest({ tid: this.tid, type: '2' })
|
|
|
|
+ .then(res => {
|
|
|
|
+ let _data = res.FunctionResponse.result.length ? JSON.parse(res.FunctionResponse.result) : []
|
|
|
|
+ if (_data.length == 0) {
|
|
|
|
+ return (this.extendLoading = false)
|
|
|
|
+ }
|
|
|
|
+ let extent = []
|
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
|
+ let _extent = _data[i]
|
|
|
|
+ _extent.jsonData = JSON.parse(_extent.jsonData)
|
|
|
|
+ extent.push(_extent)
|
|
|
|
+ }
|
|
|
|
+ this.dataList.push(...extent)
|
|
|
|
+ this.extendLoading = false
|
|
|
|
+ resolve()
|
|
|
|
+ })
|
|
|
|
+ .catch(e => {
|
|
|
|
+ console.log(e)
|
|
|
|
+ this.$toast('获取扩展分析失败')
|
|
|
|
+ resolve()
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //获取全部的数据
|
|
|
|
|
|
+ //获取全部的数据
|
|
getData() {
|
|
getData() {
|
|
- this.dataList = [];
|
|
|
|
- this.imageList = {};
|
|
|
|
|
|
+ this.dataList = []
|
|
|
|
+ this.imageList = {}
|
|
return new Promise(resolve => {
|
|
return new Promise(resolve => {
|
|
- Promise.all([this.getCurrencyAndBaseMessageData(),this.getScienceData(),this.getExtendData()]).then(_ => {
|
|
|
|
|
|
+ Promise.all([this.getCurrencyAndBaseMessageData(), this.getScienceData(), this.getExtendData()]).then(_ => {
|
|
console.log('所有分析获取完成')
|
|
console.log('所有分析获取完成')
|
|
- resolve();
|
|
|
|
|
|
+ resolve()
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- //删除分析
|
|
|
|
- delAnalysis(item){
|
|
|
|
- if(!this.tid)return;
|
|
|
|
- this.currencyLoading = true;
|
|
|
|
- this.baseMessageLoading = true;
|
|
|
|
- this.scienceLoading = true;
|
|
|
|
- this.extendLoading = true;
|
|
|
|
- delObsRequest({
|
|
|
|
- id:item.id,
|
|
|
|
- type:item.Type,
|
|
|
|
- tid:this.tid
|
|
|
|
- }).then(res=>{
|
|
|
|
- this.dataList = this.dataList.filter(_item=>_item.id!=item.id);
|
|
|
|
- this.$toast.success('删除成功');
|
|
|
|
- this.currencyLoading = false;
|
|
|
|
- this.baseMessageLoading= false;
|
|
|
|
- this.scienceLoading= false;
|
|
|
|
- this.extendLoading= false;
|
|
|
|
- }).catch(e=>{
|
|
|
|
- this.$toast.fail('删除失败');
|
|
|
|
- this.currencyLoading = false;
|
|
|
|
- this.baseMessageLoading= false;
|
|
|
|
- this.scienceLoading= false;
|
|
|
|
- this.extendLoading= false;
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- //修改分析
|
|
|
|
- editAnalysis(item){
|
|
|
|
- if(!this.tid)return;
|
|
|
|
- this.baseMessageLoading= true;
|
|
|
|
- this.scienceLoading= true;
|
|
|
|
- this.extendLoading= true;
|
|
|
|
- editObsRequest({
|
|
|
|
- id:item.id,
|
|
|
|
- type:item.Type,
|
|
|
|
- tid:this.tid
|
|
|
|
- }).then(res=>{
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- //获取默认模板并创建课堂
|
|
|
|
- addNewCourseByDefault() {
|
|
|
|
- // 通过用户ID获取默认的模板
|
|
|
|
- var OpenCC = require("opencc-js");
|
|
|
|
- let converter = OpenCC.Converter({
|
|
|
|
- from: "hk",
|
|
|
|
- to: "cn",
|
|
|
|
- });
|
|
|
|
- return new Promise((resolve,reject)=>{
|
|
|
|
- let params = {
|
|
|
|
- uid: this.userId,
|
|
|
|
- };
|
|
|
|
- this.loading = true;
|
|
|
|
- getClassroomDefaultRequest(params).then((res) => {
|
|
|
|
- let _data = res[0][0];
|
|
|
|
- if (_data) {
|
|
|
|
- this.loading = true;
|
|
|
|
- _data.tips = JSON.parse(_data.tips);
|
|
|
|
- let _result = [];
|
|
|
|
- _data.tips.forEach((i) => {
|
|
|
|
- if(converter("词频词汇分析")==converter(i.jsonData.name))return;
|
|
|
|
- let _obj = {
|
|
|
|
- jsonData: i.jsonData,
|
|
|
|
- type: i.Type,
|
|
|
|
- index: i.tIndex,
|
|
|
|
- };
|
|
|
|
- _result.push(_obj);
|
|
|
|
- });
|
|
|
|
- this.loading = false;
|
|
|
|
- // console.log('👇要生成的模板')
|
|
|
|
- // console.log(_result)
|
|
|
|
- this.addNewCourseByTemplate(_result).then(_=>{
|
|
|
|
- resolve();
|
|
|
|
- })
|
|
|
|
- }else{
|
|
|
|
- this.loading = false;
|
|
|
|
- this.$toast.fail("获取模板详细为空");
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- //通过模板创建新的课堂
|
|
|
|
- addNewCourseByTemplate(json = []) {
|
|
|
|
- if (json.length <= 0) return;
|
|
|
|
- var OpenCC = require("opencc-js");
|
|
|
|
- let converter = OpenCC.Converter({
|
|
|
|
- from: "hk",
|
|
|
|
- to: "cn",
|
|
|
|
- });
|
|
|
|
- // json = json.filter(i=>converter(i.jsonData.name)!=converter("词频词汇分析"))
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- this.loading = true;
|
|
|
|
- const _newTid = uuidv4();
|
|
|
|
- let params = {
|
|
|
|
- tid: _newTid,
|
|
|
|
- userid: this.userId,
|
|
|
|
- template: json,
|
|
|
|
- };
|
|
|
|
- insertNewClassRoomRequest(params)
|
|
|
|
- .then((res) => {
|
|
|
|
- let _data = res.FunctionResponse;
|
|
|
|
- if (converter(_data.message) == converter("创建成功")) {
|
|
|
|
- // 设置新课堂的tid
|
|
|
|
- // this.tid = params.tid;
|
|
|
|
- this.changeTid(_newTid)
|
|
|
|
- insertNewObsRequest({
|
|
|
|
- tid: params.tid,
|
|
|
|
- type: 10,
|
|
|
|
- index: 0,
|
|
|
|
- json_data: JSON.stringify({ file_ids: "" }),
|
|
|
|
- userid: this.userId,
|
|
|
|
- })
|
|
|
|
- .then((res2) => {
|
|
|
|
- let _data2 = res2.FunctionResponse;
|
|
|
|
- if (converter(_data2.message) == converter("创建成功")) {
|
|
|
|
- this.loading = false;
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- this.getCourseList().then(_ => {
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- // this.getCourseList().then((_) => {
|
|
|
|
- // this.getFileIdId();
|
|
|
|
- // this.$refs.messageAreaRef.getData();
|
|
|
|
- // this.$refs.chatAreaRef.getData();
|
|
|
|
- // resolve();
|
|
|
|
- // });
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- this.$toast.fail("创建fileIds失败");
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else if (converter(_data.message) == converter("tid重复")) {
|
|
|
|
- this.$toast.fail("该课堂已存在");
|
|
|
|
- this.loading = false;
|
|
|
|
- } else {
|
|
|
|
- this.$toast.fail("创建失败");
|
|
|
|
- this.loading = false;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
|
|
+ //删除分析
|
|
|
|
+ delAnalysis(item) {
|
|
|
|
+ if (!this.tid) return
|
|
|
|
+ this.currencyLoading = true
|
|
|
|
+ this.baseMessageLoading = true
|
|
|
|
+ this.scienceLoading = true
|
|
|
|
+ this.extendLoading = true
|
|
|
|
+ delObsRequest({
|
|
|
|
+ id: item.id,
|
|
|
|
+ type: item.Type,
|
|
|
|
+ tid: this.tid
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ this.dataList = this.dataList.filter(_item => _item.id != item.id)
|
|
|
|
+ this.$toast.success('删除成功')
|
|
|
|
+ this.currencyLoading = false
|
|
|
|
+ this.baseMessageLoading = false
|
|
|
|
+ this.scienceLoading = false
|
|
|
|
+ this.extendLoading = false
|
|
|
|
+ })
|
|
|
|
+ .catch(e => {
|
|
|
|
+ this.$toast.fail('删除失败')
|
|
|
|
+ this.currencyLoading = false
|
|
|
|
+ this.baseMessageLoading = false
|
|
|
|
+ this.scienceLoading = false
|
|
|
|
+ this.extendLoading = false
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //修改分析
|
|
|
|
+ editAnalysis(item) {
|
|
|
|
+ if (!this.tid) return
|
|
|
|
+ this.baseMessageLoading = true
|
|
|
|
+ this.scienceLoading = true
|
|
|
|
+ this.extendLoading = true
|
|
|
|
+ editObsRequest({
|
|
|
|
+ id: item.id,
|
|
|
|
+ type: item.Type,
|
|
|
|
+ tid: this.tid
|
|
|
|
+ }).then(res => {})
|
|
|
|
+ },
|
|
|
|
+ //获取默认模板并创建课堂
|
|
|
|
+ addNewCourseByDefault() {
|
|
|
|
+ // 通过用户ID获取默认的模板
|
|
|
|
+ var OpenCC = require('opencc-js')
|
|
|
|
+ let converter = OpenCC.Converter({
|
|
|
|
+ from: 'hk',
|
|
|
|
+ to: 'cn'
|
|
|
|
+ })
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ let params = {
|
|
|
|
+ uid: this.userId
|
|
|
|
+ }
|
|
|
|
+ this.loading = true
|
|
|
|
+ getClassroomDefaultRequest(params).then(res => {
|
|
|
|
+ let _data = res[0][0]
|
|
|
|
+ if (_data) {
|
|
|
|
+ this.loading = true
|
|
|
|
+ _data.tips = JSON.parse(_data.tips)
|
|
|
|
+ let _result = []
|
|
|
|
+ _data.tips.forEach(i => {
|
|
|
|
+ if (converter('词频词汇分析') == converter(i.jsonData.name)) return
|
|
|
|
+ let _obj = {
|
|
|
|
+ jsonData: i.jsonData,
|
|
|
|
+ type: i.Type,
|
|
|
|
+ index: i.tIndex
|
|
|
|
+ }
|
|
|
|
+ _result.push(_obj)
|
|
|
|
+ })
|
|
|
|
+ this.loading = false
|
|
|
|
+ // console.log('👇要生成的模板')
|
|
|
|
+ // console.log(_result)
|
|
|
|
+ this.addNewCourseByTemplate(_result).then(_ => {
|
|
|
|
+ resolve()
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.$toast.fail('获取模板详细为空')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ //通过模板创建新的课堂
|
|
|
|
+ addNewCourseByTemplate(json = []) {
|
|
|
|
+ if (json.length <= 0) return
|
|
|
|
+ var OpenCC = require('opencc-js')
|
|
|
|
+ let converter = OpenCC.Converter({
|
|
|
|
+ from: 'hk',
|
|
|
|
+ to: 'cn'
|
|
|
|
+ })
|
|
|
|
+ // json = json.filter(i=>converter(i.jsonData.name)!=converter("词频词汇分析"))
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ this.loading = true
|
|
|
|
+ const _newTid = uuidv4()
|
|
|
|
+ let params = {
|
|
|
|
+ tid: _newTid,
|
|
|
|
+ userid: this.userId,
|
|
|
|
+ template: json
|
|
|
|
+ }
|
|
|
|
+ insertNewClassRoomRequest(params).then(res => {
|
|
|
|
+ let _data = res.FunctionResponse
|
|
|
|
+ if (converter(_data.message) == converter('创建成功')) {
|
|
|
|
+ // 设置新课堂的tid
|
|
|
|
+ // this.tid = params.tid;
|
|
|
|
+ this.changeTid(_newTid)
|
|
|
|
+ insertNewObsRequest({
|
|
|
|
+ tid: params.tid,
|
|
|
|
+ type: 10,
|
|
|
|
+ index: 0,
|
|
|
|
+ json_data: JSON.stringify({ file_ids: '' }),
|
|
|
|
+ userid: this.userId
|
|
|
|
+ }).then(res2 => {
|
|
|
|
+ let _data2 = res2.FunctionResponse
|
|
|
|
+ if (converter(_data2.message) == converter('创建成功')) {
|
|
|
|
+ this.loading = false
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.getCourseList().then(_ => {})
|
|
|
|
+ // this.getCourseList().then((_) => {
|
|
|
|
+ // this.getFileIdId();
|
|
|
|
+ // this.$refs.messageAreaRef.getData();
|
|
|
|
+ // this.$refs.chatAreaRef.getData();
|
|
|
|
+ // resolve();
|
|
|
|
+ // });
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('创建fileIds失败')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else if (converter(_data.message) == converter('tid重复')) {
|
|
|
|
+ this.$toast.fail('该课堂已存在')
|
|
|
|
+ this.loading = false
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('创建失败')
|
|
|
|
+ this.loading = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.getCourseList().then(_ => {
|
|
this.getCourseList().then(_ => {
|
|
// if(this.tid=="" && this.classList.length>0){
|
|
// if(this.tid=="" && this.classList.length>0){
|
|
// this.changeTid(this.classList[0].value);
|
|
// this.changeTid(this.classList[0].value);
|
|
-
|
|
|
|
// }
|
|
// }
|
|
// this.getData()
|
|
// this.getData()
|
|
})
|
|
})
|