|
|
@@ -1,16 +1,13 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { addQuestionReportData,REPORTDATA, getQuestionTypeList, pageQuestionReportData,getPerson } from '@/api/questionReqort'
|
|
|
import { AddQuestionReportDataReq, PageQuestionReportDataReq, QuestionListRes, QuestionType, QuestionTypeListRes } from '@/api/questionReqort/types'
|
|
|
-import type { ApiResponse, PageResp } from '@/api/types'
|
|
|
-import type { AuthTokenChannelSnapshot } from '@/utils/request/requestHandler'
|
|
|
import { getCachedWecomVisitorProfile, getWecomInternalUser } from '@/api/wecom'
|
|
|
-import { computed, onMounted, ref, watch } from 'vue'
|
|
|
+import { onMounted, ref, watch } from 'vue'
|
|
|
import GridAddress from '@/components/address/gridAddress/index.vue'
|
|
|
import { showNotify } from 'vant'
|
|
|
import dayjs from 'dayjs';
|
|
|
import { onLoad } from '@dcloudio/uni-app'
|
|
|
import useUserState from '@/store/userState'
|
|
|
-import { getAuthTokenChannelSnapshot, resolveUserAuthToken } from '@/utils/request/requestHandler'
|
|
|
|
|
|
const active = ref(0)
|
|
|
const userState = useUserState()
|
|
|
@@ -230,29 +227,6 @@ const listLoadVersion = ref(0)
|
|
|
/** 合并并发 init,避免 watch 与重复进入导致多次 reset/请求交错 */
|
|
|
let listInitPromise: Promise<void> | null = null
|
|
|
|
|
|
-/** 列表接口调试:最近一次请求参数与完整响应 */
|
|
|
-const showListRawJsonPopup = ref(false)
|
|
|
-const listLastReqParams = ref<PageQuestionReportDataReq | null>(null)
|
|
|
-const listLastApiResponse = ref<ApiResponse<PageResp<QuestionListRes>> | null>(null)
|
|
|
-
|
|
|
-const listReqParamsJson = computed(() => {
|
|
|
- if (!listLastReqParams.value) return '{}'
|
|
|
- return JSON.stringify(listLastReqParams.value, null, 2)
|
|
|
-})
|
|
|
-
|
|
|
-const listApiRawJson = computed(() => {
|
|
|
- if (!listLastApiResponse.value) return '{}'
|
|
|
- return JSON.stringify(listLastApiResponse.value, null, 2)
|
|
|
-})
|
|
|
-
|
|
|
-/** 最近一次列表请求时的 token 各渠道快照(脱敏,用于弹窗诊断) */
|
|
|
-const listLastTokenDiag = ref<AuthTokenChannelSnapshot | null>(null)
|
|
|
-
|
|
|
-const listTokenDiagJson = computed(() => {
|
|
|
- if (!listLastTokenDiag.value) return '{}'
|
|
|
- return JSON.stringify(listLastTokenDiag.value, null, 2)
|
|
|
-})
|
|
|
-
|
|
|
const resetQuestionList = () => {
|
|
|
list.value = []
|
|
|
pageInfo.value.pageNumber = 1
|
|
|
@@ -270,18 +244,14 @@ const questList = async () => {
|
|
|
loading.value = true
|
|
|
try {
|
|
|
const currentPage = pageInfo.value.pageNumber
|
|
|
- listLastTokenDiag.value = getAuthTokenChannelSnapshot()
|
|
|
- const effectiveToken = resolveUserAuthToken()
|
|
|
const reqParams: PageQuestionReportDataReq = {
|
|
|
pageNumber: currentPage,
|
|
|
pageSize: pageInfo.value.pageSize,
|
|
|
- token: effectiveToken,
|
|
|
+ contactPerson: formData.value.contactPerson || '',
|
|
|
}
|
|
|
const res = await pageQuestionReportData(reqParams)
|
|
|
if (requestVersion !== listLoadVersion.value) return
|
|
|
|
|
|
- listLastReqParams.value = reqParams
|
|
|
- listLastApiResponse.value = res
|
|
|
const records = res.data.records || []
|
|
|
|
|
|
list.value = currentPage === 1 ? records : list.value.concat(records)
|
|
|
@@ -410,9 +380,6 @@ watch(active, async (value) => {
|
|
|
</van-tab>
|
|
|
<van-tab title="问题答复">
|
|
|
<view class="tab-container">
|
|
|
- <view class="mb-[8px]">
|
|
|
- <van-button size="small" plain type="primary" @click="showListRawJsonPopup = true">查看接口原始JSON</van-button>
|
|
|
- </view>
|
|
|
<van-list
|
|
|
v-model:loading="loading"
|
|
|
:finished="finished"
|
|
|
@@ -439,27 +406,6 @@ watch(active, async (value) => {
|
|
|
</view>
|
|
|
</view>
|
|
|
</van-list>
|
|
|
- <van-popup
|
|
|
- v-model:show="showListRawJsonPopup"
|
|
|
- round
|
|
|
- position="bottom"
|
|
|
- :style="{ height: '75%' }"
|
|
|
- >
|
|
|
- <view class="json-popup">
|
|
|
- <view class="json-title">请求参数</view>
|
|
|
- <scroll-view scroll-y class="json-scroll json-scroll--small">
|
|
|
- <text class="json-text">{{ listReqParamsJson }}</text>
|
|
|
- </scroll-view>
|
|
|
- <view class="json-title">token 渠道诊断(明文)</view>
|
|
|
- <scroll-view scroll-y class="json-scroll json-scroll--small">
|
|
|
- <text class="json-text">{{ listTokenDiagJson }}</text>
|
|
|
- </scroll-view>
|
|
|
- <view class="json-title">列表接口完整JSON</view>
|
|
|
- <scroll-view scroll-y class="json-scroll">
|
|
|
- <text class="json-text">{{ listApiRawJson }}</text>
|
|
|
- </scroll-view>
|
|
|
- </view>
|
|
|
- </van-popup>
|
|
|
</view>
|
|
|
</van-tab>
|
|
|
</van-tabs>
|
|
|
@@ -525,37 +471,4 @@ watch(active, async (value) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.json-popup {
|
|
|
- height: 100%;
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- padding: 12px;
|
|
|
-}
|
|
|
-
|
|
|
-.json-title {
|
|
|
- font-size: 16px;
|
|
|
- font-weight: 500;
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.json-scroll {
|
|
|
- flex: 1;
|
|
|
- overflow: hidden;
|
|
|
- background: #f7f8fa;
|
|
|
- border-radius: 8px;
|
|
|
- padding: 12px;
|
|
|
-}
|
|
|
-
|
|
|
-.json-scroll--small {
|
|
|
- flex: 0 0 auto;
|
|
|
- max-height: 120px;
|
|
|
- margin-bottom: 10px;
|
|
|
-}
|
|
|
-
|
|
|
-.json-text {
|
|
|
- white-space: pre-wrap;
|
|
|
- word-break: break-all;
|
|
|
- font-size: 13px;
|
|
|
- line-height: 20px;
|
|
|
-}
|
|
|
</style>
|