+
@@ -129,6 +129,7 @@
import checkBox from '../../components/checkBox.vue'
import dragItem from '../../components/dragItem.vue'
import Sortable from 'sortablejs'
+import { requestPost } from "@/js/dai/request"
export default {
props: {
list: {
@@ -149,8 +150,10 @@ export default {
exportLoading: false,
activeCollapse: ['1'],
activeName: 'first',
+ leftActive: '',
info: {},
rightList: [],
+ leftList: [],
form: {
isSaveTemp: false,
name: '',
@@ -161,11 +164,14 @@ export default {
diyDialog: false,
}
},
- created() {
+ async created() {
this.list.forEach(item => {
this.$set(this.info, item.id, [])
})
- console.log('infodiy----', this.list)
+ this.leftActive = this.list[0].id
+ this.leftList = [...this.list]
+ this.leftList[0].queryItemList = await this.getExportChildList(this.leftList[0].id)
+ console.log('infodiy----', this.leftList)
this.getTemplateList()
},
watch: {
@@ -175,14 +181,24 @@ export default {
},
deep: true
- }
+ },
+ // list: {
+ // handler(val) {
+ // if (val.length > 0) {
+ // this.leftList = [...val]
+ // this.leftList[0].queryItemList = this.getExportChildList(this.leftList[0].id)
+ // }
+ // },
+ // deep: true,
+ // // immediate: true
+ // },
},
methods: {
handleChangeBox({list, pid}) {
console.log('ccccc----', list)
// if (list.length == 0) return
let obj = {}
- this.list.forEach(item =>{
+ this.leftList.forEach(item =>{
if (item.id == pid) obj = { ...item, queryItemList: [...list] }
})
const groups = this.rightList.map(item => item.id)
@@ -203,12 +219,23 @@ export default {
}
this.activeCollapse = [...this.activeCollapse, pid]
},
+ handleTabsClick(val) {
+ console.log('tabs-----', val)
+ this.leftList.forEach(async item => {
+ if (item.id == val.name) {
+ if (item.queryItemList.length == 0) item.queryItemList = await this.getExportChildList(item.id)
+ }
+ })
+ },
handleDelItem(val) {
const { item, index } = val
console.log('item------', item, this.$refs[`checkbox${item.itemGroupId}`])
- const checkList = this.$refs[`checkbox${item.itemGroupId}`][0].checkedList
+ let checkList = this.$refs[`checkbox${item.itemGroupId}`][0].checkedList
checkList.forEach((n, i) => {
- if (n == item.itemId) this.$refs[`checkbox${item.itemGroupId}`][0].checkedList.splice(i, 1)
+ if (n == item.itemId) {
+ checkList.splice(i, 1)
+ this.$refs[`checkbox${item.itemGroupId}`][0].handleChange(checkList)
+ }
})
this.rightList.forEach((n, i) => {
if (n.id === item.itemGroupId) {
@@ -387,6 +414,20 @@ export default {
return this.$message.error('网络错误')
})
},
+ async getExportChildList (groupId) {
+ const url = `/oper/customize/icformitem/getItemList/${groupId}`
+ let params = {}
+
+ const { data, code, msg } = await requestPost(url, params)
+
+ if (code === 0) {
+
+ return data
+
+ } else {
+ this.$message.error(msg)
+ }
+ },
}
}
@@ -422,6 +463,10 @@ export default {
}
}
}
+.h80 {
+ height: calc(80vh - 160px);
+ overflow: auto;
+}
.diy-footer {
display: flex;
align-items: center;
diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue
index 391035b1..01335d6c 100644
--- a/src/views/modules/base/resi.vue
+++ b/src/views/modules/base/resi.vue
@@ -1260,7 +1260,8 @@ export default {
data.forEach(item => {
(async (id) => {
- item.queryItemList = await this.getExportChildList(id)
+ // item.queryItemList = await this.getExportChildList(id)
+ item.queryItemList = []
})(item.id)
})
this.exportList = [...data]