|
|
@@ -16,10 +16,10 @@
|
|
|
|
|
|
<!-- 展开内容 -->
|
|
|
<template v-slot:expand="{ row }">
|
|
|
-
|
|
|
- <div style="width:100%; min-height: 200px" v-if="row.produceList">
|
|
|
- <ele-pro-table ref="table2" :need-page="false" :datasource="row.produceList"
|
|
|
- :columns="columns2" row-key="code">
|
|
|
+
|
|
|
+ <div style="width:100%; min-height: 60px" v-if="row.produceList">
|
|
|
+ <ele-pro-table ref="table2" :need-page="false" :datasource="row.produceList" :columns="columns2"
|
|
|
+ row-key="code">
|
|
|
|
|
|
|
|
|
<!-- 默认值 -->
|
|
|
@@ -52,7 +52,7 @@
|
|
|
|
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
|
- <el-popconfirm class="ele-action" title="确定要删除当前参数吗?" @confirm="remove(row)">
|
|
|
+ <el-popconfirm class="ele-action" title="确定要删除当前参数吗?" @confirm="remove2(row)">
|
|
|
<template v-slot:reference>
|
|
|
<el-link type="danger" :underline="false" icon="el-icon-delete">
|
|
|
删除
|
|
|
@@ -253,18 +253,24 @@ export default {
|
|
|
},
|
|
|
|
|
|
chooseModal(data, current) {
|
|
|
-
|
|
|
+ data.map((m => {
|
|
|
+ m.parentId = current.id
|
|
|
+ return {
|
|
|
+ ...m,
|
|
|
+ }
|
|
|
+ }))
|
|
|
+
|
|
|
let tableList = []
|
|
|
tableList = this.$refs.table.getData()
|
|
|
|
|
|
tableList.forEach(e => {
|
|
|
- if(e.id == current.id) {
|
|
|
+ if (e.id == current.id) {
|
|
|
e.produceList = data
|
|
|
}
|
|
|
})
|
|
|
|
|
|
this.$refs.table.setData([...tableList]);
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
|
|
|
@@ -278,6 +284,22 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+ remove2(row) {
|
|
|
+
|
|
|
+ const data = this.$refs.table.getData() ?? [];
|
|
|
+
|
|
|
+
|
|
|
+ data.forEach((e) => {
|
|
|
+ if (row.parentId == e.id) {
|
|
|
+ e.produceList = e.produceList.filter((d) => d.id !== row.id);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ this.$refs.table.setData([...data])
|
|
|
+ this.$forceUpdate()
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
};
|
|
|
</script>
|