提交 f99cd5b2 编写于 作者: zhujiamin's avatar zhujiamin

update:表格支持单多选

上级 d3e18127
......@@ -21,4 +21,18 @@ export interface GridViewState extends MDViewState {
* @memberof GridViewState
*/
rowEditState: boolean;
/**
* @description 支持快速搜索
* @type {boolean}
* @memberof GridViewState
*/
enableQuickSearch: boolean;
/**
* @description 默认展开搜索表单
* @type {boolean}
* @memberof GridViewState
*/
expandSearchForm: boolean;
}
\ No newline at end of file
......@@ -30,7 +30,7 @@ export class GridControl extends MDControl {
* @memberof GridControl
*/
public useCustom() {
const { controlName, selectFirstDefault, rowEditState, rowActiveMode } = this.state;
const { controlName, selectFirstDefault, rowEditState, rowActiveMode, isSingleSelect } = this.state;
const { selectedRowKeys } = toRefs(this.state);
// 滚动条配置
const useScrollOption = computed(() => {
......@@ -75,6 +75,7 @@ export class GridControl extends MDControl {
return false;
}
return {
type:isSingleSelect ? 'radio' : 'checkbox',
columnWidth: 90,
selectedRowKeys: selectedRowKeys.value,
checkStrictly: this.props.multiple ? false : true,
......
......@@ -57,4 +57,10 @@ export interface MDControlState extends MainControlState {
*/
isSelectDefault: boolean;
/**
* @description 是否单选
* @type {boolean}
* @memberof MDControlState
*/
isSingleSelect: boolean;
}
......@@ -88,4 +88,6 @@ export const ctrlState = {
{{>(lookup 'COLUMNMODEL') item=column}}
{{/each}}
],
// 是否单选
isSingleSelect:{{#if ctrl.singleSelect}}{{ctrl.singleSelect}}{{else}}false{{/if}},
};
\ No newline at end of file
......@@ -46,12 +46,12 @@ defineExpose({ state, name: '{{ctrl.name}}' });
bordered
sticky
class="app-grid{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}"
:rowKey="rowKey"
:rowKey="useRowKey"
:showHeader="true"
:scroll="scrollOption"
:sortDirections="['ascend', 'descend']"
:data-source="state.items"
:row-selection="rowSelectionOption"
:row-selection="useRowSelectionOption"
:columns="state.columnsModel"
:pagination="state.mdCtrlPaging.pagination"
:customRow="useCustomRow"
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册