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

update:表格支持单多选

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