lixin пре 1 година
родитељ
комит
556b716a50
10 измењених фајлова са 339 додато и 57 уклоњено
  1. +2
    -1
      src/api/dashboard/index.js
  2. BIN
      src/assets/icon/camera.png
  3. BIN
      src/assets/icon/materials.png
  4. BIN
      src/assets/icon/personnel.png
  5. +6
    -5
      src/components/DataTable/tools/Tags.vue
  6. +189
    -33
      src/views/dashboard/components/Extend.vue
  7. +1
    -1
      src/views/dashboard/components/OneMap.vue
  8. +126
    -7
      src/views/dashboard/components/Supplies.vue
  9. +5
    -9
      src/views/dashboard/index.vue
  10. +10
    -1
      src/views/system-manage/department-manage/tools/table.js

+ 2
- 1
src/api/dashboard/index.js Прегледај датотеку

@@ -99,7 +99,8 @@ export function getQuestionList(data) {
return request({
url: `/index/getQuestionList`,
method: 'POST',
data
data,
hideMessage: true
})
}


BIN
src/assets/icon/camera.png Прегледај датотеку

Before After
Width: 16  |  Height: 14  |  Size: 318B

BIN
src/assets/icon/materials.png Прегледај датотеку

Before After
Width: 16  |  Height: 13  |  Size: 284B

BIN
src/assets/icon/personnel.png Прегледај датотеку

Before After
Width: 16  |  Height: 16  |  Size: 309B

+ 6
- 5
src/components/DataTable/tools/Tags.vue Прегледај датотеку

