Ver Fonte

Merge branch 'main' of http://39.98.38.2:13000/Hjl/fjjgpt

hjianglong há 1 mês atrás
pai
commit
b411c42414
3 ficheiros alterados com 86 adições e 5 exclusões
  1. 20 0
      src/api/questions.js
  2. 16 2
      src/views/Question/index.vue
  3. 50 3
      src/views/Question/listquestions.vue

+ 20 - 0
src/api/questions.js

@@ -0,0 +1,20 @@
+import request from "@/utils/request";
+
+/**
+ * 获取问题清单
+ */
+export function getTacQuestionList() {
+    return request({
+        url: '/tac/pblm/info/pageNew',
+        method: 'POST',
+        data: {"count":"false",
+            "orderBy":"INTM",
+            "pageNum":1,
+            "pageSize":20,
+            "pblmQlttvCd":0,
+            "persId":"414244bd0324447ba1b640b3ffa6fb8e",
+            "sn":0,
+            "year":0
+        }
+    })
+}

+ 16 - 2
src/views/Question/index.vue

@@ -1,13 +1,15 @@
 <template>
   <van-tabs v-model="active" @click-tab="onClickTab">
     <van-tab title="问题清单">
-      <listquestions-component></listquestions-component>
+      <ListQuestions></ListQuestions>
     </van-tab>
     <van-tab title="问题统计">
-      <questionstatistics-component></questionstatistics-component>
+      <!-- <questionstatistics-component></questionstatistics-component> -->
+       <QuestionsTatistics></QuestionsTatistics>
     </van-tab>
   </van-tabs>
 </template>
+
 <script setup>
 
 import { ref } from "vue";
@@ -46,4 +48,16 @@ const onClickTab = ({ title }) => showToast(title);
   text-decoration: none;
   border-radius: 5px;
 } */
+.van-tabs {
+  height: 100%;
+}
+
+.van-tabs__content {
+  height: calc(100% - 44px);
+
+  .van-tab__panel {
+    height: 100% !important;
+  }
+
+}
 </style>

+ 50 - 3
src/views/Question/listquestions.vue

@@ -1,5 +1,52 @@
 <template>
-    <div class="content-wrapper">
-        问题清单
+    <div style="height: 100%;">
+        <van-pull-refresh class="inspect-object-question-wrapper" v-model="loading" @refresh="getData()">
+            <!-- 使用 v-for 指令遍历 list 数组 -->
+            <card01 v-for="item in list" :key="item.id" :title="item.ojbNm + ''" icon="notes"
+                    :description="renderData(item, objectConfig.description)"
+                    @click="jumpPage(`/inspect/${item.plnaId}/object/${item.id}/question/`)" />
+        </van-pull-refresh>
     </div>
-</template>
+</template>
+<script setup>
+
+import { renderData } from "@/utils/template";
+import { jumpPage } from "@/utils/page";
+import { getTacQuestionList } from "@/api/questions";
+import { onMounted, ref } from "vue";
+
+// 使用 ref 定义响应式变量 list 和 loading
+const list = ref([]);
+const loading = ref(false);
+
+// 定义 objectConfig 变量
+const objectConfig = ref({
+    description: '这里是默认描述信息' // 你可以根据实际情况修改默认描述内容
+});
+
+// 定义 getData 函数,用于获取数据
+function getData() {
+    // 设置 loading 为 true,表示正在加载数据
+    loading.value = true;
+    // 调用 getTacQuestionList 接口获取数据
+    getTacQuestionList().then(res => {
+        // 将接口返回的数据赋值给 list
+        list.value = res.data;
+        // 设置 loading 为 false,表示数据加载完成
+        loading.value = false;
+    })
+}
+
+// 在组件挂载后调用 getData 函数获取数据
+onMounted(() => {
+    getData();
+})
+</script>
+
+<style lang="scss" scoped>
+.inspect-object-wrapper {
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+}
+</style>