大屏优化
|
|
@ -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']
|
||||
|
|
|
|||
|
After Width: | Height: | Size: 421 KiB |
|
Before Width: | Height: | Size: 421 KiB After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 91 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 102 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 35 KiB |
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)">
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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%;
|
||||
|
|
|
|||
|
|
@ -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: '主展示图不得少于1张,不得多于6张' })
|
||||
// return
|
||||
// }
|
||||
// if (detailsFileList.value.length == 0 || detailsFileList.value.length > 6) {
|
||||
// ElMessage({ type: 'error', message: '详情展示图不得少于1张,不得多于6张' })
|
||||
// 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>
|
||||
|
||||
|
|
|
|||