|
@@ -6,7 +6,7 @@
|
|
: [{{ item.x }}, {{ item.y }}, {{ item.w }}, {{ item.h }}]
|
|
: [{{ item.x }}, {{ item.y }}, {{ item.w }}, {{ item.h }}]
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
</div> -->
|
|
- <div class="vueGridLayout">
|
|
|
|
|
|
+ <div class="vueGridLayout" v-if="!editModelBool">
|
|
<div class="board" style="width: 100%">
|
|
<div class="board" style="width: 100%">
|
|
<div class="home">
|
|
<div class="home">
|
|
<grid-layout
|
|
<grid-layout
|
|
@@ -21,40 +21,69 @@
|
|
:use-css-transforms="true"
|
|
:use-css-transforms="true"
|
|
>
|
|
>
|
|
<grid-item
|
|
<grid-item
|
|
- v-for="item in mainData"
|
|
|
|
|
|
+ v-for="(item, index) in mainData"
|
|
:x="item.x"
|
|
:x="item.x"
|
|
:y="item.y"
|
|
:y="item.y"
|
|
:w="item.w"
|
|
:w="item.w"
|
|
:h="item.h"
|
|
:h="item.h"
|
|
:i="item.i"
|
|
:i="item.i"
|
|
:key="item.i"
|
|
:key="item.i"
|
|
|
|
+ :style="{
|
|
|
|
+ background:
|
|
|
|
+ item.backgroundColor === null
|
|
|
|
+ ? '#FFFFFF'
|
|
|
|
+ : item.backgroundColor,
|
|
|
|
+ }"
|
|
>
|
|
>
|
|
|
|
+ <div
|
|
|
|
+ v-if="updateModelBool"
|
|
|
|
+ style="float: right; position: relative; z-index: 999"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ text="primary"
|
|
|
|
+ link
|
|
|
|
+ style="margin-left: 0px; padding: 5px 6px"
|
|
|
|
+ @click="modelEdit(index)"
|
|
|
|
+ >
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="text"
|
|
|
|
+ text="primary"
|
|
|
|
+ link
|
|
|
|
+ style="margin-left: 0px; padding: 5px 6px"
|
|
|
|
+ @click="modelDelete(index)"
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
<div
|
|
<div
|
|
v-if="item.colorType === 'iconText'"
|
|
v-if="item.colorType === 'iconText'"
|
|
- :style="'display: flex; height:100%;'"
|
|
|
|
|
|
+ style="display: flex; height: 100%"
|
|
>
|
|
>
|
|
<div
|
|
<div
|
|
- :style="{
|
|
|
|
- padding: '0px 20px',
|
|
|
|
- 'text-align': 'center',
|
|
|
|
- margin: 'auto 0',
|
|
|
|
- }"
|
|
|
|
|
|
+ style="padding: 0px 20px; text-align: center; margin: auto 0"
|
|
>
|
|
>
|
|
- <img :src="item.img" alt="" />
|
|
|
|
|
|
+ <img :src="item.iconPath" alt="" />
|
|
</div>
|
|
</div>
|
|
- <div
|
|
|
|
- :style="{
|
|
|
|
- margin: 'auto 0',
|
|
|
|
- }"
|
|
|
|
- >
|
|
|
|
- <div style="color: black">{{ item.name }}</div>
|
|
|
|
|
|
+ <div style="margin: auto 0">
|
|
<div
|
|
<div
|
|
:style="{
|
|
:style="{
|
|
- color: item.valueColor,
|
|
|
|
|
|
+ color: item.dataNameColor,
|
|
|
|
+ 'font-size': item.dataNameFont + 'px',
|
|
|
|
+ }"
|
|
|
|
+ >
|
|
|
|
+ {{ item.dataName }}
|
|
|
|
+ </div>
|
|
|
|
+ <div
|
|
|
|
+ :style="{
|
|
|
|
+ color: item.dataValueColor,
|
|
|
|
+ 'font-size': item.dataValueFont + 'px',
|
|
'font-weight': 800,
|
|
'font-weight': 800,
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
- {{ item.value }}
|
|
|
|
|
|
+ {{ item.textValue }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -64,16 +93,16 @@
|
|
padding: '0px 5px',
|
|
padding: '0px 5px',
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
- <img :src="item.img" alt="" />
|
|
|
|
|
|
+ <img :src="item.iconPath" alt="" />
|
|
<span
|
|
<span
|
|
:style="{
|
|
:style="{
|
|
- color: item.valueColor,
|
|
|
|
|
|
+ color: item.dataValueColor,
|
|
'font-weight': 800,
|
|
'font-weight': 800,
|
|
'padding-top': '1px',
|
|
'padding-top': '1px',
|
|
'padding-left': '5px',
|
|
'padding-left': '5px',
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
- {{ item.name }}
|
|
|
|
|
|
+ {{ item.dataName }}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -83,16 +112,16 @@
|
|
padding: '0px 5px',
|
|
padding: '0px 5px',
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
- <img :src="item.img" alt="" />
|
|
|
|
|
|
+ <img :src="item.iconPath" alt="" />
|
|
<span
|
|
<span
|
|
:style="{
|
|
:style="{
|
|
- color: item.valueColor,
|
|
|
|
|
|
+ color: item.dataValueColor,
|
|
'font-weight': 800,
|
|
'font-weight': 800,
|
|
'padding-top': '1px',
|
|
'padding-top': '1px',
|
|
'padding-left': '5px',
|
|
'padding-left': '5px',
|
|
}"
|
|
}"
|
|
>
|
|
>
|
|
- {{ item.name }}
|
|
|
|
|
|
+ {{ item.dataName }}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -104,150 +133,228 @@
|
|
{{ updateBtnName }}
|
|
{{ updateBtnName }}
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <div v-if="editModelBool">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="modelEditDefine()"
|
|
|
|
+ style="margin-bottom: 15px"
|
|
|
|
+ >
|
|
|
|
+ 确定
|
|
|
|
+ </el-button>
|
|
|
|
+
|
|
|
|
+ <div v-if="editModelList.colorType === 'iconText'">
|
|
|
|
+ <iconText :editModellist="editModelList"></iconText>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="editModelList.colorType === 'echarts'">
|
|
|
|
+ <echarts :editModellist="editModelList"></echarts>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-if="editModelList.colorType === 'tabls'">
|
|
|
|
+ <!-- <a-tabls></a-tabls> -->
|
|
|
|
+ <atabls :editModellist="editModelList"></atabls>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import { dependencies, devDependencies } from '*/package.json'
|
|
import { dependencies, devDependencies } from '*/package.json'
|
|
import { GridLayout, GridItem } from 'vue-grid-layout'
|
|
import { GridLayout, GridItem } from 'vue-grid-layout'
|
|
|
|
+import iconText from './componentModel/iconText.vue'
|
|
|
|
+import Echarts from './componentModel/echarts.vue'
|
|
|
|
+import Atabls from './componentModel/Atabls.vue'
|
|
|
|
+import * as api from '@/api/index/index.js'
|
|
|
|
+
|
|
|
|
+import { useStore } from 'vuex'
|
|
|
|
+import { defineComponent, ref, onMounted } from 'vue'
|
|
|
|
+import { onBeforeRouteLeave } from 'vue-router'
|
|
|
|
|
|
-export default {
|
|
|
|
|
|
+export default defineComponent({
|
|
components: {
|
|
components: {
|
|
GridLayout,
|
|
GridLayout,
|
|
GridItem,
|
|
GridItem,
|
|
|
|
+ iconText,
|
|
|
|
+ Echarts,
|
|
|
|
+ Atabls,
|
|
},
|
|
},
|
|
- data() {
|
|
|
|
|
|
+ setup() {
|
|
|
|
+ const store = useStore()
|
|
|
|
+
|
|
|
|
+ const updateBtnName = ref('编辑')
|
|
|
|
+ const updateModelBool = ref(false)
|
|
|
|
+ const mainData = ref([])
|
|
|
|
+ const editModelBool = ref(false)
|
|
|
|
+ const editModelList = ref([])
|
|
|
|
+
|
|
|
|
+ const modelSelect = () => {
|
|
|
|
+ api
|
|
|
|
+ .getBulletinCruxConfigList({
|
|
|
|
+ siteId: store.state.siteId,
|
|
|
|
+ })
|
|
|
|
+ .then((requset) => {
|
|
|
|
+ console.log(requset.data)
|
|
|
|
+ mainData.value = requset.data
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const updateModel = () => {
|
|
|
|
+ if (updateModelBool.value === true) {
|
|
|
|
+ var bool = confirm('系统不会保存您所做的更改,确定离开吗?')
|
|
|
|
+ if (bool === false) {
|
|
|
|
+ modelSelect()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ updateModelBool.value = !updateModelBool.value
|
|
|
|
+ if (updateModelBool.value === false) {
|
|
|
|
+ updateBtnName.value = '编辑'
|
|
|
|
+ } else {
|
|
|
|
+ updateBtnName.value = '取消'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const modelEdit = (i) => {
|
|
|
|
+ editModelBool.value = !editModelBool.value
|
|
|
|
+
|
|
|
|
+ editModelList.value = []
|
|
|
|
+ editModelList.value = mainData.value[i]
|
|
|
|
+ }
|
|
|
|
+ const modelDelete = (i) => {
|
|
|
|
+ console.log(mainData.value[i])
|
|
|
|
+ mainData.value.splice(i, 1)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const modelEditDefine = () => {
|
|
|
|
+ editModelBool.value = !editModelBool.value
|
|
|
|
+
|
|
|
|
+ if (editModelList.value.colorType === 'iconText') {
|
|
|
|
+ api
|
|
|
|
+ .editBulletinCruxConfig({
|
|
|
|
+ id: editModelList.value.id,
|
|
|
|
+ dataName: editModelList.value.dataName,
|
|
|
|
+ dataType: editModelList.value.dataType,
|
|
|
|
+ dataValue: editModelList.value.dataValue,
|
|
|
|
+ backgroundColor: editModelList.value.backgroundColor,
|
|
|
|
+ dataNameColor: editModelList.value.dataNameColor,
|
|
|
|
+ dataValueColor: editModelList.value.dataValueColor,
|
|
|
|
+ dataNameFont: editModelList.value.dataNameFont,
|
|
|
|
+ dataValueFont: editModelList.value.dataValueFont,
|
|
|
|
+ iconPath: editModelList.value.iconPath,
|
|
|
|
+ coordinatex: editModelList.value.x,
|
|
|
|
+ coordinatey: editModelList.value.y,
|
|
|
|
+ wide: editModelList.value.w,
|
|
|
|
+ high: editModelList.value.h,
|
|
|
|
+ siteId: store.state.siteId,
|
|
|
|
+ })
|
|
|
|
+ .then((requset) => {
|
|
|
|
+ modelSelect()
|
|
|
|
+ console.log(requset)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (editModelList.value.colorType === 'echarts') {
|
|
|
|
+ api
|
|
|
|
+ .editBulletinHistoricalConfig({
|
|
|
|
+ id: editModelList.value.id,
|
|
|
|
+ dataTitle: editModelList.value.dataName,
|
|
|
|
+ iconPath: editModelList.value.iconPath,
|
|
|
|
+ siteId: store.state.siteId,
|
|
|
|
+ coordinatex: editModelList.value.x,
|
|
|
|
+ coordinatey: editModelList.value.y,
|
|
|
|
+ wide: editModelList.value.w,
|
|
|
|
+ high: editModelList.value.h,
|
|
|
|
+
|
|
|
|
+ queryCycle: 1, //查询周期 1本日 2本月
|
|
|
|
+ queryType: 1, //查询类型 1平均 2最大
|
|
|
|
+ maxDimension: 1, //最大值是否标注 0否 1是
|
|
|
|
+ minDimension: 1, //最小值是否标注 0否 1是
|
|
|
|
+ meanDimension: 0, //平均值是否标注 0否 1是
|
|
|
|
+ lonAdaptation: 0, //纵轴自适应 0否 1是
|
|
|
|
+ bulletinHistoricalRelationList: [
|
|
|
|
+ {
|
|
|
|
+ deviceId: 458, //监控设备id
|
|
|
|
+ variableId: 10870, //变量id
|
|
|
|
+ graphicColor: '#555', //统计图颜色
|
|
|
|
+ graphicType: 1, //1折线图 2柱形图
|
|
|
|
+ displayName: 'A相电流', //显示名称
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ deviceId: 458,
|
|
|
|
+ variableId: 10871,
|
|
|
|
+ graphicColor: '#555',
|
|
|
|
+ graphicType: 1,
|
|
|
|
+ displayName: 'B相电流',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ deviceId: 458,
|
|
|
|
+ variableId: 10872,
|
|
|
|
+ graphicColor: '#555',
|
|
|
|
+ graphicType: 1,
|
|
|
|
+ displayName: 'C相电流',
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ })
|
|
|
|
+ .then((requset) => {
|
|
|
|
+ modelSelect()
|
|
|
|
+ console.log(requset)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (editModelList.value.colorType === 'tabls') {
|
|
|
|
+ api
|
|
|
|
+ .editBulletinAlarmConfig({
|
|
|
|
+ id: 1,
|
|
|
|
+ listTitle: editModelList.value.dataName,
|
|
|
|
+ iconPath: editModelList.value.iconPath,
|
|
|
|
+ siteId: store.state.siteId,
|
|
|
|
+ coordinatex: editModelList.value.x,
|
|
|
|
+ coordinatey: editModelList.value.y,
|
|
|
|
+ wide: editModelList.value.w,
|
|
|
|
+ high: editModelList.value.h,
|
|
|
|
+ alarmType: 'PhaseLoss',
|
|
|
|
+ })
|
|
|
|
+ .then((requset) => {
|
|
|
|
+ modelSelect()
|
|
|
|
+ console.log(requset)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ onBeforeRouteLeave((to, from, next) => {
|
|
|
|
+ //离开当前的组件,触发
|
|
|
|
+ console.log(to, from)
|
|
|
|
+ if (updateModelBool.value == true) {
|
|
|
|
+ var bool = confirm('系统不会保存您所做的更改,确定离开吗?')
|
|
|
|
+ if (bool === false) {
|
|
|
|
+ next(false)
|
|
|
|
+ modelSelect()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ modelSelect()
|
|
|
|
+ })
|
|
|
|
+
|
|
return {
|
|
return {
|
|
updateTime: process.env.VUE_APP_UPDATE_TIME,
|
|
updateTime: process.env.VUE_APP_UPDATE_TIME,
|
|
dependencies: dependencies,
|
|
dependencies: dependencies,
|
|
devDependencies: devDependencies,
|
|
devDependencies: devDependencies,
|
|
|
|
|
|
- ending: null,
|
|
|
|
- dragging: null,
|
|
|
|
- dom: null,
|
|
|
|
-
|
|
|
|
- updateBtnName: '编辑',
|
|
|
|
- updateModelBool: false,
|
|
|
|
|
|
+ updateBtnName,
|
|
|
|
+ updateModelBool,
|
|
// 布局数据
|
|
// 布局数据
|
|
- mainData: [
|
|
|
|
- {
|
|
|
|
- x: 0,
|
|
|
|
- y: 0,
|
|
|
|
- w: 6,
|
|
|
|
- h: 1,
|
|
|
|
- i: '1',
|
|
|
|
- color: '#3883a0',
|
|
|
|
- name: '站点名称',
|
|
|
|
- value: '上海永天科技股份有限公司',
|
|
|
|
- valueColor: '#333333',
|
|
|
|
- colorType: 'iconText',
|
|
|
|
- img: require('@/assets/board_images/site.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- x: 6,
|
|
|
|
- y: 0,
|
|
|
|
- w: 4,
|
|
|
|
- h: 1,
|
|
|
|
- i: '2',
|
|
|
|
- color: '#4883a0',
|
|
|
|
- name: '运行天数',
|
|
|
|
- value: '1000天',
|
|
|
|
- valueColor: '#333333',
|
|
|
|
- colorType: 'iconText',
|
|
|
|
- img: require('@/assets/board_images/days.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- x: 10,
|
|
|
|
- y: 0,
|
|
|
|
- w: 4,
|
|
|
|
- h: 1,
|
|
|
|
- i: '3',
|
|
|
|
- color: '#5883a0',
|
|
|
|
- name: '今日最大负荷',
|
|
|
|
- value: '1000.00kw',
|
|
|
|
- valueColor: '#333333',
|
|
|
|
- colorType: 'iconText',
|
|
|
|
- img: require('@/assets/board_images/maxLoad.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- x: 14,
|
|
|
|
- y: 0,
|
|
|
|
- w: 4,
|
|
|
|
- h: 1,
|
|
|
|
- i: '4',
|
|
|
|
- color: '#6883a0',
|
|
|
|
- name: '站点通讯状态',
|
|
|
|
- value: '在线',
|
|
|
|
- valueColor: '#65D6A8',
|
|
|
|
- colorType: 'iconText',
|
|
|
|
- img: require('@/assets/board_images/siteAlarm.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- x: 18,
|
|
|
|
- y: 0,
|
|
|
|
- w: 4,
|
|
|
|
- h: 1,
|
|
|
|
- i: '5',
|
|
|
|
- color: '#7883a0',
|
|
|
|
- name: '站点告警状态',
|
|
|
|
- value: '离线',
|
|
|
|
- valueColor: '#f34a59',
|
|
|
|
- colorType: 'iconText',
|
|
|
|
- img: require('@/assets/board_images/siteState.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- x: 0,
|
|
|
|
- y: 1,
|
|
|
|
- w: 11,
|
|
|
|
- h: 2,
|
|
|
|
- i: '6',
|
|
|
|
- color: '#8883a0',
|
|
|
|
- name: '电流监控',
|
|
|
|
- value: '',
|
|
|
|
- valueColor: '#333333',
|
|
|
|
- colorType: 'echarts',
|
|
|
|
- img: require('@/assets/board_images/icons.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- x: 11,
|
|
|
|
- y: 1,
|
|
|
|
- w: 11,
|
|
|
|
- h: 4,
|
|
|
|
- i: '7',
|
|
|
|
- color: '#9883a0',
|
|
|
|
- name: '事件告警列表',
|
|
|
|
- value: '',
|
|
|
|
- valueColor: '#333333',
|
|
|
|
- colorType: 'tabls',
|
|
|
|
- img: require('@/assets/board_images/icons.png'),
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- x: 0,
|
|
|
|
- y: 2,
|
|
|
|
- w: 11,
|
|
|
|
- h: 2,
|
|
|
|
- i: '8',
|
|
|
|
- color: '#8883a0',
|
|
|
|
- name: '变化趋势',
|
|
|
|
- value: '',
|
|
|
|
- valueColor: '#333333',
|
|
|
|
- colorType: 'echarts',
|
|
|
|
- img: require('@/assets/board_images/icons.png'),
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
|
|
+ mainData,
|
|
|
|
+
|
|
|
|
+ editModelBool,
|
|
|
|
+ editModelList,
|
|
|
|
+
|
|
|
|
+ modelSelect,
|
|
|
|
+ updateModel,
|
|
|
|
+ modelEdit,
|
|
|
|
+ modelDelete,
|
|
|
|
+ modelEditDefine,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted() {},
|
|
|
|
- methods: {
|
|
|
|
- updateModel() {
|
|
|
|
- this.updateModelBool = !this.updateModelBool
|
|
|
|
- if (this.updateModelBool === false) {
|
|
|
|
- this.updateBtnName = '编辑'
|
|
|
|
- } else {
|
|
|
|
- this.updateBtnName = '取消'
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
-}
|
|
|
|
|
|
+})
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
.version-information {
|
|
.version-information {
|
|
@@ -266,7 +373,6 @@ export default {
|
|
margin: 5px;
|
|
margin: 5px;
|
|
padding: 5px;
|
|
padding: 5px;
|
|
background: #fff;
|
|
background: #fff;
|
|
-
|
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
@@ -281,7 +387,6 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.vue-grid-item {
|
|
.vue-grid-item {
|
|
- background: #ffffff;
|
|
|
|
border-radius: 5px;
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|