Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa-flutter
比较版本
65a445935bfb7df6d33d44326555644b06d5bda1...eb3ef9227e97b8f3e9f01b097f8b4d741a3b4a6f
O
o2oa-flutter
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa-flutter
通知
0
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
o2oa-flutter
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
源分支
eb3ef9227e97b8f3e9f01b097f8b4d741a3b4a6f
选择Git版本
...
目标分支
65a445935bfb7df6d33d44326555644b06d5bda1
选择Git版本
比较
Commits (3)
https://gitcode.net/O2OA/o2oa-flutter/-/commit/9e8ea9829138a7164f2d67e6cbd16d71f1a30e56
主页其他三个页面支持门户替换
2024-04-08T14:34:45+08:00
fancy
fancylou@outlook.com
https://gitcode.net/O2OA/o2oa-flutter/-/commit/e4c7b72a0059defa1ebd4d801748e81aa4a34dfe
设置页面支持门户
2024-04-08T17:01:17+08:00
fancy
fancylou@outlook.com
https://gitcode.net/O2OA/o2oa-flutter/-/commit/eb3ef9227e97b8f3e9f01b097f8b4d741a3b4a6f
8.3.7
2024-04-08T17:05:15+08:00
fancy
fancylou@outlook.com
隐藏空白更改
内联
并排
Showing
9 changed file
with
193 addition
and
29 deletion
+193
-29
lib/common/api/x_program_center.dart
lib/common/api/x_program_center.dart
+9
-0
lib/common/models/server/app_style.dart
lib/common/models/server/app_style.dart
+23
-3
lib/common/utils/event_bus.dart
lib/common/utils/event_bus.dart
+2
-2
lib/common/utils/javascript_handler.dart
lib/common/utils/javascript_handler.dart
+83
-1
lib/pages/common/portal/controller.dart
lib/pages/common/portal/controller.dart
+3
-3
lib/pages/home/controller.dart
lib/pages/home/controller.dart
+2
-11
lib/pages/home/settings/my_profile/controller.dart
lib/pages/home/settings/my_profile/controller.dart
+2
-0
lib/pages/home/view.dart
lib/pages/home/view.dart
+68
-8
pubspec.yaml
pubspec.yaml
+1
-1
未找到文件。
lib/common/api/x_program_center.dart
浏览文件 @
eb3ef922
...
...
@@ -254,6 +254,15 @@ class ProgramCenterService extends GetxService {
return
{};
}
/// 首页tab 门户 扩展参数
ExtendParamHomeTabPortal
?
getExtendParamHomeTabPortal
(
String
key
)
{
final
p
=
extendParam
();
if
(
p
[
key
]
!=
null
)
{
return
ExtendParamHomeTabPortal
.
fromJson
(
p
[
key
]);
}
return
null
;
}
/// 首页居中,如果居中页面个数就固定了 5 个。appIndexPages无效了
bool
isIndexCentered
()
{
if
(
appStyle
!=
null
)
{
...
...
lib/common/models/server/app_style.dart
浏览文件 @
eb3ef922
...
...
@@ -89,6 +89,28 @@ class AppStyle {
};
}
class
ExtendParamHomeTabPortal
{
String
?
portalId
;
bool
?
hiddenAppBar
;
String
?
appBarTitle
;
ExtendParamHomeTabPortal
({
this
.
portalId
,
this
.
hiddenAppBar
,
this
.
appBarTitle
});
factory
ExtendParamHomeTabPortal
.
fromJson
(
Map
<
String
,
dynamic
>
json
)
=>
ExtendParamHomeTabPortal
(
portalId:
json
[
"portalId"
],
hiddenAppBar:
json
[
"hiddenAppBar"
],
appBarTitle:
json
[
"appBarTitle"
],
);
Map
<
String
,
dynamic
>
toJson
()
=>
{
"portalId"
:
portalId
,
"hiddenAppBar"
:
hiddenAppBar
,
"appBarTitle"
:
appBarTitle
,
};
}
class
AppStyleImage
{
AppStyleImage
({
this
.
name
,
...
...
@@ -260,9 +282,7 @@ class EnumValues<T> {
EnumValues
(
this
.
map
);
Map
<
T
,
String
>
get
reverse
{
if
(
reverseMap
==
null
)
{
reverseMap
=
map
.
map
((
k
,
v
)
=>
MapEntry
(
v
,
k
));
}
reverseMap
??=
map
.
map
((
k
,
v
)
=>
MapEntry
(
v
,
k
));
return
reverseMap
!;
}
}
lib/common/utils/event_bus.dart
浏览文件 @
eb3ef922
...
...
@@ -3,8 +3,8 @@ typedef EventCallback = void Function(dynamic arg);
class
EventBus
{
//
home 双击底部导航栏按钮
static
const
homeNavItemMsg
=
"homeNavItem
Msg"
;
//
刷新门户事件
static
const
refreshPortalMsg
=
"refreshPortal
Msg"
;
// im消息
static
const
websocketCreateImMsg
=
"websocketCreateImMsg"
;
static
const
websocketRevokeImMsg
=
"websocketRevokeImMsg"
;
...
...
lib/common/utils/javascript_handler.dart
浏览文件 @
eb3ef922
import
'dart:convert'
;
import
'dart:io'
;
import
'package:app_settings/app_settings.dart'
;
import
'package:device_info_plus/device_info_plus.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/services.dart'
;
...
...
@@ -171,12 +172,33 @@ class O2JavascriptHandler {
case
'navigation.share'
:
_share
(
jsMessage
);
break
;
case
'settings.openMyProfile'
:
_settingOpenMyProfile
(
jsMessage
);
break
;
case
'settings.safeAndAccount'
:
_settingOpenSafeAndAccount
(
jsMessage
);
break
;
case
'settings.skin'
:
_settingOpenAppSkin
(
jsMessage
);
break
;
case
'settings.notice'
:
_settingOpenAppNotice
(
jsMessage
);
break
;
case
'settings.common'
:
_settingOpenAppCommon
(
jsMessage
);
break
;
case
'settings.about'
:
_settingOpenAppAbout
(
jsMessage
);
break
;
case
'settings.logout'
:
_settingLogout
(
jsMessage
);
break
;
default
:
OLogger
.
e
(
'错误的类型
${jsMessage.type}
'
);
break
;
}
}
/// o2mNotification 模块处理
_notification
(
String
msg
)
{
OLogger
.
d
(
"执行 Notification , 命令:
$msg
"
);
...
...
@@ -1019,4 +1041,64 @@ class O2JavascriptHandler {
}
}
}
/// 打开我的页面
_settingOpenMyProfile
(
JsMessage
jsMessage
)
async
{
final
callback
=
jsMessage
.
callback
??
''
;
Get
.
toNamed
(
O2OARoutes
.
homeSettingsMyProfile
);
if
(
callback
.
isNotEmpty
)
{
webviewController
?.
evaluateJavascript
(
source
:
'
$callback
()'
);
}
}
_settingOpenSafeAndAccount
(
JsMessage
jsMessage
)
async
{
final
callback
=
jsMessage
.
callback
??
''
;
Get
.
toNamed
(
O2OARoutes
.
homeSettingsAccountSafe
);
if
(
callback
.
isNotEmpty
)
{
webviewController
?.
evaluateJavascript
(
source
:
'
$callback
()'
);
}
}
_settingOpenAppSkin
(
JsMessage
jsMessage
)
async
{
final
callback
=
jsMessage
.
callback
??
''
;
Get
.
toNamed
(
O2OARoutes
.
homeSettingsSkin
);
if
(
callback
.
isNotEmpty
)
{
webviewController
?.
evaluateJavascript
(
source
:
'
$callback
()'
);
}
}
_settingOpenAppNotice
(
JsMessage
jsMessage
)
async
{
final
callback
=
jsMessage
.
callback
??
''
;
if
(
GetPlatform
.
isMobile
)
{
AppSettings
.
openNotificationSettings
();
}
if
(
callback
.
isNotEmpty
)
{
webviewController
?.
evaluateJavascript
(
source
:
'
$callback
()'
);
}
}
_settingOpenAppCommon
(
JsMessage
jsMessage
)
async
{
final
callback
=
jsMessage
.
callback
??
''
;
Get
.
toNamed
(
O2OARoutes
.
homeSettingsCommon
);
if
(
callback
.
isNotEmpty
)
{
webviewController
?.
evaluateJavascript
(
source
:
'
$callback
()'
);
}
}
_settingOpenAppAbout
(
JsMessage
jsMessage
)
async
{
final
callback
=
jsMessage
.
callback
??
''
;
Get
.
toNamed
(
O2OARoutes
.
homeSettingsAbout
);
if
(
callback
.
isNotEmpty
)
{
webviewController
?.
evaluateJavascript
(
source
:
'
$callback
()'
);
}
}
_settingLogout
(
JsMessage
jsMessage
)
async
{
final
callback
=
jsMessage
.
callback
??
''
;
O2Utils
.
logout
();
if
(
callback
.
isNotEmpty
)
{
webviewController
?.
evaluateJavascript
(
source
:
'
$callback
()'
);
}
}
}
lib/pages/common/portal/controller.dart
浏览文件 @
eb3ef922
...
...
@@ -83,9 +83,9 @@ class PortalController extends GetxController implements JsNavigationInterface {
_refreshPage
();
OLogger
.
d
(
'流程工作文档 关闭后刷新portal页面。。。。。'
);
});
_eventBus
.
on
(
EventBus
.
homeNavItem
Msg
,
_eventId
,
(
arg
)
{
_eventBus
.
on
(
EventBus
.
refreshPortal
Msg
,
_eventId
,
(
arg
)
{
_refreshPage
();
OLogger
.
d
(
'
首页双击刷新!!!!
'
);
OLogger
.
d
(
'
刷新门户,
$arg
'
);
});
super
.
onReady
();
...
...
@@ -96,7 +96,7 @@ class PortalController extends GetxController implements JsNavigationInterface {
void
onClose
()
{
_eventBus
.
off
(
EventBus
.
cmsDocumentCloseMsg
,
_eventId
);
_eventBus
.
off
(
EventBus
.
processWorkCloseMsg
,
_eventId
);
_eventBus
.
off
(
EventBus
.
homeNavItem
Msg
,
_eventId
);
_eventBus
.
off
(
EventBus
.
refreshPortal
Msg
,
_eventId
);
super
.
onClose
();
}
...
...
lib/pages/home/controller.dart
浏览文件 @
eb3ef922
...
...
@@ -132,23 +132,14 @@ class HomeController extends GetxController with WidgetsBindingObserver {
/// 点击底部菜单
void
handleNavBarClick
(
int
index
)
{
if
(
state
.
currentIndex
==
index
)
{
// 重复点击 发送事件消息
eventBus
.
emit
(
EventBus
.
homeNavItem
Msg
,
state
.
homeTabList
[
index
]);
if
(
state
.
currentIndex
==
index
)
{
// 重复点击 发送
刷新
事件消息
eventBus
.
emit
(
EventBus
.
refreshPortal
Msg
,
state
.
homeTabList
[
index
]);
return
;
}
state
.
currentIndex
=
index
;
pageController
.
jumpToPage
(
index
);
}
// /// 双击底部菜单
// void handleNavBarDoubleClick(int index) {
// if (state.currentIndex != index) {
// return;
// }
// eventBus.emit(EventBus.homeNavItemMsg, state.homeTabList[index]);
// OLogger.d('双击 $index');
// }
/// 在 widget 内存中分配后立即调用。
@override
void
onInit
()
{
...
...
lib/pages/home/settings/my_profile/controller.dart
浏览文件 @
eb3ef922
...
...
@@ -135,10 +135,12 @@ class MyProfileController extends GetxController {
/// 刷新设置页面的签名
void
_emitToUpdateSignature
()
{
eventBus
.
emit
(
EventBus
.
mySignatureUpdateMsg
,
'signature'
);
eventBus
.
emit
(
EventBus
.
refreshPortalMsg
,
'signature'
);
}
/// 刷新设置页面的头像
void
_emitToUpdateAvatar
()
{
eventBus
.
emit
(
EventBus
.
avatarUpdateMsg
,
'avatarUpdateMsg'
);
eventBus
.
emit
(
EventBus
.
refreshPortalMsg
,
'avatarUpdateMsg'
);
}
...
...
lib/pages/home/view.dart
浏览文件 @
eb3ef922
...
...
@@ -202,14 +202,44 @@ class HomePage extends GetView<HomeController> {
/// 应用页面
Widget
_appsPageView
()
{
AppsBinding
().
dependencies
();
return
const
AppsPage
();
final
portal
=
ProgramCenterService
.
to
.
getExtendParamHomeTabPortal
(
'appTabPortal'
);
if
(
portal
!=
null
&&
portal
.
portalId
?.
isNotEmpty
==
true
)
{
final
portalId
=
portal
.
portalId
!;
final
hiddenAppBar
=
portal
.
hiddenAppBar
??
false
;
final
appBarTitle
=
portal
.
appBarTitle
??
'home_tab_apps'
.
tr
;
Get
.
lazyPut
<
PortalController
>(
()
=>
PortalController
(
initMap:
{
"portalId"
:
portalId
,
"hiddenAppBar"
:
hiddenAppBar
,
"title"
:
appBarTitle
}),
tag:
'app_tag_
$portalId
'
);
return
PortalPage
(
tag:
'app_tag_
$portalId
'
);
}
else
{
AppsBinding
().
dependencies
();
return
const
AppsPage
();
}
}
/// 通讯录页面
Widget
_contactPageView
()
{
ContactBinding
().
dependencies
();
return
const
ContactPage
();
final
portal
=
ProgramCenterService
.
to
.
getExtendParamHomeTabPortal
(
'contactTabPortal'
);
if
(
portal
!=
null
&&
portal
.
portalId
?.
isNotEmpty
==
true
)
{
final
portalId
=
portal
.
portalId
!;
final
hiddenAppBar
=
portal
.
hiddenAppBar
??
false
;
final
appBarTitle
=
portal
.
appBarTitle
??
'home_tab_contact'
.
tr
;
Get
.
lazyPut
<
PortalController
>(
()
=>
PortalController
(
initMap:
{
"portalId"
:
portalId
,
"hiddenAppBar"
:
hiddenAppBar
,
"title"
:
appBarTitle
}),
tag:
'app_tag_
$portalId
'
);
return
PortalPage
(
tag:
'app_tag_
$portalId
'
);
}
else
{
ContactBinding
().
dependencies
();
return
const
ContactPage
();
}
}
/// 首页
...
...
@@ -237,13 +267,43 @@ class HomePage extends GetView<HomeController> {
/// 消息页面
Widget
_imPageView
()
{
ImBinding
().
dependencies
();
return
const
ImPage
();
final
portal
=
ProgramCenterService
.
to
.
getExtendParamHomeTabPortal
(
'imTabPortal'
);
if
(
portal
!=
null
&&
portal
.
portalId
?.
isNotEmpty
==
true
)
{
final
portalId
=
portal
.
portalId
!;
final
hiddenAppBar
=
portal
.
hiddenAppBar
??
false
;
final
appBarTitle
=
portal
.
appBarTitle
??
'home_tab_im'
.
tr
;
Get
.
lazyPut
<
PortalController
>(
()
=>
PortalController
(
initMap:
{
"portalId"
:
portalId
,
"hiddenAppBar"
:
hiddenAppBar
,
"title"
:
appBarTitle
}),
tag:
'app_tag_
$portalId
'
);
return
PortalPage
(
tag:
'app_tag_
$portalId
'
);
}
else
{
ImBinding
().
dependencies
();
return
const
ImPage
();
}
}
/// 设置页面
Widget
_settingsPageView
()
{
SettingsBinding
().
dependencies
();
return
const
SettingsPage
();
final
portal
=
ProgramCenterService
.
to
.
getExtendParamHomeTabPortal
(
'settingsTabPortal'
);
if
(
portal
!=
null
&&
portal
.
portalId
?.
isNotEmpty
==
true
)
{
final
portalId
=
portal
.
portalId
!;
final
hiddenAppBar
=
portal
.
hiddenAppBar
??
false
;
final
appBarTitle
=
portal
.
appBarTitle
??
'home_tab_settings'
.
tr
;
Get
.
lazyPut
<
PortalController
>(
()
=>
PortalController
(
initMap:
{
"portalId"
:
portalId
,
"hiddenAppBar"
:
hiddenAppBar
,
"title"
:
appBarTitle
}),
tag:
'app_tag_
$portalId
'
);
return
PortalPage
(
tag:
'app_tag_
$portalId
'
);
}
else
{
SettingsBinding
().
dependencies
();
return
const
SettingsPage
();
}
}
}
pubspec.yaml
浏览文件 @
eb3ef922
...
...
@@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version
:
8.3.
6+336
version
:
8.3.
7+337
environment
:
sdk
:
"
>=3.0.0
<
4.0.0"
...
...