linqilong 1 місяць тому
батько
коміт
a23fbaf255

+ 2 - 2
src/api/inspect.js

@@ -40,7 +40,7 @@ export function getObjectList(groupId) {
     return request({
         url: '/tac/insp/year/batch/obj/getObjList',
         method: 'POST',
-        data: {"limit":-1,"pageNum":1,"pageSize":10,"groupId":groupId,"inspType":"","mainType":false,"ojbNm":"","persId":userid,"prjType":"","type":""}
+        data: {"limit":-1,"pageNum":1,"pageSize":200,"groupId":groupId,"inspType":"","mainType":false,"ojbNm":"","persId":userid,"prjType":"","type":""}
     })
 }
 
@@ -53,6 +53,6 @@ export function getTacQuestionList(rgstrId) {
     return request({
         url: '/tac/pblm/info/page',
         method: 'POST',
-        data: {"listType":"","pageNum":1,"pageSize":20,"realPageNum":0,"rgstrId":rgstrId}
+        data: {"listType":"","pageNum":1,"pageSize":200,"realPageNum":0,"rgstrId":rgstrId}
     })
 }

+ 1 - 1
src/assets/js/base.js

@@ -1,5 +1,5 @@
 const baseList = [
-    { type: '工程', inspectTypes: ['008'], columns: [{label:'工程名称',key:'name'}, {label:'工程地址', key:''}], icon: 'location', nameColumn: 'name', description: '工程地址:{location}' },
+    { type: '工程', inspectTypes: ['008'], columns: [{label:'工程名称',key:'name'}, {label:'工程地址', key:''}], icon: 'location', nameColumn: 'name', description: '工程地址:{location}', description2: '工程类型:{type}<br/>工程地址:{location}' },
 ];
 
 /**

+ 1 - 1
src/layout/components/BottomNav.vue

@@ -19,7 +19,7 @@ const menuList = [
     { name: '首页', icon: 'wap-home-o', path: '/home' },
     { name: '一张图', icon: 'location-o', path: '/map' },
     { name: appStore.ownApp === "1" ? '督查': '稽查', icon: 'completed-o', path: '/inspect' },
-    { name: '问题', icon: 'orders-o', path: '/question' },
+    { name: '问题', icon: 'orders-o', path: '/problem' },
     { name: '我的', icon: 'user-o', path: '/about' },
 ]
 

+ 10 - 5
src/router/index.js

@@ -34,14 +34,19 @@ const routes = [
                 component: () => import('@/views/Inspect/Object/index.vue'),
             },
             {
-                path: 'inspect/:id/object/:objId/questions',
+                path: 'inspect/:id/object/:objId/problems',
                 name: 'inspectObjectQuestions',
-                component: () => import('@/views/Inspect/Object/Question/index.vue'),
+                component: () => import('@/views/Inspect/Object/Problem/index.vue'),
             },
             {
-                path: 'question',
-                name: 'question',
-                component: () => import('@/views/Question/index.vue'),
+                path: 'problem',
+                name: 'problem',
+                component: () => import('@/views/Problem/index.vue'),
+            },
+            {
+                path: 'problem/:id',
+                name: 'problemDetail',
+                component: () => import('@/views/Problem/detail/index.vue'),
             },
             {
                 path: 'about',

+ 4 - 5
src/stores/user.js

@@ -5,12 +5,11 @@ import { loginWithMessage, logout } from '@/api/login'
 import { useAppStore } from '@/stores/app'
 
 export const useUserStore = defineStore('user', () => {
-  const userId = ref(null)
-  const nickname = ref('')
-  const orgName = ref('')
+  const userId = ref(localStorage.getItem('userid'))
+  const nickname = ref(localStorage.getItem('account'))
+  const orgName = ref(localStorage.getItem('orgNm'))
   const avatar = ref('')
-  const roles = ref([])
-  const permissions = ref([])
+  const roles = ref(localStorage.getItem('allNode'))
 
   const token = ref(getToken())
 

+ 68 - 0
src/views/Inspect/Object/Problem/index.vue

@@ -0,0 +1,68 @@
+<template>
+  <div style="height: 100%;">
+    <card01 :title="object.ojbNm + ''" icon="label" :description="renderData(object, objectConfig.description2)" />
+    <van-collapse class="pblm-list-wrapper" v-model="activeNames">
+      <van-collapse-item v-for="item in list" :key="item.id" :name="item.id">
+        <template #title>
+          <div>{{ item.name }}&nbsp;&nbsp;<van-tag v-if="item.pblmList && item.pblmList.length > 0" round type="primary">{{item.pblmList.length}}</van-tag></div>
+        </template>
+        <card01 v-for="pblm in item.pblmList" :key="pblm.pblmId" :title="pblm.pblmNm" icon="question"
+        @click="jumpPage(`/problem/${item.pblmId}`)" />
+      </van-collapse-item>
+    </van-collapse>
+  </div>
+</template>
+<script setup>
+import { onMounted, ref } from "vue";
+import { useRoute } from "vue-router";
+import card01 from '@/components/card01.vue';
+import { getTacQuestionList } from "@/api/inspect";
+import { getBaseByInspectType } from "@/assets/js/base";
+import { renderData } from "@/utils/template";
+import { jumpPage } from "@/utils/page";
+
+const route = useRoute();
+const activeNames = ref(['1']);
+const list = ref([
+  { id: '1', name: '前期与设计专业', pblmList:[] },
+  { id: '2', name: '建设管理专业', pblmList:[] },
+  { id: '3', name: '计划下达与执行专业', pblmList:[] },
+  { id: '4', name: '资金使用与管理专业', pblmList:[] },
+  { id: '5', name: '工程质量专业', pblmList:[] },
+  { id: '6', name: '工程安全专业', pblmList:[] }
+]);
+const loading = ref(false);
+const inspectType = route.query.inspectType;
+const object = ref(JSON.parse(route.query.object));
+const objectConfig = ref(getBaseByInspectType(inspectType));
+
+function getData() {
+  getTacQuestionList(route.params.objId).then(res => {
+    list.value.forEach(item => {
+      item.pblmList = res.data.list.filter(pblm => pblm.listType === item.id);
+    })
+    loading.value = false;
+  })
+}
+
+onMounted(() => {
+  getData();
+})
+</script>
+<style lang="scss" scoped>
+.inspect-object-wrapper {
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+}
+</style>
+<style lang="scss">
+.pblm-list-wrapper{
+  padding: 0 10px;
+  .van-collapse-item__content{
+  padding: 0;
+  background-color: transparent;
+}
+}
+
+</style>

+ 0 - 43
src/views/Inspect/Object/Question/index.vue

@@ -1,43 +0,0 @@
-<template>
-  <div style="height: 100%;">
-    <van-pull-refresh class="inspect-object-question-wrapper" v-model="loading" @refresh="getData()">
-      <card01 v-for="item in list" :key="item" :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 { onMounted, ref } from "vue";
-import { useRoute } from "vue-router";
-import card01 from '@/components/card01.vue';
-import { getTacQuestionList } from "@/api/inspect";
-import { getBaseByInspectType } from "@/assets/js/base";
-import { renderData } from "@/utils/template";
-import { jumpPage } from "@/utils/page";
-
-const route = useRoute();
-const list = ref([]);
-const loading = ref(false);
-const inspectType = route.query.inspectType;
-const objectConfig = ref(getBaseByInspectType(inspectType));
-
-function getData() {
-  getTacQuestionList(route.params.objId).then(res => {
-    list.value = res.data;
-    loading.value = false;
-  })
-}
-
-
-onMounted(() => {
-  getData();
-})
-</script>
-<style lang="scss" scoped>
-.inspect-object-wrapper {
-  width: 100%;
-  height: 100%;
-  overflow: auto;
-}
-</style>

+ 1 - 1
src/views/Inspect/Object/index.vue

@@ -3,7 +3,7 @@
     <van-pull-refresh class="inspect-object-wrapper" v-model="loading" @refresh="getData()">
       <card01 v-for="item in list" :key="item" :title="item.ojbNm + ''" icon="notes"
         :description="renderData(item, objectConfig.description)"
-        @click="jumpPage(`/inspect/${item.groupId}/object/${item.id}/questions`)" />
+        @click="jumpPage(`/inspect/${item.groupId}/object/${item.id}/problems`, { inspectType, object: JSON.stringify(item) })" />
     </van-pull-refresh>
   </div>
 </template>

+ 2 - 2
src/views/Inspect/history.vue

@@ -44,11 +44,11 @@ function getInspBase(value, level = 1) {
             return;
         }
         if (level === 2) {
-            twoBatchs.value = res.data.map(item => ({ text: item.prsnTitle, value: item.plnaId })).reverse();
+            twoBatchs.value = res.data.map(item => ({ text: item.prsnTitle, value: item.plnaId }))
             twoBatch.value = twoBatchs.value[0].value;
             return;
         }
-        baseBatchs.value = res.data.map(item => ({ text: item.prsnTitle, value: item.plnaId }));
+        baseBatchs.value = res.data.map(item => ({ text: item.prsnTitle, value: item.plnaId })).reverse();
         baseBatch.value = baseBatchs.value[0].value;
     });
 }

+ 5 - 0
src/views/Problem/detail/index.vue

@@ -0,0 +1,5 @@
+<template>
+    
+</template>
+<script setup>
+</script>

+ 1 - 1
src/views/Question/index.vue → src/views/Problem/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    question
+    problem
   </div>
 </template>
 <script setup>