Browse Source

Merge branch 'dev-0420' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-0420

shibei_master
jiangyy 3 years ago
parent
commit
a44eb76ed3
  1. 1
      src/views/components/checkBox.vue
  2. 39
      src/views/modules/base/diyInfo.vue
  3. 49
      src/views/modules/base/resi.vue

1
src/views/components/checkBox.vue

@ -41,6 +41,7 @@ export default {
},
created() {
this.boxList = this.list.filter(item => item.itemType != 'inputRange')
console.log('cehck-bo----', this.list)
this.pid = this.list[0].itemGroupId
},
methods: {

39
src/views/modules/base/diyInfo.vue

@ -1,13 +1,13 @@
<template>
<div class="diy-container">
<div v-if="list.length > 0" class="diy-container">
<el-tabs v-model="activeName">
<el-tab-pane label="自定义模板" name="first">
<div class="diy-wr">
<div class="left">
<el-tabs tab-position="left" class="left-h">
<el-tab-pane v-for="item in list" :key="item.itemGroupId" :label="item.groupName">
<el-tab-pane v-for="item in list" :key="item.id" :label="item.label">
<div class="pd10 dialog-h-content scroll-h">
<checkBox :ref="'checkbox' + item.itemGroupId"
<checkBox v-if="item.queryItemList" :ref="'checkbox' + item.id"
:list="item.queryItemList" @change="handleChangeBox" />
</div>
</el-tab-pane>
@ -21,9 +21,9 @@
</div>
<div>
<el-collapse v-model="activeCollapse" id="collapsWr">
<el-collapse-item v-for="item in rightList" :key="item.itemGroupId"
:title="item.groupName" :name="item.itemGroupId" class="col-h">
<dragItem :ref="'drag' + item.itemGroupId" :list="item.queryItemList" :id="item.itemGroupId"
<el-collapse-item v-for="item in rightList" :key="item.id"
:title="item.label" :name="item.id" class="col-h">
<dragItem :ref="'drag' + item.id" :list="item.queryItemList" :id="item.id"
@del="handleDelItem"
@drag="handleDrag($event, item)"></dragItem>
</el-collapse-item>
@ -162,8 +162,9 @@ export default {
},
created() {
this.list.forEach(item => {
this.$set(this.info, item.itemGroupId, [])
this.$set(this.info, item.id, [])
})
console.log('infodiy----', this.list)
this.getTemplateList()
},
watch: {
@ -181,12 +182,12 @@ export default {
// if (list.length == 0) return
let obj = {}
this.list.forEach(item =>{
if (item.itemGroupId == pid) obj = { ...item, queryItemList: [...list] }
if (item.id == pid) obj = { ...item, queryItemList: [...list] }
})
const groups = this.rightList.map(item => item.itemGroupId)
const groups = this.rightList.map(item => item.id)
if (groups.includes(pid)) {
this.rightList.forEach((item, i) => {
if (item.itemGroupId == pid ) {
if (item.id == pid ) {
item.queryItemList = [...list]
if (list.length == 0) this.rightList.splice(i, 1)
}
@ -203,13 +204,13 @@ export default {
},
handleDelItem(val) {
const { item, index } = val
console.log('item------', item, this.$refs[`checkbox${item.itemGroupId}`])
const checkList = this.$refs[`checkbox${item.itemGroupId}`][0].checkedList
console.log('item------', item, this.$refs[`checkbox${item.id}`])
const checkList = this.$refs[`checkbox${item.id}`][0].checkedList
checkList.forEach((n, i) => {
if (n == item.itemId) this.$refs[`checkbox${item.itemGroupId}`][0].checkedList.splice(i, 1)
if (n == item.itemId) this.$refs[`checkbox${item.id}`][0].checkedList.splice(i, 1)
})
this.rightList.forEach((n, i) => {
if (n.itemGroupId === item.itemGroupId) {
if (n.id === item.id) {
n.queryItemList.splice(index, 1)
if (n.queryItemList.length === 0) this.rightList.splice(i, 1)
}
@ -234,7 +235,7 @@ export default {
console.log('drag-----', val)
console.log('drag-----', item)
this.rightList.forEach((n, i) => {
if (item.itemGroupId == n.itemGroupId) n.queryItemList = [...val]
if (item.id == n.id) n.queryItemList = [...val]
})
},
handleClose() {
@ -261,7 +262,7 @@ export default {
if (this.rightList.length == 0) return this.$message.error('请选择导出信息')
this.previewList = this.rightList.map(item => {
return {
label: item.groupName,
label: item.label,
children: item.queryItemList
}
})
@ -288,11 +289,11 @@ export default {
formCode: 'resi_base_info',
itemList: this.rightList.map(item => {
return {
itemId: item.itemGroupId,
label: item.groupName,
itemId: item.id,
label: item.label,
tableName: item.queryItemList[0].tableName,
children: item.queryItemList,
supportAdd: item.itemGroupId == '20220422102809_117' ? true : false
supportAdd: item.supportAdd
}
})
}

49
src/views/modules/base/resi.vue

@ -299,7 +299,7 @@
top="5vh"
class="dialog-h"
>
<diy-info v-if="diyDialog" ref="ref_diy" :list="searchList" :search="{
<diy-info v-if="diyDialog" ref="ref_diy" :list="exportList" :search="{
formCode: 'resi_base_info',
pageNo: currentPage,
pageSize: pageSize,
@ -325,6 +325,7 @@ import resiTransfer from '../../components/resiTransfer.vue'
import resiChangeRecord from '../../components/resiChangeRecord.vue'
import peopleMore from "@/views/modules/shequ/cpts/people-more";
import diyInfo from './diyInfo.vue'
import { requestPost } from "@/js/dai/request";
export default {
components: {
@ -366,6 +367,7 @@ export default {
activeName: '',
tableData: [],
searchList: [],
exportList: [],
editAgencyId: '',
editForm: {
GRID_ID: '',
@ -480,8 +482,10 @@ export default {
this.openSearch = !this.openSearch
},
diyExport() {
this.diyDialog = true
async diyExport() {
await this.getExportList()
},
computedWidth (label, type) {
@ -1244,6 +1248,45 @@ export default {
return this.$message.error('网络错误')
})
},
async getExportList (type) {
const url = '/oper/customize//icformitemgroup/list'
let params = {
formCode: 'resi_base_info'
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
data.forEach(item => {
(async (id) => {
item.queryItemList = await this.getExportChildList(id)
})(item.id)
})
this.exportList = [...data]
this.$nextTick(() => {
this.diyDialog = true
})
console.log('获取详情成功getExportList----', this.exportList)
} else {
this.$message.error(msg)
}
},
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)
}
},
async deleteresiBatch () {
if (this.selection.length === 0) return this.$message.error('请选择之后进行操作')
let userIds = this.selection.map(item => item.icResiUserId)

Loading…
Cancel
Save