wujingjing
2025-01-06 985aa40f5a3d15d4f196297697430d877b473e04
时间输入
已修改3个文件
已添加1个文件
56 ■■■■■ 文件已修改
src/components/chat/assistant/index.vue 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/chatComponents/multiChat/TimeRange.vue 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/chatComponents/multiChat/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/model/types.ts 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chat/assistant/index.vue
@@ -91,13 +91,12 @@
                                                                v-for="(multiChatItem, multiChatIndex) in subItem.subStep"
                                                            >
                                                                <component
                                                                    :order="`${stepIndex + 1}-${multiChatIndex + 1}`"
                                                                    :item="multiChatItem"
                                                                    :is="multiChatTypeMapCom[multiChatItem.type]"
                                                                    @change="multiChatChange"
                                                                    :disabled="!(stepIndex + 1 === msg?.stepGroup?.[index].value.length && isTalking && isLast)"
                                                                />
                                                            </div>
                                                        </div>
                                                    </template>
@@ -110,7 +109,6 @@
                                        ä¸ºäº†è§£å†³è¿™ä¸ªé—®é¢˜ï¼Œç­‰åˆ° msg.historyId å­˜åœ¨æ—¶ï¼Œå†æ¸²æŸ“ recordSetTable
                                        -->
                                        <component
                                            v-if="msg.content?.values?.[index] && msg.historyId"
                                            :reportIndex="index"
                                            :conclusion="msg.content.values[index].conclusion"
@@ -235,6 +233,7 @@
import { multiChatTypeMapCom } from '/@/components/chat/chatComponents/multiChat';
import { isSharePage } from '/@/stores/chatRoom';
import { ErrorCode } from '/@/utils/request';
import { question_stream_reply } from '/@/api/ai/chat';
const props = defineProps({
    /** @description å½“前消息 */
@@ -293,6 +292,14 @@
    emit('shareMsg', item);
};
//#endregion
const multiChatChange = async (replyId: string, val: any) => {
    const res = await question_stream_reply({
        start_time: val.start_time,
        end_time: val.end_time,
        reply_id: replyId,
    });
};
</script>
<style scoped lang="scss">
pre {
src/components/chat/chatComponents/multiChat/TimeRange.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,40 @@
<template>
    <div class="flex flex-col gap-1">
        <span class="text-gray-600 font-normal">{{ `${order} ${item?.data?.title}` }}</span>
        <TimeRange :disabled="disabled" @change="timeRangeChange" ></TimeRange>
    </div>
</template>
<script lang="ts" setup>
import { definePropType } from 'element-plus/es/utils';
import type { PropType } from 'vue';
import TimeRange from '../summaryCom/components/recordSet/components/TimeRange.vue';
const props = defineProps({
    order: {
        type: String,
        default: '',
    },
    item: {
        type: Object as PropType<any>,
    },
    disabled: {
        type: Boolean,
        default: false,
    },
});
const emit = defineEmits(['change']);
// const timeRangeValue = defineModel({
//     type: definePropType<[string, string]>(Array),
// });
const timeRangeChange = (val: [string, string]) => {
    if (props.disabled) return;
    emit(
        'change',
        props.item?.data?.reply_id,
        {
            start_time: val[0],
            end_time: val[1],
        }
    );
};
</script>
src/components/chat/chatComponents/multiChat/index.ts
@@ -1,8 +1,10 @@
import { MultiChatType } from '../../model/types';
import Select from './Select.vue';
import InputSelect from './InputSelect.vue';
import TimeRange from './TimeRange.vue';
export const multiChatTypeMapCom = {
    [MultiChatType.Select]: Select,
    [MultiChatType.InputSelect]: InputSelect,
    [MultiChatType.TimeRange]: TimeRange,
};
        
src/components/chat/model/types.ts
@@ -87,6 +87,7 @@
    InputSelect = 'input-select',
    Summary = 'summary',
    Result = 'result',
    TimeRange = 'time_range',
}
type SubStep = {
    data: any;