Quellcode durchsuchen

📦 修改主页细节问题

首页地图加载提示修改
首页列表文字过长问题修改
快乐的梦鱼 vor 1 Monat
Ursprung
Commit
b08a8b87c4

+ 2 - 0
src/common/components/parts/IndexCommonImageItem.vue

@@ -6,6 +6,8 @@
     :width="340"
     :imageWidth="340"
     :imageRadius="15"
+    :titleProps="{ fontSize: 24, color: 'gray', lines: 2 }"
+    :descProps="{ fontSize: 24, color: 'gray', lines: 2 }"
     backgroundColor="transparent"
     @click="$emit('click')"
   >

+ 16 - 0
src/components/display/block/ImageBlock2.vue

@@ -20,6 +20,9 @@
           :title="title"
           :desc="desc"
           :extra="extra"
+          :titleProps="titleProps"
+          :descProps="descProps"
+          :extraProps="extraProps"
           :extraMpSlotState="Boolean($slots.extra)"
         >
           <template v-if="$slots.extra" #extra>
@@ -50,6 +53,7 @@ import Touchable from '@/components/feedback/Touchable.vue';
 import type { FlexProps } from '../../layout/FlexView.vue';
 import IconTextBlock from './IconTextBlock.vue';
 import FlexCol from '@/components/layout/FlexCol.vue';
+import type { TextProps } from '@/components/basic/Text.vue';
 
 export interface ImageBlock2Props extends Partial<FlexProps> {
   /**
@@ -77,13 +81,25 @@ export interface ImageBlock2Props extends Partial<FlexProps> {
    */
   title?: string;
   /**
+   * 图片下方显示标题属性。
+   */
+  titleProps?: TextProps;
+  /**
    * 图片下方显示描述。
    */
   desc?: string;
   /**
+   * 图片下方显示描述属性。
+   */
+  descProps?: TextProps;
+  /**
    * 图片下方显示额外信息。
    */
   extra?: string;
+  /**
+   * 图片下方显示额外信息属性。
+   */
+  extraProps?: TextProps;
 }
 
 const theme = useTheme();

+ 2 - 0
src/components/dynamic/DynamicFormControl.vue

@@ -22,6 +22,7 @@
     :rules="item.rules"
     :disabled="disabled"
     :readonly="readonly"
+    :type="item.type === 'password' ? 'password' : 'text'"
     v-bind="{ 
       ...params,
       ...extraDefine?.itemProps || {},
@@ -304,6 +305,7 @@ const filedInternalTypes = [
   'text',
   'textarea',
   'text-tag',
+  'password',
 ]
 
 const props = defineProps({	

+ 11 - 2
src/pages/chat/composables/useChatSession.ts

@@ -218,8 +218,7 @@ export function useChatSession(options: UseChatSessionOptions) {
       return;
 
     if (currentSessionId.value <= 0) {
-      const overview = await AgentWorkApi.getQuestionOverview(userMessages.map(m => m.content).join('\n'));
-      const historyId = (await AgentApi.createChatHistory(overview, currentGroupId.value)).requireData();
+      const historyId = (await AgentApi.createChatHistory('新会话', currentGroupId.value)).requireData();
 
       await addChatHistoryItems(historyId);
       currentSessionId.value = historyId;
@@ -227,6 +226,16 @@ export function useChatSession(options: UseChatSessionOptions) {
       await events.emitAsync('pager-init', historyId);
       //移除未持久化的消息
       messages.value = messages.value.filter(m => m.isPersisted);
+
+      //异步更新会话摘要
+      AgentWorkApi.getQuestionOverview(userMessages.map(m => m.content).join('\n')).then(overview => {
+        const session = sessions.value.find(s => s.id === historyId);
+        if (session) {
+          session.summary = overview;
+          AgentApi.updateChatHistory(historyId, session as AgentChatHistory);
+        }
+      });
+
     } else {
       await addChatHistoryItems(currentSessionId.value);
     }

+ 3 - 1
src/pages/home/components/LightMap.vue

@@ -94,6 +94,7 @@ const emit = defineEmits([
   'selectVillage',
   'regionChanged',
 ]);
+const ready = ref(false);
 
 const props = defineProps<{
   lonlat?: { longitude: number, latitude: number } | undefined;
@@ -187,11 +188,12 @@ const mapLoader = useSimpleDataLoader<MapMarker[]>(async () => {
     }, 200);
   }
 
+  ready.value = true;
   return res;
 }, false, false, true);
 
 const isEmptyRegion = computed(() => {
-  return !selectedRegion.value || !mapLoader.content.value?.length;
+  return (!mapLoader.content.value?.length) && ready.value;
 });
 
 function onMarkerTap(e: any) {