Przeglądaj źródła

Resolve merge conflicts

linqilong 1 miesiąc temu
rodzic
commit
a35e56d1ff

+ 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
+        }
+    })
+}

+ 26 - 27
src/views/Problem/index.vue

@@ -1,39 +1,38 @@
 <template>
-  <div>
-    problem
-  </div>
+  <van-tabs v-model="active" @click-tab="onClickTab">
+    <van-tab title="问题清单">
+      <ListQuestions></ListQuestions>
+    </van-tab>
+    <van-tab title="问题统计">
+      <!-- <questionstatistics-component></questionstatistics-component> -->
+       <QuestionsTatistics></QuestionsTatistics>
+    </van-tab>
+  </van-tabs>
 </template>
+
 <script setup>
 
-import {onMounted} from "vue";
-import {getRStLLMaxDate} from "@/api/home";
+import { ref } from "vue";
+import ListQuestions from "./listquestions.vue";
+import QuestionsTatistics from "./questionstatistics.vue";
+import { showToast } from 'vant';
+
+
+const active = ref('问题清单');
+const onClickTab = ({ title }) => showToast(title);
 
-onMounted(() => {
-  getRStLLMaxDate().then(res => {
-    console.log(res)
-  })
-})
 </script>
 <style scoped>
-.container {
-  padding: 20px;
-  overflow-y: auto;
+.van-tabs {
+  height: 100%;
 }
 
-.card {
-  background-color: #f9f9f9;
-  border: 1px solid #ddd;
-  border-radius: 5px;
-  padding: 20px;
-  margin-bottom: 20px;
-}
+.van-tabs__content {
+  height: calc(100% - 44px);
+
+  .van-tab__panel {
+    height: 100% !important;
+  }
 
-.btn {
-  display: inline-block;
-  background-color: #007BFF;
-  color: white;
-  padding: 10px 20px;
-  text-decoration: none;
-  border-radius: 5px;
 }
 </style>

+ 52 - 0
src/views/Problem/listquestions.vue

@@ -0,0 +1,52 @@
+<template>
+    <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>
+<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>

+ 5 - 0
src/views/Problem/questionstatistics.vue

@@ -0,0 +1,5 @@
+<template>
+    <div class="content-wrapper">
+        问题统计
+    </div>
+</template>