Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
video-monitoring
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
刘怀志
video-monitoring
Commits
150078fc
Commit
150078fc
authored
Aug 05, 2024
by
罗林杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加重置密码功能
parent
8cf4c345
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
91 deletions
+17
-91
index.vue
src/views/employee/index.vue
+17
-91
No files found.
src/views/employee/index.vue
View file @
150078fc
...
@@ -100,7 +100,7 @@
...
@@ -100,7 +100,7 @@
</el-form>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"
2
"
>
<el-col
:span=
"
1.5
"
>
<el-button
<el-button
style=
"background-color: #0D8EEE; color: #F6F6FA"
style=
"background-color: #0D8EEE; color: #F6F6FA"
plain
plain
...
@@ -109,7 +109,7 @@
...
@@ -109,7 +109,7 @@
@
click=
"handleAdd"
@
click=
"handleAdd"
>
新增人员
</el-button>
>
新增人员
</el-button>
</el-col>
</el-col>
<el-col
:span=
"
2
"
>
<el-col
:span=
"
1.5
"
>
<el-button
<el-button
plain
plain
icon=
"el-icon-top-right"
icon=
"el-icon-top-right"
...
@@ -117,7 +117,7 @@
...
@@ -117,7 +117,7 @@
@
click=
"handleSelectAll"
@
click=
"handleSelectAll"
>
选择全部
</el-button>
>
选择全部
</el-button>
</el-col>
</el-col>
<el-col
:span=
"
2
"
>
<el-col
:span=
"
1.5
"
>
<el-button
<el-button
plain
plain
icon=
"el-icon-top-left"
icon=
"el-icon-top-left"
...
@@ -142,10 +142,10 @@
...
@@ -142,10 +142,10 @@
@
click=
"handleExport"
@
click=
"handleExport"
>
批量导出
</el-button>
>
批量导出
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1
4
"
class=
"text-right"
>
<el-col
:span=
"1
6
"
class=
"text-right"
>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
</el-col>
</el-col>
<el-col
:span=
"
2
"
class=
"text-right"
>
<el-col
:span=
"
1
"
class=
"text-right"
>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-col>
</el-col>
<!--
<!--
...
@@ -181,12 +181,12 @@
...
@@ -181,12 +181,12 @@
class-name=
"small-padding fixed-width"
class-name=
"small-padding fixed-width"
>
>
<
template
slot-scope=
"scope"
v-if=
"scope.row.userId !== 1"
>
<
template
slot-scope=
"scope"
v-if=
"scope.row.userId !== 1"
>
<!-- 查看-->
<el-button
<!--
<el-button
size=
"medium"
size=
"mini"
style=
"border: transparent"
style=
"border: transparent"
icon=
"el-icon-view"
icon=
"el-icon-refresh"
></el-button>
-->
@
click=
"handleResetPwd(scope.row)"
></el-button>
<el-button
<el-button
size=
"medium"
size=
"medium"
style=
"border: transparent"
style=
"border: transparent"
...
@@ -199,15 +199,6 @@
...
@@ -199,15 +199,6 @@
icon=
"el-icon-delete"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
@
click=
"handleDelete(scope.row)"
></el-button>
></el-button>
<!--
<el-dropdown
size=
"mini"
@
command=
"(command) => handleCommand(command, scope.row)"
v-hasPermi=
"['system:user:resetPwd', 'system:user:edit']"
>
-->
<!--
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-d-arrow-right"
>
更多
</el-button>
-->
<!--
<el-dropdown-menu
slot=
"dropdown"
>
-->
<!--
<el-dropdown-item
command=
"handleResetPwd"
icon=
"el-icon-key"
--
>
<!-- v-hasPermi="['system:user:resetPwd']">重置密码
</el-dropdown-item>
-->
<!--
<el-dropdown-item
command=
"handleAuthRole"
icon=
"el-icon-circle-check"
--
>
<!-- v-hasPermi="['system:user:edit']">分配角色
</el-dropdown-item>
-->
<!--
</el-dropdown-menu>
-->
<!--
</el-dropdown>
-->
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -272,65 +263,6 @@
...
@@ -272,65 +263,6 @@
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
<!-- <el-row>
<el-col :span="12">
<el-form-item label="用户性别">
<el-select v-model="form.sex" placeholder="请选择性别">
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-col>-->
<!-- </el-row>
<el-row>
<el-col :span="12">
<el-form-item label="岗位">
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
<el-option
v-for="item in postOptions"
:key="item.postId"
:label="item.postName"
:value="item.postId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
:disabled="item.status == 1"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>-->
<!-- <el-row>
<el-col :span="12">
<el-form-item label="创建账号">
<el-input v-model="form.createBy" maxlength="11" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间" >
<el-date-picker
v-model="form.createTime"
type="datetime"
placeholder="选择日期和时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>-->
<el-row>
<el-row>
<el-col
:span=
"24"
>
<el-col
:span=
"24"
>
<el-form-item
label=
"备注"
>
<el-form-item
label=
"备注"
>
...
@@ -357,11 +289,11 @@
...
@@ -357,11 +289,11 @@
<el-input
v-model=
"form.userName"
placeholder=
"请输入用户名称"
maxlength=
"10px"
/>
<el-input
v-model=
"form.userName"
placeholder=
"请输入用户名称"
maxlength=
"10px"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"12"
>
<!--
<el-col :span="12">
<el-form-item label="用户密码" prop="password">
<el-form-item label="用户密码" prop="password">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
-->
</el-row>
</el-row>
<el-row>
<el-row>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
...
@@ -809,20 +741,14 @@ export default {
...
@@ -809,20 +741,14 @@ export default {
},
},
/** 重置密码按钮操作 */
/** 重置密码按钮操作 */
handleResetPwd
(
row
)
{
handleResetPwd
(
row
)
{
this
.
$
prompt
(
'请输入"'
+
row
.
userName
+
'"的新密码
'
,
"提示"
,
{
this
.
$
confirm
(
'是否重置"'
+
row
.
nickName
+
'"密码为123456
'
,
"提示"
,
{
confirmButtonText
:
"确定"
,
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
cancelButtonText
:
"取消"
,
closeOnClickModal
:
false
,
closeOnClickModal
:
false
,
inputPattern
:
/^.
{5,20}
$/
,
}).
then
(({})
=>
{
inputErrorMessage
:
"用户密码长度必须介于 5 和 20 之间"
,
const
newPassword
=
"123456"
;
inputValidator
:
(
value
)
=>
{
resetUserPwd
(
row
.
userId
,
newPassword
).
then
(
response
=>
{
if
(
/<|>|"|'|
\|
|
\\
/
.
test
(
value
))
{
this
.
$modal
.
msgSuccess
(
"成功将"
+
row
.
nickName
+
"的密码重置为:"
+
newPassword
);
return
"不能包含非法字符:< >
\"
'
\\\
|"
}
},
}).
then
(({
value
})
=>
{
resetUserPwd
(
row
.
userId
,
value
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"修改成功,新密码是:"
+
value
);
});
});
}).
catch
(()
=>
{});
}).
catch
(()
=>
{});
},
},
...
...
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