Browse Source

feature : 上报问题和上报服务

梦辉 2 months ago
parent
commit
0d32fcaba8

+ 13 - 4
src/api/questionReqort/index.ts

@@ -1,15 +1,20 @@
 import { service } from '@/utils/request'
-import { AddQuestionReportDataReq, PageQuestionReportDataReq, QuestionDetailRes, QuestionListRes } from './types'
+import { AddQuestionReportDataReq, PageQuestionReportDataReq, QuestionDetailRes, QuestionListRes, QuestionType, QuestionTypeListRes } from './types'
 import { ApiResponse, PageReq, PageResp } from '../types'
 export enum questionApi {
   /** 新增上报问题  */
-  ADD_QUESTION_REPORT_DATA = '/questionReport/addQuestionReportData',
+  ADD_QUESTION_REPORT_DATA = '/ystlbusinessservice/questionReport/addQuestionReportData',
   /** 上报问题列表  */
-  QUESTION_REPORT_LIST = '/questionReport/pageQuestionReportData',
+  QUESTION_REPORT_LIST = '/ystlbusinessservice/questionReport/pageQuestionReportData',
   /** 上报问题详情
    * /questionReport/detailsQuestionReportData/{uuid}
    */
-  QUESTION_REPORT_DETAIL = '/questionReport/detailsQuestionReportData',
+  QUESTION_REPORT_DETAIL = '/ystlbusinessservice/questionReport/detailsQuestionReportData',
+  /**
+   * 类型查询列表
+   * 1知识库 2投诉 3建议 4问题 5服务
+   */
+  QUESTION_TYPE_LIST = '/ystlbusinessservice/bTKnowledgeTypes/getPage',
 }
 
 /** 新增上报问题  */
