linqilong hace 1 mes
padre
commit
4e3677dbd7

+ 1 - 1
jsconfig.json

@@ -2,7 +2,7 @@
   "compilerOptions": {
     "target": "es5",
     "module": "esnext",
-    "baseUrl": "./",
+    "baseUrl": ".",
     "moduleResolution": "node",
     "paths": {
       "@/*": [

+ 25 - 0
src/api/inspect.js

@@ -0,0 +1,25 @@
+import request from "@/utils/request";
+
+/**
+ * 获取当前督察组
+ * @param {*} pid 督察类型
+ */
+export function getCurrGroup(pid) {
+    return request({
+        url: '/dc/insp/base/getCurrGroup',
+        method: 'GET',
+        params: { pid }
+    })
+}
+
+/**
+ * 获取历史稽察年份数据
+ * @param {*} pid 督察类型
+ */
+export function getCurrGroup(pid) {
+    return request({
+        url: '/dc/insp/base/getByPersid',
+        method: 'GET',
+        params: { pid, ownApp,  }
+    })
+}

+ 0 - 58
src/components/HelloWorld.vue

@@ -1,58 +0,0 @@
-<template>
-  <div class="hello">
-    <h1>{{ msg }}</h1>
-    <p>
-      For a guide and recipes on how to configure / customize this project,<br>
-      check out the
-      <a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
-    </p>
-    <h3>Installed CLI Plugins</h3>
-    <ul>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
-      <li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
-    </ul>
-    <h3>Essential Links</h3>
-    <ul>
-      <li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
-      <li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
-      <li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
-      <li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
-      <li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
-    </ul>
-    <h3>Ecosystem</h3>
-    <ul>
-      <li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
-      <li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
-      <li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
-      <li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
-      <li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
-    </ul>
-  </div>
-</template>
-
-<script>
-export default {
-  name: 'HelloWorld',
-  props: {
-    msg: String
-  }
-}
-</script>
-
-<!-- Add "scoped" attribute to limit CSS to this component only -->
-<style scoped>
-h3 {
-  margin: 40px 0 0;
-}
-ul {
-  list-style-type: none;
-  padding: 0;
-}
-li {
-  display: inline-block;
-  margin: 0 10px;
-}
-a {
-  color: #42b983;
-}
-</style>

+ 56 - 0
src/components/card01.vue

@@ -0,0 +1,56 @@
+<template>
+    <div class="card-01-wrapper">
+        <div class="card-01-header">
+            <van-icon style="margin-right: 5px;" :name="props.icon" color="#1989fa" size="1.3rem" />
+            <span>{{ props.title }}</span>
+        </div>
+        <div v-if="props.description" class="card-01-description" v-html="props.description"></div>
+    </div>
+</template>
+<script setup>
+import { ref } from 'vue';
+
+const props = defineProps({
+    icon: {
+        type: String,
+        default: ''
+    },
+    title: {
+        type: String,
+        default: ''
+    },
+    description: {
+        type: String,
+        default: ''
+    }
+})
+
+</script>
+<style lang="scss" scoped>
+.card-01-wrapper {
+    background-color: #fff;
+    border-radius: 10px;
+    padding: 10px;
+    margin: 10px;
+
+    .card-01-header {
+        display: flex;
+        flex-direction: row;
+        align-items: center;
+
+        span {
+            font-size: 1rem;
+            color: #303133;
+            font-weight: bold;
+        }
+
+    }
+
+    .card-01-description {
+        font-size: 0.9rem;
+        color:#A8ABB2;
+        margin-top: 10px;
+    }
+
+}
+</style>

+ 29 - 0
src/components/list01.vue

@@ -0,0 +1,29 @@
+<template>
+    <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
+        <card01 v-for="item in list" :key="item" :title="item + ''" icon="notes" :description="item + ''" />
+    </van-list>
+</template>
+<script setup>
+import { ref, defineProps } from 'vue';
+import card01 from './card01.vue';
+import { getCurrGroup } from '@/api/inspect.js';
+
+const props = defineProps({
+    type: {
+        type: String,
+    },
+})
+
+
+const list = ref([]);
+const loading = ref(false);
+const finished = ref(false);
+
+const onLoad = () => {
+    getCurrGroup(props.type).then(res => {
+        list.value = res.data;
+        loading.value = false;
+        finished.value = true;
+    })
+};
+</script>

+ 6 - 5
src/layout/components/BottomNav.vue

@@ -2,7 +2,8 @@
     <div class="bottom-nav">
         <a v-for="item in menuList" :key="item.path" :class="{ 'active': activeIndex === item.path }"
             @click.prevent="setActiveIndex(item.path)">
-            <van-icon style="margin-bottom: 5px;" :name="item.icon" :color="activeIndex === item.path ? '#007BFF' : '#fff'" size="1.3rem" />
+            <van-icon style="margin-bottom: 5px;" :name="item.icon"
+                :color="activeIndex === item.path ? '#007BFF' : '#fff'" size="1.3rem" />
             {{ item.name }}
         </a>
     </div>
@@ -10,8 +11,7 @@
 
 <script setup>
 import { ref } from 'vue';
-import { useRouter } from 'vue-router';
-// import { homeOutline, navigateCircleOutline, shieldCheckmarkOutline, helpCircleOutline, personCircleOutline } from 'ionicons/icons';
+import { useRouter, useRoute } from 'vue-router';
 
 const menuList = [
     { name: '首页', icon: 'wap-home-o', path: '/home' },
@@ -21,9 +21,10 @@ const menuList = [
     { name: '我的', icon: 'user-o', path: '/about' },
 ]
 
-// 定义当前激活的导航索引
-const activeIndex = ref('/home');
+const route = useRoute();
 const router = useRouter();
+// 定义当前激活的导航索引
+const activeIndex = ref(route.path);
 
 // 定义设置激活索引的方法
 const setActiveIndex = (path) => {

+ 0 - 27
src/layout/components/Navbar.vue

@@ -1,27 +0,0 @@
-<template>
-  <header>
-    <span>{{ route.meta.title || '福建水利监管工作平台' }}</span>
-  </header>
-</template>
-<script setup>
-import { onMounted, onUnmounted } from 'vue'
-import { useRoute } from "vue-router";
-const route = useRoute()
-
-
-onMounted(() => {
-})
-onUnmounted(() => {
-})
-
-</script>
-<style lang="scss" scoped>
-/* 头部样式 */
-header {
-  background-color: #007BFF;
-  color: white;
-  text-align: center;
-  padding: 8px 0;
-  font-size: 1.2rem;
-}
-</style>

+ 0 - 1
src/layout/components/index.js

@@ -1,3 +1,2 @@
 export {default as AppMain} from './AppMain.vue'
-export {default as Navbar} from './Navbar.vue'
 export {default as BottomNav} from './BottomNav.vue'

+ 9 - 3
src/layout/index.vue

@@ -1,7 +1,6 @@
 <template>
   <div :style="{ '--current-color': theme }" class="app-wrapper">
-    <!-- 顶部 -->
-    <navbar />
+    <van-nav-bar :title="route.meta.title || '福建水利监管工作平台'" />
     <!-- 展示页 -->
     <app-main />
     <!-- 底部 -->
@@ -10,7 +9,9 @@
 </template>
 <script setup>
 import { ref } from 'vue';
-import { AppMain, Navbar, BottomNav } from '@/layout/components/index.js'
+import { AppMain, BottomNav } from '@/layout/components/index.js'
+import { useRoute } from "vue-router";
+const route = useRoute()
 
 const theme = ref(localStorage.getItem('theme'))
 
@@ -33,3 +34,8 @@ const theme = ref(localStorage.getItem('theme'))
 
 }
 </style>
+<style>
+.app-wrapper .van-nav-bar__content {
+  background-color: #007BFF;
+}
+</style>

+ 2 - 1
src/utils/auth.js

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

+ 13 - 10
src/utils/request.js

@@ -1,9 +1,14 @@
 import axios from "axios";
-import {getToken} from "@/utils/auth";
-import {getErrorMessage} from "@/utils/errorCode";
-import {validURL} from "@/utils/validate";
+import { getToken } from "@/utils/auth";
+import { getErrorMessage } from "@/utils/errorCode";
+import { validURL } from "@/utils/validate";
 
 axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8";
+
+let userid = localStorage.getItem('userid') ? localStorage.getItem('userid') : ''
+let orgId = localStorage.getItem('currentOrgId') ? localStorage.getItem('currentOrgId') : ''
+let accessToken = localStorage.getItem('accessToken') ? localStorage.getItem('accessToken') : ''
+
 // 创建axios实例
 const service = axios.create({
     // axios中请求配置有baseURL选项,表示请求URL公共部分
@@ -14,17 +19,15 @@ const service = axios.create({
 // request拦截器
 service.interceptors.request.use(
     (config) => {
-        if (
-            !config.url.startsWith("/tbazmw_api") &&
-            !config.url.startsWith("/gx_api") &&
-            !validURL(config.url)
-        ) {
+        if (!config.url.startsWith("/tbazmw_api") && !validURL(config.url)) {
             config.url = process.env.VUE_APP_BASE_API + config.url;
         }
         // 是否需要设置 token
         const isToken = (config.headers || {}).isToken === false;
         if (getToken() && !isToken) {
-            config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
+            config.headers["Orgid"] = '034'
+            config.headers["Persid"] = '414244bd0324447ba1b640b3ffa6fb8e'
+            config.headers["Accesstoken"] = getToken(); // 让每个请求携带自定义token
         }
         // get请求映射params参数
         if (config.method === "get" && config.params) {
@@ -78,7 +81,7 @@ service.interceptors.response.use(
         }
     },
     (error) => {
-        let {message} = error;
+        let { message } = error;
         if (message === "Network Error") {
             message = "后端接口连接异常";
         } else if (message.includes("timeout")) {

+ 0 - 5
src/views/Inspect/current.vue

@@ -2,11 +2,6 @@
 
 </template>
 <script setup>
-
 import { onMounted } from "vue";
-import { getRStLLMaxDate } from "@/api/home";
-
-onMounted(() => {
-})
 </script>
 <style lang="scss" scoped></style>

+ 75 - 34
src/views/Inspect/index.vue

@@ -1,58 +1,99 @@
 <template>
-  <!-- <ion-segment>
-    <ion-segment-button value="first" content-id="first">
-      <ion-label>当前</ion-label>
-    </ion-segment-button>
-    <ion-segment-button value="second" content-id="second">
-      <ion-label>历史</ion-label>
-    </ion-segment-button>
-  </ion-segment>
-  <ion-segment-view class="inspect-segment">
-    <ion-segment-content id="first">
+  <van-tabs v-model="active" @click-tab="onClickTab">
+    <van-tab title="当前">
+      <div class="content-wrapper">
+        <div class="filter-wrapper">
+          <div class="filter-item">
+            <div class="filter-btn" @click="showPicker = true"> 
+              {{ getTypeName(fieldValue) }}
+              <van-icon name="arrow-down" color="#ebecf0" size="1rem" />
+            </div>
+          </div>
+        </div>
+        <van-popup v-model:show="showPicker" round position="bottom">
+          <van-picker :columns="columns" @cancel="showPicker = false" @confirm="onConfirm" />
+        </van-popup>
+        <list01 class="ducha-group-wrapper" :type="fieldValue"></list01>
+      </div>
+
+    </van-tab>
+    <van-tab title="历史">
       <current-component></current-component>
-    </ion-segment-content>
-    <ion-segment-content id="second">
-      lishi
-    </ion-segment-content>
-  </ion-segment-view> -->
-  <div class="filter-wrapper">
-      <ion-select class="filter-item" aria-label="类型" value="当前">
-        <ion-select-option value="当前">当前</ion-select-option>
-        <ion-select-option value="历史">历史</ion-select-option>
-      </ion-select>
-      <ion-select class="filter-item" aria-label="督察类型" value="稽查工作">
-        <ion-select-option value="稽查工作">稽查工作</ion-select-option>
-      </ion-select>
-  </div>
+    </van-tab>
+  </van-tabs>
 </template>
 <script setup>
-import { onMounted } from "vue";
+import { onMounted, ref } from "vue";
 import CurrentComponent from "./current.vue";
-import { getRStLLMaxDate } from "@/api/home";
+import List01 from "@/components/list01.vue";
+import { showToast } from 'vant';
+
+const columns = [
+  { text: '稽查工作', value: '008' },
+];
+const fieldValue = ref('008');
+const showPicker = ref(false);
+
+const onConfirm = ({ selectedOptions }) => {
+  showPicker.value = false;
+  fieldValue.value = selectedOptions[0].text;
+};
+
+const active = ref('当前');
+const onClickTab = ({ title }) => showToast(title);
+
+function getTypeName(code) {
+  if (!code) return '';
+  return columns.find(item => item.value === code)?.text;
+}
 
 onMounted(() => {
-  getRStLLMaxDate().then(res => {
-    console.log(res)
-  })
 })
 </script>
 <style lang="scss" scoped>
+.content-wrapper {
+  padding-top: 8px;
+  height: 100%;
+  overflow: auto;
+
+  .ducha-group-wrapper {
+    height: calc(100% - 35px);
+    overflow: auto;
+  }
+
+}
+
 .filter-wrapper {
   display: flex;
   flex-direction: row;
   align-items: center;
-  background-color: #fff;
-  border-radius: 10px;
-  margin: 5px;
+  margin: 0 8px 8px 8px;
 
   .filter-item {
     width: auto;
     padding: 0 10px;
+    background-color: #fff;
+    border-radius: 10px;
+
+    .filter-btn {
+      padding: 3px 1px;
+    }
+
   }
 
 }
 
-ion-segment-view.inspect-segment {
-  height: calc(100% - 48px);
+.van-tabs {
+  height: 100%;
+}
+</style>
+<style lang="scss">
+.van-tabs__content {
+  height: calc(100% - 44px);
+
+  .van-tab__panel {
+    height: 100% !important;
+  }
+
 }
 </style>

+ 3 - 4
vue.config.js

@@ -1,5 +1,4 @@
 const { defineConfig } = require('@vue/cli-service')
-const { VantResolver } = require('@vant/auto-import-resolver');
 
 const port = process.env.port || process.env.npm_config_port || 80; // 端口
 
@@ -27,9 +26,9 @@ module.exports = defineConfig({
             '/pdcApi': {
                 target: 'https://27.156.118.74:19901', // 你的后端服务器地址
                 changeOrigin: true, // 需要虚拟托管站点
-                pathRewrite: {
-                    '^/pdcApi': '' // 移除路径中的/api前缀
-                }
+                // pathRewrite: {
+                //     '^/pdcApi': '' // 移除路径中的/api前缀
+                // }
             }
         }
     },