修改样式
Some checks are pending
Gallery App Build / macOS (push) Waiting to run
Gallery App Build / Windows (push) Waiting to run
Gallery App Build / Ubuntu (push) Waiting to run

This commit is contained in:
yxdy 2025-03-07 16:23:09 +08:00
parent aa9180d289
commit ff15075c79
148 changed files with 7171 additions and 566 deletions

View File

@ -12,13 +12,14 @@ Item{
property var dotSize: Qt.size(6,6)
property bool showZero: false
property int count: 0
property color tcolor: Colors.white
property color color: control.accentColor.defaultBrushFor(control.FluentUI.dark)
implicitHeight: dot ? rect_dot.height : label_count.height
implicitWidth: dot ? rect_dot.width : label_count.width
Label {
id: label_count
font: Typography.caption
color: Colors.white
color: tcolor
leftPadding: 2
rightPadding: 2
topPadding: 0

View File

@ -47,6 +47,7 @@ Item{
property alias selectionModel: selected_items
signal rowClicked(var model)
signal rowRightClicked(var model)
property Component cellBackground: Component{
Rectangle{
color: {

View File

@ -165,6 +165,68 @@ set(RESOURCES_FILES
res/image/icons/gc.png
res/image/icons/mime.png
res/image/antlogo.png
res/image/components/rect.png
res/image/components/down.png
res/image/icons/point.png
res/image/icons/circle.png
res/image/icons/curve.png
res/image/icons/ellipse.png
res/image/icons/free_area.png
res/image/icons/free_line.png
res/image/icons/polygon.png
res/image/icons/triangle.png
res/image/icons/edit.png
res/image/icons/delete.png
res/image/components/edit.png
res/image/img/map.png
res/image/avatars/300-1.jpg
res/image/img/lg.png
res/image/components/home_black.png
res/image/components/home_white.png
res/image/components/folder_black.png
res/image/components/folder_white.png
res/image/components/tab_gf.png
res/image/components/user_add.png
res/image/components/plus.png
res/image/components/ico_project.png
res/image/components/ico_tp_car.png
res/image/components/ico_tp_com.png
res/image/components/ico_tp_ele.png
res/image/components/ico_tp_h2.png
res/image/img/style1.png
res/image/img/add.png
res/image/components/tb_menu.png
res/image/components/ico_loc.png
res/image/components/ico_line.png
res/image/components/ico_area.png
res/image/components/ico_plugin.png
res/image/components/expand.png
res/image/components/icon_tree_line.png
res/image/components/ico_tree_area.png
res/image/components/ico_tree_line.png
res/image/components/ico_tree_car.png
res/image/components/ico_tree_folder.png
res/image/components/tree/ico_eye.png
res/image/components/tree/ico_unlock.png
res/image/components/map/ico_route.png
res/image/components/map/nav_bike.png
res/image/components/map/nav_car.png
res/image/components/map/nav_truck.png
res/image/components/map/nav_walk.png
res/image/components/map/ico_exchange.png
res/image/components/map/ico_plus.png
res/image/components/map/ico_add_lay.png
res/image/components/map/nav_start.png
res/image/components/map/nav_stop.png
res/image/components/map/nav_right.png
res/image/components/map/nav_right_zhi.png
res/image/components/map/nav_mid.png
res/image/components/ico_lg.png
res/image/components/ico_zs.png
res/image/components/ico_cy.png
res/image/components/ico_font.png
res/image/components/map/ico_phone.png
res/image/components/map/ico_nav.png
Gallery_zh_CN.qm
Gallery_en_US.qm
)
@ -253,6 +315,29 @@ qt_add_qml_module(${PROJECT_NAME}
QML_FILES res/qml/component/MyTabButton.qml
QML_FILES res/qml/component/MyTabBar.qml
QML_FILES res/qml/component/base/IconDropdownButton.qml
QML_FILES res/qml/component/base/BaseMenuItem.qml
QML_FILES res/qml/dataconnect/DataConnect.qml
QML_FILES res/qml/component/RightMainIntro.qml
QML_FILES res/qml/component/base/MyTabButton.qml
QML_FILES res/qml/component/base/MyDialogWindow.qml
QML_FILES res/qml/component/base/MyContentDialog.qml
QML_FILES res/qml/component/base/StyleButton.qml
QML_FILES res/qml/component/base/ProjectList.qml
QML_FILES res/qml/component/base/MyBreadcrumb.qml
QML_FILES res/qml/component/base/MyTreeView.qml
QML_FILES res/qml/component/SearchRoute.qml
QML_FILES res/qml/component/base/MyImgButton.qml
QML_FILES res/qml/component/nav/RouteResult.qml
QML_FILES res/qml/component/nav/SearchInput.qml
QML_FILES res/qml/component/RightCommon.qml
QML_FILES res/qml/component/base/CommonTitle.qml
QML_FILES res/qml/component/window/SearchNearWindow.qml
QML_FILES res/qml/component/window/AddPointWindow.qml
QML_FILES res/qml/component/base/AttachmenButton.qml
QML_FILES res/qml/component/window/FontEditWindow.qml
QML_FILES res/qml/component/window/EditIconWindow.qml
QML_FILES res/qml/component/base/AnchorChoose.qml
QML_FILES res/qml/component/base/IconRadioGroup.qml
)
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")

View File

@ -127,50 +127,6 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LeftMainMenu</name>
<message>
<location filename="res/qml/component/LeftMainMenu.qml" line="125"/>
<source>Key</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LeftProjectMenu</name>
<message>
<location filename="res/qml/component/LeftProjectMenu.qml" line="176"/>
<source>Key</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>LoginScreen</name>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="25"/>
<source>Please enter the credentials:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="31"/>
<source>Username</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="38"/>
<source>Password</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="48"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="58"/>
<source>Login</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainScreen</name>
<message>
@ -738,22 +694,22 @@
<context>
<name>MyAppBar</name>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="213"/>
<location filename="res/qml/component/MyAppBar.qml" line="304"/>
<source>Minimized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="230"/>
<location filename="res/qml/component/MyAppBar.qml" line="321"/>
<source>Restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="230"/>
<location filename="res/qml/component/MyAppBar.qml" line="321"/>
<source>Maximized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="260"/>
<location filename="res/qml/component/MyAppBar.qml" line="351"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
@ -1069,7 +1025,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/page/T_FileTreeData.qml" line="125"/>
<location filename="res/qml/page/T_FileTreeData.qml" line="190"/>
<source>Key</source>
<translation type="unfinished"></translation>
</message>
@ -1964,57 +1920,57 @@
<context>
<name>ToolBar</name>
<message>
<location filename="res/qml/component/ToolBar.qml" line="20"/>
<location filename="res/qml/component/ToolBar.qml" line="24"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="21"/>
<location filename="res/qml/component/ToolBar.qml" line="25"/>
<source>New...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="22"/>
<location filename="res/qml/component/ToolBar.qml" line="26"/>
<source>Open...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="23"/>
<location filename="res/qml/component/ToolBar.qml" line="27"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="26"/>
<location filename="res/qml/component/ToolBar.qml" line="30"/>
<source>Quit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="29"/>
<location filename="res/qml/component/ToolBar.qml" line="33"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="35"/>
<location filename="res/qml/component/ToolBar.qml" line="39"/>
<source>Disable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="39"/>
<location filename="res/qml/component/ToolBar.qml" line="43"/>
<source>Check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="42"/>
<location filename="res/qml/component/ToolBar.qml" line="46"/>
<source>Save As...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="43"/>
<location filename="res/qml/component/ToolBar.qml" line="47"/>
<source>Doc</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="44"/>
<location filename="res/qml/component/ToolBar.qml" line="48"/>
<source>PDF</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View File

@ -221,6 +221,17 @@
<translation type="obsolete"></translation>
</message>
</context>
<context>
<name>IconDropdownButton</name>
<message>
<source>Quit</source>
<translation type="obsolete">退</translation>
</message>
<message>
<source>Search</source>
<translation type="obsolete"></translation>
</message>
</context>
<context>
<name>LeftMainMenu</name>
<message>
@ -228,9 +239,8 @@
<translation type="obsolete"></translation>
</message>
<message>
<location filename="res/qml/component/LeftMainMenu.qml" line="125"/>
<source>Key</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
</context>
<context>
@ -243,37 +253,31 @@
<context>
<name>LeftProjectMenu</name>
<message>
<location filename="res/qml/component/LeftProjectMenu.qml" line="176"/>
<source>Key</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
</context>
<context>
<name>LoginScreen</name>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="25"/>
<source>Please enter the credentials:</source>
<translation type="unfinished">:</translation>
<translation type="obsolete">:</translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="31"/>
<source>Username</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="38"/>
<source>Password</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="48"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
<message>
<location filename="res/qml/screen/LoginScreen.qml" line="58"/>
<source>Login</source>
<translation type="unfinished"></translation>
<translation type="obsolete"></translation>
</message>
</context>
<context>
@ -1069,22 +1073,22 @@
<context>
<name>MyAppBar</name>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="213"/>
<location filename="res/qml/component/MyAppBar.qml" line="304"/>
<source>Minimized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="230"/>
<location filename="res/qml/component/MyAppBar.qml" line="321"/>
<source>Restore</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="230"/>
<location filename="res/qml/component/MyAppBar.qml" line="321"/>
<source>Maximized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/MyAppBar.qml" line="260"/>
<location filename="res/qml/component/MyAppBar.qml" line="351"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
@ -1438,7 +1442,7 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/page/T_FileTreeData.qml" line="125"/>
<location filename="res/qml/page/T_FileTreeData.qml" line="190"/>
<source>Key</source>
<translation type="unfinished"></translation>
</message>
@ -2697,57 +2701,57 @@
<context>
<name>ToolBar</name>
<message>
<location filename="res/qml/component/ToolBar.qml" line="20"/>
<location filename="res/qml/component/ToolBar.qml" line="24"/>
<source>File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="21"/>
<location filename="res/qml/component/ToolBar.qml" line="25"/>
<source>New...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="22"/>
<location filename="res/qml/component/ToolBar.qml" line="26"/>
<source>Open...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="23"/>
<location filename="res/qml/component/ToolBar.qml" line="27"/>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="26"/>
<location filename="res/qml/component/ToolBar.qml" line="30"/>
<source>Quit</source>
<translation type="unfinished">退</translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="29"/>
<location filename="res/qml/component/ToolBar.qml" line="33"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="35"/>
<location filename="res/qml/component/ToolBar.qml" line="39"/>
<source>Disable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="39"/>
<location filename="res/qml/component/ToolBar.qml" line="43"/>
<source>Check</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="42"/>
<location filename="res/qml/component/ToolBar.qml" line="46"/>
<source>Save As...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="43"/>
<location filename="res/qml/component/ToolBar.qml" line="47"/>
<source>Doc</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="res/qml/component/ToolBar.qml" line="44"/>
<location filename="res/qml/component/ToolBar.qml" line="48"/>
<source>PDF</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 781 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 775 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 281 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -40,6 +40,6 @@ Starter {
"/page": R.resolvedUrl("res/qml/window/PageWindow.qml"),
"/testDesign": R.resolvedUrl("res/qml/window/TestDesignWindow.qml")
}
WindowRouter.go("/")
WindowRouter.go("/") // newFolder, searchNear
}
}

View File

@ -0,0 +1,100 @@
var db;
function initDatabase() {
db = LocalStorage.openDatabaseSync("AntSEV", "1.0", "基本数据看", 100000);
try {
db.transaction(function (tx) {
tx.executeSql(`CREATE TABLE ProjectMenuTree (
id TEXT PRIMARY KEY,
pid TEXT, -- 父级ID可以用于表示层级关系
project_id TEXT NOT NULL, -- 项目ID非空
title TEXT NOT NULL, -- 标题非空
ico TEXT -- 图标可以存储图标路径或名称
);`);
tx.executeSql(`INSERT INTO ProjectMenuTree (id,pid,project_id,title,ico) VALUES
('1','-1','1','节点1','ico_tree_folder.png'),
('2','-1','1','节点2','ico_tree_folder.png'),
('3','-1','1','节点3','ico_tree_folder.png'),
('4','6','1','节点61','ico_tree_folder.png'),
('5','-1','1','节点5','ico_tree_folder.png'),
('6','7','1','节点6','ico_tree_line.png'),
('7','3','1','节点节点节点节点613','ico_tree_car.png');`)
})
} catch (err) {
// console.log("Error creating table in database: " + err)
};
}
function buildTree(data) {
// 创建一个映射表,用于快速查找每个节点
const map = new Map();
data.forEach(item => {
map.set(item.id, { id: item.id, title: item.title, ico: item.ico, items: [] }); // 初始化每个节点,并添加 children 属性
});
// 构建树结构
const tree = [];
data.forEach(item => {
if (item.pid !== "-1") { // 如果有父节点
const parent = map.get(item.pid);
if (parent) {
parent.items.push(map.get(item.id)); // 将当前节点添加到父节点的 children 中
}
} else {
tree.push(map.get(item.id)); // 如果没有父节点,则为根节点
}
});
return tree;
}
function readMenuTree(project_id) {
var res = []
var datas = []
if (!db) { return; }
db.transaction(function (tx) {
var result = tx.executeSql('select * from ProjectMenuTree where project_id=?', [project_id]);
if (result.rows.length > 0) {
res = result.rows
for (let i = 0; i < res.length; i++) {
let d = res.item(i)
datas.push(d)
}
res = buildTree(datas)
} else {
res = []
}
})
console.log(JSON.stringify(res))
return res
}
function readData(name) {
var res = "";
if (!db) { return; }
db.transaction(function (tx) {
var result = tx.executeSql('select value from data where name=?', [name]);
if (result.rows.length > 0) {
res = result.rows.item(0).value;
} else {
res = "Unknown";
}
})
return res
}
function insertData(name, value) {
var res = "";
if (!db) { return; }
db.transaction(function (tx) {
var result = tx.executeSql('INSERT OR REPLACE INTO data VALUES (?,?);', [name, value]);
if (result.rowsAffected > 0) {
res = "OK";
} else {
res = "Error";
}
})
return res
}

Some files were not shown because too many files have changed in this diff Show More