Commit 39184f9f by pangchong

feat: 调整

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