Selaa lähdekoodia

feat: 新增时间间隔筛选项

zhouyuhao 7 kuukautta sitten
vanhempi
commit
10272b18a7
2 muutettua tiedostoa jossa 74 lisäystä ja 52 poistoa
  1. 29 50
      src/views/AIApiLog/src/AIApiLog.vue
  2. 45 2
      src/views/ChatLog/src/ChatLog.vue

+ 29 - 50
src/views/AIApiLog/src/AIApiLog.vue

@@ -10,7 +10,8 @@ const searchData = ref({
   startDate: '',
   endDate: '',
   aiModel: '',
-  responseDuration: ''
+  comparator: 'thanOrEqual',
+  responseDuration: 0
 })
 
 const aiModelList = [
@@ -27,46 +28,19 @@ const aiModelList = [
     value: 'claude'
   }
 ]
-const questionTypeList = [
-  {
-    label: 'Predefined Question',
-    value: 'predefinedQuestion'
-  },
-  {
-    label: 'free text',
-    value: 'freeText'
-  }
-]
-const AnswerTypeList = [
-  {
-    label: 'Suspend',
-    value: 'suspend'
-  },
-  {
-    label: 'Timeout',
-    value: 'timeout'
-  },
-  {
-    label: 'Predefined Template',
-    value: 'predefinedTemplate'
-  },
-  {
-    label: 'AI Answer',
-    value: 'AIAnswer'
-  }
-]
-const answerSatisfactionList = [
+
+const comparatorList = [
   {
-    label: 'Null',
-    value: 'null'
+    label: '>=',
+    value: 'thanOrEqual'
   },
   {
-    label: 'Good',
-    value: 'good'
+    label: '=',
+    value: 'equal'
   },
   {
-    label: 'Not Good',
-    value: 'notGood'
+    label: '<=',
+    value: 'lessOrEqual'
   }
 ]
 
@@ -115,27 +89,24 @@ const DateChange = (date: any) => {
             />
           </el-select>
         </div>
-        <div class="tips_filter">
-          <el-select v-model="searchData.questionType" placeholder="Question Type">
+        <div class="comparator-tips_filter">
+          <span>Response Duration</span>
+          <el-select v-model="searchData.comparator" style="width: 70px; margin: 0 6px">
             <el-option
-              v-for="item in questionTypeList"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </div>
-        <div class="tips_filter">
-          <el-select v-model="searchData.answerType" placeholder="Answer Type">
-            <el-option
-              v-for="item in AnswerTypeList"
+              v-for="item in comparatorList"
               :key="item.value"
               :label="item.label"
               :value="item.value"
             >
             </el-option>
           </el-select>
+          <el-input-number
+            v-model="searchData.responseDuration"
+            placeholder="s"
+            :controls="false"
+            :min="0"
+            style="width: 60px"
+          ></el-input-number>
         </div>
 
         <el-button class="el-button--dark" @click="Search">Search</el-button>
@@ -199,6 +170,14 @@ const DateChange = (date: any) => {
   height: 32px;
   margin-right: 8px;
 }
+.comparator-tips_filter {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  max-width: 260px;
+  height: 32px;
+  margin-right: 8px;
+}
 .dashboard {
   z-index: 2014;
   position: relative;

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

@@ -12,7 +12,9 @@ const searchData = ref({
   userType: '',
   questionType: '',
   answerType: '',
-  answerSatisfaction: ''
+  answerSatisfaction: '',
+  comparator: 'thanOrEqual',
+  responseDuration: 0
 })
 
 const userTypeList = [
@@ -68,6 +70,20 @@ const answerSatisfactionList = [
   }
 ]
 
+const comparatorList = [
+  {
+    label: '>=',
+    value: 'thanOrEqual'
+  },
+  {
+    label: '=',
+    value: 'equal'
+  },
+  {
+    label: '<=',
+    value: 'lessOrEqual'
+  }
+]
 const tableRef = ref()
 
 const Search = () => {
@@ -146,6 +162,25 @@ const DateChange = (date: any) => {
             </el-option>
           </el-select>
         </div>
+        <div class="comparator-tips_filter">
+          <span>Response Duration</span>
+          <el-select v-model="searchData.comparator" style="width: 70px; margin: 0 6px">
+            <el-option
+              v-for="item in comparatorList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+          <el-input-number
+            v-model="searchData.responseDuration"
+            placeholder="s"
+            :controls="false"
+            :min="0"
+            style="width: 60px"
+          ></el-input-number>
+        </div>
         <el-button class="el-button--dark" @click="Search">Search</el-button>
       </div>
     </div>
@@ -189,7 +224,7 @@ const DateChange = (date: any) => {
 .tips_filter {
   flex: 1;
   height: 30px;
-  max-width: 190px;
+  max-width: 170px;
   margin-right: 8px;
 }
 .input-tips_filter {
@@ -207,6 +242,14 @@ const DateChange = (date: any) => {
   height: 32px;
   margin-right: 8px;
 }
+.comparator-tips_filter {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  max-width: 260px;
+  height: 32px;
+  margin-right: 8px;
+}
 .dashboard {
   z-index: 2014;
   position: relative;