瀏覽代碼

add ops

tags/v1.2.0
zhangtao 1 年之前
父節點
當前提交
6ab75f3eef
共有 2 個文件被更改,包括 20 次插入9 次删除
  1. +12
    -8
      src/views/dashboard/components/Extend.vue
  2. +8
    -1
      src/views/dashboard/index.vue

+ 12
- 8
src/views/dashboard/components/Extend.vue 查看文件

@@ -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 查看文件

@@ -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
}
}

Loading…
取消
儲存