Browse Source

情绪大模型输出完成后取消禁用输入框;修复温度计折线显示逻辑;正式数据接口;不再获取用户权限;

wangyi/feature-20250804103736-新需求
宋杰 4 weeks ago
parent
commit
8b8b2a2c0e
  1. 7
      .env.development
  2. 2
      src/store/userPessionCode.js
  3. 13
      src/views/AIchat.vue
  4. 9
      src/views/AiEmotion.vue
  5. 9
      src/views/components/marketTemperature.vue
  6. 22
      src/views/homePage.vue

7
.env.development

@ -5,9 +5,10 @@ VITE_OUTPUT_DIR = 'dev'
VITE_PUBLIC_PATH = /
#新数据接口
VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link"
# VITE_APP_API_BASE_URL = "https://api.homilychart.com/link"
VITE_APP_API_BASE_CAZE_URL = "http://39.101.133.168:8828/link"
# VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link"
VITE_APP_API_BASE_URL = "https://api.homilychart.com/link"
# VITE_APP_API_BASE_CAZE_URL = "http://39.101.133.168:8828/link"
VITE_APP_API_BASE_CAZE_URL = "https://api.homilychart.com/link"
VITE_APP_IMG_API_BASE_URL = "http://39.101.133.168:8828/hljw/api/aws/upload"
#MJ API

2
src/store/userPessionCode.js

@ -86,7 +86,7 @@ export const useUserStore = defineStore('user', () => {
}
}
onMounted(() => {
init()
// init()
})
return {

13
src/views/AIchat.vue

@ -47,7 +47,7 @@ renderer.del = function (text) {
};
//
const emit = defineEmits(["updateMessage", "sendMessage"]);
const emit = defineEmits(["updateMessage", "sendMessage", "enableInput"]);
//
const playAudio = (url) => {
@ -451,6 +451,7 @@ const createTypingEffect = (message, content, speed) => {
content: "工作流返回出错,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
if (message.error == "2") {
apiStatus.two.isError = true;
} else if (message.error == "3") {
@ -462,6 +463,7 @@ const createTypingEffect = (message, content, speed) => {
if (message.end) {
chatStore.getUserCount();
chatStore.isLoading = false;
emit('enableInput');
}
message.isTyping = false;
nextTick(() => {
@ -580,6 +582,7 @@ const createTypingEffect = (message, content, speed) => {
content: "工作流返回出错,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
if (message.error == "2") {
apiStatus.two.isError = true;
} else if (message.error == "3") {
@ -612,6 +615,7 @@ const createTypingEffect = (message, content, speed) => {
content: "工作流返回出错,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
if (message.error == "2") {
apiStatus.two.isError = true;
} else if (message.error == "3") {
@ -738,6 +742,7 @@ watch(
});
chatStore.isLoading = false;
emit('enableInput');
}
} catch (e) {
console.log(e, "意图识别失败");
@ -748,6 +753,7 @@ watch(
content: "工作流返回出错,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
}
if (flag) {
@ -1572,6 +1578,7 @@ watch(
content: "工作流返回出错,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
}
}
@ -1671,6 +1678,7 @@ watch(
content: "工作流返回出错,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
}
}
}
@ -1856,6 +1864,7 @@ watch(
content: "工作流返回出错,请稍后重试1111",
});
chatStore.isLoading = false;
emit('enableInput');
}
}
}
@ -1990,6 +1999,7 @@ watch(
content: "工作流返回出错,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
}
}
}
@ -2166,6 +2176,7 @@ watch(
content: "数据缺失,请稍后重试",
});
chatStore.isLoading = false;
emit('enableInput');
}
// API

9
src/views/AiEmotion.vue

@ -797,6 +797,15 @@ function startTypewriterEffect(conclusion, onComplete) {
for (let i = 0; i <= disclaimerText.length; i++) {
const timer = setTimeout(() => {
displayedTexts.value.disclaimer = disclaimerText.substring(0, i);
//
if (i === disclaimerText.length) {
console.log('打字机效果完成,调用onComplete回调');
if (onComplete && typeof onComplete === 'function') {
onComplete();
//
currentOnCompleteCallback.value = null;
}
}
}, totalDelay + i * typeSpeed);
typewriterTimers.value.push(timer);
}

9
src/views/components/marketTemperature.vue

@ -371,11 +371,14 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
const stockData = raw.map((item) => Math.round(item[2]));
//
const processedStockData = stockData.map((stockTemp, index) => {
//
const allDataMatch = stockData.every((stockTemp, index) => {
const marketTemp = marketData[index];
// null
return stockTemp === marketTemp ? null : stockTemp;
return stockTemp === marketTemp;
});
// null
const processedStockData = allDataMatch ? stockData.map(() => null) : stockData;
//
chartInstance = echarts.init(KlineCanvs.value);

22
src/views/homePage.vue

@ -198,10 +198,10 @@ const sendMessage = async () => {
// ensureAIchat AIchat
ensureAIchat();
console.log(chatStore.isLoading, "isLoading.value1111");
if (chatStore.isLoading) return;
chatStore.isLoading=true;
console.log(chatStore.isLoading, "isLoading.value2222");
console.log(isInputDisabled.value, "isInputDisabled.value1111");
if (isInputDisabled.value) return;
isInputDisabled.value = true;
console.log(isInputDisabled.value, "isInputDisabled.value2222");
const messageContent = message.value;
//
@ -222,6 +222,11 @@ const sendMessage = async () => {
}, 200);
};
//
const enableInput = () => {
isInputDisabled.value = false;
};
//
//
import Announcement from "./Announcement.vue";
@ -605,6 +610,7 @@ onUnmounted(() => {
@updateMessage="updateMessage"
@sendMessage="sendMessage"
@ensureAIchat="ensureAIchat"
@enableInput="enableInput"
ref="aiEmotionRef"
/>
</div>
@ -679,17 +685,11 @@ onUnmounted(() => {
>
</el-input>
<img
v-if="!chatStore.isLoading"
:src="sendBtn"
@click="sendMessage"
class="action-btn send-btn"
:style="{ opacity: isInputDisabled ? 0.5 : 1, cursor: isInputDisabled ? 'not-allowed' : 'pointer' }"
/>
<!-- <div v-else @click="chatStore.setLoading(false)"> -->
<div v-else>
<el-icon class="is-loading">
<Loading />
</el-icon>
</div>
</div>
</el-footer>
</el-container>

Loading…
Cancel
Save