Merge remote-tracking branch 'origin/main'

# Conflicts:
#	collect_information/src/pages/policeManager/index/index.vue
This commit is contained in:
wangyilin 2024-09-13 09:40:45 +08:00
commit 795f1238af
5 changed files with 184 additions and 77 deletions

View File

@ -1,43 +1,85 @@
<template> <template>
<view> <view>
<view class="content"> <view class="swiper-demo">
<div @tap="routerPush(1)" class="grid-item"> <nut-swiper ref="swiperRef" pagination-visible pagination-color="#e53e31" :auto-play="3000" :init-page="0">
<image class="grid-item-image"></image> <nut-swiper-item v-for="(item, index) in list" :key="index" style="height: 150px">
<view class="grid-item-text">企事业单位</view> <img :src="item" alt="" style="height: 100%; width: 100%" draggable="false"/>
</div> </nut-swiper-item>
<div class="grid-item"> </nut-swiper>
<image class="grid-item-image"></image> </view>
<view class="grid-item-text">监督考核</view> <view class="margin-top">
</div> <nut-grid :column-num="3">
<div class="grid-item"> <nut-grid-item
<image class="grid-item-image"></image> text="企事业单位"
<view class="grid-item-text">警保风采</view> @click="Taro.navigateTo({url: '/subPages/pages/policeManager/index'})">
</div> </nut-grid-item>
<div class="grid-item"> <nut-grid-item
<image class="grid-item-image"></image> text="警保风采"
<view class="grid-item-text">三色预警</view> @click="Taro.navigateTo({url: '/pages/index/dataEntry/personnelInformationEntry/personnelInformationEntry'})">
</div> </nut-grid-item>
<nut-grid-item text=".....">
</nut-grid-item>
</nut-grid>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import './index.scss'
import {ref} from 'vue'
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
const routerPush = (path) => { const list = ref([
switch (path) { 'https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg',
case 1: 'https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg',
Taro.navigateTo({ 'https://storage.360buyimg.com/jdc-article/welcomenutui.jpg',
url: '/subPages/pages/policeManager/index', 'https://storage.360buyimg.com/jdc-article/fristfabu.jpg'
}) ])
} const swiperRef = ref()
}
import './index.scss'
</script> </script>
<style scoped lang="scss"> <!--<template>-->
<!-- <view>-->
<!-- <view class="content">-->
<!-- <div @tap="routerPush(1)" class="grid-item">-->
<!-- <image class="grid-item-image"></image>-->
<!-- <view class="grid-item-text">企事业单位</view>-->
<!-- </div>-->
<!-- <div class="grid-item">-->
<!-- <image class="grid-item-image"></image>-->
<!-- <view class="grid-item-text">监督考核</view>-->
<!-- </div>-->
<!-- <div class="grid-item">-->
<!-- <image class="grid-item-image"></image>-->
<!-- <view class="grid-item-text">警保风采</view>-->
<!-- </div>-->
<!-- <div class="grid-item">-->
<!-- <image class="grid-item-image"></image>-->
<!-- <view class="grid-item-text">三色预警</view>-->
<!-- </div>-->
<!-- </view>-->
</style> <!-- </view>-->
<!--</template>-->
<!--<script setup lang="ts">-->
<!--import Taro from "@tarojs/taro";-->
<!--const routerPush = (path) => {-->
<!-- switch (path) {-->
<!-- case 1:-->
<!-- Taro.navigateTo({-->
<!-- url: '/subPages/pages/policeManager/index',-->
<!-- })-->
<!-- }-->
<!--}-->
<!--import './index.scss'-->
<!--</script>-->
<!--<style scoped lang="scss">-->
<!--</style>-->

View File

@ -2,3 +2,34 @@ page {
background-color: #f0f0f0; background-color: #f0f0f0;
} }
.myProject {
.myProjectItem {
margin: 20px;
border-radius: 10px;
background: #ffffff;
padding: 15px;
font-size: 28px;
line-height: 50px;
color: #333333;
.myProjectIndex {
color: #9b9b9f;
}
.project {
display: flex;
justify-content: space-between;
flex-flow: wrap;
text-align: center;
view {
width: 45%;
height: 100rpx;
border: 1px solid #cccccc;
line-height: 100rpx;
margin: 8px 0 8px 0;
}
}
}
}

View File

@ -1,20 +1,47 @@
<template> <template>
<view> <view class="myProject">
<view class="content"> <view class="myProjectItem" v-for="(item,index) in myProjectList" :key="index">
<view style="display: flex;justify-content: space-between">
<text>{{ item?.name }}</text>
<!--<text>进行中</text>-->
</view>
<view class="myProjectIndex">地址
<text>{{ item?.provinceName }}{{ item.cityName }}{{ item.districtsName }}{{ item.streetName }}</text>
</view>
<view style="display: flex;justify-content: space-between">
<text>项目负责人{{ item?.contactPersonInfo.name }}</text>
<text>电话{{ item?.contactPersonInfo.telephone }}</text>
</view>
<view class="project">
<view v-for="(items,index) in item.serviceProjectList" :key="index">{{ items.name }}</view>
</view>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import api from "@/request/index";
import Taro, {useLoad} from "@tarojs/taro"; import {onMounted, ref} from "vue";
import Taro from "@tarojs/taro";
useLoad(() => {
console.log('onLoad')
})
import './index.scss' import './index.scss'
const myProjectList = ref<myProjectList[]>()
const getMyServiceProject = async () => {
const token = Taro.getStorageSync('token')
const resp = await api.get<myProjectList[]>(`/policeIndex/getUnitServiceProjectList`, {
token: token.value
})
myProjectList.value = resp.data
console.log(resp.data)
}
onMounted(async () => {
await getMyServiceProject()
})
</script> </script>

View File

