2023-05-12 08:41:33 +00:00
|
|
|
<template>
|
|
|
|
<div class="box">
|
2023-12-04 06:04:50 +00:00
|
|
|
<div class="box-title">{{ t('messages.LegionDevList') }}</div>
|
2023-05-12 08:41:33 +00:00
|
|
|
<div class="box-body">
|
|
|
|
<dv-scroll-board ref="devList" :config="prop.config" @mouseover="dvMouseover" @mouseend="dvmouseleave"
|
|
|
|
@click="dvClick" :style="{
|
2023-12-04 06:04:50 +00:00
|
|
|
width: '100%',
|
|
|
|
height: '100%',
|
|
|
|
}" />
|
|
|
|
<el-tooltip v-model:visible="visible" :content="tipcontent" placement="top" effect="light" trigger="click"
|
|
|
|
popper-class="tooltip-class" virtual-triggering :virtual-ref="triggerRef" />
|
2023-05-12 08:41:33 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang='ts'>
|
2023-12-04 06:04:50 +00:00
|
|
|
import { getCurrentInstance, onMounted, reactive, ref, defineProps, watch } from "vue";
|
2023-05-12 08:41:33 +00:00
|
|
|
import { devListType } from "@/type/InPlantProducts";
|
|
|
|
import { useRouter } from "vue-router"
|
|
|
|
import { useI18n } from 'vue-i18n'
|
2023-12-04 06:04:50 +00:00
|
|
|
let { t } = useI18n();
|
2023-05-12 08:41:33 +00:00
|
|
|
const prop = defineProps({
|
|
|
|
config: Object,
|
|
|
|
severdata: Array
|
|
|
|
})
|
|
|
|
const router = useRouter()
|
|
|
|
//弹窗文本
|
|
|
|
let tipcontent = ref(null)
|
|
|
|
//弹窗显示与隐藏
|
|
|
|
let visible = ref(false)
|
|
|
|
//存储弹窗dom
|
|
|
|
let triggerRef = ref(null)
|
2023-12-04 06:04:50 +00:00
|
|
|
let devList = ref()
|
2023-05-12 08:41:33 +00:00
|
|
|
/**
|
|
|
|
* @函数功能: 鼠标移入组件方法
|
|
|
|
* @param {*} value
|
|
|
|
* @出口参数:
|
|
|
|
* @函数备注:
|
|
|
|
*/
|
|
|
|
const dvMouseover = (value) => {
|
2023-12-04 06:04:50 +00:00
|
|
|
if (value.toElement && value.toElement.innerHTML && value.toElement.className == 'ceil') {
|
2023-05-12 08:41:33 +00:00
|
|
|
triggerRef.value = value.toElement
|
2023-05-18 06:57:42 +00:00
|
|
|
tipcontent.value = value.toElement.innerText
|
2023-05-12 08:41:33 +00:00
|
|
|
visible.value = true
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
2023-12-04 06:04:50 +00:00
|
|
|
|
|
|
|
watch(() => prop.config, (newVal, oldVal) => {
|
|
|
|
devList.value.updateRows(newVal.data, {
|
|
|
|
header: [t('messages.SerialNum'), t('messages.productName'), t('messages.model'), t('messages.RackNum'), t('messages.type'), t('messages.InstallPhase'), t('messages.产品状态'), t('messages.AssemblyGroup'), t('messages.electronicGroup'), t('messages.inspector'), t('messages.deliveryDay')],
|
|
|
|
headerBGC: 'rgb(52, 105, 243)',
|
|
|
|
oddRowBGC: '#100c2a',
|
|
|
|
evenRowBGC: '#100c2a',
|
|
|
|
rowNum: 10,
|
|
|
|
columnWidth: [80, 170, 120, 120, 120, 120, 120, 120, 120, 100, 130],
|
|
|
|
align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center']
|
|
|
|
});
|
|
|
|
}, { deep: true, flush: 'post' })
|
|
|
|
|
2023-05-12 08:41:33 +00:00
|
|
|
/**
|
|
|
|
* @函数功能: 鼠标移出组件方法
|
|
|
|
* @出口参数:
|
|
|
|
* @函数备注:
|
|
|
|
*/
|
|
|
|
const dvmouseleave = () => {
|
|
|
|
triggerRef.value = null
|
|
|
|
tipcontent.value = null
|
|
|
|
visible.value = false
|
|
|
|
};
|
|
|
|
|
|
|
|
const dvClick = (value) => {
|
|
|
|
|
|
|
|
if (value.row) {
|
2023-12-04 06:04:50 +00:00
|
|
|
prop.severdata.forEach((res: any) => {
|
2023-05-12 08:41:33 +00:00
|
|
|
if (res.index == value.row[0]) {
|
|
|
|
router.push({
|
|
|
|
name: "devItem",
|
|
|
|
params: {
|
|
|
|
id: res.id,
|
|
|
|
label: res.label,
|
|
|
|
name: res.name,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.box {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-around;
|
|
|
|
}
|
|
|
|
|
|
|
|
.box-title {
|
|
|
|
width: 100%;
|
|
|
|
padding: 10px;
|
|
|
|
font-size: 20px;
|
|
|
|
color: #fff;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.box-body {
|
|
|
|
width: 100%;
|
|
|
|
height: 90%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-around;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
:deep(.dv-scroll-board .rows .ceil) {
|
|
|
|
overflow: auto;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
text-overflow: none
|
|
|
|
}
|
|
|
|
</style>
|
2023-06-06 08:57:53 +00:00
|
|
|
<style>
|
2023-12-04 06:04:50 +00:00
|
|
|
.el-popper.tooltip-class {
|
2023-06-06 08:57:53 +00:00
|
|
|
color: #fff !important;
|
|
|
|
}
|
|
|
|
</style>
|