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
5cfdd1a6
Commit
5cfdd1a6
authored
Jun 19, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改图片最大尺寸
parent
a8b467a5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
3 deletions
+53
-3
src/server/entity/function.js
+13
-0
src/server/routes/index.js
+2
-0
src/store/index.js
+4
-0
src/views/design/head/index.vue
+19
-2
src/views/design/main/index.vue
+15
-1
No files found.
src/server/entity/function.js
View file @
5cfdd1a6
...
...
@@ -404,4 +404,17 @@ export default {
res
.
json
({
code
:
500
,
msg
:
err
});
}
},
//获取国家名称及代码
getAllCountry
:
async
(
req
,
res
)
=>
{
const
token
=
req
.
headers
[
"jwt-token"
];
let
url
=
"https://factory.jomalls.com/api/logisticsAddress/getAllCountry"
;
try
{
let
{
data
}
=
await
axios
.
get
(
url
,
{
headers
:
{
"jwt-token"
:
token
}
});
console
.
log
(
data
);
res
.
send
(
data
);
}
catch
(
error
)
{
console
.
log
(
error
);
res
.
json
({
code
:
500
,
msg
:
error
});
}
},
};
src/server/routes/index.js
View file @
5cfdd1a6
...
...
@@ -39,5 +39,7 @@ router.post("/processImage", fn.processImage);
// 保存生成后得图片返回地址
router
.
post
(
"/saveToPng"
,
fn
.
saveToPng
);
// 保存生成后得图片返回地址
router
.
post
(
"/getAllCountry"
,
fn
.
getAllCountry
);
export
{
router
as
default
};
src/store/index.js
View file @
5cfdd1a6
...
...
@@ -12,6 +12,7 @@ const defaultSetting = {
export
default
new
Vuex
.
Store
({
state
:
{
actionList
:
[],
countryList
:
[],
imgList
:
[],
productDetail
:
{},
windowWH
:
{
width
:
0
,
height
:
0
},
...
...
@@ -94,6 +95,9 @@ export default new Vuex.Store({
setWindows
(
state
,
{
width
,
height
})
{
state
.
windowWH
=
{
width
,
height
};
},
setCountry
(
state
,
data
)
{
state
.
countryList
=
data
;
},
},
getters
:
{
systemSetting
(
state
)
{
...
...
src/views/design/head/index.vue
View file @
5cfdd1a6
...
...
@@ -88,7 +88,8 @@ export default {
actionList
()
{
return
this
.
$store
.
getters
.
getActionList
;
},
...
mapState
([
"grid"
,
"defaultProportion"
]),
...
mapState
([
"grid"
,
"defaultProportion"
,
"countryList"
]),
},
mounted
()
{
// console.log(pkg, "pkg");
...
...
@@ -588,6 +589,16 @@ export default {
return [];
}
},
getCountryName(code) {
if (code) {
const item = this.countryList?.find((el) => el.countryCode == code);
if (item) {
return `(${item.nameCn})`;
}
}
return "";
},
},
};
</
script
>
...
...
@@ -849,7 +860,13 @@ export default {
v-if=
"user && user.factory"
style=
"font-weight: 700;margin-left: 8px;"
>
{{
user
.
factory
.
countryCode
||
"CN"
}}
{{
user
.
factory
.
countryCode
?
`${user.factory.countryCode
}
${getCountryName(
user.factory.countryCode
)
}
`
:
"CN(中国)"
}}
<
/div>
<
p
v
-
if
=
"user && user.factory"
>
{{
user
.
factory
.
title
}}
<
/p>
<
el
-
dropdown
@
command
=
"dropdownCommand"
>
...
...
src/views/design/main/index.vue
View file @
5cfdd1a6
...
...
@@ -48,6 +48,9 @@ export default {
this
.
$store
.
commit
(
"setDefaultproportion"
,
proportion
);
this
.
$store
.
commit
(
"setGrid"
);
});
if
(
!
this
.
countryList
.
length
)
{
this
.
getAllCountryFn
();
}
},
computed
:
{
gridWH
()
{
...
...
@@ -135,6 +138,7 @@ export default {
"WHproportion"
,
"grid"
,
"windowWH"
,
"countryList"
,
]),
},
data
()
{
...
...
@@ -244,6 +248,7 @@ export default {
changeCheckFn
(
value
)
{
console
.
log
(
"check"
,
value
);
},
isView
:
{
handler
(
newValue
)
{
if
(
!
newValue
)
{
...
...
@@ -979,6 +984,15 @@ export default {
}
this
.
imgDom
.
style
.
webkitClipPath
=
gradient
;
},
async
getAllCountryFn
()
{
try
{
let
{
data
}
=
await
this
.
$api
.
post
(
"/getAllCountry"
);
this
.
$store
.
commit
(
"setCountry"
,
data
);
console
.
log
(
991
,
this
.
countryList
);
}
catch
(
error
)
{
console
.
log
(
error
);
}
},
},
mounted
()
{
this
.
imgHeight
=
window
.
screen
.
height
+
"px"
;
...
...
@@ -1117,7 +1131,7 @@ export default {
>
<img
:key=
"i"
style=
"width: auto;height: 190px;max-width: 200px;"
style=
"width: auto;
max-
height: 190px;max-width: 200px;"
:src=
"img.productionFile"
/>
<!--
<span>
{{
img
.
designId
}}
</span>
-->
...
...
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