linqilong 1 tháng trước cách đây
mục cha
commit
d324851d68

+ 27 - 1
src/api/inspect.js

@@ -29,4 +29,30 @@ export function getInspBaseByPersid(pid) {
         method: 'GET',
         params: { pid, ownApp, userid, tabType: 0 }
     })
-}
+}
+
+/**
+ * 稽察获取分组下的任务
+ * @param {分组ID} groupId 
+ */
+export function getObjectList(groupId) {
+    const userid = userStore.userId
+    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":""}
+    })
+}
+
+/**
+ * 稽察获取问题列表
+ * @param {任务ID} rgstrId
+ * @param {问题类型} listType(1 前期与设计专业;2 建设管理专业;3 计划下达与执行专业;4 资金使用与管理专业;5 工程质量专业;6 工程安全专业)
+ */
+export function getTacQuestionList(rgstrId) {
+    return request({
+        url: '/tac/pblm/info/page',
+        method: 'POST',
+        data: {"listType":"","pageNum":1,"pageSize":20,"realPageNum":0,"rgstrId":rgstrId}
+    })
+}

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

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

+ 4 - 1
src/components/card01.vue

@@ -8,7 +8,7 @@
     </div>
 </template>
 <script setup>
-import { ref } from 'vue';
+import { defineProps } from 'vue';
 
 const props = defineProps({
     icon: {
@@ -52,5 +52,8 @@ const props = defineProps({
         margin-top: 10px;
     }
 
+    &:last-child {
+        margin-bottom: 20px;
+    }
 }
 </style>

+ 2 - 3
src/layout/index.vue

@@ -24,11 +24,10 @@ const theme = ref(localStorage.getItem('theme'))
 
   .app-main {
     position: absolute;
-    top: 41px;
+    top: 46px;
     left: 0;
     width: 100%;
-    height: calc(100% - 100px);
-    overflow: auto;
+    height: calc(100% - 102.8px);
     background-color: #ebecf0;
   }
 

+ 6 - 1
src/main.js

@@ -1,5 +1,6 @@
 import { createApp } from 'vue';
 import {createPinia} from 'pinia';
+import VueCookies from 'vue3-cookies'
 import Vant from 'vant';
 import App from './App.vue';
 import router from './router';
@@ -7,8 +8,12 @@ import router from './router';
 import 'vant/lib/index.css';
 import '@/assets/styles/index.scss';
 
-const app = createApp(App).use(Vant).use(createPinia()).use(router);
+const app = createApp(App);
 
+app.use(createPinia());
+app.use(router);
+app.use(VueCookies);
+app.use(Vant);
 // Lazyload 指令需要单独进行注册
 app.use(Vant.Lazyload);
 

+ 10 - 0
src/router/index.js

@@ -23,6 +23,16 @@ const routes = [
                 name: 'inspect',
                 component: () => import('@/views/Inspect/index.vue'),
             },
+            {
+                path: 'inspect/:id/objects',
+                name: 'inspectObjects',
+                component: () => import('@/views/Inspect/Object/index.vue'),
+            },
+            {
+                path: 'inspect/:id/object/:objId/questions',
+                name: 'inspectObjectQuestions',
+                component: () => import('@/views/Inspect/Object/Question/index.vue'),
+            },
             {
                 path: 'question',
                 name: 'question',

+ 1 - 1
src/utils/auth.js

@@ -5,7 +5,7 @@ const TokenKey = 'Admin-Token'
 
 export function getToken() {
   // return cookies.get(TokenKey)
-  return '80938cd324e84b758042a18907777572'
+  return 'a29319df503e4b39b391092692cd9868'
 }
 
 export function setToken(token) {

+ 22 - 0
src/utils/page.js

@@ -0,0 +1,22 @@
+import router from '@/router/index';
+
+/**
+ * 跳转页面
+ * @param path    路由地址
+ * @param query   参数
+ * @param isBlank 是否新页面打开
+ */
+export function jumpPage(path, query = null, isBlank = false) {
+  if (path) {
+    if (!isBlank) {
+      router.push({path, query})
+    } else {
+      if (path.indexOf('http') !== -1) {
+        window.open(path, '_blank')
+      } else {
+        let routeUrl = router.resolve({path, query})
+        window.open(routeUrl.href, '_blank')
+      }
+    }
+  }
+}

+ 28 - 0
src/utils/template.js

@@ -0,0 +1,28 @@
+/**
+ * 模板转换
+ * @param {数据} object 
+ * @param {模板} template 
+ * @returns 
+ */
+export function renderData(object, template) {
+    // 正则表达式用于匹配{key}格式的占位符
+    const placeholderReg = /\{(\w+)\}/g;
+
+    // 判断模板是否包含占位符
+    const hasPlaceholders = placeholderReg.test(template);
+    // 重置正则表达式状态(避免test影响后续exec)
+    placeholderReg.lastIndex = 0;
+
+    // 无占位符直接返回原模板
+    if (!hasPlaceholders) {
+        return template
+    }
+
+    // 替换模板中的占位符
+    const description = template.replace(placeholderReg, (match, key) => {
+        // 从数据中提取对应字段的值,不存在时返回空字符串
+        return object[key] || '';
+    });
+
+    return description
+}

+ 7 - 37
src/views/HomeView.vue

@@ -1,43 +1,13 @@
 <template>
-  <div class="container">
-    <!-- 卡片内容 -->
-    <div class="card">
-      <h2>监管工作平台</h2>
-      <p>这是一个简单监管工作平台。</p>
-      <a class="btn" href="#">了解更多</a>
-    </div>
-    <div class="card">
-      <h2>稽查填报</h2>
-      <ul>
-        <li>稽查填报</li>
-        <li>稽查填报</li>
-        <li>稽查填报</li>
-      </ul>
-      <a class="btn" href="#">查看详情</a>
-    </div>
-    <div class="card">
-      <h2>安标评审</h2>
-      <ul>
-        <li>安标评审</li>
-        <li>安标评审</li>
-        <li>安标评审</li>
-      </ul>
-      <a class="btn" href="#">查看详情</a>
-    </div>
-  </div>
+<iframe class="home-wrapper" src="https://27.156.118.74:19901/statistics/index.html?type=1" ></iframe>
 </template>
-<script setup>
-
-import {onMounted} from "vue";
-import {getRStLLMaxDate} from "@/api/home";
+<style lang="scss" scoped>
+.home-wrapper {
+  width: 100%;
+  height: 100%;
+  border: none; 
+}
 
-onMounted(() => {
-  getRStLLMaxDate().then(res => {
-    console.log(res)
-  })
-})
-</script>
-<style scoped>
 .container {
   padding: 20px;
   overflow-y: auto;

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

@@ -0,0 +1,44 @@
+<template>
+  <div style="height: 100%;">
+    <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.plnaId}/object/${item.id}/questions`)" />
+    </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>

+ 44 - 0
src/views/Inspect/Object/index.vue

@@ -0,0 +1,44 @@
+<template>
+  <div style="height: 100%;">
+    <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`)" />
+    </van-pull-refresh>
+  </div>
+</template>
+<script setup>
+import { onMounted, ref } from "vue";
+import { useRoute } from "vue-router";
+import card01 from '@/components/card01.vue';
+import { getObjectList } 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() {
+  getObjectList(route.params.id).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>

+ 3 - 1
src/views/Inspect/current.vue

@@ -5,7 +5,8 @@
         </div>
         <van-pull-refresh class="inspect-group-wrapper" v-model="loading" @refresh="onLoad()">
             <card01 v-for="item in list" :key="item" :title="item.prsnTitle + ''" icon="notes"
-                :description="`时间:${item.sttm} 至 ${item.entm}`" @click="emits('onClick', item.prsnId)" />
+                :description="`时间:${item.sttm} 至 ${item.entm}`"
+                @click="jumpPage(`/inspect/${item.plnaId}/objects`, { inspectType })" />
         </van-pull-refresh>
     </div>
 </template>
@@ -14,6 +15,7 @@ import { ref, defineEmits, watch } from "vue";
 import GwSelect from "@/components/GwSelect.vue";
 import card01 from '@/components/card01.vue';
 import { getCurrGroup } from '@/api/inspect.js';
+import { jumpPage } from "@/utils/page";
 
 const emits = defineEmits(['onClick']);
 

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

@@ -7,7 +7,7 @@
         </div>
         <van-pull-refresh class="inspect-group-wrapper" v-model="loading" @refresh="getInspBase(twoBatch, 3)">
             <card01 v-for="item in list" :key="item" :title="item.prsnTitle + ''" icon="notes"
-                :description="`时间:${item.sttm} 至 ${item.entm}`" @click="emits('onClick', item.prsnId)" />
+                :description="`时间:${item.sttm} 至 ${item.entm}`" @click="jumpPage(`/inspect/${item.plnaId}/objects`, { inspectType  })" />
         </van-pull-refresh>
     </div>
 </template>
@@ -16,6 +16,7 @@ import { ref, watch, defineEmits } from "vue";
 import GwSelect from "@/components/GwSelect.vue";
 import card01 from '@/components/card01.vue';
 import { getInspBaseByPersid } from "@/api/inspect";
+import { jumpPage } from "@/utils/page";
 
 const emits = defineEmits(['onClick']);