@@ -76,9 +76,10 @@ export default defineComponent({
/* 获取tags的属性 */
const getProps = computed(() => {
return {
...unref(props.tags),
closable: false,
bordered: props.tags?.bordered || false
bordered: false,
color: { color: 'transparent' },
...unref(props.tags)
}
})
return {
@@ -93,7 +94,7 @@ export default defineComponent({
</script>

<style scoped lang='scss'>
.n-tag{
background: transparent;
}
// .n-tag{
// background: transparent;
// }
</style>

+ 189
- 33
src/views/dashboard/components/Extend.vue Прегледај датотеку

@@ -5,6 +5,26 @@
<p :style="{color: selectedTab === index ? item.selected.color : '#eee'}">{{ item.name }}</p>
</div>

<div v-if="showWarning" class="warning__modal">
<div class="warning__container">
<div class="container__checkbox">
<n-checkbox-group
v-model:value="checkedWarn"
@update:value="handleWarnChange"
>
<div v-for="(item, index) in warnList" :key="index" class="warn__item">
<img :src="item.icon" alt="">
<n-checkbox
:value="item.value"
:label="item.label"
/>
<span>{{ item.num }}</span>
</div>
</n-checkbox-group>
</div>
</div>
</div>

<div v-if="showPatrol" class="portal__modal">
<p class="portal__title">
<span :class="{'selected': portalTab ==='task'}" @click="handleTabChage('task')">任务</span>
@@ -52,14 +72,13 @@
</div>
<div class="container__checkbox">
<n-checkbox-group
v-model:value="checkedType"
@update:value="handleRadioChange"
v-model:value="checkedQues"
@update:value="handleQuesChange"
>
<div v-for="(item, index) in QUESTION_TYPE" :key="index">
<n-checkbox
:value="item.content"
:label="item.content"
style="color: #ffffff"
:value="item.value"
:label="item.label"
/>
</div>
</n-checkbox-group>
@@ -70,15 +89,29 @@
</template>

<script>
import { reactive, toRefs } from 'vue'
import { onMounted, reactive, toRefs } from 'vue'
import { startOfDay } from 'date-fns/esm'
import { getMissionList, getQuestionList } from '@/api/dashboard/index.js'
import { cameraList } from '@/api/basic/monitor.js'
import { materialList } from '@/api/basic/material.js'
import { formatDate } from '@/utils/index.js'
import { QUESTION_TYPE } from '@/utils/dictionary.js'

import personnel_icon from '@/assets/images/personnelActivities.png'
import problemSpot_icon from '@/assets/images/problemSpot.png'
import deadTree_icon from '@/assets/images/deadTree.png'
import fireHazard_icon from '@/assets/images/fireHazard.png'
import camera from '@/assets/icon/camera.png'
import materials from '@/assets/icon/materials.png'
import personnel from '@/assets/icon/personnel.png'
const ICON_LIST = {
'002000': problemSpot_icon,
'002001': deadTree_icon,
'002003': personnel_icon,
'002004': fireHazard_icon
}
export default {
name: 'MapExtend',
emits: [],
emits: ['send'],
setup(props, { emit }) {
const data = reactive({
selectedTab: 0,
@@ -86,9 +119,18 @@ export default {
{ name: '火灾预警', path: 'warning', selected: { color: 'rgba(51, 133, 255, 1)', path: 'warning_select' }},
{ name: '森林巡查', path: 'patrol', selected: { color: 'rgba(51, 133, 255, 1)', path: 'patrol_select' }}
],
showWarning: true,
showPatrol: false,
portalTab: 'task'
})
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: [] }
],
checkedWarn: [1, 2]
})
const task = reactive({
taskList: [],
taskParams: {
@@ -113,20 +155,36 @@ export default {
}
return ts > Date.now()
},
checkedType: QUESTION_TYPE.value?.map((item) => item.content) || null,
checkedQues: QUESTION_TYPE.value?.map((item) => item.value) || null,
message: null,
QUESTION_TYPE
})

/**
* @description: 点击面板
* @param {*} index 0火灾预警,1森林巡查
* @return {*}
*/
const handleClick = (index) => {
data.selectedTab = index
if (index === 1) {
if (!data.showPatrol) {
queryTaskList()
const times = [formatDate(ques.times[0]), formatDate(ques.times[1])]
handleDateChange(times)
}
data.showPatrol = true
data.showWarning = false
} else {
getWarnList()
data.showWarning = true
data.showPatrol = false
}
}

/**
* @description: 查询问题列表
* @return {*}
*/
const queryTaskList = async() => {
const res = await getMissionList(task.taskParams)
if (res.code === 0) {
@@ -136,7 +194,7 @@ export default {
}

/**
* @description:
* @description: 切换tab
* @return {*}
*/
const handleTabChage = (type) => {
@@ -144,26 +202,73 @@ export default {
}

/**
* @description:
* @description: 切换分页
* @return {*}
*/
const handlePageChange = () => {
queryTaskList()
}

const handleDateChange = (value) => {
console.log(ques.times)
}
const handleRadioChange = async() => {
/**
* @description: 切换时间
* @param {*} value
* @return {*}
*/
const handleDateChange = async(value) => {
const params = {
startTime: ques.times[0],
endTime: ques.times[1]
startTime: value[0],
endTime: value[1]
}
const res = await getQuestionList(params)
emit('test', res.data)
if (res.code === 0) {
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 })
} else {
ques.message = null
}
}

const getWarnList = async() => {
Promise.all([await cameraList(), await materialList()])
.then(([camera, maertral]) => {
warn.warnList[0].num = camera?.data?.length || 0
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 })
})
.catch(err => {
console.log(err)
})
}

/**
* @description: 变更火灾预警选择
* @param {*} value
* @return {*}
*/
const handleWarnChange = async(value) => {
emit('send', { tabs: data.selectedTab, data: warn.warnList, type: value })
}
/**
* @description: 变更僧林巡查问题选择
* @param {*} value
* @return {*}
*/
const handleQuesChange = async(value) => {
emit('send', { tabs: data.selectedTab, data: ques.message, type: value })
}

onMounted(() => {
getWarnList()
})

return {
...toRefs(data),
...toRefs(warn),
...toRefs(task),
...toRefs(ques),
handleClick,
@@ -172,7 +277,8 @@ export default {
handleTabChage,
handlePageChange,
handleDateChange,
handleRadioChange
handleWarnChange,
handleQuesChange
}
}
}
@@ -205,7 +311,35 @@ export default {
color: #eee;
}
}
.portal__modal {
.warning__modal{
position: absolute;
white-space: nowrap;
top: 100px;
border-radius: 1px;
background: rgba(0, 0, 0, 1);
padding: 5px;
color: #E8E8E8;
animation: scale-up-tl 0.4s cubic-bezier(0.39,0.575,0.565,1.000) both;
.warning__container{
width: 100%;
height: 100%;
padding: 10px;
background: #2c2c2c;
}
.warn__item{
display: flex;
align-items: center;
}
::v-deep(.container__checkbox){
.n-checkbox{
margin: 0 10px
}
.n-checkbox__label{
color: #E8E8E8;
}
}
}
.portal__modal{
position: absolute;
width: 400px;
height: 428px;
@@ -213,7 +347,7 @@ export default {
border-radius: 1px;
background: rgba(0, 0, 0, 1);
padding: 0 5px 5px;
animation: scale-up-tr 0.4s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
animation: scale-up-tl 0.4s cubic-bezier(0.39,0.575,0.565,1.000) both;
.portal__title{
display: flex;
align-items: center;
@@ -259,6 +393,12 @@ export default {
}
}
}
::v-deep(.container__checkbox){
margin: 15px 0 0 5px;
.n-checkbox__label{
color: #E8E8E8;
}
}
}
::v-deep(.container__page){
.n-pagination{
@@ -276,20 +416,36 @@ export default {
}
}
}
::v-deep(.container__checkbox){
margin: 15px 0 0 5px;
.n-checkbox__label{
color: #ffffff;
::v-deep(.n-checkbox.n-checkbox--checked){
.n-checkbox-box{
background-color: #C4C4C4;
}
.n-checkbox-box__border{
border-color: #C4C4C4;
}
.check-icon{
fill: #252525;
}
}
::v-deep(.n-checkbox:hover){
.n-checkbox-box__border{
border-color: #C4C4C4;
}
}
::v-deep(.n-checkbox:focus:not(:active)){
.n-checkbox-box .n-checkbox-box__border{
border-color: #C4C4C4;
box-shadow: 0 0 0 2px rgba(196, 196, 196, 0.3);
}
}
@keyframes scale-up-tr {
0% {
transform: scale(0.5);
transform-origin: 100% 0%;
@keyframes scale-up-tl {
0%{
transform:scale(0.5);
transform-origin:0 0;
}
100% {
transform: scale(1);
transform-origin: 100% 0%;
100%{
transform:scale(1);
transform-origin:0 0;
}
}


+ 1
- 1
src/views/dashboard/components/OneMap.vue Прегледај датотеку

@@ -736,7 +736,7 @@ export default {
}

const test = (data) => {
console.log(777)
console.log(data)
}

onMounted(() => {

+ 126
- 7
src/views/dashboard/components/Supplies.vue Прегледај датотеку

@@ -1,18 +1,91 @@

<template>
<div class="supplies-content">
<div v-show="suppliesShow" class="supplies-content">
<div class="supplies-title">
<p>消防物资</p>
<span class="close-supplies" />
<span class="close-supplies" @click="suppliesShow = false" />
</div>

<p class="supplies-type">
<img :src="`/src/assets/gis/images/toLeft.png`">
<img :src="`/src/assets/gis/images/toLeft.png`" @click="deSuppliesIndex">
<span v-for="(item ,index) in MATERIAL_TYPE" v-show="item.value === suppliesType" :key="index">
{{ item.label }}
</span>
<img :src="`/src/assets/gis/images/toRight.png`">
<img :src="`/src/assets/gis/images/toRight.png`" @click="inSuppliesIndex">
</p>

<div class="supplies-table">
<ul class="table-title">
<li>
<span>序号</span>
<span>物资名称</span>
<span>作用</span>
</li>
</ul>
<ul class="table-content">
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
<li>
<span>1</span>
<span>干粉灭火器</span>
<span>灭火</span>
</li>
</ul>
</div>

</div>
</template>
<script>
@@ -30,6 +103,7 @@ export default {
},
setup(props) {
const data = reactive({
suppliesShow: true,
MATERIAL_TYPE,
suppliesType: 1
})
@@ -37,8 +111,20 @@ export default {
watch(() => props.data, (value) => {
})

const deSuppliesIndex = () => {
// type索引自减一
data.suppliesType = data.suppliesType === 1 ? MATERIAL_TYPE.length : --data.suppliesType
}

const inSuppliesIndex = () => {
// type索引自增一
data.suppliesType = data.suppliesType < MATERIAL_TYPE.length ? ++data.suppliesType : 1
}

return {
...toRefs(data)
...toRefs(data),
deSuppliesIndex,
inSuppliesIndex
}
}
}
@@ -50,7 +136,7 @@ export default {
left: 430px;
top: 422px;
width: 282px;
height: 419px;
height: 409px;
background-color: rgba(0, 0, 0, 0.8);
}
.supplies-title {
@@ -74,7 +160,6 @@ export default {
cursor: pointer;
}
}

.supplies-type {
width: 270px;
height: 32px;
@@ -98,5 +183,39 @@ export default {

}

.supplies-table {
width: 270px;
height: 335px;
background: rgba(61, 61, 61, 1);
margin-left: 6px;
margin-top: 2px;
}

.supplies-table li {
width: 100%;
height: 30px;
line-height: 30px;

span {
width: 90px;
height: 30px;
line-height: 30px;
display: inline-block;
color: #fff;
font-size: 12px;
text-align: center;
}
}

::v-deep(.table-content) {
height: 300px;
overflow: auto;
scrollbar-width: none;
-ms-overflow-style: none;
&::-webkit-scrollbar {
display: none;
}
}

</style>


+ 5
- 9
src/views/dashboard/index.vue Прегледај датотеку

@@ -1,7 +1,7 @@
<template>
<div class="basic">
<OneMap ref="Map" />
<Extend class="extend" @test="addLayer" />
<Extend class="extend" @send="getmessage" />
<Supplies />
</div>
</template>
@@ -17,21 +17,17 @@ export default {
components: { OneMap, Extend, Supplies },
setup(props) {
const router = useRouter()
const Map = ref()
function toSystem() {
router.push({ path: '/login' })
}

// RefChilde 要和Son组件上的class名相同
const Map = ref()
const addLayer = (data) => {
console.log(data)
const getmessage = (data) => {
Map.value.test(data)
}

return {
toSystem,
Map,
addLayer
getmessage,
Map
}
}
}

+ 10
- 1
src/views/system-manage/department-manage/tools/table.js Прегледај датотеку

@@ -45,10 +45,19 @@ const data = reactive({
handleSearch,

columns: [
{
title: '序号',
key: 'key',
render: (_, index) => {
return `${index + 1}`
},
align: 'center'
},
{
title: '部门编号',
key: 'code',
align: 'center'
align: 'center',
width: 200
},
{
title: '部门名称',

Loading…
Откажи
Сачувај