Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
web-monitor
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
web-monitor
Commits
f1258b20
Commit
f1258b20
authored
3 months ago
by
dupengyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
站点 检测设备等修改
parent
d7a61660
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
222 additions
and
1511 deletions
+222
-1511
websocket.js
src/utils/websocket.js
+14
-14
FSU.vue
src/views/setting/add/comp/FSU.vue
+12
-12
autoAdd.vue
src/views/setting/add/comp/autoAdd.vue
+159
-33
station.vue
src/views/setting/add/comp/station.vue
+28
-3
api.js
src/views/setting/api.js
+7
-0
authRole.vue
src/views/system/user2/authRole.vue
+0
-117
index.vue
src/views/system/user2/index.vue
+0
-899
index.vue
src/views/system/user2/profile/index.vue
+0
-91
resetPwd.vue
src/views/system/user2/profile/resetPwd.vue
+0
-68
userAvatar.vue
src/views/system/user2/profile/userAvatar.vue
+0
-184
userInfo.vue
src/views/system/user2/profile/userInfo.vue
+0
-88
vue.config.js
vue.config.js
+2
-2
No files found.
src/utils/websocket.js
View file @
f1258b20
...
...
@@ -20,26 +20,26 @@ export default function socket(handlerOptions) {
let
heart
=
heartCheck
(
websocket
)
websocket
.
onerror
=
function
()
{
websocket
.
onerror
=
function
()
{
console
.
info
(
"Websocket服务器连接错误"
)
}
//连接成功建立的回调方法
websocket
.
onopen
=
function
()
{
websocket
.
onopen
=
function
()
{
console
.
info
(
"Websocket连接成功"
)
heart
.
start
()
onopen
&&
onopen
()
}
//接收到消息的回调方法
websocket
.
onmessage
=
function
(
event
)
{
websocket
.
onmessage
=
function
(
event
)
{
let
message
=
event
.
data
//消息内容
heart
.
reset
()
//重置心跳上传时间
onmessage
&&
onmessage
(
message
)
//消息业务处理
}
//监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
window
.
onbeforeunload
=
function
()
{
window
.
onbeforeunload
=
function
()
{
websocket
.
close
()
}
return
websocket
...
...
@@ -48,27 +48,27 @@ function heartCheck(websocket) {
return
{
timeout
:
15000
,
timeoutObj
:
null
,
reset
:
function
()
{
reset
:
function
()
{
clearTimeout
(
this
.
timeoutObj
)
this
.
start
()
},
start
:
function
()
{
this
.
timeoutObj
=
setInterval
(
function
()
{
start
:
function
()
{
this
.
timeoutObj
=
setInterval
(
function
()
{
// if(websocket.readyState==1){
websocket
.
send
(
"HeartBeat"
)
console
.
info
(
"Websocket发送心跳:HeartBeat"
)
// }
},
this
.
timeout
)
},
}
}
//消息处理
export
function
receiveMessage
(
message
)
{
// 消息接收后处理逻辑 接口访问
if
(
message
!=
'连接成功'
)
{
let
obj
=
JSON
.
parse
(
JSON
.
parse
(
message
))
EventBus
.
$emit
(
'dialogAlarm'
,
obj
)
EventBus
.
$emit
(
'autioPlay'
,
obj
)
}
// 消息接收后处理逻辑 接口访问
if
(
message
!=
'连接成功'
)
{
let
obj
=
JSON
.
parse
(
JSON
.
parse
(
message
))
EventBus
.
$emit
(
'dialogAlarm'
,
obj
)
EventBus
.
$emit
(
'autioPlay'
,
obj
)
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/views/setting/add/comp/FSU.vue
View file @
f1258b20
...
...
@@ -54,9 +54,9 @@
>
<el-option
v-for=
"item in backupModeSelect"
:key=
"item.
id
"
:label=
"item.dict
Value
"
:value=
"item.
id
"
:key=
"item.
dictValue
"
:label=
"item.dict
Label
"
:value=
"item.
dictValue
"
></el-option
></el-select>
</el-form-item>
...
...
@@ -64,9 +64,9 @@
<el-select
v-model=
"FSUForm.connectMode"
placeholder=
"请选择通信方式"
>
<el-option
v-for=
"item in connectModeSelect"
:key=
"item.
id
"
:label=
"item.dict
Value
"
:value=
"item.
id
"
:key=
"item.
dictValue
"
:label=
"item.dict
Label
"
:value=
"item.
dictValue
"
></el-option>
</el-select>
</el-form-item>
...
...
@@ -74,9 +74,9 @@
<el-select
v-model=
"FSUForm.equipType"
placeholder=
"请选择设备类型"
>
<el-option
v-for=
"item in equipTypeSelect"
:key=
"item.
id
"
:label=
"item.dict
Value
"
:value=
"item.
id
"
:key=
"item.
dictValue
"
:label=
"item.dict
Label
"
:value=
"item.
dictValue
"
></el-option>
</el-select>
</el-form-item>
...
...
@@ -87,9 +87,9 @@
>
<el-option
v-for=
"item in equipSubTypeSelect"
:key=
"item.
id
"
:label=
"item.dict
Value
"
:value=
"item.
id
"
:key=
"item.
dictValue
"
:label=
"item.dict
Label
"
:value=
"item.
dictValue
"
></el-option>
</el-select>
</el-form-item>
...
...
This diff is collapsed.
Click to expand it.
src/views/setting/add/comp/autoAdd.vue
View file @
f1258b20
This diff is collapsed.
Click to expand it.
src/views/setting/add/comp/station.vue
View file @
f1258b20
...
...
@@ -30,14 +30,23 @@
/>
</el-form-item>
<el-form-item
label=
"站点所在局:"
prop=
"siteArea"
>
<el-input
<el-select
v-model=
"stationForm.siteArea"
value-key=
"railwayName"
@
change=
"handleSiteArea"
placeholder=
"请选择漏缆"
>
<el-option
v-for=
"item in options"
:key=
"item.railwayName"
:label=
"item.railwayName"
:value=
"item"
></el-option>
</el-select>
<!--
<el-input
v-model=
"stationForm.siteArea"
placeholder=
"请输入站点所在局"
/>
/>
-->
</el-form-item>
<el-form-item
label=
"站点所在段号:"
prop=
"siteSectionCode"
>
<el-input
v-model=
"stationForm.siteSectionCode"
disabled
placeholder=
"请输入站点所在段号"
/>
</el-form-item>
...
...
@@ -77,7 +86,12 @@
</div>
</
template
>
<
script
>
import
{
sitesave
,
railWaylist
,
updateSiteConf
}
from
"../../api"
;
import
{
sitesave
,
railWaylist
,
updateSiteConf
,
sysRailwayBureaus
,
}
from
"../../api"
;
import
{
successAlert
,
warningAlert
}
from
"@/utils/alert"
;
export
default
{
...
...
@@ -138,12 +152,23 @@ export default {
{
required
:
true
,
message
:
"请输入站点其他信息"
,
trigger
:
"blur"
},
],
},
options
:
[],
};
},
mounted
()
{
this
.
getAllWay
();
this
.
handleSysRailwayBureaus
();
},
methods
:
{
handleSiteArea
(
e
){
console
.
log
(
e
)
this
.
stationForm
.
siteArea
=
e
.
railwayName
;
this
.
stationForm
.
siteSectionCode
=
e
.
railwayCode
;
},
async
handleSysRailwayBureaus
()
{
let
res
=
await
sysRailwayBureaus
();
this
.
options
=
res
;
},
// 编辑的确认
confirm
()
{
let
params
=
{
...
...
This diff is collapsed.
Click to expand it.
src/views/setting/api.js
View file @
f1258b20
...
...
@@ -53,6 +53,9 @@ const path = {
waveStatistics
:
'/device/sampling/waveStatistics'
,
distanceStatistics
:
'/device/sampling/distanceStatistics'
,
samplingList
:
'/device/sampling/selectPage'
,
sysRailwayBureaus
:
'/api/sysRailwayBureaus/selectAll'
}
// 铁路线
export
function
railWaylist
()
{
...
...
@@ -75,6 +78,10 @@ export function updateRailWay() {
}
//站点
export
function
sysRailwayBureaus
()
{
return
request
.
post
(
path
.
sysRailwayBureaus
,
...
arguments
);
}
export
function
selectForSite
()
{
return
request
.
post
(
path
.
selectForSite
,
...
arguments
);
}
...
...
This diff is collapsed.
Click to expand it.
src/views/system/user2/authRole.vue
deleted
100644 → 0
View file @
d7a61660
<
template
>
<div
class=
"app-container"
>
<h4
class=
"form-header h4"
>
基本信息
</h4>
<el-form
ref=
"form"
:model=
"form"
label-width=
"80px"
>
<el-row>
<el-col
:span=
"8"
:offset=
"2"
>
<el-form-item
label=
"用户昵称"
prop=
"nickName"
>
<el-input
v-model=
"form.nickName"
disabled
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
:offset=
"2"
>
<el-form-item
label=
"登录账号"
prop=
"userName"
>
<el-input
v-model=
"form.userName"
disabled
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<h4
class=
"form-header h4"
>
角色信息
</h4>
<el-table
v-loading=
"loading"
:row-key=
"getRowKey"
@
row-click=
"clickRow"
ref=
"table"
@
selection-change=
"handleSelectionChange"
:data=
"roles.slice((pageNum-1)*pageSize,pageNum*pageSize)"
>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
>
<template
slot-scope=
"scope"
>
<span>
{{
(
pageNum
-
1
)
*
pageSize
+
scope
.
$index
+
1
}}
</span>
</
template
>
</el-table-column>
<el-table-column
type=
"selection"
:reserve-selection=
"true"
width=
"55"
></el-table-column>
<el-table-column
label=
"角色编号"
align=
"center"
prop=
"roleId"
/>
<el-table-column
label=
"角色名称"
align=
"center"
prop=
"roleName"
/>
<el-table-column
label=
"权限字符"
align=
"center"
prop=
"roleKey"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"pageNum"
:limit
.
sync=
"pageSize"
/>
<el-form
label-width=
"100px"
>
<el-form-item
style=
"text-align: center;margin-left:-120px;margin-top:30px;"
>
<el-button
type=
"primary"
@
click=
"submitForm()"
>
提交
</el-button>
<el-button
@
click=
"close()"
>
返回
</el-button>
</el-form-item>
</el-form>
</div>
</template>
<
script
>
import
{
getAuthRole
,
updateAuthRole
}
from
"@/api/system/user"
;
export
default
{
name
:
"AuthRole"
,
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 分页信息
total
:
0
,
pageNum
:
1
,
pageSize
:
10
,
// 选中角色编号
roleIds
:[],
// 角色信息
roles
:
[],
// 用户信息
form
:
{}
};
},
created
()
{
const
userId
=
this
.
$route
.
params
&&
this
.
$route
.
params
.
userId
;
if
(
userId
)
{
this
.
loading
=
true
;
getAuthRole
(
userId
).
then
((
response
)
=>
{
this
.
form
=
response
.
user
;
this
.
roles
=
response
.
roles
;
this
.
total
=
this
.
roles
.
length
;
this
.
$nextTick
(()
=>
{
this
.
roles
.
forEach
((
row
)
=>
{
if
(
row
.
flag
)
{
this
.
$refs
.
table
.
toggleRowSelection
(
row
);
}
});
});
this
.
loading
=
false
;
});
}
},
methods
:
{
/** 单击选中行数据 */
clickRow
(
row
)
{
this
.
$refs
.
table
.
toggleRowSelection
(
row
);
},
// 多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
roleIds
=
selection
.
map
((
item
)
=>
item
.
roleId
);
},
// 保存选中的数据编号
getRowKey
(
row
)
{
return
row
.
roleId
;
},
/** 提交按钮 */
submitForm
()
{
const
userId
=
this
.
form
.
userId
;
const
roleIds
=
this
.
roleIds
.
join
(
","
);
updateAuthRole
({
userId
:
userId
,
roleIds
:
roleIds
}).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"授权成功"
);
this
.
close
();
});
},
/** 关闭按钮 */
close
()
{
const
obj
=
{
path
:
"/system/user"
};
this
.
$tab
.
closeOpenPage
(
obj
);
},
},
};
</
script
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/views/system/user2/index.vue
deleted
100644 → 0
View file @
d7a61660
This diff is collapsed.
Click to expand it.
src/views/system/user2/profile/index.vue
deleted
100644 → 0
View file @
d7a61660
<
template
>
<div
class=
"app-container"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"6"
:xs=
"24"
>
<el-card
class=
"box-card"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
个人信息
</span>
</div>
<div>
<div
class=
"text-center"
>
<userAvatar
/>
</div>
<ul
class=
"list-group list-group-striped"
>
<li
class=
"list-group-item"
>
<svg-icon
icon-class=
"user"
/>
用户名称
<div
class=
"pull-right"
>
{{
user
.
userName
}}
</div>
</li>
<li
class=
"list-group-item"
>
<svg-icon
icon-class=
"phone"
/>
手机号码
<div
class=
"pull-right"
>
{{
user
.
phonenumber
}}
</div>
</li>
<li
class=
"list-group-item"
>
<svg-icon
icon-class=
"email"
/>
用户邮箱
<div
class=
"pull-right"
>
{{
user
.
email
}}
</div>
</li>
<li
class=
"list-group-item"
>
<svg-icon
icon-class=
"tree"
/>
所属部门
<div
class=
"pull-right"
v-if=
"user.dept"
>
{{
user
.
dept
.
deptName
}}
/
{{
postGroup
}}
</div>
</li>
<li
class=
"list-group-item"
>
<svg-icon
icon-class=
"peoples"
/>
所属角色
<div
class=
"pull-right"
>
{{
roleGroup
}}
</div>
</li>
<li
class=
"list-group-item"
>
<svg-icon
icon-class=
"date"
/>
创建日期
<div
class=
"pull-right"
>
{{
user
.
createTime
}}
</div>
</li>
</ul>
</div>
</el-card>
</el-col>
<el-col
:span=
"18"
:xs=
"24"
>
<el-card>
<div
slot=
"header"
class=
"clearfix"
>
<span>
基本资料
</span>
</div>
<el-tabs
v-model=
"activeTab"
>
<el-tab-pane
label=
"基本资料"
name=
"userinfo"
>
<userInfo
:user=
"user"
/>
</el-tab-pane>
<el-tab-pane
label=
"修改密码"
name=
"resetPwd"
>
<resetPwd
/>
</el-tab-pane>
</el-tabs>
</el-card>
</el-col>
</el-row>
</div>
</
template
>
<
script
>
import
userAvatar
from
"./userAvatar"
;
import
userInfo
from
"./userInfo"
;
import
resetPwd
from
"./resetPwd"
;
import
{
getUserProfile
}
from
"@/api/system/user"
;
export
default
{
name
:
"Profile"
,
components
:
{
userAvatar
,
userInfo
,
resetPwd
},
data
()
{
return
{
user
:
{},
roleGroup
:
{},
postGroup
:
{},
activeTab
:
"userinfo"
};
},
created
()
{
this
.
getUser
();
},
methods
:
{
getUser
()
{
getUserProfile
().
then
(
response
=>
{
this
.
user
=
response
.
data
;
this
.
roleGroup
=
response
.
roleGroup
;
this
.
postGroup
=
response
.
postGroup
;
});
}
}
};
</
script
>
This diff is collapsed.
Click to expand it.
src/views/system/user2/profile/resetPwd.vue
deleted
100644 → 0
View file @
d7a61660
<
template
>
<el-form
ref=
"form"
:model=
"user"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"旧密码"
prop=
"oldPassword"
>
<el-input
v-model=
"user.oldPassword"
placeholder=
"请输入旧密码"
type=
"password"
show-password
/>
</el-form-item>
<el-form-item
label=
"新密码"
prop=
"newPassword"
>
<el-input
v-model=
"user.newPassword"
placeholder=
"请输入新密码"
type=
"password"
show-password
/>
</el-form-item>
<el-form-item
label=
"确认密码"
prop=
"confirmPassword"
>
<el-input
v-model=
"user.confirmPassword"
placeholder=
"请确认新密码"
type=
"password"
show-password
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
size=
"mini"
@
click=
"submit"
>
保存
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"close"
>
关闭
</el-button>
</el-form-item>
</el-form>
</
template
>
<
script
>
import
{
updateUserPwd
}
from
"@/api/system/user"
;
export
default
{
data
()
{
const
equalToPassword
=
(
rule
,
value
,
callback
)
=>
{
if
(
this
.
user
.
newPassword
!==
value
)
{
callback
(
new
Error
(
"两次输入的密码不一致"
));
}
else
{
callback
();
}
};
return
{
user
:
{
oldPassword
:
undefined
,
newPassword
:
undefined
,
confirmPassword
:
undefined
},
// 表单校验
rules
:
{
oldPassword
:
[
{
required
:
true
,
message
:
"旧密码不能为空"
,
trigger
:
"blur"
}
],
newPassword
:
[
{
required
:
true
,
message
:
"新密码不能为空"
,
trigger
:
"blur"
},
{
min
:
6
,
max
:
20
,
message
:
"长度在 6 到 20 个字符"
,
trigger
:
"blur"
}
],
confirmPassword
:
[
{
required
:
true
,
message
:
"确认密码不能为空"
,
trigger
:
"blur"
},
{
required
:
true
,
validator
:
equalToPassword
,
trigger
:
"blur"
}
]
}
};
},
methods
:
{
submit
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
updateUserPwd
(
this
.
user
.
oldPassword
,
this
.
user
.
newPassword
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
});
}
});
},
close
()
{
this
.
$tab
.
closePage
();
}
}
};
</
script
>
This diff is collapsed.
Click to expand it.
src/views/system/user2/profile/userAvatar.vue
deleted
100644 → 0
View file @
d7a61660
<
template
>
<div>
<div
class=
"user-info-head"
@
click=
"editCropper()"
><img
v-bind:src=
"options.img"
title=
"点击上传头像"
class=
"img-circle img-lg"
/></div>
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"800px"
append-to-body
@
opened=
"modalOpened"
@
close=
"closeDialog"
>
<el-row>
<el-col
:xs=
"24"
:md=
"12"
:style=
"
{height: '350px'}">
<!--
<vue-cropper
ref=
"cropper"
:img=
"options.img"
:info=
"true"
:autoCrop=
"options.autoCrop"
:autoCropWidth=
"options.autoCropWidth"
:autoCropHeight=
"options.autoCropHeight"
:fixedBox=
"options.fixedBox"
:outputType=
"options.outputType"
@
realTime=
"realTime"
v-if=
"visible"
/>
-->
</el-col>
<el-col
:xs=
"24"
:md=
"12"
:style=
"
{height: '350px'}">
<div
class=
"avatar-upload-preview"
>
<img
:src=
"previews.url"
:style=
"previews.img"
/>
</div>
</el-col>
</el-row>
<br
/>
<el-row>
<el-col
:lg=
"2"
:sm=
"3"
:xs=
"3"
>
<el-upload
action=
"#"
:http-request=
"requestUpload"
:show-file-list=
"false"
:before-upload=
"beforeUpload"
>
<el-button
size=
"small"
>
选择
<i
class=
"el-icon-upload el-icon--right"
></i>
</el-button>
</el-upload>
</el-col>
<el-col
:lg=
"
{span: 1, offset: 2}" :sm="2" :xs="2">
<el-button
icon=
"el-icon-plus"
size=
"small"
@
click=
"changeScale(1)"
></el-button>
</el-col>
<el-col
:lg=
"
{span: 1, offset: 1}" :sm="2" :xs="2">
<el-button
icon=
"el-icon-minus"
size=
"small"
@
click=
"changeScale(-1)"
></el-button>
</el-col>
<el-col
:lg=
"
{span: 1, offset: 1}" :sm="2" :xs="2">
<el-button
icon=
"el-icon-refresh-left"
size=
"small"
@
click=
"rotateLeft()"
></el-button>
</el-col>
<el-col
:lg=
"
{span: 1, offset: 1}" :sm="2" :xs="2">
<el-button
icon=
"el-icon-refresh-right"
size=
"small"
@
click=
"rotateRight()"
></el-button>
</el-col>
<el-col
:lg=
"
{span: 2, offset: 6}" :sm="2" :xs="2">
<el-button
type=
"primary"
size=
"small"
@
click=
"uploadImg()"
>
提 交
</el-button>
</el-col>
</el-row>
</el-dialog>
</div>
</
template
>
<
script
>
import
store
from
"@/store"
;
// import { VueCropper } from "vue-cropper";
import
{
uploadAvatar
}
from
"@/api/system/user"
;
import
{
debounce
}
from
'@/utils'
export
default
{
// components: { VueCropper },
data
()
{
return
{
// 是否显示弹出层
open
:
false
,
// 是否显示cropper
visible
:
false
,
// 弹出层标题
title
:
"修改头像"
,
options
:
{
img
:
store
.
getters
.
avatar
,
//裁剪图片的地址
autoCrop
:
true
,
// 是否默认生成截图框
autoCropWidth
:
200
,
// 默认生成截图框宽度
autoCropHeight
:
200
,
// 默认生成截图框高度
fixedBox
:
true
,
// 固定截图框大小 不允许改变
outputType
:
"png"
,
// 默认生成截图为PNG格式
filename
:
'avatar'
// 文件名称
},
previews
:
{},
resizeHandler
:
null
};
},
methods
:
{
// 编辑头像
editCropper
()
{
this
.
open
=
true
;
},
// 打开弹出层结束时的回调
modalOpened
()
{
this
.
visible
=
true
;
if
(
!
this
.
resizeHandler
)
{
this
.
resizeHandler
=
debounce
(()
=>
{
this
.
refresh
()
},
100
)
}
window
.
addEventListener
(
"resize"
,
this
.
resizeHandler
)
},
// 刷新组件
refresh
()
{
this
.
$refs
.
cropper
.
refresh
();
},
// 覆盖默认的上传行为
requestUpload
()
{
},
// 向左旋转
rotateLeft
()
{
this
.
$refs
.
cropper
.
rotateLeft
();
},
// 向右旋转
rotateRight
()
{
this
.
$refs
.
cropper
.
rotateRight
();
},
// 图片缩放
changeScale
(
num
)
{
num
=
num
||
1
;
this
.
$refs
.
cropper
.
changeScale
(
num
);
},
// 上传预处理
beforeUpload
(
file
)
{
if
(
file
.
type
.
indexOf
(
"image/"
)
==
-
1
)
{
this
.
$modal
.
msgError
(
"文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件。"
);
}
else
{
const
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
()
=>
{
this
.
options
.
img
=
reader
.
result
;
this
.
options
.
filename
=
file
.
name
;
};
}
},
// 上传图片
uploadImg
()
{
this
.
$refs
.
cropper
.
getCropBlob
(
data
=>
{
let
formData
=
new
FormData
();
formData
.
append
(
"avatarfile"
,
data
,
this
.
options
.
filename
);
uploadAvatar
(
formData
).
then
(
response
=>
{
this
.
open
=
false
;
this
.
options
.
img
=
process
.
env
.
VUE_APP_BASE_API
+
response
.
imgUrl
;
store
.
commit
(
'SET_AVATAR'
,
this
.
options
.
img
);
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
visible
=
false
;
});
});
},
// 实时预览
realTime
(
data
)
{
this
.
previews
=
data
;
},
// 关闭窗口
closeDialog
()
{
this
.
options
.
img
=
store
.
getters
.
avatar
this
.
visible
=
false
;
window
.
removeEventListener
(
"resize"
,
this
.
resizeHandler
)
}
}
};
</
script
>
<
style
scoped
lang=
"scss"
>
.user-info-head
{
position
:
relative
;
display
:
inline-block
;
height
:
120px
;
}
.user-info-head
:hover:after
{
content
:
'+'
;
position
:
absolute
;
left
:
0
;
right
:
0
;
top
:
0
;
bottom
:
0
;
color
:
#eee
;
background
:
rgba
(
0
,
0
,
0
,
0
.5
);
font-size
:
24px
;
font-style
:
normal
;
-webkit-font-smoothing
:
antialiased
;
-moz-osx-font-smoothing
:
grayscale
;
cursor
:
pointer
;
line-height
:
110px
;
border-radius
:
50%
;
}
</
style
>
This diff is collapsed.
Click to expand it.
src/views/system/user2/profile/userInfo.vue
deleted
100644 → 0
View file @
d7a61660
<
template
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"用户昵称"
prop=
"nickName"
>
<el-input
v-model=
"form.nickName"
maxlength=
"30"
/>
</el-form-item>
<el-form-item
label=
"手机号码"
prop=
"phonenumber"
>
<el-input
v-model=
"form.phonenumber"
maxlength=
"11"
/>
</el-form-item>
<el-form-item
label=
"邮箱"
prop=
"email"
>
<el-input
v-model=
"form.email"
maxlength=
"50"
/>
</el-form-item>
<el-form-item
label=
"性别"
>
<el-radio-group
v-model=
"form.sex"
>
<el-radio
label=
"0"
>
男
</el-radio>
<el-radio
label=
"1"
>
女
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
size=
"mini"
@
click=
"submit"
>
保存
</el-button>
<el-button
type=
"danger"
size=
"mini"
@
click=
"close"
>
关闭
</el-button>
</el-form-item>
</el-form>
</
template
>
<
script
>
import
{
updateUserProfile
}
from
"@/api/system/user"
;
export
default
{
props
:
{
user
:
{
type
:
Object
}
},
data
()
{
return
{
form
:
{},
// 表单校验
rules
:
{
nickName
:
[
{
required
:
true
,
message
:
"用户昵称不能为空"
,
trigger
:
"blur"
}
],
email
:
[
{
required
:
true
,
message
:
"邮箱地址不能为空"
,
trigger
:
"blur"
},
{
type
:
"email"
,
message
:
"请输入正确的邮箱地址"
,
trigger
:
[
"blur"
,
"change"
]
}
],
phonenumber
:
[
{
required
:
true
,
message
:
"手机号码不能为空"
,
trigger
:
"blur"
},
{
pattern
:
/^1
[
3|4|5|6|7|8|9
][
0-9
]\d{8}
$/
,
message
:
"请输入正确的手机号码"
,
trigger
:
"blur"
}
]
}
};
},
watch
:
{
user
:
{
handler
(
user
)
{
if
(
user
)
{
this
.
form
=
{
nickName
:
user
.
nickName
,
phonenumber
:
user
.
phonenumber
,
email
:
user
.
email
,
sex
:
user
.
sex
};
}
},
immediate
:
true
}
},
methods
:
{
submit
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
updateUserProfile
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功"
);
this
.
user
.
phonenumber
=
this
.
form
.
phonenumber
;
this
.
user
.
email
=
this
.
form
.
email
;
});
}
});
},
close
()
{
this
.
$tab
.
closePage
();
}
}
};
</
script
>
This diff is collapsed.
Click to expand it.
vue.config.js
View file @
f1258b20
...
...
@@ -9,8 +9,8 @@ function resolve(dir) {
const
name
=
defaultSettings
.
title
||
'漏缆故障定位监测系统'
// page title
const
port
=
process
.
env
.
port
||
process
.
env
.
npm_config_port
||
8890
// dev port
// const href = 'http://101.126.159.207'
const
href
=
'http://127.0.0.1'
// const href = 'http://192.168.0.122
'
//
const href = 'http://127.0.0.1'
const
href
=
'http://192.168.0.113
'
...
...
This diff is collapsed.
Click to expand it.
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