提交 cbb40102 编写于 作者: 邱定凯's avatar 邱定凯

update: 更新列表下列表视图内置工具栏和批操作工具栏

上级 3b328b69
......@@ -26,14 +26,6 @@ interface CheckboxListProps {
*/
data: IParam;
/**
* 代码表值分隔符
*
* @type {string}
* @memberof CheckboxListProps
*/
valueSeparator?: string;
/**
* 模式(数字或者字符串)
*
......@@ -65,6 +57,14 @@ interface CheckboxListProps {
* @memberof CheckboxListProps
*/
codeListType?: string;
/**
* 代码表值分隔符
*
* @type {string}
* @memberof CheckboxListProps
*/
valueSeparator?: string;
/**
* 视图上下文
......@@ -111,7 +111,7 @@ interface CheckboxListProps {
*
* @type {boolean}
*/
readonly?: boolean;
readOnly?: boolean;
}
interface EditorEmit {
......@@ -120,7 +120,7 @@ interface EditorEmit {
const props = withDefaults(defineProps<CheckboxListProps>(), {
disabled: false,
readonly: false,
readOnly: false,
valueType: 'string',
valueSeparator: ',',
mode: 'string',
......@@ -217,7 +217,7 @@ onBeforeMount(() => {
@change="onChange"
:value="selectArray"
:options="items"
:disabled="disabled || readonly"
:disabled="disabled || readOnly"
></a-checkbox-group>
</div>
</template>
......
import { deepCopy, IParam, isExistAndNotEmpty } from "@core";
import { deepCopy, IParam, isExistAndNotEmpty, IActionParam } from "@core";
import { ListControlState } from "./list-control-state";
import { MDControl } from "../md-control";
......
......@@ -87,6 +87,24 @@ export const ctrlState = {
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {}
},
{{#if ctrl.quickToolBarItems}}
{{#ctrl.quickToolBarItems}}
quickToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.quickToolBarItems}}
{{/if}}
{{#if ctrl.batchToolBarItems}}
{{#ctrl.batchToolBarItems}}
batchToolbar: [
{{#items}}
{ id:'{{id}}',name:'{{name}}',caption:'{{caption}}',groupExtractMode:'{{groupExtractMode}}',itemType:'{{itemType}}',noPrivDisplayMode:'{{noPrivDisplayMode}}',showIcon:{{showIcon}},showCaption:{{showCaption}},tooltip:'{{tooltip}}',disabled: false, visible: true, imgPath: '{{imgPath}}',iconClass: '{{iconClass}}',xDataControlName:'{{xDataControlName}}',{{#if uIAction}}uIAction:{codeName:'{{uIAction.codeName}}',fullCodeName:'{{uIAction.fullCodeName}}',uIActionMode:'{{uIAction.uIActionMode}}',actionTarget:'{{uIAction.actionTarget}}',uIActionTag:'{{uIAction.uIActionTag}}',dataAccessAction:'{{uIAction.dataAccessAction}}',uIActionType:'{{uIAction.uIActionType}}'}{{/if}} },
{{/items}}
],
{{/ctrl.batchToolBarItems}}
{{/if}}
// 界面行为
uIActions: {
{{#each ctrl.psDEListItems as | listItem |}}
......
......@@ -39,7 +39,7 @@ interface CtrlEmit {
const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力
const { name, state, onUIAction, newRow, remove, save, load, refresh, getData, xDataCtrl, exportExcel, useCustom } = new ListControl(ctrlState, props, emit).moduleInstall();
const { name, state, onUIAction, newRow, remove, save, load, refresh, getData, xDataControl, exportExcel, useCustom, onToolbarEvent} = new ListControl(ctrlState, props, emit).moduleInstall();
const { onListItemSelected, isSelected, loadMore } = useCustom;
// 暴露内部状态及能力
......@@ -48,15 +48,46 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData, export
// TODO 后续添加加载遮罩效果
<template>
<a-list
ref="xDataCtrl"
ref="xDataControl"
class="app-list{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}"
item-layout="horizontal"
:data-source="state.items">
:data-source="state.items"
:locale="{
{{#if ctrl.emptyText}}
emptyText:'{{ctrl.emptyText}}'
{{else}}
emptyText:'暂无数据'
{{/if}}
}">
<template #loadMore>
<div class="load-more">
<a-button @click="loadMore" type="text">加载更多</a-button>
<a-button @click="loadMore" type="text">
加载更多
</a-button>
</div>
</template>
{{#if}}
<template #footer>
{{#if ctrl.quickToolBarItems}}
<AppToolbar
v-if="!state.items || state.items.length == 0"
mode="button"
class="app-list-quicktoolbar"
name="{{ctrl.quickToolBarName}}"
:actionModel="state.quickToolbar"
@onToolbarEvent="onToolbarEvent">
</AppToolbar>
<AppToolbar
v-if="state.selections && state.selections.length > 0"
mode="button"
class="app-list-batchtoolbar"
name="list_batchtoolbar"
:actionModel="state.batchToolbar"
@onToolbarevent="onToolbarEvent">
</AppToolbar>
{{/if}}
</template>
{{/if}}
<template #renderItem="{ item }">
{{#if (and ctrl.enableGroup ctrl.groupPSAppDEField)}}
<a-list-item class="app-list-group-item">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册