|
@@ -1696,16 +1696,15 @@ ${JSON.stringify(_list)}
|
|
|
}
|
|
|
|
|
|
_behavioralCodingList.push({
|
|
|
- index:textList.length,
|
|
|
- role:privSpeakerId,
|
|
|
- content:privText,
|
|
|
- code:"",
|
|
|
- })
|
|
|
-
|
|
|
-
|
|
|
+ index: textList.length,
|
|
|
+ role: privSpeakerId,
|
|
|
+ content: privText,
|
|
|
+ code: ""
|
|
|
+ });
|
|
|
|
|
|
console.log("roleList", _roleList);
|
|
|
console.log("getRoleList", _getRoleList);
|
|
|
+ console.log("behavioralCodingList", _behavioralCodingList);
|
|
|
if (_getRoleList.length >= 10 && !_getRoleLoading) {
|
|
|
try {
|
|
|
let params = {
|
|
@@ -1765,12 +1764,6 @@ ${JSON.stringify(_list)}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- _behavioralCodingList.forEach(i=>{
|
|
|
- if(roleKeys.includes(i.role)){
|
|
|
- i.code = _roleList[i.role];
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
_getRoleList = _getRoleList.filter(
|
|
|
i => !roleKeys.includes(i.role)
|
|
|
);
|
|
@@ -1785,43 +1778,56 @@ ${JSON.stringify(_list)}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(_behavioralCodingList.filter(i=> !i.role.includes("Guest") && i.code=="").length>10 && !_getBehavioralCodingLoading){
|
|
|
+ if (
|
|
|
+ _behavioralCodingList.filter(
|
|
|
+ i => !i.role.includes("Guest") && i.code == ""
|
|
|
+ ).length > 10 &&
|
|
|
+ !_getBehavioralCodingLoading
|
|
|
+ ) {
|
|
|
try {
|
|
|
- let _behavioralCodingListTemp = _behavioralCodingList.filter(i=> !i.role.includes("Guest") && i.code=="").slice(0, 10);
|
|
|
+ let _behavioralCodingListTemp = _behavioralCodingList
|
|
|
+ .filter(i => !i.role.includes("Guest") && i.code == "")
|
|
|
+ .slice(0, 10);
|
|
|
let params = {
|
|
|
- inputs:{
|
|
|
- rows:JSON.stringify(_behavioralCodingListTemp.map(i=>{
|
|
|
- return {content:i.content,role:i.role}
|
|
|
- })),
|
|
|
- options:"老师讲课,老师提问或点名,老师板书或操作,老师评价或反馈,老师其他,学生发言,学生小组活动,学生自主学习,学生汇报分享,学生其他",
|
|
|
- attention:"- 先根据说话人角色判断,再在对应角色的选项中选择选项\n- 如果没有合适的选项,默认使用`老师其他`或者`学生其他`"
|
|
|
+ inputs: {
|
|
|
+ rows: JSON.stringify(
|
|
|
+ _behavioralCodingListTemp.map(i => {
|
|
|
+ return { content: i.content, role: i.role };
|
|
|
+ })
|
|
|
+ ),
|
|
|
+ options:
|
|
|
+ "老师讲课,老师提问或点名,老师板书或操作,老师评价或反馈,老师其他,学生发言,学生小组活动,学生自主学习,学生汇报分享,学生其他",
|
|
|
+ attention:
|
|
|
+ "- 先根据说话人角色判断,再在对应角色的选项中选择选项\n- 如果没有合适的选项,默认使用`老师其他`或者`学生其他`"
|
|
|
},
|
|
|
- response_mode:"blocking",
|
|
|
- user:_this.userId
|
|
|
- }
|
|
|
+ response_mode: "blocking",
|
|
|
+ user: _this.userId
|
|
|
+ };
|
|
|
|
|
|
_getBehavioralCodingLoading = true;
|
|
|
- _this.getBehavioralCoding(params)
|
|
|
- .then(res=>{
|
|
|
- let _runData = res.data.data;
|
|
|
- let _runResult = _runData.outputs.result;
|
|
|
- _behavioralCodingListTemp.forEach((i,index)=>{
|
|
|
- _behavioralCodingList.find(i2=>i2.index == i.index).code = _runResult[index];
|
|
|
- })
|
|
|
+ _this
|
|
|
+ .getBehavioralCoding(params)
|
|
|
+ .then(res => {
|
|
|
+ let _runData = res.data.data;
|
|
|
+ let _runResult = _runData.outputs.result;
|
|
|
+ _behavioralCodingListTemp.forEach((i, index) => {
|
|
|
+ _behavioralCodingList.find(i2 => i2.index == i.index).code =
|
|
|
+ _runResult[index];
|
|
|
+ });
|
|
|
|
|
|
- _behavioralCodingList.forEach(i=>{
|
|
|
- if(textList[i.index].code == ""){
|
|
|
- textList[i.index].code = i.code;
|
|
|
- }
|
|
|
+ _behavioralCodingList.forEach(i => {
|
|
|
+ if (textList[i.index].code == "") {
|
|
|
+ textList[i.index].code = i.code;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ _getBehavioralCodingLoading = false;
|
|
|
})
|
|
|
- _getBehavioralCodingLoading = false;
|
|
|
- })
|
|
|
- .catch(err=>{
|
|
|
- console.log("获取行为编码错误",err)
|
|
|
- _getBehavioralCodingLoading = false;
|
|
|
- })
|
|
|
+ .catch(err => {
|
|
|
+ console.log("获取行为编码错误", err);
|
|
|
+ _getBehavioralCodingLoading = false;
|
|
|
+ });
|
|
|
} catch (error) {
|
|
|
- console.log("获取行为编码错误",error)
|
|
|
+ console.log("获取行为编码错误", error);
|
|
|
_getBehavioralCodingLoading = false;
|
|
|
}
|
|
|
}
|
|
@@ -1833,7 +1839,7 @@ ${JSON.stringify(_list)}
|
|
|
endTime: _this.updateRecordedTime({ duration: _endTime }),
|
|
|
time: _this.updateRecordedTime({ duration: _endTime - _startTime }),
|
|
|
role: privSpeakerId,
|
|
|
- code:"",
|
|
|
+ code: ""
|
|
|
});
|
|
|
|
|
|
_startTime = _endTime;
|
|
@@ -1890,7 +1896,9 @@ ${JSON.stringify(_list)}
|
|
|
};
|
|
|
|
|
|
iiframe.contentWindow.onSessionStopped = async function(e) {
|
|
|
+ let _flag = false;
|
|
|
if (_getRoleList.length > 0) {
|
|
|
+ _flag = true;
|
|
|
await _this
|
|
|
.getWavRoleList({
|
|
|
inputs: {
|
|
@@ -1948,8 +1956,58 @@ ${JSON.stringify(_list)}
|
|
|
i => !roleKeys.includes(i.role)
|
|
|
);
|
|
|
_getRoleLoading = false;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log("最后的获取说话人身份失败", err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ _behavioralCodingList.filter(
|
|
|
+ i => !i.role.includes("Guest") && i.code == ""
|
|
|
+ ).length > 0
|
|
|
+ ) {
|
|
|
+ _flag = true;
|
|
|
+ let _behavioralCodingListTemp = _behavioralCodingList.filter(
|
|
|
+ i => !i.role.includes("Guest") && i.code == ""
|
|
|
+ );
|
|
|
+ let params = {
|
|
|
+ inputs: {
|
|
|
+ rows: JSON.stringify(
|
|
|
+ _behavioralCodingListTemp.map(i => {
|
|
|
+ return { content: i.content, role: i.role };
|
|
|
+ })
|
|
|
+ ),
|
|
|
+ options:
|
|
|
+ "老师讲课,老师提问或点名,老师板书或操作,老师评价或反馈,老师其他,学生发言,学生小组活动,学生自主学习,学生汇报分享,学生其他",
|
|
|
+ attention:
|
|
|
+ "- 先根据说话人角色判断,再在对应角色的选项中选择选项\n- 如果没有合适的选项,默认使用`老师其他`或者`学生其他`"
|
|
|
+ },
|
|
|
+ response_mode: "blocking",
|
|
|
+ user: _this.userId
|
|
|
+ };
|
|
|
+ _this
|
|
|
+ .getBehavioralCoding(params)
|
|
|
+ .then(res => {
|
|
|
+ let _runData = res.data.data;
|
|
|
+ let _runResult = _runData.outputs.result;
|
|
|
+ _behavioralCodingListTemp.forEach((i, index) => {
|
|
|
+ _behavioralCodingList.find(i2 => i2.index == i.index).code =
|
|
|
+ _runResult[index];
|
|
|
+ });
|
|
|
|
|
|
- let _result = `
|
|
|
+ _behavioralCodingList.forEach(i => {
|
|
|
+ if (textList[i.index].code == "") {
|
|
|
+ textList[i.index].code = i.code;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log("获取行为编码错误", err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_flag) {
|
|
|
+ let _result = `
|
|
|
<table
|
|
|
border="0"
|
|
|
width="100%"
|
|
@@ -1968,8 +2026,8 @@ ${JSON.stringify(_list)}
|
|
|
<th>行为编码</th>
|
|
|
</tr>
|
|
|
`;
|
|
|
- textList.forEach((item, index) => {
|
|
|
- _result += `<tr>
|
|
|
+ textList.forEach((item, index) => {
|
|
|
+ _result += `<tr>
|
|
|
<td>${index + 1}</td>
|
|
|
<td>${item.startTime}</td>
|
|
|
<td>${item.endTime}</td>
|
|
@@ -1978,8 +2036,8 @@ ${JSON.stringify(_list)}
|
|
|
<td>${item.role}</td>
|
|
|
<td></td>
|
|
|
</tr>`;
|
|
|
- });
|
|
|
- _result += `
|
|
|
+ });
|
|
|
+ _result += `
|
|
|
<tr>
|
|
|
<td></td>
|
|
|
<td></td>
|
|
@@ -1991,11 +2049,7 @@ ${JSON.stringify(_list)}
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>`;
|
|
|
- _this.editorBarData.content = _result;
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- console.log("最后的获取说话人身份失败", err);
|
|
|
- });
|
|
|
+ _this.editorBarData.content = _result;
|
|
|
}
|
|
|
_this.wavGetTextProgress = 100;
|
|
|
if (_this.wavFileGetTextLoading) _this.$message.success("转译完成");
|
|
@@ -2026,16 +2080,17 @@ ${JSON.stringify(_list)}
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- getBehavioralCoding(params){
|
|
|
- return new Promise((resolve,reject)=>{
|
|
|
- this.ajax.post("https://dify.cocorobo.cn/v1/workflows/run?key=code",params)
|
|
|
- .then(res=>{
|
|
|
- resolve(res)
|
|
|
- })
|
|
|
- .catch(err=>{
|
|
|
- reject(err)
|
|
|
- })
|
|
|
- })
|
|
|
+ getBehavioralCoding(params) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.ajax
|
|
|
+ .post("https://dify.cocorobo.cn/v1/workflows/run?key=code", params)
|
|
|
+ .then(res => {
|
|
|
+ resolve(res);
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ reject(err);
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
stopWavGetText() {
|
|
|
if (this.wavGetTextLoading) {
|