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
2ed9c7d7
Commit
2ed9c7d7
authored
Sep 01, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:修改问题
parent
d6018825
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
46 deletions
+36
-46
src/server/entity/function.js
+1
-15
src/utils/axios.js
+3
-0
src/utils/index.js
+6
-31
src/views/design/main/index.vue
+15
-0
vue.config.js
+11
-0
No files found.
src/server/entity/function.js
View file @
2ed9c7d7
...
...
@@ -282,20 +282,6 @@ export default {
.
on
(
"error"
,
()
=>
{
res
.
json
({
code
:
500
,
msg
:
"文件下载失败"
});
});
// let ws=fs.createWriteStream(dir );
// console.log(downloadByDesignId)
//
// ws.write(downloadByDesignId.data);
// ws.on('drain',function () {
// console.log("内存干了");
// });
// ws.on('error',function (err) {
// res.json({code: 500, msg: '文件下载失败'})
// });
// ws.on('close',function (err) {
//
// });
// ws.end()
}
catch
(
err
)
{
console
.
log
(
err
);
res
.
json
({
code
:
500
,
msg
:
err
});
...
...
@@ -489,7 +475,7 @@ export default {
msg
=
`清理错误:
${
error
.
message
}
`
;
console
.
error
(
`清理错误:
${
error
.
message
}
`
);
}
res
.
json
({
code
:
500
,
msg
:
msg
});
res
.
json
({
code
:
205
,
msg
:
msg
});
}
},
saveToPng
:
async
(
req
,
res
)
=>
{
...
...
src/utils/axios.js
View file @
2ed9c7d7
...
...
@@ -61,6 +61,9 @@ service.interceptors.response.use(
if
(
res
.
code
===
411
)
{
return
Promise
.
resolve
(
res
);
}
if
(
res
.
code
===
205
)
{
return
Promise
.
resolve
(
res
);
}
if
(
res
.
code
===
403
)
{
Vue
.
prototype
.
$dataStore
.
delete
(
"user"
);
Vue
.
prototype
.
$message
.
error
({
...
...
src/utils/index.js
View file @
2ed9c7d7
...
...
@@ -234,36 +234,11 @@ function insertAfter(newElement, targetElement) {
}
}
export
function
extractValue
(
str
,
delimiter
=
"_"
,
positionType
=
"last"
)
{
// 如果字符串不包含分隔符,返回空字符串
if
(
!
str
.
includes
(
delimiter
))
return
""
;
// 分割字符串
const
parts
=
str
.
split
(
delimiter
);
export
function
extractValue
(
str
)
{
console
.
log
(
238
,
str
);
let
position
;
// 根据位置类型确定要提取的位置
switch
(
positionType
)
{
case
"first"
:
position
=
0
;
break
;
case
"second"
:
position
=
1
;
break
;
case
"third"
:
position
=
2
;
break
;
case
"last"
:
position
=
parts
.
length
-
2
;
break
;
default
:
position
=
parts
.
length
-
1
;
}
// 检查位置是否有效
if
(
position
<
0
||
position
>=
parts
.
length
)
return
""
;
// 返回指定位置的值
return
parts
[
position
];
// 如果字符串不包含分隔符,返回空字符串
if
(
!
str
.
includes
(
"_"
))
return
""
;
if
(
str
.
includes
(
"_A_"
))
return
"A"
;
if
(
str
.
includes
(
"_B_"
))
return
"B"
;
}
src/views/design/main/index.vue
View file @
2ed9c7d7
...
...
@@ -263,6 +263,20 @@ export default {
if
(
typeof
this
.
detail
.
imageAry
==
"string"
)
{
this
.
detail
.
imageAry
=
JSON
.
parse
(
this
.
detail
.
imageAry
);
}
this
.
detail
.
imageAry
=
this
.
detail
.
imageAry
.
sort
((
a
,
b
)
=>
{
// 检查 a.title 是否为 '正' 或 'A'
const
isAPriority
=
a
.
title
===
"正"
||
a
.
title
===
"A"
;
// 检查 b.title 是否为 '正' 或 'A'
const
isBPriority
=
b
.
title
===
"正"
||
b
.
title
===
"A"
;
// 如果 a 是优先项而 b 不是,a 排前面
if
(
isAPriority
&&
!
isBPriority
)
return
-
1
;
// 如果 b 是优先项而 a 不是,b 排前面
if
(
!
isAPriority
&&
isBPriority
)
return
1
;
// 其他情况保持原顺序(稳定排序)
return
0
;
});
console
.
log
(
249
,
this
.
detail
.
imageAry
);
},
col
:
{
...
...
@@ -1126,6 +1140,7 @@ export default {
this
.
hasSize
=
!!
size
;
this
.
detail
.
designImageSize
=
size
;
console
.
log
(
this
.
detail
,
"this.detail"
);
this
.
imgList
=
[];
this
.
selectIndex
=
-
1
;
if
(
value
.
length
>
0
)
{
...
...
vue.config.js
View file @
2ed9c7d7
...
...
@@ -128,6 +128,17 @@ module.exports = {
win
:
{
requestedExecutionLevel
:
"requireAdministrator"
,
target
:
[
{
target
:
"nsis"
,
arch
:
[
"x64"
,
"ia32"
],
// 支持64位和32位系统
},
],
},
nsis
:
{
oneClick
:
false
,
// 禁用一键安装
allowToChangeInstallationDirectory
:
true
,
// 允许用户更改安装目录
perMachine
:
true
,
// 为所有用户安装
},
},
},
...
...
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