Commit 7a52f735 by pangchong

feat: 防风害待办

parent 20571861
...@@ -20,6 +20,14 @@ const ps = defineProps({ ...@@ -20,6 +20,14 @@ const ps = defineProps({
radious: { radious: {
type: [String, Number], type: [String, Number],
default: 6 default: 6
},
background: {
type: Boolean,
default: true
},
border: {
type: Boolean,
default: false
} }
}) })
//获取class //获取class
...@@ -29,23 +37,28 @@ const getClass = computed(() => { ...@@ -29,23 +37,28 @@ const getClass = computed(() => {
_class.push(ps.class) _class.push(ps.class)
} }
if (ps.type == 'primary') { if (ps.type == 'primary') {
_class.push('mocp-bg-primary-2') ps.background && _class.push('mocp-bg-primary-2')
ps.border && _class.push('mocp-border-primary-3')
_class.push('mocp-color-primary-6') _class.push('mocp-color-primary-6')
} }
if (ps.type == 'success') { if (ps.type == 'success') {
_class.push('mocp-bg-success-2') ps.background && _class.push('mocp-bg-success-2')
ps.border && _class.push('mocp-border-success-3')
_class.push('mocp-color-success-6') _class.push('mocp-color-success-6')
} }
if (ps.type == 'warning') { if (ps.type == 'warning') {
_class.push('mocp-bg-warning-2') ps.background && _class.push('mocp-bg-warning-2')
ps.border && _class.push('mocp-border-warning-3')
_class.push('mocp-color-warning-6') _class.push('mocp-color-warning-6')
} }
if (ps.type == 'info') { if (ps.type == 'info') {
_class.push('mocp-bg-fill-4') ps.background && _class.push('mocp-bg-fill-4')
ps.border && _class.push('mocp-border-fill-3')
_class.push('mocp-color-text-1') _class.push('mocp-color-text-1')
} }
if (ps.type == 'danger') { if (ps.type == 'danger') {
_class.push('mocp-bg-danger-2') ps.background && _class.push('mocp-bg-danger-2')
ps.border && _class.push('mocp-border-danger-3')
_class.push('mocp-color-danger-6') _class.push('mocp-color-danger-6')
} }
return _class return _class
......
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import useUserStore from 'mocp/store/user' import useUserStore from 'mocp/store/user'
import { getArrangeWorkListForAppApi, getDecisiongetDecisionToDoApi, getRqmListForMobileApi, getTechnicalEvaluationToDoApi } from 'mocp/api/my-toDo' import { getArrangeWorkListForAppApi, getDecisiongetDecisionToDoApi, getRqmListForMobileApi, getTechnicalEvaluationToDoApi } from 'mocp/api/my-toDo'
import { getPwdPatrolListApi } from 'mocp/api/windDamageManagement'
const useMyToDoStore = defineStore('myToDo', { const useMyToDoStore = defineStore('myToDo', {
state: () => { state: () => {
...@@ -8,12 +9,14 @@ const useMyToDoStore = defineStore('myToDo', { ...@@ -8,12 +9,14 @@ const useMyToDoStore = defineStore('myToDo', {
assignWorkNum: 0, //布置工作 assignWorkNum: 0, //布置工作
appraisalRecordNum: 0, //考核记录 appraisalRecordNum: 0, //考核记录
moveDecisionNum: 0, //运行决策 moveDecisionNum: 0, //运行决策
technologyEvaluationNum: 0 //技术评估 technologyEvaluationNum: 0, //技术评估
windDamageManagementNum: 0 //防风害管理
} }
}, },
getters: { getters: {
getTotal(state) { getTotal(state) {
const total = state.assignWorkNum + state.appraisalRecordNum + state.moveDecisionNum + state.technologyEvaluationNum const total =
state.assignWorkNum + state.appraisalRecordNum + state.moveDecisionNum + state.technologyEvaluationNum + state.windDamageManagementNum
if (total > 0) { if (total > 0) {
if (total > 99) { if (total > 99) {
return '99+' return '99+'
...@@ -51,6 +54,13 @@ const useMyToDoStore = defineStore('myToDo', { ...@@ -51,6 +54,13 @@ const useMyToDoStore = defineStore('myToDo', {
} else { } else {
return state.technologyEvaluationNum return state.technologyEvaluationNum
} }
},
getWindDamageManagementNum(state) {
if (state.windDamageManagementNum > 99) {
return '99+'
} else {
return state.windDamageManagementNum
}
} }
}, },
actions: { actions: {
...@@ -80,9 +90,19 @@ const useMyToDoStore = defineStore('myToDo', { ...@@ -80,9 +90,19 @@ const useMyToDoStore = defineStore('myToDo', {
this.technologyEvaluationNum = parseInt(res.data.total) || 0 this.technologyEvaluationNum = parseInt(res.data.total) || 0
} }
}, },
async getPwdPatrolList() {
const res = await getPwdPatrolListApi({ pageIndex: 1, pageSize: 10 })
if (res.code == 200) {
this.windDamageManagementNum = parseInt(res.data.total) || 0
}
},
async initData() { async initData() {
await Promise.all([ await Promise.all([
(this.getArrangeWorkListForApp(), this.getRqmListForMobile(), this.getDecisiongetDecisionToDo(), this.getTechnicalEvaluationToDo()) (this.getArrangeWorkListForApp(),
this.getRqmListForMobile(),
this.getDecisiongetDecisionToDo(),
this.getTechnicalEvaluationToDo(),
this.getPwdPatrolList())
]) ])
}, },
setState(...args) { setState(...args) {
......
<template>
<up-collapse-item :title="`防风害管理(${getWindDamageManagementNum})`" v-if="getWindDamageManagementNum > 0">
<global-page
:fixed="false"
:height="height"
:showNavbar="false"
:custom="false"
isDataList
refresherEnabled
loadingMoreEnabled
:params="{
userId: userStore.userInfo?.id
}"
:api="getPwdPatrolListApi"
@handleQuery="handleQuery"
auto
>
<template #default="{ item }">
<template v-for="option in item.basicInfoList" :key="option.id">
<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, option.id)">
<view class="item-title">
<view class="left">
<custom-state :value="useGetDictByValue('wdm_isOpen', item.isOpen)"></custom-state>
<view style="margin-left: 12rpx">
<global-tag type="primary" border :background="false">巡场检查单</global-tag>
</view>
</view>
<view class="right">
<global-tag :type="useGetDictByValue('wdm_rxStatusType', option.rxStatus)" style="margin-left: 12rpx">
{{ useGetDictByValue('wdm_rxStatus', option.rxStatus) }}
</global-tag>
</view>
</view>
<view class="item-content">
<view class="row" v-if="option.ac">机号:{{ option.ac }}</view>
<view class="row" v-if="item.terminal">航站:{{ baseStore.getTerminalObject[item.terminal] }}</view>
<view class="u-line-3">{{ option.windSpeed || '无' }}</view>
</view>
<view class="item-footer">
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ timeStampFormat(option.proposedTime) }}
</text>
</view>
<view class="label u-line-1">
<global-icon icon="idcard"></global-icon>
<text class="txt">操作人:{{ option.name || '-' }}</text>
</view>
</view>
<view class="item-extra">
<view class="mocp-color-danger-6" style="display: flex" v-if="option.isAbnormal == '1'">
<up-icon name="info-circle" color="#f53f3f"></up-icon>
<text style="margin-left: 4rpx">疑似异常,请关注</text>
</view>
</view>
</view>
</template>
</template>
</global-page>
</up-collapse-item>
</template>
<script setup>
import useUserStore from 'mocp/store/user'
import useMyToDoStore from 'mocp/store/my-toDo'
import { storeToRefs } from 'pinia'
import { getPwdPatrolListApi } from 'mocp/api/windDamageManagement'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { timeStampFormat } from 'mocp/utils/tool'
import useBaseStore from 'mocp/store/base'
const userStore = useUserStore()
const baseStore = useBaseStore()
const myToDoStore = useMyToDoStore()
const windDamageManagementStore = useWindDamageManagementStore()
const { getWindDamageManagementNum } = storeToRefs(myToDoStore)
const ps = defineProps({
height: {
type: String,
default: ''
}
})
//跳转
const goDetails = (data, basicId) => {
windDamageManagementStore.setState('basicId', basicId)
windDamageManagementStore.setState('weatherId', data.id)
windDamageManagementStore.setState('weatherSource', data.weatherSource)
uni.$mocpJump.navigateTo('/panel/windDamageManagement/patrolDetails')
}
//删除
const handleDelete = (data) => {
console.log(data)
}
const handleQuery = ({ res }) => {
myToDoStore.setState('windDamageManagementNum', parseInt(res.data.total) || 0)
}
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
.item-extra {
margin-top: 12rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<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>
<WindDamageManagement :height="getHeight"></WindDamageManagement>
</up-collapse> </up-collapse>
<up-modal <up-modal
:width="250" :width="250"
...@@ -26,6 +27,7 @@ import AssignWorkList from './components/assign-work-list.vue' ...@@ -26,6 +27,7 @@ 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 WindDamageManagement from './components/WindDamageManagement.vue'
import useMyToDoStore from 'mocp/store/my-toDo' import useMyToDoStore from 'mocp/store/my-toDo'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
......
...@@ -29,6 +29,21 @@ ...@@ -29,6 +29,21 @@
.mocp-color-primary-1 { .mocp-color-primary-1 {
color: $mocp-primary-1; color: $mocp-primary-1;
} }
.mocp-border-primary-7 {
border: 2rpx solid $mocp-primary-7;
}
.mocp-border-primary-6 {
border: 2rpx solid $mocp-primary-6;
}
.mocp-border-primary-3 {
border: 2rpx solid $mocp-primary-3;
}
.mocp-border-primary-2 {
border: 2rpx solid $mocp-primary-2;
}
.mocp-border-primary-1 {
border: 2rpx solid $mocp-primary-1;
}
/* 填充 Fill */ /* 填充 Fill */
.mocp-bg-fill-4 { .mocp-bg-fill-4 {
background: $mocp-fill-4; background: $mocp-fill-4;
...@@ -42,6 +57,18 @@ ...@@ -42,6 +57,18 @@
.mocp-bg-fill-1 { .mocp-bg-fill-1 {
background: $mocp-fill-1; background: $mocp-fill-1;
} }
.mocp-border-fill-4 {
border: 2rpx solid $mocp-fill-4;
}
.mocp-border-fill-3 {
border: 2rpx solid $mocp-fill-3;
}
.mocp-border-fill-2 {
border: 2rpx solid $mocp-fill-2;
}
.mocp-border-fill-1 {
border: 2rpx solid $mocp-fill-1;
}
/* 文字 Text */ /* 文字 Text */
.mocp-color-text-5 { .mocp-color-text-5 {
color: $mocp-text-5; color: $mocp-text-5;
...@@ -89,6 +116,21 @@ ...@@ -89,6 +116,21 @@
.mocp-color-success-1 { .mocp-color-success-1 {
color: $mocp-success-1; color: $mocp-success-1;
} }
.mocp-border-success-7 {
border: 2rpx solid $mocp-success-7;
}
.mocp-border-success-6 {
border: 2rpx solid $mocp-success-6;
}
.mocp-border-success-3 {
border: 2rpx solid $mocp-success-3;
}
.mocp-border-success-2 {
border: 2rpx solid $mocp-success-2;
}
.mocp-border-success-1 {
border: 2rpx solid $mocp-success-1;
}
/* 警告/提醒 Warning/Notice */ /* 警告/提醒 Warning/Notice */
.mocp-bg-warning-7 { .mocp-bg-warning-7 {
background: $mocp-warning-7; background: $mocp-warning-7;
...@@ -120,6 +162,21 @@ ...@@ -120,6 +162,21 @@
.mocp-color-warning-1 { .mocp-color-warning-1 {
color: $mocp-warning-1; color: $mocp-warning-1;
} }
.mocp-border-warning-7 {
border: 2rpx solid $mocp-warning-7;
}
.mocp-border-warning-6 {
border: 2rpx solid $mocp-warning-6;
}
.mocp-border-warning-3 {
border: 2rpx solid $mocp-warning-3;
}
.mocp-border-warning-2 {
border: 2rpx solid $mocp-warning-2;
}
.mocp-border-warning-1 {
border: 2rpx solid $mocp-warning-1;
}
/* 错误 Danger */ /* 错误 Danger */
.mocp-bg-danger-7 { .mocp-bg-danger-7 {
background: $mocp-danger-7; background: $mocp-danger-7;
...@@ -151,3 +208,18 @@ ...@@ -151,3 +208,18 @@
.mocp-color-danger-1 { .mocp-color-danger-1 {
color: $mocp-danger-1; color: $mocp-danger-1;
} }
.mocp-border-danger-7 {
border: 2rpx solid $mocp-danger-7;
}
.mocp-border-danger-6 {
border: 2rpx solid $mocp-danger-6;
}
.mocp-border-danger-3 {
border: 2rpx solid $mocp-danger-3;
}
.mocp-border-danger-2 {
border: 2rpx solid $mocp-danger-2;
}
.mocp-border-danger-1 {
border: 2rpx solid $mocp-danger-1;
}
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