2024-09-26 09:54:34 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="workbench-edit" ref="workbenchEditRef">
|
|
|
|
|
<GridLayout
|
|
|
|
|
:layout.sync="layoutList"
|
|
|
|
|
:col-num="12"
|
|
|
|
|
:rowHeight="rowHeight"
|
|
|
|
|
:is-draggable="false"
|
|
|
|
|
:is-resizable="false"
|
|
|
|
|
:is-mirrored="false"
|
|
|
|
|
:vertical-compact="true"
|
|
|
|
|
:margin="[5, 5]"
|
|
|
|
|
>
|
|
|
|
|
<GridItem
|
|
|
|
|
v-for="item in layoutList"
|
|
|
|
|
:x="item.x"
|
|
|
|
|
:y="item.y"
|
|
|
|
|
:w="item.w"
|
|
|
|
|
:h="item.h"
|
|
|
|
|
:i="item.i"
|
|
|
|
|
:key="item.i"
|
|
|
|
|
class="gridItem"
|
|
|
|
|
>
|
|
|
|
|
<div class="item-box">
|
|
|
|
|
<component v-if="item.componentName === 'CountryMap'" :is="item.componentName" :send-geo="sendGeo"/>
|
2024-09-30 16:02:45 +08:00
|
|
|
<component v-else :is="item.componentName" @openDialog="handleDialog" :proId="proId" @handlePieDialog="handlePieDialog"/>
|
2024-09-26 09:54:34 +08:00
|
|
|
</div>
|
|
|
|
|
</GridItem>
|
|
|
|
|
</GridLayout>
|
|
|
|
|
|
|
|
|
|
<common-dialog
|
|
|
|
|
ref="dialogRef"
|
|
|
|
|
>
|
|
|
|
|
</common-dialog>
|
2024-09-30 16:02:45 +08:00
|
|
|
<PieDialog ref="pieDialog" :proId="proId" />
|
|
|
|
|
<TeamDialog ref="teamDialog" :proId="proId" />
|
|
|
|
|
<LocationDialog ref="locationDialog" :proId="proId" />
|
2024-09-26 09:54:34 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import VueGridLayout from 'vue-grid-layout'
|
|
|
|
|
import ItemOne from './item-one.vue'
|
|
|
|
|
import ItemTwo from './item-two.vue'
|
|
|
|
|
import ItemThree from './item-three.vue'
|
|
|
|
|
import ItemFour from './item-four.vue'
|
|
|
|
|
import ItemFive from './item-five.vue'
|
|
|
|
|
import ItemSix from './item-six.vue'
|
|
|
|
|
import LeftOne from '@/components/home/leftOne.vue'
|
|
|
|
|
import LeftTwo from '@/components/home/leftTwo.vue'
|
|
|
|
|
import LeftThree from '@/components/home/leftThree.vue'
|
2024-09-28 20:53:00 +08:00
|
|
|
import LeftFive from '@/components/home/leftFive.vue'
|
|
|
|
|
import LeftSix from '@/components/home/leftSix.vue'
|
|
|
|
|
import LeftSeven from '@/components/home/leftSeven.vue'
|
2024-09-30 16:02:45 +08:00
|
|
|
import leftEight from '@/components/home/leftEight.vue'
|
2024-09-26 09:54:34 +08:00
|
|
|
import RightOne from '@/components/home/rightOne.vue'
|
|
|
|
|
import RightTwo from '@/components/home/rightTwo.vue'
|
|
|
|
|
import CountryMap from '@/components/home/countryMap.vue'
|
|
|
|
|
import CommonDialog from '@/components/home/commonDialog.vue'
|
2024-09-30 16:02:45 +08:00
|
|
|
import PieDialog from '@/components/home/pieDialog.vue'
|
|
|
|
|
import TeamDialog from '@/components/home/teamDialog.vue'
|
|
|
|
|
import LocationDialog from '@/components/home/locationDialog.vue'
|
2024-09-26 09:54:34 +08:00
|
|
|
import {
|
|
|
|
|
queryTableApi
|
|
|
|
|
} from '@/api/home/home'
|
|
|
|
|
import {
|
|
|
|
|
querySubProjInfoApi
|
|
|
|
|
} from '@/api/substation/substation'
|
|
|
|
|
export default {
|
2024-09-28 20:53:00 +08:00
|
|
|
props: {
|
|
|
|
|
// layoutList: {
|
|
|
|
|
// type: Array,
|
|
|
|
|
// default: () => [
|
|
|
|
|
// // 第一行
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
|
|
|
|
proId: {
|
|
|
|
|
type: Number,
|
|
|
|
|
default: undefined,
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-09-26 09:54:34 +08:00
|
|
|
components: {
|
|
|
|
|
GridLayout: VueGridLayout.GridLayout,
|
|
|
|
|
GridItem: VueGridLayout.GridItem,
|
|
|
|
|
LeftOne,
|
|
|
|
|
LeftTwo,
|
|
|
|
|
LeftThree,
|
|
|
|
|
RightOne,
|
|
|
|
|
RightTwo,
|
|
|
|
|
CountryMap,
|
2024-09-28 20:53:00 +08:00
|
|
|
CommonDialog,
|
|
|
|
|
LeftFive,
|
|
|
|
|
LeftSix,
|
2024-09-30 16:02:45 +08:00
|
|
|
LeftSeven,
|
|
|
|
|
leftEight,
|
|
|
|
|
PieDialog,
|
|
|
|
|
TeamDialog,
|
|
|
|
|
LocationDialog
|
2024-09-26 09:54:34 +08:00
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
rowHeight: 30,
|
|
|
|
|
sendGeo: undefined,
|
|
|
|
|
layoutList: [ // 第一行
|
|
|
|
|
{
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 0,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 0,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 3,
|
|
|
|
|
y: 0,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 1,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 6,
|
|
|
|
|
y: 0,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 2,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 9,
|
|
|
|
|
y: 0,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 3,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 第二行
|
|
|
|
|
{
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 1,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 4,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 3,
|
|
|
|
|
y: 1,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 5,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 6,
|
|
|
|
|
y: 1,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 6,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 9,
|
|
|
|
|
y: 1,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 7,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 第三行
|
|
|
|
|
{
|
|
|
|
|
x: 0,
|
|
|
|
|
y: 2,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 8,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 3,
|
|
|
|
|
y: 2,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 9,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 6,
|
|
|
|
|
y: 2,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 10,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
x: 9,
|
|
|
|
|
y: 2,
|
|
|
|
|
w: 3,
|
|
|
|
|
h: 4,
|
|
|
|
|
i: 11,
|
|
|
|
|
isAccord: '1*1',
|
|
|
|
|
componentName: '',
|
|
|
|
|
},]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
2024-09-28 20:53:00 +08:00
|
|
|
setTimeout(() => {
|
|
|
|
|
console.log('created-->工程id', this.proId)
|
|
|
|
|
}, 200)
|
2024-09-26 09:54:34 +08:00
|
|
|
this.getGeoData()
|
|
|
|
|
},
|
2024-09-28 20:53:00 +08:00
|
|
|
// 监听工程id变化
|
|
|
|
|
watch: {
|
|
|
|
|
proId: {
|
|
|
|
|
handler: function (val) {
|
|
|
|
|
console.log('workbench--watch-->工程id', val)
|
|
|
|
|
},
|
|
|
|
|
immediate: true
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-09-26 09:54:34 +08:00
|
|
|
mounted() {
|
|
|
|
|
this.getTableData()
|
|
|
|
|
this.rowHeight = (this.$refs['workbenchEditRef'].clientHeight - 65) / 12
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
handleDialog(val) {
|
|
|
|
|
this.$refs.dialogRef.setOpen({
|
|
|
|
|
open: true,
|
|
|
|
|
param: val
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async getTableData() {
|
|
|
|
|
let res = await queryTableApi()
|
|
|
|
|
this.layoutList = res.data
|
|
|
|
|
},
|
|
|
|
|
async getGeoData() {
|
|
|
|
|
let res = await querySubProjInfoApi()
|
|
|
|
|
console.log(res, 'geo')
|
|
|
|
|
this.sendGeo = res.data.data.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
name: item.projectName,
|
2024-10-09 11:34:59 +08:00
|
|
|
projectId: item.projectId,
|
2024-09-26 09:54:34 +08:00
|
|
|
province: item.areaName,
|
|
|
|
|
projName: item.projectName,
|
2024-10-09 11:34:59 +08:00
|
|
|
devTypeNum: item.devTypeNum,
|
|
|
|
|
devNum: item.devNum,
|
|
|
|
|
successNum: item.successNum,
|
|
|
|
|
errorNum: item.errorNum,
|
2024-09-26 09:54:34 +08:00
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
areaColor: '#7DDEFF'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
value: [
|
|
|
|
|
Number(item.lon),
|
|
|
|
|
Number(item.lat)
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2024-09-30 16:02:45 +08:00
|
|
|
handlePieDialog(val) {
|
|
|
|
|
if (val == 1) {
|
|
|
|
|
this.$refs.pieDialog.openDialog(this.proId)
|
|
|
|
|
} else if (val == 2) {
|
|
|
|
|
this.$refs.teamDialog.openDialog(this.proId)
|
|
|
|
|
} else {
|
|
|
|
|
this.$refs.locationDialog.openDialog(this.proId)
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-26 09:54:34 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.workbench-edit {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
// background-color: skyblue;
|
|
|
|
|
|
|
|
|
|
.left-content {
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.gridItem {
|
|
|
|
|
color: #000;
|
|
|
|
|
border: 1px solid #EFF2FC;
|
|
|
|
|
box-shadow: 3px 3px 3px #D9E0F3;
|
|
|
|
|
.item-box {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background-color: #F3F7FF;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|