Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
a03c228b
提交
a03c228b
编写于
12月 28, 2021
作者:
RedPig97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 更新
上级
293fd75e
变更
6
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
178 行增加
和
77 行删除
+178
-77
auto-complete.hbs
...c/main/resources/templ/r7/@macro/editor/auto-complete.hbs
+6
-0
data-picker.hbs
...src/main/resources/templ/r7/@macro/editor/data-picker.hbs
+32
-3
IbizAutoComplete.vue
.../app_{{apps}}/src/components/editors/IbizAutoComplete.vue
+11
-2
IbizDataPicker.vue
...r7/app_{{apps}}/src/components/editors/IbizDataPicker.vue
+109
-62
IbizUpload.vue
...mpl/r7/app_{{apps}}/src/components/editors/IbizUpload.vue
+19
-8
ibizToolbar.vue
...mpl/r7/app_{{apps}}/src/components/render/ibizToolbar.vue
+1
-2
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/auto-complete.hbs
浏览文件 @
a03c228b
...
@@ -33,4 +33,10 @@
...
@@ -33,4 +33,10 @@
{{#if
item
.
psEditor
.
editorParams
.
multiple
}}
{{#if
item
.
psEditor
.
editorParams
.
multiple
}}
:multiple=
"
{{
item
.
psEditor
.
editorParams
.
multiple
}}
"
:multiple=
"
{{
item
.
psEditor
.
editorParams
.
multiple
}}
"
{{/if}}
{{/if}}
{{#
eq
item
.
psEditor
.
editorType
"AC_NOBUTTON"
}}
:showButton=
"false"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"AC_FS_NOBUTTON"
}}
:showButton=
"false"
{{/
eq
}}
@
editorEvent=
"handleEditorEvent"
/>
@
editorEvent=
"handleEditorEvent"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/data-picker.hbs
浏览文件 @
a03c228b
...
@@ -20,8 +20,12 @@
...
@@ -20,8 +20,12 @@
:contextProp=
"state.context"
:contextProp=
"state.context"
:viewParamsProp=
"state.viewParams"
:viewParamsProp=
"state.viewParams"
{{#if
item
.
psEditor
.
psAppDataEntity
}}
{{#if
item
.
psEditor
.
psAppDataEntity
}}
deMajorField=
"
{{
item
.
psEditor
.
psAppDataEntity
.
majorPSAppDEField
.
codename
}}
"
{{!-- {{#each item.psEditor.psAppDataEntity as | filed |}} --}}
deKeyField=
"
{{
item
.
psEditor
.
psAppDataEntity
.
codeName
}}
"
{{!-- {{#if filed.majorField}} --}}
{{!-- deMajorField="{{lowerCase filed.majorField.codeName}}" --}}
{{!-- {{/if}} --}}
{{!-- {{/each}} --}}
{{!-- deKeyField="{{item.psEditor.psAppDataEntity.codeName}}" --}}
{{/if}}
{{/if}}
{{!-- :pickupView="getPickupView({{item.psEditor}})" --}}
{{!-- :pickupView="getPickupView({{item.psEditor}})" --}}
{{!-- :linkView="getLinkView({{item.psEditor}})" --}}
{{!-- :linkView="getLinkView({{item.psEditor}})" --}}
...
@@ -32,4 +36,29 @@
...
@@ -32,4 +36,29 @@
{{#if
item
.
psEditor
.
pickUpData
}}
{{#if
item
.
psEditor
.
pickUpData
}}
pickUpData=
"
{{
item
.
psEditor
.
pickUpData
}}
"
pickUpData=
"
{{
item
.
psEditor
.
pickUpData
}}
"
{{/if}}
{{/if}}
{{#
eq
item
.
psEditor
.
editorType
"PICKEREX_LINKONLY"
}}
:linkOnly=
"true"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"PICKEREX_LINK"
}}
:linkOnly=
"true"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"PICKEREX_NOAC"
}}
:noAC=
"true"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"PICKEREX_NOAC_LINK"
}}
:noAC=
"true"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"PICKEREX_TRIGGER"
}}
:isDropdown=
"true"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"PICKEREX_TRIGGER_LINK"
}}
:isDropdown=
"true"
{{/
eq
}}
{{!-- {{#if (or (eq item.psEditor.editorType "PICKEREX_LINKONLY") (eq item.psEditor.editorType "PICKEREX_LINK"))}} --}}
{{!-- :linkOnly="true" --}}
{{!-- {{else (or (eq item.psEditor.editorType "PICKEREX_NOAC") (eq item.psEditor.editorType "PICKEREX_NOAC_LINK"))}} --}}
{{!-- :noAC="true" --}}
{{!-- {{else (or (eq item.psEditor.editorType "PICKEREX_TRIGGER") (eq item.psEditor.editorType "PICKEREX_TRIGGER_LINK"))}} --}}
{{!-- :isDropdown="true" --}}
{{!-- {{/if}} --}}
@
editorEvent=
"handleEditorEvent"
/>
@
editorEvent=
"handleEditorEvent"
/>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizAutoComplete.vue
浏览文件 @
a03c228b
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
onBeforeMount
,
Ref
,
ref
}
from
"vue"
;
import
{
onBeforeMount
,
Ref
,
ref
}
from
"vue"
;
import
{
SearchOutlined
}
from
'@ant-design/icons-vue'
;
import
{
deepCopy
,
IParam
,
IActionParam
,
EditorBase
}
from
"@ibiz-core"
;
import
{
deepCopy
,
IParam
,
IActionParam
,
EditorBase
}
from
"@ibiz-core"
;
interface
AutoCompleteProps
{
interface
AutoCompleteProps
{
/**
/**
...
@@ -71,6 +72,11 @@ interface AutoCompleteProps {
...
@@ -71,6 +72,11 @@ interface AutoCompleteProps {
*/
*/
defaultOpen
:
boolean
;
defaultOpen
:
boolean
;
/**
* @description 是否显示按钮
*/
showButton
:
boolean
;
/**
/**
* @description 禁用
* @description 禁用
*/
*/
...
@@ -158,9 +164,12 @@ const onSelect = (value: any) => {
...
@@ -158,9 +164,12 @@ const onSelect = (value: any) => {
@search="onSearch"
@search="onSearch"
:defaultOpen="true"
:defaultOpen="true"
>
>
<template
#
option=
"
{ srfmajortext: caption,srfkey: value }
">
<template
#
option=
"
option
"
>
<div
@
click=
"onSelect(
value)"
>
\
{{
caption
}}
</div>
<div
@
click=
"onSelect(
option[deKeyField])"
>
\
{{
option
[
deMajorField
]
}}
</div>
</
template
>
</
template
>
<a-input
:placeholder=
"placeholder"
>
<
template
#
suffix
><search-outlined
v-if=
"showButton"
class=
"certain-category-icon"
/></
template
>
</a-input>
</a-auto-complete>
</a-auto-complete>
</template>
</template>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizDataPicker.vue
浏览文件 @
a03c228b
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
onBeforeMount
,
Ref
,
ref
}
from
"vue"
;
import
{
onBeforeMount
,
Ref
,
ref
}
from
'vue'
;
import
{
deepCopy
,
IParam
,
IActionParam
,
EditorBase
}
from
"@ibiz-core"
;
import
{
SearchOutlined
,
ExportOutlined
}
from
'@ant-design/icons-vue'
;
import
{
deepCopy
,
IParam
,
IActionParam
,
EditorBase
}
from
'@ibiz-core'
;
interface
DataPickerProps
{
interface
DataPickerProps
{
/**
/**
* @description 编辑器名称
* @description 编辑器名称
...
@@ -86,13 +87,22 @@ interface DataPickerProps {
...
@@ -86,13 +87,22 @@ interface DataPickerProps {
* @description 外键值附加数据
* @description 外键值附加数据
*/
*/
pickUpData
?:
string
;
pickUpData
?:
string
;
linkOnly
:
boolean
;
isAC
:
boolean
;
isDropdown
:
boolean
;
}
}
interface
EditorEmit
{
interface
EditorEmit
{
(
name
:
'editorEvent'
,
value
:
IActionParam
):
void
(
name
:
'editorEvent'
,
value
:
IActionParam
):
void
;
}
}
const
props
=
withDefaults
(
defineProps
<
DataPickerProps
>
(),
{
const
props
=
withDefaults
(
defineProps
<
DataPickerProps
>
(),
{
deMajorField
:
'srfmajortext'
,
deMajorField
:
'srfmajortext'
,
deKeyField
:
'srfkey'
,
deKeyField
:
'srfkey'
,
linkOnly
:
false
,
isAC
:
false
,
isDropdown
:
false
,
});
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
emit
=
defineEmits
<
EditorEmit
>
();
const
{
handleEditorNavParams
,
openLinkView
,
openPickUpView
}
=
new
EditorBase
();
const
{
handleEditorNavParams
,
openLinkView
,
openPickUpView
}
=
new
EditorBase
();
...
@@ -106,48 +116,37 @@ const initItems = () => {
...
@@ -106,48 +116,37 @@ const initItems = () => {
if
(
props
.
valueItem
&&
props
.
data
)
{
if
(
props
.
valueItem
&&
props
.
data
)
{
items
.
value
.
push
({
items
.
value
.
push
({
[
props
.
deMajorField
]:
props
.
value
,
[
props
.
deMajorField
]:
props
.
value
,
[
props
.
deKeyField
]:
props
.
data
[
props
.
valueItem
]
[
props
.
deKeyField
]:
props
.
data
[
props
.
valueItem
]
,
})
})
;
}
}
}
}
;
/**
/**
* @description 填充外键值附加数据
* @description 填充外键值附加数据
* @param item 选中数据
* @param item 选中数据
*/
*/
const
fillPickUpData
=
(
item
:
IParam
)
=>
{
const
fillPickUpData
=
(
item
:
IParam
)
=>
{
if
(
props
.
pickUpData
){
if
(
props
.
pickUpData
)
{
let
pickUpDataArray
:
string
[]
=
props
.
pickUpData
.
split
(
";"
)
let
pickUpDataArray
:
string
[]
=
props
.
pickUpData
.
split
(
';'
);
if
(
pickUpDataArray
&&
pickUpDataArray
.
length
>
0
){
if
(
pickUpDataArray
&&
pickUpDataArray
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
pickUpDataArray
.
length
;
i
++
){
for
(
let
i
=
0
;
i
<
pickUpDataArray
.
length
;
i
++
)
{
if
(
item
){
if
(
item
)
{
emit
(
"editorEvent"
,
{
emit
(
'editorEvent'
,
{
tag
:
pickUpDataArray
[
i
],
action
:
"valueChange"
,
data
:
item
[
pickUpDataArray
[
i
]]
tag
:
pickUpDataArray
[
i
],
action
:
'valueChange'
,
data
:
item
[
pickUpDataArray
[
i
]],
});
});
}
else
{
}
else
{
emit
(
"editorEvent"
,
{
emit
(
'editorEvent'
,
{
tag
:
pickUpDataArray
[
i
],
action
:
"valueChange"
,
data
:
null
tag
:
pickUpDataArray
[
i
],
action
:
'valueChange'
,
data
:
null
,
});
});
}
}
}
}
}
}
}
}
}
};
/**
* @description 选中项改变
* @param select 选中项值
* @param option 选中项数据
*/
const
onChange
=
(
select
:
any
,
option
:
any
)
=>
{
const
selectItem
=
items
.
value
.
find
(
(
item
:
IParam
)
=>
Object
.
is
(
item
[
props
.
deKeyField
],
select
)
);
emit
(
'editorEvent'
,
{
tag
:
props
.
name
,
action
:
"valueChange"
,
data
:
selectItem
[
props
.
deMajorField
]});
emit
(
'editorEvent'
,
{
tag
:
props
.
valueItem
,
action
:
"valueChange"
,
data
:
selectItem
[
props
.
deKeyField
]});
fillPickUpData
(
selectItem
);
}
/**
/**
* @description 搜索
* @description 搜索
...
@@ -155,13 +154,14 @@ const onChange = (select: any, option:any) => {
...
@@ -155,13 +154,14 @@ const onChange = (select: any, option:any) => {
*/
*/
const
onSearch
=
(
value
:
string
)
=>
{
const
onSearch
=
(
value
:
string
)
=>
{
let
_navContext
=
deepCopy
(
navContext
);
let
_navContext
=
deepCopy
(
navContext
);
let
_navViewParam
=
deepCopy
(
navViewParam
);
let
_navViewParam
=
deepCopy
(
navViewParam
);
Object
.
assign
(
_navViewParam
,
{
query
:
value
,
size
:
1000
});
Object
.
assign
(
_navViewParam
,
{
query
:
value
,
size
:
1000
});
if
(
props
.
sort
)
{
if
(
props
.
sort
)
{
Object
.
assign
(
_navViewParam
,
{
sort
:
props
.
sort
});
Object
.
assign
(
_navViewParam
,
{
sort
:
props
.
sort
});
}
}
// TODO数据服务请求数据
// TODO数据服务请求数据
items
.
value
=
[
{
items
.
value
=
[
{
srfkey
:
'4646'
,
srfkey
:
'4646'
,
srfmajortext
:
'Jack'
,
srfmajortext
:
'Jack'
,
},
},
...
@@ -176,18 +176,65 @@ const onSearch = (value: string) => {
...
@@ -176,18 +176,65 @@ const onSearch = (value: string) => {
{
{
srfkey
:
'4646'
,
srfkey
:
'4646'
,
srfmajortext
:
'Yiminghe'
,
srfmajortext
:
'Yiminghe'
,
}];
},
}
];
};
const
filterOption
=
(
inputValue
:
string
,
option
:
IParam
)
=>
{
return
option
[
props
.
deMajorField
].
toUpperCase
().
indexOf
(
inputValue
.
toUpperCase
())
>=
0
;
};
onBeforeMount
(()
=>
{
const
onSelect
=
(
value
:
any
)
=>
{
initItems
();
const
selectItem
=
items
.
value
.
find
((
item
:
IParam
)
=>
Object
.
is
(
item
[
props
.
deKeyField
],
value
));
})
emit
(
'editorEvent'
,
{
tag
:
props
.
name
,
action
:
'valueChange'
,
data
:
selectItem
[
props
.
deMajorField
],
});
emit
(
'editorEvent'
,
{
tag
:
props
.
valueItem
,
action
:
'valueChange'
,
data
:
selectItem
[
props
.
deKeyField
]
});
fillPickUpData
(
selectItem
);
};
</
script
>
</
script
>
<
template
>
<
template
>
<template
v-if=
"linkOnly"
:class=
"['app-data-picker', `app-data-picker-$
{name}`]">
<a
@
click=
"openLinkView"
>
\
{{
value
}}
</a>
</
template
>
<
template
v-else-if=
"!noAc && !isDropdown"
>
<a-auto-complete
:class=
"['app-data-picker', `app-data-picker-$
{name}`]"
:allowClear="true"
v-model:value="value"
:placeholder="placeholder"
:options="items"
:filterOption="filterOption"
:disabled="disabled || readonly"
@search="onSearch"
:defaultOpen="true"
>
<template
#
option=
"option"
>
<div
@
click=
"onSelect(option[deKeyField])"
>
\
{{
option
[
deMajorField
]
}}
</div>
</
template
>
<a-input
:placeholder=
"placeholder"
>
<
template
#
suffix
>
<search-outlined
v-if=
"pickUpView && showButton"
class=
"certain-category-icon"
@
click=
"openView"
/>
<export-outlined
v-if=
"linkView"
@
click=
"openLinkView"
/>
</
template
>
</a-input>
</a-auto-complete>
</template>
<
template
v-else-if=
"noAc"
>
<a-input
:class=
"['app-data-picker', `app-data-picker-$
{name}`]" :placeholder="placeholder">
<template
#
suffix
>
<search-outlined
v-if=
"pickUpView && showButton"
class=
"certain-category-icon"
@
click=
"openView"
/>
<export-outlined
v-if=
"linkView"
@
click=
"openLinkView"
/>
</
template
>
</a-input>
</template>
<
template
v-else-if=
"isDropdown"
>
<a-select
<a-select
:class=
"['app-editor-contain
er', `app-data-picker-$
{name}`]"
:class=
"['app-data-pick
er', `app-data-picker-$
{name}`]"
allowClear
allowClear
showSearch
showSearch
v-model:value="value"
v-model:value="value"
...
@@ -195,17 +242,17 @@ onBeforeMount(() => {
...
@@ -195,17 +242,17 @@ onBeforeMount(() => {
:filterOption="false"
:filterOption="false"
@change="onChange"
@change="onChange"
@search="onSearch"
@search="onSearch"
:placeholder="placeholder">
:placeholder="placeholder"
>
<template
#
suffixIcon
>
<template
#
suffixIcon
>
<search-outlined
v-if=
"pickUpView"
@
click=
"openPickUpView"
/>
<search-outlined
v-if=
"pickUpView"
@
click=
"openPickUpView"
/>
<select-outlined
v-if=
"linkView"
@
click=
"openLinkView"
/>
<select-outlined
v-if=
"linkView"
@
click=
"openLinkView"
/>
</
template
>
</
template
>
<a-select-option
v-for=
"(item, index) in items"
:key=
"index"
:value=
"item[deKeyField]"
>
<a-select-option
v-for=
"(item, index) in items"
:key=
"index"
:value=
"item[deKeyField]"
>
\{{
item[deMajorField]
}}
\{{
item[deMajorField]
}}
</a-select-option>
</a-select-option>
</a-select>
</a-select>
</template>
</template>
</template>
<
style
scoped
>
<
style
scoped
></
style
>
</
style
>
\ No newline at end of file
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizUpload.vue
浏览文件 @
a03c228b
...
@@ -144,17 +144,28 @@ const onChange = ($event: any) => {
...
@@ -144,17 +144,28 @@ const onChange = ($event: any) => {
</div>
</div>
</
template
>
</
template
>
<
style
scoped
>
<
style
lang=
"scss"
>
.app-editor-container
{
.app-editor-container
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
text-align
:
left
;
text-align
:
left
;
}
.ant-upload--limit
{
.app-editor-container
.ant-upload--limit
.ant-upload-select-picture-card
{
.ant-upload-select-picture-card
,
.ant-upload-select-text
{
display
:
none
;
display
:
none
;
}
}
.ant-upload-select-picture-card
.ant-upload-text
{
.ant-upload-list-text
{
>
div
:first-child
{
.ant-upload-list-item
{
margin-top
:
4px
;
}
}
}
}
.ant-upload-select-picture-card
{
.ant-upload-text
{
margin-top
:
8px
;
margin-top
:
8px
;
color
:
#666
;
color
:
#666
;
}
}
}
}
</
style
>
</
style
>
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/render/ibizToolbar.vue
浏览文件 @
a03c228b
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
{
IParam
,
IActionParam
,
useContextParams
}
from
"@ibiz-core"
;
import
{
IParam
,
IActionParam
}
from
"@ibiz-core"
;
import
{
onBeforeMount
,
ref
,
Ref
}
from
"vue"
;
import
{
onBeforeMount
,
ref
,
Ref
}
from
"vue"
;
interface
ToolbarProps
{
interface
ToolbarProps
{
...
@@ -14,7 +14,6 @@ interface toolbarEmit {
...
@@ -14,7 +14,6 @@ interface toolbarEmit {
const
props
=
withDefaults
(
defineProps
<
ToolbarProps
>
(),
{});
const
props
=
withDefaults
(
defineProps
<
ToolbarProps
>
(),
{});
const
emit
=
defineEmits
<
toolbarEmit
>
();
const
emit
=
defineEmits
<
toolbarEmit
>
();
const
items
:
Ref
<
IParam
[]
>
=
ref
(
props
.
toolbarModel
?.
items
||
[]);
const
items
:
Ref
<
IParam
[]
>
=
ref
(
props
.
toolbarModel
?.
items
||
[]);
const
{
context
,
viewParams
}
=
useContextParams
(
props
);
const
getItemClass
=
(
item
:
IParam
)
=>
{
const
getItemClass
=
(
item
:
IParam
)
=>
{
//todo 样式表
//todo 样式表
return
item
.
class
;
return
item
.
class
;
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录