Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
8f1ba4d6
提交
8f1ba4d6
编写于
12月 24, 2021
作者:
Shine-zwj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
上级
422ee752
变更
12
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
159 行增加
和
16 行删除
+159
-16
grid-column.hbs
...ain/resources/templ/r7/@macro/grid-detail/grid-column.hbs
+33
-0
include-grid.hbs
...in/resources/templ/r7/@macro/grid-detail/include-grid.hbs
+1
-0
IbizDefaultViewLayout.vue
..._{{apps}}/src/components/layout/IbizDefaultViewLayout.vue
+1
-1
IbizIconText.vue
...pl/r7/app_{{apps}}/src/components/render/IbizIconText.vue
+9
-9
grid-view-state.ts
.../src/ibiz-core/modules/views/grid-view/grid-view-state.ts
+13
-0
grid-control-state.ts
...z-core/modules/widgets/grid-control/grid-control-state.ts
+35
-0
grid-control.ts
...rc/ibiz-core/modules/widgets/grid-control/grid-control.ts
+14
-0
{{pages@DEEDITVIEW}}.vue.hbs
...age/{{appModules}}/{{pages}}/{{pages@DEEDITVIEW}}.vue.hbs
+1
-1
{{pages@DEGRIDVIEW}}-config.ts.hbs
...appModules}}/{{pages}}/{{pages@DEGRIDVIEW}}-config.ts.hbs
+2
-0
{{pages@DEGRIDVIEW}}.vue.hbs
...age/{{appModules}}/{{pages}}/{{pages@DEGRIDVIEW}}.vue.hbs
+5
-2
{{ctrls@FORM}}-form.vue.hbs
...ntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form.vue.hbs
+1
-1
{{ctrls@GRID}}-grid.vue.hbs
...ntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
+44
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/grid-detail/grid-column.hbs
0 → 100644
浏览文件 @
8f1ba4d6
<template
#
bodyCell=
"{ column, text, record }"
>
<div
class=
"table-cell"
>
{{#
eq
item
.
columnType
'DEFGRIDCOLUMN'
}}
{{/
eq
}}
{{#
eq
item
.
columnType
'UAGRIDCOLUMN'
}}
{{/
eq
}}
</div>
<template
v-if=
"column.dataIndex === 'name'"
>
<div
class=
"editable-cell"
>
<div
v-if=
"editableData[record.key]"
class=
"editable-cell-input-wrapper"
>
<a-input
v-model:value=
"editableData[record.key].name"
@
pressEnter=
"save(record.key)"
/>
<check-outlined
class=
"editable-cell-icon-check"
@
click=
"save(record.key)"
/>
</div>
<div
v-else
class=
"editable-cell-text-wrapper"
>
{{
text
||
' '
}}
<edit-outlined
class=
"editable-cell-icon"
@
click=
"edit(record.key)"
/>
</div>
</div>
</template>
<template
v-else-if=
"column.dataIndex === 'operation'"
>
<a-popconfirm
v-if=
"dataSource.length"
title=
"Sure to delete?"
@
confirm=
"onDelete(record.key)"
>
<a>
Delete
</a>
</a-popconfirm>
</template>
</template>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/grid-detail/include-grid.hbs
0 → 100644
浏览文件 @
8f1ba4d6
{{#
*
inline
"COLUMN"
}}{{>
@macro
/
grid-detail
/
grid-column
.
hbs
}}{{/
inline
}}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/layout/IbizDefaultViewLayout.vue
浏览文件 @
8f1ba4d6
...
@@ -22,7 +22,7 @@ const showHeader = computed(()=> props.showHeader && (props.viewCaption || slot
...
@@ -22,7 +22,7 @@ const showHeader = computed(()=> props.showHeader && (props.viewCaption || slot
<div
class=
"ibiz-view-layout__header-content"
>
<div
class=
"ibiz-view-layout__header-content"
>
<slot
name=
"header"
>
<slot
name=
"header"
>
<div
class=
"ibiz-view-layout__header-left"
>
<div
class=
"ibiz-view-layout__header-left"
>
<slot
name=
"header-left"
>
{{
$props
.
viewCaption
}}
</slot
>
<slot
name=
"header-left"
/
>
</div>
</div>
<div
class=
"ibiz-view-layout__header-right"
>
<div
class=
"ibiz-view-layout__header-right"
>
<slot
name=
"header-right"
/>
<slot
name=
"header-right"
/>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/render/IbizIconText.vue
浏览文件 @
8f1ba4d6
...
@@ -27,20 +27,20 @@ const extraClass = {
...
@@ -27,20 +27,20 @@ const extraClass = {
<div
<div
:class=
"[
:class=
"[
{
{
[`ibiz-icon-text--${
$props.
position}`]: hasIcon,
[`ibiz-icon-text--${position}`]: hasIcon,
},
},
`ibiz-icon-text--${
$props.
size}`,
`ibiz-icon-text--${size}`,
'ibiz-icon-text'
'ibiz-icon-text'
]"
]"
>
>
<template
v-if=
"
$props.
position == 'left'"
>
<template
v-if=
"position == 'left'"
>
<i
v-if=
"
$props.iconClass"
:class=
"'ibiz-icon-text__icon ' + $props.
iconClass"
/>
<i
v-if=
"
iconClass"
:class=
"'ibiz-icon-text__icon ' +
iconClass"
/>
<img
v-else-if=
"
$props.imgPath"
class=
"ibiz-icon-text__icon-img"
:src=
"$props.
imgPath"
/>
<img
v-else-if=
"
imgPath"
class=
"ibiz-icon-text__icon-img"
:src=
"
imgPath"
/>
</
template
>
</
template
>
<span
class=
"ibiz-icon-text__text"
v-if=
"
$props.text"
>
{{ $props.text
}}
</span>
<span
class=
"ibiz-icon-text__text"
v-if=
"
text"
>
\{{text
}}
</span>
<
template
v-if=
"
$props.
position == 'right'"
>
<
template
v-if=
"position == 'right'"
>
<i
v-if=
"
$props.iconClass"
:class=
"'ibiz-icon-text__icon ' + $props.
iconClass"
/>
<i
v-if=
"
iconClass"
:class=
"'ibiz-icon-text__icon ' +
iconClass"
/>
<img
v-else-if=
"
$props.imgPath"
class=
"ibiz-icon-text__icon-img"
:src=
"$props.
imgPath"
/>
<img
v-else-if=
"
imgPath"
class=
"ibiz-icon-text__icon-img"
:src=
"
imgPath"
/>
</
template
>
</
template
>
</div>
</div>
</template>
</template>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/views/grid-view/grid-view-state.ts
浏览文件 @
8f1ba4d6
...
@@ -8,4 +8,17 @@ import { MainViewState } from "@ibiz-core";
...
@@ -8,4 +8,17 @@ import { MainViewState } from "@ibiz-core";
*/
*/
export
interface
GridViewState
extends
MainViewState
{
export
interface
GridViewState
extends
MainViewState
{
/**
* @description 表格行激活模式
* @type {(0 | 1 | 2)} 不激活 | 单击激活 | 双击激活
* @memberof GridViewState
*/
gridRowActiveMode
:
0
|
1
|
2
;
/**
* @description 表格行编辑状态
* @type {boolean}
* @memberof GridViewState
*/
rowEditState
:
boolean
;
}
}
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/grid-control/grid-control-state.ts
浏览文件 @
8f1ba4d6
...
@@ -35,4 +35,39 @@ export interface GridControlState extends MainControlState {
...
@@ -35,4 +35,39 @@ export interface GridControlState extends MainControlState {
* @memberof GridControlState
* @memberof GridControlState
*/
*/
rules
:
IParam
;
rules
:
IParam
;
/**
* @description 是否多选
* @type {boolean}
* @memberof GridControlState
*/
multiple
:
boolean
;
/**
* @description 行编辑状态
* @type {boolean}
* @memberof GridControlState
*/
rowEditState
:
boolean
;
/**
* @description 行激活模式
* @type {(0 | 1 | 2)} 不激活 | 单击激活 | 双击激活
* @memberof GridControlState
*/
rowActiveMode
:
0
|
1
|
2
;
/**
* @description 选中数据
* @type {IParam[]}
* @memberof GridControlState
*/
selectedData
:
IParam
[];
/**
* @description 是否默认选中第一条数据
* @type {boolean}
* @memberof GridControlState
*/
selectFirstDefault
:
boolean
;
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/widgets/grid-control/grid-control.ts
浏览文件 @
8f1ba4d6
...
@@ -15,6 +15,20 @@ export class GridControl extends MainControl {
...
@@ -15,6 +15,20 @@ export class GridControl extends MainControl {
*/
*/
public
declare
controlState
:
GridControlState
;
public
declare
controlState
:
GridControlState
;
/**
* @description
* @param {GridControlProps} props
* @memberof GridControl
*/
public
setState
(
props
:
GridControlProps
)
{
super
.
setState
(
props
);
this
.
controlState
.
multiple
=
toRef
(
props
,
'multiple'
)
as
any
;
this
.
controlState
.
rowEditState
=
toRef
(
props
,
'rowEditState'
)
as
any
;
this
.
controlState
.
rowActiveMode
=
toRef
(
props
,
'rowActiveMode'
)
as
any
;
this
.
controlState
.
selectedData
=
toRef
(
props
,
'selectedData'
)
as
any
;
this
.
controlState
.
selectFirstDefault
=
toRef
(
props
,
'selectFirstDefault'
)
as
any
;
}
/**
/**
* @description 表格数据改变
* @description 表格数据改变
* @param {number} rowIndex 行索引
* @param {number} rowIndex 行索引
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages}}/{{pages@DEEDITVIEW}}.vue.hbs
浏览文件 @
8f1ba4d6
...
@@ -36,7 +36,7 @@ const { state } = new EditView(ViewConfig).moduleInstall(props);
...
@@ -36,7 +36,7 @@ const { state } = new EditView(ViewConfig).moduleInstall(props);
<template>
<template>
<IbizDefaultViewLayout
class=
"ibiz-edit-view"
>
<IbizDefaultViewLayout
class=
"ibiz-edit-view"
>
<template
v-slot:header-left
>
<template
v-slot:header-left
>
<IbizIconText
class=
"ibiz-view__caption"
size=
"large"
text=
"state.viewCaption"
/>
<IbizIconText
class=
"ibiz-view__caption"
size=
"large"
:
text=
"state.viewCaption"
/>
</template>
</template>
<template
v-slot:header-right
>
<template
v-slot:header-right
>
<span>
工具栏部件
</span>
<span>
工具栏部件
</span>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages}}/{{pages@DEGRIDVIEW}}-config.ts.hbs
浏览文件 @
8f1ba4d6
...
@@ -2,4 +2,6 @@ export const ViewConfig = {
...
@@ -2,4 +2,6 @@ export const ViewConfig = {
viewCodeName: '
{{
page
.
codeName
}}
',
viewCodeName: '
{{
page
.
codeName
}}
',
viewName: '
{{
page
.
name
}}
',
viewName: '
{{
page
.
name
}}
',
viewCaption: '
{{
page
.
caption
}}
',
viewCaption: '
{{
page
.
caption
}}
',
gridRowActiveMode:
{{
page
.
gridRowActiveMode
}}
,
rowEditState:
{{#if
page
.
enableRowEdit
}}{{
page
.
rowEditDefault
}}{{else}}
false
{{/if}}
,
};
};
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/page/{{appModules}}/{{pages}}/{{pages@DEGRIDVIEW}}.vue.hbs
浏览文件 @
8f1ba4d6
...
@@ -36,7 +36,7 @@ const { state } = new GridView(ViewConfig).moduleInstall(props);
...
@@ -36,7 +36,7 @@ const { state } = new GridView(ViewConfig).moduleInstall(props);
<template>
<template>
<IbizDefaultViewLayout
class=
"ibiz-grid-view"
>
<IbizDefaultViewLayout
class=
"ibiz-grid-view"
>
<template
v-slot:header-left
>
<template
v-slot:header-left
>
<IbizIconText
class=
"ibiz-view__caption"
size=
"large"
text=
"state.viewCaption"
/>
<IbizIconText
class=
"ibiz-view__caption"
size=
"large"
:
text=
"state.viewCaption"
/>
</template>
</template>
<template
v-slot:header-right
>
<template
v-slot:header-right
>
<span>
工具栏部件
</span>
<span>
工具栏部件
</span>
...
@@ -44,8 +44,11 @@ const { state } = new GridView(ViewConfig).moduleInstall(props);
...
@@ -44,8 +44,11 @@ const { state } = new GridView(ViewConfig).moduleInstall(props);
{{#
page
.
ctrls
}}
{{#
page
.
ctrls
}}
{{#
eq
controlType
"GRID"
}}
{{#
eq
controlType
"GRID"
}}
<
{{
codeName
}}
Grid
<
{{
codeName
}}
Grid
:showBusyIndicator=
"true"
:context=
"state.context"
:context=
"state.context"
:multiple=
"false"
:rowEditState=
"state.rowEditState"
:rowActiveMode=
"state.gridRowActiveMode"
:showBusyIndicator=
"true"
:viewParams=
"state.viewParams"
:viewParams=
"state.viewParams"
:controlAction=
"state.controlsAction"
:controlAction=
"state.controlsAction"
:viewSubject=
"state.viewSubject"
:viewSubject=
"state.viewSubject"
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@FORM}}-form/{{ctrls@FORM}}-form.vue.hbs
浏览文件 @
8f1ba4d6
...
@@ -52,6 +52,6 @@ const { state, handleEditorEvent } = new FormControl(CtrlConfig).moduleInstall(p
...
@@ -52,6 +52,6 @@ const { state, handleEditorEvent } = new FormControl(CtrlConfig).moduleInstall(p
</template>
</template>
<style
lang=
"scss"
>
<style
lang=
"scss"
>
.ibiz-form
{
.ibiz-form
{
margin
:
20px
;
margin
:
20px
!important
;
}
}
</style>
</style>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/widgets/{{appEntities}}/{{ctrls@GRID}}-grid/{{ctrls@GRID}}-grid.vue.hbs
浏览文件 @
8f1ba4d6
{{>
@macro
/
form-detail
/
include-form
.
hbs
}}
{{>
@macro
/
grid-detail
/
include-grid
.
hbs
}}
<script
setup
lang=
"ts"
>
<script
setup
lang=
"ts"
>
import
{
Subject
}
from
'rxjs'
;
import
{
Subject
}
from
'rxjs'
;
import
{
CtrlConfig
}
from
'./
{{
ctrl
.
codeName
.
spinalCase
}}
-grid-config'
;
import
{
CtrlConfig
}
from
'./
{{
ctrl
.
codeName
.
spinalCase
}}
-grid-config'
;
...
@@ -6,6 +6,11 @@ import { GridControl, IActionParam, IParam, ControlAction } from '@ibiz-core';
...
@@ -6,6 +6,11 @@ import { GridControl, IActionParam, IParam, ControlAction } from '@ibiz-core';
interface
Props
{
interface
Props
{
context
:
IParam
;
context
:
IParam
;
multiple
:
boolean
;
rowEditState
:
boolean
;
rowActiveMode
:
0
|
1
|
2
;
selectedData
:
IParam
[];
selectFirstDefault
:
boolean
;
viewParams
?:
IParam
;
viewParams
?:
IParam
;
controlAction
:
ControlAction
;
controlAction
:
ControlAction
;
showBusyIndicator
?:
boolean
;
showBusyIndicator
?:
boolean
;
...
@@ -15,6 +20,10 @@ interface Props {
...
@@ -15,6 +20,10 @@ interface Props {
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
const
props
=
withDefaults
(
defineProps
<
Props
>
(),
{
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
viewSubject
:
()
=>
new
Subject
<
IActionParam
>
(),
showBusyIndicator
:
true
,
showBusyIndicator
:
true
,
multiple
:
false
,
rowEditState
:
false
,
rowActiveMode
:
0
,
selectFirstDefault
:
false
,
})
})
// emit声明
// emit声明
...
@@ -27,9 +36,42 @@ const emit = defineEmits<CtrlEmit>();
...
@@ -27,9 +36,42 @@ const emit = defineEmits<CtrlEmit>();
// 安装功能模块,提供状态和能力方法
// 安装功能模块,提供状态和能力方法
const
{
state
,
handleEditorEvent
}
=
new
GridControl
(
CtrlConfig
).
moduleInstall
(
props
);
const
{
state
,
handleEditorEvent
}
=
new
GridControl
(
CtrlConfig
).
moduleInstall
(
props
);
// 表格选择功能配置
const
rowSelection
=
computed
(()
=>
{
return
{
onChange
:
(
selectedRowKeys
:
string
[],
selectedRows
:
IParam
[])
=>
{
console
.
log
(
`selectedRowKeys:
${
selectedRowKeys
}
`
,
'selectedRows: '
,
selectedRows
);
},
getCheckboxProps
:
(
record
:
IParam
)
=>
({
}),
};
});
</script>
</script>
<template>
<template>
<a-table
bordered
class=
"ibiz-grid"
:showHeader=
"
{{#if
ctrl
.
hideHeader
}}
false
{{else}}
true
{{/if}}
"
:data-source=
"state.items"
:row-selection=
"rowSelection"
:columns=
"state.columnsModel"
>
<template
#
emptyText
>
<div
class=
"not-data"
>
<span
class=
"empty-text"
>
{{#if
ctrl
.
emptyText
}}
{{
ctrl
.
emptyText
}}
{{else}}
无数据
{{/if}}
</span>
{{!-- 快速工具栏 --}}
</div>
</template>
{{!-- {{#each ctrl.pSDEGridColumns as | column |}}
{{>(lookup 'COLUMN') item=column}}
{{/each}} --}}
</a-table>
</template>
</template>
<style
lang=
"scss"
>
<style
lang=
"scss"
>
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录