123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- <template>
- <div class="goodInfo layout-pd" >
- <!--部件详情-->
- <el-row>
- <!-- 基础信息 -->
- <el-col :xs="24" >
- <el-card shadow="hover" header="基础信息">
- <div class="basicInformation" v-loading="goods.loadingBasic">
- <div class="basicInformation-left">
- <div class="item ">
- <el-popover
- placement="top-start"
- :width="200"
- title="物料名称"
- trigger="hover"
- :content="goods.basicInformation.bomName"
- >
- <template #reference>
- <span class="m-2"> 物料名称: {{goods.basicInformation.bomName}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="物料号"
- trigger="hover"
- :content="goods.basicInformation.bomNo"
- >
- <template #reference>
- <span class="m-2"> 物料号: {{goods.basicInformation.bomNo}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="CPUID"
- trigger="hover"
- :content="goods.basicInformation.cpuId"
- >
- <template #reference>
- <span class="m-2"> CPUID: {{goods.basicInformation.cpuId}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="软件版本"
- trigger="hover"
- :content="goods.basicInformation.software_v"
- >
- <template #reference>
- <span class="m-2"> 软件版本: {{goods.basicInformation.software_v}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="状态"
- trigger="hover"
- :content="goods.basicInformation.status"
- >
- <template #reference>
- <span class="m-2"> 状态: {{goods.basicInformation.status}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="密钥状态"
- trigger="hover"
- :content="goods.basicInformation.key_name"
- >
- <template #reference>
- <span class="m-2"> 密钥状态: {{goods.basicInformation.key_name}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="团标状态"
- trigger="hover"
- :content="goods.basicInformation.stand_name"
- >
- <template #reference>
- <span class="m-2"> 团标状态: {{goods.basicInformation.stand_name}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="创建时间"
- trigger="hover"
- :content="goods.basicInformation.createTime"
- >
- <template #reference>
- <span class="m-2"> 创建时间: {{goods.basicInformation.createTime}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- trigger="hover"
- title="备注"
- :content="goods.basicInformation.remark"
- >
- <template #reference>
- <span class="m-2"> 备注: {{goods.basicInformation.remark}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="检测时间"
- trigger="hover"
- :content="goods.basicInformation.detectionTime"
- >
- <template #reference>
- <span class="m-2"> 检测时间: {{goods.basicInformation.detectionTime}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- <el-popover
- placement="top-start"
- :width="200"
- title="检测员"
- trigger="hover"
- :content="goods.basicInformation.detectionEmployee"
- >
- <template #reference>
- <span class="m-2"> 检测员: {{goods.basicInformation.detectionEmployee}}</span>
- </template>
- </el-popover>
- </div>
- <div class="item">
- </div>
- </div>
- <div class="basicInformation-right" >
- <div @click="showBigPic(goods.basicInformation.img)">
- <el-image loading="lazy"
- alt="fgg"
- class="img"
- fit="contain"
- :src="baseUrl + '/' + goods.basicInformation.img" >
- <template #error>
- <div class="image-slot">
- <el-icon><icon-picture /></el-icon>
- </div>
- </template>
- </el-image>
- </div>
- </div>
- </div>
- </el-card>
- </el-col>
- <!-- 生产日志 -->
- <el-col :xs="24" >
- <el-card style="height: 40vh" class="my-fill mt8" shadow="hover" header="生产日志">
- <el-table v-loading="goods.loadingProduct" :data="goods.productionLog.tableData" row-key="id" style="width: 100%">
- <el-table-column v-for="column in goods.productionLog.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label" />
- </el-table>
- <div class="my-flex my-flex-end" style="margin-top: 20px">
- <el-pagination
- v-model:currentPage="goods.productionLog.pageInput.CurrentPage"
- v-model:page-size="goods.productionLog.pageInput.PageSize"
- :default-page-size="5"
- :total="goods.productionLog.total"
- :page-sizes="[5, 10, 20, 50, 100]"
- small
- background
- @size-change="onProductionLogSizeChange"
- @current-change="onProductionLogCurrentChange"
- layout="total, sizes, prev, pager, next, jumper"
- />
- </div>
- </el-card>
- </el-col>
- <!-- 报警日志 -->
- <el-col :span="24" >
- <el-card style="height: 40vh" class="my-fill mt8" shadow="hover" header="报警日志">
- <el-table v-loading="goods.loadingAlarm" :data="goods.alarmLog.tableData" row-key="id" style="width: 100%">
- <el-table-column v-for="column in goods.alarmLog.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label" />
- </el-table>
- <div class="my-flex my-flex-end" style="margin-top: 20px">
- <el-pagination
- v-model:currentPage="goods.alarmLog.pageInput.CurrentPage"
- v-model:page-size="goods.alarmLog.pageInput.PageSize"
- :total="goods.alarmLog.total"
- :page-sizes="[5, 10, 20, 50, 100]"
- :default-page-size="5"
- small
- background
- @size-change="onAlarmLogSizeChange"
- @current-change="onAlarmLogCurrentChange"
- layout="total, sizes, prev, pager, next, jumper"
- />
- </div>
- </el-card>
- </el-col>
- </el-row>
- <!--大图显示-->
- <el-dialog
- v-model="goods.showBig"
- :close-on-click-modal="true"
- :show-close="false"
- width="80%"
- >
- <img
- :src="goods.imageUrl"
- class="fullscreen-image"
- alt="放大的图片"/>
- </el-dialog>
- </div>
- </template>
- <script setup lang="ts" name="goodInfo">
- import {onMounted, reactive} from "vue";
- import {ComponentDetails} from "/src/api/admin/productionManagement/ComponentDetails";
- import router from "/src/router";
- import type {
- alarmLog,
- goodsInformationBasic,
- productionLog
- } from "/src/api/admin/productionManagement/ComponentDetailsDto";
- import {adminProductGoodsInfoDto, filterData} from "/src/api/admin/productionManagement/ComponentDetailsDto";
- import type {columnsProps, pageInput} from "/src/api/admin/shareDto/shareDto";
- import { Picture as IconPicture } from '@element-plus/icons-vue'
- //组件的页面对象
- const goods = reactive({
- /**部件id */
- id:"",
- /**页面请求参数*/
- data:{} as filterData,
- /**显示加载效果 */
- loadingBasic: false,
- loadingProduct: false,
- loadingAlarm: false,
- /**图片是否方法显示 */
- showBig: false,
- /**放大图片的url */
- imageUrl: "",
- /**基础信息 */
- basicInformation: {} as goodsInformationBasic,
- /**生产日志 */
- productionLog: {
- /**表格数据 */
- tableData: [] as Array<productionLog>,
- /**动态表头 */
- dynamicColumns: [] as Array<columnsProps>,
- /**页面分页 */
- pageInput: {
- CurrentPage: 1,
- PageSize: 5
- } as pageInput,
- /**总数 */
- total: 0
- } as productionLog,
- /**报警日志 */
- alarmLog: {
- /**表格数据 */
- tableData: [] as Array<alarmLog>,
- /**动态表头 */
- dynamicColumns: [] as Array<columnsProps>,
- /**页面分页 */
- pageInput: {
- CurrentPage: 1,
- PageSize: 5
- } as pageInput,
- /**总数 */
- total: 0
- } as alarmLog,
- } as adminProductGoodsInfoDto)
- //图片url前缀
- const baseUrl = import.meta.env.VITE_API_URL
- //查看大图
- const showBigPic = (val) => {
- // eslint-disable-next-line no-console
- console.log(val)
- goods.imageUrl = baseUrl + '/' + val
- goods.showBig = true
- }
- /**生产日志分页size变化 */
- const onProductionLogSizeChange = (val) => {
- goods.productionLog.pageInput.PageSize = val
- initProductionLog()
- }
- /**生产日志分页Current变化 */
- const onProductionLogCurrentChange = (val) => {
- goods.productionLog.pageInput.CurrentPage = val
- initProductionLog()
- }
- /**报警日志分页size变化 */
- const onAlarmLogSizeChange = (val) => {
- goods.alarmLog.pageInput.CurrentPage = val
- initAlarmLog()
- }
- /**报警日志分页Current变化 */
- const onAlarmLogCurrentChange = (val) => {
- goods.alarmLog.pageInput.CurrentPage = val
- initAlarmLog()
- }
- /**
- * 初始化数据
- */
- const initBasicInformation = async () => {
- goods.loadingBasic = true
- const res = await new ComponentDetails().getBasicInfo({GUID:goods.id} ).catch(() => {
- goods.loadingBasic = false
- })
- goods.basicInformation = res?.data
- goods.loadingBasic = false
- }
- const initProductionLog = async () => {
- goods.loadingProduct = true
- goods.productionLog = await new ComponentDetails().getProductionLog(goods.productionLog.pageInput, goods.id)
- goods.loadingProduct = false
- // console.log(goods.productionLog)
- }
- const initAlarmLog = async () => {
- goods.loadingAlarm = true
- goods.alarmLog = await new ComponentDetails().getAlarmLog(goods.productionLog.pageInput, goods.id)
- goods.loadingAlarm = false
- // console.log(goods.alarmLog)
- }
- onMounted(() => {
- goods.id = router.currentRoute.value.params.guid
- // console.log(goods.productionLog.pageInput.PageSize)
- /**初始化 */
- initBasicInformation()
- initProductionLog()
- initAlarmLog()
- })
- </script>
- <style scoped lang="scss">
- .goodInfo{
- font-weight: 500;
- .el-card{
- margin-bottom: 20px;
- }
- .basicInformation{
- display: flex;
- display: -webkit-flex; /* Safari */
- justify-content: space-around;
- align-items:center;
- align-content:space-around;
- flex-wrap: wrap-reverse;
- .basicInformation-left{
- display: flex;
- display: -webkit-flex; /* Safari */
- justify-content: space-around;
- flex-wrap: wrap;
- height: 100%;
- max-width: 65%;
- min-width: 300px;
- .item{
- cursor: pointer;
- width: 240px;/*设置显示的最大宽度*/
- height:40px;
- overflow:hidden;/*超出部分隐藏*/
- white-space:nowrap;/*强制单行显示*/
- text-overflow: ellipsis;
- display: flex;
- align-items: center;
- }
- }
- .basicInformation-right{
- width: 50%;
- height: 100%;
- max-width: 300px;
- min-width: 200px;
- padding: 0 10px;
- .img {
- width: 220px;
- height: 140px;
- cursor: pointer;
- }
- .image-slot {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 100%;
- background: var(--el-fill-color-light);
- color: var(--el-text-color-secondary);
- font-size: 30px;
- }
- .image-slot .el-icon {
- font-size: 30px;
- }
- }
- }
- .fullscreen-image {
- width: 100%;
- max-height: 80vh;
- object-fit: contain;
- }
- }
- </style>
|