机械分厂设备屏 设备列表修改

This commit is contained in:
hzz 2023-09-05 18:21:52 +08:00
parent 98d4a5a6a5
commit c15d791494
3 changed files with 40 additions and 6 deletions

View File

@ -33,7 +33,7 @@ function routerpush(isLink:boolean=false) {
<style scoped> <style scoped>
.item { .item {
width: 20%; width: 20%;
height: 30%; height: 27%;
margin: 30px; margin: 30px;
} }

View File

@ -27,7 +27,7 @@
</template> </template>
<script setup lang='ts'> <script setup lang='ts'>
import { getCurrentInstance, onMounted, reactive, ref } from "vue"; import { getCurrentInstance, onMounted, reactive, ref, watch } from "vue";
import { devListType } from "@/type/InPlantProducts"; import { devListType } from "@/type/InPlantProducts";
import { useRouter } from "vue-router" import { useRouter } from "vue-router"
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
@ -35,6 +35,7 @@ import DecorationFadeOut from "@/components/decoration/DecorationFadeOut.vue";
let { t } = useI18n(); let { t } = useI18n();
const prop = defineProps({ const prop = defineProps({
config: Object, config: Object,
data: Array
}) })
const router = useRouter() const router = useRouter()
// //
@ -43,6 +44,7 @@ let tipcontent = ref(null)
let visible = ref(false) let visible = ref(false)
//dom //dom
let triggerRef = ref(null) let triggerRef = ref(null)
let devList = ref(null)
/** /**
* @函数功能: 鼠标移入组件方法 * @函数功能: 鼠标移入组件方法
* @param {*} value * @param {*} value
@ -57,6 +59,15 @@ const dvMouseover = (value) => {
} }
}; };
watch(
() => prop.data,
(val) => {
devList.value.updateRows(prop.data)
},
{ deep: true }
);
/** /**
* 点击表格事件 * 点击表格事件
*/ */
@ -95,7 +106,6 @@ const dvmouseleave = () => {
tipcontent.value = null tipcontent.value = null
visible.value = false visible.value = false
}; };
</script> </script>
<style scoped> <style scoped>

View File

@ -16,7 +16,7 @@
<div style="width: 100%;height: 100%;"> <div style="width: 100%;height: 100%;">
<h2 class="module-header"> <h2 class="module-header">
<DecorationFadeOut> <DecorationFadeOut>
&nbsp;设备总览&nbsp; &nbsp;设备总览&nbsp;
</DecorationFadeOut> </DecorationFadeOut>
</h2> </h2>
<div class="module-content"> <div class="module-content">
@ -42,7 +42,7 @@
</div> </div>
<div style="width: 100%; height: 78%;"> <div style="width: 100%; height: 78%;">
<border13> <border13>
<scrollBoard :config="scrollBoardConfig"></scrollBoard> <scrollBoard ref="DvScrollBoard" :data="scrollBoardConfig_data" :config="scrollBoardConfig"></scrollBoard>
</border13> </border13>
</div> </div>
</el-col> </el-col>
@ -86,6 +86,7 @@ const store = useMechanicsStore();
let Acontent = ref(); let Acontent = ref();
let headerref = ref(); let headerref = ref();
let DvScrollBoard = ref()
let DevOverviewData = ref([]) let DevOverviewData = ref([])
let devFaultTipData = ref([]) let devFaultTipData = ref([])
@ -102,6 +103,7 @@ let scrollBoardConfig = reactive({
data: [], data: [],
rawData: [] rawData: []
}) })
let scrollBoardConfig_data = ref([])
let gatewayData = ref([]) let gatewayData = ref([])
let devNumTimer: any = null let devNumTimer: any = null
// //
@ -128,6 +130,27 @@ function getWebsocket(val) {
store.changegatewaynum(data.msg); store.changegatewaynum(data.msg);
// store.changePM(data.msg) // store.changePM(data.msg)
} }
if (data.type == "DeviceStatusInMF") {
let compare = {
H_OFF: '待机',
H_ON: '工作',
H_IDLE: '停机',
H_STOP: '急停',
H_E_STOP: '急停',
}
let id = data.msg.id
let status = data.msg.status
let dataIndex = scrollBoardConfig.rawData.findIndex((item, index) => {
return item.id == id
})
if (scrollBoardConfig_data.value[dataIndex][3] != compare[status]) {
scrollBoardConfig_data.value[dataIndex][3] = compare[status] ? compare[status] : '停机'
console.log(scrollBoardConfig_data.value[dataIndex],dataIndex);
}
}
} catch (err) { } catch (err) {
console.log(err); console.log(err);
} }
@ -165,7 +188,7 @@ async function reqDeviceTotelListMFfun() {
H_IDLE: '停机', H_IDLE: '停机',
H_STOP: '急停', H_STOP: '急停',
} }
scrollBoardConfig.data = result.data.map((item, index) => { scrollBoardConfig_data.value = result.data.map((item, index) => {
return [ return [
index + 1, index + 1,
item.name, item.name,
@ -175,6 +198,7 @@ async function reqDeviceTotelListMFfun() {
// item.failure + '%' // item.failure + '%'
] ]
}) })
scrollBoardConfig.data = scrollBoardConfig_data.value
scrollBoardConfig.rawData = result.data; scrollBoardConfig.rawData = result.data;
} }
} }