|
|
@ -24,21 +24,24 @@ |
|
|
|
<template #top="scope"> |
|
|
|
<q-resize-observer @resize="onResize" /> |
|
|
|
<div class="col"> |
|
|
|
<w-form ref="queryFormRef" v-bind="props.queryFormAttrs" :fields="table.queryFormFields" :cols-num="queryFormColsNum"> |
|
|
|
<div class="pt-2.5 flex flex-nowrap items-end"> |
|
|
|
<div class="flex-none">{{ title }}</div> |
|
|
|
<div class="flex-1"> |
|
|
|
<w-toolbar :dense="denseToolbarComputed" v-bind="toolbarConfigure" :buttons="buttons_" :grid="instance"></w-toolbar> |
|
|
|
</div> |
|
|
|
<div v-if="configButton" class="flex-none pl-1"> |
|
|
|
<q-btn round dense :size="denseToolbarComputed ? '13px' : '14px'" :icon="IconEnum.设置" unelevated outline> |
|
|
|
<q-popup-proxy v-model="table.gridConfig"> |
|
|
|
<GridConfig :scope="scope" :grid-props="props" :more-column-title-array="columnTitleState.columnTitleArr" :grid="instance"></GridConfig> |
|
|
|
</q-popup-proxy> |
|
|
|
</q-btn> |
|
|
|
</div> |
|
|
|
<w-form ref="queryFormRef" v-bind="props.queryFormAttrs" :fields="table.queryFormFields" :cols-num="queryFormColsNum"></w-form> |
|
|
|
<div |
|
|
|
v-if="title || buttons_.length > 0 || configButton || table.queryFormFields.length > 0" |
|
|
|
class="flex flex-nowrap items-end" |
|
|
|
:class="table.queryFormFields.length > 0 ? 'pt-2.5' : ''" |
|
|
|
> |
|
|
|
<div class="flex-none">{{ title }}</div> |
|
|
|
<div class="flex-1"> |
|
|
|
<w-toolbar :dense="denseToolbarComputed" v-bind="toolbarConfigure" :buttons="buttons_" :grid="instance"></w-toolbar> |
|
|
|
</div> |
|
|
|
</w-form> |
|
|
|
<div v-if="configButton" class="flex-none pl-1"> |
|
|
|
<q-btn round dense :size="denseToolbarComputed ? '13px' : '14px'" :icon="IconEnum.设置" unelevated outline> |
|
|
|
<q-popup-proxy v-model="table.gridConfig"> |
|
|
|
<GridConfig :scope="scope" :grid-props="props" :more-column-title-array="columnTitleState.columnTitleArr" :grid="instance"></GridConfig> |
|
|
|
</q-popup-proxy> |
|
|
|
</q-btn> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template #header="scope"> |
|
|
@ -679,8 +682,8 @@ const buttonObj = { |
|
|
|
}, |
|
|
|
expand: { |
|
|
|
name: ButtonEnum.expand, |
|
|
|
icon: expandIcon.value, |
|
|
|
label: expandLabel.value, |
|
|
|
icon: expandIcon, |
|
|
|
label: expandLabel, |
|
|
|
click: (selected, context) => { |
|
|
|
expandFun(table.rows, table.treeExpand); |
|
|
|
table.treeExpand = !table.treeExpand; |
|
|
@ -1190,8 +1193,6 @@ const onRequest = async (ops: any) => { |
|
|
|
state.pagination.rowsPerPage = responseData.size || state.pagination.rowsPerPage; |
|
|
|
} |
|
|
|
state.pagination.rowsNumber = responseData.totalElements; |
|
|
|
state.pagination.sortBy = ops.pagination.sortBy; |
|
|
|
state.pagination.descending = ops.pagination.descending; |
|
|
|
table.rows = responseData.content; |
|
|
|
} |
|
|
|
} else if (resp && resp.data && props.tree) { |
|
|
@ -1216,6 +1217,8 @@ const onRequest = async (ops: any) => { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
state.pagination.sortBy = ops.pagination.sortBy; |
|
|
|
state.pagination.descending = ops.pagination.descending; |
|
|
|
addRowKey(table.rows); |
|
|
|
stickyHeaderColumn(); |
|
|
|
}; |
|
|
@ -1258,6 +1261,8 @@ const save = async () => { |
|
|
|
dialogFormData[props.foreignKey] = null; |
|
|
|
} else if (formStatus === 'addChild') { |
|
|
|
dialogFormData[props.foreignKey] = getSelectedRowsComputed.value[0][props.primaryKey]; |
|
|
|
} else if (formStatus === PageStatusEnum.编辑 && getSelectedRowsComputed.value[0][props.foreignKey]) { |
|
|
|
dialogFormData[props.foreignKey] = getSelectedRowsComputed.value[0][props.foreignKey]; |
|
|
|
} |
|
|
|
let requestParams = { |
|
|
|
method: formStatus === PageStatusEnum.新增 || formStatus === 'addTop' || formStatus === 'addChild' ? 'POST' : 'PUT', |
|
|
@ -1554,6 +1559,11 @@ const stickyHeaderColumn = (time = 500) => { |
|
|
|
tableRef.value.$el.getElementsByClassName('q-table__bottom')[0].style.setProperty('--tableBottomHeight', 50 + 'px'); |
|
|
|
tableRef.value.$el.getElementsByClassName('q-table__bottom')[0].style.setProperty('--tableBottomButtonHeight', 40 + 'px'); |
|
|
|
} |
|
|
|
if (props.title || buttons_.length > 0 || props.configButton) { |
|
|
|
tableRef.value.$el.getElementsByClassName('q-table__top')[0].style.setProperty('--tableTopPadding', '8px'); |
|
|
|
} else { |
|
|
|
tableRef.value.$el.getElementsByClassName('q-table__top')[0].style.setProperty('--tableTopPadding', '0px'); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const excludeColumnNum = computed(() => { |
|
|
@ -2086,7 +2096,7 @@ VueTools.expose2Instance(instance); |
|
|
|
} */ |
|
|
|
|
|
|
|
.q-table__top { |
|
|
|
padding: 8px 8px; |
|
|
|
padding: var(--tableTopPadding) var(--tableTopPadding); |
|
|
|
} |
|
|
|
|
|
|
|
.q-table tr:first-child th:first-child { |
|
|
|