no message
This commit is contained in:
@@ -69,6 +69,7 @@ interface ColumnConfig {
|
||||
filterable: boolean
|
||||
sortable: string | boolean
|
||||
showColumn: boolean
|
||||
sortNum?: number
|
||||
}
|
||||
|
||||
interface Props {
|
||||
@@ -93,10 +94,6 @@ const initColumnConfig = () => {
|
||||
if (!props.columns) return
|
||||
|
||||
columnConfigList.value = Object.keys(props.columns)
|
||||
.filter(key => {
|
||||
const column = props.columns[key]
|
||||
return column.showColumn !== false && column.prop
|
||||
})
|
||||
.map(key => {
|
||||
const column = props.columns[key]
|
||||
return {
|
||||
@@ -106,10 +103,18 @@ const initColumnConfig = () => {
|
||||
fixed: column.fixed || false,
|
||||
filterable: column.filterable || false,
|
||||
sortable: column.sortable || false,
|
||||
showColumn: column.showColumn !== false
|
||||
showColumn: column.showColumn !== false,
|
||||
sortNum: column.sortNum
|
||||
}
|
||||
})
|
||||
.sort((a, b) => {
|
||||
// 优先按 sortNum 排序(从小到大)
|
||||
if (a.sortNum !== undefined && b.sortNum !== undefined) {
|
||||
return a.sortNum - b.sortNum
|
||||
}
|
||||
if (a.sortNum !== undefined) return -1
|
||||
if (b.sortNum !== undefined) return 1
|
||||
// 如果都没有 sortNum,则按 label 排序
|
||||
const labelA = a.label || ''
|
||||
const labelB = b.label || ''
|
||||
return labelA.localeCompare(labelB, 'zh-CN')
|
||||
|
||||
@@ -1417,7 +1417,6 @@ const replaceColumnButton = () => {
|
||||
|
||||
// 添加新的事件监听器
|
||||
newButtonClone.addEventListener('click', (e) => {
|
||||
debugger
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
showColumnConfigDrawer.value = true
|
||||
@@ -1555,12 +1554,10 @@ const loadColumnConfigToFieldList = async () => {
|
||||
try {
|
||||
const pageId = (route.params.id as string) || props.tableId
|
||||
const savedConfig = await getColumnConfig(pageId)
|
||||
debugger
|
||||
|
||||
if (savedConfig) {
|
||||
// 修改 fieldList 中的 webEntity.isShowColumn
|
||||
fieldListRef.value.forEach((field: any) => {
|
||||
debugger
|
||||
if (field.webEntity && field.fieldCode && savedConfig[field.fieldCode] !== undefined) {
|
||||
const colConfig = savedConfig[field.fieldCode]
|
||||
// 优先使用 isShowColumn,如果没有则使用 hide 转换
|
||||
|
||||
@@ -116,7 +116,7 @@ const initColumn = (data, componentData, columnParams) => {
|
||||
const summaryBottom = {}
|
||||
const tableDic = {}
|
||||
data.forEach(item => {
|
||||
const { dictEntity, webEntity, queryEntity, exportEntity, summaryEntity, fieldCode, fieldName, fieldType, fieldLen, fieldPointLen, fieldDefaultVal } = item
|
||||
const { dictEntity, webEntity, queryEntity, exportEntity, summaryEntity, fieldCode, fieldName, fieldType, fieldLen, fieldPointLen, fieldDefaultVal, sortNum } = item
|
||||
const { cellWidthType, cellWidth, controlsConfig, verifyConfig, isShowForm, isShowList, isDbSelect, isShowColumn, isShowSort, isRequired } = webEntity
|
||||
let controlType = webEntity.controlType || 'input'
|
||||
const { queryIsWeb, queryMode, queryConfig, queryDefaultVal } = queryEntity
|
||||
@@ -140,7 +140,8 @@ const initColumn = (data, componentData, columnParams) => {
|
||||
dataType: ['Integer', 'BigInt', 'BigDecimal'].includes(fieldType) || controlType == 'number' ? 'number' : 'string',
|
||||
overHidden: isCardTable ? false : true,
|
||||
className: `low-field__${fieldCode} control-${controlType}`,
|
||||
labelClassName: `low-header__${fieldCode}`
|
||||
labelClassName: `low-header__${fieldCode}`,
|
||||
sortNum: sortNum
|
||||
}
|
||||
|
||||
//租户字段的列表、表单权限控制
|
||||
|
||||
Reference in New Issue
Block a user