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
2cf858d8
Commit
2cf858d8
authored
Apr 02, 2020
by
佟礼
Browse files
Options
Browse Files
Download
Plain Diff
工艺规程语言包
parents
54aabd35
354e6256
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1092 additions
and
373 deletions
+1092
-373
account.js
api/account.js
+1
-1
dataGrid.vue
components/page/dataGrid.vue
+4
-0
tb.vue
components/tb.vue
+18
-0
zh-CN.js
i18n/locale/zh-CN.js
+34
-26
product.vue
layouts/basic-layout/product.vue
+374
-0
default.vue
layouts/default.vue
+1
-24
product.vue
layouts/product.vue
+19
-0
index.vue
pages/account/login/index.vue
+53
-56
add.vue
pages/aps/aps/add.vue
+119
-33
api.js
pages/aps/aps/api.js
+29
-1
edit.vue
pages/aps/aps/components/edit.vue
+72
-18
excute.vue
pages/aps/aps/components/excute.vue
+41
-26
index.vue
pages/aps/aps/index.vue
+112
-21
dispatch.less
pages/aps/dispatch/dispatch.less
+1
-0
index.vue
pages/aps/plan/index.vue
+1
-0
api.js
pages/aps/results/api.js
+5
-5
detail.vue
pages/basicData/systemlog/components/detail.vue
+2
-2
index.vue
pages/basicData/user/index.vue
+4
-3
userInfo.vue
pages/basicData/userManagent/userInfo.vue
+12
-3
table.less
pages/implement/table.less
+1
-0
trialOrder.vue
...rocessDesign/ChangeSingle/unqualifiedorder/trialOrder.vue
+2
-2
index.vue
pages/system/host/index.vue
+1
-1
index.vue
pages/system/tanant/index.vue
+1
-1
iview.js
plugins/iview.js
+1
-1
index.js
plugins/request/index.js
+22
-14
account.js
store/admin/account.js
+160
-133
index.js
store/index.js
+2
-2
No files found.
api/account.js
View file @
2cf858d8
...
...
@@ -2,7 +2,7 @@ import request from '@/plugins/request';
export
function
AccountLogin
(
data
)
{
return
request
({
url
:
'/api/login'
,
url
:
`
${
authUrl
}
/api/services/app/auth/login`
,
method
:
'post'
,
data
});
...
...
components/page/dataGrid.vue
View file @
2cf858d8
...
...
@@ -500,6 +500,10 @@ export default {
watch
:{
"data.length"
(){
this
.
list
=
this
.
data
;
},
"height"
()
{
this
.
tableHeight
=
this
.
height
;
}
}
}
...
...
components/tb.vue
0 → 100644
View file @
2cf858d8
<
template
>
<Table
:border=
"tbPro.isBorder"
stripe
:columns=
"tbPro.columns"
:stripe=
"tbPro.stripe"
:data=
"tbPro.data"
:highlight-row=
"tbPro.highlight"
:loading=
"tbPro.loading"
:height=
"tbPro.height"
:content=
"tbPro.cur"
@
on-row-click=
"rowclick"
class=
"tableCommon"
></Table>
</
template
>
<
script
>
export
default
{
name
:
'tb'
,
props
:[
//'columns1','data1','isBorder'
'tbPro'
],
methods
:{
rowclick
(
rowdata
,
index
){
this
.
$emit
(
'rowclick'
,
rowdata
,
index
)
}
}
}
</
script
>
\ No newline at end of file
i18n/locale/zh-CN.js
View file @
2cf858d8
...
...
@@ -1051,6 +1051,14 @@ export default {
routing_header_id
:
''
,
comb_param
:
''
,
rule_qty
:
''
,
taskSeq
:
'工序号'
,
efficiencyValue
:
'效率系数'
,
calId
:
'连班策略'
,
overTime
:
'六日加班'
,
isDiscrete
:
'是否离散'
,
multipleEquip
:
"是否多台安排设备"
,
// 否 是
multipleEquipIds
:
"设备id"
,
//用英文逗号分隔
discrete
:
'离散值'
,
},
routing_header
:{
id
:
''
,
...
...
@@ -1174,30 +1182,30 @@ export default {
stepContent
:
'工步内容'
,
extend
:
'扩展字段'
,
},
routing_qc_card
:{
id
:
''
,
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'修改时间'
,
lastModifierUserId
:
'修改人'
,
isDeleted
:
'是否删除'
,
deleterUserId
:
'删除人'
,
deletionTime
:
'删除时间'
,
routingHeaderId
:
'工艺'
,
routingDetailId
:
'工序'
,
routingStepId
:
'工步'
,
checkContent
:
'检验内容'
,
checkType
:
'检验标记'
,
checkParams
:
'参数名称'
,
measurementUnit
:
'单位'
,
fillintype
:
'汇报类型'
,
qualityTemplate
:
'模板'
,
isphotograph
:
'是否拍照'
,
status
:
'状态'
,
extend
:
'扩展字段'
,
remark
:
'备注'
,
productionRequirement
:
'生产要求'
,
standard
:
'标准指标'
,
qualityTemplateName
:
'模板文件名称'
,
routing_qc_card
:
{
id
:
''
,
creationTime
:
'创建时间'
,
creatorUserId
:
'创建人'
,
lastModificationTime
:
'修改时间'
,
lastModifierUserId
:
'修改人'
,
isDeleted
:
'是否删除'
,
deleterUserId
:
'删除人'
,
deletionTime
:
'删除时间'
,
routingHeaderId
:
'工艺'
,
routingDetailId
:
'工序'
,
routingStepId
:
'工步'
,
checkContent
:
'检验内容'
,
checkType
:
'检验标记'
,
checkParams
:
'参数名称'
,
measurementUnit
:
'单位'
,
fillintype
:
'汇报类型'
,
qualityTemplate
:
'模板'
,
isphotograph
:
'是否拍照'
,
status
:
'状态'
,
extend
:
'扩展字段'
,
remark
:
'备注'
,
productionRequirement
:
'生产要求'
,
standard
:
'标准指标'
,
qualityTemplateName
:
'模板文件名称'
,
}
}
\ No newline at end of file
layouts/basic-layout/product.vue
0 → 100644
View file @
2cf858d8
This diff is collapsed.
Click to expand it.
layouts/default.vue
View file @
2cf858d8
...
...
@@ -33,7 +33,6 @@ export default {
},
mounted
()
{
this
.
getMenu
();
this
.
initUserInfo
();
},
watch
:
{
// 监听路由 控制侧边栏显示 标记当前顶栏菜单(如需要)
...
...
@@ -66,29 +65,7 @@ export default {
}
},
methods
:
{
//获取用户基本信息
initUserInfo
()
{
let
userInfo
=
this
.
$store
.
state
.
admin
.
user
.
info
;
let
parma
=
{
Id
:
userInfo
.
userId
};
this
.
$http
.
sysUser
.
getuserinfo
(
parma
).
then
(
res
=>
{
if
(
res
.
result
)
{
if
(
res
.
result
.
avatarUrl
&&
res
.
result
.
avatarUrl
!=
""
&&
res
.
result
.
avatarUrl
!=
null
)
{
res
.
result
.
avatarUrl
=
fileUrlDown
+
res
.
result
.
avatarUrl
;
}
this
.
$store
.
commit
(
"admin/user/setUserAvatar"
,
res
.
result
);
}
else
{
this
.
$Message
.
error
(
"用户信息查询失败!"
);
}
});
},
//用户中心结束
//menu
getMenu
()
{
this
.
$http
.
sysUser
.
getusermenu
().
then
(
res
=>
{
if
(
res
.
result
)
{
...
...
layouts/product.vue
0 → 100644
View file @
2cf858d8
<
template
>
<Layout
class=
"i-layout"
>
<Header>
<i-header-breadcrumb
v-if=
"showBreadcrumb && !headerMenu && !isMobile"
ref=
"breadcrumb"
/>
<div
class=
"i-layout-header-right"
>
<i-header-search
v-if=
"(showSearch && isMobile) || (showSearch && (headerMenu || showBreadcrumb))"
/>
<i-header-log
v-if=
"isDesktop && showLog"
/>
<i-header-bug
/>
<i-header-fullscreen
v-if=
"isDesktop && showFullscreen"
/>
<i-header-notice
v-if=
"showNotice"
/>
<i-header-user
/>
<i-header-i18n
v-if=
"showI18n"
/>
<i-header-setting
v-if=
"enableSetting && !isMobile"
/>
</div>
</Header>
<Content>
<nuxt
v-if=
"loadRouter"
/></Content>
</Layout>
</
template
>
\ No newline at end of file
pages/account/login/index.vue
View file @
2cf858d8
<
template
>
<div
class=
"account"
>
<Carousel
v-model=
"value1"
autoplay
autoplay-speed=
"5000"
loop
class=
"zmd"
>
<Carousel
v-model=
"value1"
autoplay
:
autoplay-speed=
"5000"
loop
class=
"zmd"
>
<CarouselItem>
<div
class=
"bg bg0"
>
1
</div>
</CarouselItem>
...
...
@@ -29,17 +29,16 @@
<!--
<div
class=
"page-account-top-desc tc"
>
SaaS MES 制造执行系统
</div>
-->
</div>
<h3
class=
"mb20"
>
用户登陆
</h3>
<Login
@
on-submit=
"
oidc
"
>
<UserName
name=
"username"
value=
"
admin
"
/>
<Password
name=
"password"
value=
"
admin
"
enter-to-submit
/>
<Login
@
on-submit=
"
handleSubmit
"
>
<UserName
name=
"username"
value=
"
13211111111
"
/>
<Password
name=
"password"
value=
"
1
"
enter-to-submit
/>
<div
class=
"page-account-auto-login mb20"
>
<Checkbox
v-model=
"autoLogin"
>
{{
$t
(
'page.login.remember'
)
}}
</Checkbox>
<Checkbox
v-model=
"autoLogin"
>
{{
$t
(
'page.login.remember'
)
}}
</Checkbox>
<a
href
>
{{
$t
(
'page.login.forgot'
)
}}
</a>
</div>
<div
class=
"mt20"
>
<Submit
class=
"shadown"
>
{{
$t
(
'page.login.submit'
)
}}
</Submit>
</div>
</Login>
</div>
</div>
...
...
@@ -58,6 +57,7 @@ export default {
components
:
{
iCopyright
},
data
()
{
return
{
value1
:
0
,
autoLogin
:
true
};
},
...
...
@@ -66,34 +66,6 @@ export default {
},
methods
:
{
...
mapActions
(
"admin/account"
,
[
"login"
]),
oidc
()
{
let
that
=
this
;
mgr
.
getUser
().
then
(
function
(
user
)
{
if
(
user
)
{
console
.
info
(
"user"
,
user
)
that
.
msg
=
"该用户已经登录"
;
const
userInfos
=
{
token
:
user
.
access_token
,
login_id
:
user
.
profile
.
name
,
userId
:
user
.
profile
[
"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"
],
accountId
:
user
.
profile
.
sub
,
tanantCode
:
user
.
profile
.
TanantCode
,
name
:
"Aresn"
,
avatar
:
"https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar"
,
access
:
[
"admin"
]
};
// that.$store.commit('setUserInfo',userInfos);
that
.
oidcLogin
(
userInfos
);
window
.
location
=
"/"
;
}
else
{
mgr
.
signinRedirect
();
}
});
},
/**
* @description 登录
* 表单校验已有 iView Pro 自动完成,如有需要修改,请阅读 iView Pro 文档
...
...
@@ -104,26 +76,50 @@ export default {
this
.
login
({
username
,
password
}).
then
(()
=>
{
// 重定向对象不存在则返回顶层路径
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
"/"
);
}).
then
(
r
=>
{
if
(
r
>
0
)
{
this
.
$Message
.
success
(
"登陆成功!"
);
this
.
initUserInfo
(
r
);
}
else
{
this
.
$Message
.
error
(
"登陆失败!"
);
}
});
}
},
oidcLogin
(
user
)
{
util
.
cookies
.
set
(
"uuid"
,
user
.
userId
);
util
.
cookies
.
set
(
"token"
,
user
.
token
);
// 设置 vuex 用户信息
this
.
$store
.
dispatch
(
"admin/user/set"
,
user
,
{
root
:
true
});
// 用户登录后从持久化数据加载一系列的设置
this
.
$store
.
dispatch
(
"load"
);
this
.
$store
.
commit
(
"setUserInfo"
,
user
);
initUserInfo
(
id
)
{
let
parma
=
{
Id
:
id
};
this
.
$http
.
sysUser
.
getuserinfo
(
parma
).
then
(
res
=>
{
if
(
res
.
result
)
{
if
(
res
.
result
.
avatarUrl
&&
res
.
result
.
avatarUrl
!=
""
&&
res
.
result
.
avatarUrl
!=
null
)
{
res
.
result
.
avatarUrl
=
fileUrlDown
+
res
.
result
.
avatarUrl
;
}
let
info
=
res
.
result
;
info
.
auth
=
[
"admin"
];
info
.
avatar
=
info
.
avatarUrl
;
info
.
userId
=
info
.
id
;
info
.
name
=
info
.
userName
;
this
.
$store
.
dispatch
(
"admin/user/set"
,
info
,
{
root
:
true
});
// setUserInfo
this
.
$store
.
commit
(
"setUserInfo"
,
info
)
this
.
$router
.
replace
(
this
.
$route
.
query
.
redirect
||
"/"
);
}
else
{
this
.
$Message
.
error
(
"用户信息22查询失败!"
);
}
});
}
}
};
</
script
>
<
style
lang=
"less"
>
@jianju:40px;
@jianju:
40px;
.account {
position: fixed;
width: 100%;
...
...
@@ -160,12 +156,14 @@ export default {
left: @jianju;
right: @jianju;
bottom: @jianju;
background: rgba(38,
128,
235, 0.3);
background: rgba(38,
128,
235, 0.3);
display: flex;
.ad{
.ad
{
flex: 1;
text-align: center;
img{margin-top: 400px;}
img {
margin-top: 400px;
}
}
.login {
background-color: white;
...
...
@@ -176,14 +174,13 @@ export default {
// background-position-y: 525px;
.ivu-input-wrapper {
margin-bottom: 5px;
}
.mt20{
.mt20
{
margin-top: 50px;
.shadown{
box-shadow: 1px 5px 15px #2680
EB
;
.shadown
{
box-shadow: 1px 5px 15px #2680
eb
;
}
.ivu-btn-large
{
.ivu-btn-large
{
height: 50px !important;
}
}
...
...
pages/aps/aps/add.vue
View file @
2cf858d8
...
...
@@ -11,33 +11,36 @@
<span
slot=
"close"
>
Off
</span>
</i-switch>
</FormItem>
<FormItem
:label=
"l('cal_id')"
prop=
"cal_id"
>
<Select
v-model=
"entity.cal_id"
style=
"width:150px"
>
<Option
value=
"beijing"
>
策略1
</Option>
<Option
value=
"shanghai"
>
策略2
</Option>
<Option
value=
"shenzhen"
>
策略3
</Option>
<FormItem
:label=
"l('calId')"
prop=
"calId"
>
<Select
v-model=
"entity.calId"
style=
"width:150px"
>
<Option
v-for=
"(item,index) in listCal"
:key=
"index"
:value=
"item.calid"
:label=
"item.calname"
></Option>
</Select>
</FormItem>
<FormItem
:label=
"l('over
_time')"
prop=
"over_t
ime"
>
<i-switch
v-model=
"entity.over
_t
ime"
size=
"large"
>
<FormItem
:label=
"l('over
Time')"
prop=
"overT
ime"
>
<i-switch
v-model=
"entity.over
T
ime"
size=
"large"
>
<span
slot=
"open"
>
On
</span>
<span
slot=
"close"
>
Off
</span>
</i-switch>
</FormItem>
<FormItem
:label=
"l('efficiency
_value')"
prop=
"efficiency_v
alue"
>
<Input
v-model=
"entity.efficiency
_v
alue"
style=
"width:150px"
></Input>
<FormItem
:label=
"l('efficiency
Value')"
prop=
"efficiencyV
alue"
>
<Input
v-model=
"entity.efficiency
V
alue"
style=
"width:150px"
></Input>
</FormItem>
<FormItem
:label=
"l('run_time')"
prop=
"run_time"
>
<InputNumber
v-model=
"entity.run_time"
></InputNumber>
</FormItem>
<FormItem
:label=
"l('is
discrete')"
prop=
"isd
iscrete"
>
<i-switch
v-model=
"entity.is
d
iscrete"
size=
"large"
>
<FormItem
:label=
"l('is
Discrete')"
prop=
"isD
iscrete"
>
<i-switch
v-model=
"entity.is
D
iscrete"
size=
"large"
>
<span
slot=
"open"
>
On
</span>
<span
slot=
"close"
>
Off
</span>
</i-switch>
</FormItem>
<FormItem
:label=
"l('discrete
_value')"
prop=
"discrete_valu
e"
>
<InputNumber
v-model=
"entity.discrete
_value
"
></InputNumber>
<FormItem
:label=
"l('discrete
')"
prop=
"discret
e"
>
<InputNumber
v-model=
"entity.discrete"
></InputNumber>
</FormItem>
<FormItem
:label=
"l('discrete_percent')"
prop=
"discrete_percent"
>
<InputNumber
v-model=
"entity.discrete_percent"
></InputNumber>
...
...
@@ -83,7 +86,7 @@
</Dropdown>
</div>
<div
class=
"slider"
>
<Slider
v-model=
"entity.
value1"
:step=
"25
"
show-stops
></Slider>
<Slider
v-model=
"entity.
level"
:step=
"20
"
show-stops
></Slider>
<div
class=
"slow"
>
慢
</div>
<div
class=
"fast"
>
快
</div>
</div>
...
...
@@ -109,11 +112,15 @@
</Col>
</Row>
<FormItem
label=
"班组结构"
>
<Select
v-model=
"entity.select6"
style=
"width:150px"
>
<Option
value=
"beijing"
>
结构1
</Option>
<Option
value=
"shanghai"
>
结构2
</Option>
<Option
value=
"shenzhen"
>
结构3
</Option>
<Option
value=
"shenzhen"
>
结构4
</Option>
<Select
v-model=
"entity.shopId"
placeholder=
"请选择"
style=
"width:150px"
prop=
"shopId"
>
<Option
v-for=
"(item,index) in list"
:key=
"index"
:value=
"item.value"
:label=
"item.title"
style=
"display:none"
></Option>
<Tree
key=
"mytree"
:data=
"data1"
ref=
"mytree"
:render=
"renderContent"
></Tree>
</Select>
</FormItem>
<div
class=
"check-box"
>
...
...
@@ -150,40 +157,119 @@
</div>
</
template
>
<
script
>
import
Api
from
"./api"
;
export
default
{
data
()
{
return
{
entity
:
{
value1
:
100
,
value2
:
100
,
flog
:
0
,
//参数应用
planMethod
:
"转序规则"
,
// 平行 重叠
shopId
:
null
,
level
:
100
,
value2
:
100
,
fruit
:
[]
},
list
:
[],
data1
:
[],
listCal
:
[],
visible
:
false
,
rules
:
{
businessName
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}],
businessCode
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
businessName
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}],
businessCode
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
}
};
},
mounted
()
{
this
.
getCal
();
//获取连班策略
this
.
apsGet
();
//获取参数级别和转序等的关系
this
.
initTree
();
//获取当前登录人所在车间下的所有部门
},
methods
:
{
handleSubmit
()
{},
getCal
()
{
Api
.
getallcal
().
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
listCal
=
res
.
result
;
}
});
},
apsGet
()
{
Api
.
apsGetall
().
then
(
res
=>
{
// if (res.success) {
// }
});
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
valid
)
{
Api
.
apsschedulupdateparameter
(
this
.
entity
).
then
(
res
=>
{
if
(
res
.
success
)
{
}
});
}
else
{
this
.
$Message
.
error
(
"Fail!"
);
}
});
},
initTree
()
{
var
sumData
=
[];
Api
.
userdepartmentsofworkshop
()
.
then
(
r
=>
{
if
(
r
.
result
)
{
this
.
data1
=
r
.
result
;
}
else
{
this
.
$Message
.
error
(
"加载部门失败!"
);
}
})
.
catch
(
err
=>
{});
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
//渲染树的样式
return
h
(
"span"
,
{
style
:
{
cursor
:
"pointer"
},
on
:
{
click
:
()
=>
{
this
.
handleSelect
(
data
);
//手动选择树节点
}
}
},
data
.
title
);
},
handleSelect
(
data
)
{
let
obj
=
{
label
:
data
.
title
,
value
:
data
.
value
};
this
.
list
=
[];
this
.
list
.
push
(
obj
);
alert
(
this
.
list
[
0
].
value
)
this
.
entity
.
shopId
=
this
.
list
[
0
].
value
;
},
handleClose
()
{
this
.
$emit
(
"on-close"
)
this
.
$emit
(
"on-close"
)
;
},
handleOpen
()
{
this
.
visible
=
true
this
.
visible
=
true
;
},
handle
()
{
this
.
visible
=
false
this
.
visible
=
false
;
},
handleOk
()
{},
l
(
key
)
{
let
vkey
=
'mes_op_task_plan_simulate'
+
'.'
+
key
return
this
.
$t
(
vkey
)
||
key
let
vkey
=
"mes_op_task_plan_simulate"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
}
}
}
}
;
</
script
>
<
style
lang=
"less"
scoped
>
.parameter {
...
...
@@ -262,7 +348,7 @@ export default {
color: #2680eb;
}
.check-box {
height: 3
00
px;
height: 3
48
px;
border-top: 1px solid #e0e0e0;
padding: 15px;
padding-left: 0;
...
...
@@ -271,7 +357,7 @@ export default {
}
}
.right-down {
height:
100
px;
height:
92
px;
}
.click-btn {
text-align: right;
...
...
pages/aps/aps/api.js
View file @
2cf858d8
...
...
@@ -53,7 +53,35 @@ export default {
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/processschemedispatch`
,
params
);
},
//APS排产前数据合法性校验
recoveryoptasksimluate
(
params
)
{
apsdatachecked
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/apspoolappservices/apsdatachecked`
,
params
);
},
//获取连班策略
getallcal
(
params
)
{
return
Api
.
get
(
`
${
apsUrl
}
/mes_daily_work_sched/getallcal`
,
params
);
},
//工序参数调整
apsschedulupdateparameter
(
params
)
{
return
Api
.
post
(
`
${
apsUrl
}
/ser/apsschedulupdateparameter`
,
params
);
},
//获取参数级别和转序等的关系
apsGetall
(
params
)
{
return
Api
.
get
(
`
${
apsUrl
}
/apsparaconfig/getall`
,
params
);
},
//获取所在班组的设备或根据设备类型过滤
getequiplist
(
params
)
{
return
Api
.
get
(
`
${
apsUrl
}
/mes_equip_info/getequiplist`
,
params
);
},
//获取当前登录人所在车间下的所有部门
userdepartmentsofworkshop
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/user/userdepartmentsofworkshop`
,
params
);
},
//获取班组 /mes_equip_info/getequiptypelist
getUserDepart
(
params
)
{
return
Api
.
get
(
`
${
systemUrl
}
/user/userdepartmentsofworkshop`
,
params
);
},
//获取设备
getEquiptypeList
(
params
)
{
return
Api
.
get
(
`
${
apsUrl
}
/mes_equip_info/getequiptypelist`
,
params
);
},
}
pages/aps/aps/components/edit.vue
View file @
2cf858d8
...
...
@@ -12,36 +12,49 @@
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('sHOPID')
"
prop=
"sHOPID"
>
<FormItem
label=
"班组
"
prop=
"sHOPID"
>
<!-- v-model="orderSearchForm.orderCat" -->
<Select
>
<Option
value=
""
class=
"option-text"
>
请选择
</Option>
<Option
v-for=
"item in orderCatList"
:value=
"item"
:key=
"item"
>
{{
item
}}
</Option>
<Select
v-model=
"entity.department_id"
>
<Option
v-for=
"(item,index) in list"
:key=
"index"
:value=
"item.value"
style=
"display:none"
:label=
"item.label"
></Option>
<Tree
key=
"mytree"
:data=
"orderCatList"
ref=
"mytree"
:render=
"renderContent"
></Tree>
<!--
<Option
v-for=
"(item,index) in orderCatList"
:value=
"item.title"
:key=
"index"
>
{{
item
.
title
}}
</Option>
-->
</Select>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
:label=
"l('eQUIPID')
"
prop=
"eQUIPID"
>
<Select
>
<Option
value=
""
class=
"option-text"
>
请选择
</Option>
<Option
v-for=
"
item in orderCatList"
:value=
"item"
:key=
"item"
>
{{
item
}}
</Option>
<FormItem
label=
"首选设备
"
prop=
"eQUIPID"
>
<Select
placeholder=
"编号 / 名称"
>
<Option
value=
""
class=
"option-text"
>
编号 / 名称
</Option>
<Option
v-for=
"
(item,index) in equiptypeList"
:value=
"item.id"
:key=
"index"
>
{{
item
.
equipTypeName
}}
</Option>
</Select>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem
label=
"
关重
资源名称"
prop=
"rUNTIME"
>
<
!--
<
Col
:span=
"12"
>
<FormItem
label=
"资源名称"
prop=
"rUNTIME"
>
<Select
>
<Option
value=
""
class=
"option-text"
>
请选择
</Option>
<Option
v-for=
"item in orderCatList"
:value=
"item"
:key=
"item"
>
{{
item
}}
</Option>
</Select>
</FormItem>
</Col>
</Col>
-->
<Col
:span=
"12"
>
<FormItem
:label=
"l('rUNTIME')"
prop=
"rUNTIME"
>
<!-- v-model="value1" -->
<InputNumber
:max=
"100"
:min=
"1"
></InputNumber>
</FormItem>
</Col>
<Col
:span=
"12"
>
<FormItem>
<!-- v-model="single" -->
<Checkbox>
是否同步到原始工艺
</Checkbox>
</FormItem>
</Col>
</Row>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
...
...
@@ -56,20 +69,26 @@ export default {
data
()
{
return
{
disabled
:
false
,
entity
:
{},
orderCatList
:[
],
entity
:
{
department_id
:
null
,
//班组
},
list
:[],
selectdata
:
[],
orderCatList
:[],
//班组
equiptypeList
:[],
//设备
rules
:
{
name
:
[{
required
:
true
,
message
:
'必填'
,
trigger
:
'blur'
}]
}
}
},
props
:
{
eid
:
Number
eid
:
Number
,
},
created
()
{
// this.getUserDepart()
},
methods
:
{
load
(
v
)
{
load
()
{
// Api.get({ id: v }).then((r) => {
// this.entity = r.result
// this.$emit('on-load')
...
...
@@ -97,6 +116,41 @@ export default {
}
})
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
//渲染树的样式
return
h
(
"span"
,
{
style
:
{
// color: data.isProduct != "1" ? "#249E91" : "#333", //根据选中状态设置样式
cursor
:
"pointer"
},
on
:
{
click
:
()
=>
{
let
arrTree
=
[];
arrTree
.
push
(
data
);
this
.
handleSelect
(
arrTree
);
//手动选择树节点
}
}
},
data
.
title
);
},
handleSelect
(
data
)
{
if
(
data
.
length
>
0
)
{
this
.
selectdata
=
[];
this
.
selectdata
=
data
;
this
.
list
=
[];
this
.
list
.
push
({
label
:
data
[
0
].
title
,
value
:
data
[
0
].
id
});
// if (data[0].isProduct == "1") {
// this.orderSearchForm.productName = data[0].title;
// this.orderSearchForm.productId = data[0].productId;
// this.orderSearchForm.drawnNumber = data[0].drawingNo;
// } else {
// this.$Message.error("此节点不是产品,请选择产品节点!");
// }
}
},
handleClose
()
{
this
.
$emit
(
'on-close'
)
},
...
...
pages/aps/aps/components/excute.vue
View file @
2cf858d8
...
...
@@ -10,13 +10,11 @@
:border=
"false"
:data=
"data1"
:page=
"false"
:height=
"gridHeight"
></DataGrid>
<Modal
v-model=
"editModal"
title=
"编辑"
footer-hide
width=
"800"
>
<Edit
:eid=
"curId"
@
on-close=
"cancel"
/>
</Modal>
<Modal
v-model=
"deletelModal"
title=
"删除"
@
on-ok=
"removeOk"
@
on-cancel=
"cancel"
>
<p>
确定删除?
</p>
<Edit
ref=
"editPart"
:eid=
"curId"
@
on-close=
"cancel"
/>
</Modal>
<Modal
v-model=
"insertlModal"
title=
"插单"
@
on-ok=
"insertOk"
@
on-cancel=
"cancel"
>
<p>
确定进行
{{
insertTItle
}}
操作?
</p>
...
...
@@ -51,10 +49,10 @@ export default {
setParsModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
deletelModal
:
false
,
insertlModal
:
false
,
rowIndex
:
null
,
curId
:
0
,
gridHeight
:
50
,
columns
:
[
{
key
:
"id"
,
title
:
this
.
l
(
"id"
),
hide
:
true
,
align
:
"left"
},
{
title
:
" "
,
width
:
130
},
...
...
@@ -301,6 +299,7 @@ export default {
attrs
:
{
icon
:
"md-options"
,
type
:
"icon"
,
oprate
:
"detail"
,
title
:
"工序参数设置"
},
on
:
{
click
:
()
=>
this
.
openParms
(
params
.
row
.
id
)
}
...
...
@@ -323,14 +322,15 @@ export default {
oprate
:
"delete"
,
msg
:
"确认要刪除工序吗?"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
,
params
.
index
)
}
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
,
params
.
index
)
}
})
]);
}
}
],
data1
:
[],
insertTItle
:
"插单"
insertTItle
:
"插单"
,
selectRoutingDetail
:
{}
//需那种工序
};
},
mounted
()
{
...
...
@@ -344,9 +344,11 @@ export default {
loadData
(
expendId
)
{
let
params
=
{
id
:
expendId
}
Api
.
getbyorderid
(
params
).
then
(
(
res
)
=>
{
}
;
Api
.
getbyorderid
(
params
).
then
(
res
=>
{
if
(
res
.
success
)
{
this
.
gridHeight
=
50
;
this
.
gridHeight
=
(
res
.
result
.
length
+
1
)
*
48
;
this
.
data1
=
res
.
result
;
}
});
...
...
@@ -388,29 +390,42 @@ export default {
edit
(
id
)
{
this
.
editModal
=
true
;
this
.
curId
=
Number
(
id
);
this
.
getUserDepart
()
this
.
getEquiptypeList
()
},
// 获取班组
getUserDepart
(){
Api
.
getUserDepart
().
then
(
res
=>
{
console
.
log
(
res
.
result
)
this
.
$refs
.
editPart
.
orderCatList
=
res
.
result
})
},
// 获取设备
getEquiptypeList
(){
Api
.
getEquiptypeList
().
then
(
res
=>
{
console
.
log
(
"设备"
,
res
.
result
)
this
.
$refs
.
editPart
.
equiptypeList
=
res
.
result
})
},
//编辑工序end----
//删除工序事件start-----
remove
(
id
,
index
)
{
this
.
deletelModal
=
true
;
this
.
curId
=
Number
(
id
);
remove
(
row
,
index
)
{
//this.curId = Number(id);
this
.
rowIndex
=
index
;
},
removeOk
()
{
alert
(
this
.
rowIndex
);
this
.
selectRoutingDetail
=
row
;
let
params
=
{
partPk
:
this
.
selectRoutingDetail
.
part_task_pk
,
detailIdstr
:
this
.
selectRoutingDetail
.
routing_detail_id
};
Api
.
removeoptasksimluate
(
params
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"删除成功"
);
this
.
data1
.
splice
(
this
.
rowIndex
,
1
);
// Api.delete({ id: this.curId }).then((r) => {
// if (r.success) {
// this.$refs.grid.load()
// this.deletelModal = false
// this.$Message.success('删除成功')
// }
// })
},
removeCancel
()
{
this
.
deletelModal
=
false
;
}
});
},
//删除工序时间end-----
cancel
()
{
this
.
curId
=
0
;
...
...
pages/aps/aps/index.vue
View file @
2cf858d8
...
...
@@ -8,16 +8,22 @@
:high=
"false"
@
on-drag-drop=
"onDragDrop"
:page=
"false"
@
on-select=
"onSelect"
@
on-select
ion-change
=
"onSelect"
:batch=
"true"
:border=
"false"
:easy=
"false"
>
<template
slot=
"easySearch"
></
template
>
<
template
slot=
"searchBack"
>
<Select
placeholder=
"选择历史方案"
style=
"width: 150px"
></Select>
<DatePicker
type=
"date"
placeholder=
"设置基准日期"
style=
"width: 150px"
></DatePicker>
<a
style=
"font-weight:bold"
@
click=
"addModal=true"
>
<Select
placeholder=
"选择历史方案"
style=
"width: 150px;"
></Select>
<DatePicker
type=
"date"
placeholder=
"设置基准日期"
style=
"width: 150px"
v-model=
"entity.setTime"
@
on-change=
"getTime"
></DatePicker>
<a
style=
"font-weight:bold;"
@
click=
"addModal=true"
>
<Icon
type=
"ios-options"
size=
"14"
/>
工序参数调整
</a>
</
template
>
...
...
@@ -28,13 +34,13 @@
<Button
type=
"primary"
@
click=
"apsModal=true"
>
APS排产
</Button>
</
template
>
<
template
slot=
"batch"
>
<Button
type=
"primary"
class=
"mr10 ml10"
>
移出排产
</Button>
<Button
type=
"primary"
class=
"mr10 ml10"
@
click=
"removeOk"
>
移出排产
</Button>
</
template
>
</DataGrid>
<Modal
v-model=
"addModal"
title=
"工序参数设置"
footer-hide
width=
"1000"
>
<Add
@
on-close=
"cancel"
@
on-ok=
"addOk"
/>
</Modal>
<Modal
v-model=
"apsModal"
title=
"确定APS排产"
@
on-ok=
"
remove
Ok"
@
on-cancel=
"cancel"
>
<Modal
v-model=
"apsModal"
title=
"确定APS排产"
@
on-ok=
"
aps
Ok"
@
on-cancel=
"cancel"
>
<p>
确定进行APS排产?
</p>
</Modal>
</div>
...
...
@@ -55,6 +61,9 @@ export default {
easySearch
:
{
keys
:
{
op
:
"notes"
,
value
:
null
}
},
entity
:
{
setTime
:
""
},
addModal
:
false
,
editModal
:
false
,
detailModal
:
false
,
...
...
@@ -123,7 +132,10 @@ export default {
key
:
"priority"
,
title
:
this
.
l
(
"priority"
),
align
:
"left"
,
high
:
true
high
:
true
,
render
:
(
h
,
params
)
=>
{
return
h
(
"span"
,
{},
params
.
index
+
1
);
}
},
{
key
:
"plan_qty"
,
...
...
@@ -209,7 +221,7 @@ export default {
oprate
:
"delete"
,
msg
:
"确认要移出排产吗?"
},
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
id
)
}
on
:
{
click
:
()
=>
this
.
remove
(
params
.
row
.
part_task_pk
)
}
}),
h
(
"op"
,
{
attrs
:
{
...
...
@@ -219,12 +231,13 @@ export default {
oprate
:
"delete"
,
msg
:
"确认要恢复工序吗?"
},
on
:
{
click
:
()
=>
this
.
re
move
(
params
.
row
.
id
)
}
on
:
{
click
:
()
=>
this
.
re
fresh
(
params
.
row
.
part_task_pk
)
}
})
]);
}
}
]
],
arrPartPkId
:
[]
};
},
mounted
()
{
...
...
@@ -241,6 +254,7 @@ export default {
this
.
list
=
res
.
result
;
}
});
},
addOk
()
{
this
.
$refs
.
grid
.
load
();
...
...
@@ -257,21 +271,49 @@ export default {
this
.
editModal
=
true
;
this
.
curId
=
id
;
},
remove
(
id
)
{
this
.
deletelModal
=
true
;
this
.
curId
=
id
;
refresh
(
partPkId
)
{
//恢复工序
let
params
=
{
id
:
partPkId
};
Api
.
recoveryoptasksimluate
(
params
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"恢复成功"
);
this
.
list
=
[];
this
.
loadList
();
}
});
},
onSelect
(
a
,
b
)
{},
removeOk
()
{
Api
.
delete
({
id
:
this
.
curId
}).
then
(
r
=>
{
remove
(
partPkId
)
{
//移出排产池
let
paramsArry
=
[];
if
(
partPkId
.
constructor
==
Array
)
{
paramsArry
=
partPkId
;
}
else
{
paramsArry
.
push
(
partPkId
);
}
let
params
=
{
partPks
:
paramsArry
};
Api
.
shiftoutapspool
(
params
).
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$refs
.
grid
.
load
();
this
.
deletelModal
=
false
;
this
.
$Message
.
success
(
"删除成功"
);
this
.
$Message
.
success
(
"移出排产池操作成功"
);
this
.
loadList
();
}
});
},
onSelect
(
a
,
b
)
{
//批量选择
let
selectRows
=
a
;
this
.
arrPartPkId
=
[];
selectRows
.
forEach
(
e
=>
{
this
.
arrPartPkId
.
push
(
e
.
part_task_pk
);
});
},
removeOk
()
{
//批量选择移出排产池
this
.
remove
(
this
.
arrPartPkId
);
},
removeCancel
()
{
this
.
deletelModal
=
false
;
},
...
...
@@ -289,9 +331,58 @@ export default {
openParms
(
id
)
{
this
.
addModal
=
true
;
},
getUserDepart
(){
alert
(
"5656565"
)
// Api.getUserDepart().then(res=>{
// console.log("11111",res)
// return res
// })
},
l
(
key
)
{
let
vkey
=
"mes_part_task_plan_simulate"
+
"."
+
key
;
return
this
.
$t
(
vkey
)
||
key
;
},
getTime
(
value
)
{
this
.
entity
.
getTime
=
value
;
},
//a确定aps排产
apsOk
()
{
//APS排产前订单优先级功能
let
parmsOrderpriority
=
{
alls
:
[]
};
let
arryIds
=
[];
this
.
list
.
forEach
((
e
,
index
)
=>
{
let
objIds
=
{};
objIds
.
orderId
=
e
.
part_task_pk
;
objIds
.
priority
=
index
+
1
;
arryIds
.
push
(
objIds
);
});
parmsOrderpriority
.
alls
=
arryIds
;
// alert(JSON.stringify(parmsOrderpriority));
Api
.
orderpriority
(
parmsOrderpriority
).
then
(
res
=>
{
if
(
res
.
success
)
{
if
(
res
.
result
)
{
this
.
$Message
.
success
(
"排序成功"
);
//apsp排产前检查
Api
.
apsdatachecked
().
then
(
res1
=>
{
if
(
res1
.
success
)
{
if
(
res1
.
result
.
res
)
{
this
.
$Message
.
success
(
"数据校验成功"
);
}
else
{
this
.
$Message
.
success
(
"数据校验失败"
);
}
}
else
{
this
.
$Message
.
error
(
"操作失败:数据校验"
);
}
});
}
else
{
this
.
$Message
.
error
(
"排序失败,请重新APS排产操作"
);
}
}
else
{
this
.
$Message
.
error
(
"操作失败:排序"
);
}
});
//APS排产前数据合法性校验
}
}
};
...
...
pages/aps/dispatch/dispatch.less
View file @
2cf858d8
...
...
@@ -16,6 +16,7 @@
}
.dispatch_part{
border: 1px solid #ccc;
height: 100%;
.dispatch_part_top{
height: 50px;
line-height: 50px;
...
...
pages/aps/plan/index.vue
View file @
2cf858d8
...
...
@@ -433,6 +433,7 @@ export default {
.
then
(
r
=>
{
if
(
r
.
success
)
{
this
.
$Message
.
success
(
"移入排产成功"
);
this
.
$refs
.
grid
.
reload
(
this
.
easySearch
);
}
else
{
this
.
$Message
.
error
(
"移入排产失败"
);
}
...
...
pages/aps/results/api.js
View file @
2cf858d8
import
Api
from
'@/plugins/request'
export
default
{
// index: `${aps
Result
}/scheduletotal/getall`,
// index: `${aps
Url
}/scheduletotal/getall`,
paged
(
params
)
{
return
Api
.
get
(
`
${
aps
Result
}
/scheduletotal/getall`
,
params
);
return
Api
.
get
(
`
${
aps
Url
}
/scheduletotal/getall`
,
params
);
},
getall
(
params
)
{
return
Api
.
get
(
`
${
aps
Result
}
/schema/getall`
,
params
);
return
Api
.
get
(
`
${
aps
Url
}
/schema/getall`
,
params
);
},
clearall
(
params
)
{
return
Api
.
post
(
`
${
aps
Result
}
/schema/clearall`
,
params
);
return
Api
.
post
(
`
${
aps
Url
}
/schema/clearall`
,
params
);
},
getdetail
(
params
)
{
return
Api
.
get
(
`
${
aps
Result
}
/scheduletotal/getdetail`
,
params
);
return
Api
.
get
(
`
${
aps
Url
}
/scheduletotal/getdetail`
,
params
);
},
}
pages/basicData/systemlog/components/detail.vue
View file @
2cf858d8
...
...
@@ -61,7 +61,7 @@
<Input
v-model=
"formValidate.parameters"
type=
"textarea"
rows=
"3"
:
rows=
"3"
style=
"width:634px;"
></Input>
</FormItem>
...
...
@@ -71,7 +71,7 @@
<Input
v-model=
"formValidate.exception"
type=
"textarea"
rows=
"3"
:
rows=
"3"
style=
"width:634px;"
></Input>
</FormItem>
...
...
pages/basicData/user/index.vue
View file @
2cf858d8
...
...
@@ -21,7 +21,7 @@
ref=
"grid"
:action=
"action"
:conditions=
"easySearch"
placeholder=
"请输入姓名
或者员工编号进行搜索
"
placeholder=
"请输入姓名
/员工编号
"
:high=
"true"
:height=
"tdHeight"
>
...
...
@@ -126,6 +126,7 @@ import Edit from "./edit";
import
Detail
from
"./detail"
;
import
Search
from
"./search"
;
import
service
from
"@/plugins/request"
;
import
util
from
'@/libs/util'
;
export
default
{
name
:
"list"
,
components
:
{
...
...
@@ -451,7 +452,7 @@ export default {
let
parms
=
{
userId
:
this
.
curId
,
accountId
:
this
.
selectRow
.
accountId
,
tanantCode
:
this
.
$store
.
state
.
userInfo
.
tanantCode
,
tanantCode
:
util
.
cookies
.
get
(
'tanantCode'
)
,
isDeleted
:
true
};
Api
.
authAccount
(
parms
).
then
(
res
=>
{
...
...
@@ -604,7 +605,7 @@ export default {
userId
:
this
.
selectRow
.
id
,
loginName
:
this
.
selectRow
.
phone
,
status
:
this
.
selectRow
.
status
,
tanantCode
:
this
.
$store
.
state
.
userInfo
.
tanantCode
tanantCode
:
util
.
cookies
.
get
(
'tanantCode'
),
};
if
(
this
.
selectRow
.
phone
&&
this
.
selectRow
.
phone
!=
""
)
{
Api
.
authAccount
(
parms
).
then
(
res
=>
{
...
...
pages/basicData/userManagent/userInfo.vue
View file @
2cf858d8
<
template
>
<div>
<Card
style=
"width:350px;float:left
"
>
<Card
class=
"img_top01
"
>
<p
slot=
"title"
>
个人头像
</p>
<div
style=
"height:415px;"
>
<p
style=
"text-align:center;padding-top:100px;"
>
...
...
@@ -267,8 +267,17 @@ export default {
};
</
script
>
<
style
lang=
"less"
>
.ivu-card-body {
.img_top01{
width:350px;
float:left;
.ivu-card-body {
padding: 0px;
}
}
.user_info_right{
.ivu-card-body {
padding: 0px;
}
}
.ivu-tabs-nav-scroll {
background: #f5f6fa;
...
...
pages/implement/table.less
View file @
2cf858d8
...
...
@@ -44,6 +44,7 @@
padding : 8px 15px;
border-bottom: 1px solid #e4e6ed;
position : relative;
height: 46px;
}
.state {
...
...
pages/processDesign/ChangeSingle/unqualifiedorder/trialOrder.vue
View file @
2cf858d8
...
...
@@ -169,8 +169,8 @@ export default {
},
formcontextdata
:
{
measures
:
''
,
triaLevel
:
''
,
conclusion
:
''
,
triaLevel
:
[]
,
conclusion
:
[]
,
causeAnalysis
:
''
,
},
formcontextclosedata
:
...
...
pages/system/host/index.vue
View file @
2cf858d8
<
template
>
<div>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
><template
slot=
"easySearch"
><Form
ref=
"formInline"
:model=
"easySearch"
inline
><FormItem
prop=
"keys"
><Input
placeholder=
"请输入
关键字数据源名称/服务器地址/用户名
"
v-model=
"easySearch.keys.value"
/>
</FormItem>
<DataGrid
:columns=
"columns"
ref=
"grid"
:action=
"action"
><template
slot=
"easySearch"
><Form
ref=
"formInline"
:model=
"easySearch"
inline
><FormItem
prop=
"keys"
><Input
placeholder=
"请输入
数据源/服务器/用户"
class=
"w200
"
v-model=
"easySearch.keys.value"
/>
</FormItem>
<FormItem><Button
type=
"primary"
@
click=
"search"
>
查询
</Button></FormItem>
</Form></
template
>
<
template
slot=
"searchForm"
>
...
...
pages/system/tanant/index.vue
View file @
2cf858d8
...
...
@@ -4,7 +4,7 @@
<template
slot=
"easySearch"
>
<Form
ref=
"formInline"
:model=
"easySearch"
inline
>
<FormItem
prop=
"keys"
>
<Input
placeholder=
"请输入
关键字公司名称/公司编码"
v-model=
"easySearch.keys.value"
/>
<Input
placeholder=
"请输入
公司名称/公司编码"
v-model=
"easySearch.keys.value"
class=
"w200"
/>
</FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"search"
>
查询
</Button>
...
...
plugins/iview.js
View file @
2cf858d8
...
...
@@ -94,7 +94,7 @@ Vue.component("DTSpan", DTSpan)
Vue
.
component
(
"DTSearch"
,
DTSearch
)
//注入mock
require
(
"../mock"
)
//
require("../mock")
Vue
.
prototype
.
$api
=
request
;
Vue
.
prototype
.
$http
=
Api
;
Vue
.
prototype
.
$u
=
Henq
;
...
...
plugins/request/index.js
View file @
2cf858d8
...
...
@@ -13,6 +13,14 @@ function errorCreate (msg) {
// 记录和显示错误
function
errorLog
(
err
)
{
if
(
err
&&
err
.
response
&&
err
.
response
.
status
==
500
){
console
.
log
(
err
.
response
)
Message
.
error
({
content
:
err
.
response
.
data
.
error
.
message
,
duration
:
5
})
return
;
}
// 添加到日志
$nuxt
.
$store
.
dispatch
(
'admin/log/push'
,
{
message
:
'数据请求异常'
,
...
...
@@ -28,18 +36,18 @@ function errorLog (err) {
console
.
log
(
err
);
}
// 显示提示,可配置使用 iView 的 $Message 还是 $Notice 组件来显示
if
(
Setting
.
errorModalType
===
'Message'
)
{
Message
.
error
({
content
:
err
.
message
,
duration
:
Setting
.
modalDuration
});
}
else
if
(
Setting
.
errorModalType
===
'Notice'
)
{
Notice
.
error
({
title
:
'提示'
,
desc
:
err
.
message
,
duration
:
Setting
.
modalDuration
});
}
//
if (Setting.errorModalType === 'Message') {
//
Message.error({
//
content: err.message,
//
duration: Setting.modalDuration
//
});
//
} else if (Setting.errorModalType === 'Notice') {
//
Notice.error({
//
title: '提示',
//
desc: err.message,
//
duration: Setting.modalDuration
//
});
//
}
}
// 创建一个 axios 实例
...
...
@@ -83,7 +91,7 @@ service.interceptors.request.use(
},
error
=>
{
// 发送失败
console
.
log
(
error
);
//
console.log(error);
Promise
.
reject
(
error
);
}
);
...
...
store/admin/account.js
View file @
2cf858d8
...
...
@@ -3,10 +3,14 @@
* */
import
util
from
'@/libs/util'
;
// import router from '@/router';
import
{
AccountLogin
,
AccountRegister
}
from
'@/api/account'
;
import
Oidc
from
'oidc-client'
import
{
Modal
}
from
'view-design'
;
export
const
actions
=
{
import
{
AccountLogin
,
AccountRegister
}
from
'@/api/account'
;
import
{
Modal
}
from
'view-design'
;
export
const
actions
=
{
/**
* @description 登录
* @param {Object} param context
...
...
@@ -14,7 +18,9 @@ export const actions={
* @param {Object} param password {String} 密码
* @param {Object} param route {Object} 登录成功后定向的路由对象 任何 vue-router 支持的格式
*/
login
({
dispatch
},
{
login
({
dispatch
},
{
username
=
''
,
password
=
''
}
=
{})
{
...
...
@@ -32,14 +38,24 @@ export const actions={
// 如有必要 token 需要定时更新,默认保存一天,可在 setting.js 中修改
// 如果你的 token 不是通过 cookie 携带,而是普通字段,也可视情况存储在 localStorage
console
.
warn
(
res
);
util
.
cookies
.
set
(
'uuid'
,
res
.
uuid
);
util
.
cookies
.
set
(
'token'
,
res
.
token
);
// 设置 vuex 用户信息
await
dispatch
(
'admin/user/set'
,
res
.
info
,
{
root
:
true
});
// 用户登录后从持久化数据加载一系列的设置
await
dispatch
(
'load'
);
if
(
res
.
result
)
{
util
.
cookies
.
set
(
'uuid'
,
res
.
result
.
userId
);
util
.
cookies
.
set
(
'tanantCode'
,
res
.
result
.
tanantCode
);
util
.
cookies
.
set
(
'token'
,
res
.
result
.
accessToken
);
sessionStorage
.
setItem
(
'token'
,
res
.
result
.
accessToken
)
// // 设置 vuex 用户信息
// await dispatch('admin/user/set', res.info, {
// root: true
// });
// // 用户登录后从持久化数据加载一系列的设置
// await dispatch('load');
// 结束
resolve
(
res
.
result
.
userId
);
}
else
{
resolve
();
}
})
.
catch
(
err
=>
{
// console.log('err: ', err);
...
...
@@ -50,23 +66,23 @@ export const actions={
/**
* @description 退出登录
* */
logout
({
commit
,
dispatch
},
{
confirm
=
false
,
vm
}
=
{})
{
var
mgr
=
new
Oidc
.
UserManager
(
window
.
authConfig
)
async
function
logout
()
{
logout
({
commit
,
dispatch
},
{
confirm
=
false
,
vm
}
=
{})
{
async
function
logout
()
{
// 删除cookie
util
.
cookies
.
remove
(
'token'
);
util
.
cookies
.
remove
(
'uuid'
);
// 清空 vuex 用户信息
await
dispatch
(
'admin/user/set'
,
{},
{
root
:
true
});
// 跳转路由
// alert(123)
window
.
frames
[
0
].
sessionStorage
.
clear
()
sessionStorage
.
clear
()
mgr
.
events
.
addUserSignedOut
(
function
()
{
log
(
'User signed out of OP'
)
mgr
.
removeUser
()
})
await
dispatch
(
'admin/user/set'
,
{},
{
root
:
true
});
sessionStorage
.
clear
();
localStorage
.
clear
();
$nuxt
.
$router
.
push
(
"/account/login"
);
}
...
...
@@ -74,7 +90,7 @@ export const actions={
Modal
.
confirm
({
title
:
vm
.
$t
(
'basicLayout.logout.confirmTitle'
),
content
:
vm
.
$t
(
'basicLayout.logout.confirmContent'
),
onOk
()
{
onOk
()
{
logout
();
}
});
...
...
@@ -90,7 +106,9 @@ export const actions={
* @param {Object} param mobile {String} 手机号码
* @param {Object} param captcha {String} 验证码
*/
register
({
dispatch
},
{
register
({
dispatch
},
{
mail
=
''
,
password
=
''
,
mobile
=
''
,
...
...
@@ -110,7 +128,9 @@ export const actions={
util
.
cookies
.
set
(
'uuid'
,
res
.
uuid
);
util
.
cookies
.
set
(
'token'
,
res
.
token
);
// 设置 vuex 用户信息
await
dispatch
(
'admin/user/set'
,
res
.
info
,
{
root
:
true
});
await
dispatch
(
'admin/user/set'
,
res
.
info
,
{
root
:
true
});
// 用户登录后从持久化数据加载一系列的设置
await
dispatch
(
'load'
);
// 结束
...
...
@@ -127,12 +147,19 @@ export const actions={
* @param {Object} state vuex state
* @param {Object} dispatch vuex dispatch
*/
load
({
state
,
dispatch
})
{
load
({
state
,
dispatch
})
{
return
new
Promise
(
async
resolve
=>
{
// 加载用户登录信息
await
dispatch
(
'admin/user/load'
,
null
,
{
root
:
true
});
await
dispatch
(
'admin/user/load'
,
null
,
{
root
:
true
});
// 持久化数据加载上次退出时的多页列表
await
dispatch
(
'admin/page/openedLoad'
,
null
,
{
root
:
true
});
await
dispatch
(
'admin/page/openedLoad'
,
null
,
{
root
:
true
});
// end
resolve
();
})
...
...
store/index.js
View file @
2cf858d8
...
...
@@ -41,8 +41,8 @@ export const mutations={
},
setUserInfo
(
state
,
userInfo
)
{
state
.
userInfo
=
userInfo
;
sessionStorage
.
setItem
(
"userInfo"
,
JSON
.
stringify
(
userInfo
));
sessionStorage
.
setItem
(
"token"
,
userInfo
.
token
);
//
sessionStorage.setItem("userInfo", JSON.stringify(userInfo));
//
sessionStorage.setItem("token", userInfo.token);
},
addUser
(
state
,
user
){
state
.
userMap
.
push
(
user
);
...
...
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