Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz-Vue-R7-Res
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7前端标准模板
iBiz-Vue-R7-Res
提交
9491583d
提交
9491583d
编写于
10月 18, 2020
作者:
tony001
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev'
上级
fd20017c
55f10f60
变更
22
隐藏空白字符变更
内嵌
并排
正在显示
22 个修改的文件
包含
235 行增加
和
60 行删除
+235
-60
CHANGELOG.md
CHANGELOG.md
+64
-0
codelist-service.ts
src/codelist/codelist-service.ts
+9
-7
app-actionbar.vue
src/components/app-actionbar/app-actionbar.vue
+2
-2
app-alert-group.vue
src/components/app-alert-group/app-alert-group.vue
+30
-1
app-alert.vue
src/components/app-alert/app-alert.vue
+40
-6
app-breadcrumb.vue
src/components/app-breadcrumb/app-breadcrumb.vue
+9
-1
app-form-group.vue
src/components/app-form-group/app-form-group.vue
+1
-1
app-image-preview.vue
src/components/app-image-preview/app-image-preview.vue
+1
-1
app-image-upload.vue
src/components/app-image-upload/app-image-upload.vue
+1
-1
appConfig.ts
src/config/appConfig.ts
+3
-1
calendar-exp-view-engine.ts
src/engine/view/calendar-exp-view-engine.ts
+0
-3
data-view-exp-view-engine.ts
src/engine/view/data-view-exp-view-engine.ts
+0
-3
grid-exp-view-engine.ts
src/engine/view/grid-exp-view-engine.ts
+0
-3
list-exp-view-engine.ts
src/engine/view/list-exp-view-engine.ts
+0
-3
tree-exp-view-engine.ts
src/engine/view/tree-exp-view-engine.ts
+0
-3
view-engine.ts
src/engine/view/view-engine.ts
+1
-1
wizard-view-engine.ts
src/engine/view/wizard-view-engine.ts
+5
-1
view-message-service.ts
src/message/view-message-service.ts
+18
-11
getters.ts
src/store/modules/auth-resource/getters.ts
+43
-10
default.less
src/styles/default.less
+3
-0
ui-service.ts
src/uiservice/ui-service.ts
+4
-0
view-tool.ts
src/utils/view-tool/view-tool.ts
+1
-1
未找到文件。
CHANGELOG.md
浏览文件 @
9491583d
## v7.0.0-alpha.20 [2020-10-18]
### Bug修复
修复获取数据对象的主状态值统一转字符串处理逻辑
修复表单空输入异常问题
修复下拉数据数据加载异常问题
修复表单分页图标重复发布异常
修复数据选择增加外键值附加数据回填逻辑
修复表格行编辑可设置数据主键和清空仿真主键问题
修复代码表返回数据不合法抛出的异常
修复表单值规则部分逻辑
修复导航类视图修改右侧表单数据时,只能跳转第一条数据BUG
### 功能新增及优化
#### 模板
新增动态表单支持
新增视图消息支持
新增表单、面板、工具栏、数据看板直接内容项支持
新增日历项支持标识属性和文本属性
新增应用组件包支持
新增导航工具栏权限控制支持
新增图表绘制最终参数
新增门户部件界面行为组权限校验
新增表单、表格数据对象方式新建、更新默认值
新增导航视图搜索框提示可搜索字段名称
新增部件逻辑插件支持
新增工具栏、工具栏项插件支持
优化调整代码表服务基类位置
#### 基础文件
新增动态表单组件、直接内容项组件、视图消息组组件和视图消息组件
优化导航类部件工具栏状态逻辑
修复表单空输入异常问题
修复下拉数据数据加载异常
修复关系页第一次进入不加载问题
## v7.0.0-alpha.19 [2020-9-13]
### Bug修复
...
...
src/codelist/codelist-service.ts
浏览文件 @
9491583d
...
...
@@ -149,10 +149,11 @@ export default class CodeListService {
// 启用缓存
if
(
isEnableCache
){
const
callback
:
Function
=
(
context
:
any
=
{},
data
:
any
=
{},
tag
:
string
,
promise
:
Promise
<
any
>
)
=>
{
const
callbackKey
:
string
=
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
;
promise
.
then
((
result
:
any
)
=>
{
if
(
result
.
length
>
0
){
CodeListService
.
codelistCached
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,{
items
:
result
});
CodeListService
.
codelistCache
.
delete
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
);
CodeListService
.
codelistCached
.
set
(
callbackKey
,{
items
:
result
});
CodeListService
.
codelistCache
.
delete
(
callbackKey
);
return
resolve
(
result
);
}
else
{
return
resolve
([]);
...
...
@@ -162,8 +163,9 @@ export default class CodeListService {
})
}
// 加载完成,从本地缓存获取
if
(
CodeListService
.
codelistCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
let
items
:
any
=
CodeListService
.
codelistCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
).
items
;
const
key
:
string
=
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
;
if
(
CodeListService
.
codelistCached
.
get
(
key
)){
let
items
:
any
=
CodeListService
.
codelistCached
.
get
(
key
).
items
;
if
(
items
.
length
>
0
){
if
(
new
Date
().
getTime
()
<=
codelist
.
getExpirationTime
()){
return
resolve
(
items
);
...
...
@@ -172,11 +174,11 @@ export default class CodeListService {
}
if
(
codelist
)
{
// 加载中,UI又需要数据,解决连续加载同一代码表问题
if
(
CodeListService
.
codelistCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
callback
(
context
,
data
,
tag
,
CodeListService
.
codelistCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
));
if
(
CodeListService
.
codelistCache
.
get
(
key
)){
callback
(
context
,
data
,
tag
,
CodeListService
.
codelistCache
.
get
(
key
));
}
else
{
let
result
:
Promise
<
any
>
=
codelist
.
getItems
(
context
,
data
,
isloading
);
CodeListService
.
codelistCache
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,
result
);
CodeListService
.
codelistCache
.
set
(
key
,
result
);
codelist
.
setExpirationTime
(
new
Date
().
getTime
()
+
cacheTimeout
);
callback
(
context
,
data
,
tag
,
result
);
}
...
...
src/components/app-actionbar/app-actionbar.vue
浏览文件 @
9491583d
...
...
@@ -66,7 +66,7 @@ export default class AppActionBar extends Vue {
public
created
(){
if
(
this
.
viewState
)
{
this
.
viewStateEvent
=
this
.
viewState
.
subscribe
(({
tag
,
action
,
data
})
=>
{
if
(
!
Object
.
is
(
tag
,
"a
pp-actionbar
"
))
{
if
(
!
Object
.
is
(
tag
,
"a
ll-portlet
"
))
{
return
;
}
if
(
Object
.
is
(
action
,
'loadmodel'
)){
...
...
@@ -107,7 +107,7 @@ export default class AppActionBar extends Vue {
const
_item
=
ActionModel
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
UIService
){
let
dataActionResult
:
any
;
if
(
Object
.
is
(
_item
[
'actiontarget'
],
"NONE"
)){
if
(
Object
.
is
(
_item
[
'actiontarget'
],
"NONE"
)
||
Object
.
is
(
_item
[
'actiontarget'
],
""
)
){
dataActionResult
=
UIService
.
getResourceOPPrivs
(
_item
[
'dataaccaction'
]);
}
else
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
){
...
...
src/components/app-alert-group/app-alert-group.vue
浏览文件 @
9491583d
...
...
@@ -4,7 +4,11 @@
<app-alert
:key=
"index"
:tag=
"item.tag"
:position=
"item.position"
/>
:context=
"context"
:viewparam=
"viewparam"
:position=
"item.position"
:infoGroup=
"infoGroup"
:viewname=
"viewname"
/>
</
template
>
</div>
...
...
@@ -32,6 +36,23 @@ export default class AppAlertGroup extends Vue {
*/
@
Prop
()
infoGroup
:
any
;
/**
* 应用上下文
*
* @type {any}
* @memberof AppAlertGroup
*/
@
Prop
()
context
:
any
;
/**
* 视图参数
*
* @type {any}
* @memberof AppAlertGroup
*/
@
Prop
()
viewparam
:
any
;
/**
* 视图消息组显示位置
*
...
...
@@ -40,6 +61,14 @@ export default class AppAlertGroup extends Vue {
*/
@
Prop
()
position
:
any
;
/**
* 视图名称
*
* @type {any}
* @memberof AppAlertGroup
*/
@
Prop
()
viewname
:
any
;
/**
* 当前位置视图消息集合
*
...
...
src/components/app-alert/app-alert.vue
浏览文件 @
9491583d
...
...
@@ -43,6 +43,39 @@ export default class AppAlert extends Vue {
* @memberof AppAlert
*/
@
Prop
()
position
:
any
;
/**
* 应用上下文
*
* @type {any}
* @memberof AppAlert
*/
@
Prop
()
context
:
any
;
/**
* 视图参数
*
* @type {any}
* @memberof AppAlert
*/
@
Prop
()
viewparam
:
any
;
/**
* 视图消息组tag
*
* @type {any}
* @memberof AppAlert
*/
@
Prop
()
infoGroup
!
:
any
;
/**
* 视图名称
*
* @type {any}
* @memberof AppAlert
*/
@
Prop
()
viewname
!
:
any
;
/**
* 视图消息对象
...
...
@@ -79,7 +112,7 @@ export default class AppAlert extends Vue {
* @memberof AppAlert
*/
public
async
getData
()
{
let
response
:
any
=
await
this
.
viewMessageService
.
getViewMessageByTag
(
this
.
tag
,
null
,
null
)
let
response
:
any
=
await
this
.
viewMessageService
.
getViewMessageByTag
(
this
.
tag
,
this
.
context
,
this
.
viewparam
);
if
(
response
&&
response
.
length
>
0
)
{
response
.
forEach
((
item
:
any
)
=>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
item
));
...
...
@@ -118,7 +151,8 @@ export default class AppAlert extends Vue {
data
.
showState
=
true
;
if
(
data
.
closeMode
||
data
.
closeMode
==
0
)
{
if
(
data
.
closeMode
==
1
)
{
const
id
=
this
.
$store
.
getters
.
getViewMessage
(
data
.
codename
);
const
tag
=
this
.
viewname
+
'_'
+
this
.
infoGroup
+
'_'
+
data
.
codename
;
const
id
=
localStorage
.
getItem
(
tag
);
if
(
id
)
{
data
.
showState
=
false
;
flag
=
false
;
...
...
@@ -182,14 +216,14 @@ export default class AppAlert extends Vue {
let
tempArr
:
any
[]
=
data
.
customClass
.
toString
().
split
(
','
);
if
(
tempArr
&&
tempArr
.
length
>
0
)
{
if
(
Object
.
is
(
"1"
,
tempArr
[
1
]))
{
const
args
=
{
tag
:
tempArr
[
0
],
id
:
data
.
customClass
}
;
this
.
$store
.
commit
(
'addViewMessage'
,
arg
s
);
const
tag
=
this
.
viewname
+
'_'
+
this
.
infoGroup
+
'_'
+
tempArr
[
0
]
;
localStorage
.
setItem
(
tag
,
data
.
customClas
s
);
}
}
}
if
(
data
.
closeMode
&&
data
.
closeMode
==
1
)
{
const
args
=
{
tag
:
data
.
codename
,
id
:
data
.
id
}
;
this
.
$store
.
commit
(
'addViewMessage'
,
args
);
const
tag
=
this
.
viewname
+
'_'
+
this
.
infoGroup
+
'_'
+
data
.
codename
;
localStorage
.
setItem
(
tag
,
data
.
id
);
}
}
...
...
src/components/app-breadcrumb/app-breadcrumb.vue
浏览文件 @
9491583d
<
template
>
<el-breadcrumb
class=
"app-breadcrumb"
separator=
"/
"
>
<el-breadcrumb
class=
"app-breadcrumb"
:separator=
"separator
"
>
<transition-group
name=
"breadcrumb"
>
<template
v-if=
"Object.is(this.navModel,'route')"
>
<el-breadcrumb-item
v-for=
"(item, index) in breadcrumbs"
:key=
"item.id"
>
...
...
@@ -34,6 +34,7 @@
import
{
Component
,
Vue
,
Watch
,
Prop
}
from
'vue-property-decorator'
import
{
RouteRecord
,
Route
}
from
'vue-router'
import
{
Environment
}
from
"@/environments/environment"
;
import
{
appConfig
}
from
'@/config/appConfig'
;
import
NavDataService
from
'@/service/app/navdata-service'
;
import
{
Subscription
}
from
'rxjs'
;
...
...
@@ -48,6 +49,13 @@ export default class Breadcrumb extends Vue {
*/
private
breadcrumbs
:
Array
<
any
>
=
[];
/**
* 面包屑分隔符
*
* @memberof Breadcrumb
*/
private
separator
:
string
=
appConfig
.
breadcrumbSeparator
;
/**
* 导航服务
*
...
...
src/components/app-form-group/app-form-group.vue
浏览文件 @
9491583d
...
...
@@ -165,7 +165,7 @@ export default class AppFormGroup extends Vue {
const
_item
=
ActionModel
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
UIService
){
let
dataActionResult
:
any
;
if
(
Object
.
is
(
_item
[
'actiontarget'
],
"NONE"
)){
if
(
Object
.
is
(
_item
[
'actiontarget'
],
"NONE"
)
||
Object
.
is
(
_item
[
'actiontarget'
],
""
)
){
dataActionResult
=
UIService
.
getResourceOPPrivs
(
_item
[
'dataaccaction'
]);
}
else
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
){
...
...
src/components/app-image-preview/app-image-preview.vue
浏览文件 @
9491583d
...
...
@@ -21,7 +21,7 @@
</ul>
<!-- 预览 -->
<modal
v-model=
"dialogVisible"
footer-hide
width=
"auto"
class-name=
'app-image-preview-model'
>
<el-image
src=
"dialogImageUrl"
>
<el-image
:
src=
"dialogImageUrl"
>
<div
slot=
'error'
class=
'image-slot'
>
<img
src=
"/assets/img/picture.png"
>
</div>
...
...
src/components/app-image-upload/app-image-upload.vue
浏览文件 @
9491583d
...
...
@@ -49,7 +49,7 @@
</el-upload>
<!-- 预览 -->
<modal
v-model=
"dialogVisible"
footer-hide
class-name=
'app-image-upload-model'
>
<el-image
src=
"dialogImageUrl"
>
<el-image
:
src=
"dialogImageUrl"
>
<div
slot=
'error'
class=
'image-slot'
>
<i
class=
'el-icon-picture-outline'
></i>
</div>
...
...
src/config/appConfig.ts
浏览文件 @
9491583d
...
...
@@ -35,5 +35,7 @@ export const appConfig = {
label
:
'YouYuan'
,
value
:
'YouYuan'
,
},
]
],
// 面包屑分隔符
breadcrumbSeparator
:
"/"
}
\ No newline at end of file
src/engine/view/calendar-exp-view-engine.ts
浏览文件 @
9491583d
...
...
@@ -81,9 +81,6 @@ export default class CalendarExpViewEngine extends ViewEngine {
this
.
view
.
$emit
(
'viewload'
,
args
);
}
if
(
Object
.
is
(
eventName
,
'selectionchange'
))
{
if
(
this
.
calendarExpBar
&&
this
.
calendarExpBar
.
calcNavigationToolbarState
&&
this
.
calendarExpBar
.
calcNavigationToolbarState
instanceof
Function
){
this
.
calendarExpBar
.
calcNavigationToolbarState
();
}
this
.
view
.
$emit
(
'viewdataschange'
,
args
);
}
if
(
Object
.
is
(
eventName
,
'activated'
))
{
...
...
src/engine/view/data-view-exp-view-engine.ts
浏览文件 @
9491583d
...
...
@@ -78,9 +78,6 @@ export default class DataViewExpViewEngine extends ViewEngine {
*/
public
dataviewExpBarEvent
(
eventName
:
string
,
args
:
any
):
void
{
if
(
Object
.
is
(
eventName
,
'load'
))
{
if
(
this
.
dataviewExpBar
&&
this
.
dataviewExpBar
.
calcNavigationToolbarState
&&
this
.
dataviewExpBar
.
calcNavigationToolbarState
instanceof
Function
){
this
.
dataviewExpBar
.
calcNavigationToolbarState
();
}
this
.
view
.
$emit
(
'viewload'
,
args
);
}
if
(
Object
.
is
(
eventName
,
'selectionchange'
))
{
...
...
src/engine/view/grid-exp-view-engine.ts
浏览文件 @
9491583d
...
...
@@ -78,9 +78,6 @@ export default class GridExpViewEngine extends ViewEngine {
*/
public
gridExpBarEvent
(
eventName
:
string
,
args
:
any
):
void
{
if
(
Object
.
is
(
eventName
,
'load'
))
{
if
(
this
.
gridExpBar
&&
this
.
gridExpBar
.
calcNavigationToolbarState
&&
this
.
gridExpBar
.
calcNavigationToolbarState
instanceof
Function
){
this
.
gridExpBar
.
calcNavigationToolbarState
();
}
this
.
view
.
$emit
(
'viewload'
,
args
);
}
if
(
Object
.
is
(
eventName
,
'selectionchange'
))
{
...
...
src/engine/view/list-exp-view-engine.ts
浏览文件 @
9491583d
...
...
@@ -78,9 +78,6 @@ export default class ListExpViewEngine extends ViewEngine {
*/
public
listExpBarEvent
(
eventName
:
string
,
args
:
any
):
void
{
if
(
Object
.
is
(
eventName
,
'load'
))
{
if
(
this
.
listExpBar
&&
this
.
listExpBar
.
calcNavigationToolbarState
&&
this
.
listExpBar
.
calcNavigationToolbarState
instanceof
Function
){
this
.
listExpBar
.
calcNavigationToolbarState
();
}
this
.
view
.
$emit
(
'viewload'
,
args
);
}
if
(
Object
.
is
(
eventName
,
'selectionchange'
))
{
...
...
src/engine/view/tree-exp-view-engine.ts
浏览文件 @
9491583d
...
...
@@ -79,9 +79,6 @@ export default class TreeExpView extends ViewEngine {
*/
public
treeExpBarEvent
(
eventName
:
string
,
args
:
any
):
void
{
if
(
Object
.
is
(
eventName
,
'load'
))
{
if
(
this
.
treeExpBar
&&
this
.
treeExpBar
.
calcNavigationToolbarState
&&
this
.
treeExpBar
.
calcNavigationToolbarState
instanceof
Function
){
this
.
treeExpBar
.
calcNavigationToolbarState
();
}
this
.
view
.
$emit
(
'viewload'
,
args
);
}
if
(
Object
.
is
(
eventName
,
'selectionchange'
))
{
...
...
src/engine/view/view-engine.ts
浏览文件 @
9491583d
...
...
@@ -194,7 +194,7 @@ export default class ViewEngine {
const
_item
=
_this
.
view
.
toolBarModels
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
_this
.
view
.
appUIService
){
let
dataActionResult
:
any
;
if
(
_item
.
uiaction
&&
(
Object
.
is
(
_item
.
uiaction
.
target
,
'NONE'
))){
if
(
_item
.
uiaction
&&
(
Object
.
is
(
_item
.
uiaction
.
target
,
"NONE"
)
||
Object
.
is
(
_item
.
uiaction
.
target
,
""
))){
dataActionResult
=
_this
.
view
.
appUIService
.
getResourceOPPrivs
(
_item
[
'dataaccaction'
]);
}
else
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
){
...
...
src/engine/view/wizard-view-engine.ts
浏览文件 @
9491583d
...
...
@@ -78,7 +78,11 @@ export default class WizardViewEngine extends ViewEngine {
*/
public
onfinish
(
args
:
any
):
void
{
this
.
view
.
$emit
(
'viewdataschange'
,
[
args
]);
this
.
view
.
$emit
(
'close'
,
null
);
if
(
!
this
.
view
.
viewDefaultUsage
){
this
.
view
.
$emit
(
'close'
,
null
);
}
else
{
this
.
view
.
$tabPageExp
.
onClose
(
this
.
view
.
$route
.
fullPath
);
}
}
/**
...
...
src/message/view-message-service.ts
浏览文件 @
9491583d
...
...
@@ -201,7 +201,7 @@ export default class ViewMessageService {
public
async
getViewMessageByTag
(
tag
:
string
,
context
:
any
=
{},
viewparam
:
any
=
{}){
let
messageService
:
any
=
await
this
.
getService
(
tag
);
if
(
messageService
.
dynamicMode
&&
Object
.
is
(
messageService
.
dynamicMode
,
"STATIC"
)){
return
messageService
.
getStaticViewMessage
();
return
messageService
.
getStaticViewMessage
(
context
,
viewparam
);
}
else
{
return
messageService
.
getDynamicViewMessage
(
tag
,
messageService
,
context
,
viewparam
);
}
...
...
@@ -209,10 +209,15 @@ export default class ViewMessageService {
/**
* 转化消息模板标题和内容
*
* @target {*} target 返回目标数据
* @param {*} context 应用上下文
* @param {*} viewparam 视图参数
* @param {*} item 源数据
*
* @memberof ViewMessageService
*/
public
translateMessageTemp
(
target
:
any
,
item
?:
any
){
public
translateMessageTemp
(
target
:
any
,
context
:
any
,
viewparam
:
any
,
item
?:
any
){
}
...
...
@@ -221,7 +226,7 @@ export default class ViewMessageService {
*
* @memberof ViewMessageService
*/
public
getStaticViewMessage
():
Array
<
ViewMessage
>
{
public
getStaticViewMessage
(
context
:
any
,
viewparam
:
any
):
Array
<
ViewMessage
>
{
let
returnViewMessage
:
ViewMessage
=
{
id
:
this
.
id
,
name
:
this
.
name
,
...
...
@@ -236,7 +241,7 @@ export default class ViewMessageService {
dynamicMode
:
this
.
dynamicMode
,
messageType
:
this
.
messageType
};
this
.
translateMessageTemp
(
returnViewMessage
);
this
.
translateMessageTemp
(
returnViewMessage
,
context
,
viewparam
);
return
[
returnViewMessage
];
}
...
...
@@ -259,10 +264,11 @@ export default class ViewMessageService {
// 启用缓存
if
(
isEnableCache
){
const
callback
:
Function
=
(
context
:
any
=
{},
data
:
any
=
{},
tag
:
string
,
promise
:
Promise
<
any
>
)
=>
{
const
callbackKey
:
string
=
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
;
promise
.
then
((
result
:
any
)
=>
{
if
(
result
.
length
>
0
){
ViewMessageService
.
messageCached
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,{
items
:
result
});
ViewMessageService
.
messageCache
.
delete
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
);
ViewMessageService
.
messageCached
.
set
(
callbackKey
,{
items
:
result
});
ViewMessageService
.
messageCache
.
delete
(
callbackKey
);
return
resolve
(
result
);
}
else
{
return
resolve
([]);
...
...
@@ -271,9 +277,10 @@ export default class ViewMessageService {
return
reject
(
result
);
})
}
const
key
:
string
=
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
;
// 加载完成,从本地缓存获取
if
(
ViewMessageService
.
messageCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
let
items
:
any
=
ViewMessageService
.
messageCached
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
).
items
;
if
(
ViewMessageService
.
messageCached
.
get
(
key
)){
let
items
:
any
=
ViewMessageService
.
messageCached
.
get
(
key
).
items
;
if
(
items
.
length
>
0
){
if
(
new
Date
().
getTime
()
<=
messageService
.
getExpirationTime
()){
return
resolve
(
items
);
...
...
@@ -282,11 +289,11 @@ export default class ViewMessageService {
}
if
(
messageService
)
{
// 加载中,UI又需要数据,解决连续加载同一代码表问题
if
(
ViewMessageService
.
messageCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
)){
callback
(
context
,
data
,
tag
,
ViewMessageService
.
messageCache
.
get
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
));
if
(
ViewMessageService
.
messageCache
.
get
(
key
)){
callback
(
context
,
data
,
tag
,
ViewMessageService
.
messageCache
.
get
(
key
));
}
else
{
let
result
:
Promise
<
any
>
=
messageService
.
getItems
(
context
,
data
,
isloading
);
ViewMessageService
.
messageCache
.
set
(
`
${
JSON
.
stringify
(
context
)}
-
${
JSON
.
stringify
(
data
)}
-
${
tag
}
`
,
result
);
ViewMessageService
.
messageCache
.
set
(
key
,
result
);
messageService
.
setExpirationTime
(
new
Date
().
getTime
()
+
cacheTimeout
);
callback
(
context
,
data
,
tag
,
result
);
}
...
...
src/store/modules/auth-resource/getters.ts
浏览文件 @
9491583d
...
...
@@ -32,23 +32,56 @@ export const getEnablePermissionValid = (state: any) => {
}
/**
* 判断指定菜单是否显示
* 判断指定菜单是否显示
(混合模式)
*
* @param state
*/
export
const
getAuthMenu
=
(
state
:
any
)
=>
(
menu
:
any
)
=>
{
// 存在权限
let
resourceIndex
:
any
;
let
menuIndex
:
any
;
if
(
state
.
enablePermissionValid
){
resourceIndex
=
state
.
resourceData
.
findIndex
((
resourcetag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
export
const
getAuthMenu
=
(
state
:
any
)
=>
(
menu
:
any
)
=>
{
if
(
state
.
enablePermissionValid
)
{
let
resourceIndex
:
any
;
let
menuIndex
:
any
;
resourceIndex
=
state
.
resourceData
.
findIndex
((
resourcetag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
return
Object
.
is
(
menu
.
resourcetag
,
resourcetag
);
})
menuIndex
=
state
.
menuData
.
findIndex
((
menutag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
menuIndex
=
state
.
menuData
.
findIndex
((
menutag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
return
Object
.
is
(
menu
.
authtag
,
menutag
);
})
return
(
resourceIndex
!==
-
1
||
menuIndex
!==
-
1
)?
true
:
false
;
}
else
{
return
(
resourceIndex
!==
-
1
||
menuIndex
!==
-
1
)
?
true
:
false
;
}
else
{
return
true
;
}
}
/**
* 判断指定菜单是否显示(资源模式)
*
* @param state
*/
export
const
getAuthMenuWithResource
=
(
state
:
any
)
=>
(
menu
:
any
)
=>
{
if
(
state
.
enablePermissionValid
&&
menu
.
resourcetag
)
{
let
resourceIndex
:
any
;
resourceIndex
=
state
.
resourceData
.
findIndex
((
resourcetag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
return
Object
.
is
(
menu
.
resourcetag
,
resourcetag
);
})
return
resourceIndex
!==
-
1
?
true
:
false
;
}
else
{
return
true
;
}
}
/**
* 判断指定菜单是否显示(RT模式)
*
* @param state
*/
export
const
getAuthMenuWithRT
=
(
state
:
any
)
=>
(
menu
:
any
)
=>
{
if
(
state
.
enablePermissionValid
)
{
let
menuIndex
:
any
;
menuIndex
=
state
.
menuData
.
findIndex
((
menutag
:
any
,
objIndex
:
any
,
objs
:
any
)
=>
{
return
Object
.
is
(
menu
.
authtag
,
menutag
);
})
return
menuIndex
!==
-
1
?
true
:
false
;
}
else
{
return
true
;
}
}
\ No newline at end of file
src/styles/default.less
浏览文件 @
9491583d
...
...
@@ -124,11 +124,14 @@
// flex-grow: 1;
height: calc(100% - 74px);
padding: 0px;
display: flex;
flex-direction: column;
> .content-container {
height: 100%;
display: flex;
margin: 0;
flex-direction: column;
overflow: auto;
}
}
}
...
...
src/uiservice/ui-service.ts
浏览文件 @
9491583d
import
{
Store
}
from
'vuex'
;
import
AuthService
from
'@/authservice/auth-service'
;
/**
* 界面服务基类
...
...
@@ -63,6 +64,9 @@ export default class UIService {
* @memberof UIService
*/
public
getResourceOPPrivs
(
tag
:
any
){
if
(
!
this
.
authService
)
{
this
.
authService
=
new
AuthService
(
this
.
getStore
());
}
return
this
.
authService
.
getResourcePermission
(
this
.
authService
.
sysOPPrivsMap
.
get
(
tag
))?
1
:
0
;
}
...
...
src/utils/view-tool/view-tool.ts
浏览文件 @
9491583d
...
...
@@ -260,7 +260,7 @@ export class ViewTool {
const
_item
=
ActionModel
[
key
];
if
(
_item
&&
_item
[
'dataaccaction'
]
&&
UIService
){
let
dataActionResult
:
any
;
if
(
Object
.
is
(
_item
[
'actiontarget'
],
"NONE"
)){
if
(
Object
.
is
(
_item
[
'actiontarget'
],
"NONE"
)
||
Object
.
is
(
_item
[
'actiontarget'
],
""
)
){
dataActionResult
=
UIService
.
getResourceOPPrivs
(
_item
[
'dataaccaction'
]);
}
else
{
if
(
data
&&
Object
.
keys
(
data
).
length
>
0
){
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录