Parcourir la source

Merge branch 'zhangtao' of gitadmin/tuoheng_lc_web into develop

tags/v1.2.0
zhangtao il y a 1 an
Parent
révision
dec35ef086
3 fichiers modifiés avec 23 ajouts et 15 suppressions
  1. +3
    -6
      src/utils/global.js
  2. +12
    -8
      src/views/dashboard/components/Extend.vue
  3. +8
    -1
      src/views/dashboard/index.vue

+ 3
- 6
src/utils/global.js Voir le fichier

@@ -2,7 +2,6 @@ import { getToken } from './token.js'
import { fireHeart, updateWarning } from '@/api/early/fire.js'
import { router } from '@/router/index.js'
import { ref } from 'vue'
import { useDialogReactiveList } from 'naive-ui'
const hasModal = ref(false)
const hasTimer = ref(false)

@@ -12,6 +11,7 @@ export const getTimer = () => {

export const timerHeart = async function() {
if (getToken()) {
setTimeout(() => { timerHeart() }, 5000)
hasTimer.value = true
const res = await fireHeart()
if (res.code === 0) {
@@ -49,12 +49,9 @@ export const timerHeart = async function() {
}
}
)
} else {
$dialog.colseDialog()
// } else {
// $dialog.colseDialog()
}
setTimeout(() => {
timerHeart()
}, 5000)
}
} else {
hasModal.value = false

+ 12
- 8
src/views/dashboard/components/Extend.vue Voir le fichier

@@ -125,11 +125,11 @@ export default {
})
const warn = reactive({
warnList: [
{ icon: camera, label: '监控分布', value: 1, num: 0, list: [] },
{ icon: materials, label: '消防物资', value: 2, num: 0, list: [] },
{ icon: personnel, label: '防护人员', value: 3, num: 0, list: [] }
{ icon: camera, label: '监控分布', value: 'camera', num: 0, list: [] },
{ icon: materials, label: '消防物资', value: 'materials', num: 0, list: [] }
// { icon: personnel, label: '防护人员', value: 'personnel', num: 0, list: [] }
],
checkedWarn: [1, 2, 3]
checkedWarn: ['camera', 'materials']
})
const task = reactive({
taskList: [],
@@ -168,6 +168,8 @@ export default {
const handleClick = (index) => {
data.selectedTab = index
if (index === 1) {
data.portalTab = 'task'
ques.checkedQues = QUESTION_TYPE.value?.map((item) => item.value) || null
if (!data.showPatrol) {
queryTaskList()
const times = [formatDate(ques.times[0]), formatDate(ques.times[1])]
@@ -177,6 +179,7 @@ export default {
data.showWarning = false
} else {
getWarnList()
warn.checkedWarn = ['camera', 'materials']
data.showWarning = true
data.showPatrol = false
}
@@ -221,11 +224,12 @@ export default {
}
const res = await getQuestionList(params)
if (res.code === 0) {
ques.checkedQues = QUESTION_TYPE.value?.map((item) => item.value) || null
ques.message = res.data?.map((item) => {
item.icon = ICON_LIST[item.type]
return item
})
emit('send', { tabs: data.selectedTab, data: ques.message, type: ques.checkedQues })
emit('send', { tabs: data.selectedTab, data: ques.message, type: ques.checkedQues, ops: 'query' })
} else {
ques.message = null
}
@@ -238,7 +242,7 @@ export default {
warn.warnList[0].list = camera?.data || []
warn.warnList[1].num = maertral?.data?.length || 0
warn.warnList[1].list = maertral?.data || []
emit('send', { tabs: data.selectedTab, data: warn.warnList, type: warn.checkedWarn })
emit('send', { tabs: data.selectedTab, data: warn.warnList, type: warn.checkedWarn, ops: 'query' })
})
.catch(err => {
console.log(err)
@@ -251,7 +255,7 @@ export default {
* @return {*}
*/
const handleWarnChange = async(value) => {
emit('send', { tabs: data.selectedTab, data: warn.warnList, type: value })
emit('send', { tabs: data.selectedTab, data: warn.warnList, type: value, ops: 'select' })
}
/**
* @description: 变更僧林巡查问题选择
@@ -259,7 +263,7 @@ export default {
* @return {*}
*/
const handleQuesChange = async(value) => {
emit('send', { tabs: data.selectedTab, data: ques.message, type: value })
emit('send', { tabs: data.selectedTab, data: ques.message, type: value, ops: 'select' })
}

return {

+ 8
- 1
src/views/dashboard/index.vue Voir le fichier

@@ -1,7 +1,7 @@
<template>
<div class="basic">
<OneMap />
<Extend class="extend" @send="getmessage" />
<Extend ref="extendRef" class="extend" @send="getmessage" />
</div>
</template>

@@ -9,19 +9,26 @@
import { useRouter } from 'vue-router'
import OneMap from './components/OneMap.vue'
import Extend from './components/Extend.vue'
import { ref, onMounted } from 'vue'
export default {
name: 'HomePage',
components: { OneMap, Extend },
setup(props) {
const router = useRouter()
const extendRef = ref()

function toSystem() {
router.push({ path: '/login' })
}
const getmessage = (data) => {
console.log(data)
}
onMounted(() => {
extendRef.value.handleClick(0)
})
return {
toSystem,
extendRef,
getmessage
}
}

Chargement…
Annuler
Enregistrer