Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
testMenu
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蔡芬
testMenu
Commits
e854999b
提交
e854999b
authored
4月 21, 2023
作者:
caicai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1
上级
43fa18e7
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
61 行增加
和
27 行删除
+61
-27
cateWin.js
src/main/plugins/cateWin.js
+15
-6
category.js
src/main/plugins/category.js
+22
-14
mainWindow.js
src/main/windows/mainWindow.js
+13
-2
one.vue
src/renderer/components/Dockmode/one.vue
+5
-2
index.vue
src/renderer/views/category/index.vue
+6
-3
没有找到文件。
src/main/plugins/cateWin.js
浏览文件 @
e854999b
...
...
@@ -78,15 +78,19 @@ class cateWin {
// 删除所有分类窗口
let
winList
=
this
.
getAllWindows
();
winList
.
forEach
(
v
=>
{
v
.
close
();
console
.
log
(
v
.
id
)
this
.
mainWindow
.
closeWin
(
v
.
id
);
})
}
delCateIdWin
(
id
)
{
// 删除某个分类窗口
let
currentWin
=
this
.
mainWindow
.
getWinCateOf
(
id
);
console
.
log
(
'删除某个分类窗口'
)
console
.
log
(
currentWin
)
if
(
currentWin
!=
null
)
{
currentWin
.
close
();
console
.
log
(
'删除 窗口id'
,
currentWin
.
id
)
this
.
mainWindow
.
closeWin
(
currentWin
.
id
);
}
}
...
...
@@ -155,13 +159,17 @@ class cateWin {
currentWidth
=
len
?
(
len
*
50
+
(
len
-
1
)
*
24
+
80
)
:
20
;
item
.
x
=
offsetX
||
item
.
x
;
item
.
width
=
currentWidth
;
console
.
log
(
'Id'
,
item
.
cateId
,
`窗口
${
item
.
win
!=
null
?
'已经存在'
:
'不存在'
}
`
)
console
.
log
(
'width'
,
currentWidth
)
if
(
item
.
win
)
{
// item.x =
item
.
win
.
setBounds
(
{
x
:
baseX
+
offsetX
+
(
pIndex
+
1
)
*
12
,
width
:
currentWidth
}
);
if
(
!
item
.
win
.
isVisible
())
{
item
.
win
.
show
();
}
}
if
(
item
.
win
==
null
)
{
// 创建窗口
...
...
@@ -175,7 +183,8 @@ class cateWin {
});
}
// 为下一个准备的偏移
offsetX
=
item
.
x
+
currentWidth
+
12
;
// offsetX = item.x + currentWidth + 12;
offsetX
=
item
.
x
+
currentWidth
;
})
// console.log('最终渲染')
// console.log(pList)
...
...
@@ -186,7 +195,7 @@ class cateWin {
let
cateList
=
this
.
getCategoryList
();
let
pList
=
[];
console
.
log
(
cateList
)
//
console.log(cateList)
cateList
.
forEach
(
cItem
=>
{
let
currentWin
=
this
.
mainWindow
.
getWinCateOf
(
cItem
.
id
);
// console.log(currentWin)
...
...
@@ -211,7 +220,7 @@ class cateWin {
width
:
item
.
width
}
);
})
console
.
log
(
pList
)
//
console.log(pList)
}
/* 获取分类列表 */
...
...
src/main/plugins/category.js
浏览文件 @
e854999b
...
...
@@ -58,44 +58,47 @@ class category {
categoryList
.
unshift
(
category
);
this
.
store
.
set
(
process
.
env
.
VUE_APP_CATENAME
,
categoryList
);
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
{
console
.
log
(
'新增分类'
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
}
sender
.
send
(
"add-category"
,
category
);
this
.
mainWindow
.
win
.
webContents
.
send
(
"add-category"
,
category
);
}
/* 删除分类 */
delCategory
({
id
,
sender
})
{
delCategory
({
id
,
sender
}
=
{})
{
try
{
if
(
id
==
undefined
)
return
;
let
categoryList
=
this
.
store
.
get
(
process
.
env
.
VUE_APP_CATENAME
);
let
hasIn
=
categoryList
.
findIndex
(
v
=>
v
.
id
==
id
);
let
nextId
=
null
;
// console.log('delCategory - hasIn', hasIn, id)
if
(
hasIn
==
-
1
)
return
null
;
if
(
hasIn
==
0
&&
categoryList
[
1
]
)
nextId
=
categoryList
[
1
].
id
;
if
(
hasIn
==
0
&&
categoryList
[
1
]
!=
undefined
)
nextId
=
categoryList
[
1
].
id
;
categoryList
.
splice
(
hasIn
,
1
);
// 删除对应窗口,主窗口不用
// 分类 id
//根据分类重新渲染
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
{
if
(
hasIn
==
0
)
{
console
.
log
(
'删除分类'
)
if
(
hasIn
==
0
&&
categoryList
[
1
]
)
{
this
.
cateWinPlugin
.
delCateIdWin
(
nextId
);
setTimeout
(()
=>
{
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
},
800
);
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
}
else
{
this
.
cateWinPlugin
.
delCateIdWin
(
id
);
setTimeout
(()
=>
{
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
},
800
);
}
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
}
this
.
store
.
set
(
process
.
env
.
VUE_APP_CATENAME
,
categoryList
);
sender
.
send
(
'remove-category'
,{
id
});
this
.
mainWindow
.
main
.
webContents
.
send
(
"category-list"
,
categoryList
);
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
// 获取分类详情
...
...
@@ -111,18 +114,20 @@ class category {
let
categoryList
=
this
.
store
.
get
(
process
.
env
.
VUE_APP_CATENAME
);
let
hasIn
=
categoryList
.
findIndex
(
v
=>
v
.
id
==
id
);
// console.log('hasIn', hasIn)
console
.
log
(
'分类id'
,
id
)
console
.
log
(
'分类id'
,
id
,
'hasIn'
,
hasIn
)
if
(
hasIn
==
-
1
)
return
null
;
categoryList
[
hasIn
]
=
detail
;
// 修改窗口大小
let
cateWin
=
this
.
mainWindow
.
getWinCateOf
(
id
);
console
.
log
(
'cateWin'
,
cateWin
!=
null
)
if
(
cateWin
!=
null
&&
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
)
{
// cateWin.setBounds({
// width:352,
// });
// this.cateWinPlugin.resizeAndPosition({cateId:id, softList:detail.softList});
console
.
log
(
'当前窗口存在,需要更新'
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
}
...
...
@@ -142,7 +147,10 @@ class category {
// 重新调整窗口大小及其位置
// if(this.store.get("currentMode")==="modeJianYue") this.cateWinPlugin.resizeAndPosition({cateId:id, softList:detail.softList});
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
{
console
.
log
(
'更新分类下的软件列表'
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
}
this
.
store
.
set
(
process
.
env
.
VUE_APP_CATENAME
,
categoryList
);
sender
.
send
(
'remove-soft'
,{
detail
,
id
});
...
...
src/main/windows/mainWindow.js
浏览文件 @
e854999b
...
...
@@ -141,6 +141,8 @@ class MainWindow {
/* 获取分类窗口 */
getWinCateOf
(
id
)
{
let
winId
=
""
;
console
.
log
(
'窗口组'
,
id
)
console
.
log
(
this
.
group
)
let
keys
=
Object
.
keys
(
this
.
group
);
let
targetIndex
=
keys
.
findIndex
(
v
=>
this
.
group
[
v
].
route
===
'/category/'
+
id
);
if
(
targetIndex
!=
-
1
)
winId
=
keys
[
targetIndex
];
...
...
@@ -166,6 +168,7 @@ class MainWindow {
if
(
args
.
visible
==
'hide'
)
return
;
if
(
!
this
.
getWindow
(
Number
(
i
)).
isVisible
())
this
.
getWindow
(
Number
(
i
)).
show
()
this
.
getWindow
(
Number
(
i
)).
focus
()
console
.
log
(
'route已存在窗口组中,不再创建'
,
args
.
route
)
return
}
}
...
...
@@ -318,10 +321,18 @@ class MainWindow {
if
(
this
.
getWindow
(
Number
(
i
)))
{
this
.
getWindow
(
Number
(
i
)).
close
()
}
else
{
app
.
quit
()
// app.quit()
}
}
}
}
/* 关闭某个窗口 */
closeWin
(
winId
)
{
if
(
winId
)
{
this
.
getWindow
(
Number
(
winId
)).
close
()
if
(
this
.
group
[
Number
(
winId
)])
delete
this
.
group
[
Number
(
winId
)]
}
}
// 开启监听
...
...
@@ -476,7 +487,7 @@ class MainWindow {
quitListener
()
{
// 注册一个'Alt+CommandOrControl+Q' 快捷键监听器
const
ret
=
globalShortcut
.
register
(
'Alt+CommandOrControl+Q'
,
function
()
{
app
.
quit
();
//
app.quit();
});
if
(
!
ret
)
{
console
.
log
(
'registration failed'
)
...
...
src/renderer/components/Dockmode/one.vue
浏览文件 @
e854999b
...
...
@@ -114,10 +114,13 @@ export default {
opacity: 0;
position: absolute;
left: 6px;
top: 4px;
// top: 4px;
top: 50%;
transform: translateY(-50%);
bottom: 0;
width: 20px;
height: 4em;
max-height: 4em;
height: max-content;
overflow: hidden;
line-height: 1;
// z-index: 1;
...
...
src/renderer/views/category/index.vue
浏览文件 @
e854999b
<
template
>
<div
class=
"category_container page_wrap app-drag"
>
<!--
{{
id
}}
-->
<!--
<div
style=
"padding-left:300px;"
>
{{
id
}}
</div>
-->
<div
v-if=
"list && list.length > 0"
class=
"group1_wrap_name"
>
{{
detail
.
name
}}
</div>
<!--
<el-scrollbar
ref=
"scrollContainer"
:vertical=
"false"
style=
"height: 68px;background:red"
class=
""
@
wheel
.
native
.
prevent=
"handleScroll"
>
-->
...
...
@@ -89,10 +89,13 @@ export default {
opacity: 0;
position: absolute;
left: 16px;
top: 6px;
// top: 6px;
top: 50%;
transform: translateY(-50%);
bottom: 0;
width: 20px;
height: 4em;
max-height: 4em;
height: max-content;
overflow: hidden;
line-height: 1;
font-size: 14px;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论