Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
ef7c98ba
提交
ef7c98ba
编写于
3月 15, 2022
作者:
Mosher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update:更新
1、表格列类型获取逻辑调整 2、多数据视图快速分组加载逻辑调整 3、预置导出行为调整 4、标签组件格式化逻辑调整
上级
b24eb94b
变更
11
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
179 行增加
和
99 行删除
+179
-99
grid-column.hbs
...l/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
+7
-3
app-export-excel.vue
...7/app_{{apps}}/src/components/common/app-export-excel.vue
+2
-2
app-quick-group.vue
...r7/app_{{apps}}/src/components/common/app-quick-group.vue
+33
-10
app-span.vue
...templ/r7/app_{{apps}}/src/components/editors/app-span.vue
+24
-10
app-sys-action.ts
...p_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
+7
-3
md-view.ts
...r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
+24
-12
form-control.ts
...s}}/src/core/modules/widgets/form-control/form-control.ts
+1
-1
md-control.ts
...{apps}}/src/core/modules/widgets/md-control/md-control.ts
+7
-2
tree-exp-bar-control.ts
...ules/widgets/tree-exp-bar-control/tree-exp-bar-control.ts
+1
-1
data-types.ts
...ces/templ/r7/app_{{apps}}/src/core/utils/ui/data-types.ts
+65
-49
format.ts
...ces/templ/r7/app_{{apps}}/src/directives/format/format.ts
+8
-6
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/front-end/widgets/grid-detail/grid-column.hbs
浏览文件 @
ef7c98ba
...
...
@@ -23,9 +23,13 @@
<AppSpan
name=
"
{{#if
item
.
dataItemName
}}{{
lowerCase
item
.
dataItemName
}}{{else}}{{
item
.
codeName
}}{{/if}}
"
:value=
"text"
{{#if
item
.
psAppDEField
}}
:dataType=
"
{{
item
.
psAppDEField
.
stdDataType
}}
"
{{/if}}
{{#
each
ctrl
.
psDEGridDataItems
as
|
dataItem
|
}}
{{#
eq
dataItem
.
name
item
.
dataItemName
}}
{{#if
dataItem
.
dataType
}}
:dataType=
"
{{
dataItem
.
dataType
}}
"
{{/if}}
{{/
eq
}}
{{/
each
}}
valueFormat=
"
{{
item
.
valueFormat
}}
"
:precision=
"
{{#if
item
.
precision
}}{{
item
.
precision
}}{{else}}
0
{{/if}}
"
></AppSpan>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-export-excel.vue
浏览文件 @
ef7c98ba
...
...
@@ -8,7 +8,7 @@
<span>
<a-input-number
v-model:value=
"startPage"
@
change=
"onChange('start')"
:min=
"1"
@
click
.
stop
:controls=
"false"
/>
~
<a-input-number
v-model:value=
"endPage"
@
change=
"onChange('end')"
@
click
.
stop
:min=
"
1
"
:controls=
"false"
/>
<a-input-number
v-model:value=
"endPage"
@
change=
"onChange('end')"
@
click
.
stop
:min=
"
2
"
:controls=
"false"
/>
<a-button
type=
"text"
@
click=
"exportExcel('custom', $event)"
>
GO
</a-button>
</span>
</a-menu-item>
...
...
@@ -38,7 +38,7 @@ const props = withDefaults(defineProps<exportExcelProps>(), {});
// 初始化选择值
const
startPage
=
ref
(
1
);
const
endPage
=
ref
(
10
);
const
endPage
=
ref
(
2
);
/**
* 导出数据
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/common/app-quick-group.vue
浏览文件 @
ef7c98ba
...
...
@@ -21,7 +21,7 @@ const handleClick = ($event: any) => {
selectItem
.
value
=
$event
;
emit
(
'onQuickGroupEvent'
,
{
tag
:
'quickGroup'
,
action
:
"valueChange"
,
action
:
'valueChange'
,
data
:
$event
,
});
};
...
...
@@ -31,27 +31,50 @@ const codeListService = App.getCodeListService();
onBeforeMount
(()
=>
{
if
(
codeListService
)
{
codeListService
.
getCodeListItems
({
tag
:
props
.
quickGroupModel
.
codeListTag
,
context
:
props
.
context
,
viewParams
:
props
.
viewParams
}).
then
((
codeListItems
:
any
[])
=>
{
items
.
value
=
codeListItems
;
// 默认选中第一项
if
(
codeListItems
.
length
)
{
handleClick
(
items
.
value
[
0
]);
}
})
codeListService
.
getCodeListItems
({
tag
:
props
.
quickGroupModel
.
codeListTag
,
context
:
props
.
context
,
viewParams
:
props
.
viewParams
,
})
.
then
((
codeListItems
:
any
[])
=>
{
items
.
value
=
codeListItems
;
// 默认选中第一项
if
(
codeListItems
.
length
)
{
emit
(
'onQuickGroupEvent'
,
{
tag
:
'quickGroup'
,
action
:
'initSuccess'
,
data
:
items
.
value
[
0
],
});
}
})
.
catch
((
error
:
any
)
=>
{
emit
(
'onQuickGroupEvent'
,
{
tag
:
'quickGroup'
,
action
:
'initError'
,
data
:
null
,
});
});
}
});
</
script
>
<
template
>
<a-space
class=
"app-quick-group"
:size=
"0"
>
<a-button
class=
"quick-group-item"
v-for=
"(item, index) in items"
:key=
"index"
type=
"text"
@
click=
"handleClick(item)"
>
<a-button
class=
"quick-group-item"
v-for=
"(item, index) in items"
:key=
"index"
type=
"text"
@
click=
"handleClick(item)"
>
<span
:style=
"
{ color: item.color }">
<AppIconText
v-if=
"!item.children"
:text=
"item.text"
:iconClass=
"item.iconClass"
:imgPath=
"item.imgPath"
/>
<a-dropdown
v-else
>
<AppIconText
:text=
"item.text"
:iconClass=
"item.iconClass"
:imgPath=
"item.imgPath"
/>
<template
#
overlay
>
<a-menu>
<a-menu-item
v-for=
"(childItem,index) in item.children"
:key=
"index"
>
<a-menu-item
v-for=
"(childItem,
index) in item.children"
:key=
"index"
>
<AppIconText
:text=
"childItem.text"
:iconClass=
"childItem.iconClass"
:imgPath=
"childItem.imgPath"
/>
</a-menu-item>
</a-menu>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/app-span.vue
浏览文件 @
ef7c98ba
<
script
setup
lang=
"ts"
>
import
{
IParam
,
EditorBase
,
IContext
}
from
"@core"
;
import
{
IParam
,
EditorBase
,
IContext
,
DataTypes
,
isExistAndNotEmpty
}
from
"@core"
;
import
moment
from
"moment"
;
import
{
onBeforeMount
,
ref
,
Ref
}
from
"vue"
;
interface
SpanProps
{
/**
...
...
@@ -24,7 +25,7 @@ interface SpanProps {
* @type {string}
* @memberof AppSpan
*/
dataType
?:
string
;
dataType
?:
number
;
/**
* 单位名称
...
...
@@ -92,9 +93,14 @@ interface SpanProps {
const
props
=
withDefaults
(
defineProps
<
SpanProps
>
(),
{
unitName
:
""
,
precision
:
2
,
dataType
:
0
});
const
{
handleEditorNavParams
,
loadCodeListData
}
=
new
EditorBase
();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
// 数据类型
const
dataTypeValue
=
computed
(()
=>
{
return
DataTypes
.
toString
(
props
.
dataType
);
})
let
text
:
Ref
<
string
>
=
ref
(
""
);
let
textFormat
:
Ref
<
string
>
=
ref
(
""
);
// 初始化值
...
...
@@ -119,18 +125,24 @@ const initText = () => {
}
if
(
props
.
valueFormat
)
{
textFormat
.
value
=
props
.
valueFormat
;
}
else
if
(
Object
.
is
(
props
.
dataType
,
"DATETIME"
)
||
Object
.
is
(
props
.
dataType
,
"DATE"
)
||
Object
.
is
(
props
.
dataType
,
"TIME"
)
||
Object
.
is
(
props
.
dataType
,
"SMALLDATETIME"
)
)
{
}
else
if
(
DataTypes
.
isDate
(
dataTypeValue
.
value
))
{
textFormat
.
value
=
"YYYY-MM-DD HH:mm:ss"
;
}
else
if
(
Object
.
is
(
props
.
dataType
,
"NUMBER"
))
{
}
else
if
(
DataTypes
.
isNumber
(
dataTypeValue
.
value
))
{
textFormat
.
value
=
`#
${
props
.
unitName
}
`
;
}
}
const
getFormatDate
=
()
=>
{
if
(
!
isExistAndNotEmpty
(
props
.
value
))
{
return
''
;
}
const
value
=
moment
(
props
.
value
).
format
(
textFormat
.
value
);
if
(
value
!==
'Invalid date'
)
{
return
value
;
}
return
props
.
value
;
}
onBeforeMount
(()
=>
{
// 监听值变化
watch
(()
=>
props
.
value
,
(
newVal
:
any
,
oldVal
:
any
)
=>
{
if
(
newVal
!==
oldVal
)
initText
();
});
...
...
@@ -140,7 +152,9 @@ onBeforeMount(() => {
<
template
>
<div
:class=
"['app-editor-container', 'app-span', `app-span-$
{name}`]">
<span
v-format=
"textFormat"
>
{{
text
}}
</span>
<span
v-if=
"DataTypes.isDate(dataTypeValue)"
>
{{
getFormatDate
()
}}
</span>
<span
v-else-if=
"textFormat"
v-format=
"textFormat"
>
{{
text
}}
</span>
<span
v-else
>
{{
text
}}
</span>
</div>
</
template
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/logic/app-ui-action/app-sys-action.ts
浏览文件 @
ef7c98ba
...
...
@@ -408,12 +408,16 @@ export class AppSysAction {
* @return {*}
*/
public
static
async
exportExcel
(
params
:
IUIActionParams
)
{
const
{
actionEnvironment
}
=
params
;
const
{
actionEnvironment
,
event
}
=
params
;
const
exportParams
:
IParam
=
{};
if
(
event
&&
(
event
as
any
).
exportParams
)
{
Object
.
assign
(
exportParams
,
(
event
as
any
).
exportParams
);
}
// 视图里获取多数据部件
if
(
actionEnvironment
.
xDataControl
&&
hasFunction
(
actionEnvironment
.
xDataControl
,
"exportExcel"
))
{
await
actionEnvironment
.
xDataControl
.
exportExcel
();
await
actionEnvironment
.
xDataControl
.
exportExcel
(
exportParams
);
}
else
if
(
isExist
(
actionEnvironment
.
exportExcel
))
{
await
actionEnvironment
.
exportExcel
();
await
actionEnvironment
.
exportExcel
(
exportParams
);
}
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/views/md-view/md-view.ts
浏览文件 @
ef7c98ba
...
...
@@ -76,7 +76,11 @@ export class MDView extends MainView {
// 初始化搜索栏引用
this
.
searchBar
=
ref
(
null
);
onMounted
(()
=>
{
this
.
xDataControlLoad
();
const
{
enableQuickGroup
,
quickGroupPSCodeList
}
=
this
.
state
;
// 开启快速分组时,挂载完成不主动加载数据
if
(
!
enableQuickGroup
||
!
quickGroupPSCodeList
)
{
this
.
xDataControlLoad
();
}
});
}
...
...
@@ -131,9 +135,11 @@ export class MDView extends MainView {
* @memberof MDView
*/
public
handleQuickGroupSearch
(
args
:
any
=
{}):
void
{
this
.
state
.
quickGroupData
=
JSON
.
parse
(
args
.
data
);
const
tag
=
this
.
getMDCtrl
().
name
;
this
.
next
({
tag
:
tag
,
action
:
'load'
,
data
:
null
});
if
(
args
.
data
)
{
this
.
state
.
quickGroupData
=
JSON
.
parse
(
args
.
data
);
const
tag
=
this
.
getMDCtrl
().
name
;
this
.
next
({
tag
:
tag
,
action
:
'load'
,
data
:
null
});
}
}
/**
...
...
@@ -211,10 +217,6 @@ export class MDView extends MainView {
if
(
searchBar
)
{
Object
.
assign
(
args
,
searchBar
.
getData
());
}
// 快速搜索
// if (this.view && !this.view.isExpandSearchForm) {
// Object.assign(args, { query: this.view.query });
// }
// 快速分组
const
{
quickGroupData
}
=
this
.
state
;
if
(
quickGroupData
&&
Object
.
keys
(
quickGroupData
).
length
)
{
...
...
@@ -286,12 +288,22 @@ export class MDView extends MainView {
/**
* @description 处理快速分组事件
* @param {IActionParam}
$event
* @param {IActionParam}
actionParam
* @memberof MDView
*/
public
onQuickGroupEvent
(
$event
:
IActionParam
)
{
if
(
$event
)
{
this
.
handleQuickGroupSearch
(
$event
.
data
);
public
onQuickGroupEvent
(
actionParam
:
IActionParam
)
{
const
{
action
,
data
}
=
actionParam
;
switch
(
action
)
{
case
'valueChange'
:
// 值变化
this
.
handleQuickGroupSearch
(
data
);
return
;
case
'initSuccess'
:
// 初始化完成
if
(
data
.
data
)
{
this
.
state
.
quickGroupData
=
JSON
.
parse
(
data
.
data
);
}
case
'initError'
:
// 初始化失败
this
.
xDataControlLoad
();
break
;
}
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/form-control/form-control.ts
浏览文件 @
ef7c98ba
...
...
@@ -892,7 +892,7 @@ export class FormControl extends MainControl {
* @memberof FormControl
*/
private
async
formValidateStatus
():
Promise
<
boolean
>
{
const
form
=
this
.
getXDataCtrl
()?.
value
;
const
form
=
this
.
xDataControl
;
let
result
:
boolean
=
true
;
if
(
form
&&
hasFunction
(
form
,
'validate'
))
{
try
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/md-control/md-control.ts
浏览文件 @
ef7c98ba
...
...
@@ -507,13 +507,18 @@ export class MDControl extends MainControl {
// 最大行
if
(
Object
.
is
(
opt
.
type
,
'maxRowCount'
))
{
Object
.
assign
(
tempViewParams
,
{
page
:
0
,
size
:
opt
.
maxRowCount
?
opt
.
maxRowCount
:
1000
});
// } else if (Object.is(opt.type, 'activatedPage')) {
}
else
{
}
else
if
(
Object
.
is
(
opt
.
type
,
'activatedPage'
))
{
// 当前激活页
const
{
current
,
pageSize
}
=
mdCtrlPaging
;
Object
.
assign
(
tempViewParams
,
{
page
:
current
-
1
,
size
:
pageSize
});
this
.
doExport
(
items
);
return
;
}
else
if
(
Object
.
is
(
opt
.
type
,
'custom'
))
{
const
{
pageSize
}
=
this
.
state
;
const
{
startPage
,
endPage
}
=
opt
;
if
(
startPage
&&
endPage
)
{
Object
.
assign
(
tempViewParams
,
{
page
:
0
,
offset
:
(
startPage
-
1
)
*
pageSize
,
size
:
(
endPage
-
startPage
+
1
)
*
pageSize
});
}
}
// 远程获取
const
{
noSort
,
minorSortDir
,
minorSortPSDEF
}
=
mdCtrlSort
;
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/modules/widgets/tree-exp-bar-control/tree-exp-bar-control.ts
浏览文件 @
ef7c98ba
...
...
@@ -43,7 +43,7 @@ export class TreeExpBarControl extends ExpBarControl {
protected
useSearch
()
{
const
search
=
(
value
:
any
,
event
:
MouseEvent
)
=>
{
const
{
viewSubject
}
=
this
.
state
;
const
xData
=
this
.
getXDataCtrl
()
;
const
xData
=
this
.
xDataControl
;
if
(
xData
)
{
viewSubject
.
next
({
tag
:
xData
.
name
,
action
:
'search'
,
data
:
{
query
:
value
}
});
}
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/core/utils/ui/data-types.ts
浏览文件 @
ef7c98ba
...
...
@@ -3,38 +3,38 @@
* 数据类型
*
*/
export
class
DataTypes
{
export
class
DataTypes
{
static
readonly
DataTypes
:
any
=
{
UNKNOWN
:
0
,
//
BIGINT
:
1
,
BINARY
:
2
,
BIT
:
3
,
CHAR
:
4
,
DATETIME
:
5
,
DECIMAL
:
6
,
FLOAT
:
7
,
IMAGE
:
8
,
INT
:
9
,
MONEY
:
10
,
NCHAR
:
11
,
NTEXT
:
12
,
NVARCHAR
:
13
,
NUMERIC
:
14
,
REAL
:
15
,
SMALLDATETIME
:
16
,
SMALLINT
:
17
,
SMALLMONEY
:
18
,
SQL_VARIANT
:
19
,
SYSNAME
:
20
,
TEXT
:
21
,
TIMESTAMP
:
22
,
TINYINT
:
23
,
VARBINARY
:
24
,
VARCHAR
:
25
,
UNIQUEIDENTIFIER
:
26
,
DATE
:
27
,
// 纯日期型
TIME
:
28
,
// 纯时间
BIGDECIMAL
:
29
,
// 大数值
UNKNOWN
:
0
,
//
BIGINT
:
1
,
BINARY
:
2
,
BIT
:
3
,
CHAR
:
4
,
DATETIME
:
5
,
DECIMAL
:
6
,
FLOAT
:
7
,
IMAGE
:
8
,
INT
:
9
,
MONEY
:
10
,
NCHAR
:
11
,
NTEXT
:
12
,
NVARCHAR
:
13
,
NUMERIC
:
14
,
REAL
:
15
,
SMALLDATETIME
:
16
,
SMALLINT
:
17
,
SMALLMONEY
:
18
,
SQL_VARIANT
:
19
,
SYSNAME
:
20
,
TEXT
:
21
,
TIMESTAMP
:
22
,
TINYINT
:
23
,
VARBINARY
:
24
,
VARCHAR
:
25
,
UNIQUEIDENTIFIER
:
26
,
DATE
:
27
,
// 纯日期型
TIME
:
28
,
// 纯时间
BIGDECIMAL
:
29
,
// 大数值
}
/**
...
...
@@ -46,11 +46,11 @@ export class DataTypes {
* @return {*}
* @memberof DataTypes
*/
protected
static
equalsIgnoreCase
(
value
:
string
,
value2
:
string
)
{
return
value
.
toLocaleLowerCase
()
==
value2
.
toLocaleLowerCase
();
protected
static
equalsIgnoreCase
(
value
:
string
,
value2
:
string
)
{
return
value
.
toLocaleLowerCase
()
==
value2
.
toLocaleLowerCase
();
}
/**
/**
* @description 字符串转数值
* @static
* @param {string} strValue
...
...
@@ -58,11 +58,11 @@ export class DataTypes {
* @memberof DataTypes
*/
public
static
fromString
(
strValue
:
string
):
number
{
let
result
=
this
.
DataTypes
[
strValue
.
toUpperCase
()];
return
result
||
this
.
DataTypes
.
VARCHAR
;
}
let
result
=
this
.
DataTypes
[
strValue
.
toUpperCase
()];
return
result
||
this
.
DataTypes
.
VARCHAR
;
}
/**
/**
* @description 是否为number类型
* @static
* @param {string} strValue
...
...
@@ -70,15 +70,31 @@ export class DataTypes {
* @memberof DataTypes
*/
public
static
isNumber
(
strValue
:
string
):
boolean
{
const
numberTypes
:
any
[]
=
[
'BIGINT'
,
'BINARY'
,
'DECIMAL'
,
'FLOAT'
,
'INT'
,
'MONEY'
,
'NUMERIC'
,
'REAL'
,
'SMALLINT'
,
'SMALLMONEY'
,
'TINYINT'
,
'VARBINARY'
];
if
(
numberTypes
.
indexOf
(
strValue
)
!==
-
1
)
{
return
true
;
}
else
{
return
false
const
numberTypes
:
any
[]
=
[
'BIGINT'
,
'BINARY'
,
'DECIMAL'
,
'FLOAT'
,
'INT'
,
'MONEY'
,
'NUMERIC'
,
'REAL'
,
'SMALLINT'
,
'SMALLMONEY'
,
'TINYINT'
,
'VARBINARY'
];
if
(
numberTypes
.
indexOf
(
strValue
)
!==
-
1
)
{
return
true
;
}
else
{
return
false
}
}
}
/**
/**
* @description 是否是日期类型
* @static
* @param {string} strValue
* @return {*} {boolean}
* @memberof DataTypes
*/
public
static
isDate
(
strValue
:
string
):
boolean
{
const
numberTypes
:
any
[]
=
[
'DATETIME'
,
'DATE'
,
'TIME'
,
'SMALLDATETIME'
];
if
(
numberTypes
.
indexOf
(
strValue
)
!==
-
1
)
{
return
true
;
}
else
{
return
false
}
}
/**
* @description 获取字符串名称
* @static
* @param {number} nDataType
...
...
@@ -87,13 +103,13 @@ export class DataTypes {
*/
public
static
toString
(
nDataType
:
number
)
{
let
result
=
'VARCHAR'
;
for
(
let
key
in
this
.
DataTypes
)
{
if
(
nDataType
==
this
.
DataTypes
[
key
])
{
for
(
let
key
in
this
.
DataTypes
)
{
if
(
nDataType
==
this
.
DataTypes
[
key
])
{
result
=
key
;
break
;
}
}
return
result
;
}
return
result
;
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/directives/format/format.ts
浏览文件 @
ef7c98ba
...
...
@@ -410,12 +410,14 @@ export class FormatController {
}
else
if
(
temp
===
'?'
)
{
returnHtml
+=
' '
;
}
if
(
isQianfenwei
&&
(
codeZhengshuNumCount
-
finishedNumCount
)
%
3
===
1
&&
codeZhengshuNumCount
-
finishedNumCount
!==
1
)
{
returnHtml
+=
','
;
if
(
temp
===
'0'
)
{
if
(
isQianfenwei
&&
(
codeZhengshuNumCount
-
finishedNumCount
)
%
3
===
1
&&
codeZhengshuNumCount
-
finishedNumCount
!==
1
)
{
returnHtml
+=
','
;
}
}
newFormatRule
=
newFormatRule
.
slice
(
1
);
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录