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

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

上级 3b328b69
...@@ -26,14 +26,6 @@ interface CheckboxListProps { ...@@ -26,14 +26,6 @@ interface CheckboxListProps {
*/ */
data: IParam; data: IParam;
/**
* 代码表值分隔符
*
* @type {string}
* @memberof CheckboxListProps
*/
valueSeparator?: string;
/** /**
* 模式(数字或者字符串) * 模式(数字或者字符串)
* *
...@@ -66,6 +58,14 @@ interface CheckboxListProps { ...@@ -66,6 +58,14 @@ interface CheckboxListProps {
*/ */
codeListType?: string; codeListType?: string;
/**
* 代码表值分隔符
*
* @type {string}
* @memberof CheckboxListProps
*/
valueSeparator?: string;
/** /**
* 视图上下文 * 视图上下文
* *
...@@ -111,7 +111,7 @@ interface CheckboxListProps { ...@@ -111,7 +111,7 @@ interface CheckboxListProps {
* *
* @type {boolean} * @type {boolean}
*/ */
readonly?: boolean; readOnly?: boolean;
} }
interface EditorEmit { interface EditorEmit {
...@@ -120,7 +120,7 @@ interface EditorEmit { ...@@ -120,7 +120,7 @@ interface EditorEmit {
const props = withDefaults(defineProps<CheckboxListProps>(), { const props = withDefaults(defineProps<CheckboxListProps>(), {
disabled: false, disabled: false,
readonly: false, readOnly: false,
valueType: 'string', valueType: 'string',
valueSeparator: ',', valueSeparator: ',',
mode: 'string', mode: 'string',
...@@ -217,7 +217,7 @@ onBeforeMount(() => { ...@@ -217,7 +217,7 @@ onBeforeMount(() => {
@change="onChange" @change="onChange"
:value="selectArray" :value="selectArray"
:options="items" :options="items"
:disabled="disabled || readonly" :disabled="disabled || readOnly"
></a-checkbox-group> ></a-checkbox-group>
</div> </div>
</template> </template>
......
import { deepCopy, IParam, isExistAndNotEmpty } from "@core"; import { deepCopy, IParam, isExistAndNotEmpty, IActionParam } from "@core";
import { ListControlState } from "./list-control-state"; import { ListControlState } from "./list-control-state";
import { MDControl } from "../md-control"; import { MDControl } from "../md-control";
......
...@@ -87,6 +87,24 @@ export const ctrlState = { ...@@ -87,6 +87,24 @@ export const ctrlState = {
pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}}, pageSize: {{#if ctrl.pagingSize}}{{ctrl.pagingSize}}{{else}}20{{/if}},
pagination: {} 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: { uIActions: {
{{#each ctrl.psDEListItems as | listItem |}} {{#each ctrl.psDEListItems as | listItem |}}
......
...@@ -39,7 +39,7 @@ interface CtrlEmit { ...@@ -39,7 +39,7 @@ interface CtrlEmit {
const emit = defineEmits<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; const { onListItemSelected, isSelected, loadMore } = useCustom;
// 暴露内部状态及能力 // 暴露内部状态及能力
...@@ -48,15 +48,46 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData, export ...@@ -48,15 +48,46 @@ defineExpose({ name, state, newRow, remove, save, load, refresh, getData, export
// TODO 后续添加加载遮罩效果 // TODO 后续添加加载遮罩效果
<template> <template>
<a-list <a-list
ref="xDataCtrl" ref="xDataControl"
class="app-list{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}" class="app-list{{#if ctrl.psSysCss}} {{ctrl.psSysCss.cssName}}{{/if}}"
item-layout="horizontal" item-layout="horizontal"
:data-source="state.items"> :data-source="state.items"
:locale="{
{{#if ctrl.emptyText}}
emptyText:'{{ctrl.emptyText}}'
{{else}}
emptyText:'暂无数据'
{{/if}}
}">
<template #loadMore> <template #loadMore>
<div class="load-more"> <div class="load-more">
<a-button @click="loadMore" type="text">加载更多</a-button> <a-button @click="loadMore" type="text">
加载更多
</a-button>
</div> </div>
</template> </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 }"> <template #renderItem="{ item }">
{{#if (and ctrl.enableGroup ctrl.groupPSAppDEField)}} {{#if (and ctrl.enableGroup ctrl.groupPSAppDEField)}}
<a-list-item class="app-list-group-item"> <a-list-item class="app-list-group-item">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册