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 个修改的文件
包含
76 行增加
和
42 行删除
+76
-42
cateWin.js
src/main/plugins/cateWin.js
+15
-6
category.js
src/main/plugins/category.js
+37
-29
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 {
...
@@ -78,15 +78,19 @@ class cateWin {
// 删除所有分类窗口
// 删除所有分类窗口
let
winList
=
this
.
getAllWindows
();
let
winList
=
this
.
getAllWindows
();
winList
.
forEach
(
v
=>
{
winList
.
forEach
(
v
=>
{
v
.
close
();
console
.
log
(
v
.
id
)
this
.
mainWindow
.
closeWin
(
v
.
id
);
})
})
}
}
delCateIdWin
(
id
)
{
delCateIdWin
(
id
)
{
// 删除某个分类窗口
// 删除某个分类窗口
let
currentWin
=
this
.
mainWindow
.
getWinCateOf
(
id
);
let
currentWin
=
this
.
mainWindow
.
getWinCateOf
(
id
);
console
.
log
(
'删除某个分类窗口'
)
console
.
log
(
currentWin
)
if
(
currentWin
!=
null
)
{
if
(
currentWin
!=
null
)
{
currentWin
.
close
();
console
.
log
(
'删除 窗口id'
,
currentWin
.
id
)
this
.
mainWindow
.
closeWin
(
currentWin
.
id
);
}
}
}
}
...
@@ -155,13 +159,17 @@ class cateWin {
...
@@ -155,13 +159,17 @@ class cateWin {
currentWidth
=
len
?
(
len
*
50
+
(
len
-
1
)
*
24
+
80
)
:
20
;
currentWidth
=
len
?
(
len
*
50
+
(
len
-
1
)
*
24
+
80
)
:
20
;
item
.
x
=
offsetX
||
item
.
x
;
item
.
x
=
offsetX
||
item
.
x
;
item
.
width
=
currentWidth
;
item
.
width
=
currentWidth
;
console
.
log
(
'Id'
,
item
.
cateId
,
`窗口
${
item
.
win
!=
null
?
'已经存在'
:
'不存在'
}
`
)
console
.
log
(
'width'
,
currentWidth
)
if
(
item
.
win
)
{
if
(
item
.
win
)
{
// item.x =
// item.x =
item
.
win
.
setBounds
(
{
item
.
win
.
setBounds
(
{
x
:
baseX
+
offsetX
+
(
pIndex
+
1
)
*
12
,
x
:
baseX
+
offsetX
+
(
pIndex
+
1
)
*
12
,
width
:
currentWidth
width
:
currentWidth
}
);
}
);
if
(
!
item
.
win
.
isVisible
())
{
item
.
win
.
show
();
}
}
}
if
(
item
.
win
==
null
)
{
if
(
item
.
win
==
null
)
{
// 创建窗口
// 创建窗口
...
@@ -175,7 +183,8 @@ class cateWin {
...
@@ -175,7 +183,8 @@ class cateWin {
});
});
}
}
// 为下一个准备的偏移
// 为下一个准备的偏移
offsetX
=
item
.
x
+
currentWidth
+
12
;
// offsetX = item.x + currentWidth + 12;
offsetX
=
item
.
x
+
currentWidth
;
})
})
// console.log('最终渲染')
// console.log('最终渲染')
// console.log(pList)
// console.log(pList)
...
@@ -186,7 +195,7 @@ class cateWin {
...
@@ -186,7 +195,7 @@ class cateWin {
let
cateList
=
this
.
getCategoryList
();
let
cateList
=
this
.
getCategoryList
();
let
pList
=
[];
let
pList
=
[];
console
.
log
(
cateList
)
//
console.log(cateList)
cateList
.
forEach
(
cItem
=>
{
cateList
.
forEach
(
cItem
=>
{
let
currentWin
=
this
.
mainWindow
.
getWinCateOf
(
cItem
.
id
);
let
currentWin
=
this
.
mainWindow
.
getWinCateOf
(
cItem
.
id
);
// console.log(currentWin)
// console.log(currentWin)
...
@@ -211,7 +220,7 @@ class cateWin {
...
@@ -211,7 +220,7 @@ class cateWin {
width
:
item
.
width
width
:
item
.
width
}
);
}
);
})
})
console
.
log
(
pList
)
//
console.log(pList)
}
}
/* 获取分类列表 */
/* 获取分类列表 */
...
...
src/main/plugins/category.js
浏览文件 @
e854999b
...
@@ -58,44 +58,47 @@ class category {
...
@@ -58,44 +58,47 @@ class category {
categoryList
.
unshift
(
category
);
categoryList
.
unshift
(
category
);
this
.
store
.
set
(
process
.
env
.
VUE_APP_CATENAME
,
categoryList
);
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
);
sender
.
send
(
"add-category"
,
category
);
this
.
mainWindow
.
win
.
webContents
.
send
(
"add-category"
,
category
);
this
.
mainWindow
.
win
.
webContents
.
send
(
"add-category"
,
category
);
}
}
/* 删除分类 */
/* 删除分类 */
delCategory
({
id
,
sender
})
{
delCategory
({
id
,
sender
}
=
{})
{
let
categoryList
=
this
.
store
.
get
(
process
.
env
.
VUE_APP_CATENAME
);
try
{
let
hasIn
=
categoryList
.
findIndex
(
v
=>
v
.
id
==
id
);
if
(
id
==
undefined
)
return
;
let
nextId
=
null
;
let
categoryList
=
this
.
store
.
get
(
process
.
env
.
VUE_APP_CATENAME
);
let
hasIn
=
categoryList
.
findIndex
(
v
=>
v
.
id
==
id
);
// console.log('delCategory - hasIn', hasIn, id)
let
nextId
=
null
;
if
(
hasIn
==
-
1
)
return
null
;
if
(
hasIn
==
0
&&
categoryList
[
1
])
nextId
=
categoryList
[
1
].
id
;
// console.log('delCategory - hasIn', hasIn, id)
if
(
hasIn
==
-
1
)
return
null
;
categoryList
.
splice
(
hasIn
,
1
);
if
(
hasIn
==
0
&&
categoryList
[
1
]
!=
undefined
)
nextId
=
categoryList
[
1
].
id
;
// 删除对应窗口,主窗口不用
categoryList
.
splice
(
hasIn
,
1
);
// 分类 id
//根据分类重新渲染
// 删除对应窗口,主窗口不用
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
{
// 分类 id
if
(
hasIn
==
0
)
{
//根据分类重新渲染
console
.
log
(
'删除分类'
)
if
(
hasIn
==
0
&&
categoryList
[
1
])
{
this
.
cateWinPlugin
.
delCateIdWin
(
nextId
);
this
.
cateWinPlugin
.
delCateIdWin
(
nextId
);
setTimeout
(()
=>
{
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
},
800
);
}
else
{
}
else
{
this
.
cateWinPlugin
.
delCateIdWin
(
id
);
this
.
cateWinPlugin
.
delCateIdWin
(
id
);
setTimeout
(()
=>
{
if
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
},
800
);
}
}
}
this
.
store
.
set
(
process
.
env
.
VUE_APP_CATENAME
,
categoryList
);
this
.
store
.
set
(
process
.
env
.
VUE_APP_CATENAME
,
categoryList
);
sender
.
send
(
'remove-category'
,{
id
});
sender
.
send
(
'remove-category'
,{
id
});
this
.
mainWindow
.
main
.
webContents
.
send
(
"category-list"
,
categoryList
);
this
.
mainWindow
.
main
.
webContents
.
send
(
"category-list"
,
categoryList
);
}
catch
(
error
)
{
console
.
error
(
error
)
}
}
}
// 获取分类详情
// 获取分类详情
...
@@ -111,18 +114,20 @@ class category {
...
@@ -111,18 +114,20 @@ class category {
let
categoryList
=
this
.
store
.
get
(
process
.
env
.
VUE_APP_CATENAME
);
let
categoryList
=
this
.
store
.
get
(
process
.
env
.
VUE_APP_CATENAME
);
let
hasIn
=
categoryList
.
findIndex
(
v
=>
v
.
id
==
id
);
let
hasIn
=
categoryList
.
findIndex
(
v
=>
v
.
id
==
id
);
// console.log('hasIn', hasIn)
// console.log('hasIn', hasIn)
console
.
log
(
'分类id'
,
id
)
console
.
log
(
'分类id'
,
id
,
'hasIn'
,
hasIn
)
if
(
hasIn
==
-
1
)
return
null
;
if
(
hasIn
==
-
1
)
return
null
;
categoryList
[
hasIn
]
=
detail
;
categoryList
[
hasIn
]
=
detail
;
// 修改窗口大小
// 修改窗口大小
let
cateWin
=
this
.
mainWindow
.
getWinCateOf
(
id
);
let
cateWin
=
this
.
mainWindow
.
getWinCateOf
(
id
);
console
.
log
(
'cateWin'
,
cateWin
!=
null
)
if
(
cateWin
!=
null
&&
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
)
{
if
(
cateWin
!=
null
&&
(
this
.
store
.
get
(
"currentMode"
)
===
"modeJianYue"
)
)
{
// cateWin.setBounds({
// cateWin.setBounds({
// width:352,
// width:352,
// });
// });
// this.cateWinPlugin.resizeAndPosition({cateId:id, softList:detail.softList});
// this.cateWinPlugin.resizeAndPosition({cateId:id, softList:detail.softList});
console
.
log
(
'当前窗口存在,需要更新'
)
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
this
.
cateWinPlugin
.
resizeAndCreate
({
categoryList
});
}
}
...
@@ -142,7 +147,10 @@ class category {
...
@@ -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.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
);
this
.
store
.
set
(
process
.
env
.
VUE_APP_CATENAME
,
categoryList
);
sender
.
send
(
'remove-soft'
,{
detail
,
id
});
sender
.
send
(
'remove-soft'
,{
detail
,
id
});
...
...
src/main/windows/mainWindow.js
浏览文件 @
e854999b
...
@@ -141,6 +141,8 @@ class MainWindow {
...
@@ -141,6 +141,8 @@ class MainWindow {
/* 获取分类窗口 */
/* 获取分类窗口 */
getWinCateOf
(
id
)
{
getWinCateOf
(
id
)
{
let
winId
=
""
;
let
winId
=
""
;
console
.
log
(
'窗口组'
,
id
)
console
.
log
(
this
.
group
)
let
keys
=
Object
.
keys
(
this
.
group
);
let
keys
=
Object
.
keys
(
this
.
group
);
let
targetIndex
=
keys
.
findIndex
(
v
=>
this
.
group
[
v
].
route
===
'/category/'
+
id
);
let
targetIndex
=
keys
.
findIndex
(
v
=>
this
.
group
[
v
].
route
===
'/category/'
+
id
);
if
(
targetIndex
!=
-
1
)
winId
=
keys
[
targetIndex
];
if
(
targetIndex
!=
-
1
)
winId
=
keys
[
targetIndex
];
...
@@ -166,6 +168,7 @@ class MainWindow {
...
@@ -166,6 +168,7 @@ class MainWindow {
if
(
args
.
visible
==
'hide'
)
return
;
if
(
args
.
visible
==
'hide'
)
return
;
if
(
!
this
.
getWindow
(
Number
(
i
)).
isVisible
())
this
.
getWindow
(
Number
(
i
)).
show
()
if
(
!
this
.
getWindow
(
Number
(
i
)).
isVisible
())
this
.
getWindow
(
Number
(
i
)).
show
()
this
.
getWindow
(
Number
(
i
)).
focus
()
this
.
getWindow
(
Number
(
i
)).
focus
()
console
.
log
(
'route已存在窗口组中,不再创建'
,
args
.
route
)
return
return
}
}
}
}
...
@@ -318,12 +321,20 @@ class MainWindow {
...
@@ -318,12 +321,20 @@ class MainWindow {
if
(
this
.
getWindow
(
Number
(
i
)))
{
if
(
this
.
getWindow
(
Number
(
i
)))
{
this
.
getWindow
(
Number
(
i
)).
close
()
this
.
getWindow
(
Number
(
i
)).
close
()
}
else
{
}
else
{
app
.
quit
()
//
app.quit()
}
}
}
}
}
}
}
}
/* 关闭某个窗口 */
closeWin
(
winId
)
{
if
(
winId
)
{
this
.
getWindow
(
Number
(
winId
)).
close
()
if
(
this
.
group
[
Number
(
winId
)])
delete
this
.
group
[
Number
(
winId
)]
}
}
// 开启监听
// 开启监听
listen
()
{
listen
()
{
// 关闭
// 关闭
...
@@ -476,7 +487,7 @@ class MainWindow {
...
@@ -476,7 +487,7 @@ class MainWindow {
quitListener
()
{
quitListener
()
{
// 注册一个'Alt+CommandOrControl+Q' 快捷键监听器
// 注册一个'Alt+CommandOrControl+Q' 快捷键监听器
const
ret
=
globalShortcut
.
register
(
'Alt+CommandOrControl+Q'
,
function
()
{
const
ret
=
globalShortcut
.
register
(
'Alt+CommandOrControl+Q'
,
function
()
{
app
.
quit
();
//
app.quit();
});
});
if
(
!
ret
)
{
if
(
!
ret
)
{
console
.
log
(
'registration failed'
)
console
.
log
(
'registration failed'
)
...
...
src/renderer/components/Dockmode/one.vue
浏览文件 @
e854999b
...
@@ -114,10 +114,13 @@ export default {
...
@@ -114,10 +114,13 @@ export default {
opacity: 0;
opacity: 0;
position: absolute;
position: absolute;
left: 6px;
left: 6px;
top: 4px;
// top: 4px;
top: 50%;
transform: translateY(-50%);
bottom: 0;
bottom: 0;
width: 20px;
width: 20px;
height: 4em;
max-height: 4em;
height: max-content;
overflow: hidden;
overflow: hidden;
line-height: 1;
line-height: 1;
// z-index: 1;
// z-index: 1;
...
...
src/renderer/views/category/index.vue
浏览文件 @
e854999b
<
template
>
<
template
>
<div
class=
"category_container page_wrap app-drag"
>
<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>
<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=
""
<!--
<el-scrollbar
ref=
"scrollContainer"
:vertical=
"false"
style=
"height: 68px;background:red"
class=
""
@
wheel
.
native
.
prevent=
"handleScroll"
>
-->
@
wheel
.
native
.
prevent=
"handleScroll"
>
-->
...
@@ -89,10 +89,13 @@ export default {
...
@@ -89,10 +89,13 @@ export default {
opacity: 0;
opacity: 0;
position: absolute;
position: absolute;
left: 16px;
left: 16px;
top: 6px;
// top: 6px;
top: 50%;
transform: translateY(-50%);
bottom: 0;
bottom: 0;
width: 20px;
width: 20px;
height: 4em;
max-height: 4em;
height: max-content;
overflow: hidden;
overflow: hidden;
line-height: 1;
line-height: 1;
font-size: 14px;
font-size: 14px;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论