@ -5,42 +5,31 @@
<div>公安后台</div> <div>公安后台</div>
</div> </div>
<div v-else class="logo flex-center"> <div v-else class="logo flex-center">
<img src="@/assets/vue.svg" title="超级后台" alt="xx" /> <img src="@/assets/vue.svg" title="超级后台" alt="xx"/>
</div> </div>
<!-- -->
<!-- <a-menu v-model:selectedKeys="selectedKeys" theme="light" mode="inline">
<a-menu-item key="1">
<router-link to="/index">
<pie-chart-outlined />
<span>首页</span>
</router-link>
</a-menu-item>
<a-menu-item key="2">
<router-link to="/register/index">
<pie-chart-outlined />
<span>注册</span>
</router-link>
</a-menu-item>
</a-menu> -->
<!-- 动态生成菜单项 --> <!-- 动态生成菜单项 -->
<a-menu v-model:selectedKeys="selectedKeys" v-model:openKeys="openKeys" theme="light" mode="inline"> <a-menu v-model:selectedKeys="selectedKeys" v-model:openKeys="openKeys" theme="light" mode="inline">
<template v-for="route in staticRouter"> <template v-for="route in staticRouter">
<a-menu-item v-if="route.meta?.title === undefined && route.children" :key="route.path" @click="handleMenuClick(route.children[0].path)"> <a-menu-item v-if="route.meta?.title === undefined && route.children" :key="route.path"
<router-link :to="`${route.children[0].path}`"> @click="handleMenuClick(route.children[0].path)">
<HomeOutlined v-if="route.name === 'dashboard'" /> <router-link :to="`${route.children[0].path}`" class="flex_">
<InsuranceOutlined v-if="route.name === 'police'" /> <!-- <icon-font :font-class="route.icon"/>-->
<SoundOutlined v-if="route.name === 'law'" /> <HomeOutlined v-if="route.name === 'dashboard'"/>
<ApartmentOutlined v-if="route.name === 'warning'" /> <InsuranceOutlined v-if="route.name === 'police'"/>
<SoundOutlined v-if="route.name === 'law'"/>
<ApartmentOutlined v-if="route.name === 'warning'"/>
<span>{{ route?.children[0]?.meta?.title }}</span> <span>{{ route?.children[0]?.meta?.title }}</span>
</router-link> </router-link>
</a-menu-item> </a-menu-item>
<a-sub-menu v-if="route.children && route.children.length && route?.meta?.title" :key="route.path"> <a-sub-menu v-if="route.children && route.children.length && route?.meta?.title" :key="route.path">
<template #title> <template #title>
<MailOutlined v-if="route.name === 'query-'" /> <MailOutlined v-if="route.name === 'query-'"/>
<UserOutlined v-if="route.name === 'user'" /> <UserOutlined v-if="route.name === 'user'"/>
<span>{{ route.meta?.title }}</span> <span>{{ route.meta?.title }}</span>
</template> </template>
<a-menu-item v-for="child in route.children" :key="child.path" @click="handleMenuClick(`${route.path}/${child.path}`)"> <a-menu-item v-for="child in route.children" :key="child.path"
@click="handleMenuClick(`${route.path}/${child.path}`)">
<router-link :to="`${route.path}/${child.path}`">{{ child.meta?.title }}</router-link> <router-link :to="`${route.path}/${child.path}`">{{ child.meta?.title }}</router-link>
</a-menu-item> </a-menu-item>
</a-sub-menu> </a-sub-menu>
@ -49,7 +38,7 @@
</a-layout-sider> </a-layout-sider>
<a-layout> <a-layout>
<a-layout-header class="layout-header"> <a-layout-header class="layout-header">
<layout-header v-model:collapsed="collapsed" /> <layout-header v-model:collapsed="collapsed"/>
</a-layout-header> </a-layout-header>
<a-layout-content class="layout-content"> <a-layout-content class="layout-content">
<!-- <keep-alive> 会缓存已经访问过的组件当你再次访问同一个页面时它会直接从缓存中加载而不会触发重新渲染 --> <!-- <keep-alive> 会缓存已经访问过的组件当你再次访问同一个页面时它会直接从缓存中加载而不会触发重新渲染 -->
@ -59,7 +48,7 @@
<!-- <router-view v-slot="{ Component, route }"> --> <!-- <router-view v-slot="{ Component, route }"> -->
<transition appear name="fade-transform" mode="out-in"> <transition appear name="fade-transform" mode="out-in">
<keep-alive :include="keepAliveNames"> <keep-alive :include="keepAliveNames">
<component :is="Component" :key="route.path" /> <component :is="Component" :key="route.path"/>
</keep-alive> </keep-alive>
</transition> </transition>
</router-view> </router-view>
@ -69,11 +58,21 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { InsuranceOutlined, HomeOutlined, SoundOutlined, MailOutlined, ApartmentOutlined, UserOutlined, AppstoreOutlined } from '@ant-design/icons-vue' import IconFont from "@/components/iconfont/IconFont.vue";
import {
InsuranceOutlined,
HomeOutlined,
SoundOutlined,
MailOutlined,
ApartmentOutlined,
UserOutlined,
AppstoreOutlined
} from '@ant-design/icons-vue'
import LayoutHeader from '@/components/layout/header/LayoutHeader.vue' import LayoutHeader from '@/components/layout/header/LayoutHeader.vue'
import { computed, watch, onMounted } from 'vue' import {computed, watch, onMounted} from 'vue'
import { staticRouter } from '@/router/staticRouters' import {staticRouter} from '@/router/staticRouters'
import { useRoute } from 'vue-router' import {useRoute} from 'vue-router'
const route = useRoute() const route = useRoute()
const selectedKeys = ref([route.path]) const selectedKeys = ref([route.path])
/** /**
@ -86,10 +85,10 @@ const handleMenuClick = (path: any) => {
localStorage.setItem('selectedKeys', JSON.stringify([path])) localStorage.setItem('selectedKeys', JSON.stringify([path]))
} }
watch( watch(
() => route.path, () => route.path,
(newPath) => { (newPath) => {
selectedKeys.value = [newPath] selectedKeys.value = [newPath]
} }
) )
const openKeys = ref([]) const openKeys = ref([])
// localStorage // localStorage
@ -132,7 +131,7 @@ watch(openKeys, (newOpenKeys) => {
// //
// const keepAliveNames = ref(['index']) // const keepAliveNames = ref(['index'])
import { ref } from 'vue' import {ref} from 'vue'
// //
const collapsed = ref<boolean>(false) const collapsed = ref<boolean>(false)
@ -141,6 +140,13 @@ const keepAliveNames = ref<string[]>(['index', 'rindex'])
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.flex_ {
display: flex;
flex-direction: row;
align-items: center;
}
.main-content { .main-content {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;

View File

@ -9,6 +9,7 @@ export const staticRouter: RouteRecordRaw[] =
path: '/', path: '/',
name: 'dashboard', name: 'dashboard',
redirect: '/index', redirect: '/index',
icon: 'icon-policeman-full',
meta: { meta: {
keepalive: true keepalive: true
}, },