|
@@ -77,8 +77,7 @@
|
|
|
<div :title="$t('board.optionView.翻牌')" class="listicon AnswerShow" v-if="currentIRS() == 'irsImmediately'" @click="listbtn('default')"><svg-icon icon-class="flop" /></div>
|
|
|
<div :title="$t('board.optionView.長條圖')" v-show="currentIRS() == 'irsImmediately'" @click="listbtn('bar')" :class="['listicon', current === 'bar' ? 'clickicon' : '']"><svg-icon icon-class="barchart" /></div>
|
|
|
<div :title="$t('board.optionView.餅圖')" v-show="currentIRS() == 'irsImmediately'" @click="listbtn('pie')" :class="['listicon', current === 'pie' ? 'clickicon' : '']"><svg-icon icon-class="Piechart" /></div>
|
|
|
- <div title="gpt" class="listicon" style="line-height: 28px" v-if="currentIRS() == 'irsText' && this.$store.state.currentState == 'irsTextEnd' && isAuthAccount() != 0 && isAuthGPT()&&!isAuthOnlyPureScan()" @click="triggerGPTByOpenBox()"><strong style="font-size: 12px">Gpt</strong></div>
|
|
|
- <div title="gpt" class="listicon" style="line-height: 28px" v-if="currentIRS() == 'irsText' && this.$store.state.currentState == 'irsTextEnd' && isAuthAccount() != 0 && !isAuthGPT()&&!isAuthOnlyPureScan()" @click="hintInstalledGPT()"><strong style="font-size: 12px">Gpt</strong></div>
|
|
|
+ <div title="gpt" class="listicon" style="line-height: 28px" v-if="currentIRS() == 'irsText' && this.$store.state.currentState == 'irsTextEnd' && isAuthAccount() != 0 && isAuthOpenAIAccount()&&!isAuthOnlyPureScan()" @click="triggerGPTByOpenBox()"><strong style="font-size: 12px">Gpt</strong></div>
|
|
|
<div :title="$t('board.optionView.文字雲')" class="listicon" v-if="currentIRS() == 'irsText' && this.$store.state.currentState == 'irsTextEnd' && isAuthAccount() != 0 && isAuthWordCloud()" @click="triggerWordCloud()"><svg-icon icon-class="word-cloud" /></div>
|
|
|
<div :title="$t('board.optionView.貼回舞台')" class="listicon" v-if="status == 'cloud' && this.$store.state.currentState == 'irsTextEnd'" @click="requestWordCloudImg()"><svg-icon icon-class="HTPaste" /></div>
|
|
|
<div :title="$t('board.optionView.統計翻牌自動結束')" v-if="status !== 'cloud' && status !== 'GPT'" class="live-switch"><i-switch :title="$t('board.optionView.統計翻牌自動結束')" v-model="autoOff" /></div>
|
|
@@ -90,8 +89,6 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="righticon-group">
|
|
|
- <div class="rightlisticon" v-if="currentIRS() == 'irsText' && status == 'GPT' && !boardElement.isWaitingGptFeedbackDone" @click="continueGpt()"><svg-icon icon-class="continue" /></div>
|
|
|
- <div class="rightlisticon" v-if="currentIRS() == 'irsText' && status == 'GPT' && boardElement.isWaitingGptFeedbackDone" @click="stopGpt()"><svg-icon icon-class="stop" class="stop-icon" /></div>
|
|
|
<div class="rightlisticon" :title="$t('board.optionView.匿名')" v-if="currentIRS() == 'irsText' && status !== 'cloud' && status !== 'GPT'" @click="hideName"><svg-icon :icon-class="this.$store.state.hideStudentName == false ? 'eye-show' : 'eye-hide'" /></div>
|
|
|
<div class="rightlisticon" :title="$t('board.optionView.複製到剪貼簿')" v-if="currentIRS() == 'irsText' && status == 'GPT'" @click="copyGPTAnsToClipboard()"><svg-icon icon-class="copy" /></div>
|
|
|
<div class="rightlisticon" :title="$t('board.optionView.複製到剪貼簿')" v-if="currentIRS() == 'irsText' && status == 'text'" @click="copyToClipboard()"><svg-icon icon-class="copy" /></div>
|
|
@@ -569,11 +566,7 @@ export default {
|
|
|
let wordItemIndex = that.wordCloudFreq.findIndex((item) => item.name == e.data.word);
|
|
|
that.$q.loading.hide();
|
|
|
that.showWordCloudTableSmartPickBtn(that.wordCloudFreq[wordItemIndex], clientEvent);
|
|
|
- } else if (e.data?.action == "GPT_done") {
|
|
|
- that.$parent.$parent.$parent.isWaitingGptFeedbackDone = false;
|
|
|
- } else if (e.data?.action == "GPT_error") {
|
|
|
- that.$parent.$parent.$parent.isWaitingGptFeedbackDone = false;
|
|
|
- }
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
window.addEventListener("resize", () => {
|
|
@@ -662,8 +655,8 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- isAuthGPT() {
|
|
|
- return this.$parent.$parent.$parent.checkGptExtensionInstalled;
|
|
|
+ isAuthOpenAIAccount() { //改介接OpenAI的權益
|
|
|
+ return this.$parent.$parent.$parent.isAuthOpenAIAccount();
|
|
|
},
|
|
|
isAuthWordCloud() {
|
|
|
return this.$parent.$parent.$parent.isAuthWordCloud();
|
|
@@ -1414,37 +1407,6 @@ export default {
|
|
|
});
|
|
|
return optionLength;
|
|
|
},
|
|
|
- hintInstalledGPT() {
|
|
|
- this.$parent.$parent.$parent.showHintGptInstalled = true;
|
|
|
- },
|
|
|
- continueGpt() {
|
|
|
- let board = this.$parent.$parent.$parent;
|
|
|
- if (!board.isWaitingGptFeedbackDone) {
|
|
|
- setTimeout(() => {
|
|
|
- window.postMessage({
|
|
|
- action: "ContinueGPT",
|
|
|
- id: "IRSChatGptBox",
|
|
|
- parentLang: board.lang,
|
|
|
- question: this.$t('gptBox["繼續"]'),
|
|
|
- });
|
|
|
- board.isWaitingGptFeedbackDone = true;
|
|
|
- }, 1000);
|
|
|
- } else {
|
|
|
- this.$Message.info(this.$t('gptBox["等候提示字"]'));
|
|
|
- }
|
|
|
- },
|
|
|
- stopGpt() {
|
|
|
- let board = this.$parent.$parent.$parent;
|
|
|
- if (board.isWaitingGptFeedbackDone) {
|
|
|
- window.postMessage({
|
|
|
- action: "StopGPT",
|
|
|
- id: "IRSChatGptBox",
|
|
|
- parentLang: board.lang,
|
|
|
- question: "",
|
|
|
- });
|
|
|
- board.isWaitingGptFeedbackDone = false;
|
|
|
- }
|
|
|
- },
|
|
|
triggerGPTByOpenBox() {
|
|
|
this.$store.state.mqtt.mqttIoTData.isGpt=1
|
|
|
this.$store.dispatch('mqtt/saveMqttIoTsessionStorage')
|
|
@@ -1461,63 +1423,6 @@ export default {
|
|
|
this.$parent.$parent.$parent.showGptBox = true
|
|
|
|
|
|
},
|
|
|
- // triggerGPTBySelect() {
|
|
|
- // if (this.currentSelectedGptAct == "") this.currentSelectedGptAct = this.gptActionList[0].value;
|
|
|
- // let that = this;
|
|
|
- // if (!this.$parent.$parent.$parent.isWaitingGptFeedbackDone) {
|
|
|
- // this.current = "GPT";
|
|
|
- // this.status = "GPT";
|
|
|
- // let allText = "";
|
|
|
- // this.student.forEach((stu) => {
|
|
|
- // allText = allText + stu.statement;
|
|
|
- // });
|
|
|
- // setTimeout(() => {
|
|
|
- // window.postMessage({
|
|
|
- // parentLang: that.lang,
|
|
|
- // action: "triggerGPT",
|
|
|
- // id: "IRSChatGptBox",
|
|
|
- // question: that.$t('gptBox["當前語系指令"]')+that.currentSelectedGptAct + "\n" + allText,
|
|
|
- // });
|
|
|
- // }, 500);
|
|
|
-
|
|
|
- // this.$parent.$parent.$parent.isWaitingGptFeedbackDone = true;
|
|
|
- // } else {
|
|
|
- // this.$Message.info(this.$t("gptBox['等候提示字']"));
|
|
|
- // }
|
|
|
- // },
|
|
|
- // triggerGPT() {
|
|
|
- // console.log(this.gptActionList, "this.gptActionList");
|
|
|
- // if (this.currentSelectedGptAct == "") this.currentSelectedGptAct = this.gptActionList[0].value;
|
|
|
- // let that = this;
|
|
|
- // if (!this.$parent.$parent.$parent.isWaitingGptFeedbackDone) {
|
|
|
- // if (this.current === "GPT") {
|
|
|
- // this.current = "";
|
|
|
- // this.status = "default";
|
|
|
- // } else {
|
|
|
- // this.current = "GPT";
|
|
|
- // this.status = "GPT";
|
|
|
- // let allText = "";
|
|
|
- // this.student.forEach((stu) => {
|
|
|
- // if (stu.statement != "") {
|
|
|
- // allText = allText + stu.statement + ",";
|
|
|
- // }
|
|
|
- // });
|
|
|
- // setTimeout(() => {
|
|
|
- // window.postMessage({
|
|
|
- // parentLang: that.lang,
|
|
|
- // action: "triggerGPT",
|
|
|
- // id: "IRSChatGptBox",
|
|
|
- // question: that.$t('gptBox["當前語系指令"]')+that.currentSelectedGptAct + "\n" + allText,
|
|
|
- // });
|
|
|
- // }, 500);
|
|
|
- // this.$parent.$parent.$parent.isWaitingGptFeedbackDone = true;
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.$Message.info(this.$t("gptBox['等候提示字']"));
|
|
|
- // this.current = "GPT";
|
|
|
- // this.status = "GPT";
|
|
|
- // }
|
|
|
- // },
|
|
|
triggerWordCloud() {
|
|
|
let that = this;
|
|
|
if (this.current === "cloud") {
|