Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibizlab-generator
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibizlab-generator
提交
d612298f
提交
d612298f
编写于
12月 28, 2021
作者:
RedPig97
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update: 更新
上级
59b4e4d1
变更
13
隐藏空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
283 行增加
和
246 行删除
+283
-246
date-picker.hbs
...src/main/resources/templ/r7/@macro/editor/date-picker.hbs
+18
-28
IbizAutoComplete.vue
.../app_{{apps}}/src/components/editors/IbizAutoComplete.vue
+2
-1
IbizCheckboxList.vue
.../app_{{apps}}/src/components/editors/IbizCheckboxList.vue
+2
-3
IbizDataPicker.vue
...r7/app_{{apps}}/src/components/editors/IbizDataPicker.vue
+3
-2
IbizDatePicker.vue
...r7/app_{{apps}}/src/components/editors/IbizDatePicker.vue
+59
-23
IbizDropdownList.vue
.../app_{{apps}}/src/components/editors/IbizDropdownList.vue
+2
-1
IbizRadioGroup.vue
...r7/app_{{apps}}/src/components/editors/IbizRadioGroup.vue
+3
-4
IbizRaw.vue
.../templ/r7/app_{{apps}}/src/components/editors/IbizRaw.vue
+4
-3
IbizSpan.vue
...templ/r7/app_{{apps}}/src/components/editors/IbizSpan.vue
+3
-2
IbizUpload.vue
...mpl/r7/app_{{apps}}/src/components/editors/IbizUpload.vue
+2
-1
editor-base-help.ts
...{{apps}}/src/ibiz-core/modules/editor/editor-base-help.ts
+0
-177
editor-base.ts
.../app_{{apps}}/src/ibiz-core/modules/editor/editor-base.ts
+184
-0
index.ts
...mpl/r7/app_{{apps}}/src/ibiz-core/modules/editor/index.ts
+1
-1
未找到文件。
modules/ibizlab-generator-core/src/main/resources/templ/r7/@macro/editor/date-picker.hbs
浏览文件 @
d612298f
...
...
@@ -11,49 +11,39 @@
:readonly=
"
{{
item
.
psEditor
.
readOnly
}}
"
{{/if}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX"
}}
valueFormat=
"yyyy-MM-dd HH:mm:ss"
picker=
"date"
mode=
"date"
dateFormat=
"YYYY-MM-DD HH:mm:ss"
dateType=
"dateTime"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX_NOTIME"
}}
valueFormat=
"yyyy-MM-dd"
picker=
"date"
mode=
"date"
dateFormat=
"YYYY-MM-DD"
dateType=
"date"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKER"
}}
valueFormat=
"yyyy-MM-dd HH:mm:ss"
picker=
"date"
mode=
"time"
dateFormat=
"YYYY-MM-DD HH:mm:ss"
dateType=
"dateTime"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX_HOUR"
}}
valueFormat=
"yyyy-MM-dd HH"
picker=
"date"
mode=
"time"
dateFormat=
"YYYY-MM-DD HH"
dateType=
"dateTime"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX_MINUTE"
}}
valueFormat=
"yyyy-MM-dd HH:mm"
picker=
"time"
mode=
"date"
dateFormat=
"YYYY-MM-DD HH:mm"
dateType=
"dateTime"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX_SECOND"
}}
valueFormat=
"yyyy-MM-dd HH:mm:ss"
picker=
"time"
mode=
"date"
dateFormat=
"YYYY-MM-DD HH:mm:ss"
dateType=
"dateTime"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX_NODAY"
}}
valueFormat=
"HH:mm:ss"
picker=
"date"
mode=
"date"
dateFormat=
"HH:mm:ss"
dateType=
"time"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX_NODAY_NOSECOND"
}}
valueFormat=
"HH:mm"
picker=
"date"
mode=
"date"
dateFormat=
"HH:mm"
dateType=
"time"
{{/
eq
}}
{{#
eq
item
.
psEditor
.
editorType
"DATEPICKEREX_NOSECOND"
}}
valueFormat=
"yyyy-MM-dd HH:mm"
picker=
"date"
mode=
"date"
dateFormat=
"YYYY-MM-DD HH:mm"
dateType=
"dateTime"
{{/
eq
}}
@
editorEvent=
"handleEditorEvent"
/>
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizAutoComplete.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
onBeforeMount
,
Ref
,
ref
}
from
"vue"
;
import
{
handleEditorNavParams
,
deepCopy
,
IParam
,
IActionParam
}
from
"@ibiz-core"
;
import
{
deepCopy
,
IParam
,
IActionParam
,
EditorBase
}
from
"@ibiz-core"
;
interface
AutoCompleteProps
{
/**
* @description 表单数据或表格行数据
...
...
@@ -84,6 +84,7 @@ interface AutoCompleteProps {
interface
EditorEmit
{
(
name
:
"editorEvent"
,
value
:
IActionParam
):
void
;
}
const
{
handleEditorNavParams
}
=
new
EditorBase
();
const
props
=
withDefaults
(
defineProps
<
AutoCompleteProps
>
(),
{
deMajorField
:
"srfmajortext"
,
deKeyField
:
"srfkey"
,
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizCheckboxList.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
handleEditorNavParams
,
handleLevelCodeList
,
loadCodeListData
,
EditorBase
,
IActionParam
,
IParam
}
from
"@ibiz-core"
;
...
...
@@ -132,6 +130,7 @@ const props = withDefaults(defineProps<CheckboxListProps>(), {
mode
:
"string"
,
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
{
handleEditorNavParams
,
handleLevelCodeList
,
loadCodeListData
}
=
new
EditorBase
();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
let
items
:
Ref
<
IParam
[]
>
=
ref
([]);
const
selectArray
:
Ref
<
boolean
>
=
computed
(()
=>
{
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizDataPicker.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
onBeforeMount
,
Ref
,
ref
}
from
"vue"
;
import
{
handleEditorNavParams
,
deepCopy
,
openLinkView
,
openPickUpView
,
IParam
,
IActionParam
}
from
"@ibiz-core"
;
import
{
deepCopy
,
IParam
,
IActionParam
,
EditorBase
}
from
"@ibiz-core"
;
interface
DataPickerProps
{
/**
* @description 编辑器名称
...
...
@@ -95,6 +95,7 @@ const props = withDefaults(defineProps<DataPickerProps>(), {
deKeyField
:
'srfkey'
,
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
{
handleEditorNavParams
,
openLinkView
,
openPickUpView
}
=
new
EditorBase
();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
let
items
:
Ref
<
any
[]
>
=
ref
([]);
...
...
@@ -200,7 +201,7 @@ onBeforeMount(() => {
<select-outlined
v-if=
"linkView"
@
click=
"openLinkView"
/>
</
template
>
<a-select-option
v-for=
"(item, index) in items"
:key=
"index"
:value=
"item[deKeyField]"
>
{{item[deMajorField]}}
\
{{item[deMajorField]}}
</a-select-option>
</a-select>
</template>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizDatePicker.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
IActionParam
}
from
"@ibiz-core"
;
import
{
computed
,
Ref
}
from
"vue"
;
import
{
IActionParam
}
from
'@ibiz-core'
;
// import dayjs from 'ant-design-vue/lib/time-picker/dayjs';
import
{
computed
,
Ref
}
from
'vue'
;
import
dayjs
,
{
Dayjs
}
from
'dayjs'
;
interface
DatePickerProps
{
/**
* checked选中状态
*
* @type {
number
}
* @type {
string
}
* @memberof DatePickerProps
*/
value
:
number
;
value
:
string
;
/**
* checked选中状态
...
...
@@ -19,20 +21,20 @@ interface DatePickerProps {
name
:
string
;
/**
*
日期面板的状态
*
设置选择器类型
*
* @type {string}
* @memberof DatePickerProps
*/
mode
:
'time'
|
'date'
|
'month'
|
'year'
|
'decade'
;
dateFormat
:
string
;
/**
*
设置选择器
类型
/**
*
时间
类型
*
* @type {string}
* @memberof DatePickerProps
*/
picker
:
'date'
|
'week'
|
'month'
|
'quarter'
|
'year
'
;
dateType
:
'time'
|
'date'
|
'dateTime
'
;
/**
* 提示信息
...
...
@@ -56,37 +58,71 @@ interface DatePickerProps {
* @type {boolean}
*/
readonly
?:
boolean
;
}
interface
EditorEmit
{
(
name
:
"editorEvent"
,
value
:
IActionParam
):
void
;
(
name
:
'editorEvent'
,
value
:
IActionParam
):
void
;
}
const
props
=
withDefaults
(
defineProps
<
DatePickerProps
>
(),
{
disabled
:
false
,
readonly
:
false
,
picker
:
'date'
,
dateType
:
'date'
,
dateFormat
:
'yyyy-MM-dd HH:mm:ss'
,
placeholder
:
'请选择日期'
,
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
onChange
=
(
value
:
number
)
=>
{
emit
(
"editorEvent"
,
{
const
curValue
:
Ref
<
any
>
=
props
.
value
?
ref
<
Dayjs
>
(
dayjs
(
props
.
value
,
props
.
dateFormat
))
:
ref
(
''
);
const
onChange
=
(
date
:
string
,
dateString
:
string
)
=>
{
emit
(
'editorEvent'
,
{
tag
:
props
.
name
,
action
:
"valueChange"
,
data
:
value
?
1
:
0
,
action
:
'valueChange'
,
data
:
dateString
,
});
};
</
script
>
<
template
>
<a-date-picker
:class=
"['app-editor-container', `app-date-picker-$
{name}`]"
:mode="mode"
:picker="picker"
:placeholder="placeholder"
:inputReadOnly="readonly"
:disabled="disabled"/>
<template
v-if=
"dateType === 'time'"
>
<a-time-picker
:class=
"['app-date-picker', `app-date-picker--$
{name}`]"
v-model:value="curValue"
:format="dateFormat"
:placeholder="placeholder"
:inputReadOnly="readonly"
:disabled="disabled"
@change="onChange"
/>
</
template
>
<
template
v-else-if=
"dateType === 'date'"
>
<a-date-picker
:class=
"['app-date-picker', `app-date-picker--$
{name}`]"
v-model:value="curValue"
:format="dateFormat"
picker="date"
:placeholder="placeholder"
:inputReadOnly="readonly"
:disabled="disabled"
@change="onChange"
/>
</
template
>
<
template
v-else
>
<a-date-picker
showTime
:class=
"['app-date-picker', `app-date-picker--$
{name}`]"
v-model:value="curValue"
:format="dateFormat"
:placeholder="placeholder"
:inputReadOnly="readonly"
:disabled="disabled"
@change="onChange"
/>
</
template
>
</template>
<
style
scoped
>
<
style
lang=
"scss"
>
.app-date-picker
{
width
:
100%
;
}
</
style
>
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizDropdownList.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
onBeforeMount
,
Ref
,
ref
}
from
"vue"
;
import
{
IActionParam
,
IParam
,
handleEditorNavParams
,
typeOf
,
loadCodeListData
,
handleLevelCodeList
}
from
"@ibiz-core"
;
import
{
IActionParam
,
IParam
,
typeOf
,
EditorBase
}
from
"@ibiz-core"
;
interface
DropdownListProps
{
/**
...
...
@@ -79,6 +79,7 @@ const props = withDefaults(defineProps<DropdownListProps>(), {
})
const
emit
=
defineEmits
<
EditorEmit
>
()
const
{
handleEditorNavParams
,
loadCodeListData
,
handleLevelCodeList
}
=
new
EditorBase
();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
let
curValue
:
Ref
<
any
>
=
ref
(
props
.
multiple
?
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizRadioGroup.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
handleEditorNavParams
,
handleLevelCodeList
,
loadCodeListData
,
IActionParam
,
IParam
IParam
,
EditorBase
}
from
"@ibiz-core"
;
import
{
onBeforeMount
,
ref
,
Ref
}
from
"vue"
;
interface
RadioGroupProps
{
...
...
@@ -105,6 +103,7 @@ const props = withDefaults(defineProps<RadioGroupProps>(), {
readonly
:
false
,
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
{
handleEditorNavParams
,
loadCodeListData
,
handleLevelCodeList
}
=
new
EditorBase
();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
let
items
:
Ref
<
IParam
[]
>
=
ref
([]);
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizRaw.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
handleEditorNavParams
,
IActionParam
}
from
"@ibiz-core"
;
import
{
EditorBase
,
IActionParam
}
from
"@ibiz-core"
;
import
{
onBeforeMount
,
ref
,
Ref
}
from
"vue"
;
interface
RawProps
{
/**
...
...
@@ -52,6 +52,7 @@ const props = withDefaults(defineProps<RawProps>(), {
contentType
:
"RAW"
,
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
{
handleEditorNavParams
}
=
new
EditorBase
();
const
content
:
Ref
<
string
>
=
ref
(
""
);
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
...
...
@@ -82,9 +83,9 @@ onBeforeMount(() => {
<
template
>
<div
:class=
"['app-editor-container', `app-raw-$
{name}`]">
<div
class=
"raw-caption"
v-if=
"caption"
>
{{
caption
}}
</div>
<div
class=
"raw-caption"
v-if=
"caption"
>
\
{{
caption
}}
</div>
<div
v-if=
"Object.is(contentType, 'RAW')"
>
{{
content
}}
\
{{
content
}}
</div>
<div
v-else-if=
"Object.is(contentType, 'HTML')"
v-html=
"content"
/>
<div
v-else-if=
"Object.is(contentType, 'IMAGE')"
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizSpan.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
handleEditorNavParams
,
loadCodeListData
,
IParam
}
from
"@ibiz-core"
;
import
{
IParam
,
EditorBase
}
from
"@ibiz-core"
;
import
{
onBeforeMount
,
ref
,
Ref
}
from
"vue"
;
interface
SpanProps
{
/**
...
...
@@ -93,6 +93,7 @@ const props = withDefaults(defineProps<SpanProps>(), {
unitName
:
""
,
precision
:
2
,
});
const
{
handleEditorNavParams
,
loadCodeListData
}
=
new
EditorBase
();
const
{
navContext
,
navViewParam
}
=
handleEditorNavParams
(
props
);
let
text
:
Ref
<
string
>
=
ref
(
""
);
let
textFormat
:
Ref
<
string
>
=
ref
(
""
);
...
...
@@ -133,7 +134,7 @@ onBeforeMount(() => {
<
template
>
<div
:class=
"['app-editor-container', `app-span-$
{name}`]">
<span>
{{
text
}}
</span>
<span>
\
{{
text
}}
</span>
</div>
</
template
>
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/components/editors/IbizUpload.vue
浏览文件 @
d612298f
<
script
setup
lang=
"ts"
>
import
{
getDownloadUrl
,
getRequestingHeader
,
getUploadUrl
,
IActionParam
,
IParam
}
from
"@ibiz-core"
;
import
{
EditorBase
,
IActionParam
,
IParam
}
from
"@ibiz-core"
;
import
{
UploadOutlined
,
PlusOutlined
}
from
'@ant-design/icons-vue'
;
import
{
ref
,
Ref
}
from
"vue"
;
interface
UploadProps
{
...
...
@@ -98,6 +98,7 @@ const props = withDefaults(defineProps<UploadProps>(), {
listType
:
'text'
,
});
const
emit
=
defineEmits
<
EditorEmit
>
();
const
{
getDownloadUrl
,
getRequestingHeader
,
getUploadUrl
}
=
new
EditorBase
();
const
uploadUrl
=
getUploadUrl
();
const
downloadUrl
=
getDownloadUrl
();
const
headers
=
getRequestingHeader
();
...
...
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/editor/editor-base-help.ts
已删除
100644 → 0
浏览文件 @
59b4e4d1
import
{
toRefs
}
from
"vue"
;
import
{
IParam
}
from
"@ibiz-core"
;
import
{
computedNavData
,
useContextParams
}
from
"@ibiz-core"
;
/**
* @description 处理编辑器导航数据(查询代码表)
* @export
* @param {Record<string, any>} props 编辑器输入属性
* @return {*}
*/
export
function
handleEditorNavParams
(
props
:
Record
<
string
,
any
>
)
{
const
{
localContext
,
localParam
,
data
}
=
toRefs
(
props
);
const
{
context
,
viewParams
}
=
useContextParams
(
props
);
const
navParams
=
{
navContext
:
context
.
value
,
navViewParam
:
viewParams
.
value
,
}
if
(
localContext
&&
Object
.
keys
(
localContext
).
length
>
0
)
{
const
_context
=
computedNavData
(
data
,
navParams
.
navContext
,
navParams
.
navViewParam
,
localContext
);
Object
.
assign
(
navParams
.
navContext
,
_context
);
}
if
(
localParam
&&
Object
.
keys
(
localParam
).
length
>
0
)
{
const
_param
=
computedNavData
(
data
,
navParams
.
navContext
,
navParams
.
navViewParam
,
localParam
);
Object
.
assign
(
navParams
.
navViewParam
,
_param
);
}
return
navParams
;
}
/**
* @description 加载代码表数据
* @export
* @param {string} codeListTag 代码表标识
* @param {string} codeListType 代码表类型
* @param {IParam} navContext 导航上下文
* @param {IParam} navViewParam 导航视图参数
* @param {boolean} isNumber 是否为数值类型
* @return {Promise<any[]>} {any[]}
*/
export
async
function
loadCodeListData
(
codeListTag
?:
string
,
codeListType
?:
string
,
navContext
?:
IParam
,
navViewParam
?:
IParam
):
Promise
<
IParam
[]
>
{
const
data
:
IParam
[]
=
[
{
value
:
'243144'
,
label
:
'Jack'
,
},
{
value
:
'7dawda'
,
label
:
'Lucy'
,
},
{
value
:
'disaweqeqeqbled'
,
label
:
'Disabled'
,
disabled
:
true
,
},
{
value
:
'yimirwqrqwenghe'
,
label
:
'Yiminghe'
,
}
];
if
(
codeListTag
)
{
// todo 调用代码表服务获取数据
}
return
data
;
}
/**
* @description 处理层级代码表
* @export
* @param {IParam[]} codeListData 代码表数据
*/
export
function
handleLevelCodeList
(
codeListData
:
IParam
[]):
IParam
[]
{
let
items
:
IParam
[]
=
[...
codeListData
]
const
hasChildren
:
boolean
=
codeListData
.
some
((
item
:
any
)
=>
{
return
item
.
pvalue
;
})
if
(
hasChildren
){
let
list
:
IParam
[]
=
[];
items
.
forEach
((
codeItem
:
IParam
)
=>
{
if
(
!
codeItem
.
pvalue
){
let
valueField
:
string
=
codeItem
.
value
;
setChildCodeItems
(
valueField
,
items
,
codeItem
);
list
.
push
(
codeItem
);
}
})
items
=
list
;
}
return
items
;
}
/**
* @description 设置子代码表
* @param {string} pValue 父代码项值
* @param {IParam[]} result 代码表
* @param {IParam} codeItem 代码项
*/
function
setChildCodeItems
(
pValue
:
string
,
result
:
IParam
[],
codeItem
:
IParam
)
{
result
.
forEach
((
item
:
IParam
)
=>
{
if
(
item
.
pvalue
==
pValue
){
let
valueField
:
string
=
item
.
value
;
setChildCodeItems
(
valueField
,
result
,
item
);
if
(
!
codeItem
.
options
){
codeItem
.
children
=
[];
}
codeItem
.
children
.
push
(
item
);
}
})
}
/**
* @description 打开选择视图
* @export
*/
export
function
openPickUpView
()
{
//todo
}
/**
* @description 打开链接视图
* @export
*/
export
function
openLinkView
()
{
//todo
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
export
function
getUploadUrl
():
string
{
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().BaseUrl + AppServiceBase.getInstance().getAppEnvironment().UploadFile;
return
""
;
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
export
function
getDownloadUrl
():
string
{
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().ExportFile;
return
""
;
}
/**
* @description 获取文件请求头
* @export
* @return {*} {IParam}
*/
export
function
getRequestingHeader
():
IParam
{
//todo 请求头
// if (AppServiceBase.getInstance().getAppEnvironment().SaaSMode) {
// let activeOrgData = getSessionStorage('activeOrgData');
// this.headers['srforgid'] = activeOrgData?.orgid;
// this.headers['srfsystemid'] = activeOrgData?.systemid;
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// } else {
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// }
// if (getCookie('ibzuaa-token')) {
// this.headers['Authorization'] = `Bearer ${getCookie('ibzuaa-token')}`;
// } else {
// // 第三方应用打开免登
// if (sessionStorage.getItem("srftoken")) {
// const token = sessionStorage.getItem('srftoken');
// this.headers['Authorization'] = `Bearer ${token}`;
// }
// }
return
{};
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/editor/editor-base.ts
0 → 100644
浏览文件 @
d612298f
import
{
computedNavData
,
ControlPropsBase
,
ControlStateBase
,
IParam
,
toOneWayRef
,
useContextParams
}
from
'@ibiz-core'
;
import
{
RouteLocationNormalizedLoaded
,
Router
,
useRoute
,
useRouter
}
from
'vue-router'
;
/**
* @description 部件基类
* @export
* @class EditorBase
*/
export
class
EditorBase
{
/**
* @description 处理编辑器导航数据(查询代码表)
* @export
* @param {Record<string, any>} props 编辑器输入属性
* @return {*}
*/
public
handleEditorNavParams
(
props
:
Record
<
string
,
any
>
)
{
const
{
localContext
,
localParam
,
data
}
=
toRefs
(
props
);
const
{
context
,
viewParams
}
=
useContextParams
(
props
);
const
navParams
=
{
navContext
:
context
.
value
,
navViewParam
:
viewParams
.
value
,
}
if
(
localContext
&&
Object
.
keys
(
localContext
).
length
>
0
)
{
const
_context
=
computedNavData
(
data
,
navParams
.
navContext
,
navParams
.
navViewParam
,
localContext
);
Object
.
assign
(
navParams
.
navContext
,
_context
);
}
if
(
localParam
&&
Object
.
keys
(
localParam
).
length
>
0
)
{
const
_param
=
computedNavData
(
data
,
navParams
.
navContext
,
navParams
.
navViewParam
,
localParam
);
Object
.
assign
(
navParams
.
navViewParam
,
_param
);
}
return
navParams
;
}
/**
* @description 加载代码表数据
* @export
* @param {string} codeListTag 代码表标识
* @param {string} codeListType 代码表类型
* @param {IParam} navContext 导航上下文
* @param {IParam} navViewParam 导航视图参数
* @param {boolean} isNumber 是否为数值类型
* @return {Promise<any[]>} {any[]}
*/
public
async
loadCodeListData
(
codeListTag
?:
string
,
codeListType
?:
string
,
navContext
?:
IParam
,
navViewParam
?:
IParam
):
Promise
<
IParam
[]
>
{
const
data
:
IParam
[]
=
[
{
value
:
'243144'
,
label
:
'Jack'
,
},
{
value
:
'7dawda'
,
label
:
'Lucy'
,
},
{
value
:
'disaweqeqeqbled'
,
label
:
'Disabled'
,
disabled
:
true
,
},
{
value
:
'yimirwqrqwenghe'
,
label
:
'Yiminghe'
,
}
];
if
(
codeListTag
)
{
// todo 调用代码表服务获取数据
}
return
data
;
}
/**
* @description 处理层级代码表
* @export
* @param {IParam[]} codeListData 代码表数据
*/
public
handleLevelCodeList
(
codeListData
:
IParam
[]):
IParam
[]
{
let
items
:
IParam
[]
=
[...
codeListData
]
const
hasChildren
:
boolean
=
codeListData
.
some
((
item
:
any
)
=>
{
return
item
.
pvalue
;
})
if
(
hasChildren
){
let
list
:
IParam
[]
=
[];
items
.
forEach
((
codeItem
:
IParam
)
=>
{
if
(
!
codeItem
.
pvalue
){
let
valueField
:
string
=
codeItem
.
value
;
this
.
setChildCodeItems
(
valueField
,
items
,
codeItem
);
list
.
push
(
codeItem
);
}
})
items
=
list
;
}
return
items
;
}
/**
* @description 设置子代码表
* @param {string} pValue 父代码项值
* @param {IParam[]} result 代码表
* @param {IParam} codeItem 代码项
*/
public
setChildCodeItems
(
pValue
:
string
,
result
:
IParam
[],
codeItem
:
IParam
)
{
result
.
forEach
((
item
:
IParam
)
=>
{
if
(
item
.
pvalue
==
pValue
){
let
valueField
:
string
=
item
.
value
;
this
.
setChildCodeItems
(
valueField
,
result
,
item
);
if
(
!
codeItem
.
options
){
codeItem
.
children
=
[];
}
codeItem
.
children
.
push
(
item
);
}
})
}
/**
* @description 打开选择视图
* @export
*/
public
openPickUpView
()
{
//todo
}
/**
* @description 打开链接视图
* @export
*/
public
openLinkView
()
{
//todo
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
public
getUploadUrl
():
string
{
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().BaseUrl + AppServiceBase.getInstance().getAppEnvironment().UploadFile;
return
""
;
}
/**
* @description 获取文件上传路径
* @export
* @return {*} {string}
*/
public
getDownloadUrl
():
string
{
//todo 环境参数
// return AppServiceBase.getInstance().getAppEnvironment().ExportFile;
return
""
;
}
/**
* @description 获取文件请求头
* @export
* @return {*} {IParam}
*/
public
getRequestingHeader
():
IParam
{
//todo 请求头
// if (AppServiceBase.getInstance().getAppEnvironment().SaaSMode) {
// let activeOrgData = getSessionStorage('activeOrgData');
// this.headers['srforgid'] = activeOrgData?.orgid;
// this.headers['srfsystemid'] = activeOrgData?.systemid;
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// } else {
// if(getSessionStorage("srfdynaorgid")){
// this.headers['srfdynaorgid'] = getSessionStorage("srfdynaorgid");
// }
// }
// if (getCookie('ibzuaa-token')) {
// this.headers['Authorization'] = `Bearer ${getCookie('ibzuaa-token')}`;
// } else {
// // 第三方应用打开免登
// if (sessionStorage.getItem("srftoken")) {
// const token = sessionStorage.getItem('srftoken');
// this.headers['Authorization'] = `Bearer ${token}`;
// }
// }
return
{};
}
}
modules/ibizlab-generator-core/src/main/resources/templ/r7/app_{{apps}}/src/ibiz-core/modules/editor/index.ts
浏览文件 @
d612298f
export
*
from
'./editor-base-help'
;
\ No newline at end of file
export
*
from
'./editor-base'
;
\ No newline at end of file
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录