|
@@ -29,13 +29,17 @@
|
|
<div class="location-item">
|
|
<div class="location-item">
|
|
<div class="item-title">{{ location.title }} :</div>
|
|
<div class="item-title">{{ location.title }} :</div>
|
|
<div>
|
|
<div>
|
|
- <a-radio-group v-model:value="location.isVisible" :name="location.deviceType">
|
|
|
|
|
|
+ <a-radio-group v-model:value="location.Visible" :name="location.deviceType">
|
|
<a-radio :value="1">是</a-radio>
|
|
<a-radio :value="1">是</a-radio>
|
|
<a-radio :value="0">否</a-radio>
|
|
<a-radio :value="0">否</a-radio>
|
|
</a-radio-group>
|
|
</a-radio-group>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
+ <div class="location-bottom-btn">
|
|
|
|
+ <span @click="setLocation">提交</span>
|
|
|
|
+ <span @click="resetLocation">重置</span>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -107,7 +111,6 @@
|
|
import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, nextTick } from 'vue'
|
|
import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, nextTick } from 'vue'
|
|
import { SendOutlined } from '@ant-design/icons-vue';
|
|
import { SendOutlined } from '@ant-design/icons-vue';
|
|
import { list, getDeviceList, getDeviceTypeList } from './device.api'
|
|
import { list, getDeviceList, getDeviceTypeList } from './device.api'
|
|
-// import { locationList } from './device.data'
|
|
|
|
import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
|
|
import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
|
|
import HistoryTable from '../comment/HistoryTable.vue';
|
|
import HistoryTable from '../comment/HistoryTable.vue';
|
|
import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
|
|
import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
|
|
@@ -116,11 +119,11 @@ import GroupMonitorTable from '../comment/GroupMonitorTable.vue';
|
|
import { TreeProps, message } from 'ant-design-vue';
|
|
import { TreeProps, message } from 'ant-design-vue';
|
|
import { TableAction } from '/@/components/Table';
|
|
import { TableAction } from '/@/components/Table';
|
|
import FiberModal from './modal/fiber.modal.vue';
|
|
import FiberModal from './modal/fiber.modal.vue';
|
|
|
|
+import BundleModal from './modal/bundle.modal.vue'
|
|
import DustModal from './modal/dust.modal.vue'
|
|
import DustModal from './modal/dust.modal.vue'
|
|
import { SvgIcon } from '/@/components/Icon';
|
|
import { SvgIcon } from '/@/components/Icon';
|
|
import { getActions } from '/@/qiankun/state';
|
|
import { getActions } from '/@/qiankun/state';
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
-import { initDictOptions } from '/@/utils/dict/index';
|
|
|
|
|
|
|
|
|
|
|
|
type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
|
|
type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
|
|
@@ -147,8 +150,9 @@ const treeShow = ref(true) //是否显示树形菜单
|
|
const locationSettingShow = ref(false) //是否显示树形菜单
|
|
const locationSettingShow = ref(false) //是否显示树形菜单
|
|
const treeNodeTitle = ref('') // 选中的树形标题
|
|
const treeNodeTitle = ref('') // 选中的树形标题
|
|
|
|
|
|
-const locationList = ref([])
|
|
|
|
-const deviceList = ref<DeviceType[]>([])
|
|
|
|
|
|
+const locationList = ref([]) //巷道定位图标显示列表
|
|
|
|
+let locationListTemp = []
|
|
|
|
+const deviceList = ref<DeviceType[]>([]) //关联设备列表
|
|
const deviceActive = ref('')
|
|
const deviceActive = ref('')
|
|
const activeKey = ref('1'); // tab key
|
|
const activeKey = ref('1'); // tab key
|
|
const dataSource = shallowRef([]) // 实时监测数据
|
|
const dataSource = shallowRef([]) // 实时监测数据
|
|
@@ -180,13 +184,14 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
|
|
}
|
|
}
|
|
selectedKeys.values = keys
|
|
selectedKeys.values = keys
|
|
treeNodeTitle.value = e.node.title
|
|
treeNodeTitle.value = e.node.title
|
|
- debugger
|
|
|
|
if(timer) clearTimeout(timer)
|
|
if(timer) clearTimeout(timer)
|
|
timer = undefined
|
|
timer = undefined
|
|
if (monitorTable.value) monitorTable.value.setLoading(true)
|
|
if (monitorTable.value) monitorTable.value.setLoading(true)
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
- timer = null
|
|
|
|
- getMonitor()
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ timer = null
|
|
|
|
+ getMonitor()
|
|
|
|
+ }, 0)
|
|
})
|
|
})
|
|
|
|
|
|
};
|
|
};
|
|
@@ -227,9 +232,7 @@ async function getDeviceType() {
|
|
});
|
|
});
|
|
return dataSourceList
|
|
return dataSourceList
|
|
}
|
|
}
|
|
- console.log('树形菜单-------------->', treeData.value)
|
|
|
|
treeData.value = getData(result, dataSource, key)
|
|
treeData.value = getData(result, dataSource, key)
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -261,7 +264,7 @@ async function getDataSource() {
|
|
deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
|
|
deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- console.log('关联设备列表', deviceArr)
|
|
|
|
|
|
+
|
|
deviceList.value = deviceArr
|
|
deviceList.value = deviceArr
|
|
deviceActive.value = deviceArr[1].deviceType
|
|
deviceActive.value = deviceArr[1].deviceType
|
|
monitorChange(1)
|
|
monitorChange(1)
|
|
@@ -301,10 +304,6 @@ function setDivHeight(e: MouseEvent) {
|
|
document.onmousemove = null
|
|
document.onmousemove = null
|
|
if (scroll.value.y != drawerHeight.value - 100) {
|
|
if (scroll.value.y != drawerHeight.value - 100) {
|
|
scroll.value = { y: drawerHeight.value - 100 }
|
|
scroll.value = { y: drawerHeight.value - 100 }
|
|
-
|
|
|
|
- // const tableBody = document.getElementsByClassName('zxm-table-container')[0].children[1] as HTMLElement
|
|
|
|
- // debugger
|
|
|
|
- // tableBody.style.height = `${drawerHeight.value - 350}px`
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -312,6 +311,7 @@ function setDivHeight(e: MouseEvent) {
|
|
function goLocation(record) {
|
|
function goLocation(record) {
|
|
actions.setGlobalState({ locationId: record.deviceID, locationObj: null, pageObj: null });
|
|
actions.setGlobalState({ locationId: record.deviceID, locationObj: null, pageObj: null });
|
|
}
|
|
}
|
|
|
|
+
|
|
function goDetail(record?) {
|
|
function goDetail(record?) {
|
|
|
|
|
|
if (record) {
|
|
if (record) {
|
|
@@ -319,10 +319,14 @@ function goDetail(record?) {
|
|
activeID.value = record.deviceID
|
|
activeID.value = record.deviceID
|
|
currentModal.value = FiberModal
|
|
currentModal.value = FiberModal
|
|
modalVisible.value = true;
|
|
modalVisible.value = true;
|
|
- } else if (deviceType.value.startsWith('dusting')) {
|
|
|
|
|
|
+ } else if (deviceType.value.startsWith('dusting')) { //bundletube
|
|
activeID.value = record.deviceID
|
|
activeID.value = record.deviceID
|
|
currentModal.value = DustModal
|
|
currentModal.value = DustModal
|
|
modalVisible.value = true;
|
|
modalVisible.value = true;
|
|
|
|
+ } else if (deviceType.value.startsWith('bundletube')) {
|
|
|
|
+ activeID.value = record.deviceID
|
|
|
|
+ currentModal.value = BundleModal
|
|
|
|
+ modalVisible.value = true;
|
|
} else if (deviceType.value.indexOf("gate") != -1) {
|
|
} else if (deviceType.value.indexOf("gate") != -1) {
|
|
const newPage = router.resolve({ path: '/monitorChannel/monitor-gate' })
|
|
const newPage = router.resolve({ path: '/monitorChannel/monitor-gate' })
|
|
window.open(newPage.href, '_blank')
|
|
window.open(newPage.href, '_blank')
|
|
@@ -393,7 +397,6 @@ async function findTreeDataValue(data: [], obj) {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
findDeviceType(data, obj)
|
|
findDeviceType(data, obj)
|
|
- debugger
|
|
|
|
if (timer === undefined) {
|
|
if (timer === undefined) {
|
|
timer = null
|
|
timer = null
|
|
await getDataSource()
|
|
await getDataSource()
|
|
@@ -419,7 +422,27 @@ function monitorChange(index) {
|
|
handlerHistoryTable.value.setLoading(true)
|
|
handlerHistoryTable.value.setLoading(true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+/**
|
|
|
|
+ * 设置巷道设备定位图标的显示与隐藏
|
|
|
|
+ */
|
|
|
|
+function setLocation() {
|
|
|
|
+ let locationStr = ''
|
|
|
|
+ locationList.value.forEach((item: any) => {
|
|
|
|
+ if(item.Visible) {
|
|
|
|
+ locationStr = locationStr ? locationStr +','+ item.value : item.value
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ actions.setGlobalState({ locationId: null, locationObj: null, pageObj:null, locationPlane: locationStr });
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ message.success('设置成功')
|
|
|
|
+ }, 600)
|
|
|
|
+}
|
|
|
|
+/**
|
|
|
|
+ * 巷道设备定位图标重置
|
|
|
|
+ */
|
|
|
|
+function resetLocation() {
|
|
|
|
+ locationList.value = locationListTemp
|
|
|
|
+}
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
actions.onGlobalStateChange((newState, prev) => {
|
|
actions.onGlobalStateChange((newState, prev) => {
|
|
@@ -435,15 +458,18 @@ onMounted(async () => {
|
|
findTreeDataValue(treeData.value, { deviceType: pageObj.pageType })
|
|
findTreeDataValue(treeData.value, { deviceType: pageObj.pageType })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ const posShowData = pageObj.locationPlane
|
|
|
|
+ if (posShowData) {
|
|
|
|
+ locationList.value = posShowData
|
|
|
|
+ locationListTemp = posShowData
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
await getDeviceType()
|
|
await getDeviceType()
|
|
- locationList.value = await initDictOptions('devPosVisible')
|
|
|
|
- console.log('定位列表------------>', locationList.value)
|
|
|
|
- // getMonitor()
|
|
|
|
})
|
|
})
|
|
|
|
+
|
|
onUnmounted(() => {
|
|
onUnmounted(() => {
|
|
if (timer) {
|
|
if (timer) {
|
|
clearTimeout(timer);
|
|
clearTimeout(timer);
|
|
@@ -706,6 +732,25 @@ onUnmounted(() => {
|
|
color: #87f1ff;
|
|
color: #87f1ff;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .location-bottom-btn{
|
|
|
|
+ width: 100%;
|
|
|
|
+ color: #fff;
|
|
|
|
+ display: flex;
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ span{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ padding: 2px 16px;
|
|
|
|
+ background: #007099;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ border: 1px solid rgb(125, 230, 249);
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ &:hover{
|
|
|
|
+ background: #005574;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.location-select-show{
|
|
.location-select-show{
|