Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周远喜
mes-ui
Commits
cd795b18
Commit
cd795b18
authored
Apr 20, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt
parents
00cc6099
e9f50b41
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1286 additions
and
744 deletions
+1286
-744
opration.vue
components/page/opration.vue
+10
-10
user.vue
components/page/user.vue
+38
-43
zh-CN.js
i18n/locale/zh-CN.js
+30
-8
product.vue
layouts/basic-layout/product.vue
+1
-1
default.vue
layouts/default.vue
+4
-1
henq.js
libs/henq.js
+11
-0
api.js
pages/aps/dispatch/api.js
+5
-1
index.vue
pages/aps/dispatch/index.vue
+145
-24
newEquipment.vue
...Management/deviceManagementCP/components/newEquipment.vue
+188
-166
index.vue
pages/resourceManagement/deviceManagementCP/index.vue
+391
-393
api.js
pages/resourceManagement/productionResources/api.js
+24
-0
index.vue
pages/resourceManagement/productionResources/index.vue
+205
-0
set.vue
pages/resourceManagement/productionResources/set.vue
+147
-0
index.js
store/index.js
+87
-97
No files found.
components/page/opration.vue
View file @
cd795b18
<
template
>
<Tooltip
trigger=
"hover"
v-if=
"title"
:content=
"title"
placement=
"top-end"
>
<a
class=
"op"
:class=
"css"
@
click=
"handler"
>
<slot>
<Icon
v-if=
"type=='icon'"
:type=
"icon"
/>
<span
v-else=
"type=='text'"
v-text=
"text"
></span>
</slot>
</a>
<Tooltip
trigger=
"hover"
v-if=
"title"
:content=
"title"
placement=
"top-end"
>
<a
class=
"op"
:class=
"css"
@
click=
"handler"
>
<slot>
<Icon
v-if=
"type=='icon'"
:type=
"icon"
/>
<span
v-else=
"type=='text'"
v-text=
"text"
></span>
</slot>
</a>
</Tooltip>
<a
class=
"op"
v-else
:class=
"css"
@
click=
"handler"
>
<a
class=
"op"
v-else
:class=
"css"
@
click=
"handler"
>
<slot>
<Icon
v-if=
"type=='icon'"
:type=
"icon"
/>
<span
v-else=
"type=='text'"
v-text=
"text"
></span>
...
...
@@ -25,8 +25,8 @@ export default {
type
:
String
},
type
:
{
type
:
String
,
default
:
"text"
type
:
String
,
default
:
"text"
},
title
:{
type
:
String
...
...
components/page/user.vue
View file @
cd795b18
...
...
@@ -2,22 +2,20 @@
<Poptip
placement=
"bottom-start"
trigger=
"hover"
width=
"240"
transfer
>
<label
:class=
"css"
>
{{
user
.
name
}}
</label>
<div
slot=
"content"
>
<Avatar
v-if=
"user.face"
size=
"large"
:src=
"user.face"
></Avatar>
<Avatar
v-if=
"user.face"
size=
"large"
:src=
"user.face"
></Avatar>
<Avatar
v-else
size=
"large"
style=
"color: #f56a00;background-color: #fde3cf; text-align:center"
:icon=
"user.gender=='男'?'md-person':'md-woman'"
></Avatar>
<div>
姓名:
{{
user
.
name
}}
<div>
姓名:
{{
user
.
name
}}
<tag
v-if=
"user.isDeleted"
>
已删除
</tag>
</div>
<div>
状态:
<state
:value=
"user.status"
type=
"tag"
code=
"User.base.status"
/>
<div>
状态:
<state
:value=
"user.status"
type=
"tag"
code=
"User.base.status"
/>
</div>
<div>
性别:
{{
user
.
gender
}}
</div>
<div>
部门:
{{
user
.
department
}}
</div>
...
...
@@ -27,7 +25,7 @@
</
template
>
<
script
>
export
default
{
name
:
'User'
,
name
:
"User"
,
props
:
{
value
:
{
type
:
[
Number
,
String
],
...
...
@@ -38,58 +36,55 @@ export default {
return
{
user
:
{
name
:
this
.
value
,
face
:
''
,
gender
:
''
,
roles
:
''
,
department
:
''
,
loginName
:
''
,
face
:
""
,
gender
:
""
,
roles
:
""
,
status
:
0
,
department
:
""
,
loginName
:
""
,
id
:
0
},
css
:
"s0"
}
css
:
"s0"
}
;
},
mounted
()
{
//{"id":77,"name":"杨华馥","gender":"男","department":"北京生产车间","roles":"admin","status":1,"isDeleted":false}
this
.
load
()
this
.
load
()
;
},
methods
:
{
load
()
{
if
(
this
.
value
)
{
var
user
=
this
.
$store
.
getters
.
getUser
(
this
.
value
)
var
user
=
this
.
$store
.
getters
.
getUser
(
this
.
value
)
;
if
(
user
)
{
this
.
user
=
user
}
else
{
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuser`
,
{
id
:
this
.
value
})
.
then
((
r
)
=>
{
// alert(JSON.stringify( r.result))
if
(
r
.
success
)
{
this
.
user
=
r
.
result
if
(
this
.
user
.
isDeleted
){
this
.
css
=
"s2"
}
else
if
(
this
.
user
.
status
==
1
){
this
.
css
=
"s1"
}
if
(
this
.
user
.
face
){
this
.
user
.
face
=
fileUrlDown
+
this
.
user
.
face
;
}
// this.$store.commit('addUser', r.result)
}
})
this
.
user
=
user
;
if
(
this
.
user
.
isDeleted
)
{
this
.
css
=
"s2"
;
}
else
if
(
this
.
user
.
status
==
1
)
{
this
.
css
=
"s1"
;
}
if
(
this
.
user
.
face
)
{
this
.
user
.
face
=
fileUrlDown
+
this
.
user
.
face
;
}
}
}
}
},
watch
:
{
value
(
v
)
{
if
(
v
>
0
)
this
.
load
()
if
(
v
>
0
)
this
.
load
()
;
}
}
}
}
;
</
script
>
<
style
lang=
"less"
>
.s2{color: red;}
.s1{color: #333}
.s0{color:#ddd}
.s2 {
color: red;
}
.s1 {
color: #333;
}
.s0 {
color: #ddd;
}
</
style
>
\ No newline at end of file
i18n/locale/zh-CN.js
View file @
cd795b18
...
...
@@ -924,14 +924,14 @@ export default {
demandStartDate
:
'投料时间'
,
demandFinishDate
:
'节点时间'
,
//tempTitle------
stage
:
'阶段'
,
materialId
:
'材料'
,
routing_Method
:
'工艺方法'
,
outer_Envelope_Size
:
'外包络尺寸'
,
guestName
:
'甲方客户'
,
taskCode
:
'甲方任务号'
,
putintDocmentCode
:
'甲方投产输入文件(编号)'
,
technologyDocmentCode
:
'甲方技术输入文件(编号)'
,
stage
:
'阶段'
,
materialId
:
'材料'
,
routing_Method
:
'工艺方法'
,
outer_Envelope_Size
:
'外包络尺寸'
,
guestName
:
'甲方客户'
,
taskCode
:
'甲方任务号'
,
putintDocmentCode
:
'甲方投产输入文件(编号)'
,
technologyDocmentCode
:
'甲方技术输入文件(编号)'
,
},
mes_part_task_plan_simulate
:
{
id
:
''
,
...
...
@@ -1259,5 +1259,27 @@ export default {
productionRequirement
:
'生产要求'
,
standard
:
'标准指标'
,
qualityTemplateName
:
'模板文件名称'
,
},
plan_resource
:
{
id
:
''
,
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'更新时间'
,
lastModifierUserId
:
'更新人'
,
isDeleted
:
'删除人'
,
deletionTime
:
'删除时间'
,
deleterUserId
:
'删除人'
,
title
:
'资源名称'
,
code
:
'资源编号'
,
type
:
'资源类型'
,
property
:
'属性'
,
departId
:
'部门id'
,
departTitle
:
'部门'
,
calId
:
'工作日历编号'
,
holidayCalId
:
'加班日历编号'
,
calName
:
'工作日历名称'
,
holidayCalName
:
'加班日历名称'
,
isimportant
:
'关重'
,
capabilityValue
:
'能力值'
,
}
}
layouts/basic-layout/product.vue
View file @
cd795b18
...
...
@@ -74,7 +74,7 @@
</Header>
<div
class=
"i-tabs"
>
<transition
name=
"fade-quick"
>
<i-tabs
v-if=
"tabs"
v-show=
"showHeader"
@
on-reload=
"handleReload"
/>
<i-tabs
v-show=
"showHeader"
@
on-reload=
"handleReload"
/>
</transition>
</div>
<Content
class=
"i-layout-content"
>
...
...
layouts/default.vue
View file @
cd795b18
...
...
@@ -22,6 +22,10 @@ export default {
menus
:
[]
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
"loadUsers"
);
//加载缓存的用户
},
created
()
{
// 处理路由 得到每一级的路由设置
this
.
$store
.
commit
(
"admin/page/init"
,
frameInRoutes
);
...
...
@@ -66,7 +70,6 @@ export default {
}
},
methods
:
{
getMenu
()
{
this
.
$http
.
sysUser
.
getusermenu
().
then
(
res
=>
{
if
(
res
.
result
)
{
...
...
libs/henq.js
View file @
cd795b18
...
...
@@ -96,6 +96,17 @@ henq.getDate = (strDate) => {
}).
match
(
/
\d
+/g
)
+
')'
);
return
date
;
}
henq
.
group
=
(
array
,
f
)
=>
{
const
groups
=
{};
array
.
forEach
(
function
(
o
)
{
const
group
=
JSON
.
stringify
(
f
(
o
));
groups
[
group
]
=
groups
[
group
]
||
[];
groups
[
group
].
push
(
o
);
});
return
Object
.
keys
(
groups
).
map
(
function
(
group
)
{
return
groups
[
group
];
});
}
henq
.
toTree
=
(
list
,
rootId
,
format
,
parentFiledName
)
=>
{
var
upId
=
parentFiledName
;
let
i
=
0
;
...
...
pages/aps/dispatch/api.js
View file @
cd795b18
...
...
@@ -25,7 +25,11 @@ export default {
saveTeamentry
(
params
){
return
Api
.
post
(
`
${
PlanUrl
}
/teamsdispatchs/saveteamentry`
,
params
);
},
//删除:
// 删除拆分项
deleteItem
(
params
){
return
Api
.
get
(
`
${
PlanUrl
}
/teamsdispatchs/deldispatch`
,
params
);
},
//删除:
delete
(
params
)
{
return
Api
.
delete
(
`
${
PlanUrl
}
/mesorder/delete`
,
{
params
:
params
...
...
pages/aps/dispatch/index.vue
View file @
cd795b18
This diff is collapsed.
Click to expand it.
pages/resourceManagement/deviceManagementCP/components/newEquipment.vue
View file @
cd795b18
This diff is collapsed.
Click to expand it.
pages/resourceManagement/deviceManagementCP/index.vue
View file @
cd795b18
This diff is collapsed.
Click to expand it.
pages/resourceManagement/productionResources/api.js
0 → 100644
View file @
cd795b18
// import Api from '@/api/axios'
import
Api
from
'@/plugins/request'
export
default
{
index
:
`
${
systemUrl
}
/planresource/paged`
,
paged
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/planresource/paged`
,
params
);
},
get
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/planresource/get`
,
params
);
},
create
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/mesdailyworksched/list`
,
params
);
},
create1
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/mesholidaycal/list`
,
params
);
},
update
(
params
)
{
return
Api
.
post
(
`
${
systemUrl
}
/equipcalendarwork/createorupdate`
,
params
);
},
//删除:
delete
(
params
)
{
return
Api
.
delete
(
`
${
systemUrl
}
/planresource/delete`
,
{
params
:
params
});
},
}
\ No newline at end of file
pages/resourceManagement/productionResources/index.vue
0 → 100644
View file @
cd795b18
<
template
>
<div>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
:high=
"false"
>
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入关键字资源名称/资源编号/资源类型/部门"
v-model=
"easySearch.keys.value"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
</FormItem>
</Form>
</
template
>
</DataGrid>
<Modal
v-model=
"editModal"
title=
"编辑"
footer-hide
>
<Set
:eid=
"curId"
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"deletelModal"
title=
"删除"
@
on-ok=
"removeOk"
@
on-cancel=
"cancel"
>
<p>
确定删除?
</p>
</Modal>
</div>
</template>
<
script
>
import
Api
from
"./api"
;
import
Set
from
"./set"
;
export
default
{
name
:
"list"
,
components
:
{
Set
},
data
()
{
return
{
action
:
Api
.
index
,
easySearch
:
{
keys
:
{
op
:
"title,code,type,departTitle"
,
value
:
null
}
},
editModal
:
false
,
deletelModal
:
false
,
curId
:
0
,
columns
:
[
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
},
// {
// key: "deleterUserId",
// title: this.l("deleterUserId"),
// hide: true,
// align: "left"
// },
{
key
:
"title"
,
title
:
this
.
l
(
"title"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"code"
,
title
:
this
.
l
(
"code"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"type"
,
title
:
this
.
l
(
"type"
),
align
:
"center"
,
code
:
"aps.resource.type"
,
easy
:
true
,
high
:
true
},
// {
// key: "property",
// title: this.l("property"),
// align: "left",
// high: true
// },
// {
// key: "departId",
// title: this.l("departId"),
// align: "left",
// high: true
// },
{
key
:
"departTitle"
,
title
:
this
.
l
(
"departTitle"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"calId"
,
title
:
this
.
l
(
"calId"
),
align
:
"center"
,
easy
:
true
,
high
:
true
},
{
key
:
"holidayCalId"
,
title
:
this
.
l
(
"holidayCalId"
),
align
:
"center"
,
easy
:
true
,
high
:
true
},
{
key
:
"calName"
,
title
:
this
.
l
(
"calName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
key
:
"holidayCalName"
,
title
:
this
.
l
(
"holidayCalName"
),
align
:
"left"
,
easy
:
true
,
high
:
true
},
{
title
:
"操作"
,
key
:
"id"
,
width
:
140
,
align
:
"center"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"div"
,
{
class
:
"action"
},
[
h
(
"op"
,
{
attrs
:
{
oprate
:
"edit"
},
on
:
{
click
:
()
=>
this
.
edit
(
params
.
row
.
id
)
}
},
"设置日历"
),
h
(
"op"
,
{
attrs
:
{
oprate
:
"remove"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
},
"删除"
)
]);
}
}
]
};
},
mounted
()
{
console
.
log
(
this
);
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
methods
:
{
addOk
()
{
this
.
$refs
.
grid
.
load
();
this
.
editModal
=
false
;
this
.
curId
=
0
;
},
search
()
{
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
},
edit
(
id
)
{
this
.
editModal
=
true
;
this
.
curId
=
id
;
},
remove
(
id
)
{
this
.
deletelModal
=
true
;
this
.
curId
=
id
;
},
removeOk
()
{
Api
.
delete
({
id
:
this
.
curId
}).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
deletelModal
=
false
;
this
.
$Message
.
success
(
"删除成功"
);
}
});
},
removeCancel
()
{
this
.
deletelModal
=
false
;
},
cancel
()
{
this
.
curId
=
0
;
this
.
addModal
=
false
;
this
.
detailModal
=
false
;
this
.
editModal
=
false
;
this
.
deletedlModal
=
false
;
},
l
(
key
)
{
let
vkey
=
"plan_resource"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
}
}
};
</
script
>
<
style
lang=
"less"
>
</
style
>
\ No newline at end of file
pages/resourceManagement/productionResources/set.vue
0 → 100644
View file @
cd795b18
<
template
>
<Form
ref=
"form"
:model=
"entity"
:rules=
"rules"
:label-width=
"90"
>
<Row>
<Col
span=
"12"
>
<FormItem
label=
"资源名称"
prop=
"equip_name"
>
<Input
v-model=
"formItem.equip_name"
placeholder=
"请输入设备名称"
readonly
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"资源编号"
prop=
"equip_id"
>
<Input
v-model=
"formItem.equip_id"
placeholder=
"请输入设备编号"
readonly
></Input>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"工作日历"
prop=
"work"
>
<Select
v-model=
"formItem1.calendarwork_pk"
clearable
placeholder=
"请选择..."
>
<Option
v-for=
"item in workList"
:value=
"item.id"
:key=
"item.calName"
>
{{
item
.
calName
}}
</Option>
</Select>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"加班日历"
prop=
"overtime"
>
<Select
v-model=
"formItem2.calendarovertime_pk"
clearable
placeholder=
"请选择..."
>
<Option
v-for=
"item in overtimeList"
:value=
"item.id"
:key=
"item.holidayCalName"
>
{{
item
.
holidayCalName
}}
</Option>
</Select>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</Form>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
name
:
"Edit"
,
data
()
{
return
{
disabled
:
false
,
workList
:
[],
overtimeList
:
[],
formItem
:
{
equip_name
:
""
,
equip_id
:
""
},
formItem1
:
{
id
:
0
,
equip_pk
:
0
,
calendarwork_pk
:
0
},
formItem2
:
{
id
:
0
,
equip_pk
:
0
,
calendarovertime_pk
:
0
},
entity
:
{},
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
}
};
},
props
:
{
eid
:
Number
},
created
()
{
this
.
laodaction
();
},
methods
:
{
laodaction
()
{
let
parmse
=
{
pageIndex
:
1
,
conditions
:
[],
pageSize
:
10
};
Api
.
create
(
parmse
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
workList
=
r
.
result
;
}
else
{
this
.
$Message
.
error
(
"获取数据失败..."
);
}
});
Api
.
create1
(
parmse
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
overtimeList
=
r
.
result
;
}
else
{
this
.
$Message
.
error
(
"获取数据失败..."
);
}
});
},
load
(
v
)
{
Api
.
get
({
id
:
v
}).
then
(
r
=>
{
this
.
formItem
.
equip_name
=
r
.
result
.
title
;
this
.
formItem
.
equip_id
=
r
.
result
.
code
;
this
.
formItem1
.
equip_pk
=
r
.
result
.
id
;
this
.
formItem2
.
equip_pk
=
r
.
result
.
id
;
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
this
.
disabled
=
true
;
Api
.
update
({
equipCalendarWork
:
this
.
formItem1
,
equipCalendarOverTime
:
this
.
formItem2
})
.
then
(
r
=>
{
this
.
disabled
=
false
;
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"保存成功"
);
this
.
$emit
(
"on-ok"
);
}
else
{
this
.
$Message
.
error
(
"保存失败"
);
}
})
.
catch
(
err
=>
{
this
.
disabled
=
false
;
this
.
$Message
.
error
(
"保存失败"
);
console
.
warn
(
err
);
});
}
});
},
handleClose
()
{
this
.
$emit
(
"on-close"
);
},
l
(
key
)
{
key
=
"plan_resource"
+
"."
+
key
;
return
this
.
$t
(
key
);
}
},
watch
:
{
eid
(
v
)
{
if
(
v
!=
0
)
{
this
.
formItem1
.
calendarwork_pk
=
""
;
this
.
formItem2
.
calendarovertime_pk
=
""
;
this
.
load
(
v
);
}
}
}
};
</
script
>
\ No newline at end of file
store/index.js
View file @
cd795b18
import
createVuexAlong
from
'vuex-along'
import
Api
from
'@/plugins/request'
export
const
state
=
()
=>
({
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
userMap
:
[],
//所有用户缓存;
userInfo
:
{
userId
:
0
,
userName
:
""
},
cart
:[],
count
:
0
,
countAps
:
0
,
//aps排产
countAi
:
0
,
//智能排产
countAll
:
0
,
//整机排产
countRun
:
0
,
//流水排产
export
const
state
=
()
=>
({
counter
:
0
,
dictionary
:
new
Map
(),
//所有字典项
userMap
:
new
Map
(),
//所有用户缓存;
userInfo
:
{
userId
:
0
,
userName
:
""
},
cart
:[],
count
:
0
,
countAps
:
0
,
//aps排产
countAi
:
0
,
//智能排产
countAll
:
0
,
//整机排产
countRun
:
0
,
//流水排产
})
export
const
getters
=
{
export
const
getters
=
{
dictionaryByKey
:
(
state
)
=>
(
key
)
=>
{
let
result
=
[];
let
items
=
state
.
dictionary
.
get
(
key
);
...
...
@@ -25,79 +25,69 @@ export const getters = {
}
return
result
;
},
getUser
:
state
=>
key
=>
{
// try{
// if(state.userMap.has(key)){
// return state.userMap.get(key);
// }
// }catch(e){
// console.log(e);
// }
let
user
=
state
.
userMap
.
filter
(
u
=>
{
return
u
.
id
==
key
});
if
(
user
.
length
>
0
)
{
return
user
[
0
]
}
else
{
return
null
;
getUser
:(
state
)
=>
key
=>
{
// debugger
if
(
state
.
userMap
&&
state
.
userMap
.
get
){
return
state
.
userMap
.
get
(
key
);
}
}
}
export
const
mutations
=
{
increment
(
state
)
{
state
.
counter
++
},
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
},
addUser
(
state
,
user
)
{
state
.
userMap
.
push
(
user
);
},
setDictionary
(
state
,
dictionary
)
{
state
.
dictionary
=
dictionary
;
},
setCart
(
state
,
cart
)
{
state
.
cart
=
cart
;
},
setCartCount
(
state
,
count
)
{
state
.
count
=
count
;
},
setCountAps
(
state
,
count
)
{
//设置aps排产数量
state
.
countAps
=
count
;
},
setCountAi
(
state
,
count
)
{
//设置智能排产数量
state
.
countAi
=
count
;
},
setCountAll
(
state
,
count
)
{
//设置整机排产数量
state
.
countAll
=
count
;
},
setCountRun
(
state
,
count
)
{
//设置流水排产数量
state
.
countRun
=
count
;
}
export
const
mutations
=
{
increment
(
state
){
state
.
counter
++
},
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
// sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
// sessionStorage.setItem("token", userInfo.token);
},
setUsers
(
state
,
users
){
state
.
userMap
=
users
;
},
addUser
(
state
,
user
){
state
.
userMap
.
push
(
user
);
},
setDictionary
(
state
,
dictionary
)
{
state
.
dictionary
=
dictionary
;
},
setCart
(
state
,
cart
)
{
state
.
cart
=
cart
;
},
setCartCount
(
state
,
count
)
{
state
.
count
=
count
;
},
setCountAps
(
state
,
count
)
{
//设置aps排产数量
state
.
countAps
=
count
;
},
setCountAi
(
state
,
count
)
{
//设置智能排产数量
state
.
countAi
=
count
;
},
setCountAll
(
state
,
count
)
{
//设置整机排产数量
state
.
countAll
=
count
;
},
setCountRun
(
state
,
count
)
{
//设置流水排产数量
state
.
countRun
=
count
;
}
}
export
const
actions
=
{
async
loadUser
({
commit
},
key
)
{
let
{
result
}
=
await
this
.
$api
.
get
(
`
${
systemUrl
}
/user/getuser`
,
{
id
:
key
export
const
actions
=
{
async
loadUser
({
commit
},
key
){
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuser`
,{
id
:
key
});
console
.
warn
(
"result"
,
result
)
commit
(
"addUser"
,
result
);
},
async
loadUsers
({
commit
}){
let
{
result
}
=
await
Api
.
get
(
`
${
systemUrl
}
/user/getuserlist`
);
var
map
=
new
Map
();
result
.
map
(
u
=>
{
map
.
set
(
u
.
id
,
u
);
});
console
.
warn
(
"result"
,
result
)
commit
(
"addUser"
,
result
);
commit
(
"setUsers"
,
map
)
},
async
loadDictionary
({
commit
})
{
async
loadDictionary
({
commit
})
{
let
url
=
`
${
systemUrl
}
/Dictionary/GetAll`
let
{
result
}
=
await
Api
.
get
(
url
);
let
{
result
}
=
await
Api
.
get
(
url
);
var
map
=
new
Map
();
...
...
@@ -110,20 +100,20 @@ export const actions = {
}
}
export
const
plugins
=
[
createVuexAlong
({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name
:
"hyhmes"
,
local
:
{
list
:
[
"hyhmes"
],
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter
:
true
,
},
session
:
{
// 保存模块 ma 中的 a1 到 sessionStorage
list
:
[
"hyhmes.session"
],
},
}),
]
//设置 strict 为不严格模式,即可在actions中修改state
export
const
strict
=
false
;
export
const
plugins
=
[
createVuexAlong
({
// 设置保存的集合名字,避免同站点下的多项目数据冲突
name
:
"hyhmes"
,
local
:
{
list
:
[
"hyhmes"
],
// 过滤模块 ma 数据, 将其他的存入 localStorage
isFilter
:
true
,
},
session
:
{
// 保存模块 ma 中的 a1 到 sessionStorage
list
:
[
"hyhmes.session"
],
},
}),
]
//设置 strict 为不严格模式,即可在actions中修改state
export
const
strict
=
false
;
\ No newline at end of file
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