Merge remote-tracking branch 'origin/dev-nx' into dev-nx
This commit is contained in:
commit
7b0b5eb1f8
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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: '创建日期', },
|
||||
],
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@
|
|||
>
|
||||
</el-row>
|
||||
</template>
|
||||
<template slot-scope="{ data }" slot="totalNum">
|
||||
{{ data.totalNum }}
|
||||
</template>
|
||||
|
||||
<!-- 列表操作栏 -->
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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: '创建日期', },
|
||||
],
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@
|
|||
>
|
||||
</el-row>
|
||||
</template>
|
||||
<template slot-scope="{ data }" slot="totalNum">
|
||||
{{ data.totalNum }}
|
||||
</template>
|
||||
|
||||
<!-- 列表操作栏 -->
|
||||
<template slot="handle" slot-scope="{ data }">
|
||||
|
|
|
|||
Loading…
Reference in New Issue