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>
<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 class="swiper-demo">
<nut-swiper ref="swiperRef" pagination-visible pagination-color="#e53e31" :auto-play="3000" :init-page="0">
<nut-swiper-item v-for="(item, index) in list" :key="index" style="height: 150px">
<img :src="item" alt="" style="height: 100%; width: 100%" draggable="false"/>
</nut-swiper-item>
</nut-swiper>
</view>
<view class="margin-top">
<nut-grid :column-num="3">
<nut-grid-item
text="企事业单位"
@click="Taro.navigateTo({url: '/subPages/pages/policeManager/index'})">
</nut-grid-item>
<nut-grid-item
text="警保风采"
@click="Taro.navigateTo({url: '/pages/index/dataEntry/personnelInformationEntry/personnelInformationEntry'})">
</nut-grid-item>
<nut-grid-item text=".....">
</nut-grid-item>
</nut-grid>
</view>
</view>
</template>
<script setup lang="ts">
import './index.scss'
import {ref} from 'vue'
import Taro from "@tarojs/taro";
const routerPush = (path) => {
switch (path) {
case 1:
Taro.navigateTo({
url: '/subPages/pages/policeManager/index',
})
}
const list = ref([
'https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg',
'https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg',
'https://storage.360buyimg.com/jdc-article/welcomenutui.jpg',
'https://storage.360buyimg.com/jdc-article/fristfabu.jpg'
])
const swiperRef = ref()
}
import './index.scss'
</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;
}
.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>
<view>
<view class="content">
<view class="myProject">
<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>
</template>
<script setup lang="ts">
import Taro, {useLoad} from "@tarojs/taro";
useLoad(() => {
console.log('onLoad')
})
import api from "@/request/index";
import {onMounted, ref} from "vue";
import Taro from "@tarojs/taro";
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>

View File

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

View File

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