大屏优化

This commit is contained in:
bb_pan 2025-03-17 16:33:03 +08:00
parent 5947e66ea3
commit 8f89140501
28 changed files with 243 additions and 203 deletions

11
components.d.ts vendored
View File

@ -14,6 +14,7 @@ declare module 'vue' {
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
@ -22,11 +23,13 @@ declare module 'vue' {
ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElCountdown: typeof import('element-plus/es')['ElCountdown']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElEmpty: typeof import('element-plus/es')['ElEmpty']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
@ -34,14 +37,22 @@ declare module 'vue' {
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPageHeader: typeof import('element-plus/es')['ElPageHeader']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']
ElUpload: typeof import('element-plus/es')['ElUpload']
Empty: typeof import('./src/components/Empty/index.vue')['default']
EquipCard: typeof import('./src/components/equipCard.vue')['default']
EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default']

Binary file not shown.

After

Width:  |  Height:  |  Size: 421 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 KiB

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -56,7 +56,7 @@ import CenterModel from './model-components/center-model.vue'
.screen-title {
position: absolute;
top: 4%;
top: 2%;
left: 50%;
color: #fff;
font-size: 30px;

View File

@ -3,7 +3,7 @@
<div class="item">
<!-- <h2>装备上架</h2> -->
<div class="item-title">
<img src="@/assets/img/screen/装备上架.png" style="width: 100%; height: 90%" />
<img src="@/assets/img/screen/装备上架.png" style="width: 100%; height: 70%" />
</div>
<div class="item-info">
<div class="info-box info-box_1" style="transform: translateY(-14.5vh)">
@ -51,7 +51,7 @@
<div class="item">
<!-- <h2>装备租赁</h2> -->
<div class="item-title" style="transform: translateY(-5vh)">
<img src="@/assets/img/screen/装备租赁.png" style="width: 100%; height: 90%" />
<img src="@/assets/img/screen/装备租赁.png" style="width: 100%; height: 70%" />
</div>
<div class="item-info">
<div class="info-box info-box_2" style="transform: translateY(-14vh)">
@ -97,7 +97,7 @@
<div class="item">
<!-- <h2>装备需求</h2> -->
<div class="item-title" style="transform: translateY(-5vh)">
<img src="@/assets/img/screen/装备需求.png" style="width: 100%; height: 90%" />
<img src="@/assets/img/screen/装备需求.png" style="width: 100%; height: 70%" />
</div>
<div class="item-info">
<div class="info-box info-box_3" style="transform: translateY(-12.5vh)">

View File

@ -1,8 +1,7 @@
<template>
<!-- 装备租赁互联 -->
<div class="container">
<ScreenTitle :title="`装备租赁互联`" @reset="reset" :showReset="false"/>
<div class="reset">重置</div>
<ScreenTitle :title="`装备租赁互联`" @reset="reset" :showReset="true" />
<div class="content" ref="echartsRef"></div>
</div>
</template>
@ -12,31 +11,35 @@ import ScreenTitle from 'components/ScreenTitle/index.vue'
import { getLeaseCouplesApi } from 'http/api/screen/index'
import IconImg from '@/assets/img/screen/999.svg'
import * as echarts from 'echarts'
import { ElMessage } from 'element-plus'
const echartsRef = ref(null)
const secondsTimer: any = ref(null)
const oneArr: any = ref([])
const erArr: any = ref([])
const companyId: any = ref(241)
const getLeaseCouplesData = async () => {
const res: any = await getLeaseCouplesApi()
// console.log(res, '')
const res: any = await getLeaseCouplesApi({ companyId: companyId.value })
console.log(res, '装备租赁互联')
if (res.data.length == 0) {
ElMessage.error('暂无装备租赁互联数据')
return
}
const arr = res.data.map((item: any, index: any) => {
if ((index = 0)) {
item.type = 0
}
item.type = 1
item.symbol = 'image://' + IconImg
item.symbolSize = 45
item.name = item.companyName
// item.type = 1
// item.symbol = 'image://' + IconImg
// item.symbolSize = 45
// item.name = item.companyName
return {
type: item.type,
type: 1,
symbol: 'image://' + IconImg,
symbolSize: 45,
name: item.companyName,
orderNum: item.orderNum,
companyId: item.companyId,
}
})
// console.log('🚀 ~ getLeaseCouplesData ~ arr:', arr)
oneArr.value = [arr[0]]
// oneArr.value[0].type = 0
oneArr.value.push(arr[0])
// console.log('🚀 ~ getLeaseCouplesData ~ oneArr.value:', oneArr.value)
erArr.value = arr.slice(1)
// console.log('🚀 ~ getLeaseCouplesData ~ erArr.value:', erArr.value)
@ -46,51 +49,53 @@ getLeaseCouplesData()
//
const reset = () => {
console.log('重置')
//
location.reload()
}
onMounted(() => {
setTimeout(() => {
const myChart = echarts.init(echartsRef.value)
//
myChart.on('click', function (params) {
myChart.on('click', function (params: any) {
if (params.componentType === 'series' && params.seriesType === 'graph') {
// console.log(':', params, allArr)
allArr.forEach((item: any) => {
// console.log('🚀 ~ allArr.forEach ~ item:', item)
item.type = 1
if (item.name == params.name) {
if (item.type == 0) {
item.type = 1
} else {
item.type = 0
}
}
})
// type 0
let oneArr = allArr.filter((item: any) => {
return item.type == 0
})
// console.log('🚀 ~ oneArr ~ oneArr:', oneArr)
// type 1
let erArr = allArr.filter((item: any) => {
return item.type == 1
})
// console.log('🚀 ~ erArr ~ erArr:', erArr)
oneArr = group(oneArr, 0)
erArr = group(erArr, 40)
allArr = [...oneArr, ...erArr]
// console.log('🚀 ~ allArr:', allArr)
console.log('点击了项:', params, allArr)
companyId.value = params.data.companyId
//
myChart.setOption({
// tooltip: {
// trigger: 'item', //
// formatter: function (params: any) {
// //
// return `: ${params.name}<br>: ${params.data.orderNum}`
// },
// },
}) // true
getLeaseCouplesApi({ companyId: companyId.value }).then((res: any) => {
console.log(res, '装备租赁互联')
if (res.data.length === 0) {
//
ElMessage.error('暂无关联数据')
return
}
const arr = res.data.map((item: any, index: any) => {
// item.type = 1
// item.symbol = 'image://' + IconImg
// item.symbolSize = 45
// item.name = item.companyName
return {
type: 1,
symbol: 'image://' + IconImg,
symbolSize: 45,
name: item.companyName,
orderNum: item.orderNum || 0,
companyId: item.companyId,
}
})
console.log('🚀 ~ arr ~ arr:', arr)
let oneArr2 = [arr[0]]
console.log('🚀 ~ myChart.on ~ oneArr:', oneArr2)
let erArr2 = arr.slice(1)
console.log('🚀 ~ myChart.on ~ erArr:', erArr2)
oneArr2 = group(oneArr2, 0)
erArr2 = group(erArr2, 40)
allArr = [...oneArr2, ...erArr2]
// linesConfig(allArr)
console.log('🚀 ~ allArr:', allArr)
forAllArr()
myChart.setOption({}) // true
})
}
})
@ -101,42 +106,49 @@ onMounted(() => {
let allArr = [...oneArr.value, ...erArr.value],
dataArr: any = []
//
allArr.forEach((el, ind) => {
if (el.type > 0) {
el.symbolSize = 45
el.symbol = 'image://' + uploadImg2
el.itemStyle = {
color: color[el.type],
}
}
el.label = {
show: true,
position: 'bottom',
distance: -30,
color: color[el.type],
formatter: function (params: any) {
// console.log('🚀 ~ allArr.forEach ~ params:', params)
const maxLength = 6 //
const name =
params.data.name.length > maxLength
? params.data.name.substring(0, maxLength) + '...'
: params.data.name
function forAllArr() {
if (!allArr || allArr.length == 0) return
allArr.forEach((el, ind) => {
console.log('🚀 ~ allArr.forEach ~ el111:', el)
// if (el.type > 0) {
// el.symbolSize = 45
// el.symbol = 'image://' + uploadImg2
// el.itemStyle = {
// color: '#fff',
// }
// }
el.label = {
show: true,
position: 'bottom',
distance: -30,
color: '#fff',
formatter: function (params: any) {
// console.log('🚀 ~ allArr.forEach ~ params:', params)
const maxLength = 6 //
const name =
params.data.name.length > maxLength
? params.data.name.substring(0, maxLength) + '...'
: params.data.name
// ''
return [
`{c|订单数:${params.data.orderNum}}`,
`{b|${name}}`, //
].join('\n') //
},
rich: {
b: {
fontSize: 12,
// ''
return [
`{c|订单数:${params.data.orderNum}}`,
`{b|${name}}`, //
].join('\n') //
},
c: {
fontSize: 12,
rich: {
b: {
fontSize: 12,
},
c: {
fontSize: 12,
},
},
},
}
}
})
}
nextTick(() => {
forAllArr()
})
//
@ -164,38 +176,42 @@ onMounted(() => {
// 线
function linesConfig(arr: any) {
if (!arr || arr.length == 0) return
const [dataArr, targetCoord] = [[], [0, 0]]
arr.forEach((el: any) => {
console.log('🚀 ~ arr.forEach ~ el222:', el)
function getFormatItem(start: any, end: any) {
let item = [
{ coord: el.twoPoint[start] }, //
{
coord: el.twoPoint[end],
lineStyle: {
color: color[el.type],
curveness: el.type === 3 ? 0.1 : 0,
color: '#fff',
// curveness: el.type === 3 ? 0.1 : 0,
curveness: 0,
},
effect: {
color: color[el.type],
color: '#fff',
},
}, //
]
return item
}
switch (el.type) {
case 0:
break
case 1:
dataArr.push(getFormatItem(0, 1))
break
case 2:
dataArr.push(getFormatItem(1, 0))
break
case 3:
dataArr.push(getFormatItem(0, 1))
dataArr.push(getFormatItem(1, 0))
break
}
dataArr.push(getFormatItem(0, 1))
// switch (el.type) {
// case 0:
// break
// case 1:
// dataArr.push(getFormatItem(0, 1))
// break
// case 2:
// dataArr.push(getFormatItem(1, 0))
// break
// case 3:
// dataArr.push(getFormatItem(0, 1))
// dataArr.push(getFormatItem(1, 0))
// break
// }
})
return dataArr
}
@ -244,10 +260,10 @@ onMounted(() => {
trigger: 'item', //
formatter: function (params: any) {
//
return `公司名称: ${params.name}<br>订单数: ${params.data.orderNum}`
return `公司名称: ${params.data.name}<br>订单数: ${params.data.orderNum}`
},
},
backgroundColor: '#081c47',
backgroundColor: '',
xAxis: {
show: false,
type: 'value',

View File

@ -66,7 +66,7 @@ const initEChart = () => {
return `${companyName} ${params[0].value}`
},
},
backgroundColor: 'rgb(20,28,52)',
backgroundColor: '',
xAxis: {
show: false,
type: 'value',
@ -245,7 +245,7 @@ onMounted(() => {
.content {
width: 100%;
flex: 1;
padding: 0 8px;
.item {
width: 30%;
height: 100%;

View File

@ -36,6 +36,16 @@ import {
downLoadTemplate, //
} from 'http/api/usercenter/goodsmang'
const batchAddVisible: any = ref(false) //
const batchAddData: any = ref([]) //
const batchAddColumn: any = ref([
{ label: '文件名称', prop: 'fileName' },
{ label: '上传位置', prop: 'position' },
{ label: '装备唯一标识', prop: 'code' },
{ label: '装备名称', prop: 'deviceName' },
{ label: '装备型号', prop: 'deviceType' },
])
//
const AssemblyRegisterAddress: any = reactive([])
const deviceType: any = reactive([])
@ -66,8 +76,8 @@ const getTypeTreeData = async () => {
}
//-change
const deviceTypeChange = (val: any) => {
console.log("ssssssssssssssssssssssssss",val)
if (val!=null && val.length > 0) {
console.log('ssssssssssssssssssssssssss', val)
if (val != null && val.length > 0) {
queryParams.value.typeId = val[3]
} else {
queryParams.value.typeId = ''
@ -520,12 +530,12 @@ const dialogTypeChange = async () => {
// }
console.log('deviceTypeList', deviceTypeList[0].data)
warningDays.value = deviceTypeList[0].data.maintenanceAlarmDay
if(deviceTypeList[0].data.manageType == 0){
addAndEditForm.deviceCount = 1
typeDisabled.value = true
}else{
addAndEditForm.deviceCount = 1
typeDisabled.value = false
if (deviceTypeList[0].data.manageType == 0) {
addAndEditForm.deviceCount = 1
typeDisabled.value = true
} else {
addAndEditForm.deviceCount = 1
typeDisabled.value = false
}
if (deviceTypeList[0].data.maTypeProperties == null) {
propertyNames.value = []
@ -632,7 +642,6 @@ const equipRules = ref({
message: '请输入日租金',
trigger: 'blur',
},
],
person: [{ required: true, message: '联系人不能为空', trigger: 'blur' }],
@ -703,70 +712,9 @@ const descriptionRules = ref({
//
const submitBtn = async () => {
submitFun(isEditForm.value ? 3 : 1)
// ruleFormRef.value.validate(async (valid: any) => {
// if (valid) {
// if (
// equipmentDeploymentParams.value.deviceTypeList &&
// equipmentDeploymentParams.value.deviceTypeList.length > 0
// ) {
// equipmentDeploymentParams.value.typeId =
// equipmentDeploymentParams.value.deviceTypeList[3]
// } else {
// equipmentDeploymentParams.value.typeId = ''
// }
// if (mainFileList.value.length == 0 || mainFileList.value.length > 6) {
// ElMessage({ type: 'error', message: '16' })
// return
// }
// if (detailsFileList.value.length == 0 || detailsFileList.value.length > 6) {
// ElMessage({ type: 'error', message: '16' })
// return
// }
// let param = {
// ...equipmentDeploymentParams.value,
// mainFileList: mainFileList.value, //
// detailsFileList: detailsFileList.value, //
// insurancePdf: insurancePdf.value, //
// examinationPdf: examinationPdf.value, //
// }
// param.maStatus == 0 ? (param.maStatus = 1) : param.maStatus
// if (
// equipmentDeploymentParams.value.maId &&
// equipmentDeploymentParams.value.maId != ''
// ) {
// const res: any = await equipmentEditApi(param)
// if (res.code === 200) {
// ElMessage({
// type: 'success',
// message: '',
// })
// dialogFormVisibleSettlein.value = false
// getList()
// }
// } else {
// const res: any = await equipmentAddApi(param)
// if (res.code === 200) {
// ElMessage({
// type: 'success',
// message: '',
// })
// dialogFormVisibleSettlein.value = false
// getList()
// }
// }
// }
// })
}
const submitFun = (type: any) => {
// type 1 () 2 稿() 3 4 稿
// addAndEditForm.mainFileList = [
// ...addAndEditForm.mainFileList,
// ...addAndEditForm.mainFileTempList,
// ]
// addAndEditForm.detailsFileList = [
// ...addAndEditForm.detailsFileList,
// ...addAndEditForm.detailsFileTempList,
// ]
if (isAdd.value) {
addAndEditForm.mainFileList = Array.from(
new Set([...addAndEditForm.mainFileList, ...addAndEditForm.mainFileTempList]),
@ -1453,24 +1401,23 @@ const changeNextDate = (row: any) => {
}
}
const getUpdateTimeBgColor = (row: any) => {
// Date
const checkDate = new Date();
const nextCheckDate = new Date(row.nextCheckDate);
// Date
const checkDate = new Date()
const nextCheckDate = new Date(row.nextCheckDate)
//
const diffTime = Math.abs(nextCheckDate - checkDate);
//
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
//
const diffTime = Math.abs(nextCheckDate - checkDate)
//
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
if (checkDate < nextCheckDate && diffDays <= 30) {
return '#FFFFCC'; //
} else if (checkDate > nextCheckDate) {
return '#FFCCCC'; //
}
return ''; //
};
if (checkDate < nextCheckDate && diffDays <= 30) {
return '#FFFFCC' //
} else if (checkDate > nextCheckDate) {
return '#FFCCCC' //
}
return '' //
}
</script>
<template>
@ -1580,11 +1527,14 @@ const getUpdateTimeBgColor = (row: any) => {
>批量下架</el-button
>
<!-- <el-button class="primary-lease" type="primary" @click="onTempDownLoad()"
>模板下载</el-button
>
<el-button class="primary-lease" type="primary" @click="onBatchUpload()"
>批量上传</el-button
> -->
>模板下载</el-button
> -->
<el-button
class="primary-lease"
type="primary"
@click="batchAddVisible = true"
>批量新增</el-button
>
</el-form-item>
</el-col>
</el-row>
@ -1626,10 +1576,12 @@ const getUpdateTimeBgColor = (row: any) => {
</template>
</el-table-column>
<el-table-column align="center" prop="typeName" label="装备型号" />
<el-table-column align="center" prop="nextCheckDate" label="下次检验日期" >
<template #default="{ row }">
<span :style="{ backgroundColor: getUpdateTimeBgColor(row) }">{{ row.nextCheckDate }}</span>
</template>
<el-table-column align="center" prop="nextCheckDate" label="下次检验日期">
<template #default="{ row }">
<span :style="{ backgroundColor: getUpdateTimeBgColor(row) }">{{
row.nextCheckDate
}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="装备状态">
<template #default="{ row }">
@ -2521,6 +2473,67 @@ const getUpdateTimeBgColor = (row: any) => {
:z-index="9999999999"
/>
</el-dialog>
<!-- 批量新增弹框 -->
<el-dialog
v-model="batchAddVisible"
title="批量新增"
width="80%"
destroy-on-close
:close-on-click-modal="false"
>
<el-row :gutter="20" style="display: flex; align-items: center">
<el-col :span="1.5" :offset="0">
<el-button type="primary" @click="">下载模版</el-button>
</el-col>
<el-col :span="1.5" :offset="0">
<el-button type="primary" @click="">上传文件</el-button>
</el-col>
<el-col :span="5" :offset="0">
<div style="color: #ccc; font-size: small">
备注: 一次上传装备数量不能超过50条
</div>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<TitleTip titleText="资料不全装备清单" />
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="1.5" :offset="0">
<el-button type="primary" @click="">删除</el-button>
</el-col>
</el-row>
<el-table
:data="batchAddData"
style="width: auto"
row-key="maId"
show-overflow-tooltip
:header-cell-style="{ background: '#00a288', color: '#fff' }"
@selection-change=""
>
<el-table-column
label="序号"
align="center"
width="80px"
>
<template #default="{ row, $index }">
{{ $index + 1 }}
</template>
</el-table-column>
<el-table-column
v-for="(column, index) in batchAddColumn"
:key="index"
:prop="column.prop"
:label="column.label"
:width="column.width"
align="center"
></el-table-column>
</el-table>
</el-dialog>
</div>
</template>