Commit 39184f9f by pangchong

feat: 调整

parent ad5661f3
......@@ -3,7 +3,7 @@
<z-paging
ref="paging"
v-model="dataList"
:auto="auto"
:auto="auto || showEmpty"
:fixed="fixed"
:height="height"
:refresher-enabled="refresherEnabled"
......@@ -12,13 +12,13 @@
:loading-more-enabled="loadingMoreEnabled"
:back-to-top-bottom="backToTopBottom"
show-refresher-update-time
:hide-empty-view="!auto"
:hide-empty-view="!(auto || showEmpty)"
@query="queryList"
@scroll="scroll"
:paging-style="getPagingStyle"
:default-page-size="pageSize"
>
<template #empty v-if="auto && !dataList.length">
<template #empty v-if="showEmpty || (auto && !dataList.length)">
<global-empty></global-empty>
</template>
<!-- 头部 -->
......@@ -83,6 +83,10 @@ const dataList = ref([])
const es = defineEmits(['handleQuery', 'handleLeftClick', 'handleRightClick', 'handleFooterClick', 'handleChooseData'])
const paging = ref()
const ps = defineProps({
showEmpty: {
type: Boolean,
default: false
},
background: {
type: String,
default: '#f7f8fa'
......
......@@ -25,47 +25,31 @@ const useMyToDoStore = defineStore('myToDo', {
}
},
getAssignWorkNum(state) {
if (state.assignWorkNum > 0) {
if (state.assignWorkNum > 99) {
return '99+'
} else {
return state.assignWorkNum
}
if (state.assignWorkNum > 99) {
return '99+'
} else {
return '暂无待办'
return state.assignWorkNum
}
},
getAppraisalRecordNum(state) {
if (state.appraisalRecordNum > 0) {
if (state.appraisalRecordNum > 99) {
return '99+'
} else {
return state.appraisalRecordNum
}
if (state.appraisalRecordNum > 99) {
return '99+'
} else {
return '暂无待办'
return state.appraisalRecordNum
}
},
getMoveDecisionNum(state) {
if (state.moveDecisionNum > 0) {
if (state.moveDecisionNum > 99) {
return '99+'
} else {
return state.moveDecisionNum
}
if (state.moveDecisionNum > 99) {
return '99+'
} else {
return '暂无待办'
return state.moveDecisionNum
}
},
getTechnologyEvaluationNum(state) {
if (state.technologyEvaluationNum > 0) {
if (state.technologyEvaluationNum > 99) {
return '99+'
} else {
return state.technologyEvaluationNum
}
if (state.technologyEvaluationNum > 99) {
return '99+'
} else {
return '暂无待办'
return state.technologyEvaluationNum
}
}
},
......
......@@ -5,16 +5,16 @@ import { ref } from 'vue'
const menuList = ref([
{ id: 1, name: '信息通报', icon: 'xxtb', group: '技术支援', default: true, count: 0, url: '/panel/inforDisclosure/search' },
{ id: 2, name: '机队状态', icon: 'jdzt', group: '技术支援', default: true, count: 0, url: '/panel/fleet/search' },
{ id: 3, name: '支援申请', icon: 'zysq', group: '技术支援', default: true, count: 0, url: '/panel/support-application/search' },
{ id: 4, name: '工作指令', icon: 'gzzl', group: '技术支援', default: true, count: 0, url: '/panel/work-assignment/search' },
{ id: 5, name: '技术评估', icon: 'jspg', group: '技术支援', default: true, count: 0, url: '/panel/technology-evaluation/list' },
{ id: 3, name: '支援申请', icon: 'zysq', group: '技术支援', default: false, count: 0, url: '/panel/support-application/search' },
{ id: 4, name: '工作指令', icon: 'gzzl', group: '技术支援', default: false, count: 0, url: '/panel/work-assignment/search' },
{ id: 5, name: '技术评估', icon: 'jspg', group: '技术支援', default: false, count: 0, url: '/panel/technology-evaluation/list' },
{ id: 6, name: '运行调查', icon: 'yxdc', group: '维修控制', default: false, count: 0 },
{ id: 7, name: '运行决策', icon: 'yxjc', group: '维修控制', default: true, count: 0, url: '/panel/move-decision/list' },
{ id: 8, name: '布置工作', icon: 'bzgz', group: '维修控制', default: true, count: 0, url: '/panel/assign-work/search' },
{ id: 9, name: '航站管理', icon: 'hzgl', group: '航站管理', default: true, count: 0 },
{ id: 10, name: '协议单位', icon: 'xydw', group: '航站管理', default: true, count: 0 },
{ id: 11, name: '不正常事件', icon: 'bzcsj', group: '运行品质', default: true, count: 0 },
{ id: 12, name: '考核记录', icon: 'khjl', group: '运行品质', default: true, count: 0, url: '/panel/appraisal-record/list' },
{ id: 7, name: '运行决策', icon: 'yxjc', group: '维修控制', default: false, count: 0, url: '/panel/move-decision/list' },
{ id: 8, name: '布置工作', icon: 'bzgz', group: '维修控制', default: false, count: 0, url: '/panel/assign-work/search' },
{ id: 9, name: '航站管理', icon: 'hzgl', group: '航站管理', default: false, count: 0 },
{ id: 10, name: '协议单位', icon: 'xydw', group: '航站管理', default: false, count: 0 },
{ id: 11, name: '不正常事件', icon: 'bzcsj', group: '运行品质', default: false, count: 0 },
{ id: 12, name: '考核记录', icon: 'khjl', group: '运行品质', default: false, count: 0, url: '/panel/appraisal-record/list' },
{ id: 13, name: 'AOG任务', icon: 'AOG', group: '运行品质', default: true, count: 0, url: '/panel/aog/search' },
{ id: 14, name: 'MCO', icon: 'MCO', group: '运行品质', default: true, count: 0, url: '/panel/mco/search' },
{ id: 15, name: '航班保障', icon: 'hbbz', group: '运行品质', default: true, count: 0, url: '/panel/flight-support/list' },
......@@ -26,7 +26,7 @@ const useUserStore = defineStore('user', {
token: '',
userInfo: undefined, //用户信息
allMenuItem: { id: 999, name: '全部菜单', icon: 'all', group: '', count: 0 },
allHomeMenuList: [] //所有登录用户的首页菜单信息
allUserList: [] //所有登录用户存储的信息
}
},
getters: {
......@@ -48,7 +48,7 @@ const useUserStore = defineStore('user', {
},
//获取当前登录用户的首页菜单
getHomeMenuList(state) {
const homeMenuList = state.allHomeMenuList.find((item) => item.userId == state.userInfo?.id)?.homeMenuList
const homeMenuList = state.allUserList.find((item) => item.userId == state.userInfo?.id)?.homeMenuList
const ids = []
homeMenuList.forEach((item) => {
ids.push(item.id)
......@@ -62,9 +62,9 @@ const useUserStore = defineStore('user', {
this.token = data.token
this.userInfo = data
//加入用户首页菜单信息
if (!this.allHomeMenuList.find((item) => item.userId == this.userInfo.id)) {
if (!this.allUserList.find((item) => item.userId == this.userInfo.id)) {
//记录菜单id
this.allHomeMenuList.push({
this.allUserList.push({
userId: this.userInfo.id,
homeMenuList: this.getMenuList
.filter((item) => item.default)
......@@ -85,8 +85,10 @@ const useUserStore = defineStore('user', {
},
//修改用户首页菜单
changeHomeMenuList(menuList) {
const index = this.allHomeMenuList.findIndex((item) => item.userId == this.userInfo.id)
this.allHomeMenuList[index].homeMenuList = menuList
const index = this.allUserList.findIndex((item) => item.userId == this.userInfo.id)
this.allUserList[index].homeMenuList = menuList.map((item) => {
return { id: item.id }
})
}
},
// 配置持久化
......
import useUserStore from 'mocp/store/user'
// const baseURL = 'https://hna-platform.anyremote.cn' //测试
const baseURL = 'https://hna-platform.anyremote.cn' //测试
// const baseURL = 'https://moc.hnatechnic.com/api' //生产
const baseURL = 'https://hnaelbtest.hnatechnic.com/mocptest/api' //内网
// const baseURL = 'https://hnaelbtest.hnatechnic.com/mocptest/api' //内网
class ServiceLoading {
open(loading) {
......@@ -123,7 +123,7 @@ export const http = (options) => {
}, 500)
reject(res)
} else {
uni.$mocpMessage.error(res.data.message || '请求错误')
uni.$mocpMessage.error(res.data.path + '接口错误')
reject(res)
}
},
......
<template>
<up-collapse-item :title="`考核记录(${getAppraisalRecordNum})`">
<up-collapse-item :title="`考核记录(${getAppraisalRecordNum})`" v-if="getAppraisalRecordNum > 0">
<global-page
:fixed="false"
:height="height"
......@@ -16,6 +16,19 @@
auto
>
<template #default="{ item }">
<up-swipe-action>
<up-swipe-action-item
@click="handleDelete(item)"
:options="[
{
text: '移除',
style: {
backgroundColor: '#f53f3f'
}
}
]"
></up-swipe-action-item>
</up-swipe-action>
<view class="item" @tap="goDetails(item)">
<view class="item-title">
<view class="desc">
......@@ -55,6 +68,10 @@ const goDetails = (data) => {
id: data.id
})
}
//删除
const handleDelete = (data) => {
console.log(data)
}
const handleQuery = ({ res }) => {
myToDoStore.setState('appraisalRecordNum', parseInt(res.total) || 0)
}
......
<template>
<up-collapse-item :title="`布置工作(${getAssignWorkNum})`">
<up-collapse-item :title="`布置工作(${getAssignWorkNum})`" v-if="getAssignWorkNum > 0">
<global-page
:fixed="false"
:height="height"
......@@ -16,6 +16,19 @@
auto
>
<template #default="{ item }">
<up-swipe-action>
<up-swipe-action-item
@click="handleDelete(item)"
:options="[
{
text: '移除',
style: {
backgroundColor: '#f53f3f'
}
}
]"
></up-swipe-action-item>
</up-swipe-action>
<view class="item" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
......@@ -67,6 +80,10 @@ const ps = defineProps({
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/assign-work/details', { id: data.id })
}
//删除
const handleDelete = (data) => {
console.log(data)
}
const handleQuery = ({ res }) => {
myToDoStore.setState('assignWorkNum', parseInt(res.data.total) || 0)
}
......
<template>
<up-collapse-item :title="`运行决策(${getMoveDecisionNum})`">
<up-collapse-item :title="`运行决策(${getMoveDecisionNum})`" v-if="getMoveDecisionNum > 0">
<global-page
:fixed="false"
:height="height"
......@@ -13,28 +13,42 @@
auto
>
<template #default="{ item }">
<view class="item" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
<custom-state :value="useGetDictByValue('md_state', item.state)"></custom-state>
<up-swipe-action>
<up-swipe-action-item
@click="handleDelete(item)"
:options="[
{
text: '移除',
style: {
backgroundColor: '#f53f3f'
}
}
]"
>
<view class="item" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
<custom-state :value="useGetDictByValue('md_state', item.state)"></custom-state>
</view>
<view class="right">
<text class="txt u-line-1" v-if="item.machineNumber">{{ item.machineNumber }}</text>
<text class="txt u-line-1" v-if="item.aviation">{{ item.aviation }}</text>
</view>
</view>
<view class="item-content u-line-3">
{{ item.faultDescription || '无' }}
</view>
<view class="item-footer">
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ timeStampFormat(item.filledTime, { format: 'YYYY/MM/DD HH:mm' }) }}
</text>
</view>
</view>
</view>
<view class="right">
<text class="txt u-line-1" v-if="item.machineNumber">{{ item.machineNumber }}</text>
<text class="txt u-line-1" v-if="item.aviation">{{ item.aviation }}</text>
</view>
</view>
<view class="item-content u-line-3">
{{ item.faultDescription || '无' }}
</view>
<view class="item-footer">
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ timeStampFormat(item.filledTime, { format: 'YYYY/MM/DD HH:mm' }) }}
</text>
</view>
</view>
</view>
</up-swipe-action-item>
</up-swipe-action>
</template>
</global-page>
</up-collapse-item>
......@@ -63,6 +77,10 @@ const goDetails = (data) => {
moveDecisionStore.setState('details', data)
})
}
//删除
const handleDelete = (data) => {
console.log(data)
}
const handleQuery = ({ res }) => {
myToDoStore.setState('moveDecisionNum', parseInt(res.data.total) || 0)
}
......
<template>
<up-collapse-item :title="`技术评估(${getTechnologyEvaluationNum})`">
<up-collapse-item :title="`技术评估(${getTechnologyEvaluationNum})`" v-if="getTechnologyEvaluationNum > 0">
<global-page
:fixed="false"
:height="height"
......@@ -13,6 +13,19 @@
auto
>
<template #default="{ item }">
<up-swipe-action>
<up-swipe-action-item
@click="handleDelete(item)"
:options="[
{
text: '移除',
style: {
backgroundColor: '#f53f3f'
}
}
]"
></up-swipe-action-item>
</up-swipe-action>
<view class="item" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
......@@ -69,6 +82,10 @@ const goDetails = (data) => {
technologyEvaluationStore.setState('details', data)
})
}
//删除
const handleDelete = (data) => {
console.log(data)
}
const handleQuery = ({ res }) => {
myToDoStore.setState('technologyEvaluationNum', parseInt(res.data.total) || 0)
}
......
<template>
<global-page title="我的待办">
<!-- :showNavRight="getTotal !== '-'" -->
<global-page title="我的待办" :showEmpty="getTotal == '-'" navRightText="全部移除" @handleRightClick="handleRightClick">
<up-collapse :border="false" accordion>
<assign-work-list :height="getHeight"></assign-work-list>
<appraisal-record-list :height="getHeight"></appraisal-record-list>
<move-decision-list :height="getHeight"></move-decision-list>
<technology-evaluation-list :height="getHeight"></technology-evaluation-list>
</up-collapse>
<up-modal
:width="250"
content="是否确认移除全部「我的待办」?"
:show="show"
showCancelButton
closeOnClickOverlay
@confirm="confirm"
@cancel="show = false"
@close="show = false"
></up-modal>
</global-page>
</template>
<script setup>
import { computed } from 'vue'
import { computed, ref } from 'vue'
import AssignWorkList from './components/assign-work-list.vue'
import AppraisalRecordList from './components/appraisal-record-list.vue'
import MoveDecisionList from './components/move-decision-list.vue'
import TechnologyEvaluationList from './components/technology-evaluation-list.vue'
import useMyToDoStore from 'mocp/store/my-toDo'
import { storeToRefs } from 'pinia'
const { windowHeight, safeAreaInsets } = uni.getSystemInfoSync()
//内容高度-nav高度-底部安全区-底部安全区
const getHeight = computed(() => {
return windowHeight - 44 - safeAreaInsets?.top - safeAreaInsets?.bottom - 75 * 4 + 'px'
})
const myToDoStore = useMyToDoStore()
const { getTotal } = storeToRefs(myToDoStore)
//全部清除
const show = ref(false)
const handleRightClick = () => {
show.value = true
}
//确认删除
const confirm = () => {
show.value = false
}
</script>
<style lang="scss">
@import 'mocpStatic/css/list.scss';
.item {
margin-bottom: 0;
}
.u-swipe-action {
margin-bottom: 16rpx;
}
</style>
<style lang="scss" scoped>
.item:last-child {
......
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