Commit 3dbf906a by pangchong

feat: 调整

parent 34978d3a
......@@ -7,6 +7,7 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
// 全局组件
GlobalButton: typeof import('./src/components/global-button/global-button.vue')['default']
GlobalEmpty: typeof import('./src/components/global-empty/global-empty.vue')['default']
GlobalIcon: typeof import('./src/components/global-icon/global-icon.vue')['default']
......@@ -15,7 +16,9 @@ declare module 'vue' {
GlobalPageSwiper: typeof import('./src/components/global-page-swiper/global-page-swiper.vue')['default']
GlobalPageSwiperItem: typeof import('./src/components/global-page-swiper-item/global-page-swiper-item.vue')['default']
GlobalPicker: typeof import('./src/components/global-picker/global-picker.vue')['default']
GlobalScore: typeof import('./src/components/global-score/global-score.vue')['default']
GlobalTabs: typeof import('./src/components/global-tabs/global-tabs.vue')['default']
GlobalUpload: typeof import('./src/components/global-upload/global-upload.vue')['default']
// 自定义组件
CustomScore: typeof import('./src/components/widget/custom-score.vue')['default']
}
}
......@@ -5,9 +5,12 @@
"custom": {
// uni-ui 规则如下配置
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue",
// uview-plus 规则如下配置
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue",
// 自定义组件 规则如下配置
"^custom-(.*)": "@/components/widget/custom-$1.vue"
}
},
"pages": [
......@@ -80,6 +83,13 @@
"navigationBarTitleText": "添加公司值班信息",
"navigationStyle": "custom"
}
},
{
"path": "pages/panel/assign-work/list",
"style": {
"navigationBarTitleText": "布置工作",
"navigationStyle": "custom"
}
}
],
"globalStyle": {
......
......@@ -82,7 +82,7 @@ const handleHomeMenu = (menu, type) => {
}
//获取全部应用
const getMenuList = computed(() => {
return userStore.menuList.map((item) => {
return userStore.getMenuList.map((item) => {
return {
...item,
isHome: homeMenuList.value.find((opt) => opt.id == item.id) ? true : false
......
......@@ -15,11 +15,11 @@
<view class="details-header">
<view class="details-header-top">
<view class="txt">{{ details.status == 1 ? 'OPEN' : 'ClOSE' }}</view>
<global-score
<custom-score
v-if="details.score != -1"
:type="details.eventType == 1 ? 'success' : 'warning'"
:count="details.score"
></global-score>
></custom-score>
</view>
<view class="details-header-bottom">
<view class="left">
......
......@@ -9,7 +9,7 @@
<view class="txt">{{ item.appraisee != '-1' ? item.appraisee : '' }}</view>
<view class="place">{{ item.department != '-1' ? item.department : '' }}</view>
</view>
<global-score v-if="item.score != -1" :type="item.eventType == 1 ? 'success' : 'warning'" :count="item.score"></global-score>
<custom-score v-if="item.score != -1" :type="item.eventType == 1 ? 'success' : 'warning'" :count="item.score"></custom-score>
</view>
<view class="item-content u-line-3">
{{ item.eventMsg || '暂无内容~' }}
......
.list {
padding: 24rpx;
.item {
padding: 24rpx;
margin-bottom: 16rpx;
border-radius: 12rpx;
background: linear-gradient(#e6eeff, #ffffff, #ffffff);
&-title {
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 16rpx;
border-bottom: 2rpx solid #f4f4f4;
.desc {
display: flex;
align-items: center;
.type {
color: #f53f3f;
font-size: 34rpx;
}
.txt {
color: #1d2129;
font-size: 34rpx;
margin: 0 16rpx;
}
.place {
font-size: 28rpx;
color: #86909c;
}
}
}
&-content {
padding-top: 16rpx;
font-size: 30rpx;
color: #4e5969;
line-height: 40rpx;
}
}
}
\ No newline at end of file
<template>
<global-page-swiper title="考核记录" refresherEnabled loadingMoreEnabled :tabList="tabList" :api="getRqmListApi" ref="paging">
<template #="{ dataList }">
<view class="list">
<view class="item" v-for="item in dataList" :key="item.id" @tap="goDetails(item)">
<view class="item-title">
<view class="desc">
<view class="type">{{ item.status == 1 ? 'OPEN' : 'ClOSE' }}</view>
<view class="txt">{{ item.appraisee != '-1' ? item.appraisee : '' }}</view>
<view class="place">{{ item.department != '-1' ? item.department : '' }}</view>
</view>
<custom-score v-if="item.score != -1" :type="item.eventType == 1 ? 'success' : 'warning'" :count="item.score"></custom-score>
</view>
<view class="item-content u-line-3">
{{ item.eventMsg || '暂无内容~' }}
</view>
</view>
</view>
</template>
</global-page-swiper>
</template>
<script setup>
import { ref } from 'vue'
import { getRqmListApi } from '@/api/appraisal-record'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import useAppraisalRecordStore from '@/store/appraisal-record'
const tabList = ref([
{ name: 'OPEN', value: 1 },
{ name: 'CLOSE', value: 0 },
{ name: '全部', value: -1 }
])
//跳转
const goDetails = (data) => {
uni.navigateTo({
url: 'details?id=' + data.id
})
}
//加载下拉框数据
const appraisalRecordStore = useAppraisalRecordStore()
onLoad(() => {
appraisalRecordStore.getRqmOptions()
})
//刷新
const paging = ref()
uni.$on('appraisalRecordReload', () => {
paging.value?.reload()
})
onUnload(() => {
uni.$off('appraisalRecordReload')
})
</script>
<style lang="scss" scoped>
@import './constants/list.scss';
</style>
import { defineStore } from 'pinia'
import { cloneDeep } from 'lodash'
const menuList = [
import { ref } from 'vue'
const menuList = ref([
{ id: 1, name: '信息通报', icon: 'xxtb', group: '技术支援', count: 12 },
{ id: 2, name: '机队状态', icon: 'jdzt', group: '技术支援', count: 0 },
{ id: 3, name: '支援申请', icon: 'zysq', group: '技术支援', count: 0 },
......@@ -8,7 +8,7 @@ const menuList = [
{ id: 5, name: '技术评估', icon: 'jspg', group: '技术支援', count: 0 },
{ id: 6, name: '运行调查', icon: 'yxdc', group: '维修控制', count: 0 },
{ id: 7, name: '运行决策', icon: 'yxjc', group: '维修控制', count: 0 },
{ id: 8, name: '布置工作', icon: 'bzgz', group: '维修控制', count: 0 },
{ id: 8, name: '布置工作', icon: 'bzgz', group: '维修控制', count: 0, url: '/pages/panel/assign-work/list' },
{ id: 9, name: '航站管理', icon: 'hzgl', group: '航站管理', count: 0 },
{ id: 10, name: '协议单位', icon: 'xydw', group: '航站管理', count: 0 },
{ id: 11, name: '不正常事件', icon: 'bzcsj', group: '运行品质', count: 0 },
......@@ -16,21 +16,24 @@ const menuList = [
{ id: 13, name: 'AOG任务', icon: 'AOG', group: '运行品质', count: 0 },
{ id: 14, name: 'MCO', icon: 'MCO', group: '运行品质', count: 0 },
{ id: 15, name: '航班保障', icon: 'hbbz', group: '运行品质', count: 0 }
]
])
const useUserStore = defineStore('user', {
state: () => {
return {
token: '',
userInfo: undefined, //用户信息
menuList: cloneDeep(menuList), //全部菜单
allMenuItem: { id: 999, name: '全部菜单', icon: 'all', group: '', count: 0 },
allHomeMenuList: [] //所有登录用户的首页菜单信息
}
},
getters: {
//获取全部菜单
getMenuList() {
return menuList.value
},
//获取分组菜单
getGroupMenuList(state) {
return state.menuList.reduce((groups, item) => {
return state.getMenuList.reduce((groups, item) => {
// 如果该组不存在,则创建一个新组
if (!groups[item.group]) {
groups[item.group] = []
......@@ -42,7 +45,12 @@ const useUserStore = defineStore('user', {
},
//获取当前登录用户的首页菜单
getHomeMenuList(state) {
return state.allHomeMenuList.find((item) => item.userId == state.userInfo?.id)?.homeMenuList || state.menuList
const homeMenuList = state.allHomeMenuList.find((item) => item.userId == state.userInfo?.id)?.homeMenuList
const ids = []
homeMenuList.forEach((item) => {
ids.push(item.id)
})
return state.getMenuList.filter((item) => ids.includes(item.id))
}
},
actions: {
......@@ -52,9 +60,12 @@ const useUserStore = defineStore('user', {
this.userInfo = data
//加入用户首页菜单信息
if (!this.allHomeMenuList.find((item) => item.userId == this.userInfo.id)) {
//记录菜单id
this.allHomeMenuList.push({
userId: this.userInfo.id,
homeMenuList: this.menuList
homeMenuList: this.getMenuList.map((item) => {
return { id: item.id }
})
})
}
//跳转工作台
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment