diff --git a/jero-web/src/components/tableCollection/index.vue b/jero-web/src/components/tableCollection/index.vue index 83f6a46f0..d8aac10db 100644 --- a/jero-web/src/components/tableCollection/index.vue +++ b/jero-web/src/components/tableCollection/index.vue @@ -787,98 +787,184 @@ if (res.success) { if(res.result && res.result.length > 0){ jsonHead = res.result + this.columns = [] + let num = 0 + this.content = [] + let checkedList = [] + jsonHead.forEach((res, index) => { + // console.log(res) + // 配置列 + checkedList.push(res.dataIndex) + if (res.type) { + // console.log('配置') + this.columns.push({ + dataIndex: res.db_field_name, + align: 'left', + ellipsis: true, + sorter: res.sort, + width: 600 + }) + num++ + this.content.push(res) + this.columns[index].scopedSlots = { + customRender: 'detailClick', + title: 'titleName' + num + } + console.log( this.content," this.content this.content this.content this.content this.content") + // 非配置列 + } else { + this.columns.push({ + title: res.db_field_txt, + dataIndex: res.db_field_name, + align: 'left', + // ellipsis: true, + fixed: res.click5 ? 'left' : '', + sorter: res.sort, + width: 160 + }) + this.columns[index].scopedSlots = { + customRender: 'titleName' + } + if (res.db_field_name == 'nioNumber') { + this.columns[index].width = 120 + } + if (res.click1) { + this.columns[index].scopedSlots = { + customRender: 'operationzr' + } + } + if (res.click2) { + this.columns[index].scopedSlots = { + customRender: 'ParameterDescription' + } + } + if (res.click3) { + this.columns[index].scopedSlots = { + customRender: 'paramsNameDescription' + } + } + if (res.click6) { + this.columns[index].scopedSlots = { + customRender: 'Operation' + } + } + if (res.click) { + // 工程接口人列表修改 + this.columns[index].scopedSlots = { + customRender: 'operationbtn' + } + } + if (res.db_field_name == 'paramsName') { + this.columns[index].width = 300 + this.columns[index].scopedSlots = { + customRender: 'paramsName' + } + } + } + + if(res.isLock && res.isLock === '0'){ + this.colIndexs.push(index) + } + }) + this.columns = [...this.columns] + this.colIndexs.forEach((item)=>{ + this.minWidthColumns.push([this.columns[item],500]) + }) + this.$emit('getcustomizeList',checkedList) + this.$forceUpdate() }else{ + console.log(1) getAction(this.url.tableHeader, params).then((val) => { if (val.success) { - jsonHead = val.result + jsonHead = val.result + this.columns = [] + let num = 0 + this.content = [] + let checkedList = [] + jsonHead.forEach((res, index) => { + // console.log(res) + // 配置列 + checkedList.push(res.dataIndex) + if (res.type) { + // console.log('配置') + this.columns.push({ + dataIndex: res.db_field_name, + align: 'left', + ellipsis: true, + sorter: res.sort, + width: 600 + }) + num++ + this.content.push(res) + this.columns[index].scopedSlots = { + customRender: 'detailClick', + title: 'titleName' + num + } + console.log( this.content," this.content this.content this.content this.content this.content") + // 非配置列 + } else { + this.columns.push({ + title: res.db_field_txt, + dataIndex: res.db_field_name, + align: 'left', + // ellipsis: true, + fixed: res.click5 ? 'left' : '', + sorter: res.sort, + width: 160 + }) + this.columns[index].scopedSlots = { + customRender: 'titleName' + } + if (res.db_field_name == 'nioNumber') { + this.columns[index].width = 120 + } + if (res.click1) { + this.columns[index].scopedSlots = { + customRender: 'operationzr' + } + } + if (res.click2) { + this.columns[index].scopedSlots = { + customRender: 'ParameterDescription' + } + } + if (res.click3) { + this.columns[index].scopedSlots = { + customRender: 'paramsNameDescription' + } + } + if (res.click6) { + this.columns[index].scopedSlots = { + customRender: 'Operation' + } + } + if (res.click) { + // 工程接口人列表修改 + this.columns[index].scopedSlots = { + customRender: 'operationbtn' + } + } + if (res.db_field_name == 'paramsName') { + this.columns[index].width = 300 + this.columns[index].scopedSlots = { + customRender: 'paramsName' + } + } + } + + if(res.isLock && res.isLock === '0'){ + this.colIndexs.push(index) + } + }) + this.columns = [...this.columns] + this.colIndexs.forEach((item)=>{ + this.minWidthColumns.push([this.columns[item],500]) + }) + this.$emit('getcustomizeList',checkedList) + this.$forceUpdate() } }) } - this.columns = [] - let num = 0 - this.content = [] - let checkedList = [] - jsonHead.forEach((res, index) => { - // console.log(res) - // 配置列 - checkedList.push(res.dataIndex) - if (res.type) { - // console.log('配置') - this.columns.push({ - dataIndex: res.db_field_name, - align: 'left', - ellipsis: true, - sorter: res.sort, - width: 600 - }) - num++ - this.content.push(res) - this.columns[index].scopedSlots = { - customRender: 'detailClick', - title: 'titleName' + num - } - console.log( this.content," this.content this.content this.content this.content this.content") - // 非配置列 - } else { - this.columns.push({ - title: res.db_field_txt, - dataIndex: res.db_field_name, - align: 'left', - // ellipsis: true, - fixed: res.click5 ? 'left' : '', - sorter: res.sort, - width: 160 - }) - this.columns[index].scopedSlots = { - customRender: 'titleName' - } - if (res.db_field_name == 'nioNumber') { - this.columns[index].width = 120 - } - if (res.click1) { - this.columns[index].scopedSlots = { - customRender: 'operationzr' - } - } - if (res.click2) { - this.columns[index].scopedSlots = { - customRender: 'ParameterDescription' - } - } - if (res.click3) { - this.columns[index].scopedSlots = { - customRender: 'paramsNameDescription' - } - } - if (res.click6) { - this.columns[index].scopedSlots = { - customRender: 'Operation' - } - } - if (res.click) { - // 工程接口人列表修改 - this.columns[index].scopedSlots = { - customRender: 'operationbtn' - } - } - if (res.db_field_name == 'paramsName') { - this.columns[index].width = 300 - this.columns[index].scopedSlots = { - customRender: 'paramsName' - } - } - } - - if(res.isLock && res.isLock === '0'){ - this.colIndexs.push(index) - } - }) - this.columns = [...this.columns] - this.colIndexs.forEach((item)=>{ - this.minWidthColumns.push([this.columns[item],500]) - }) - this.$emit('getcustomizeList',checkedList) - this.$forceUpdate() } }) }, @@ -1043,8 +1129,8 @@ if (Obj[item] instanceof Object && Obj[item].controlType !== undefined) { for (const key in Obj[item].paramsConfigData){ Obj[item].paramsConfigData[key].forEach((itemLi) => { - console.log(item) - console.log(this.currentPersonRole) + // console.log(item) + // console.log(this.currentPersonRole) if((this.currentPersonRole == 'homo' || this.currentPersonRole == 'admin') && item == 'referencesCol'){ itemLi.isLock = 0 }else{ diff --git a/jero-web/src/components/tableCollection/index1.vue b/jero-web/src/components/tableCollection/index1.vue index 1314dbd20..193d17b0f 100644 --- a/jero-web/src/components/tableCollection/index1.vue +++ b/jero-web/src/components/tableCollection/index1.vue @@ -578,96 +578,179 @@ if (res.success) { if(res.result && res.result.length > 0){ jsonHead = res.result + this.columns = [] + let num = 0 + this.content = [] + let checkedList = [] + jsonHead.forEach((res, index) => { + checkedList.push(res.dataIndex) + // 配置列 + if (res.type) { + this.columns.push({ + dataIndex: res.db_field_name, + align: 'left', + ellipsis: true, + sorter: res.sort, + width: 500 + }) + num++ + this.content.push(res) + this.columns[index].scopedSlots = { + customRender: 'detailClick', + title: 'titleName' + num + } + // 非配置列 + } else { + this.columns.push({ + title: res.db_field_txt, + dataIndex: res.db_field_name, + align: 'left', + // ellipsis: true, + fixed: res.fixedLeft ? 'left' : '', + sorter: res.sort, + width: 160 + }) + this.columns[index].scopedSlots = { + customRender: 'titleName' + } + if (res.db_field_name == 'nioNumber') { + this.columns[index].width = 120 + } + if (res.click) { + // 工程接口人列表修改 + this.columns[index].scopedSlots = { + customRender: 'operationbtn' + } + } + if (res.click2) { + this.columns[index].scopedSlots = { + customRender: 'ParameterDescription' + } + } + if (res.click3) { + this.columns[index].scopedSlots = { + customRender: 'RemarkDescription' + } + } + if (res.click4) { + this.columns[index].scopedSlots = { + customRender: 'Operation' + } + } + if (res.db_field_name == 'paramsName') { + this.columns[index].width = 300 + this.columns[index].ellipsis = false + this.columns[index].scopedSlots = { + customRender: 'paramsName' + } + } + } + + if(res.type){ + this.colIndexs.push(index) + } + }) + + this.isTrue = false + setTimeout(()=>{ + this.isTrue = true + this.columns = [...this.columns] + this.colIndexs.forEach((item)=>{ + this.minWidthColumns.push([this.columns[item],500]) + this.$emit('getcustomizeList',checkedList) + }) + },300) + console.log(this.columns) }else{ getAction(this.url.tableHeader, params).then((val) => { if (val.success) { jsonHead = val.result - } - }) - } - this.columns = [] - let num = 0 - this.content = [] - let checkedList = [] - jsonHead.forEach((res, index) => { - checkedList.push(res.dataIndex) - // 配置列 - if (res.type) { - this.columns.push({ - dataIndex: res.db_field_name, - align: 'left', - ellipsis: true, - sorter: res.sort, - width: 500 - }) - num++ - this.content.push(res) - this.columns[index].scopedSlots = { - customRender: 'detailClick', - title: 'titleName' + num - } - // 非配置列 - } else { - this.columns.push({ - title: res.db_field_txt, - dataIndex: res.db_field_name, - align: 'left', - // ellipsis: true, - fixed: res.fixedLeft ? 'left' : '', - sorter: res.sort, - width: 160 - }) - this.columns[index].scopedSlots = { - customRender: 'titleName' - } - if (res.db_field_name == 'nioNumber') { - this.columns[index].width = 120 - } - if (res.click) { - // 工程接口人列表修改 - this.columns[index].scopedSlots = { - customRender: 'operationbtn' - } - } - if (res.click2) { - this.columns[index].scopedSlots = { - customRender: 'ParameterDescription' - } - } - if (res.click3) { - this.columns[index].scopedSlots = { - customRender: 'RemarkDescription' - } - } - if (res.click4) { - this.columns[index].scopedSlots = { - customRender: 'Operation' - } - } - if (res.db_field_name == 'paramsName') { - this.columns[index].width = 300 - this.columns[index].ellipsis = false - this.columns[index].scopedSlots = { - customRender: 'paramsName' - } - } - } + this.columns = [] + let num = 0 + this.content = [] + let checkedList = [] + jsonHead.forEach((res, index) => { + checkedList.push(res.dataIndex) + // 配置列 + if (res.type) { + this.columns.push({ + dataIndex: res.db_field_name, + align: 'left', + ellipsis: true, + sorter: res.sort, + width: 500 + }) + num++ + this.content.push(res) + this.columns[index].scopedSlots = { + customRender: 'detailClick', + title: 'titleName' + num + } + // 非配置列 + } else { + this.columns.push({ + title: res.db_field_txt, + dataIndex: res.db_field_name, + align: 'left', + // ellipsis: true, + fixed: res.fixedLeft ? 'left' : '', + sorter: res.sort, + width: 160 + }) + this.columns[index].scopedSlots = { + customRender: 'titleName' + } + if (res.db_field_name == 'nioNumber') { + this.columns[index].width = 120 + } + if (res.click) { + // 工程接口人列表修改 + this.columns[index].scopedSlots = { + customRender: 'operationbtn' + } + } + if (res.click2) { + this.columns[index].scopedSlots = { + customRender: 'ParameterDescription' + } + } + if (res.click3) { + this.columns[index].scopedSlots = { + customRender: 'RemarkDescription' + } + } + if (res.click4) { + this.columns[index].scopedSlots = { + customRender: 'Operation' + } + } + if (res.db_field_name == 'paramsName') { + this.columns[index].width = 300 + this.columns[index].ellipsis = false + this.columns[index].scopedSlots = { + customRender: 'paramsName' + } + } + } - if(res.type){ - this.colIndexs.push(index) - } - }) + if(res.type){ + this.colIndexs.push(index) + } + }) - this.isTrue = false - setTimeout(()=>{ - this.isTrue = true - this.columns = [...this.columns] - this.colIndexs.forEach((item)=>{ - this.minWidthColumns.push([this.columns[item],500]) - this.$emit('getcustomizeList',checkedList) - }) - },300) - console.log(this.columns) + this.isTrue = false + setTimeout(()=>{ + this.isTrue = true + this.columns = [...this.columns] + this.colIndexs.forEach((item)=>{ + this.minWidthColumns.push([this.columns[item],500]) + this.$emit('getcustomizeList',checkedList) + }) + },300) + console.log(this.columns) + } + }) + } } }) },