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() { created() {
this.boxList = this.list.filter(item => item.itemType != 'inputRange') this.boxList = this.list.filter(item => item.itemType != 'inputRange')
console.log('cehck-bo----', this.list)
this.pid = this.list[0].itemGroupId this.pid = this.list[0].itemGroupId
}, },
methods: { methods: {

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

@ -1,13 +1,13 @@
<template> <template>
<div class="diy-container"> <div v-if="list.length > 0" class="diy-container">
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="自定义模板" name="first"> <el-tab-pane label="自定义模板" name="first">
<div class="diy-wr"> <div class="diy-wr">
<div class="left"> <div class="left">
<el-tabs tab-position="left" class="left-h"> <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"> <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" /> :list="item.queryItemList" @change="handleChangeBox" />
</div> </div>
</el-tab-pane> </el-tab-pane>
@ -21,9 +21,9 @@
</div> </div>
<div> <div>
<el-collapse v-model="activeCollapse" id="collapsWr"> <el-collapse v-model="activeCollapse" id="collapsWr">
<el-collapse-item v-for="item in rightList" :key="item.itemGroupId" <el-collapse-item v-for="item in rightList" :key="item.id"
:title="item.groupName" :name="item.itemGroupId" class="col-h"> :title="item.label" :name="item.id" class="col-h">
<dragItem :ref="'drag' + item.itemGroupId" :list="item.queryItemList" :id="item.itemGroupId" <dragItem :ref="'drag' + item.id" :list="item.queryItemList" :id="item.id"
@del="handleDelItem" @del="handleDelItem"
@drag="handleDrag($event, item)"></dragItem> @drag="handleDrag($event, item)"></dragItem>
</el-collapse-item> </el-collapse-item>
@ -162,8 +162,9 @@ export default {
}, },
created() { created() {
this.list.forEach(item => { this.list.forEach(item => {
this.$set(this.info, item.itemGroupId, []) this.$set(this.info, item.id, [])
}) })
console.log('infodiy----', this.list)
this.getTemplateList() this.getTemplateList()
}, },
watch: { watch: {
@ -181,12 +182,12 @@ export default {
// if (list.length == 0) return // if (list.length == 0) return
let obj = {} let obj = {}
this.list.forEach(item =>{ 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)) { if (groups.includes(pid)) {
this.rightList.forEach((item, i) => { this.rightList.forEach((item, i) => {
if (item.itemGroupId == pid ) { if (item.id == pid ) {
item.queryItemList = [...list] item.queryItemList = [...list]
if (list.length == 0) this.rightList.splice(i, 1) if (list.length == 0) this.rightList.splice(i, 1)
} }
@ -203,13 +204,13 @@ export default {
}, },
handleDelItem(val) { handleDelItem(val) {
const { item, index } = val const { item, index } = val
console.log('item------', item, this.$refs[`checkbox${item.itemGroupId}`]) console.log('item------', item, this.$refs[`checkbox${item.id}`])
const checkList = this.$refs[`checkbox${item.itemGroupId}`][0].checkedList const checkList = this.$refs[`checkbox${item.id}`][0].checkedList
checkList.forEach((n, i) => { 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) => { this.rightList.forEach((n, i) => {
if (n.itemGroupId === item.itemGroupId) { if (n.id === item.id) {
n.queryItemList.splice(index, 1) n.queryItemList.splice(index, 1)
if (n.queryItemList.length === 0) this.rightList.splice(i, 1) if (n.queryItemList.length === 0) this.rightList.splice(i, 1)
} }
@ -234,7 +235,7 @@ export default {
console.log('drag-----', val) console.log('drag-----', val)
console.log('drag-----', item) console.log('drag-----', item)
this.rightList.forEach((n, i) => { this.rightList.forEach((n, i) => {
if (item.itemGroupId == n.itemGroupId) n.queryItemList = [...val] if (item.id == n.id) n.queryItemList = [...val]
}) })
}, },
handleClose() { handleClose() {
@ -261,7 +262,7 @@ export default {
if (this.rightList.length == 0) return this.$message.error('请选择导出信息') if (this.rightList.length == 0) return this.$message.error('请选择导出信息')
this.previewList = this.rightList.map(item => { this.previewList = this.rightList.map(item => {
return { return {
label: item.groupName, label: item.label,
children: item.queryItemList children: item.queryItemList
} }
}) })
@ -288,11 +289,11 @@ export default {
formCode: 'resi_base_info', formCode: 'resi_base_info',
itemList: this.rightList.map(item => { itemList: this.rightList.map(item => {
return { return {
itemId: item.itemGroupId, itemId: item.id,
label: item.groupName, label: item.label,
tableName: item.queryItemList[0].tableName, tableName: item.queryItemList[0].tableName,
children: item.queryItemList, 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" top="5vh"
class="dialog-h" 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', formCode: 'resi_base_info',
pageNo: currentPage, pageNo: currentPage,
pageSize: pageSize, pageSize: pageSize,
@ -325,6 +325,7 @@ import resiTransfer from '../../components/resiTransfer.vue'
import resiChangeRecord from '../../components/resiChangeRecord.vue' import resiChangeRecord from '../../components/resiChangeRecord.vue'
import peopleMore from "@/views/modules/shequ/cpts/people-more"; import peopleMore from "@/views/modules/shequ/cpts/people-more";
import diyInfo from './diyInfo.vue' import diyInfo from './diyInfo.vue'
import { requestPost } from "@/js/dai/request";
export default { export default {
components: { components: {
@ -366,6 +367,7 @@ export default {
activeName: '', activeName: '',
tableData: [], tableData: [],
searchList: [], searchList: [],
exportList: [],
editAgencyId: '', editAgencyId: '',
editForm: { editForm: {
GRID_ID: '', GRID_ID: '',
@ -480,8 +482,10 @@ export default {
this.openSearch = !this.openSearch this.openSearch = !this.openSearch
}, },
diyExport() { async diyExport() {
this.diyDialog = true await this.getExportList()
}, },
computedWidth (label, type) { computedWidth (label, type) {
@ -1244,6 +1248,45 @@ export default {
return this.$message.error('网络错误') 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 () { async deleteresiBatch () {
if (this.selection.length === 0) return this.$message.error('请选择之后进行操作') if (this.selection.length === 0) return this.$message.error('请选择之后进行操作')
let userIds = this.selection.map(item => item.icResiUserId) let userIds = this.selection.map(item => item.icResiUserId)

Loading…
Cancel
Save