Browse Source

异常反馈列表

S0025136190 1 year ago
parent
commit
f5410b1361

+ 18 - 0
Web/src/api/custom/index.ts

@@ -87,6 +87,16 @@ export type FetchPilotPasswordApiParams = {
     userId: string,
 };
 
+export type FetchGetLogListApiParms = {
+    begin_time: number,
+    end_time: number,
+    template_type: number,
+    username: number,
+    search_info: string,
+    page: number,
+    page_size: number,
+}
+
 // Api函数类型
 export type FetchDeviceLogListApi = (sn: string, params: { domain_list: string }) => Promise<any>;
 export type CreateDeviceFeedbackApi = (sn: string, data: CreateDeviceFeedbackApiParams) => Promise<any>;
@@ -110,6 +120,7 @@ export type FetchTrajectoryListApi = (params: FetchTrajectoryListApiParams) => P
 export type FetchTrajectoryMapApi = (taskId: string) => Promise<any>;
 export type AddPilotApi = (data: AddPilotApiParams) => Promise<any>;
 export type FetchPilotPasswordApi = (params: FetchPilotPasswordApiParams) => Promise<any>;
+export type FetchGetLogListApi = (params: FetchGetLogListApiParms) => Promise<any>;
 
 export const getUploadPath = () => {
     return `api/media/api/v1/files/${getWorkspaceId()}/file/upload`;
@@ -260,6 +271,12 @@ const fetchPilotPasswordApi: FetchPilotPasswordApi = async (params) => {
     return res.data;
 };
 
+// 获取异常变化记录列表
+const fetchGetLogListApi: FetchGetLogListApi = async (params) => {
+    const res = await request.get(`/manage/api/v1/workspaces/${getWorkspaceId()}/devices/logsList`, { params: params });
+    return res.data;
+};
+
 export const apis = {
     fetchDeviceLogList: fetchDeviceLogListApi,
     createDeviceFeedback: createDeviceFeedbackApi,
@@ -283,4 +300,5 @@ export const apis = {
     fetchTrajectoryMap: fetchTrajectoryMapApi,
     AddPilot: addPilotApi,
     fetchPilotPassword: fetchPilotPasswordApi,
+    fetchGetLogList:fetchGetLogListApi,
 };

+ 19 - 10
Web/src/components/devices/feedbackRecord/components/Search.vue

@@ -8,28 +8,28 @@
         <a-form-item name="status">
           <a-select style="width: 200px;" placeholder="请选择状态" v-model:value="formModel.status">
             <a-select-option value="1">
-              设备空闲
+              上传
             </a-select-option>
             <a-select-option value="2">
-              设备已离线
+              成功
             </a-select-option>
             <a-select-option value="3">
-              舱内关机
+              取消
             </a-select-option>
             <a-select-option value="4">
-              离线
+              失败
             </a-select-option>
           </a-select>
         </a-form-item>
         <a-form-item name="device_name">
-          <a-select style="width: 200px;" placeholder="请选择反馈人" v-model:value="formModel.device_name">
+          <a-select style="width: 200px;" placeholder="请选择反馈人" v-model:value="formModel.username">
             <a-select-option value="1">
               pilot
             </a-select-option>
           </a-select>
         </a-form-item>
-        <a-form-item name="keyword">
-          <a-input style="width: 200px;" placeholder="设备SN、设备异常描述" v-model:value="formModel.keyword" />
+        <a-form-item name="search_info">
+          <a-input style="width: 200px;" placeholder="设备SN、设备异常描述" v-model:value="formModel.search_info" />
         </a-form-item>
         <a-form-item>
           <a-button style="margin-right: 10px;" @click="handleClicSekarch">
@@ -51,6 +51,7 @@
 <script lang="ts" setup>
 import { ref, reactive } from 'vue';
 import { SearchOutlined, ReloadOutlined } from '@ant-design/icons-vue';
+import moment from 'moment';
 
 interface Props {
   onClickSearch: (query: any) => Promise<any>,
@@ -66,14 +67,22 @@ const formRef = ref();
 const formModel = reactive({
   date: [],
   status: undefined,
-  device_name: undefined,
-  keyword: '',
+  username: undefined,
+  search_info: '',
 })
 
 // 点击查询
 const handleClicSekarch = async () => {
   const values = formRef.value?.getFieldsValue();
-  await props.onClickSearch(values);
+  const data = {
+    ...values,
+  };
+  delete data.date;
+  if (values.date.length === 2) {
+    data.begin_time = moment(values.date[0]).valueOf();
+    data.end_time = moment(values.date[1]).valueOf();
+  }
+  await props.onClickSearch(data);
 }
 
 // 点击重置

+ 3 - 3
Web/src/components/devices/feedbackRecord/index.vue

@@ -80,7 +80,7 @@ const paginationConfig = reactive({
 const fetchList = async () => {
   state.listLoading = true;
   try {
-    const res = await apis.fetchChangeRecordList({
+    const res = await apis.fetchGetLogList({
       ...state.query,
       page: paginationConfig.current,
       page_size: paginationConfig.pageSize
@@ -111,7 +111,7 @@ const columns = [
   },
   {
     title: '反馈人',
-    dataIndex: 'username',
+    dataIndex: 'user_name',
     width: 150,
   },
   {
@@ -143,7 +143,7 @@ const columns = [
   },
   {
     title: '设备异常描述',
-    dataIndex: 'log_info',
+    dataIndex: 'logs_info',
     width: 150,
     ellipsis: true,
   },