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
97e0fb09
Commit
97e0fb09
authored
May 07, 2025
by
linjinhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改裁剪功能bug以及登录后网格消失问题
parent
08521d9f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
12 deletions
+53
-12
config/env.json
+2
-2
src/store/index.js
+14
-0
src/views/design/main/index.vue
+0
-0
src/views/login/index.vue
+37
-10
No files found.
config/env.json
View file @
97e0fb09
{
"apiApiHost"
:
"http
s://factory.jomalls.com
/api"
,
"fileApiUrl"
:
"https://factory.jomalls.com
/upload/factory"
,
"apiApiHost"
:
"http
://10.168.31.142:8060
/api"
,
"fileApiUrl"
:
"http://10.168.31.142:80
/upload/factory"
,
"visionUrl"
:
"https://console.jomalls.com"
}
src/store/index.js
View file @
97e0fb09
...
...
@@ -26,6 +26,16 @@ export default new Vuex.Store({
autoPrint
:
false
,
gridSpacing
:
10
,
},
grid
:
[
{
label
:
"16×18"
,
value
:
1
,
row
:
16
,
col
:
18
,
h
:
0
,
w
:
0
,
},
],
},
mutations
:
{
setDefaultSetting
(
state
)
{
...
...
@@ -55,6 +65,10 @@ export default new Vuex.Store({
setIsPreView
(
state
,
value
)
{
state
.
isPreView
=
value
;
},
setGrid
(
state
,
{
h
,
w
})
{
state
.
grid
[
0
].
h
=
h
;
state
.
grid
[
0
].
w
=
w
;
},
},
getters
:
{
systemSetting
(
state
)
{
...
...
src/views/design/main/index.vue
View file @
97e0fb09
This diff is collapsed.
Click to expand it.
src/views/login/index.vue
View file @
97e0fb09
<
script
>
const
{
ipcRenderer
}
=
require
(
"electron"
);
import
{
mapState
}
from
"vuex"
;
export
default
{
data
()
{
return
{
rules
:
{
factoryCode
:
[
{
message
:
"请输入工厂编码"
,
required
:
true
,
trigger
:
"blur"
}
{
message
:
"请输入工厂编码"
,
required
:
true
,
trigger
:
"blur"
}
,
],
account
:
[{
message
:
"请输入账号"
,
required
:
true
,
trigger
:
"blur"
}],
password
:
[{
message
:
"请输入密码"
,
required
:
true
,
trigger
:
"blur"
}]
password
:
[{
message
:
"请输入密码"
,
required
:
true
,
trigger
:
"blur"
}]
,
},
userList
:
[],
authorityVisible
:
false
,
...
...
@@ -17,12 +20,33 @@ export default {
form
:
{
factoryCode
:
""
,
account
:
""
,
password
:
""
}
password
:
""
,
}
,
};
},
computed
:
{
...
mapState
([
"grid"
]),
},
created
()
{
this
.
userList
=
this
.
$dataStore
.
get
(
'userList'
)
||
[]
this
.
userList
=
this
.
$dataStore
.
get
(
"userList"
)
||
[];
ipcRenderer
.
on
(
"window-size"
,
(
event
,
size
)
=>
{
const
{
width
,
height
}
=
size
;
console
.
log
(
`接收到窗口尺寸:
${
width
}
x
${
height
}
`
);
let
proportion
;
if
(
height
>
1000
)
{
proportion
=
1.7
;
}
else
if
(
height
>
900
&&
height
<=
1000
)
{
proportion
=
1.5
;
}
else
{
proportion
=
1
;
}
this
.
$store
.
commit
(
"setWHproportion"
,
proportion
);
this
.
$store
.
commit
(
"setGrid"
,
{
h
:
540
*
proportion
,
w
:
480
*
proportion
,
});
console
.
log
(
this
.
grid
);
});
},
mounted
()
{
document
.
addEventListener
(
"keyup"
,
this
.
keyUp
);
...
...
@@ -38,11 +62,14 @@ export default {
},
async
login
()
{
this
.
$refs
.
formRef
.
validate
(
async
valid
=>
{
this
.
$refs
.
formRef
.
validate
(
async
(
valid
)
=>
{
if
(
valid
)
{
let
f
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
));
let
{
data
}
=
await
this
.
$api
.
post
(
"/login"
,
f
);
this
.
$dataStore
.
set
(
"user"
,
{
...
data
.
sysUser
,...{
token
:
data
.
token
}
});
this
.
$dataStore
.
set
(
"user"
,
{
...
data
.
sysUser
,
...{
token
:
data
.
token
},
});
console
.
log
(
this
.
$dataStore
);
if
(
this
.
remember
)
{
let
userList
=
this
.
$dataStore
.
get
(
"userList"
);
...
...
@@ -50,7 +77,7 @@ export default {
if
(
userList
)
{
if
(
!
userList
.
find
(
el
=>
(
el
)
=>
el
.
account
===
f
.
account
&&
el
.
factoryCode
===
f
.
factoryCode
)
)
{
...
...
@@ -70,8 +97,8 @@ export default {
this
.
form
.
account
=
this
.
userList
[
v
].
account
;
this
.
form
.
factoryCode
=
this
.
userList
[
v
].
factoryCode
;
this
.
form
.
password
=
this
.
userList
[
v
].
password
;
}
}
}
,
}
,
};
</
script
>
...
...
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