Răsfoiți Sursa

feat: 修改菜单

zhouyuhao 5 luni în urmă
părinte
comite
0d0e1ddd1e

+ 4 - 3
src/views/AIApiLog/src/AIApiLog.vue

@@ -50,8 +50,8 @@ const DateChange = (date: any) => {
     searchData.value.request_date_start = ''
     searchData.value.request_date_end = ''
   } else {
-    searchData.value.request_date_start = dayjs(date[0]).format('DD/MM/YYYY')
-    searchData.value.request_date_end = dayjs(date[1]).format('DD/MM/YYYY')
+    searchData.value.request_date_start = dayjs(date[0]).format('MM/DD/YYYY')
+    searchData.value.request_date_end = dayjs(date[1]).format('MM/DD/YYYY')
   }
   tableRef.value.SearchOperationLog(searchData.value)
 }
@@ -81,7 +81,7 @@ const DateChange = (date: any) => {
           <CalendarDate @DateChange="DateChange"></CalendarDate>
         </div>
         <div class="tips_filter">
-          <el-select v-model="searchData.ai_model" placeholder="AI Model">
+          <el-select v-model="searchData.ai_model" clearable placeholder="AI Model">
             <el-option
               v-for="item in aiModelList"
               :key="item.value"
@@ -94,6 +94,7 @@ const DateChange = (date: any) => {
           <span>Response Duration</span>
           <el-select
             placeholder=""
+            clearable
             v-model="searchData.response_duration_type"
             style="width: 70px; margin: 0 6px"
           >

+ 13 - 3
src/views/AIApiLog/src/components/LogDialog.vue

@@ -2,13 +2,17 @@
 const dialogVisible = ref(false)
 
 const requestContent = ref()
+// const requestList = ref([])
 const responseContent = ref()
+// const responseList = ref()
 const requestContentRef = ref<HTMLElement | null>(null)
 const responseHeight = ref(580)
 const openDialog = (request, response) => {
   dialogVisible.value = true
   requestContent.value = request
-  responseContent.value = response
+  responseContent.value = response.choices[0].message.content
+  // requestList.value = JSON.stringify(request).split('\n')
+  // responseList.value = JSON.stringify(response).split('\n')
   nextTick(() => {
     if (requestContentRef.value) {
       const height = requestContentRef.value.scrollHeight
@@ -33,14 +37,20 @@ defineExpose({
       <div class="title">Request Content</div>
       <div class="content" ref="requestContentRef">
         {{ requestContent }}
+        <!-- <p v-for="(item, index) in requestList" :key="index">
+          {{ item }}
+        </p> -->
       </div>
     </div>
     <el-divider style="margin: 16px 0" />
     <div class="response-section">
       <div class="title">Response Content</div>
-      <p class="content" :style="{ height: responseHeight + 'px' }">
+      <div class="content" :style="{ height: responseHeight + 'px' }">
+        <!-- <p v-for="(item, index) in responseList" :key="index">
+          {{ item }}
+        </p> -->
         {{ responseContent }}
-      </p>
+      </div>
     </div>
   </el-dialog>
 </template>

+ 2 - 2
src/views/ChatLog/src/ChatLog.vue

@@ -94,8 +94,8 @@ const DateChange = (date: any) => {
     searchData.value.question_date_start = ''
     searchData.value.question_date_end = ''
   } else {
-    searchData.value.question_date_start = dayjs(date[0]).format('DD/MM/YYYY')
-    searchData.value.question_date_end = dayjs(date[1]).format('DD/MM/YYYY')
+    searchData.value.question_date_start = dayjs(date[0]).format('MM/DD/YYYY')
+    searchData.value.question_date_end = dayjs(date[1]).format('MM/DD/YYYY')
   }
   tableRef.value.searchTableData(searchData.value)
 }

+ 6 - 63
src/views/Layout/src/components/Menu/MenuView.vue

@@ -10,64 +10,7 @@ const userStore = useUserStore()
 
 const isCollapse = defineModel<boolean>()
 
-const menuList = ref([
-  {
-    index: '1',
-    label: 'Dashboard',
-    icon: 'icon_data_fill_b',
-    path: '/dashboard'
-  },
-  {
-    index: '2',
-    label: 'Booking',
-    icon: 'icon_booking__fill_b',
-    path: '/booking'
-  },
-  {
-    index: '3',
-    label: 'Tracking',
-    icon: 'icon_tracking__fill_b',
-    path: '/tracking'
-  },
-  {
-    index: '4',
-    label: 'System Management',
-    icon: 'icon_system__management_fill_b',
-    type: 'list',
-    children: [
-      {
-        index: '4-1',
-        label: 'System Message',
-        path: '/system-message'
-      },
-      {
-        index: '4-2',
-        label: 'System Settings',
-        path: '/SystemSettings'
-      },
-      {
-        index: '4-3',
-        label: 'Operation Log',
-        path: '/Operationlog'
-      },
-      {
-        index: '4-4',
-        label: 'Chat Log',
-        path: '/chat-log'
-      },
-      {
-        index: '4-5',
-        label: 'AI API  Log',
-        path: '/ai-api-log'
-      },
-      {
-        index: '4-6',
-        label: 'Prompt Configuration',
-        path: '/PromptConfiguration'
-      }
-    ]
-  }
-])
+const menuList = ref()
 watch(
   () => userStore.userInfo?.uname,
   () => {
@@ -75,11 +18,11 @@ watch(
   }
 )
 const getMenuList = () => {
-  // $api.getMenuList().then((res) => {
-  //   if (res.code === 200) {
-  //     menuList.value = res.data
-  //   }
-  // })
+  $api.getMenuList().then((res) => {
+    if (res.code === 200) {
+      menuList.value = res.data
+    }
+  })
 }
 getMenuList()
 //监听窗口大小