@@ -26,4 +31,8 @@ export const pageQuestionReportData = (params: PageQuestionReportDataReq) => {
 /** 上报问题详情 */
 export const getQuestionReportDetail = (id: string) => {
   return service.get<ApiResponse<QuestionDetailRes>>(questionApi.QUESTION_REPORT_DETAIL + '/' + id)
+}
+
+export const getQuestionTypeList = (params: {page:number,limit:number,category:QuestionType}) => {
+  return service.get<ApiResponse<PageResp<QuestionTypeListRes>>>(questionApi.QUESTION_TYPE_LIST,{params})
 }

+ 25 - 0
src/api/questionReqort/types.ts

@@ -98,3 +98,28 @@ export interface QuestionDetailRes {
   /** 问题解答 */
   questionAnswer:string
 }
+
+/** 类型查询列表res */
+export interface QuestionTypeListRes {
+  category: number
+  createTime: number
+  createUser: string
+  creatorName: string
+  isDelete: number
+  typeName: string
+  updateTime: number
+  updateUser: string
+  uuid: string
+}
+/** 
+ * 类型列表category
+ * // 1知识库 2投诉 3建议 4问题 5服务
+ *  */
+
+export enum QuestionType {
+  KNOWLEDGE = '1',
+  COMPLAINT = '2',
+  SUGGESTION = '3',
+  QUESTION = '4',
+  SERVICE = '5'
+}

+ 3 - 3
src/api/reportService/index.ts

@@ -4,12 +4,12 @@ import { ApiResponse, PageResp } from '../types'
 
 export enum reportAPi {
   /** 新增上报服务 */
-  ADD_SERVICE_REPORT_DATA = '/serviceReport/addServiceReportData',
+  ADD_SERVICE_REPORT_DATA = '/ystlbusinessservice/serviceReport/addServiceReportData',
   /** 上报服务列表 */
-  SERVICE_REPORT_LIST = '/serviceReport/pageServiceReportData',
+  SERVICE_REPORT_LIST = '/ystlbusinessservice/serviceReport/pageServiceReportData',
   /** 上报服务详情 */
   // /serviceReport/detailsServiceReportData/{uuid}
-  SERVICE_REPORT_DETAIL = '/serviceReport/detailsServiceReportData',
+  SERVICE_REPORT_DETAIL = '/ystlbusinessservice/serviceReport/detailsServiceReportData',
 }
 
 /** 新增上报服务 */

+ 1 - 1
src/api/system/index.ts

@@ -3,7 +3,7 @@ import { GridAddressReq, GridAddressResp } from './types'
 import { ApiResponse } from '../types'
 export enum SystemApi {
   /** 获取网格地址信息 */
-  GET_GRID_ADDRESS = '/areaGrid/data/getAreaGrid',
+  GET_GRID_ADDRESS = '/ystlsystemservice/areaGrid/data/getAreaGrid',
 }
 
 /** 获取网格地址信息 */

+ 8 - 6
src/config/proxy.ts

@@ -2,13 +2,15 @@ import { ProxyOptions } from 'vite'
 
 const proxy: Record<string, string | ProxyOptions> = {
   /** 请求的后端地址  */
-  '/api/areaGrid': {
-    target: 'http://192.168.3.72:8085/',
-    changeOrigin: true,
-    rewrite: (path) => path.replace(/^\/api/, ''),
-  },
+  // '/api/areaGrid': {
+  //   // target: 'http://192.168.3.72:8085/',
+  //   target: 'http://10.68.191.169:9080',
+  //   changeOrigin: true,
+  //   rewrite: (path) => path.replace(/^\/api/, ''),
+  // },
   '/api': {
-    target: 'http://192.168.3.72:8081/',
+    // target: 'http://192.168.3.72:8081/',
+    target: 'http://10.68.191.169:9080',
     changeOrigin: true,
     rewrite: (path) => path.replace(/^\/api/, ''),
   },

+ 25 - 4
src/subPages/pages/reportProblems/index.vue

@@ -1,14 +1,14 @@
 <script lang="ts" setup>
-import { addQuestionReportData, pageQuestionReportData } from '@/api/questionReqort'
-import { AddQuestionReportDataReq, QuestionListRes } from '@/api/questionReqort/types'
-import { ref } from 'vue'
+import { addQuestionReportData, getQuestionTypeList, pageQuestionReportData } from '@/api/questionReqort'
+import { AddQuestionReportDataReq, QuestionListRes, QuestionType, QuestionTypeListRes } from '@/api/questionReqort/types'
+import { onMounted, ref } from 'vue'
 import GridAddress from '@/components/address/gridAddress/index.vue'
 import { showNotify } from 'vant';
 
 const active = ref(0)
 
 const formData = ref<AddQuestionReportDataReq & { location?: string }>({})
-const range = ref([])
+const range = ref<{text: string, value: string}[]>([])
 const rules = ref({
   type: [{ required: true, message: '请选择问题类型' }],
   title: [{ required: true, message: '请输入问题标题' }],
@@ -81,6 +81,27 @@ const areaShow = ref(false)
 const hanleSelectArea = () => {
   areaShow.value = true
 }
+
+
+
+onMounted(async () => {
+  const {data} = await getQuestionTypeList({
+    page: 1,
+    limit: 9999,
+    category:QuestionType.QUESTION
+    
+  })
+  if (data.records) {
+    range.value = data.records.map(item => {
+      return {
+        text: item.typeName,
+        value: item.typeName
+      }
+    })
+  } else {
+     range.value = []
+  }
+})
 </script>
 
 <template>

+ 24 - 2
src/subPages/pages/reportServer/index.vue

@@ -1,8 +1,10 @@
 <script lang="ts" setup>
 import { addServiceReportData, pageServiceReportData } from '@/api/reportService'
 import { addReportServiceDataReq, ReportServiceRes } from '@/api/reportService/types'
-import { ref } from 'vue'
+import { onMounted, ref } from 'vue'
 import GridAddress from '@/components/address/gridAddress/index.vue'
+import { getQuestionTypeList } from '@/api/questionReqort';
+import { QuestionType } from '@/api/questionReqort/types';
 
 
 const active = ref(0)
@@ -17,7 +19,7 @@ const rules = ref({
   area: [{ required: true, message: '请选择服务区域' }],
 })
 // 服务类型
-const range = ref([])
+const range = ref<{text: string, value: string}[]>([])
 
 const submit = async () => {
   const { data } = await addServiceReportData({
@@ -81,6 +83,26 @@ const handleAddressFinish = (value) => {
 const hanleSelectArea = () => {
   areaShow.value = true
 }
+
+
+onMounted(async () => {
+  const {data} = await getQuestionTypeList({
+    page: 1,
+    limit: 9999,
+    category:QuestionType.SERVICE
+    
+  })
+  if (data.records) {
+    range.value = data.records.map(item => {
+      return {
+        text: item.typeName,
+        value: item.typeName
+      }
+    })
+  } else {
+     range.value = []
+  }
+})
 </script>
 
 <template>