Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
electron-printer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhuzhequan
electron-printer
Commits
53cd059f
Commit
53cd059f
authored
Apr 28, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改右边栏配置
parent
f197473e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
51 deletions
+115
-51
src/background.js
+4
-1
src/views/design/head/index.vue
+0
-2
src/views/design/main/imgSetting.vue
+0
-0
src/views/design/main/index.vue
+111
-48
No files found.
src/background.js
View file @
53cd059f
...
@@ -36,6 +36,7 @@ async function createWindow() {
...
@@ -36,6 +36,7 @@ async function createWindow() {
nodeIntegration
:
true
,
nodeIntegration
:
true
,
},
},
});
});
// let newWindow = new BrowserWindow({
// let newWindow = new BrowserWindow({
// fullscreen: false,
// fullscreen: false,
// width: 1000,
// width: 1000,
...
@@ -166,6 +167,7 @@ async function createWindow() {
...
@@ -166,6 +167,7 @@ async function createWindow() {
});
});
});
});
});
});
win
.
on
(
"resize"
,
()
=>
{
win
.
on
(
"resize"
,
()
=>
{
const
{
width
,
height
}
=
win
.
getBounds
();
const
{
width
,
height
}
=
win
.
getBounds
();
win
.
webContents
.
send
(
"window-size"
,
{
width
,
height
});
win
.
webContents
.
send
(
"window-size"
,
{
width
,
height
});
...
@@ -186,7 +188,8 @@ app.on("activate", async () => {
...
@@ -186,7 +188,8 @@ app.on("activate", async () => {
app
.
on
(
"ready"
,
async
()
=>
{
app
.
on
(
"ready"
,
async
()
=>
{
await
createWindow
();
await
createWindow
();
// 获取当前窗口的尺寸
// 获取当前窗口的尺寸
const
{
width
,
height
}
=
win
.
getBounds
();
win
.
webContents
.
send
(
"window-size"
,
{
width
,
height
});
globalShortcut
.
register
(
"F5"
,
()
=>
{
globalShortcut
.
register
(
"F5"
,
()
=>
{
return
false
;
return
false
;
});
});
...
...
src/views/design/head/index.vue
View file @
53cd059f
...
@@ -259,8 +259,6 @@ export default {
...
@@ -259,8 +259,6 @@ export default {
}, 500);
}, 500);
}
}
} else {
} else {
console.log(260, res.data);
bus.$emit("
busEmit
", {
bus.$emit("
busEmit
", {
type: "
sendFile
",
type: "
sendFile
",
value: res.data,
value: res.data,
...
...
src/views/design/main/imgSetting.vue
View file @
53cd059f
This diff is collapsed.
Click to expand it.
src/views/design/main/index.vue
View file @
53cd059f
<
script
>
<
script
>
import
VueDragResizeRotate
from
"@minogin/vue-drag-resize-rotate"
;
import
VueDragResizeRotate
from
"@minogin/vue-drag-resize-rotate"
;
const
{
ipcRenderer
}
=
require
(
"electron"
);
const
{
ipcRenderer
}
=
require
(
"electron"
);
import
{
grid
}
from
"../data"
;
import
{
grid
}
from
"../data"
;
import
ImgSetting
from
"./imgSetting.vue"
;
import
ImgSetting
from
"./imgSetting.vue"
;
...
@@ -35,6 +36,7 @@ export default {
...
@@ -35,6 +36,7 @@ export default {
proportion
=
1.7
;
proportion
=
1.7
;
}
else
if
(
height
>
900
&&
height
<=
1000
)
{
}
else
if
(
height
>
900
&&
height
<=
1000
)
{
proportion
=
1.5
;
proportion
=
1.5
;
this
.
PreViewGrid
.
h
;
}
else
{
}
else
{
proportion
=
1
;
proportion
=
1
;
}
}
...
@@ -51,15 +53,6 @@ export default {
...
@@ -51,15 +53,6 @@ export default {
!
this
.
grid
[
this
.
systemSetting
.
gridValue
]
!
this
.
grid
[
this
.
systemSetting
.
gridValue
]
)
)
return
{
w
:
0
,
h
:
0
,
v
:
1
};
return
{
w
:
0
,
h
:
0
,
v
:
1
};
console
.
log
(
35
,
this
.
grid
);
console
.
log
(
1111111
,
this
.
grid
[
this
.
systemSetting
.
gridValue
].
w
,
this
.
grid
[
this
.
systemSetting
.
gridValue
].
value
,
this
.
grid
[
this
.
systemSetting
.
gridValue
].
h
);
return
{
return
{
w
:
this
.
grid
[
this
.
systemSetting
.
gridValue
].
w
,
w
:
this
.
grid
[
this
.
systemSetting
.
gridValue
].
w
,
v
:
this
.
grid
[
this
.
systemSetting
.
gridValue
].
value
,
v
:
this
.
grid
[
this
.
systemSetting
.
gridValue
].
value
,
...
@@ -67,7 +60,6 @@ export default {
...
@@ -67,7 +60,6 @@ export default {
};
};
},
},
gridSpacing
()
{
gridSpacing
()
{
console
.
log
(
61
,
this
.
systemSetting
);
const
{
unit
,
gridSpacing
}
=
this
.
systemSetting
;
const
{
unit
,
gridSpacing
}
=
this
.
systemSetting
;
if
(
!
this
.
systemSetting
||
!
Object
.
keys
(
this
.
systemSetting
).
length
)
if
(
!
this
.
systemSetting
||
!
Object
.
keys
(
this
.
systemSetting
).
length
)
return
{
w
:
0
,
h
:
0
};
return
{
w
:
0
,
h
:
0
};
...
@@ -147,6 +139,14 @@ export default {
...
@@ -147,6 +139,14 @@ export default {
selectImgList
:
[],
selectImgList
:
[],
bus
:
0
,
bus
:
0
,
grid
,
grid
,
PreViewGrid
:
{
label
:
"16×18"
,
value
:
1
,
row
:
16
,
col
:
18
,
h
:
540
,
w
:
480
,
},
showImgSetting
:
true
,
showImgSetting
:
true
,
printDialogShow
:
true
,
printDialogShow
:
true
,
parentHeight
:
0
,
parentHeight
:
0
,
...
@@ -156,6 +156,7 @@ export default {
...
@@ -156,6 +156,7 @@ export default {
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
imgList
:
[],
imgList
:
[],
viewImgList
:
[],
selectImgIndexList
:
[],
selectImgIndexList
:
[],
isView
:
false
,
isView
:
false
,
imgHistoryList
:
[[]],
imgHistoryList
:
[[]],
...
@@ -173,6 +174,8 @@ export default {
...
@@ -173,6 +174,8 @@ export default {
if
(
this
.
imgList
.
length
>
0
)
{
if
(
this
.
imgList
.
length
>
0
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
let
dom
=
document
.
getElementsByClassName
(
"drr"
);
let
dom
=
document
.
getElementsByClassName
(
"drr"
);
console
.
log
(
"dom"
,
dom
);
this
.
imgList
.
forEach
((
el
,
i
)
=>
{
this
.
imgList
.
forEach
((
el
,
i
)
=>
{
let
dom_i
=
document
.
getElementsByClassName
(
"drr"
)[
i
];
let
dom_i
=
document
.
getElementsByClassName
(
"drr"
)[
i
];
dom_i
.
style
.
zIndex
=
dom_i
.
style
.
zIndex
=
...
@@ -719,12 +722,14 @@ export default {
...
@@ -719,12 +722,14 @@ export default {
if
(
currentElement
.
closest
(
".container"
))
{
if
(
currentElement
.
closest
(
".container"
))
{
// 如果点击的元素不是 boxShaow,执行方法
// 如果点击的元素不是 boxShaow,执行方法
if
(
!
currentElement
.
closest
(
".boxShaow"
)
&&
!
this
.
isView
)
{
if
(
!
currentElement
.
closest
(
".boxShaow"
)
&&
!
this
.
isView
)
{
this
.
isView
=
!
this
.
isView
;
this
.
isView
=
true
;
console
.
log
(
723
,
this
.
isView
);
console
.
log
(
723
,
this
.
isView
);
this
.
$store
.
commit
(
"setIsPreView"
,
this
.
isView
);
}
}
}
}
if
(
currentElement
.
closest
(
".drawer"
))
{
this
.
isView
=
false
;
}
this
.
$store
.
commit
(
"setIsPreView"
,
this
.
isView
);
},
},
},
},
mounted
()
{
mounted
()
{
...
@@ -750,8 +755,6 @@ export default {
...
@@ -750,8 +755,6 @@ export default {
break
;
break
;
case
"updateSystemSetting"
:
case
"updateSystemSetting"
:
this
.
systemSetting
=
this
.
$dataStore
.
get
(
"setting"
);
this
.
systemSetting
=
this
.
$dataStore
.
get
(
"setting"
);
console
.
log
(
6684
,
this
.
systemSetting
);
break
;
break
;
case
"uploadImage"
:
case
"uploadImage"
:
this
.
addFile
(
value
,
()
=>
{
this
.
addFile
(
value
,
()
=>
{
...
@@ -762,7 +765,6 @@ export default {
...
@@ -762,7 +765,6 @@ export default {
this
.
imgList
=
[];
this
.
imgList
=
[];
this
.
selectIndex
=
-
1
;
this
.
selectIndex
=
-
1
;
if
(
value
.
length
>
0
)
{
if
(
value
.
length
>
0
)
{
console
.
log
(
111
,
value
);
this
.
selectImgList
=
value
;
this
.
selectImgList
=
value
;
this
.
selectImgIndex
=
0
;
this
.
selectImgIndex
=
0
;
this
.
getBackFile
({
files
:
[
value
[
0
]],
size
},
(
file
)
=>
{
this
.
getBackFile
({
files
:
[
value
[
0
]],
size
},
(
file
)
=>
{
...
@@ -800,10 +802,24 @@ export default {
...
@@ -800,10 +802,24 @@ export default {
@
close=
"close"
@
close=
"close"
>
>
<template
#
content
>
<template
#
content
>
<!--
<div
class=
"information-content"
>
<div
class=
"information-content"
>
<div
class=
"title"
>
<div
素材信息
style=
"display: flex;justify-content: space-between;flex-wrap: nowrap;"
>
<div
class=
"title"
style=
"flex: 1;"
>
素材信息
</div>
<div>
<el-button
type=
"primary"
size=
"small"
style=
"margin: 10px;"
@
click=
"cutImgFn"
>
裁切
</el-button
>
</div>
</div>
</div>
<el-row
class=
"main"
>
<el-row
class=
"main"
>
<el-col
:span=
"6"
>
<el-col
:span=
"6"
>
<div
class=
"text-center"
>
打印区域
</div>
<div
class=
"text-center"
>
打印区域
</div>
...
@@ -818,16 +834,48 @@ export default {
...
@@ -818,16 +834,48 @@ export default {
</el-col>
</el-col>
<el-row
class=
"border-row"
>
<el-row
class=
"border-row"
>
<el-col
:span=
"6"
class=
"text-center"
>
A面
</el-col>
<el-col
<el-col
:span=
"9"
class=
"border-col"
>
:span=
"6"
class=
"text-center"
style=
"align-items: stretch;flex-grow: 1"
>
A面
</el-col
>
<el-col
:span=
"9"
class=
"border-col"
style=
"align-items: stretch;flex-grow: 1"
>
<div
class=
"img"
>
<div
class=
"img"
>
<img
class=
"full-width"
src=
"#"
alt=
""
/>
<img
class=
"full-width"
src=
"#"
alt=
""
/>
</div>
</div>
</el-col>
</el-col>
<el-col
:span=
"9"
>
<div
class=
"boxLine"
></div>
<div
class=
"img"
v-for=
"(it, i) in selectImgList"
:key=
"i"
>
<el-col
<img
class=
"full-width"
:src=
"it.productionFile"
alt=
""
/>
:span=
"9"
</div>
style=
"overflow: hidden;align-items: stretch;flex-grow: 1"
>
<el-checkbox-group
v-if=
"selectImgList.length"
v-model=
"checkList"
>
<el-checkbox
:label=
"selectImgList[0]"
:class=
"
{
imgchecked: checkList.includes(selectImgList[0]),
}"
>
<div
class=
"img-item"
@
click
.
stop
.
prevent=
"selectImg(selectImgList[0], 0)"
>
<img
style=
"width: 140px"
:src=
"selectImgList[0].productionFile"
/>
<span>
{{
selectImgList
[
0
].
designId
}}
</span>
</div>
</el-checkbox>
</el-checkbox-group>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -838,10 +886,29 @@ export default {
...
@@ -838,10 +886,29 @@ export default {
<img
class=
"full-width"
src=
"#"
alt=
""
/>
<img
class=
"full-width"
src=
"#"
alt=
""
/>
</div>
</div>
</el-col>
</el-col>
<el-col
:span=
"9"
>
<el-col
:span=
"9"
style=
"overflow: hidden;"
>
<div
class=
"img"
v-for=
"(it, i) in selectImgList"
:key=
"i"
>
<el-checkbox-group
<img
class=
"full-width"
:src=
"it.productionFile"
alt=
""
/>
v-if=
"selectImgList.length > 1"
</div>
v-model=
"checkList"
>
<el-checkbox
:label=
"selectImgList[1]"
:class=
"
{
imgchecked: checkList.includes(selectImgList[1]),
}"
>
<div
class=
"img-item"
@
click
.
stop
.
prevent=
"selectImg(selectImgList[1], 1)"
>
<img
style=
"width: 140px"
:src=
"selectImgList[1].productionFile"
/>
<span>
{{
selectImgList
[
1
].
designId
}}
</span>
</div>
</el-checkbox>
</el-checkbox-group>
</el-col>
</el-col>
</el-row>
</el-row>
</el-row>
</el-row>
...
@@ -936,8 +1003,8 @@ export default {
...
@@ -936,8 +1003,8 @@ export default {
<div>
{{
detail
.
startStockingTime
}}
</div>
<div>
{{
detail
.
startStockingTime
}}
</div>
</div>
</div>
</div>
</div>
</div>
-->
</div>
<div
<
!--
<
div
class=
"select-img"
class=
"select-img"
v-if=
"selectImgList.length && $store.state.desktopDevice === 1"
v-if=
"selectImgList.length && $store.state.desktopDevice === 1"
>
>
...
@@ -961,16 +1028,16 @@ export default {
...
@@ -961,16 +1028,16 @@ export default {
</div>
</div>
</el-checkbox>
</el-checkbox>
</el-checkbox-group>
</el-checkbox-group>
<!--
<div
<div
@
click=
"selectImg(it, i)"
@
click=
"selectImg(it, i)"
v-for=
"(it, i) in selectImgList"
v-for=
"(it, i) in selectImgList"
:key=
"i"
:key=
"i"
class=
"img-item"
class=
"img-item"
>
>
<img
style=
"width: 140px;height: auto;"
:src=
"it.productionFile"
/>
<img
style=
"width: 140px;height: auto;"
:src=
"it.productionFile"
/>
<span>
{{
it
.
designId
}}
</span>
<span>
{{
it
.
designId
}}
</span>
</div>
</div>
-->
</div>
-->
</div>
</
template
>
</
template
>
</img-setting>
</img-setting>
<div
<div
...
@@ -979,12 +1046,6 @@ export default {
...
@@ -979,12 +1046,6 @@ export default {
:style=
"{ 'background-color': !isView ? '#77797a' : '#fff' }"
:style=
"{ 'background-color': !isView ? '#77797a' : '#fff' }"
>
>
<div
class=
"container"
>
<div
class=
"container"
>
<!-- <el-button
style="position: absolute;top: 0;left: 50%;z-index: 99;"
size="langer"
@click="changePic"
>切换视图</el-button
> -->
<div
v-if=
"isView"
id=
"img"
style=
"background-color: #fff; "
>
<div
v-if=
"isView"
id=
"img"
style=
"background-color: #fff; "
>
<div
<div
id=
"line"
id=
"line"
...
@@ -1300,7 +1361,7 @@ img {
...
@@ -1300,7 +1361,7 @@ img {
flex-direction
:
column
;
flex-direction
:
column
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
box-sizing
:
border-box
;
span
{
span
{
font-size
:
14px
;
font-size
:
14px
;
margin
:
5px
0
;
margin
:
5px
0
;
...
@@ -1352,6 +1413,7 @@ img {
...
@@ -1352,6 +1413,7 @@ img {
}
}
.imgchecked
{
.imgchecked
{
border
:
1px
solid
#409eff
;
border
:
1px
solid
#409eff
;
box-sizing
:
border-box
;
}
}
</
style
>
</
style
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
...
@@ -1382,7 +1444,7 @@ img {
...
@@ -1382,7 +1444,7 @@ img {
.main
{
.main
{
margin
:
5px
;
margin
:
5px
;
border
:
1px
solid
#ececec
;
border
:
1px
solid
#ececec
;
height
:
100%
;
.effectPic
{
.effectPic
{
.img
{
.img
{
width
:
100%
;
width
:
100%
;
...
@@ -1423,6 +1485,7 @@ img {
...
@@ -1423,6 +1485,7 @@ img {
border-bottom
:
1px
solid
#ececec
;
border-bottom
:
1px
solid
#ececec
;
display
:
flex
;
display
:
flex
;
width
:
100%
;
width
:
100%
;
height
:
100%
;
align-items
:
center
;
align-items
:
center
;
}
}
.full-width
{
.full-width
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment