Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
T
TrainSys
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
苏州培训方案
TrainSys
提交
9ce561db
提交
9ce561db
编写于
6月 16, 2023
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhujiamin 发布系统代码 [TrainSys,网页端]
上级
cedbc94f
变更
4
展开全部
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
149 行增加
和
84 行删除
+149
-84
package.json
app_Web/package.json
+7
-7
pnpm-lock.yaml
app_Web/pnpm-lock.yaml
+41
-41
app-menu.tsx
app_Web/src/components/widgets/app-menu/app-menu.tsx
+73
-8
yarn.lock
app_Web/yarn.lock
+28
-28
未找到文件。
app_Web/package.json
浏览文件 @
9ce561db
...
@@ -13,13 +13,13 @@
...
@@ -13,13 +13,13 @@
"dependencies"
:
{
"dependencies"
:
{
"@floating-ui/dom"
:
"^1.0.11"
,
"@floating-ui/dom"
:
"^1.0.11"
,
"@ibiz-template/command"
:
"^0.0.1-beta.50"
,
"@ibiz-template/command"
:
"^0.0.1-beta.50"
,
"@ibiz-template/controller"
:
"^0.0.1-beta.8
1
"
,
"@ibiz-template/controller"
:
"^0.0.1-beta.8
2
"
,
"@ibiz-template/core"
:
"^0.0.1-beta.8
1
"
,
"@ibiz-template/core"
:
"^0.0.1-beta.8
2
"
,
"@ibiz-template/model"
:
"^0.0.1-beta.8
1
"
,
"@ibiz-template/model"
:
"^0.0.1-beta.8
2
"
,
"@ibiz-template/runtime"
:
"^0.0.1-beta.8
1
"
,
"@ibiz-template/runtime"
:
"^0.0.1-beta.8
2
"
,
"@ibiz-template/service"
:
"^0.0.1-beta.8
1
"
,
"@ibiz-template/service"
:
"^0.0.1-beta.8
2
"
,
"@ibiz-template/theme"
:
"^0.0.1-beta.8
1
"
,
"@ibiz-template/theme"
:
"^0.0.1-beta.8
2
"
,
"@ibiz-template/vue-util"
:
"^0.0.1-beta.8
1
"
,
"@ibiz-template/vue-util"
:
"^0.0.1-beta.8
2
"
,
"@ibiz/dynamic-model-api"
:
"^2.1.17"
,
"@ibiz/dynamic-model-api"
:
"^2.1.17"
,
"@riophae/vue-treeselect"
:
"^0.4.0"
,
"@riophae/vue-treeselect"
:
"^0.4.0"
,
"dayjs"
:
"^1.11.7"
,
"dayjs"
:
"^1.11.7"
,
...
...
app_Web/pnpm-lock.yaml
浏览文件 @
9ce561db
此差异已折叠。
点击以展开。
app_Web/src/components/widgets/app-menu/app-menu.tsx
浏览文件 @
9ce561db
...
@@ -13,6 +13,7 @@ import {
...
@@ -13,6 +13,7 @@ import {
defineComponent
,
defineComponent
,
getCurrentInstance
,
getCurrentInstance
,
onMounted
,
onMounted
,
onUnmounted
,
PropType
,
PropType
,
Ref
,
Ref
,
ref
,
ref
,
...
@@ -20,6 +21,7 @@ import {
...
@@ -20,6 +21,7 @@ import {
}
from
'vue'
;
}
from
'vue'
;
import
{
AppMenuController
}
from
'@ibiz-template/controller'
;
import
{
AppMenuController
}
from
'@ibiz-template/controller'
;
import
'@ibiz-template/theme/style/components/widgets/app-menu/app-menu.scss'
;
import
'@ibiz-template/theme/style/components/widgets/app-menu/app-menu.scss'
;
import
{
AppCounter
,
CounterService
}
from
'@ibiz-template/service'
;
/**
/**
* 递归生成菜单数据,递给 antd 的 Menu 组件
* 递归生成菜单数据,递给 antd 的 Menu 组件
*
*
...
@@ -34,6 +36,7 @@ function getMenus(items: AppMenuItemModel[]): IData[] {
...
@@ -34,6 +36,7 @@ function getMenus(items: AppMenuItemModel[]): IData[] {
key
:
item
.
source
.
id
,
key
:
item
.
source
.
id
,
label
:
item
.
label
,
label
:
item
.
label
,
image
:
item
.
image
,
image
:
item
.
image
,
counterId
:
item
.
counterId
,
};
};
if
(
item
.
children
)
{
if
(
item
.
children
)
{
data
.
children
=
getMenus
(
item
.
children
);
data
.
children
=
getMenus
(
item
.
children
);
...
@@ -54,6 +57,7 @@ function renderMenuItem(
...
@@ -54,6 +57,7 @@ function renderMenuItem(
collapseChange
:
boolean
,
collapseChange
:
boolean
,
ns
:
Namespace
,
ns
:
Namespace
,
c
:
AppMenuController
,
c
:
AppMenuController
,
counterData
:
IData
,
)
{
)
{
if
(
!
c
.
menuItemsState
[
menu
.
key
].
visible
)
{
if
(
!
c
.
menuItemsState
[
menu
.
key
].
visible
)
{
return
;
return
;
...
@@ -62,6 +66,12 @@ function renderMenuItem(
...
@@ -62,6 +66,12 @@ function renderMenuItem(
<
i
-
menu
-
item
class=
{
ns
.
e
(
'item'
)
}
name=
{
menu
.
key
}
>
<
i
-
menu
-
item
class=
{
ns
.
e
(
'item'
)
}
name=
{
menu
.
key
}
>
<
app
-
icon
class=
{
ns
.
e
(
'icon'
)
}
icon=
{
menu
.
image
}
></
app
-
icon
>
<
app
-
icon
class=
{
ns
.
e
(
'icon'
)
}
icon=
{
menu
.
image
}
></
app
-
icon
>
{
menu
.
label
}
{
menu
.
label
}
{
typeof
counterData
[
menu
.
counterId
]
===
'number'
?
(
<
i
-
badge
class=
{
ns
.
e
(
'counter'
)
}
count=
{
counterData
[
menu
.
counterId
]
}
></
i
-
badge
>
)
:
null
}
</
i
-
menu
-
item
>
</
i
-
menu
-
item
>
)
:
(
)
:
(
<
i
-
tooltip
<
i
-
tooltip
...
@@ -73,6 +83,12 @@ function renderMenuItem(
...
@@ -73,6 +83,12 @@ function renderMenuItem(
<
i
-
menu
-
item
class=
{
ns
.
e
(
'item'
)
}
name=
{
menu
.
key
}
>
<
i
-
menu
-
item
class=
{
ns
.
e
(
'item'
)
}
name=
{
menu
.
key
}
>
<
app
-
icon
class=
{
ns
.
e
(
'icon'
)
}
icon=
{
menu
.
image
}
></
app
-
icon
>
<
app
-
icon
class=
{
ns
.
e
(
'icon'
)
}
icon=
{
menu
.
image
}
></
app
-
icon
>
{
!
menu
.
image
?
menu
.
label
.
slice
(
0
,
1
)
:
null
}
{
!
menu
.
image
?
menu
.
label
.
slice
(
0
,
1
)
:
null
}
{
typeof
counterData
[
menu
.
counterId
]
===
'number'
?
(
<
i
-
badge
class=
{
ns
.
e
(
'counter'
)
}
count=
{
counterData
[
menu
.
counterId
]
}
></
i
-
badge
>
)
:
null
}
</
i
-
menu
-
item
>
</
i
-
menu
-
item
>
</
i
-
tooltip
>
</
i
-
tooltip
>
);
);
...
@@ -90,13 +106,22 @@ function renderDropDownMenuItem(
...
@@ -90,13 +106,22 @@ function renderDropDownMenuItem(
collapseChange
:
boolean
,
collapseChange
:
boolean
,
ns
:
Namespace
,
ns
:
Namespace
,
c
:
AppMenuController
,
c
:
AppMenuController
,
counterData
:
IData
,
)
{
)
{
if
(
!
c
.
menuItemsState
[
menu
.
key
].
visible
)
{
if
(
!
c
.
menuItemsState
[
menu
.
key
].
visible
)
{
return
;
return
;
}
}
return
(
return
(
<
i
-
dropdown
-
item
class=
{
ns
.
be
(
'submenu'
,
'item'
)
}
name=
{
menu
.
key
}
>
<
i
-
dropdown
-
item
class=
{
ns
.
be
(
'submenu'
,
'item'
)
}
name=
{
menu
.
key
}
>
<
i
-
menu
-
item
name=
{
menu
.
key
}
>
{
menu
.
label
}
</
i
-
menu
-
item
>
<
i
-
menu
-
item
name=
{
menu
.
key
}
>
{
menu
.
label
}
{
typeof
counterData
[
menu
.
counterId
]
===
'number'
?
(
<
i
-
badge
class=
{
ns
.
e
(
'counter'
)
}
count=
{
counterData
[
menu
.
counterId
]
}
></
i
-
badge
>
)
:
null
}
</
i
-
menu
-
item
>
</
i
-
dropdown
-
item
>
</
i
-
dropdown
-
item
>
);
);
}
}
...
@@ -114,6 +139,7 @@ function renderSubmenu(
...
@@ -114,6 +139,7 @@ function renderSubmenu(
collapseChange
:
boolean
,
collapseChange
:
boolean
,
ns
:
Namespace
,
ns
:
Namespace
,
c
:
AppMenuController
,
c
:
AppMenuController
,
counterData
:
IData
,
)
{
)
{
if
(
!
c
.
menuItemsState
[
subMenu
.
key
].
visible
)
{
if
(
!
c
.
menuItemsState
[
subMenu
.
key
].
visible
)
{
return
;
return
;
...
@@ -126,9 +152,9 @@ function renderSubmenu(
...
@@ -126,9 +152,9 @@ function renderSubmenu(
</
template
>
</
template
>
{
subMenu
.
children
.
map
((
item
:
IData
)
=>
{
{
subMenu
.
children
.
map
((
item
:
IData
)
=>
{
if
(
item
.
children
)
{
if
(
item
.
children
)
{
return
renderSubmenu
(
false
,
item
,
collapseChange
,
ns
,
c
);
return
renderSubmenu
(
false
,
item
,
collapseChange
,
ns
,
c
,
counterData
);
}
}
return
renderMenuItem
(
item
,
collapseChange
,
ns
,
c
);
return
renderMenuItem
(
item
,
collapseChange
,
ns
,
c
,
counterData
);
})
}
})
}
</
i
-
submenu
>
</
i
-
submenu
>
)
:
(
)
:
(
...
@@ -148,9 +174,22 @@ function renderSubmenu(
...
@@ -148,9 +174,22 @@ function renderSubmenu(
<
i
-
dropdown
-
menu
class=
{
ns
.
be
(
'submenu'
,
'list'
)
}
slot=
'list'
>
<
i
-
dropdown
-
menu
class=
{
ns
.
be
(
'submenu'
,
'list'
)
}
slot=
'list'
>
{
subMenu
.
children
.
map
((
item
:
IData
)
=>
{
{
subMenu
.
children
.
map
((
item
:
IData
)
=>
{
if
(
item
.
children
)
{
if
(
item
.
children
)
{
return
renderSubmenu
(
false
,
item
,
collapseChange
,
ns
,
c
);
return
renderSubmenu
(
false
,
item
,
collapseChange
,
ns
,
c
,
counterData
,
);
}
}
return
renderDropDownMenuItem
(
item
,
collapseChange
,
ns
,
c
);
return
renderDropDownMenuItem
(
item
,
collapseChange
,
ns
,
c
,
counterData
,
);
})
}
})
}
</
i
-
dropdown
-
menu
>
</
i
-
dropdown
-
menu
>
</
i
-
dropdown
>
</
i
-
dropdown
>
...
@@ -175,6 +214,9 @@ export const AppMenu = defineComponent({
...
@@ -175,6 +214,9 @@ export const AppMenu = defineComponent({
const
defaultOpens
:
Ref
<
string
[]
>
=
ref
([]);
const
defaultOpens
:
Ref
<
string
[]
>
=
ref
([]);
// 路由对象
// 路由对象
const
route
=
proxy
.
$route
;
const
route
=
proxy
.
$route
;
// 计数器数据
let
counter
:
AppCounter
|
null
=
null
;
const
counterData
=
ref
<
IData
>
({});
c
.
nerve
.
self
.
evt
.
on
(
'created'
,
()
=>
{
c
.
nerve
.
self
.
evt
.
on
(
'created'
,
()
=>
{
menus
.
value
=
getMenus
(
c
.
model
.
items
);
menus
.
value
=
getMenus
(
c
.
model
.
items
);
...
@@ -261,7 +303,7 @@ export const AppMenu = defineComponent({
...
@@ -261,7 +303,7 @@ export const AppMenu = defineComponent({
},
},
);
);
onMounted
(()
=>
{
onMounted
(
async
()
=>
{
// 默认激活的菜单项
// 默认激活的菜单项
const
defaultActiveMenuItem
=
c
.
model
.
allItems
.
find
(
item
=>
{
const
defaultActiveMenuItem
=
c
.
model
.
allItems
.
find
(
item
=>
{
return
(
return
(
...
@@ -286,9 +328,25 @@ export const AppMenu = defineComponent({
...
@@ -286,9 +328,25 @@ export const AppMenu = defineComponent({
});
});
}
}
updateMenu
();
updateMenu
();
// 计数器相关
const
CounterRef
=
c
.
model
.
source
.
getPSAppCounterRef
();
if
(
CounterRef
)
{
counter
=
await
CounterService
.
getCounterByRef
(
CounterRef
,
props
.
context
,
);
counter
.
onChange
(
data
=>
{
counterData
.
value
=
data
;
});
}
});
onUnmounted
(()
=>
{
counter
?.
destroy
();
});
});
return
{
menus
,
c
,
onClick
,
ns
,
defaultActive
,
defaultOpens
};
return
{
menus
,
c
,
onClick
,
ns
,
defaultActive
,
defaultOpens
,
counterData
};
},
},
render
()
{
render
()
{
return
(
return
(
...
@@ -309,9 +367,16 @@ export const AppMenu = defineComponent({
...
@@ -309,9 +367,16 @@ export const AppMenu = defineComponent({
this
.
collapseChange
,
this
.
collapseChange
,
this
.
ns
,
this
.
ns
,
this
.
c
,
this
.
c
,
this
.
counterData
,
);
);
}
}
return
renderMenuItem
(
item
,
this
.
collapseChange
,
this
.
ns
,
this
.
c
);
return
renderMenuItem
(
item
,
this
.
collapseChange
,
this
.
ns
,
this
.
c
,
this
.
counterData
,
);
})
}
})
}
</
i
-
menu
>
</
i
-
menu
>
);
);
...
...
app_Web/yarn.lock
浏览文件 @
9ce561db
...
@@ -651,54 +651,54 @@
...
@@ -651,54 +651,54 @@
dependencies:
dependencies:
qx-util "^0.4.8"
qx-util "^0.4.8"
"@ibiz-template/controller@^0.0.1-beta.8
1
":
"@ibiz-template/controller@^0.0.1-beta.8
2
":
version "0.0.1-beta.8
1
"
version "0.0.1-beta.8
2
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/controller/-/controller-0.0.1-beta.8
1.tgz#5fc9aa0d6f93395565c47dc916b3abcfa61b63b5
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/controller/-/controller-0.0.1-beta.8
2.tgz#593a0efd887db6f923e245d279dddf4cf8baf6ca
"
integrity sha512-
b8p9ud5F+aX0n/5gcHLROa+u9GgTmgqmJiIbV/1noRQrnlNWoPkWCC3ImxYPtNDT1dMxEsYoI4lymIbNi9yDE
g==
integrity sha512-
Eo/ja4bFBz8i+aatC6wkQiMiYkTEmpu+aGqvq3XIJs0q0H3b5epMsspYWI4vu/o1u2Qmb8dkLsXKU29QRDdT5
g==
dependencies:
dependencies:
async-validator "^4.2.5"
async-validator "^4.2.5"
dayjs "^1.11.5"
dayjs "^1.11.5"
"@ibiz-template/core@^0.0.1-beta.8
1
":
"@ibiz-template/core@^0.0.1-beta.8
2
":
version "0.0.1-beta.8
1
"
version "0.0.1-beta.8
2
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/core/-/core-0.0.1-beta.8
1.tgz#729646bb0211520fc418c0c17435fce84268ac1e
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/core/-/core-0.0.1-beta.8
2.tgz#9ee90429b3100b462f43900001a28988446604f4
"
integrity sha512-
P/vhtmEJd1vE92KJZeAHPPvaFoHI9Cl/hVatcQhU5o/mgXJHCjkB4wgMDqGPaJMyI7LQodw3MT6Fs3+9M3jz0w
==
integrity sha512-
WnPe2FBZ5DUhrhVoI6JrhSl6sjkGLVn/7OVj0g4dmp1DhXwoOrbWjW+Ogr/p7kSV/LyRC4g1sRXk/tb9V4dPAA
==
dependencies:
dependencies:
axios "^1.2.1"
axios "^1.2.1"
loglevel "^1.8.0"
loglevel "^1.8.0"
pluralize "^8.0.0"
pluralize "^8.0.0"
qs "^6.11.0"
qs "^6.11.0"
"@ibiz-template/model@^0.0.1-beta.8
1
":
"@ibiz-template/model@^0.0.1-beta.8
2
":
version "0.0.1-beta.8
1
"
version "0.0.1-beta.8
2
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/model/-/model-0.0.1-beta.8
1.tgz#64d528dcf0f6fc220e647d3eae4e052b6179428c
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/model/-/model-0.0.1-beta.8
2.tgz#3bebf980965d237da02251d3181c1bafbe467d2a
"
integrity sha512-
Dj90m2Pn7FirAH8Na2/2Hd89hVl0qZw8id8I/qu7y7x1tQDeOLN6D80mbwrbCUsxgyg7niWyk3i/SP3EB0giiQ
==
integrity sha512-
Zn8pvpi/fq8qo1p/0NjMmu0D7nojCH3EAjifybdLe/+h700UTT0bfPOI6vlk8csVkYgkzI8Ds/RC6kb+EcDhXw
==
dependencies:
dependencies:
"@ibiz/dynamic-model-api" "^2.1.17"
"@ibiz/dynamic-model-api" "^2.1.17"
pluralize "^8.0.0"
pluralize "^8.0.0"
"@ibiz-template/runtime@^0.0.1-beta.8
1
":
"@ibiz-template/runtime@^0.0.1-beta.8
2
":
version "0.0.1-beta.8
1
"
version "0.0.1-beta.8
2
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/runtime/-/runtime-0.0.1-beta.8
1.tgz#3d229d13187d613c9a43255e85b084543b4bc10
a"
resolved "http://npm.zhr.icu:4873/@ibiz-template/runtime/-/runtime-0.0.1-beta.8
2.tgz#b0591f99ae6c77946f885695304468cce29af23
a"
integrity sha512-
sRIOZfPz54VgPT04tzQ08RNdkEGDegfzLiwJu4ig9JvZTKECKmZLACbPS8wtKA/0kau5vLA6cQWKZTvcufN9E
g==
integrity sha512-
Tx50eIcsliwh0x4C1DIjY4VEu8gmXFzmfDxVQxA9oWyB+I3sQA0Cn+G87NjgCnDWWQsV/iGXnC9430hO4X264
g==
dependencies:
dependencies:
"@ibiz-template/command" "^0.0.1-beta.50"
"@ibiz-template/command" "^0.0.1-beta.50"
qs "^6.11.0"
qs "^6.11.0"
"@ibiz-template/service@^0.0.1-beta.8
1
":
"@ibiz-template/service@^0.0.1-beta.8
2
":
version "0.0.1-beta.8
1
"
version "0.0.1-beta.8
2
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/service/-/service-0.0.1-beta.8
1.tgz#e5ab0c19976a24689385dbcb3d5d01f496069cd3
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/service/-/service-0.0.1-beta.8
2.tgz#f55458d818cbfb3691444f718e10c8486322e7ea
"
integrity sha512-
0BY0Jv99KsZV00PHcPSvMkMYn0fRCFLUKfLTq6bFvjwjXykJCft1KVHA4acXHVJCgRlv9c0az36AN14QwhE5iw
==
integrity sha512-
gd5Okom1MwfTClItV4ekECu6bPZq3HV3fsfmM/R6Qe6KD4VDEqwORca8r1VRYP1eE1s/mTonXnoyy154vC9aIg
==
"@ibiz-template/theme@^0.0.1-beta.8
1
":
"@ibiz-template/theme@^0.0.1-beta.8
2
":
version "0.0.1-beta.8
1
"
version "0.0.1-beta.8
2
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/theme/-/theme-0.0.1-beta.8
1.tgz#1b79592c345956c37a5fd5ca85ba0e80832c3400
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/theme/-/theme-0.0.1-beta.8
2.tgz#e3ec9371d833ddc79d0b2cff43fe2ba15bc8ff97
"
integrity sha512-
ulgZQ0VoUCZmLvbd+ihxg9GgdKEjQT321jOxrQDyX5cCen4VQfFkSlvitj3az7IOYDVgEp0+zXuTQfo0z9CQHw
==
integrity sha512-
PAvZkfgtD+AVSIXaLywhhpErMbW6eRkcBGnJIdlQSj52C3dgRgXkDkRW9DTRPInntMTe4LGUMMytYdjV4216QA
==
"@ibiz-template/vue-util@^0.0.1-beta.8
1
":
"@ibiz-template/vue-util@^0.0.1-beta.8
2
":
version "0.0.1-beta.8
1
"
version "0.0.1-beta.8
2
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/vue-util/-/vue-util-0.0.1-beta.8
1.tgz#bd0faed3bc60a7c616e52ced40d38a5649472aca
"
resolved "http://npm.zhr.icu:4873/@ibiz-template/vue-util/-/vue-util-0.0.1-beta.8
2.tgz#cd8bf58d5c5d836d64d610d44612cfa868f36541
"
integrity sha512-
IAfDtDbLIvIxSJ35wb5xEX3cM4BaPYy3ScRikGqEs+4SwJJ/l2pTQJxPXS5v6Nvez4+D/RnaMfzvnmICStG7Wg
==
integrity sha512-
L2IqYp/LQCPLpi5N870l+1phRQKXx2flxEObyKON0HtoBSvh99HrYPsJJb1AtrOEIagVVVVGBSLVx+cnIb7Bjw
==
"@ibiz/dynamic-model-api@^2.1.17":
"@ibiz/dynamic-model-api@^2.1.17":
version "2.1.17"
version "2.1.17"
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录