|
@ -348,21 +348,21 @@ watch( |
|
|
tableColumns.value = columnDefaultProps(rawColumns.value); |
|
|
tableColumns.value = columnDefaultProps(rawColumns.value); |
|
|
table.columns = tableColumns.value; |
|
|
table.columns = tableColumns.value; |
|
|
if (tableColumns.value && tableColumns.value.length > rawColumns.value.length) { |
|
|
if (tableColumns.value && tableColumns.value.length > rawColumns.value.length) { |
|
|
headerRef?.value?.handlerMoreRowColumnTitle(); |
|
|
headerRef.value?.handlerMoreRowColumnTitle(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
eventBus.on('onLocaleChanged', (local) => { |
|
|
eventBus.on('onLocaleChanged', (local) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
topRef.value.handlerQueryFormShowField(); |
|
|
topRef.value?.handlerQueryFormShowField(); |
|
|
topRef.value.setLocaleFlag(); |
|
|
topRef.value?.setLocaleFlag(); |
|
|
table.columns = tableColumns.value; |
|
|
table.columns = tableColumns.value; |
|
|
// 重构内置按钮 label |
|
|
// 重构内置按钮 label |
|
|
topRef.value.resetLabel(); |
|
|
topRef.value?.resetLabel(); |
|
|
topRef.value.handleToolbarActions(); |
|
|
topRef.value?.handleToolbarActions(); |
|
|
// 重构内置新增编辑窗口中的按钮 label |
|
|
// 重构内置新增编辑窗口中的按钮 label |
|
|
editorRef.value.resetButtonLabel(); |
|
|
editorRef.value?.resetButtonLabel(); |
|
|
stickyHeaderColumn(); |
|
|
stickyHeaderColumn(); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
@ -578,7 +578,7 @@ const rowClick = (evt: any, row: any, index: any) => { |
|
|
} |
|
|
} |
|
|
row[table.selectedField] = true; |
|
|
row[table.selectedField] = true; |
|
|
row[table.tickedField] = true; |
|
|
row[table.tickedField] = true; |
|
|
bodyRef.value.allTickedStatus(); |
|
|
bodyRef.value?.allTickedStatus(); |
|
|
if (props.onRowClick) { |
|
|
if (props.onRowClick) { |
|
|
emit('rowClick', evt, row, index); |
|
|
emit('rowClick', evt, row, index); |
|
|
} |
|
|
} |
|
@ -589,16 +589,16 @@ const rowDbClick = (evt, row, index) => { |
|
|
if (props.onRowDbClick) { |
|
|
if (props.onRowDbClick) { |
|
|
emit('rowDbClick', evt, row, index); |
|
|
emit('rowDbClick', evt, row, index); |
|
|
} else if (props.dbClickOperation === 'view') { |
|
|
} else if (props.dbClickOperation === 'view') { |
|
|
viewRef.value.view(); |
|
|
viewRef.value?.view(); |
|
|
} else { |
|
|
} else { |
|
|
topRef.value.dbClickOperation(row); |
|
|
topRef.value?.dbClickOperation(row); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const onResize = () => { |
|
|
const onResize = () => { |
|
|
onResizeRef.value = !onResizeRef.value; |
|
|
onResizeRef.value = !onResizeRef.value; |
|
|
topRef.value.handlerQueryFormShowField(); |
|
|
topRef.value?.handlerQueryFormShowField(); |
|
|
if (tableRef.value) { |
|
|
if (tableRef.value) { |
|
|
state.refHeightWidth.yLocation = tableRef.value.$el.getBoundingClientRect().y; |
|
|
state.refHeightWidth.yLocation = tableRef.value.$el.getBoundingClientRect().y; |
|
|
if (tableRef.value.$el.getElementsByClassName('noDataTr').length > 0) { |
|
|
if (tableRef.value.$el.getElementsByClassName('noDataTr').length > 0) { |
|
@ -643,7 +643,7 @@ const buildQueryCriterias = (reqParams) => { |
|
|
if (Object.keys(queryCriteria).length > 0) { |
|
|
if (Object.keys(queryCriteria).length > 0) { |
|
|
urlSearchParams.append('criteria', JSON.stringify(queryCriteria)); |
|
|
urlSearchParams.append('criteria', JSON.stringify(queryCriteria)); |
|
|
} |
|
|
} |
|
|
const queryForm = topRef.value.getQueryForm(); |
|
|
const queryForm = topRef.value?.getQueryForm(); |
|
|
if (queryForm) { |
|
|
if (queryForm) { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
const queryFormData = queryForm.getData(); |
|
|
const queryFormData = queryForm.getData(); |
|
@ -1001,7 +1001,7 @@ const stickyHeaderColumn = (time = 500) => { |
|
|
|
|
|
|
|
|
const tableDom = tableRef.value.$el.getElementsByTagName('table')[0]; |
|
|
const tableDom = tableRef.value.$el.getElementsByTagName('table')[0]; |
|
|
if (table.stickyNum > 0) { |
|
|
if (table.stickyNum > 0) { |
|
|
if (headerRef.value.getColumnTitleState().columnTitleRowNum > 1) { |
|
|
if (headerRef.value?.getColumnTitleState()?.columnTitleRowNum > 1) { |
|
|
const theadDom = tableDom.getElementsByTagName('thead')[0]; |
|
|
const theadDom = tableDom.getElementsByTagName('thead')[0]; |
|
|
const theadTrDom = theadDom.getElementsByTagName('tr'); |
|
|
const theadTrDom = theadDom.getElementsByTagName('tr'); |
|
|
tableDom.style.setProperty('--columnWidth' + '-' + 0 + '-' + 0, 0 + 'px'); |
|
|
tableDom.style.setProperty('--columnWidth' + '-' + 0 + '-' + 0, 0 + 'px'); |
|
@ -1124,14 +1124,14 @@ watchEffect(() => { |
|
|
const tableClassComputed = computed(() => { |
|
|
const tableClassComputed = computed(() => { |
|
|
const classArr = <string[]>['sticky-header-column-table']; |
|
|
const classArr = <string[]>['sticky-header-column-table']; |
|
|
if (table.stickyNum && table.stickyNum > 0) { |
|
|
if (table.stickyNum && table.stickyNum > 0) { |
|
|
if (headerRef.value.getColumnTitleState().columnTitleRowNum > 1) { |
|
|
if (headerRef.value?.getColumnTitleState()?.columnTitleRowNum > 1) { |
|
|
// 存在多行列头 |
|
|
// 存在多行列头 |
|
|
const stickyColumn = rawColumns.value.filter((item, index) => { |
|
|
const stickyColumn = rawColumns.value.filter((item, index) => { |
|
|
return index < table.stickyNum; |
|
|
return index < table.stickyNum; |
|
|
}); |
|
|
}); |
|
|
let tdNum = excludeColumnNum.value; |
|
|
let tdNum = excludeColumnNum.value; |
|
|
stickyColumn.forEach((item: any, index: number) => { |
|
|
stickyColumn.forEach((item: any, index: number) => { |
|
|
tdNum += headerRef.value.getMoreColumnTitleMap().get(item.name)!.colspan; |
|
|
tdNum += headerRef.value?.getMoreColumnTitleMap()?.get(item.name)?.colspan; |
|
|
}); |
|
|
}); |
|
|
// 处理表格数据列锁定 |
|
|
// 处理表格数据列锁定 |
|
|
if (tdNum > 0) { |
|
|
if (tdNum > 0) { |
|
@ -1198,9 +1198,9 @@ const updates = (data, callback) => { |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
if (tableColumns.value && tableColumns.value.length > rawColumns.value.length) { |
|
|
if (tableColumns.value && tableColumns.value.length > rawColumns.value.length) { |
|
|
headerRef.value.handlerMoreRowColumnTitle(); |
|
|
headerRef.value?.handlerMoreRowColumnTitle(); |
|
|
} |
|
|
} |
|
|
topRef.value.handlerQueryFormShowField(); |
|
|
topRef.value?.handlerQueryFormShowField(); |
|
|
if (props.autoFetchData) { |
|
|
if (props.autoFetchData) { |
|
|
onRequest({ |
|
|
onRequest({ |
|
|
pagination: state.pagination, |
|
|
pagination: state.pagination, |
|
@ -1211,19 +1211,19 @@ onMounted(() => { |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
const getQueryForm = () => { |
|
|
const getQueryForm = () => { |
|
|
return topRef.value.getQueryForm(); |
|
|
return topRef.value?.getQueryForm(); |
|
|
}; |
|
|
}; |
|
|
const getEditorDialog = () => { |
|
|
const getEditorDialog = () => { |
|
|
return editorRef.value.getDialog(); |
|
|
return editorRef.value?.getDialog(); |
|
|
}; |
|
|
}; |
|
|
const getEditorForm = () => { |
|
|
const getEditorForm = () => { |
|
|
return editorRef.value.getForm(); |
|
|
return editorRef.value?.getForm(); |
|
|
}; |
|
|
}; |
|
|
const getViewerDrawer = () => { |
|
|
const getViewerDrawer = () => { |
|
|
return viewRef.value.getViewerDrawer(); |
|
|
return viewRef.value?.getViewerDrawer(); |
|
|
}; |
|
|
}; |
|
|
const getViewerPanel = () => { |
|
|
const getViewerPanel = () => { |
|
|
return viewRef.value.getInfoPanel(); |
|
|
return viewRef.value?.getInfoPanel(); |
|
|
}; |
|
|
}; |
|
|
const setQueryCriteria = (criteria) => { |
|
|
const setQueryCriteria = (criteria) => { |
|
|
queryCriteria = criteria; |
|
|
queryCriteria = criteria; |
|
@ -1348,11 +1348,11 @@ const getCascadeParents = (propertyName: string) => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const edit = (selected) => { |
|
|
const edit = (selected) => { |
|
|
topRef.value.edit(selected); |
|
|
topRef.value?.edit(selected); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const view = () => { |
|
|
const view = () => { |
|
|
viewRef.value.view(); |
|
|
viewRef.value?.view(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const getElement = () => { |
|
|
const getElement = () => { |
|
|