Merge remote-tracking branch 'origin/dev-nx' into dev-nx

This commit is contained in:
liang.chao 2024-07-22 09:03:00 +08:00
commit 7b0b5eb1f8
6 changed files with 64 additions and 3 deletions

View File

@ -57,6 +57,7 @@
<el-table :data="tempList" border>
<el-table-column align="center" label="序号" type="index" />
<el-table-column prop="typeName" align="center" label="设备名称" />
<el-table-column
prop="deviceType"
align="center"
@ -156,6 +157,7 @@ export default {
deviceInfo: [],
},
isEdit: false,
deviceName: '',
}
},
async created() {
@ -182,6 +184,10 @@ export default {
//
selMainDevice(val) {
const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes()
this.recursionGetDeviceName(
this.deviceTypeTreeNew,
val[val.length - 2],
)
if (checkNode.length < 1) return
@ -191,6 +197,7 @@ export default {
deviceNum: '', //
deviceAscription: '主体设备', //
ascriptionType: 1, // 1 2
typeName: this.deviceName,
}
if (this.tempList.length === 0) {
@ -215,6 +222,10 @@ export default {
//
selAssortDevice(val) {
const checkNode = this.$refs['assortDeviceRef'].getCheckedNodes()
this.recursionGetDeviceName(
this.deviceTypeTreeNew,
val[val.length - 2],
)
if (checkNode.length < 1) return
@ -224,6 +235,7 @@ export default {
deviceNum: '', //
deviceAscription: '配套设备', //
ascriptionType: 2, // 1 2
typeName: this.deviceName,
}
//
@ -331,6 +343,21 @@ export default {
this.$emit('openHomePage')
this.tempList = []
},
//
recursionGetDeviceName(list, id) {
try {
list.map((e) => {
if (e.id == id) {
this.deviceName = e.label
throw new Error()
} else {
if (e.children && e.children.length > 0) {
this.recursionGetDeviceName(e.children, id)
}
}
})
} catch (error) {}
},
},
}
</script>

View File

@ -15,7 +15,7 @@ export const config = {
columnsList: [
{ t_width: '', t_props: 'wholeTypeName', t_label: '成套设备名称', },
{ t_width: '', t_props: 'typeModelName', t_label: '主体设备', },
{ t_width: '', t_props: 'totalNum', t_label: '配套设备种类数量' },
{ t_width: '', t_label: '配套设备种类数量', t_slot: 'totalNum' },
{ t_width: '', t_props: 'nickName', t_label: '创建人', },
{ t_width: '', t_props: 'createTime', t_label: '创建日期', },
],

View File

@ -17,6 +17,9 @@
>
</el-row>
</template>
<template slot-scope="{ data }" slot="totalNum">
{{ data.totalNum }}
</template>
<!-- 列表操作栏 -->
<template slot="handle" slot-scope="{ data }">

View File

@ -57,6 +57,7 @@
<el-table :data="tempList" border>
<el-table-column align="center" label="序号" type="index" />
<el-table-column prop="typeName" align="center" label="设备名称" />
<el-table-column
prop="deviceType"
align="center"
@ -156,6 +157,7 @@ export default {
deviceInfo: [],
},
isEdit: false,
deviceName: '',
}
},
async created() {
@ -183,14 +185,19 @@ export default {
selMainDevice(val) {
const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes()
this.recursionGetDeviceName(
this.deviceTypeTreeNew,
val[val.length - 2],
)
if (checkNode.length < 1) return
const mainDeviceObj = {
deviceType: checkNode[0].label, //
deviceType: checkNode[0].label, //
deviceTypeId: val[val.length - 1], // Id
deviceNum: '', //
deviceAscription: '主体设备', //
ascriptionType: 1, // 1 2
typeName: this.deviceName,
}
if (this.tempList.length === 0) {
@ -215,6 +222,10 @@ export default {
//
selAssortDevice(val) {
const checkNode = this.$refs['assortDeviceRef'].getCheckedNodes()
this.recursionGetDeviceName(
this.deviceTypeTreeNew,
val[val.length - 2],
)
if (checkNode.length < 1) return
@ -224,6 +235,7 @@ export default {
deviceNum: '', //
deviceAscription: '配套设备', //
ascriptionType: 2, // 1 2
typeName: this.deviceName,
}
//
@ -331,6 +343,22 @@ export default {
this.$emit('openHomePage')
this.tempList = []
},
//
recursionGetDeviceName(list, id) {
try {
list.map((e) => {
if (e.id == id) {
this.deviceName = e.label
throw new Error()
} else {
if (e.children && e.children.length > 0) {
this.recursionGetDeviceName(e.children, id)
}
}
})
} catch (error) {}
},
},
}
</script>

View File

@ -15,7 +15,7 @@ export const config = {
columnsList: [
{ t_width: '', t_props: 'wholeTypeName', t_label: '成套设备名称', },
{ t_width: '', t_props: 'typeModelName', t_label: '主体设备', },
{ t_width: '', t_props: 'totalNum', t_label: '配套设备种类数量' },
{ t_width: '', t_label: '配套设备种类数量', t_slot: 'totalNum' },
{ t_width: '', t_props: 'nickName', t_label: '创建人', },
{ t_width: '', t_props: 'createTime', t_label: '创建日期', },
],

View File

@ -17,6 +17,9 @@
>
</el-row>
</template>
<template slot-scope="{ data }" slot="totalNum">
{{ data.totalNum }}
</template>
<!-- 列表操作栏 -->
<template slot="handle" slot-scope="{ data }">