Merge remote-tracking branch 'origin/feature_dev_20230109_BTTZ' into dev_2nd_20230213

# Conflicts:
#	jero-web/src/mixins/header.js
#	jero-web/src/views/businessSupport/collectionOfRegulatoryOpinions/components/evaluationResultsList.vue
#	jero-web/src/views/documentManage/collection/index.vue
#	jero-web/src/views/documentTools/virtualList/components/virtualListDetails.vue
#	jero-web/src/views/projectManagement/components/customizeList.vue
This commit is contained in:
高嵩
2023-02-13 09:51:53 +08:00
120 changed files with 1852 additions and 950 deletions
+63 -14
View File
@@ -5,8 +5,10 @@ const events = {
move: 'mousemove',
stop: 'mouseup'
}
let tableAll = [] // 单个页面存放多个表格的columns
var columnsAll = []
var columnsKey = ''
let minColumn = [] // 存放设置最小宽的列及宽度
const DragHandler = {
name: 'nio-drag-handler',
//获取混入的方法(重新设置表头宽度)
@@ -85,26 +87,63 @@ const DragHandler = {
return h('div', { class: 'nio-drag-handler', on: { mousedown: this.handleMouseDown } }, [line])
}
}
const ResizeHeaderOne = function(val, name) {
const ResizeHeaderOne = function(val, name ,minWidths) {
columnsAll = val
columnsKey = name
minColumn = minWidths
if(tableAll.indexOf(val) === -1){
tableAll.push(val)
}
return (h, props, children) => {
const { key, column, ...restProps } = props
let col = {}
// 处理多级表头
col = getRenderCoL(key, val)
// col = getRenderCoL(key, val)
col = getRenderCoL(key, columnsAll)
let content = [].concat(children)
if (col ) {
const handlerVNode = h(DragHandler, {
props: {
width: col.width,
minWidth: Math.min(col.width, 100),
column: col
if (col) {
let handlerVNode;
if(minColumn && minWidths !== undefined && minColumn.length>0){
// 存放所有需要手动设置最小宽度的列的dataIndex
let colsdataIndex = []
minColumn.forEach((item)=>{
colsdataIndex.push(item[0].dataIndex)
handlerVNode = h(DragHandler, {
props: {
width: col.width,
minWidth: Math.min(item[1]),
column: col
}
}, [])
content = content.concat(
handlerVNode
)
})
// 不需要手动设置最小宽度的列
if(colsdataIndex.indexOf(col.dataIndex) === -1){
handlerVNode = h(DragHandler, {
props: {
width: col.width,
minWidth: Math.min(col.width, 100),
column: col
}
}, [])
content = content.concat(
handlerVNode
)
}
}, [])
content = content.concat(
handlerVNode
)
}else{
handlerVNode = h(DragHandler, {
props: {
width: col.width,
minWidth: Math.min(col.width, 100),
column: col
}
}, [])
content = content.concat(
handlerVNode
)
}
}
console.log(restProps)
let className = ''
@@ -120,10 +159,12 @@ const ResizeHeaderOne = function(val, name) {
}
export const ResizeHeader = {
methods: {
drag(columns, name) {
drag(columns, name ,minWidths) {
console.log(minWidths)
return {
header: {
cell: ResizeHeaderOne(columns, name)
// minWidths : 最小宽度 => [[需要设置的列,最小宽],[需要设置的列,最小宽],...]
cell: ResizeHeaderOne(columns, name,minWidths)
}
}
}
@@ -197,6 +238,14 @@ export const ResizeColumnProvide = {
},
methods: {
_resizeColumn(w, column) {
console.log(column)
tableAll.forEach(item=>{
item.forEach((i)=>{
if(i === column && i.dataIndex === column.dataIndex){
columnsAll = item
}
})
})
this.moving = true
let time = setTimeout(() => {
this.moving = false